Skip to content

Instantly share code, notes, and snippets.

View zzzhc's full-sized avatar

Cheng Huang zzzhc

View GitHub Profile

The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages such as CoffeeScript, Sass and ERB.

javascripts/stylesheets/images moved to app/assets

configuration

in config/application.rb, add:

@zzzhc
zzzhc / prototype.js
Created December 17, 2012 05:48
javascript prototype chain demonstration
var Creature = function() {};
Creature.prototype = {
f1 : function() {
console.log("f1 in creature");
}
};
var Animal = function() {};
Animal.prototype = new Creature;

FS

  • fhs

    / : Root directory

    /bin : Essential user command binaries (for use by all users)

    /sbin : Essential system binaries

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@zzzhc
zzzhc / air_ssd.md
Created April 29, 2013 08:59
save macbook air disk space by disable swap and sleepimage

disable swap

$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
$ sudo rm /private/var/vm/swapfile*

disable sleepimage

#!/bin/bash
##############################
# dnspodsh v0.3
# 基于dnspod api构架的bash ddns客户端
# 作者:zrong(zengrong.net)
# 详细介绍:http://zengrong.net/post/1524.htm
# 创建日期:2012-02-13
# 更新日期:2012-03-11
##############################
A backup of http://sites.google.com/site/redcodenl/creating-shazam-in-java-1 just in case
Why is this necessary? Read http://sites.google.com/site/redcodenl/patent-infringement
Please fork, tweet about, etc.
----
Creating Shazam in Java
A couple of days ago I encountered this article: How Shazam Works
This got me interested in how a program like Shazam works… And more importantly, how hard is it to program something similar in Java?
@zzzhc
zzzhc / graphite.md
Last active August 29, 2015 14:10 — forked from relaxdiego/graphite.md

Follow these steps to install graphite on OS X Mavericks.

Prerequisites

  • Homebrew
  • Python 2.7
  • Git

Install dependencies

Install Cairo and friends

#
# https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
# based on the RSnake original http://ha.ckers.org/xss.html
# Retrieved on 2013-11-20
# Much of this wildly obsolete
#
# XSS Locator 2
'';!--"<XSS>=&{()}
@zzzhc
zzzhc / gist:f30383dc3462026a5631
Created November 23, 2015 10:49 — forked from rc1/gist:69b2c49d0efaebeafd08
Building node.js for Raspberry Pi 2 (with Armv7 and Neon support)
export CC='gcc -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon'
export CXX='g++ -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon'
./configure --without-snapshot
make -j4
sudo make install