Skip to content

Instantly share code, notes, and snippets.

@hakee
hakee / app.js
Created June 13, 2012 12:50 — forked from pixelhandler/app.js
Develop a RESTful API Using Node.js With Express and Mongoose - See: http://pixelhandler.com/blog/2012/02/09/develop-a-restful-api-using-node-js-with-express-and-mongoose/
var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');
@hakee
hakee / gist:2001448
Created March 8, 2012 15:14 — forked from thinkphp/gist:1642162
Insertion Sort pseudocode
/*
Pseudocode of the complete algorithm
Twitter : http://twitter.com/thinkphp
Website : http://thinkphp.ro
Google Plus : http://gplus.to/thinkphp
MIT Style License
*/
INSERTION-SORT(V)
@hakee
hakee / facebook.py
Created March 8, 2012 15:08 — forked from rodbegbie/facebook.py
Hacked version of "official" (but now unsupported) Facebook Python SDK to support OAuth 2.0
#!/usr/bin/env python
#
# Copyright 2010 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@hakee
hakee / Auto-Suggestion
Created March 8, 2012 15:07 — forked from wgpshashank/Auto-Suggestion
How Google Won User's Heart :: Google Auto-Suggestion/Auto-Completion Algorithm Exposed
How Auto Suggestion Works e.g. How Google Won User's Heart
You've seen search engines suggest queries when you begin typing the first few letters of your search string. This is being done by Duck Duck Go as well as Google (to name a few). This is typically done by maintaining
a list of past queries and/or important strings that the search engine thinks are worthy of being suggested to a user that is trying to find something similar. These suggestions are effective only if the search engine
spits them out very fast since these should show up on the screen before the user has finished typing what he/she wanted to type. Hence the speed with which these suggestions are made is very critical to the usefulness of this feature.
Let us consider a situation (and a possible way of approaching this problem) in which when a user enters the first few letters of a search query, he/she is presented with some suggestions that have as their prefix,
the string that the user has typed. Furthermore, these suggestions should