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
;; Implementation of the Sieve of Eratosthenes | |
;; https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes | |
(define (eratosthenes n) | |
;; Mark multiples of the given prime in the vector | |
(define (mark-multiples p marked) | |
(define (mark-multiples-at p m marked) | |
(if (>= m (vector-length marked)) | |
marked | |
(begin | |
(vector-set! marked m #t) |
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/ruby | |
require 'wiringpi' | |
require 'net/ping' | |
require 'syslog' | |
# Constants | |
OUTPUT_PINA = 0 # RPi Pin 11 | |
OUTPUT_PINB = 1 # RPi Pin 12 | |
ARM_ON_TIME = 0.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
#!/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
module sample | |
import io | |
/** | |
* Greeting class. | |
* | |
* Stores a list of greetings and prints them to the | |
* screen upon request | |
*/ |
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 ruby | |
# Invoke with `ruby md2cre.rb filename.md` | |
# | |
# Setup: `gem install redcarpet` | |
require 'rubygems' | |
require 'redcarpet' | |
class Creole < Redcarpet::Render::Base | |
def normal_text(text) |
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
/* | |
* C11 <threads.h> emulation library | |
* | |
* (C) Copyright yohhoy 2012. | |
* Distributed under the Boost Software License, Version 1.0. | |
* (See copy at http://www.boost.org/LICENSE_1_0.txt) | |
*/ | |
#ifndef EMULATED_THREADS_H_INCLUDED_ | |
#define EMULATED_THREADS_H_INCLUDED_ |