Skip to content

Instantly share code, notes, and snippets.

@typpo
typpo / .xmodmap
Created October 13, 2011 00:19
Remap capslock to escape
!Remap capslock to escape
clear lock
keycode 0x42 = Escape
@typpo
typpo / .vimrc
Created October 29, 2011 03:15
.vimrc
set nocompatible
colorscheme wombat
set cul
syntax on
filetype plugin indent on
au BufNewFile,BufRead *.djs set filetype=javascript
set smartindent
@typpo
typpo / tree.md
Created April 23, 2012 22:30 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@typpo
typpo / gist:4201220
Created December 4, 2012 06:17
ANGLE-generated HLSL code
// This is ANGLE HLSL output. GLSL input here: https://gist.github.com/4209605
float3 vec3(float x0, float x1, float x2) {
return float3(x0, x1, x2);
}
float4 vec4(float3 x0, float x1) {
return float4(x0, x1);
}
// Attributes
static float _P = {
@typpo
typpo / gist:4209605
Created December 4, 2012 22:32
original glsl
// This is autogenerated by Three.js:
precision highp float;
#define VERTEX_TEXTURES
#define MAX_DIR_LIGHTS 0
@typpo
typpo / gist:4217800
Created December 5, 2012 17:41
HLSL 2
float3 vec3(float x0, float x1, float x2) {
return float3(x0, x1, x2);
}
float4 vec4(float3 x0, float x1) {
return float4(x0, x1);
}
static float _P = {
0
};
static float _a = {
This file has been truncated, but you can view the full file.
'use strict';
var COMPILED = !0, goog = goog || {};
goog.global = this;
goog.DEBUG = !1;
goog.LOCALE = "en";
goog.provide = function (a) {
if (!COMPILED) {
if (goog.isProvided_(a))
throw Error('Namespace "' + a + '" already declared.');
delete goog.implicitNamespaces_[a];
@typpo
typpo / sqlite2pg.sh
Last active July 31, 2019 14:20 — forked from eclubb/sqlite2pg.sh
#!/bin/sh
# This script will migrate schema and data from a SQLite3 database to PostgreSQL.
# Schema translation based on http://stackoverflow.com/a/4581921/1303625.
# Some column types are not handled (e.g blobs).
if [ $# -lt 3 ]; then
echo "usage: sqlite2pg.sh sqlite_db_path pg_db_name pg_user_name";
exit 1
fi
@typpo
typpo / dream unigrams
Created April 14, 2013 21:22
dream unigrams
people: 96
sophia: 58
room: 50
house: 47
mom: 42
big: 39
going: 36
guy: 31
dartmouth: 29
dream: 28
@typpo
typpo / dream bigrams
Created April 14, 2013 21:29
dream bigrams
a big: 23
sort of: 18
going to: 18
with mom: 16
sophia and: 14
old house: 14
a lot: 13
lots of: 13
high school: 13
mom and: 13