Skip to content

Instantly share code, notes, and snippets.


Chris Van Horne cwvh

  • Seattle, WA, USA
View GitHub Profile
cwvh / vimrc
Created Aug 15, 2014
minimal vimrc
View vimrc
set nocompatible
filetype plugin indent on
syntax on
let mapleader = " "
no j gj
no k gk
no <c-j> 6j
no <c-k> 6k
no <c-a> ^
no <c-e> $
""" pip install GitPython --upgrade --pre """
import git
import sys
def pretty_date(time=False):
from datetime import datetime
now =
if type(time) is int:
cwvh / A.hs
Created May 15, 2014
View A.hs
data Gabuzomeu a b = Gabu a | Zomeu b
deriving Show
shadok :: (a -> c) -> (b -> d) -> Gabuzomeu a b -> Gabuzomeu c d
shadok f _ (Gabu a) = Gabu (f a)
shadok _ g (Zomeu b) = Zomeu (g b)
newtype G b a = G {first :: Gabuzomeu a b}
deriving Show
View gist:eb2d6e26829a7e6c4dbe
Version: GnuPG v1
#include <iostream>
#include <chrono>
#include <cstdlib>
int main() {
const int N = 7*1024;
int** m = new int*[N];
int* n = new int[N*N];
int* k = new int[N*N];
cwvh / facebook.user.js
Created Apr 7, 2014
Fix for Facebook updated UI (2014-04-06) for smaller desktop displays
View facebook.user.js
// ==UserScript==
// @match*
// ==/UserScript==
var e = document.getElementById('rightCol');
document.getElementById('contentArea').style.width = '100%';
cwvh / B.hs
Created Feb 4, 2014
fast reverse ordered character count
View B.hs
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Internal as B
import qualified Data.ByteString.Unsafe as B
import Data.List
import Data.Word
import Foreign
import Foreign.C.Types
import Foreign.Marshal.Alloc
import Foreign.ForeignPtr
import Text.Printf
cwvh / webauth.user.js
Created Jan 23, 2014
drag-and-drop this into your chrome settings -> extensions page
View webauth.user.js
// ==UserScript==
// @match*
// ==/UserScript==
var username = 'fill me in',
password = 'fill me in';
document.getElementById('username').value = username;
document.getElementById('password').value = password;'fm1'))
View K.hs
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BangPatterns #-}
import Control.Applicative
import Control.Monad.Loops
import Control.Monad.State.Strict
import Data.Either
import Data.Attoparsec.Char8
import qualified Data.ByteString.Char8 as B
cwvh / C.hs
Created Jan 7, 2014
trivial optimizing brainfuck interpreter
View C.hs
{-# LANGUAGE OverloadedStrings #-}
import Data.Array.IO
import Data.Array.Base
import Control.Applicative
import Control.Monad
import Data.Attoparsec.Char8
import qualified Data.ByteString.Char8 as B
import System.Environment
import Debug.Trace