Skip to content

Instantly share code, notes, and snippets.

View unfo's full-sized avatar

Jan Wikholm unfo

View GitHub Profile
(take 10 (for [n (whole-numbers) :when (even? n) ] n))
= > (2 4 6 8 10 12 14 16 18 20)
@unfo
unfo / trac-ticket.user.js
Created March 5, 2012 11:07
Extend TRAC ticket view to be 80% wide
// ==UserScript==
// @name Expand my Tickets!
// @namespace http://jw.fi/
// @version 0.1
// @description Expands Trac ticket view to be 80% wide to better fit bigger resolutions
// @match https://*trac*/*
// @copyright 2012+, Jan Wikholm
// ==/UserScript==
function addStyle(style) {
@unfo
unfo / all-minutes.sh
Created April 24, 2012 12:49
Interleave two different datapoint count csv files to fill all minutes of a day
for h in {0..23}
do
for m in {0..59}
do
# .csv format:
# 00:07,2
# 00:10,17
# this combines single.csv and all csv to so that all minutes of the day are counted
# all.csv includes single.csv numbers, but we want em separate
ts=`printf "%02d:%02d" $h $m`
@unfo
unfo / crossword.prolog
Created August 20, 2012 15:26
Learn Prolog Now, Exercises 2.3 Crossword
% 2.3
word(astante, a,s,t,a,n,t,e).
word(astoria, a,s,t,o,r,i,a).
word(baratto, b,a,r,a,t,t,o).
word(cobalto, c,o,b,a,l,t,o).
word(pistola, p,i,s,t,o,l,a).
word(statale, s,t,a,t,a,l,e).
crossword(V1, V2, V3, H1, H2, H3) :-
word(V1, _,V1H1,_,V1H2,_,V1H3,_),
#date: 03/30/2005
#title: Charlie the Smiling Fish
#author: Jan Wikholm
#email: jw at jw dot fi
#comments: This was written in <6hrs once I heard I might actually have a chance at the prizes ;)
#----------------------------------------
#code:
# Hello IORCC judges.
module IORCC_entry
extend self
alias g='git'
alias ga='git_add_shortcuts'
alias gb='exec_scmb_expand_args _scmb_git_branch_shortcuts'
alias gba='exec_scmb_expand_args _scmb_git_branch_shortcuts -a'
alias gca='git_commit_all'
alias gf='git fetch'
alias gg='git status'
alias git_aliases='list_aliases git'
alias gp='git push origin master'
alias grb='git rebase origin/master'
@unfo
unfo / eol.sh
Created April 23, 2013 07:10
Naive CR/CRLF checker script
#!/bin/bash
grep -r $'\r' -l $1 > /dev/null
if [ $? -eq 0 ]; then
echo "Windows"
else
echo "Linux"
fi
(╯°□°)╯︵ ┻━┻
(ノ`Д´)ノ彡┻━┻
┻━┻ ︵ヽ(`Д´)ノ︵ ┻━┻
(ノ ಠ益ಠ)ノ~ (\;。▽。)ヽ
∠( ゚д゚)/
@unfo
unfo / gist:5922361
Last active December 19, 2015 07:59 — forked from vuorejo1/gist:5922213
# Implement a DiceSet Class here:
class DiceSet
def initialize
@noppaluvut = []
end
def roll(montako)
@noppaluvut = []
# if montako.size == 0 || montako.size > 6
# raise error?
1.8.7 :001 > class Foo
1.8.7 :002?> attr_accessor :bar
1.8.7 :003?> end
=> nil
1.8.7 :004 > f = Foo.new
=> #<Foo:0x10d893ec0>
1.8.7 :005 > f.bar
=> nil
1.8.7 :006 > f.bar = 'kek'
=> "kek"