Debian Jessie buildkite agent when networking is up.
/etc/systemd/system/buildkite-agent.service
// code for http://gowithconfidence.tumblr.com/post/31797884887/limit-buffers | |
package main | |
import ( | |
"bytes" | |
"errors" | |
"fmt" | |
"io" | |
"sync" |
#include "flags.h" | |
#define isopt(text) strncmp(text, "--", 2) == 0 | |
#define isneg(text) strncmp(text, "--no-", 4) == 0 | |
flags_t *flags_parse(int argc, char *argv[]) { | |
int n; | |
char *option, *value; | |
flags_t *flags = NULL, *flag; |
#!/bin/sh | |
go test -test.bench . 2> /dev/null | |
go test -tags debug -test.bench . 2> /dev/null |
/* | |
Router. | |
Unlike larger projects (crossroads-min.js ~6.8kb, davis-min.js ~10kb, ...) | |
this router <1kb is intended to do one thing well; route. No events, | |
listeners, loggers, history or any other bullshit just a way to execute | |
callbacks by path. | |
@example | |
// document.location.pathname #=> /posts/media/2 |
package :foo do | |
enum :test, {foo: 1, bar: 2, end: 99} | |
struct :hsv do | |
float :h | |
float :s | |
float :v | |
end | |
struct :example do |
// Has the advantage of not needing a temp buffer. | |
#define BINARY_8_FORMAT \ | |
"%d%d%d%d%d%d%d%d" | |
#define BINARY_8_PARAMS(byte) \ | |
(byte & 0x80 ? 1 : 0), \ | |
(byte & 0x40 ? 1 : 0), \ | |
(byte & 0x20 ? 1 : 0), \ | |
(byte & 0x10 ? 1 : 0), \ | |
(byte & 0x08 ? 1 : 0), \ |
#!/bin/bash | |
set -e | |
command=$1 | |
TARGET="STM32F405RG" | |
TARGET_IF="swd" | |
TARGET_ADDRESS="0x08000000" | |
BUILD="build" |
#!/usr/bin/env sh | |
# Setup Go environment. | |
# | |
# source ~/local/bin/go-env | |
# http://superuser.com/questions/39751/add-directory-to-path-if-its-not-already-there | |
__util_env_path_prepend() { | |
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then | |
PATH="$1:$PATH" |
# [ -e ~/.config/short-prompt.sh ] && source ~/.config/short-prompt.sh | |
export GIT_PS1_SHOWDIRTYSTATE=true | |
__git_ps1() { PS1="$1$2"; } | |
[ -e ~/.config/git-prompt.sh ] && source ~/.config/git-prompt.sh | |
__short_ps1() { | |
local exit=$? | |
local __short_ps1_host="" | |
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then |