Skip to content

Instantly share code, notes, and snippets.

View progrium's full-sized avatar

Jeff Lindsay progrium

View GitHub Profile

Agenda

Twitchsay

A tool that connects to Twitch chat and plays messages through say so you can hear chat while streaming.

  • Recreating prototype as standalone project, with calling say builtin
  • Add queuing
  • Figure out how to deal with crazy usernames. Not say usernames?
<script>
var pushedTime
setInterval(function() {
$.getJSON("http://api.github.com/repos/taramk/taramk.github.io", null, function(data) {
if (pushedTime != null && pushedTime != data.pushed_at) {
window.location.href = window.location.href
}
pushedTime = data.pushed_at
})
}, 3000)
@progrium
progrium / gist:a6d8f4b72fc16891bd15
Last active August 29, 2015 14:25
Found some notes sketching possible Docker commands before we (well, Solomon) settled on most of what exists today. Some made it, some didn't. Explicit layer management idea was dropped entirely.
docker run -L layer://buildlayer -L file:///tmp/appsrc.tgz build.sh
docker run --layer buildlayer --layer appsrc.tgz --export build.sh > output.tgz
docker run --layer buildlayer --layer appsrc.tgz --export-file myfile build.sh > myfile
docker start foobar "run.sh web"
docker stop foobar
docker restart foobar
docker info foobar
docker logs foobar
docker destroy foobar
render-template() {
declare filename="$1"; shift
local script k v
for var in "$@"; do
IFS='=' read k v <<< "$var"
script="s/\$\$$k/${var##${k}=}/;$script"
done
cat "$filename" | sed "$script"
}
package main
import (
"bytes"
"fmt"
"math/rand"
"time"
)
// Field represents a two-dimensional field of cells.
@progrium
progrium / bash.sh
Created February 17, 2015 14:19
Comparing natural brevity and concise expressiveness between Go and shell/Bash for certain tasks using each tool's "standard" library.
curl -s "$url" | tar -zxC "$dest"
#!/bin/sh
tail -n +6 $0 | tar -zx "$(uname -sm)"
mv "$(uname -sm)" $0
exec $0 $@
exit
( gzip data with different binaries named after output of uname -sm )
#include
https://cloud-init.gliderlabs.com/docker-cluster
export PS1="\[\033[01;31m\]\$(status=\$?; [[ \$status -ne 0 ]] && echo \"[\$status] \")\[\033[01;32m\]\u@\h \[\033[01;34m\]\w\n\$ \[\033[00m\]"
alias reload="curl -s https://gist.githubusercontent.com/progrium/6a24ae8d7ab93bc65579/raw/gistfile1.txt > ~/.profile.me; source ~/.profile"
alias g="git"
alias gpr="git pull --rebase origin"
alias gprr="git pull --rebase"
alias gpu="git push origin"
alias gpuu="git push"
alias gs="git status"
#!/usr/local/bin/bash
#nl2spc() {
# sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g'
#}
#set -x
fn-args() {
local argline=$(type $1 | grep declare | grep -v "declare desc" | head -1)