Skip to content

Instantly share code, notes, and snippets.

View stianeikeland's full-sized avatar

Stian Eikeland stianeikeland

View GitHub Profile
@stianeikeland
stianeikeland / Program.cs
Created November 30, 2012 10:10
RabbitMQ consumer/producer
using System;
using System.Reactive.Linq;
using System.Text;
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
namespace RabbitTest
{
class Program
{
@stianeikeland
stianeikeland / test.md
Created December 20, 2012 11:43
Markdown gist.io test

Dette er en test

Bacon ipsum dolor sit amet meatball tongue turkey ribeye. Ribeye meatball kielbasa pork turkey bresaola pork belly tongue, shoulder andouille beef ribs fatback. Capicola tri-tip bresaola, meatball drumstick leberkas sausage filet mignon andouille tongue beef strip steak jerky cow. Short loin sausage leberkas, ham rump meatball ball tip. Andouille turkey sirloin strip steak kielbasa short ribs, boudin ground round fatback sausage beef doner.

Corned beef cow prosciutto leberkas shankle, capicola boudin. Flank bacon pancetta brisket capicola beef ball tip beef ribs boudin short loin shank tail. Pork pastrami short loin bacon sausage meatball t-bone pork belly bresaola pork chop jerky meatloaf brisket kielbasa. Pork belly ball tip strip steak leberkas tongue. Ball tip jowl meatball brisket.

Sausage flank venison shoulder, meatball brisket jerky capicola salami pancetta pastrami swine pork loin biltong. Spare ribs ground round shank, drumstick t-bone corned beef sausage hamburger. Pork salami

@stianeikeland
stianeikeland / redirect-news.user.js
Created February 28, 2013 11:30
Avoid the stupid celebrity news at vg.no / db.no
// ==UserScript==
// @name          redirect
// @description    redirect
// @include        http://www.vg.no/
// @include http://www.dagbladet.no/
// @version        1.0
// ==/UserScript==
if (window.location == 'http://www.vg.no/')
window.location = 'http://www.vg.no/nyheter/'

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@stianeikeland
stianeikeland / fromRoman.coffee
Created April 4, 2013 10:16
Bergen coding dojo - Roman numerals
_ = require 'underscore'
class FromRomanNumerals
baseValues: {
"I": 1
"V": 5
"X": 10
"L": 50
@stianeikeland
stianeikeland / test.md
Last active December 19, 2015 00:09
Tasklist
  • this is a complete item
  • this is an incomplete item
import png
import random
imgsize = 900
img = [[random.randint(0, 255) for x in range(imgsize)] for y in range(imgsize)]
f = open('rnd.png', 'wb')
w = png.Writer(imgsize, imgsize, greyscale=True)
w.write(f, img)
// A concurrent prime sieve
package main
// Send the sequence 2, 3, 4, ... to channel 'ch'.
func Generate(ch chan<- int) {
for i := 2; ; i++ {
ch <- i // Send 'i' to channel 'ch'.
}
}
package main
import (
"fmt"
"github.com/PuerkitoBio/goquery"
"strconv"
"strings"
)
func GetFloridaFloat(datarows *goquery.Selection, field int) (data float64, err error) {
package main
import (
"fmt"
"os"
"reflect"
"syscall"
"unsafe"
)