Skip to content

Instantly share code, notes, and snippets.

script = """
local callcount = tonumber(ARGV[1]) or 0
local maxcps = tonumber(ARGV[2]) or 0
local expected = (tonumber(redis.call('GET', KEYS[1])) or 0) + callcount
if expected > maxcps then
return nil
else
redis.call('incrby', KEYS[1], callcount)
redis.call('expire', KEYS[1], 10)
@jney
jney / nokogiri.sh
Created September 20, 2011 14:08 — forked from retr0h/gist:1001477
RVM + HomeBrew + Nokogiri
#!/bin/sh
##
# to install :
# $ curl -L "https://gist.github.com/gists/path/to/raw/gist/nokogiri.sh" | sh
set -e
echo "installing libraries"
brew install libxml2
@jney
jney / LICENSE.txt
Created June 21, 2011 11:01 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jney
jney / gist:838547
Created February 22, 2011 11:37 — forked from ezmobius/gist:807334
#!/bin/bash
set -e
trap onexit 1 2 3 15 ERR
function onexit {
echo "## cleaning installation folder"
pushd /tmp
rm -rf libev-mirror
rm -rf zeromq-2.1.0
/*
Add a bookmark to this
javascript:(function(b){for(var c=0,a=b.length;c<a;c++){var d=b[c];if(d.rel==="stylesheet"||d.type==="text/css"){var e=d.href.split("?",2);d.href=e[0]+"?"+((e.length===2)?e[1]+"&":"")+(new Date().getTime())}}})(document.getElementsByTagName("link"));
*/
;(function (links) {
for (var i = 0, len = links.length; i < len; i++) {
var link = links[i];
if (link.rel === 'stylesheet' || link.type === 'text/css') {