Skip to content

Instantly share code, notes, and snippets.

View henrikh's full-sized avatar

Henrik Enggaard henrikh

  • Denmark
View GitHub Profile
\documentclass[a4paper,12pt]{memoir}
\usepackage{threeparttable} % Tabelnoter
\usepackage[latin1]{inputenc} % så må vi bruge æøå
\begin{document}
\begin{table}[!ht]
\centering
\caption{Driftsoplæg ved basisscenariet, eksisterende infrastruktur og togmængde}
\label{tab:togbasis}
List mySort := method(
if(size <= 1,
yield
self,
list(
select(v, v < self at(1)) mySort,
select(v, v >= self at(1)) mySort
) flatten
)
)

Using the latest Chrome Beta (11.0.696.16 beta) and the new HTML5 Speech Input features, we can jump into the future with Wolfram|Alpha.

Make a bookmark with the code below as the source.

javascript:(function(){javascript:input=$('input');
['','webkit','x-webkit-'].map(function(prefix){input.attr(prefix+'speech','').bind(prefix+'speechchange',
function(e){$('form:first').submit()})})})();

Navigate to Wolfram|Alpha, click the bookmark.

def add
+ #1 #2
end
set a 5
puts add 2 5 // prints: 7
require "dbus"
require "notify"
require "thread"
Thread.abort_on_exception = true
def notify(msg)
puts msg
Notify.notify msg, ""
end
@henrikh
henrikh / gist:729402
Created December 5, 2010 19:48
One of the tasks for 7 PL in 7 Weeks
a = (1..16)
stash = []
a.each {|e| p stash[-4..-1] if stash.push(e).count % 4 == 0}
SET n TO 0
PRINT "Hello, World!"
IFEQUAL n 5
NOGO 5
GOTO 2
PRINT "Done!"
# !/bin/bash
# # figlet-dialog - A "graphical" figlet frontend.
# ## Intro
# So I wanted to learn some shell/bash scripting. I found this
# program called `dialog`, which would allow me to make "GUI"s in
# shell, so I decided to make something with it.
# The following program is a `figlet` GUI. It will display a textbox
@henrikh
henrikh / gist:578909
Created September 14, 2010 11:49
I had a folder images I needed to resize, I used this shell script to do so.
#!/bin/bash
#I had a folder images I needed to resize, I used this shell script to do so.
for f in *.JPG
do
echo -n "Resizing $f... "
convert $f -resize 256x256 s-$f
mv s-$f small/
echo "Done"
Hvad er meningen?
Selektiv
Negativ
Stiv
Mangel på liv