Skip to content

Instantly share code, notes, and snippets.

@iiska
iiska / keybase.txt
Created June 4, 2014 07:50
Keybase verification
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1
owF1UntQVFUc3gXCyAIr0ZCHeNXBgl3v+55LGIqvghxt0Ikg3e7j3OUusrvuLiur
CzNQIuaoYIMgby001yKBaQbQHmIWw9YgUyhggKCkEM3oRDOCDHUvQ5M10/nrnPP7
zvf7vu93ip7x1fhoVzj9K06wCYla7yivST7a6diP8BbRhcTuR4TdMjQ71J2Zy4RI
LJIBXTxnh3rZEmm2iFBvskfOYWIQJ7TZZYtZQaF6Uo8iOTEqXH0syWYjtFltssqF
CATN4QQFJZQWeMAAQsAEXGQZnGRolGZ5liZYEic5hTLdYnf8qysyy2mQReV2Dp8w
h1+n1LJmCxyHcYQAFCbAcrzI4YAjeQySAkrSkEZRFWiHtjlLsmzP4FSxmdCWsRsa
bBbLrGPBIat1jEQxQAOMwBQ5nD1dtSdJGAcgSooUg0s0BThMEliRF1AoUCLKsBir
# .bashrc
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
[ -z "$PS1" ] && return
# http://en.tldp.org/HOWTO/Bash-Prompt-HOWTO/x869.html
function prompt_command {
hostnam=$(hostname -s)
usernam=$(whoami)
@iiska
iiska / iiska.theme
Created January 23, 2009 09:19
My irssi theme with minor changes
# default foreground color (%N) - -1 is the "default terminal color"
default_color = "-1";
# print timestamp/servertag at the end of line, not at beginning
info_eol = "false";
# these characters are automatically replaced with specified color
# (dark grey by default)
replaces = { "[]=" = "%K$*%n"; };
@iiska
iiska / wvdial.conf
Created February 6, 2009 18:16
wvdial.conf to be used with DNA Finland 3G or gprs over bluetooth.
# wvdial.conf to be used with DNA Finland 3G or gprs over bluetooth
[Modem0]
Modem = /dev/rfcomm0
Baud = 115200
SetVolume = 0
Dial Command = ATD
Init1 = AT
Init3 = ATH
FlowControl = CRTSCTS
[Dialer dna]
require 'source_annotation_extractor'
class SourceAnnotationExtractor
# Override the directories that the SourceAnnotationExtractor
# traverses when you call rake notes
def find(dirs=%w(app lib spec public/javascripts))
dirs.inject({}) { |h, dir| h.update(find_in(dir)) }
end
# Override to extract annotations from .haml and .js files
@iiska
iiska / pre-commit
Created October 4, 2010 12:40
Refuse commit when there are debug code present.
#!/bin/sh
#
# Aborts commit if grepping diff encounters JS or Ruby debug lines.
has_console_log=$(git diff --cached | grep '^\+\s*console\.log\(.*\)')
has_console_dir=$(git diff --cached | grep '^\+\s*console\.dir\(.*\)')
has_ruby_debug=$(git diff --cached | grep "^\+\s*\(require \['\"\]ruby-debug\['\"\];\?\)\?\s*debugger")
@iiska
iiska / .irbrc
Created October 8, 2010 07:12
Command history, tab completion and Rails SQL logs for script/console
# -*- mode: ruby -*-
# TAB completion for irb
require 'irb/completion'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
# Save command history to be used between multiple sessions
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
@iiska
iiska / .ackrc
Created December 29, 2011 10:47
Configuration for ack tool
--type-add=ruby=.haml,.rake
--type-add=css=.less
--type-add=coffeescript=.coffee
@iiska
iiska / lut-helper.c
Created January 11, 2012 13:19
Floating point --> Fixed point --> Bit string conversion for constellation code lookup tables
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
const double qpsk[] = {-1.0, 1.0};
const double qam16[] = {-3.0, -1.0, 3.0, 1.0};
const double qam64[] = {-7.0, -5.0, -1.0, -3.0, 7.0, 5.0, 1.0, 3.0};
/* Generic function for converting short integers to bit string
* representation.
@iiska
iiska / problem-50.scm
Created January 31, 2012 15:11
Scheme solution for Project-Euler problem 50
;; The prime 41, can be written as the sum of six consecutive primes: 41
;; = 2 + 3 + 5 + 7 + 11 + 13
;;
;; This is the longest sum of consecutive primes that adds to a prime
;; below one-hundred.
;;
;; The longest sum of consecutive primes below one-thousand that adds to
;; a prime, contains 21 terms, and is equal to 953.
;;
;; Which prime, below one-million, can be written as the sum of the most