Skip to content

Instantly share code, notes, and snippets.

Redis + LibUV prototype README

Special thanks to Dušan Majkic (dmajkic, https://github.com/dmajkic/redis/) for his project on GitHub that gave us the opportunity to quickly learn some on the intricacies of Redis code. His project also helped us to build our prototype quickly.

Get source repository

First clone the Redis sources from https://github.com/antirez/redis.

  • On your computer create a working folder and cd into it.
  • Clone antirez/redis repository:
@ProximaMonkey
ProximaMonkey / summary.json
Created January 29, 2012 18:42
Devcast - 1
{
"JavaScript": ["Font.js"],
"NodeJS": ["node-geoip","ftp-get","magician"]
}
@ProximaMonkey
ProximaMonkey / weibo.py
Created February 20, 2012 16:40 — forked from mazesoul87/weibo.py
weibo oauth
#encoding:utf-8
import logging
import time
import urllib
import mimetools
from tornado import httpclient
from tornado.httputil import HTTPHeaders
from tornado import escape
from tornado.auth import OAuthMixin,OAuth2Mixin
match '/:id', :to => proc { |env|
id = env["action_dispatch.request.path_parameters"][:id]
model = Slug.find_by_slug(id).model
controller = [model.pluralize.camelize,"Controller"].join.constantize
controller.action("show").call(env)
@ProximaMonkey
ProximaMonkey / bijective.rb
Created March 13, 2012 06:07 — forked from zumbojo/bijective.rb
Simple bijective function (base(n) encode/decode)
# Simple bijective function
# Basically encodes any integer into a base(n) string,
# where n is ALPHABET.length.
# Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047
ALPHABET =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//)
# make your own alphabet using:
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join

Redis + LibUV prototype README

Special thanks to Dušan Majkic (dmajkic, https://github.com/dmajkic/redis/) for his project on GitHub that gave us the opportunity to quickly learn some on the intricacies of Redis code. His project also helped us to build our prototype quickly.

Get source repository

First clone the Redis sources from https://github.com/antirez/redis.

  • On your computer create a working folder and cd into it.
  • Clone antirez/redis repository:
@ProximaMonkey
ProximaMonkey / jquery.imagesloaded.js
Created April 6, 2012 07:09 — forked from desandro/jquery.imagesloaded.js
$.fn.imagesLoaded jQuery plugin
// $('img.photo',this).imagesLoaded(myFunction)
// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images
// Modified with a two-pass approach to changing image
// src. First, the proxy imagedata is set, which leads
// to the first callback being triggered, which resets
// imagedata to the original src, which fires the final,
// user defined callback.
@ProximaMonkey
ProximaMonkey / dropboxmixin.py
Created April 7, 2012 21:38 — forked from adam-stokes/dropboxmixin.py
Tornado Dropbox oauth mixin
class DropboxMixin(tornado.auth.OAuthMixin):
""" Dropbox OAuth authentication.
"""
_OAUTH_REQUEST_TOKEN_URL = "https://api.dropbox.com/1/oauth/request_token"
_OAUTH_ACCESS_TOKEN_URL = "https://api.dropbox.com/1/oauth/access_token"
_OAUTH_AUTHORIZE_URL = "https://www.dropbox.com/1/oauth/authorize"
_OAUTH_VERSION = "1.0"
_OAUTH_NO_CALLBACKS = False
def authorize_redirect(self, callback_uri=None, extra_params=None,
@ProximaMonkey
ProximaMonkey / result_collector.py
Created April 7, 2012 21:39 — forked from bdarnell/result_collector.py
result_collector.py
import functools
import logging
import sys
class ResultCollector(object):
'''Like a BarrierCallback, but saves results passed to the callback.
>>> rc = ResultCollector()
>>> cb_foo = rc.get_callback('foo')
>>> cb_bar = rc.get_callback('bar')
@ProximaMonkey
ProximaMonkey / gist:2336255
Created April 8, 2012 09:30 — forked from huacnlee/gist:1150933
redis-search 0.3 Benchmark, 用户昵称搜索(10个字以内)
redis-search 0.3 Benchmark
Core 2 Duo CPU 2.66G, 4G Memory
20W 数据
# coding: utf-8
require "benchmark"
["的","美丽","云","云儿","花","云儿的"].each do |key|