Skip to content

Instantly share code, notes, and snippets.

View zzzhc's full-sized avatar

Cheng Huang zzzhc

View GitHub Profile
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?
#!/bin/bash
##############################
# dnspodsh v0.3
# 基于dnspod api构架的bash ddns客户端
# 作者:zrong(zengrong.net)
# 详细介绍:http://zengrong.net/post/1524.htm
# 创建日期:2012-02-13
# 更新日期:2012-03-11
##############################
@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

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

FS

  • fhs

    / : Root directory

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

    /sbin : Essential system binaries

@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;

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: