Skip to content

Instantly share code, notes, and snippets.

View vagrant up log
INFO global: Vagrant version: 1.5.1
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/bin/../embedded/gems/gems/vagrant-1.5.1/bin/vagrant"
INFO global: VAGRANT_LOG="DEBUG"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/bin/../embedded"
INFO global: VAGRANT_CPU_CORES="3"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Linux"
INFO global: VAGRANT_INSTALLER_ENV="1"
View ribosome_to_python.py
import jinja2
data = {
"EINVAL": "Invalid value",
"EMFILE": "Too many open files",
"EINTR": "Interrupted by a signal"
}
with open('errno.h', 'wt') as f:
f.write(jinja2.Template("""
View Makefile
all:
rustc mycrate.rs
RUST_BACKTRACE=1 rustc main.rs -L .
View pkg-slash-__init__.py
from . import first
from . import hello
View gist:c76f1bdf4533d8564fb8
function generator() {
var result = yield "http://google.com";
console.log(result)
}
var gen = generator()
var url = gen.next()
var req = new XMLHTTPRequest(url)
req.ondocumentstatechage = function(resp) {
gen.next(resp.responseText)
@tailhook
tailhook / hello-world.go
Created Sep 5, 2015
Hello world go server for microbenchmarks
View hello-world.go
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello World")
}
@tailhook
tailhook / io-context.rs
Last active Sep 21, 2015
quick_error_primer
View io-context.rs
#[macro_use] extern crate quick_error;
quick_error! {
#[derive(Debug)]
pub enum SomeError {
Io(err: io::Error, path: PathBuf) {
display("I/O error at {path}: {err}", err=err, path=path)
description(err.description())
}
ApplicationError
}
@tailhook
tailhook / error.rs
Created Sep 21, 2015
quick-error-example
View error.rs
#[macro_use] extern crate quick_error;
quick_error! {
#[derive(Debug)]
pub enum SomeError {
Io(err: io::Error) {
from()
display("I/O error: {}", err)
description(err.description())
}
ApplicationError
@tailhook
tailhook / context.rs
Created Sep 21, 2015
quick-error-with-context
View context.rs
#[macro_use] extern crate quick_error;
quick_error! {
#[derive(Debug)]
pub enum SomeError {
Io(err: io::Error, path: PathBuf) {
display("I/O error at {path}: {err}", err=err, path=path)
description(err.description())
}
ApplicationError
}