This file contains hidden or 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
var fs = require('fs'), | |
sys = require('sys'), | |
http = require('http'); | |
http.createServer(function (req, res) { | |
checkBalanceFile(req, res); | |
}).listen(8000); | |
function checkBalanceFile(req, res) { | |
fs.stat("balance", function(err) { |
This file contains hidden or 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
/* MultiFile - A JavaScript library to load multiple files from | |
tar archives and json_packed files (see http://gist.github.com/407595) | |
Example: Loading multiple images from a tarball. | |
MultiFile.load('images.tar', function(xhr) { | |
this.files.forEach(function(f) { | |
var e = document.createElement('div'); | |
document.body.appendChild(e); | |
var p = document.createElement('p'); |
This file contains hidden or 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
// | |
// !!WARNING: Not recommended for production code!! | |
// | |
public class ClassLoaderActivity extends Activity | |
{ | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
// file.jar has a dex'd "classes.dex" entry that you can generate with "dx" from any number of JARs or class files | |
ClassLoader dexLoader = new DexClassLoader("/path/to/file.jar", getCacheDir().getAbsolutePath(), null, getClassLoader()); | |
setAPKClassLoader(dexLoader); |
This file contains hidden or 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
URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash" | |
PROFILE="$HOME/.profile" | |
echo "Downloading git-completion..." | |
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then | |
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1 | |
fi |
This file contains hidden or 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 node | |
var fs = require('fs'); | |
var sys = require('sys'); | |
var bin = require('binary'); | |
function bytesize(n) { | |
// JavaScript can't handle 64-bit ints natively. | |
// TODO: hack it up anyway. | |
// (n & 0xFFFFFFFF00000000) ? 8 : ... |
This file contains hidden or 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
/*! | |
* isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill | |
* Copyright (c) 2011 Addy Osmani | |
* Dual licensed under the MIT and GPL licenses. | |
*/ | |
(function () { | |
window.visibly = { | |
b: null, | |
q: document, |
This file contains hidden or 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
require 'rubygems' | |
require 'json' | |
require 'rest_client' | |
coupons = 'JSON RESULT FROM CURL ABOVE' | |
table = JSON.parse(coupons) | |
table["rows"].each do |i| | |
puts i["value"]["_id"] |
This file contains hidden or 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
#include <stdio.h> | |
#include <math.h> | |
long long n; | |
char beat(char c) { | |
if( c == 'R' ) return 'P'; | |
if( c == 'P' ) return 'S'; | |
return 'R'; | |
} |
This file contains hidden or 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
/*! | |
* isVis - v0.5.6 Sep 2012 - Page Visibility API Polyfill | |
* Copyright (c) 2011 Addy Osmani | |
* Dual licensed under the MIT and GPL licenses. | |
*/ | |
/* | |
* Firefox support added based on https://developer.mozilla.org/en-US/docs/DOM/Using_the_Page_Visibility_API | |
* @juanmhidalgo | |
*/ |
This file contains hidden or 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
/*! | |
* jQuery postMessage - v1.0 - 8/26/2011 | |
* | |
* Copyright (c) 2011 "zachleat" Zach Leatherman | |
* Copyright (c) 2009 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://jquery.org/license | |
*/ | |
/* Forked from http://benalman.com/projects/jquery-postmessage-plugin/ |
OlderNewer