Skip to content

Instantly share code, notes, and snippets.

View boopathi's full-sized avatar
💭
I may be slow to respond.

Boopathi Rajaa boopathi

💭
I may be slow to respond.
View GitHub Profile
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
import os
import os.path
import sys
from graphite.render.hashing import ConsistentHashRing
## Settings
# Absolute path to the Graphite Data Directory
DATA_DIR = '/data/graphite/whisper/'
## You need not modify anything below this
@boopathi
boopathi / gist:4386980
Last active December 10, 2015 05:18 — forked from seekshiva/gist:4386309
upstream thin {
server unix:/tmp/thin.0.sock;
server unix:/tmp/thin.1.sock;
server unix:/tmp/thin.2.sock;
}
server {
listen 80;
server_name my-domain-name.com
@boopathi
boopathi / server_main.js
Created November 11, 2012 23:42 — forked from nmorse/server_main.js
basic nowJS on connect and disconnect methods
var node_static = require('node-static');
var node_static_file = new(node_static.Server)('./client');
var http = require('http'),
players = {},
server = http.createServer(function(req, res) {
// static file server
req.addListener('end', function () {
node_static_file.serve(req, res);
});
}).listen(80);
class Module
def subclasses
classes = []
ObjectSpace.each_object do |klass|
next unless Module === klass
classes << klass if self > klass
end
classes
end
end
@boopathi
boopathi / radix_sort.py
Created November 26, 2011 09:19 — forked from hiroshi-manabe/radix_sort.py
Radix sort
base = 10
def radix_sort(x, max):
radix = 1
while radix < max:
x = counting_sort(x, radix)
radix *= base
return x
def counting_sort(a, radix):
@boopathi
boopathi / gist:1020875
Created June 11, 2011 19:41 — forked from mkuklis/gist:1011477
JavaScript debounce
function debounce(fn, wait) {
var timeout = null;
return function () {
clearTimeout(timeout);
var args = arguments;
var ctx = this;
timeout = setTimeout(function () {
fn.apply(ctx, args);
}, wait);
}
@boopathi
boopathi / javascript_prototype_objects.js
Created June 8, 2011 06:45 — forked from thisivan/javascript_prototype_objects.js
Creating Prototype objects with JavaScript
// Defining constructor function
function ObjectConstructor(message) {
// TODO: Add your own initialization code here
this.message = message || 'Hello Prototype World!';
};
// Defining an instance function
ObjectConstructor.prototype.sayHello = function() {
alert(this.message);
};
@boopathi
boopathi / utmstrip.user.js
Created May 22, 2011 09:37 — forked from paulirish/utmstrip.user.js
userscript: Drop the UTM params from a URL when the page loads
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @version 1.1
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http://*
// ==/UserScript==
@boopathi
boopathi / gist:985312
Created May 22, 2011 09:45 — forked from paulirish/gist:616412
"iframe" sitedown fallback via <object>
<!-- so it turns out that the object tag can act like an iframe
but the cool thing is you can nest object tags inside eachother for a fallback path.
what this means is you can "objectframe" a site.. and if it fails.. (site down, offline, whatever).. it'll use the next one.
so you can objectframe the live site and fallback to a screenshot.
or something.
demo at : http://jsfiddle.net/paul/CY2FQ/1/
-->