Skip to content

Instantly share code, notes, and snippets.

@tbelaire
tbelaire / gist:2969233
Created June 21, 2012 23:27
brew install ipe failure log
$ brew install -v ipe
==> Downloading http://sourceforge.net/projects/ipe7/files/ipe/7.1.0/ipe-7.1.2-src.tar.gz
Already downloaded: /Library/Caches/Homebrew/ipe-7.1.2.tar.gz
/usr/bin/tar xf /Library/Caches/Homebrew/ipe-7.1.2.tar.gz
==> Patching
/usr/bin/patch -f -p1 -i 000-homebrew.diff
patching file src/config.mak
==> make IPEPREFIX=/usr/local/Cellar/ipe/7.1.2 install
make IPEPREFIX=/usr/local/Cellar/ipe/7.1.2 install
make --directory=ipelib all
@tbelaire
tbelaire / hello.c
Created November 4, 2012 18:19
A small concurrent C example
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
// Small channel library here.
// It mimics unbuffered Go channels.
typedef struct chan_int {
int message;
{-# LANGUAGE ViewPatterns #-}
module Main where
import Control.Applicative
import Control.Concurrent
import System.Console.ANSI
import System.IO
-- import Test.HUnit -- Soon
data Direction = Leftwards | Rightwards deriving (Show, Eq, Bounded, Enum)
import re
import collections
import itertools
def munge_timestamp(timestamp):
return timestamp
def parse_srt(srt_string):
"""Return json version for storing in datastore"""
@tbelaire
tbelaire / commit_template
Last active August 29, 2015 13:56
Replace ~/.git_template/commit_template and webapp/.git/hooks/prepare-commit-msg
Test Plan:
# Commands to run, or process to follow to test the changes
#
# Previous commit:
# {PREV_COMMIT_MSG}
# Review: {Dxxxx}
# can be used instead of 'Test Plan:' to continue that commit's Differential
#!/bin/bash -xe
template_dir=~/khan/template_captions
tmp_dir=~/khan/tmp/captions
webapp=~/khan/webapp
locales="en tr"
for l in $locales; do
mkdir -p $tmp_dir/incoming/$l;
cp $template_dir/incoming/$l/*.srt $tmp_dir/incoming/$l/
use std::io;
#[deriving(Show)]
enum List {
Cons(~str, ~List),
Nil
}
fn print_list( lst : &List ) {
fn mutter( x : ~int ) -> ~int {
let mut y = x;
*y = 24;
return y;
}
fn main() {
let y = box 42;
@tbelaire
tbelaire / gist:d0850dbb470a069cde9d
Last active August 29, 2015 14:02
Coq and HoTT

Steps for installing HoTT Coq and VIM on OSX

VIM: If you're using Vundle, get the plugin:

Bundle 'def-lkb/vimbufsync'
Bundle 'tbelaire/coquille'

Otherwise go to github.com/trefis/coquille and get it yourself. There is a dependancy on the vimbufsync plugin, so make sure to get that too.

Keybase proof

I hereby claim:

  • I am tbelaire on github.
  • I am tbelaire (https://keybase.io/tbelaire) on keybase.
  • I have a public key whose fingerprint is 5771 D9EF 2249 8DBD D35E 542E DF53 D9D2 B1BF FDF2

To claim this, I am signing this object: