Skip to content

Instantly share code, notes, and snippets.

View phongkt-dev's full-sized avatar
🚵‍♂️

phongkt-dev phongkt-dev

🚵‍♂️
View GitHub Profile
@phongkt-dev
phongkt-dev / change-codec.md
Created March 27, 2025 15:10 — forked from dvf/change-codec.md
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

let transaction
try {
// Unmanaged Transaction
transaction = await sequelize.transaction()
// make sure to use the transaction in options
await MyModel.create({ key: "some-value" }, { transaction })
// always call commit at the end
var express = require('express')
var parseurl = require('parseurl')
var session = require('express-session')
var RedisStore = require('connect-redis')(session);
var app = express()
app.use(session({
store: new RedisStore(options),
secret: 'keyboard cat',
resave: false
var express = require('express')
var parseurl = require('parseurl')
var session = require('express-session')
var app = express()
const mongoose = require('mongoose');
// Basic usage
mongoose.connect(connectionOptions);
var express = require('express')
var parseurl = require('parseurl')
var session = require('express-session')
var app = express()
app.use(session({
secret: 'keyboard cat',
resave: false,
saveUninitialized: true
@phongkt-dev
phongkt-dev / aws_ec2_root.md
Created August 18, 2017 11:00 — forked from tracend/aws_ec2_root.md
AWS EC2: Steps to enable root access with your local key - Inspired by: https://forums.aws.amazon.com/thread.jspa?threadID=86876

Note: replace {{server}} with your domain or ip

  • Login as the ec2-user
ssh -i key.pem ec2-user@{{server}}
  • Switch to administrator
sudo -i
@phongkt-dev
phongkt-dev / visor-archivos-online.md
Created June 19, 2017 12:26 — forked from izazueta/visor-archivos-online.md
Google Docs Viewer & Office Web Apps Viewer

Google Docs Viewer

Only files under 25 MB can be previewed with the Google Drive viewer.

Google Drive viewer helps you preview over 16 different file types, listed below:

  • Image files (.JPEG, .PNG, .GIF, .TIFF, .BMP)
  • Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV)
  • Text files (.TXT)
  • Markup/Code (.CSS, .HTML, .PHP, .C, .CPP, .H, .HPP, .JS)
  • Microsoft Word (.DOC and .DOCX)
@phongkt-dev
phongkt-dev / permissions-directive.js
Created May 20, 2017 12:55 — forked from d-levin/permissions-directive.js
Simple permissions directive for Vue.js
const args = {
SOME: 'some',
EVERY: 'every'
}
const permissions = [
'create',
'view',
'update',
'delete'