Skip to content

Instantly share code, notes, and snippets.

View inancgumus's full-sized avatar

İnanç Gümüş inancgumus

View GitHub Profile
'''
redis_search.py
Written by Josiah Carlson July 3, 2010
Released into the public domain.
This module implements a simple TF/IDF indexing and search algorithm using
Redis as a datastore server. The particular algorithm implemented uses the

Getting started

First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.

@yuanyan
yuanyan / poisson.js
Created May 29, 2011 06:12
Poisson distribution
//Poisson distribution
//http://en.wikipedia.org/wiki/Poisson_distribution
function poisson(expectvalue){
var n = 0, //循环计数
limit = Math.exp(-expectvalue), // e -v, 其中v是期望值
x = Math.random(); //生成 0-1之间随机数
while(x > limit){
require 'camping'
Camping.goes :Async
module Async
def service(*a)
return super unless respond_to?(:async?)
EM.next_tick do
send(@method, *a)
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@RandomEtc
RandomEtc / Procfile
Created September 26, 2011 15:59
Getting Kue working on Heroku
web: node app.js
worker: node consumer.js
@bonkydog
bonkydog / jasmine_fixtures.rb
Created February 3, 2012 05:18
Generate Jasmine fixtures using RSpec
module JasmineFixtures
extend ActiveSupport::Concern
module InstanceMethods
# Saves the markup to a fixture file using the given name
def save_fixture(name)
response.should be_success
fixture_path = File.join(Rails.root, '/spec/javascripts/fixtures')
fixture_file = File.join(fixture_path, name)
@angeldm
angeldm / balancer.go
Created April 19, 2012 14:13
Rob Pike balancer for go
package main
import (
"container/heap"
"fmt"
"math/rand"
"time"
)
const nRequester = 100
@jonnyreeves
jonnyreeves / index.html
Created April 23, 2012 21:38
JavaScript Class Structure using requireJS. The following code shows you how to create a Class definition in one JavaScript file and then import it for use in another; coming from an ActionScript 3 background this (and some of JavaScript specific traits)
<!DOCTYPE html>
<html>
<head>
<script data-main="usage" src="http://requirejs.org/docs/release/1.0.8/comments/require.js"></script>
</head>
<body>
<p>Check your JavaScript console for output!</p>
</body>
</head>
@paulmillr
paulmillr / active.md
Last active May 15, 2024 02:25
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)