Skip to content

Instantly share code, notes, and snippets.

View hansent's full-sized avatar

Thomas Hansen hansent

View GitHub Profile
@hansent
hansent / models.js
Created January 30, 2014 19:31
models.js
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
var Schema = mongoose.Schema;
var playerSchema = new Schema({
name: String,
var request = require('superagent');
var url = "www.fresklabs.com"
url = url.replace("http://", "");
url = url.replace("https://", "");
url = "http://textance.herokuapp.com/title/" + url;
request.get(url, function(err, res){
if (err) throw err;
import tornado.ioloop
import tornado.web
import tornado.autoreload
class LoginHandler(tornado.web.RequestHandler):
def post(self):
userid = self.get_argument('userid')
password = self.get_argument('password')
if (userid == password):
var CATEGORIES = {
"museum" : "Museums",
"zoo" : "Zoos",
"art" : "Public Art",
"art_museum" : "Art Museum",
"history_museum" : "History Museum",
"historic_place" : "Historic Place",
"county_school" : "County School",
"pos_office_murals" : "Post Office Murals",
"monument_memorial" : "Monuments and Memorials",
traceroute to undefined (69.25.136.210), 30 hops max, 60 byte packets
1 107.170.29.253 (107.170.29.253) 0.357 ms 0.329 ms 0.322 ms
2 192.241.164.241 (192.241.164.241) 0.284 ms 0.296 ms 0.292 ms
3 * * *
4 ae-0.att.nycmny01.us.bb.gin.ntt.net (129.250.9.206) 3.411 ms 3.080 ms 3.400 ms
5 cr1.n54ny.ip.att.net (12.122.131.94) 69.715 ms 69.726 ms 69.723 ms
6 cr2.cgcil.ip.att.net (12.122.1.2) 70.103 ms 69.410 ms 69.342 ms
7 cr2.st6wa.ip.att.net (12.122.31.130) 72.004 ms 71.998 ms 71.975 ms
8 12.123.46.129 (12.123.46.129) 67.418 ms 67.412 ms 67.351 ms
9 12.90.77.10 (12.90.77.10) 75.648 ms 75.652 ms 77.054 ms
@hansent
hansent / keybase.md
Created April 25, 2014 19:43
keybase.md

Keybase proof

I hereby claim:

  • I am hansent on github.
  • I am hansent (https://keybase.io/hansent) on keybase.
  • I have a public key whose fingerprint is D144 107A 48AB 0353 F022 87AA 534A C46A C5BB 1A75

To claim this, I am signing this object:

set nocompatible
filetype off
" Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
let g:vundle_default_git_proto = 'git'
Plugin 'gmarik/Vundle.vim'
Plugin 'ColorSchemeMenuMaker'
Plugin 'Lokaltog/vim-distinguished'
@hansent
hansent / index.html
Created June 4, 2014 21:19
bootstrap example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>bootstrap sample</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
WEB
browser
DOM
events
html/css
rendering
html5 api's (canvas, etc)
server
http
var $ = require('jquery');
//global variable to keep track of ongoing touches
var ongoingTouches = {};
$(function() {
var el = document.body;