Skip to content

Instantly share code, notes, and snippets.

😂
Learning

Justin Chen interjc

😂
Learning
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:527683
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@micmcg
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

@DevinClark
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": "source.java"
}
@devinrhode2
devinrhode2 / clean-scrollbar.css
Created May 2, 2012
Like, basically PERFECT scrollbars
View clean-scrollbar.css
/**
* 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.
View gist:2848464
@zoghal
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
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
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:
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
@ricardozea
ricardozea / ie67891011-css-hacks.txt
Last active Sep 21, 2019
IE CSS hacks - IE6, 7, 8, 9, 10, 11
View ie67891011-css-hacks.txt
IE6 Only
==================
_selector {...}
IE6 & IE7
==================
*html or { _property: }
IE7 Only
==================
@messense
messense / shadowsocks-on-openwrt.md
Last active Jul 17, 2019
shadowsocks on openwrt
View shadowsocks-on-openwrt.md

配置 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.