This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# "cpath_env $DIRECTORY" sets paths appropriately for making gcc+autoconf | |
# pick up C libraries installed with ./configure --prefix $DIRECTORY. | |
# example: | |
# cd /tmp | |
# tar xf ~/libfoo.tar.gz | |
# cd libfoo | |
# ./configure --prefix=$HOME/stuff | |
# make && make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import thread | |
import threading | |
import sys | |
import dis | |
import os | |
done = threading.Semaphore(0) | |
A = [0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "lucid64" | |
config.vm.box_url = "http://files.vagrantup.com/lucid64.box" | |
config.vm.define :lucid do |t| | |
end | |
config.vm.network "forwarded_port", guest: 8080, host: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int foo(FOO_ARGS); | |
int main(int argc, char **argv) { | |
printf("%d!\n", foo()); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int hork(int x, int y) | |
{ | |
return x * (x + y); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import pickle | |
>>> class C(object): | |
... def __init__(self, banana): | |
... self.banana = banana | |
... def __reduce__(self): | |
... return (C, (self.banana,)) | |
... | |
>>> pickle.dumps(C(1)) | |
'c__main__\nC\np0\n(I1\ntp1\nRp2\n.' | |
>>> pickle.loads(pickle.dumps(C(1))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RichardB@narcissus ~$ od -t x1 /sys/bus/pci/devices/0000:01:00.0/config | |
0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff | |
* | |
0000100 | |
RichardB@narcissus ~$ optirun glxgears >/dev/null & | |
[1] 3758 | |
RichardB@narcissus ~$ sleep 1 | |
RichardB@narcissus ~$ od -t x1 /sys/bus/pci/devices/0000:01:00.0/config | |
0000000 de 10 92 13 07 00 10 00 a2 00 02 03 00 00 00 00 | |
0000020 00 00 00 f6 0c 00 00 e0 00 00 00 00 0c 00 00 f0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html><head><meta charset="UTF-8" /> | |
<title>Odd layout example.</title> | |
<style type="text/css"> | |
#evil-container { | |
position: relative; | |
background: #aaffaa; | |
} | |
body, #evil-container { | |
width: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FindBirthday where | |
-- compile as: ghc --make FindBirthday.hs -main-is FindBirthday.main | |
-- or run as: runhaskell FindBirthday.hs | |
-- and answer "y" or "n" when the program asks you a question. :) | |
import Data.Time (formatTime, addDays) | |
import System.Locale (defaultTimeLocale) | |
-- use 2014 because that was a leap year, and we need all 366 days. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "ie_counts" | |
version = "0.0.1" | |
authors = ["Richard Barrell <rchrd@brrll.co.uk>"] | |
[[bin]] | |
name = "ie_counts" | |
crate-type = ["staticlib"] |
OlderNewer