Skip to content

Instantly share code, notes, and snippets.

View eagleflo's full-sized avatar

Aku Kotkavuo eagleflo

View GitHub Profile

Keybase proof

I hereby claim:

  • I am eagleflo on github.
  • I am eagleflo (https://keybase.io/eagleflo) on keybase.
  • I have a public key whose fingerprint is BB68 7DB7 4A4D 13A3 93C3 AD8E E496 3242 172A 95E1

To claim this, I am signing this object:

@eagleflo
eagleflo / posts.clj
Created August 13, 2014 13:39
Simple templating with Clojure using enlive
(ns eagleflow.posts
(:require [markdown.core :refer [md-to-html-string]]
[net.cgrand.enlive-html :as html]))
(defn single
"Return a single post from the file system as HTML."
[date title]
(md-to-html-string (slurp (str "posts/" date "-" title ".md"))))
(html/deftemplate post (clojure.java.io/file "public/index.html")
@eagleflo
eagleflo / extract-cards.py
Created July 20, 2014 15:25
Hearthstone cards.xml extraction script
#!/usr/bin/env python
"""
Place this script in the same directory as cardxml0.unity3d, which can be
found under Hearthstone data files. Then chmod a+x and run it.
See https://eagleflow.fi/posts/2014-07-19/hearthstone-cards for more details.
"""
import re
@eagleflo
eagleflo / null.cljs
Created May 13, 2013 16:14
js/null in ClojureScript 0.0-1806
; This fails with Uncaught ReferenceError: null$ is not defined
(defn foo [bar] (if (== js/null bar) "foo" "bar"))
;#<
;function foo(bar) {
; if ((null$ === bar)) {
; return "foo";
; } else {
; return "bar";
; }
;}
@eagleflo
eagleflo / gist:5188261
Created March 18, 2013 16:01
Emacs hard crash with clojure-mode and autocomplete
Process: Emacs [671]
Path: /usr/local/Cellar/emacs/24.3/Emacs.app/Contents/MacOS/Emacs
Identifier: org.gnu.Emacs
Version: Version 24.3 (9.0)
Code Type: X86-64 (Native)
Parent Process: launchd [232]
User ID: 501
Date/Time: 2013-03-18 17:59:25.064 +0200
OS Version: Mac OS X 10.8.3 (12D78)
@eagleflo
eagleflo / gist:4137586
Created November 23, 2012 22:31
MacBook Air 11" late 2010 hard crash
Interval Since Last Panic Report: 518338 sec
Panics Since Last Report: 1
Anonymous UUID: 0718864D-F6BD-A0E9-75FF-6F535BA9474A
Sat Nov 24 00:30:03 2012
panic(cpu 0 caller 0xffffff80162b7bd5): Kernel trap at 0xffffff7f96a53d39, type 14=page fault, registers:
CR0: 0x000000008001003b, CR2: 0xffffff801ff470b8, CR3: 0x0000000018eab000, CR4: 0x0000000000000660
RAX: 0x0000000000000001, RBX: 0x0000000000000000, RCX: 0x0000000000000000, RDX: 0x00000000deadbeef
RSP: 0xffffff805687b5a0, RBP: 0xffffff805687b5e0, RSI: 0xffffff801ff45004, RDI: 0xffffff801ff45004
R8: 0x00000000deadbeef, R9: 0x00000000deadbeef, R10: 0x0000000000000000, R11: 0xffffff8046d8d000
@eagleflo
eagleflo / Problem Report
Created October 22, 2012 13:37
Git send-email Perl crash
Process: perl5.12 [44259]
Path: /usr/bin/perl5.12
Identifier: perl5.12
Version: 77.2
Code Type: X86-64 (Native)
Parent Process: git [44258]
User ID: 501
Date/Time: 2012-10-22 16:31:42.738 +0300
OS Version: Mac OS X 10.8.2 (12C60)
@eagleflo
eagleflo / arkx.zsh-theme
Created August 8, 2012 08:38
My ZSH theme
PROMPT='%{$fg[green]%}%~ $(git_prompt_info)%{$reset_color%}$ '
if [[ `hostname -f` == *eagleflow.fi ]]; then
PROMPT='%{$fg[cyan]%}[%M]%{$reset_color%}:'$PROMPT
fi
LSCOLORS=''
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[yellow]%}✗%{$fg[red]%})%{$reset_color%}"
@eagleflo
eagleflo / gist:2708230
Created May 16, 2012 07:09
MacBookPro6,2 hard lockup after trying to wake from sleep
Interval Since Last Panic Report: 184341 sec
Panics Since Last Report: 1
Anonymous UUID: CCF0AC9C-BA96-488A-A335-4A608F76321D
Wed May 16 10:05:30 2012
panic(cpu 1 caller 0xffffff80002c473a): Kernel trap at 0xffffff7f8077fb23, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0x0000000000000078, CR3: 0x0000000020890038, CR4: 0x00000000000206e0
RAX: 0x0000000000000020, RBX: 0xffffff801afb0610, RCX: 0x0000000000000020, RDX: 0xffffff80141ce310
RSP: 0xffffff811712bae0, RBP: 0xffffff811712baf0, RSI: 0xffffff801afb0610, RDI: 0xffffff80141ce310
R8: 0x0000000000000000, R9: 0x0000000000000000, R10: 0xffffff8014aef000, R11: 0xffffff800086eb70
@eagleflo
eagleflo / 09052012
Created May 9, 2012 10:58
iTerm 2 + zsh + close ssh tab kernel panic
Interval Since Last Panic Report: 579029 sec
Panics Since Last Report: 1
Anonymous UUID: B0298408-47AF-4111-B72D-A2CCD32099B4
Wed May 9 13:53:55 2012
panic(cpu 2 caller 0xffffff8000328af2): "Negative open count?"@/SourceCache/xnu/xnu-1699.24.23/bsd/miscfs/specfs/spec_vnops.c:1368
Backtrace (CPU 2), Frame : Return Address
0xffffff80f1733c10 : 0xffffff8000220702
0xffffff80f1733c90 : 0xffffff8000328af2
0xffffff80f1733cd0 : 0xffffff800032c895