Skip to content

Instantly share code, notes, and snippets.

View nguyenbathanh's full-sized avatar

Thanh Nguyen nguyenbathanh

View GitHub Profile
@nguyenbathanh
nguyenbathanh / install.sh
Last active January 10, 2017 08:58
Install Nodejs, LAMP, Composer
#!/bin/sh
# update
sudo apt-get update
# curl
sudo apt-get install -y curl
# openssh
sudo apt-get install -y openssh-server
@nguyenbathanh
nguyenbathanh / Preferences.sublime-settings
Last active April 24, 2017 02:36
My sublime settings
{
"theme": "Autumn.sublime-theme",
"drag_text": false,
"folder_exclude_patterns": [
".svn",
".git",
".hg",
"CVS",
"node_modules"
],
@danswick
danswick / README.md
Last active November 2, 2017 04:01
Update a popup's content in Mapbox.js

Use setPopupContent() to update a popup periodically.

@nguyenbathanh
nguyenbathanh / config
Last active January 3, 2018 14:51
My sublime settings
{
// "auto_complete_cycle": true,
"caret_extra_bottom": 1,
"caret_extra_top": 2,
"caret_extra_width": 1,
"caret_style": "blink",
"drag_text": false,
"draw_white_space": "none",
// "ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
@nguyenbathanh
nguyenbathanh / gist:8b658031c519f76859e13db893c3fab2
Last active January 3, 2018 14:55
Opening Sublime Text on command line as subl on Mac OS? (one line command)
sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/
@homanp
homanp / gist:4e49daedddabfa5b8321
Last active February 13, 2018 23:51
Nginx Html5Mode for ReactJS
server {
listen 80;
server_name react.dev;
root /app/react-demo;
location / {
include /etc/nginx/mime.types;
try_files $uri $uri/ /index.html;
}
}
@gati
gati / encoder.py
Created September 7, 2014 00:46
Mongoengine JSON encoder
import json
from collections import Iterable
from bson import ObjectId
from datetime import datetime
class MongoengineEncoder(json.JSONEncoder):
"""
The default JSON encoder that ships with Mongoengine (the to_json method
exposed on Document instances) makes some odd choices. Datetime objects
are nested on a $date property, ObjectIds are nested on an $oid property,
@timaschew
timaschew / linklist.md
Last active October 18, 2018 04:14
React CSS Transitions - codepen.io examples
@danharper
danharper / 1-sleep-es7.js
Created February 8, 2015 16:55
ES7's async/await syntax.
// ES7, async/await
function sleep(ms = 0) {
return new Promise(r => setTimeout(r, ms));
}
(async () => {
console.log('a');
await sleep(1000);
console.log('b');
})()
@lsauer
lsauer / gist:2838503
Created May 30, 2012 19:43
comprehensive list of MIME types / subtypes as a tab-separated flatfile
//lsauer.com 2012
//description: comprehensive list of MIME types / subtypes as a tab-separated flatfile
//source: W3C
extension mime
.3dm x-world/x-3dmf
.3dmf x-world/x-3dmf
.a application/octet-stream
.aab application/x-authorware-bin
.aam application/x-authorware-map