Skip to content

Instantly share code, notes, and snippets.

$ git fetch
...
$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.andrew-working.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
@andydude
andydude / foo.foo.go
Created April 5, 2012 16:59
Smallest example of a weird build error "nested/sub.Foo: undefined: nested/sub.bar"
// file: nested/foo/foo.go
package main
import "nested/sub"
func main() {
nestedsub.Foo()
}
// filename: cmd/foo/foo.go
package main
import simple "simple"
func main() {
d := simple.GetData()
simple.PutData(d)
}
// filename: cmd/foo/foo.go
package main
import simple "simple"
func main() {
d := simple.GetData()
simple.PutData(d)
}
@andydude
andydude / core.clj
Created June 28, 2012 07:28
test-template
;; filename: src/test_template/core.clj
(ns test-template.core
(:require [clojure.java.io :as io]
[clostache.parser :as st]
[cheshire.core :as js]))
(defn render [template-filename json-filename]
(let [temp (str (line-seq (io/reader template-filename)))
data (js/parse-stream (io/reader json-filename) true)]
func error1panic(err error) {
if err != nil {
panic(err)
}
return
}
func error2panic(a Any, err error) Any {
if err != nil {
panic(err)
@andydude
andydude / StdC89Lexer.pm6
Created March 29, 2013 01:31
My first attempt at a C11 parser (ignore the filenames)
# References ISO/IEC 9899:1990 "Information technology - Programming Language C" (C89 for short)
grammar C::StdC89Lexer;
#rule TOP {
# ^ <c-token>+ $
#}
# SS 6.4
proto token c-token {*}
# This file is at C/CIntent.pm6
grammar C::CIdent;
token TOP {^ <ident> $}
# identifier
token ident { <.ident-first> <.ident-rest>* }
# identifier-nondigit
proto token ident-first {*}
token ident-first:sym<under> { '_' }
$ panda install Grammar::Debugger
==> Grammar::Debugger depends on Term::ANSIColor
==> Fetching Term::ANSIColor
==> Building Term::ANSIColor
Compiling lib/Term/ANSIColor.pm
==> Testing Term::ANSIColor
t/00-load.t .. ok
All tests successful.
Files=1, Tests=1, 1 wallclock secs ( 0.02 usr 0.01 sys + 0.72 cusr 0.19 csys = 0.94 CPU)
Result: PASS
use Grammar::Debugger;
grammar C::CInteger;
token TOP {^ <integer-constant> $}
token integer-constant {
<integer-value> <integer-suffix>*
}
proto token integer-value {*}
token integer-value:sym<8> { <octal-constant> }