start new:
tmux
start new with session name:
tmux new -s myname
#!/usr/bin/env ruby | |
# Command line util for acquiring a one-off Twitter OAuth access token | |
# Based on http://blog.beefyapps.com/2010/01/simple-ruby-oauth-with-twitter/ | |
require 'rubygems' | |
require 'oauth' | |
puts <<EOS | |
Set up your application at https://twitter.com/apps/ (as a 'Client' app), |
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
# prints a sparkline in the terminal using the supplied list of numbers | |
# examples: | |
# spark.rb 10 20 30 100 90 80 | |
# spark.rb 1 2 0.4 0.1 1.3 0.7 | |
@ticks = %w[▁ ▂ ▃ ▄ ▅ ▆ ▇] | |
values = ARGV.map { |x| x.to_f } |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'bundler' | |
require 'fileutils' | |
require 'net/http' | |
require 'net/https' | |
require 'uri' | |
TMP_DIR = "/tmp/gems" |
/** | |
* Converts a string to a "URL-safe" slug. | |
* Allows for some customization with two optional parameters: | |
* | |
* @param {string} Delimiter used. If not specified, defaults to a dash "-" | |
* @param {array} Adds to the list of non-alphanumeric characters which | |
* will be converted to the delimiter. The default list includes: | |
* ['–', '—', '―', '~', '\\', '/', '|', '+', '\'', '‘', '’', ' '] | |
*/ | |
if (!String.prototype.slugify) { |
#!/bin/sh | |
echo Install all AppStore Apps at first! | |
# no solution to automate AppStore installs | |
read -p "Press any key to continue... " -n1 -s | |
echo '\n' | |
echo Install and Set San Francisco as System Font | |
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)" | |
echo Install Homebrew, Postgres, wget and cask | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
require "date" | |
# Small DSL for idiomatic date parsing and formatting in Ruby. | |
# https://gist.github.com/sshaw/53c27b148e903a07e494 | |
# | |
# Usage: | |
# | |
# include YYMMDD | |
# date = Date.today | |
# |
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |