Skip to content

Instantly share code, notes, and snippets.

View progrium's full-sized avatar

Jeff Lindsay progrium

View GitHub Profile
// magical github automation
//
// add hooks similar to below based on:
// https://developer.github.com/v3/activity/events/types/
//
// use github object according to docs:
// http://mikedeboer.github.io/node-github/
const Promise = require("bluebird");
### Keybase proof
I hereby claim:
* I am progrium on github.
* I am progrium (https://keybase.io/progrium) on keybase.
* I have a public key ASB2MPQoPvuUzt8zs32FR4O4CsNGhUbG32YZkvqC5A-4-Ao
To claim this, I am signing this object:
cd /tmp
rm hello.cmd
rm http.cmd
ssh cmd.io :delete hello
ssh cmd.io :delete http
source ~/.profile.d/demo
clear
[wait 2]# Let's build two quick commands with Cmd.io!
# First,[wait] a simple command that says hello.
# blah blah blah
deps-update: ## update dependencies if changed
./dev/deps.sh
deps-go:
glide install
git log -n 1 --pretty=format:%h -- glide.yaml > .git/deps-go
deps-js:
FROM alpine
RUN apk add --update wget unzip ca-certificates
RUN cd /tmp && wget -q https://releases.hashicorp.com/terraform/0.7.2/terraform_0.7.2_linux_amd64.zip \
&& unzip terraform_0.7.2_linux_amd64.zip \
&& mv terraform /bin \
&& rm terraform_0.7.2_linux_amd64.zip
COPY ./tf /bin/tf
ENTRYPOINT ["/bin/tf"]
@progrium
progrium / gist:6ec40a63549e25196dcee824e9407f54
Created August 31, 2016 18:42
make an empty branch (destroy) on a bare repo
#!/bin/bash
blob="$(git hash-object -w --stdin < /dev/null)"
git update-index --add --cacheinfo 0644 "$blob" file
tree="$(git write-tree)"
commit="$(echo file | git commit-tree $tree)"
git update-ref refs/heads/destroy $commit
package main
import (
"io"
"github.com/progrium/automata/pkg/ssh"
)
func main() {
ssh.ListenAndServe(":2222", func(s ssh.Session) {
@progrium
progrium / 0.before.md
Last active August 13, 2016 00:29
execute and insert commands found in markdown inside ``` starting with #!

Hello world

#! ls -la
USER-GIVEN INFO:
I was starting a game; selected (perhaps too many?) modules, and then pressed play. The game crashed while generating the game for the first time.
ERROR STACK TRACE:
15:52:20.322 [main] ERROR org.terasology.assets.AssetType - Asset instances remained loaded after disposal - [engine:messagePopup!instance, engine:confirmPopup!instance, engine:waitPopup!instance]
15:52:20.955 [main] INFO o.t.e.m.loadProcesses.RegisterMods - Activating module: engine:1.2.0
15:52:20.956 [main] INFO o.t.e.m.loadProcesses.RegisterMods - Activating module: Core:1.2.1-SNAPSHOT
15:52:20.956 [main] INFO o.t.e.m.loadProcesses.RegisterMods - Activating module: AlterationEffects:0.2.0-SNAPSHOT
15:52:20.956 [main] INFO o.t.e.m.loadProcesses.RegisterMods - Activating module: ClimateConditions:0.1.1-SNAPSHOT
15:52:20.956 [main] INFO o.t.e.m.loadProcesses.RegisterMods - Activating module: AnotherWorld:0.2.0-SNAPSHOT
@progrium
progrium / 0_demo
Last active February 18, 2016 13:36
11 lines that makes interactively using asyncio libraries nice again
$ python3 -i shellasync.py
>>> import websockets
>>> websockets.connect("ws://localhost:8000/echo")
<websockets.client.WebSocketClientProtocol object at 0x1041a34e0>
>>> ws = _ # only caveat is assignment has to be done after
>>> ws.send("Hello world")
None
>>> ws.recv()
'Hello world'
>>>