Skip to content

Instantly share code, notes, and snippets.

ion1 / test.c
Created Jan 29, 2010
Optimization of modified brownian noise
View test.c
// Optimization of modified brownian noise: trying to get rid of branching in
// the ‘reference’ function.
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline float
reference (const float a, const float b)
ion1 / 99-shutdown-scheduled
Created Feb 1, 2010
A “shutdown/reboot scheduled” warning for update-motd
View 99-shutdown-scheduled
set -e
if [ ! -e /var/run/ ]; then
exit 0
my_tput() {
2>/dev/null tput -Tansi "$@" || :
ion1 / gist:294841
Created Feb 4, 2010
Getting aj’s Spicy built
View gist:294841
Removing Headers/Makefile
Removing Headers/
Removing Headers/Spicy/Makefile
Removing Headers/Spicy/
Removing Makefile
Removing Source/.deps/
Removing Source/.libs/
Removing Source/JSONParser.lo
Removing Source/Makefile
ion1 / compass_examples
Created Feb 25, 2010
Some Compass examples
View compass_examples
Some Compass <> examples
background-color: blue
View gist:318639
% cd your-project-directory
% sudo apt-get install gitg
(not a typo)
% git clone git://
% cd
% gitg
% sudo apt-get install rubygems
% sudo gem install rake bundler
View gist:318731
”The first line is required because RubyGems currently can’t mix prerelease
and regular release gems (someone please fix that!).”
Asennetaan tuon vuoksi Rails Bundlerilla:
% export PATH="$PATH:/var/lib/gems/1.8/bin"
% sudo gem install bundler --version=0.9.9
(0.9.10 vaatii uudemman RubyGemsin kuin Debianissa/Ubuntussa on.)
ion1 / have_a_member_matcher.rb
Created Mar 15, 2010
have_a_member matcher for Rspec 2
View have_a_member_matcher.rb
require 'rspec/matchers'
[[:have_a_member, "have a member", :any?],
[:have_every_member, "have every member", :all?]].
each do |name, desc, iterator|
Rspec::Matchers.define name do |matcher|
match do |actual|
actual.send(iterator) {|member| matcher.matches? member }
description do
ion1 / ski.erl
Created Mar 23, 2010
A quick and dirty lambda calculus to combinatory logic transformer
View ski.erl
-module (ski).
-export ([apply/2, lambda/2, transform/1, to_binary/1, to_iolist/1]).
-record (apply, {function, input}).
-record (lambda, {name, expression}).
-define (APPLY (Function, Input), #apply{function=Function, input=Input}).
ion1 / background-slideshow-generate
Created Mar 25, 2010
View background-slideshow-generate
set -e
dir="$(dirname "$0")"
dir="$(readlink -f "$dir")"
ion1 / gist:344284
Created Mar 25, 2010
DNS records for Google Apps
View gist:344284
@ MX 10
MX 20
MX 20
MX 30
MX 30
MX 30
MX 30
TXT "v=spf1 ~all"
_xmpp-server._tcp SRV 5 0 5269