Skip to content

Instantly share code, notes, and snippets.

/*
* Mclarens Bar: Redis based Instant Messaging
* Nikhil Marathe - 22/04/2010
* A simple example of an IM client implemented using
* Redis PUB/SUB commands so that all the communication
* is offloaded to Redis, and the node.js code only
* handles command interpretation,presentation and subscribing.
*
* Requires redis-node-client and a recent version of Redis
# compl1.rb - Redis autocomplete example
# download female-names.txt from http://antirez.com/misc/female-names.txt
require 'rubygems'
require 'redis'
r = Redis.new
# Create the completion sorted set
if !r.exists(:compl)
#!/bin/bash
echo gcc -I/usr/include/lua5.1/ -L/usr/local/lib/ -llua -o call_lua{,.c} -llua -ldl -lm
gcc -I/usr/include/lua5.1/ -L/usr/local/lib/ -llua -o call_lua{,.c} -llua -ldl
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
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
@pibi
pibi / LICENSE
Created July 12, 2011 10:54
Embedding V8 on GWAN
Copyright (c) 2011 pibi, http://pianobit.com
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@utaal
utaal / Makefile
Created September 5, 2011 16:42
webserver using libuv
webserver: webserver.c libuv/uv.a http-parser/http_parser.o
gcc -I libuv/include \
-lrt -lm -lpthread -o \
webserver webserver.c \
libuv/uv.a http-parser/http_parser.o
libuv/uv.a:
$(MAKE) -C libuv
http-parser/http_parser.o:
@entaroadun
entaroadun / gist:1653794
Created January 21, 2012 20:10
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@Wollw
Wollw / wavelet.c
Created March 1, 2012 04:54
Wavelet Tree
/*
* An implementation of the Wavelet Tree data structure.
* It is similar to a binary search tree using bits.
*
* More info here:
* http://siganakis.com/challenge-design-a-data-structure-thats-small
* http://www.alexbowe.com/wavelet-trees
*/
#include <stdio.h>
#include <stdlib.h>
@lpereira
lpereira / coro.c
Created March 22, 2012 01:12
Simple coroutine implementation in C
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <ucontext.h>
typedef struct coro_t_ coro_t;
typedef struct thread_t_ thread_t;
typedef int (*coro_function_t)(coro_t *coro);
typedef enum {
CORO_NEW,
@deanmalmgren
deanmalmgren / facebook_post_rate_example.py
Created April 19, 2012 14:07
How to count number of Posts shared by Facebook Page.
"""This gist demonstrates how to automatically authenticate with Facebook's OAuth2
using fbconsole --- programmatically, without a browser --- and then count the number
of Posts, for example, on a Facebook Page.
"""
import fbconsole
import datetime
import time
# set up fbconsole