Skip to content

Instantly share code, notes, and snippets.

{
"body": [
{
"Contract": {
"kind": {
"name": {
"kind": "ERC20",
"span": {
"start": 9,
"end": 14
@sbillig
sbillig / Makefile
Created January 28, 2014 18:46
C++ starter Makefile
CXX := clang++
CXXFLAGS := -isystem ./external -std=c++11 -stdlib=libc++ -MMD -MP \
-Wall -Wpedantic -Wextra -Weffc++ -O3
SRCS := $(wildcard src/*.cpp)
OBJS := $(SRCS:.cpp=.o)
TESTSRCS := $(wildcard tests/*.cpp)
TESTOBJS := $(TESTSRCS:.cpp=.o)
TESTOBJS += $(filter-out src/main.o,$(OBJS))
@sbillig
sbillig / gist:5287073
Created April 1, 2013 19:26
Rust str each_char error.
use core::str::*;
fn main() {
let s = ~"hello";
let f = |ch| { io::println(fmt!("%?",ch)); true };
// Works:
each_char(s, f);
// Fails:
// s.each_char(f);
@sbillig
sbillig / gist:5272756
Last active December 15, 2015 14:09 — forked from thomaslee/gist:4753338
Dumb "Hello World" TCP server in Rust. Updated for Rust 0.6
extern mod std;
use std::net;
use std::uv;
type ErrChan = comm::SharedChan<Option<net::tcp::TcpErrData>>;
fn on_ready(_kill_ch: ErrChan) {
io::println("listener is ready");
}