Skip to content

Instantly share code, notes, and snippets.

View yoshuawuyts's full-sized avatar

Yosh yoshuawuyts

View GitHub Profile

TAP version 13

Platform

ok 1 (unnamed assert) Node.js 6.2.1 on Linux 64-bit

1..1

tests 1

pass 1

ok

Tests

✔ Platform [pass: 1, fail: 0, duration: 1ms]
✔ init [pass: 22, fail: 0, duration: 1ms]
✔ emit [pass: 27, fail: 0, duration: 12ms]
✔ emit with context [pass: 42, fail: 0, duration: 5ms]
✔ emit one value - two listeners [pass: 57, fail: 0, duration: 2ms]
✔ emit one value - one listener [pass: 40, fail: 0, duration: 1ms]
✔ emit many listeners [pass: 30, fail: 0, duration: 1ms]
@yoshuawuyts
yoshuawuyts / formdata.js
Created June 21, 2016 01:15
Trying to add items to a list
const choo = require('choo')
const app = choo()
function view (params, state, send) {
return choo.view`
<main>
@yoshuawuyts
yoshuawuyts / .profile
Created April 6, 2016 03:29 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@yoshuawuyts
yoshuawuyts / Q&A.md
Created March 16, 2016 05:58 — forked from novaluke/0-Q&A.md
I want to use Nix for development, but... -- answers to common concerns about Nix

Nix seems perfect for developers - until I try to use it...

Want to use Nix for development but you're not sure how? Concerned about the fluidity of nixpkgs channels or not being able to easily install arbitrary package versions?

When I first heard about Nix it seemed like the perfect tool for a developer. When I tried to actually use it for developing and deploying web apps, though, the pieces just didn't seem to add up.

var wswarm = require('webrtc-swarm')
var signalhub = require('signalhub')
var swarm = wswarm(signalhub(
'swarmchat-example',
['https://signalhub.mafintosh.com']
))
var randombytes = require('randombytes')
var vdom = require('virtual-dom')
var h = vdom.h
@yoshuawuyts
yoshuawuyts / TAP.rs
Created February 22, 2016 10:21 — forked from chromatic/gist:8467580
A very basic, procedural TAP library for the Rust language (hardly idiomatic, but it's my second day)
#[crate_id(name = "rusttap")];
#[crate_type = "lib"];
#[feature(globs)];
#[desc = "TAP implementation for rust"];
#[license = "BSD"];
#[allow(dead_code)];
#[allow(unused_variable)];
pub mod rusttap {
use std::io;
@yoshuawuyts
yoshuawuyts / README
Created January 19, 2016 05:46 — forked from rkusa/README
Install alpine linux on xhyve VM
# curl -LO http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.3/releases/x86_64/alpine-3.3.1-x86_64.iso
curl -LO http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.3/releases/x86/alpine-3.3.1-x86.iso
# create hdd image (8GB)
dd if=/dev/zero of=hdd.img bs=1g count=8
# extract kernel and initramfs
brew install cdrtools
isoinfo -i alpine-3.3.1-x86.iso -J -x /boot/initramfs-grsec > initramfs-grsec
isoinfo -i alpine-3.3.1-x86.iso -J -x /boot/vmlinuz-grsec > vmlinuz-grsec
@yoshuawuyts
yoshuawuyts / iccat.sh
Created January 6, 2016 23:16 — forked from heapwolf/iccat.sh
Download and show image in terminal (iterm2 only)
#!/bin/bash
function print_image() {
printf "\033]"
printf "1337;File="
echo -n "$1" | base64 -D | wc -c | awk '{printf "size=%d",$1}'
printf ";inline=1:"
echo -n "$1"
printf "\a\n"
}
#!/bin/sh
VERSION="1.0"
AUTHOR="John Doe"
COPYRIGHT_YEAR="2000"
SCRIPT_NAME="example"
# or maybe SCRIPT_NAME="$(basename "$0")"
show_usage() {