Skip to content

Instantly share code, notes, and snippets.


Justin Chen interjc

Block or report user

Report or block interjc

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 gist:2848464
zoghal / localization_helper.js
Created Jul 24, 2012 — forked from davidwkeith/localization_helper.js
Localization Helper for Ember.js's Handlebars
View localization_helper.js
Handlebars.registerHelper('loc', function(property, fn) {
var str;
// we are bound to a value, it is now the context
if (fn.contexts && typeof fn.contexts[0] === 'string') {
str = fn.contexts[0];
// Convention, start all localization keys with _
} else if (property[0] === '_') {
str = property;
sofish / type-day.js
Created Oct 10, 2012
detect date type
View type-day.js
// 仅支持 8 种类型的 day
// 20120409 | 2012-04-09 | 2012/04/09 | 2012.04.09 | 以上各种无 0 的状况
var isDate = function (text) {
var reg = /^([1-2]\d{3})([-/.])?(1[0-2]|0?[1-9])([-/.])?([1-2]\d|3[01]|0?[1-9])$/
, taste, validDate, yyyy, mm, dd;
if (!reg.test(text)) return false;
taste = reg.exec(text);
year = taste[1], month = taste[3], day = taste[5];
leandropincini / gist:4384452
Last active May 11, 2016
How to install Apache Tomcat on Mac OSX Montain Lion 10.8.2
View gist:4384452
Download and unzip the tar.gz:
sudo mkdir /usr/local
sudo mv ~/Downloads/apache-tomcat-7.0.* /usr/local
sudo ln -s /usr/local/apache-tomcat-7.0.* /Library/Tomcat
sudo chown -R <your OSX username> /Library/Tomcat
sudo chmod +x /Library/Tomcat/apache-tomcat-7.0.*/bin/*.sh
DevinClark / JavaCandR.sublime-build
Created Jan 18, 2012
This is a build script for Sublime Text 2 that will compile and run the open java file by simply pressing cmd + B. I am very new at Java so feel free to point out problems with this script. You can just drop this file in the User Packges folder and restar
View JavaCandR.sublime-build
"cmd": ["javac", "$file_name"],
"cmd": ["java", "$file_base_name"],
"working_dir": "${project_path:${folder}}",
"selector": ""
indieisaconcept / gist:936dbf33cfc844d87968
Last active Mar 25, 2017
browserify + watchify + viny-transform + multiple bundles
View gist:936dbf33cfc844d87968
// this setup assumes you are using gulp-config for file.src & file.dest
// but can be adapted to vanilla easily.
'use strict';
var transform = require('vinyl-transform'),
browserify = require('browserify'),
watchify = require('watchify'),
// consider using gulp-load-plugins
asika32764 /
Last active Jun 1, 2018
Using this command to create a symbol link to mysql.sock in Mac
sudo ln -s /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock /var/mysql/mysql.sock
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
sudo ln -s /Applications/AMPPS/mysql/tmp/mysql.sock /var/mysql/mysql.sock
alyssaq / gulpfile.js
Last active Mar 1, 2019
browserify, babel, gulp, glob, vinyl-source-stream, uglify
View gulpfile.js
npm install gulp gulp-load-plugins gulp-uglify
npm install browserify babelify glob vinyl-source-stream vinyl-buffer
More examples:
var gulp = require('gulp')
var $ = require('gulp-load-plugins')()
var browserify = require('browserify')
micmcg / gist:976172
Created May 17, 2011
Markdown cheat sheet
View gist:976172

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

messense /
Last active Jul 17, 2019
shadowsocks on openwrt

配置 shadowsocks

架设好 shadowsocks 服务端,在路由器上安装 shadowsocks 客户端,并配置 /etc/config/shadowsocks.json ,假设本地监听端口为 1080 。启动 shadowsocks

/etc/init.d/shadowsocks start

配置 privoxy

安装 privoxy openwrt 版。

You can’t perform that action at this time.