Skip to content

Instantly share code, notes, and snippets.

View follesoe's full-sized avatar
📱

Jonas Follesø follesoe

📱
View GitHub Profile
@follesoe
follesoe / gist:5056055
Last active December 14, 2015 08:08 — forked from lillesand/gist:5056052
window.onerror = function(errorMsg, url, lineNumber) {
alert('noobface, plz');
alert('foo');
};
@follesoe
follesoe / log.txt
Created February 3, 2013 19:51
MonoTouch installation error
Feb 3 20:48:16 Jonas-Folless-iMac.local Installer[83705]: @(#)PROGRAM:Install PROJECT:Install-735
Feb 3 20:48:16 Jonas-Folless-iMac.local Installer[83705]: @(#)PROGRAM:Installer PROJECT:Installer-614
Feb 3 20:48:16 Jonas-Folless-iMac.local Installer[83705]: Hardware: iMac11,1 @ 2.80 GHz (x 8), 8192 MB RAM
Feb 3 20:48:16 Jonas-Folless-iMac.local Installer[83705]: Running OS Build: Mac OS X 10.8.2 (12C60)
Feb 3 20:48:16 Jonas-Folless-iMac.local Installer[83705]: Env: PATH=/Applications/MonoDevelop.app:/usr/bin:/bin:/usr/sbin:/sbin
Feb 3 20:48:16 Jonas-Folless-iMac.local Installer[83705]: Env: TMPDIR=/var/folders/hf/8mgncf3x61qd6l2lrstp1m740000gn/T/
Feb 3 20:48:16 Jonas-Folless-iMac.local Installer[83705]: Env: SHELL=/bin/bash
Feb 3 20:48:16 Jonas-Folless-iMac.local Installer[83705]: Env: HOME=/Users/jonasfolles
Feb 3 20:48:16 Jonas-Folless-iMac.local Installer[83705]: Env: USER=jonasfolles
Feb 3 20:48:16 Jonas-Folless-iMac.local Installer[83705]: Env: LOGNAME=jonasfolles
@follesoe
follesoe / output.sml
Created January 18, 2013 17:42
Example of testing in SML
val true_if_first_date_is_before_second_date = " -- PASS" : string
val false_if_same_date = " -- PASS" : string
val false_if_second_date_is_after_first_date = " -- PASS" : string
@follesoe
follesoe / core.clj
Created November 27, 2012 20:36
Early work in progress for a simple genetic algorithm simulation
(ns gensim.core)
(def size 10)
(defn cls [] (print "\033\143"))
(defn indices [pred coll]
(keep-indexed #(when (pred %2) %1) coll))
(defn is-player? [cell]
(cond
@follesoe
follesoe / TicTacToeBuild.scala
Created October 3, 2012 07:24
Atempt to build a simple, distributed TicTacToe - we gave up after spending all our time on SBT/versioning troubles.
import sbt._
import sbt.Keys._
object TictactortoeBuild extends Build {
lazy val tictactortoe = Project(
id = "tictactortoe",
base = file("."),
settings = Project.defaultSettings ++ Seq(
name := "TicTActorToe",
@follesoe
follesoe / birthday.md
Created September 4, 2012 16:08
Puzzles solved in Prolog

Five sisters

Five sisters all have their birthday in a different month and each on a different day of the week. Using the clues below, determine the month and day of the week each sister's birthday falls.

  1. Paula was born in March but not on Saturday. Abigail's birthday was not on Friday or Wednesday.
  2. The girl whose birthday is on Monday was born earlier in the year than Brenda and Mary.
  3. Tara wasn't born in February and her birthday was on the weekend.
  4. Mary was not born in December nor was her birthday on a weekday. The girl whose birthday was in June was born on Sunday.
  5. Tara was born before Brenda, whose birthday wasn't on Friday. Mary wasn't born in July.

Puzzle taken from puzzelersparadise.com.

@follesoe
follesoe / fizzbuzz_spec.io
Created June 26, 2012 20:13
First spike of Jasmine.Io - a simple implementation of Jasmine BDD for Io.
getFizzBuzz := method(number,
if(number % 3 == 0 and number % 5 == 0 , return "FizzBuzz")
if(number % 3 == 0, return "Fizz")
if(number % 5 == 0, return "Buzz")
number
)
describe("FizzBuzz",
it("Should return Fizz for divisible of three",
equals("Fizz", getFizzBuzz(3))
@follesoe
follesoe / git_tips.md
Created May 22, 2012 17:01 — forked from rainly/git_tips.md
Git Tips

(Several of these git examples have been extracted from the book 'Pragmatic guide to GIT' of Travis Swicegood )

Git tips

Global git user

git config --global user.name "Fernando Guillen"
git config --global user.email "[email protected]"

Repository git user

cd /develop/myrepo

@follesoe
follesoe / RubyXmlDslExercise.md
Created May 22, 2012 16:57
Simple Ruby XML DSL exercise implemented by Torgeir and Jonas

Simple Ruby DSL to generate XML

Implemented as an exercise to learn about metaprogramming in Ruby. The DSL is implemented using instance_eval and method_missing.

Usage

require 'xmldsl'

Twitter = Struct.new :name, :avatar, :text
twitters = []
5.times { twitters << Twitter.new("Jonas", "/profile.png", "Hello World!") }
@follesoe
follesoe / TrackingViewModelCtr.cs
Created April 28, 2012 18:09
Example code for blog post on testable WP7 apps.
public TrackingViewModel() :
this(new CompassAdapter(), new GeoCoordinateWatcherAdapter())
{
}
public TrackingViewModel(ICompass compass, IGeoCoordinateWatcher geoWatcher)
{
// ...
}