Skip to content

Instantly share code, notes, and snippets.

View IanConnolly's full-sized avatar

Ian Connolly IanConnolly

View GitHub Profile
(defadvice vc-mode-line (after strip-backend () activate)
(when (stringp vc-mode)
(let ((noback (replace-regexp-in-string
(format "^ %s-" (vc-backend buffer-file-name))
" " vc-mode)))
(setq vc-mode noback))))
require 'formula'
class Scala210 < Formula
homepage 'http://www.scala-lang.org/'
url 'http://www.scala-lang.org/files/archive/scala-2.10.5.tgz'
sha256 '918daf7de186305ff3c47bd0e6b03e74d6648c5239c050687b57b8fac2f87eb2'
keg_only 'Conflicts with scala in main repository.'
option 'with-docs', 'Also install library documentation'
@IanConnolly
IanConnolly / cvim.vim
Created December 9, 2015 05:56
cVim confg
let mapleader = " "
let barposition = "bottom"
let searchalias g = "google"
unmap b
map b :buffer<Space>
map <C-k> scrollFullPageUp
map <C-j> scrollFullPageDown

Keybase proof

I hereby claim:

  • I am ianconnolly on github.
  • I am ianconnolly (https://keybase.io/ianconnolly) on keybase.
  • I have a public key whose fingerprint is E3C4 5B87 E6EE 2783 96DB D893 E47B AD4A 405F 38B2

To claim this, I am signing this object:

@IanConnolly
IanConnolly / matmul-timer.py
Created March 11, 2014 17:11
hacky timer for CS3014 Parallel Matmul
import subprocess
import argparse
import sys
from random import randrange
BIG = 1000
SMALL = 100
def generate_data(big=False):
MAX_32_UINT = 4294967295
MAX_32_SINT = 2147483648
MIN_32_SINT = -2147483647
def would_overflow_multiplication(in_type, a, b, sign=1):
"""
Checks if a * b would overflow
"""
if in_type is "deci":
def enum(*sequential, **named):
"""
Automatic enumerated enum type.
(PEP 435 added it to Python 3.4, and actual backports exist fyi)
"""
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)
def get_val_from_binary_range(high_bit, low_bit, int_type):
'''
Returns the numeric value of the bits bounded by low_bit and high_bit in the int_type param
low_bit becomes the new value's zeroth bit
'''
val = 0
cur_bit = high_bit
while (cur_bit >= low_bit):
val = val << 1
if test_bit(int_type, cur_bit) != 0: