Skip to content

Instantly share code, notes, and snippets.

@jtwb
jtwb / install_makemkv.sh
Created July 7, 2016 04:05
install_makemkv_ubuntu.sh
#!/bin/bash
set +x
set -e
sudo -v
pushd `mktemp -d`
wget "http://www.makemkv.com/download/makemkv-bin-1.9.10.tar.gz" "http://www.makemkv.com/download/makemkv-oss-1.9.10.tar.gz" "http://ffmpeg.org/releases/ffmpeg-3.0.2.tar.bz2"
@jtwb
jtwb / install_makemkv.sh
Last active May 23, 2017 23:49
Install MakeMKV 1.9.10 on Fedora 23
#!/bin/bash
set +x
set -e
sudo -v
sudo mount -o remount,size=2048M /tmp
pushd `mktemp -d`
@jtwb
jtwb / async-basics.js
Created February 13, 2013 01:01
Asynchronous programming basics
// Time elapsed: 0µs
var a = 200000000000;
for (var i = 1000; i; i--){
a = a / 3;
}
// Time elapsed: 1µs, probably less
@jtwb
jtwb / gist:4272872
Created December 13, 2012 00:03
Schema rough draft
Applicant
Organization belongs to
Email
Starred?
Status
Attributes (hstore)
Added by (user)
Ddate
Cdate
Mdate
@jtwb
jtwb / HackerHire.md
Created November 28, 2012 07:36
HackerHire

HackerHire

Topics

Why "HackerHire"?

My closest friends are true hackers - curious people who love to create and to master tools and systems. It seemed like companies had no way of identifying these people - at the resume stage, they tend to look like crap early in their careers. So this is for them: they are the best, and we're giving companies x-ray vision.

Doesn't "hacker" carry negative connotations? Criminals, identity theft, etc.

@jtwb
jtwb / gist:4126850
Created November 21, 2012 18:51
Simple directory tree in JSON
[
{
path: "images/"
},
{
path: "images/asdf.png",
mimeType: "image/png"
},
{
path: "README",
@jtwb
jtwb / gist:4126770
Created November 21, 2012 18:40
Simple JSON directory listing
{
label: "files",
children: [
{
label: "images",
children: [
@jtwb
jtwb / q-test.js
Created October 1, 2012 17:38
Exploring q.js flow control library: comparing ncall/nbind and promises
var q = require('q');
/*
* ncall / nbind test
*/
function simpleAdmin(callback) {
setTimeout(
function () {
console.log('nc admin ok');
callback();
@jtwb
jtwb / vmup.sh
Created July 24, 2012 20:25
VMWare headless
# With Vmware Fusion bin path in $PATH...
alias vmup="vmrun -T fusion start $HOME/Documents/Virtual\ Machines.localized/$VMIMAGE.vmwarevm/$VMIMAGE.vmx nogui"
alias vmp="vmrun -T fusion pause $HOME/Documents/Virtual\ Machines.localized/$VMIMAGE.vmwarevm/$VMIMAGE.vmx"
alias vusu="ssh -A -l $VMUSER $VMIP"
@jtwb
jtwb / ps1.sh
Created June 28, 2012 21:49
Sexy PS1 with collapsed git branch name and dirs stack
function dirs_depth () {
echo `dirs -v | wc -l`
}
function parse_git_branch () {
BRANCH=$(git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
BLEN=$(echo `echo $BRANCH | wc -c` " - 1" | bc)
echo $BRANCH | cut -c1 | sed -e "s/^./${BLEN}\0/"
}