Skip to content

Instantly share code, notes, and snippets.

@nhannguyen95
nhannguyen95 / restart_bluetooth.sh
Created July 6, 2019 01:57 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@nhannguyen95
nhannguyen95 / docker-i-t-trivia.md
Created January 22, 2019 06:01 — forked from v0lkan/docker-i-t-trivia.md
docker run -i -t
docker run -i -t --name nodejs ubuntu:latest /bin/bash

So here, -i stands for interactive mode and -t will allocate a pseudo terminal for us.

Some more trivia about these flags.

@nhannguyen95
nhannguyen95 / iterm2-oh-my-fish.md
Last active January 20, 2019 00:16 — forked from normanlolx/iterm2-oh-my-fish.md
iTerm2 Solarized Dark theme + Fish shell + oh-my-fish /// macOS High Sierra
@nhannguyen95
nhannguyen95 / The Technical Interview Cheat Sheet.md
Created September 9, 2018 09:30 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@nhannguyen95
nhannguyen95 / IndexedDB101.js
Created September 9, 2018 02:59 — forked from JamesMessinger/IndexedDB101.js
Very Simple IndexedDB Example
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"});
@nhannguyen95
nhannguyen95 / test_runner.py
Last active August 2, 2018 10:25
Use file storage on the local filesystem in Django unit tests, worked with Django >= 1.9
import shutil
import tempfile
from django.conf import settings
from django.core.files.storage import FileSystemStorage
from django.db.models import FileField
from django.apps.apps import get_model, get_models
from django.test.runner import DiscoverRunner