Skip to content

Instantly share code, notes, and snippets.

View kitofr's full-sized avatar

Kristoffer Roupé kitofr

  • Stockholm, Sweden
View GitHub Profile
@kitofr
kitofr / extract.clj
Created July 27, 2011 15:27
Extract data from a pivotal tracker project with Clojure CLR
(import '(System.Reflection Assembly))
(Assembly/LoadWithPartialName "System.Xml")
(import '(System.Xml XmlDocument))
(import '(System DateTime))
(def yaml "\ntype: %s\nname: %s\ncreated at: %s\naccepted at: %s\n")
(def csv "%s;%s;%s;%s\n")
(def types '("release" "feature" "bug"))
(def xml (doto (XmlDocument.) (. Load "11621.xml")))
@kitofr
kitofr / gist:1220144
Created September 15, 2011 18:59
game of life?
(def width 50)
(def height 50)
(defn populated? [pos]
true)
(defn unpopulated? [pos]
false)
(defn neighbors [pos]
@kitofr
kitofr / index.html
Created September 26, 2013 12:52
Plunker that "wroks" with file upload directive... this does *NOT* work on my machine, it causes >Error: InvalidStateError: DOM Exception 11 Error: An attempt was made to use an object that is not, or is no longer, usable.
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<div ng-controller="MyCtrl">
1) test convert (Hashish.Test)
** (ExUnit.ExpectationError)
expected: [project: [[[:id, "_Root"], [[:name, "<Root project>"], [[:href, "/guestAuth/app/rest/projects/id:_Root"]]]], [[[:id, "AmazonApiClient"], [[:name, "Amazon API client"], [[:href, "/guestAuth/app/rest/projects/id:AmazonApiClient"]]]]]]]
to be equal to (===): [project: [[id: "_Root", name: "<Root project>", href: "/guestAuth/app/rest/projects/id:_Root"], [id: "AmazonApiClient", name: "Amazon API client", href: "/guestAuth/app/rest/projects/id:AmazonApiClient"]]]
at test/tcbot_test.exs:15
@kitofr
kitofr / kill_ruby.bat
Last active August 29, 2015 14:03
A simple script to kill off "hanging" ruby processes
ruby %~dp0kill_ruby_processes.rb
@kitofr
kitofr / Gemfile
Last active August 29, 2015 14:08
OSX extras
source "https://rubygems.org"
gem 'rake'
@kitofr
kitofr / reset_homebrew_cask.sh
Created March 20, 2015 21:00
homebrew cask reset
brew untap caskroom/cask && brew update && brew cleanup --force -s && rm -rf "$(brew --cache)" && brew tap caskroom/cask

Keybase proof

I hereby claim:

  • I am kitofr on github.
  • I am kitofr (https://keybase.io/kitofr) on keybase.
  • I have a public key ASDQ8PkOWBRCiPQhiDgUCuhcMr6LFb6j8aRR8gqnpQvQeAo

To claim this, I am signing this object:

@kitofr
kitofr / MITPlanck.md
Created April 25, 2017 06:19
Empty planck scaffold

MIT Layout

Name:

 ,-----------------------------------------------------------------------.
 |     |     |     |     |     |     |     |     |     |     |     |     |
 |-----------------------------------------------------------------------|
 |     |     |     |     |     |     |     |     |     |     |     |     |
 |-----------------------------------------------------------------------|
 | | | | | | | | | | | | |
test =
describe "State machine"
[
test "[A,A,A] should be False" <|
\() ->
Expect.equal (decide [A, A, A]) False
, test "[A,A,A,A,B,B,A,A,A] should be True" <|
\() ->
Expect.equal (decide [A,A,A,A,B,B,A,A,A]) True
, test "[B,A,B,A,B,A] should be False" <|