Skip to content

Instantly share code, notes, and snippets.

View beeryardtech's full-sized avatar

Travis Goldie beeryardtech

View GitHub Profile
@beeryardtech
beeryardtech / constuctor.js
Last active September 5, 2017 14:59
How to create a dynamic constructor without needing caller to use "new"
function X(a, b, c) {
console.log(a, b, c);
}
var c = (n, Fn) => {
return function() {
var a = _.toArray(arguments);
var t = _.times(n, (n) => {
return 'a[' + n + ']'
});
@beeryardtech
beeryardtech / tmux.poc.sh
Created May 9, 2016 16:29
Tmux POC - detach-client going wonky
#!/bin/bash
SESSION=tmuxtest
tmux_new_or_attach()
{
local session=$1
tmux has-session -t "$session" > /dev/null 2>&1
should_attach=$?
if [[ "$should_attach" == 0 ]] ; then