Skip to content

Instantly share code, notes, and snippets.

🍵
Focusing

GT Deng gtdeng

🍵
Focusing
Block or report user

Report or block gtdeng

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ImmutableJS_examples_for_humans.js
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);
View NamedFunction.sublime-snippet
<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 Oct 9, 2015 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
View mysql2sqlite.sh
#!/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 Aug 29, 2015 — forked from jlong/uri.js
URI Parsing with Javascript
View uri.js
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 Aug 10, 2015
Tributary inlet
View _.md
You can’t perform that action at this time.