This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis-cli KEYS "prefix:*" | xargs redis-cli DEL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Base64 encode / decode | |
* http://www.webtoolkit.info/ | |
* | |
**/ | |
var Base64 = { | |
// private property |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE cloned LIKE the_table_to_drop; | |
RENAME TABLE the_table_to_drop TO drop_me, cloned TO the_table_to_drop; | |
DROP TABLE drop_me; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 把中文转换成拼音数组后,如果有多音字,枚举所有可能的组合 | |
* 示例: | |
* [ [ 'a' ], | |
* [ 'b', 'c', 'd' ], | |
* [ 'e', 'f' ], | |
* [ 'g' ] ] | |
* 使用getResult方法将会返回: | |
* ["abeg", "abfg", "aceg", "acfg", "adeg", "adfg"] | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch -f --commit-filter ' | |
if [ "$GIT_COMMITTER_NAME" = "yehao" ]; | |
then | |
GIT_COMMITTER_NAME="Lingzheng"; | |
GIT_AUTHOR_NAME="Lingzheng"; | |
GIT_COMMITTER_EMAIL="[email protected]"; | |
GIT_AUTHOR_EMAIL="[email protected]"; | |
git commit-tree "$@"; | |
else | |
git commit-tree "$@"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function openWindow($url:String, $window:String = "_blank"):void { | |
var req:URLRequest = new URLRequest($url); | |
if (!ExternalInterface.available) { | |
navigateToURL(req, $window); | |
} else { | |
try { | |
var strUserAgent:String = String(ExternalInterface.call("function() {return navigator.userAgent;}")).toLowerCase(); | |
if (strUserAgent.indexOf("firefox") != -1 || (strUserAgent.indexOf("msie") != -1 && uint(strUserAgent.substr(strUserAgent.indexOf("msie") + 5, 3)) >= 7)) { | |
ExternalInterface.call("function(url, target){window.open(url, target);return;}", req.url, $window); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tar -xvzf community_images.tar.gz | |
To explain a little further, tar collected all the files into one package, community_images.tar. The gzip program applied compression, hence the gz extension. So the command does a couple things. | |
f: this must be the last flag of the command, and the tar file must be immediately after. It tells tar the name and path of the compressed file. | |
z: tells tar to decompress the archive using gzip | |
x: tar can collect files or extract them. x does the latter. | |
v: makes tar talk a lot. Verbose output shows you all the files being extracted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mxmlc ./YOUR_MAIN_CLASS.as -l ./YOUR_MAIN_SWC.swc -static-link-runtime-shared-libraries=true -managers=flash.fonts.AFEFontManager -default-size=550,400 -debug=false -o OUTPUT_FILE_NAME.swf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flexEmbedCharUnicode(charCode) { | |
var leadingZeros = ''; | |
for (var i = 0; i < 4 - charCode.length; i++) { | |
leadingZeros += '0'; | |
} | |
return 'U+' + leadingZeros + charCode; | |
} | |
function flexEmbedUnicodeRanges(string) { | |
var unicodeRange = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Utils | |
function trace() { | |
$.writeln.apply($, arguments); | |
} | |
// Construct the dialog layout | |
var layoutInfo = "dialog{\ | |
text: 'Save for Web in JPEG',\ | |
info: Panel {\ | |
orientation: 'column',\ |
OlderNewer