Skip to content

Instantly share code, notes, and snippets.

View wolverian's full-sized avatar

Ilmari Vacklin wolverian

View GitHub Profile
function! ToggleOnly()
let l:view = winsaveview()
if search("\\v( |^)(it|describe)", "b")
if search("\\.only", "c", line("."))
%s/\.only//g
else
let l:cur = getpos(".")
%s/\.only//ge
call setpos(".", l:cur)
@wolverian
wolverian / gist:5929197
Created July 4, 2013 17:18
brew doctor and config
iv@blindsight ~/plan9port> brew doctor
Warning: Experimental support for using Xcode without the "Command Line Tools".
You have only installed Xcode. If stuff is not building, try installing the
"Command Line Tools" package provided by Apple.
iv@blindsight ~/plan9port> brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 3a17f96c8f428a8de8c00b5c80e9f4c40fb19630
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
@wolverian
wolverian / genbuffer.go
Created March 30, 2013 19:03
go-gl GenBuffer sigsegv
package main
import (
"github.com/go-gl/gl"
)
func main() {
buf := gl.GenBuffer()
println(buf)
}
@wolverian
wolverian / casper-function-passing.js
Created September 12, 2012 09:48
CasperJS: passing a function to casper.evaluate() passes undefined instead
var casper = require('casper').create({
verbose: true,
logLevel: 'debug'
});
casper.start('http://www.google.com', function() {
console.log('opened page');
this.on('page.error', function(msg, backtrace) {
this.echo("Error: " + msg, "ERROR");
require "thread"
class Future
attr_reader :exception, :cancelled
def initialize(&block)
@thread = Thread.new(&block)
@thread.abort_on_exception = false
@exception = nil
@cancelled = false
@wolverian
wolverian / gist:1949145
Created March 1, 2012 11:17
brew install -vd git-flow
~ brew install -vd git-flow
==> Cloning https://github.com/nvie/gitflow.git
git clone --depth 1 https://github.com/nvie/gitflow.git /Users/wolverian/Library/Caches/Homebrew/git-flow--git
Cloning into '/Users/wolverian/Library/Caches/Homebrew/git-flow--git'...
remote: Counting objects: 324, done.
remote: Compressing objects: 100% (244/244), done.
remote: Total 324 (delta 101), reused 247 (delta 42)
Receiving objects: 100% (324/324), 229.24 KiB | 193 KiB/s, done.
Resolving deltas: 100% (101/101), done.
==> Checking out tag 0.4.1
Buildfile: /Users/wolverian/src/kotlin/build.xml
clean:
[delete] Deleting directory /Users/wolverian/src/kotlin/dist
init:
[mkdir] Created dir: /Users/wolverian/src/kotlin/dist/kotlinc
[mkdir] Created dir: /Users/wolverian/src/kotlin/dist/kotlinc/lib
[mkdir] Created dir: /Users/wolverian/src/kotlin/dist/kotlinc/lib/alt
@wolverian
wolverian / gist:1401598
Created November 28, 2011 19:15
use highlight.js
<script src="http://yandex.st/highlightjs/6.1/highlight.min.js"></script>
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.1/styles/github.min.css">
@wolverian
wolverian / Problem.scala
Created February 18, 2011 02:08
I'm confused about the Scala parser combinator libraries
package wolv.parserlibproblem
import util.parsing.ast.AbstractSyntax
import util.parsing.combinator.syntactical.TokenParsers
import util.parsing.combinator.lexical.Lexical
import util.parsing.combinator.token.Tokens
trait SimpleTokens extends Tokens {
case class Foo extends Token
case class Bar extends Token