Dotfiles are now all together at home
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
#!/usr/bin/env python | |
import sys | |
import subprocess | |
import tempfile | |
import time | |
# Emacs is in the Cellar, installed by Homebrew | |
emacspath="/usr/local/Cellar/emacs/24.3/Emacs.app/Contents/MacOS/Emacs" | |
def run(cmd, args): |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <inttypes.h> | |
#include "timer.h" | |
struct aligned { | |
uint32_t o:8; | |
uint32_t d:8; |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <gmp.h> | |
/** | |
* Compute a Factorial | |
* | |
* returns a string representation of the number `n` in base 10. | |
*/ |
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> | |
#include <stdlib.h> | |
#include <complex.h> | |
int main(int argc, char* argv[]) | |
{ | |
float _Complex number = 1 + (1 * _Complex_I); | |
printf("%g, %g", cabs(number), carg(number)); |
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
# Snooper configuration file | |
# This is YAML | |
base_path: . | |
# default to watching the whole tree | |
paths: | |
# watch lex, c, and makefiles. | |
filters: [\.l$, \.c$, \.h$, \.mk$] |
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
extern "C" { | |
#include <sys/mman.h> | |
#include <fcntl.h> | |
} | |
#include <cstring> | |
#include <cerrno> | |
#include <iostream> | |
int main(int argc, char* argv[]) { |
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
#! /usr/bin/env python | |
import random | |
import string | |
import mdp | |
def foo(): | |
return random.sample(xrange(255), 32) | |
def bar(n): | |
ret = [] |
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> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <inttypes.h> | |
#define BLOCK_SIZE (4096 * 1024) | |
typedef struct { | |
uint8_t byte; |
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
/* compile with clang -m32 */ | |
.text | |
.global _main | |
_main: | |
pushl %ebp | |
movl %esp, %ebp | |
/* we need to access data relative to the instruction pointer in OS X. | |
* This register is not readable in 32 bit mode so this trick is needed */ |