Skip to content

Instantly share code, notes, and snippets.

View redacted's full-sized avatar

Steven Tobin redacted

  • Ireland
View GitHub Profile
#!/usr/bin/python
# Global data
# dict for dart station rss IDs
stations = {
'pearse' : 'PERSE',
'blackrock' : 'BROCK',
'grand canal dock' : 'GCDK',
'tara' : 'TARA',
@redacted
redacted / qsort
Created March 10, 2011 17:50
quicksort
(defn qsort [[pivot & xs]]
(when pivot
(let [smaller #(< % pivot)]
(lazy-cat (qsort (filter smaller xs))
[pivot]
(qsort (remove smaller xs))))))
@redacted
redacted / brew install -v gettext
Created March 17, 2011 20:04
verbose log for a failed gettext build
> brew install -v gettext
==> Build Environment
CC: /usr/bin/cc => /usr/bin/gcc-4.2
CXX: /usr/bin/c++ => /usr/bin/c++-4.2
LD: /usr/bin/cc => /usr/bin/gcc-4.2
CFLAGS: -O3 -w -pipe
CXXFLAGS: -O3 -w -pipe
MAKEFLAGS: -j4
==> Downloading http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.1.1.tar.gz
File already downloaded and cached to /Users/steven/Library/Caches/Homebrew
@redacted
redacted / brew doctor
Created March 17, 2011 20:05
output of brew doctor for failed gettext build
> brew doctor
Your OS X is ripe for brewing.
Any troubles you may be experiencing are likely purely psychosomatic.
@redacted
redacted / gettext.rb
Created March 19, 2011 16:24
patched gettext.rb to fix build problem
1 require 'formula'
2
3 class Gettext < Formula
4 url 'http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.1.1.tar.gz'
5 md5 '3dd55b952826d2b32f51308f2f91aa89'
6 homepage 'http://www.gnu.org/software/gettext/'
7
8 keg_only "OS X provides the BSD gettext library and some software gets confused if both are in the library path."
9
10 def options
@redacted
redacted / makefile
Created May 5, 2011 17:28
One Make to rule them all...
# get platform
uname_ans=$(shell uname)
ifeq ($(uname_ans), Darwin)
# on a Mac, can use clang/llvm
# much better diagnostics, slightly slower code
cc=clang
else
# fall back to gcc
cc=gcc
@redacted
redacted / gist:959571
Created May 6, 2011 19:06
Autojump proposal
import os
import os.path as path
CLONE_DIR = os.getcwd()
SHELL = os.environ['SHELL'].split("/")[-1]
if SHELL == 'zsh':
with open("custom_install.zsh", "w") as fz:
fz.write("# edit path to include autojump\n")
@redacted
redacted / mathematica.nb
Created July 4, 2011 14:13
Mathematica in Lisp mode
Set[f[x_],
ReplaceAll[Times[A, Exp[-x]],
First[Solve[
Equal[Integrate[Times[A, Exp[-r]], {r, -Infinity, Infinity}], 1], A]]]]
@redacted
redacted / Simplex.py
Created August 30, 2011 16:42
Simplex algorithm in Python (c) 2001 Vivake Gupta, retrieved from archive.org
#!/usr/bin/env python
#
# Copyright (c) 2001 Vivake Gupta (vivakeATomniscia.org). All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@redacted
redacted / cmd2png
Created September 22, 2011 13:51
Command line screenshots. e.g. cmd2png "ls -ll" "ls.png"
#!/bin/sh
$1 | convert -background black -fill white \
-font Monaco-Regular -pointsize 13 \
-border 10 -bordercolor black \
label:@- $2