This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function retry(isDone, next) { | |
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false; | |
var id = window.setInterval( | |
function() { | |
if (isDone()) { | |
window.clearInterval(id); | |
next(is_timeout); | |
} | |
if (current_trial++ > max_retry) { | |
window.clearInterval(id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 1. The class name must match the filename (i.e., "foo.php" for JSON_API_Foo_Controller) | |
// 2. Save this in your themes folder | |
// 3. Activate your controller under Settings > JSON API | |
class JSON_API_Example_Controller { | |
public function get_posts_by_meta_query() { | |
global $json_api; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function graph(data, w, h, color) { | |
var canvas = document.createElement('canvas'); | |
var max = 0; | |
// normalize | |
var len = data.length, i; | |
for(i = 0; i < len; ++i) { | |
max = Math.max(data[i], max); | |
} | |
for(i = 0; i < len; ++i) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
#clone the repo | |
git clone -q "${1}" "clones/${2}" | |
cd "clones/${2}" | |
#update the submodules (how do we handle errors here?) | |
git submodule --quiet update --init --recursive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script that checks GitHub's status API before continuing. If GitHub does not return "good" then | |
# you will be prompted whether you want to continue. | |
# | |
# Information messages are echoed to stderr so it is still possible to pipe the results of stdout to | |
# a file. | |
# | |
# Example Usage: | |
# $ if-github-up make clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |