Skip to content

Instantly share code, notes, and snippets.

@teepark
teepark / btree.py
Created September 9, 2010 22:45
a pure-python B tree and B+ tree implementation
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@entaroadun
entaroadun / gist:1653794
Created January 21, 2012 20:10
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

class AbstractNode
@@root = nil
def initialize(n, keys, parent)
@slot = n
@keys = keys
@parent = parent
@@root = self unless @@root
end
@andikan
andikan / install-flow
Created September 21, 2012 13:57
ec2 environment
http://ggd.github.com/blog/2012/07/20/deploy-rails-3-with-apache-mysql-passenger-capistrano-to-ec2/
http://nathanhoad.net/how-to-ruby-on-rails-ubuntu-apache-with-passenger
#ruby :
sudo apt-get install ruby1.9.1-full
#simple compiler
sudo apt-get install build-essential
#mysql
sudo apt-get install mysql-server mysql-common mysql-client libmysqlclient-dev
#ruby mysql adapter
@evenchange4
evenchange4 / step.md
Created September 23, 2012 21:55
Deploy a Express.js project on Heroku

Deploy a Express.js project on Heroku

Step by step from command line by Michael Hsu

Quick start

Create a Node.js web framework 'express'

$ express myfirstexpress && cd myfirstexpress

Declare dependencies with NPM /package.json

@evenchange4
evenchange4 / step.md
Created September 24, 2012 06:31
Use Express and Mongolab to create Todo-list on Heroku

Use Express and Mongolab to create Todo-list on Heroku

Step by step from command line by Michael Hsu

Quick start

Clone an express-todo-example code

$ git clone https://github.com/dreamerslab/express-todo-example.git mongolab-todo-list

Link MongoDB Hosting /db.js

  1. create a MongoLab Platform account