Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View interjc's full-sized avatar
😂
Learning

Justin Chen interjc

😂
Learning
View GitHub Profile
@zoghal
zoghal / localization_helper.js
Created July 24, 2012 19:23 — forked from davidwkeith/localization_helper.js
Localization Helper for Ember.js's Handlebars
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
sofish / type-day.js
Created October 10, 2012 12:25
detect date type
// 仅支持 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];
@DevinClark
DevinClark / JavaCandR.sublime-build
Created January 18, 2012 16:18
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
{
"cmd": ["javac", "$file_name"],
"cmd": ["java", "$file_base_name"],
"working_dir": "${project_path:${folder}}",
"selector": "source.java"
}
@leandropincini
leandropincini / gist:4384452
Last active April 14, 2020 16:29
How to install Apache Tomcat on Mac OSX Montain Lion 10.8.2
Download and unzip the tar.gz:
http://tomcat.apache.org/download-70.cgi
install:
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
@asika32764
asika32764 / mysql.sock.sh
Last active January 28, 2021 21:23
Using this command to create a symbol link to mysql.sock in Mac
# XAMPP
sudo ln -s /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock /var/mysql/mysql.sock
# MAMP
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
# AMPPS
sudo ln -s /Applications/AMPPS/mysql/tmp/mysql.sock /var/mysql/mysql.sock
@yanknudtskov
yanknudtskov / allow-unfiltered-admin-uploads.php
Created April 21, 2014 18:10
Allowing Unfiltered WordPress Uploads for Administrators With ALLOW_UNFILTERED_UPLOADS
define( 'ALLOW_UNFILTERED_UPLOADS', true );
@ricardozea
ricardozea / ie67891011-css-hacks.txt
Last active February 2, 2023 15:17
IE CSS hacks - IE6, 7, 8, 9, 10, 11
IE6 Only
==================
_selector {...}
IE6 & IE7
==================
*html or { _property: }
IE7 Only
==================
@indieisaconcept
indieisaconcept / gist:936dbf33cfc844d87968
Last active February 2, 2023 19:58
browserify + watchify + viny-transform + multiple bundles
// 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
@devinrhode2
devinrhode2 / clean-scrollbar.css
Created May 2, 2012 03:42
Like, basically PERFECT scrollbars
/**
* Like, basically PERFECT scrollbars
*/
/*
It's pure CSS.
Since a quick google search will confirm people going crazy about Mac OS Lion scrollbars...
this has no fade-out effect.
In Mac OS Lion, the lowest common denominator is always showing scrollbars by a setting.
@messense
messense / shadowsocks-on-openwrt.md
Last active June 8, 2023 07:49
shadowsocks on openwrt

配置 shadowsocks

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

/etc/init.d/shadowsocks start

配置 privoxy

安装 privoxy openwrt 版。