Skip to content

Instantly share code, notes, and snippets.

runtime: morestack on g0, stack [0x400068a000 0x400068c000], sp=0x400068a360, called from
runtime: g 0: unexpected return pc for runtime.callers.func1 called from 0x1000078924
stack: frame={sp:0x400068a580, fp:0x400068a7a0} stack=[0x400068a000,0x400068c000)
0x000000400068a480: 0x00000000000834f8 <runtime.callers+0x0000000000000078> 0x000000400068a4c8
0x000000400068a490: 0xca151ccd62f39c26 0xa17935b73a3c927a
0x000000400068a4a0: 0x0d305e1b159d03d0 0xffffffff00000001
0x000000400068a4b0: 0x00000000ffffffff 0x000000400068a588
0x000000400068a4c0: 0x0000000000080644 <runtime.(*unwinder).initAt+0x0000000000000354> 0x000000000210c0b8
0x000000400068a4d0: 0x00000000024d3d60 0x0000000000049d94 <runtime.mProf_Malloc+0x0000000000000054>
0x000000400068a4e0: 0x0000000000000000 0x0000000000000000
@dmac
dmac / repl.clj
Last active October 6, 2017 00:03
user=> (= (byte \a) (byte 97))
true
user=> (set! *unchecked-math* true)
:warn-on-boxed
user=> (= (byte \a) (byte 97))
ClassCastException java.lang.Character cannot be cast to java.lang.Number clojure.lang.RT.uncheckedByteCast (RT.java:1340)
@dmac
dmac / test.pb.go
Created May 10, 2016 21:41
gogofast map not in package bug
// Code generated by protoc-gen-gogo.
// source: test.proto
// DO NOT EDIT!
/*
Package test is a generated protocol buffer package.
It is generated from these files:
test.proto
int main(void) {
int x = 1;
x = x + 0.1;
}
@dmac
dmac / inventory
Created March 20, 2015 00:32
ansible group vars
[group1]
localhost
[group1:vars]
n = 1
[group2]
localhost
[group2:vars]
@dmac
dmac / test.yml
Last active August 29, 2015 14:09
ansible lineinfile
- name: test playbook
hosts: localhost
tasks:
- name: test lineinfile
local_action: lineinfile dest="{{ playbook_dir }}"/test.txt state=present line=foo create=yes
# failed: [127.0.0.1 -> 127.0.0.1] => {"failed": true}
# msg: missing required arguments: regexp
@dmac
dmac / main.rs
Last active January 3, 2016 23:08
rust collect
use std::hashmap::HashMap;
fn main() {
let v = [("a", 1), ("b", 2), ("c", 3)];
let m: HashMap<~str, int> = v.iter().map(|&(s, n)| (s.to_owned(), n)).collect();
let keys = [~"a", ~"b", ~"c"];
for k in keys.iter() {
println!("{:?}: {:?}", k, m.get(k));
}
}
@dmac
dmac / main1.rs
Last active January 3, 2016 12:39
borrowed value lifetimes
fn main() {
println!("{:?}", format!("{}", 1).as_bytes());
}
/*
main.rs:2:22: 2:39 error: borrowed value does not live long enough
main.rs:2 println!("{:?}", format!("{}", 1).as_bytes());
^~~~~~~~~~~~~~~~~
main.rs:2:14: 2:20 note: reference must be valid for the block at 2:13...
main.rs:2 println!("{:?}", format!("{}", 1).as_bytes());
@dmac
dmac / etc hosts
Created October 17, 2013 13:17
ansible host module: aliases and changed status
127.0.0.1 localhost
@dmac
dmac / gist:6996258
Created October 15, 2013 18:25
ansible dict iteration
---
- hosts: localhost
vars:
- foo:
a: 1
b: 2
c: 3
tasks:
- debug: msg="{{ item }} is {{ foo[item] }}"
with_items: foo|list