Skip to content

Instantly share code, notes, and snippets.

View lizhengnacl's full-sized avatar
:octocat:

李正 lizhengnacl

:octocat:
  • Meituan
  • Beijing
View GitHub Profile
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
@dbodyas
dbodyas / decimal.js
Created February 12, 2012 15:30
JavaScript Get Unicode char as decimal
/*
Sometimes, unicode symbols that have to be inserted in an HTML page should be escaped.
For example, everybody know, that’s “&” should be escaped as “&”, ” ” as “ ” and so on.
But what, if you should insert symbol, that you never used before. So you don’t know how it should be present or escaped.
Code below, helps you to get valid decimal unicode for appropriate symbol.
*/
function getCharAsDecimalUTF8(char){
var getUTF8 = escape(char);
console.log("&#" + parseInt(getUTF8.substring(getUTF8.match(/\%u/) !== null ? 2 : 1), 16) + ";");
}
@artero
artero / launch_sublime_from_terminal.markdown
Last active January 25, 2024 16:57 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation