Skip to content

Instantly share code, notes, and snippets.

View hansent's full-sized avatar

Thomas Hansen hansent

View GitHub Profile
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 / 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:

//gulp & plugins
var gulp = require('gulp');
var gutil = require('gulp-util');
var jshint = require('gulp-jshint');
var browserify = require('gulp-browserify');
var jade = require('gulp-jade');
var stylus = require('gulp-stylus');
var mocha = require('gulp-mocha');
var nodemon = require('gulp-nodemon');
var livereload = require('gulp-livereload');
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
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",
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 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;
@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,
import os
import sys
import json
import threading
import requests
DIGITIZE_IO_API_KEY = os.environ.get("DIGITIZE_IO_API_KEY", "<your-api-key>")
DIGITIZE_IO_ENDPOINT = "https://digitize.io/api/ocr"
@hansent
hansent / test.php
Last active December 26, 2015 21:39
<?php $events_loop = new WP_Query( array('post_type' => 'events', 'posts_per_page' => '0', 'orderby' => 'ASC' ) ); ?>
<?php while ( $events_loop->have_posts() ) : $events_loop->the_post(); ?>
<?php $feat_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'mediumsize' ); ?>
<?php
$locations_list = wp_get_post_terms($post->ID, 'locations', array("fields" => "slugs"));
$occurences_list = wp_get_post_terms($post->ID, 'occurences', array("fields" => "slugs"));
$disciplines_list = wp_get_post_terms($post->ID, 'disciplines', array("fields" => "slugs"));