This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package :foo do | |
enum :test, {foo: 1, bar: 2, end: 99} | |
struct :hsv do | |
float :h | |
float :s | |
float :v | |
end | |
struct :example do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
go test -test.bench . 2> /dev/null | |
go test -tags debug -test.bench . 2> /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
command=$1 | |
TARGET="STM32F405RG" | |
TARGET_IF="swd" | |
TARGET_ADDRESS="0x08000000" | |
BUILD="build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// code for http://gowithconfidence.tumblr.com/post/31797884887/limit-buffers | |
package main | |
import ( | |
"bytes" | |
"errors" | |
"fmt" | |
"io" | |
"sync" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <mosquitto.h> | |
int main (int argc, char *argv[]) | |
{ | |
bool matches = false; | |
mosquitto_topic_matches_sub(argv[1], argv[2], &matches); | |
printf("matches: %d\n", matches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package persona | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"net/http" | |
"net/url" | |
) | |
type Auth struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
templates: | |
cd web/templates && haml-coffee -i . -n this.nd.templates -o ../js/nd-templates.js | |
css: | |
cd web/css && recess nd.less --compile > ../../public/nd.css | |
app: | |
cd web/app && coffee -cj ../js/nd.js nd.coffee | |
js: |