Skip to content

Instantly share code, notes, and snippets.

View gtdeng's full-sized avatar
🍵
Focusing

GT Deng gtdeng

🍵
Focusing
View GitHub Profile
List()
var list = Immutable.List([1,2,3])
// [1, 2, 3]
List.isList()
Immutable.List.isList(list)
// true
List.of()
var list = Immutable.List.of(1,2,3);
@gtdeng
gtdeng / NamedFunction.sublime-snippet
Created October 15, 2015 16:49
Named Function Expression
<snippet>
<content>
<![CDATA[
var ${1:methodName} = function ${1:methodName}(${2:arguments}) {
${3}
};
]]>
</content>
<tabTrigger>fn</tabTrigger>
<scope>source.js</scope>
@gtdeng
gtdeng / mysql2sqlite.sh
Created October 9, 2015 03:20 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@gtdeng
gtdeng / uri.js
Last active August 29, 2015 14:27 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@gtdeng
gtdeng / _.md
Created August 10, 2015 18:33
Tributary inlet