Skip to content

Instantly share code, notes, and snippets.

View kuno's full-sized avatar

kuno kuno

View GitHub Profile
@kuno
kuno / redis-benchmark.2.2.14
Created October 13, 2011 12:02
Redis 2.2.14 benchmark
PING (inline): 0.00====== PING (inline) ======
10000 requests completed in 0.23 seconds
50 parallel clients
3 bytes payload
keep alive: 1
97.11% <= 1 milliseconds
99.67% <= 2 milliseconds
99.92% <= 3 milliseconds
99.95% <= 4 milliseconds
@kuno
kuno / redis-benchmark.2.4.0rc8
Created October 13, 2011 12:04
redis 2.4.0rc8(2.3.11) benchmark
PING (inline): 0.00PING (inline): 38011.86====== PING (inline) ======
10000 requests completed in 0.26 seconds
50 parallel clients
3 bytes payload
keep alive: 1
84.69% <= 1 milliseconds
91.30% <= 2 milliseconds
92.09% <= 3 milliseconds
99.81% <= 4 milliseconds
@kuno
kuno / redis-benchmark.2.4.0
Created October 15, 2011 11:26
Redis 2.4.0 benchmark
PING (inline): 0.00
====== PING (inline) ======
10000 requests completed in 0.21 seconds
50 parallel clients
3 bytes payload
keep alive: 1
98.72% <= 1 milliseconds
99.90% <= 2 milliseconds
99.95% <= 3 milliseconds
@kuno
kuno / model_caching.coffee
Created December 8, 2011 03:55 — forked from rstacruz/model_caching.coffee
Backbone.js model caching
# ## Backbone model caching
# This is a simple solution to the problem "how do I make less requests to
# my server?".
#
# Whenever you need a model instance, this will check first if the same thing
# has been fetched before, and gives you the same instance instead of fetching
# the same data from the server again.
#
# Reusing the same instance also has the great side-effect of making your
# model changeable from one part of your code, with your changes being available
@kuno
kuno / nginx.conf
Created February 7, 2012 15:51 — forked from timmyomahony/nginx.conf
Python, UWSGI, Supervisor & Nginx
upstream uwsgi {
ip_hash;
server 127.0.0.1:40000;
}
server {
listen 80;
server_name www.domain.com;
root /sites/mysite/;
access_log /sites/mysite/log/nginx/access.log;
@kuno
kuno / uEditor.html
Created February 20, 2012 03:24
The html structure of uEditor page
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<script src="jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="jquery.muEditor.js" type="text/javascript"></script>
<script src="jquery.muEditor.i18n.js" type="text/javascript"></script>
<link rel="stylesheet" href="muEditor.css" type="text/css" media="screen">
<script type="text/javascript">
@kuno
kuno / gist:3154669
Created July 21, 2012 05:13
TileMill.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=TileMill
Categories=;
Comment=Fast and beautiful maps
Encoding=UTF-8
Exec=/usr/bin/tilemill
Hidden=false
Icon=/usr/share/pixmaps/tilemill.png
@kuno
kuno / es.txt
Created September 11, 2012 07:58 — forked from karussell/Query-DSL-elasticsearch.txt
Bird's Eye View on ElasticSearch its Query DSL
Several times in a month there pop up questions regarding query structure on the ElasticSearch user group.
Although there are good docs explaining this in depth probably the bird view of the Query DSL is necessary to
understand what is written there. There is even already some good external documentation available:
http://www.elasticsearch.org/tutorials/2011/08/28/query-dsl-explained.html
And there were attempts to define a schema:
http://groups.google.com/group/json-schema/browse_thread/thread/ae498ee818155d50
https://gist.github.com/8887766ca0e7052814b0
var resque = require('coffee-resque').connect({
host: 'localhost',
port: 6379
});
resque.enqueue('math', 'add', [1, 2]);
resque.enqueue('math', 'cp', ['/tmp/tmp.c', '/tmp/tmp.back']);
resque.enqueue('math', 'git', ['git@github.com:kuno/GeoIP.git', '/tmp/GeoIP/']);
var spawn = require('child_process').spawn;
var resque = require('coffee-resque').connect({
host: 'localhost',
port: 6379
});
var mathJobs = {
git: function(url, dest, callback) {
var clone = spawn('git', ['clone', url, dest]);