Skip to content

Instantly share code, notes, and snippets.

@IskenHuang
IskenHuang / uglify.js
Last active December 22, 2015 08:49
make html scripts merge to one uglify script
var fs = require('fs'),
sys = require('sys'),
exec = require('child_process').exec,
staticFolder = 'static',
jsFolder = 'js',
jsRoot = __dirname + '/' + jsFolder + '/',
htmlRoot = __dirname+ '/../application/views',
suffix = '.min',
@IskenHuang
IskenHuang / img.js
Last active December 22, 2015 06:59
/**
* This is simple transfer image to data uri(base64 encode) nodejs command line tool
*
* require
* install nodejs v0.8+
*
* how to use
* node img YOUR_IMAGE_FILE_PATH
*
* sample

Google Chrome

Windows

  • Go to: %localappdata%\google\chrome\user data\default\Local Storage

Mac OS X

  • Go to: Application Support -> Google -> Chrome -> Default -> Local Storage

Linux

  • Open Places -> Home Folder

Advanced Rest Client with OAuth2orize

For this to work you will need to install the Advanced Rest Client for some of these steps. Of course you will need to install OAuth2orize as well.

Run the oauth2orize provider/server example which does server-side OAuth flow:

cd oauth2orize\examples\express2
node app.js
.border-radius( @radius: 3px ) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
.outline-radius( @radius: 3px ) {
-webkit-outline-radius: @radius;
-moz-outline-radius: @radius;
outline-radius: @radius;
var keycode = {
'backspace' : '8',
'tab' : '9',
'enter' : '13',
'shift' : '16',
'ctrl' : '17',
'alt' : '18',
'pause_break' : '19',
'caps_lock' : '20',
'escape' : '27',
@IskenHuang
IskenHuang / sublime.md
Created June 17, 2013 15:22
launch sublime from terminal
@IskenHuang
IskenHuang / app.js
Last active December 15, 2015 15:38
Quick launch an web server base on expressjsupdate add support CORS
/**
* Tutorial
*
* Step1. install nodejs & npm (download: http://nodejs.org/download/)
*
* Step2. install express (http://expressjs.com/)
* $ sudo npm install express -g
*
* Step3. $ node app
@IskenHuang
IskenHuang / google login from curl
Created January 8, 2013 15:20
Google oauth login from curl
/*
* Step 1. get access token using curl
* https://developers.google.com/gdata/articles/using_cURL
*
* service name list
* https://developers.google.com/gdata/faq#clientlogin
*
*/
curl https://www.google.com/accounts/ClientLogin \
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="YOUR_PAYPAL_ACCOUNT">
<!-- code -->
<input type="hidden" name="charset" value="utf-8">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">