Skip to content

Instantly share code, notes, and snippets.

View todgru's full-sized avatar

todgru

  • Portland, OR
View GitHub Profile

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/bin/bash
#
# Report time to first byte for the provided URL using a cache buster to ensure
# that we're measuring full cold-cache performance
while (($#)); do
echo $1
curl -so /dev/null -H "Pragma: no-cache" -H "Cache-Control: no-cache" \
-w "%{http_code}\tPre-Transfer: %{time_pretransfer}\tStart Transfer: %{time_starttransfer}\tTotal: %{time_total}\tSize: %{size_download}\n" \
"$1?`date +%s`"
require 'rubygems'
require 'net/http'
require 'uri'
BIT_RATE = 48 #6kbxseg * 60 seg (a min) * 15min
TAMO_CORTE = (BIT_RATE/8) * 60 * 15 #en KB
url = URI.parse('http://186.1.15.253:8000/')
Net::HTTP.start(url.host, url.port) do |http|
#!/bin/sh
#cloneall.sh by Jan-Piet Mens, February 2012
# Obtain a list of gists (mine) and clone them into the current directory
# Requires jsonpipe (https://github.com/dvxhouse/jsonpipe)
URL=http://gist.github.com/api/v1/json/gists/jpmens
CLONEURLFMT="git://gist.github.com/%d.git\n"
curl -qs $URL |
jsonpipe -s ' ' |
#!/usr/bin/perl
use v5.10;
use strict;
use warnings;
# Usage: gist_backup.pl <user>
# Clone all the gists of a GitHub user
@todgru
todgru / Bcrypt.php
Created September 7, 2012 22:52
Simple PHP 5.3+ Bcrypt class and functions php bcrypt
<?php
/*
By Marco Arment <me@marco.org>.
This code is released in the public domain.
THERE IS ABSOLUTELY NO WARRANTY.
Usage example:
// In a registration or password-change form: