This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -W1 | |
# frozen_string_literal: true | |
require 'optparse' | |
require 'shellwords' | |
# A script to automate changelog generation from Git commit messages | |
# | |
# For use with a git-flow workflow, it will take changes from the last tagged | |
# release where commit messages contain NEW, FIXED, CHANGED, and IMPROVED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
man() { | |
env \ | |
LESS_TERMCAP_mb=$(printf "\e[1;31m") \ | |
LESS_TERMCAP_md=$(printf "\e[1;31m") \ | |
LESS_TERMCAP_me=$(printf "\e[0m") \ | |
LESS_TERMCAP_se=$(printf "\e[0m") \ | |
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \ | |
LESS_TERMCAP_ue=$(printf "\e[0m") \ | |
LESS_TERMCAP_us=$(printf "\e[1;32m") \ | |
man "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__sizeup_build_query () { | |
local bool="and" | |
local query="" | |
for t in $@; do | |
query="$query -$bool -iname \"*.$t\"" | |
bool="or" | |
done | |
echo -n "$query" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"shell_cmd": ["cat", "$file", "|", "/usr/bin/ruby", "/Users/ttscoff/scripts/update_workflow.rb"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
module Bytes | |
def to_human(n,fmt=false) | |
count = 0 | |
formats = %w(B KB MB GB TB PB EB ZB YB) | |
while (fmt || n >= 1024) && count < 8 | |
n /= 1024.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# encoding: utf-8 | |
# Bitlyize by Brett Terpstra 2014 | |
# Shortens all URLs in input and automatically adds Amazon and iTunes affiliate codes | |
# A single bitly link passed to this script will return the long url | |
# This script was designed for use in an OS X System Service, but runs | |
# as a CLI and can be included as a Ruby library in other scripts | |
# | |
# The bitly_username and bitly_key variables are required | |
# Optionally configure the custom domain, and itunes and amazon affiliate variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
die "Usage: rename <expression> <files>\n" unless (@ARGV >= 2); | |
my $op = eval 'sub { ' . shift . ' }'; # crazily dangerous - type carefully! | |
die $@ if $@; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# So you know whoami, but whereami? | |
# Relies on this handy hack <https://github.com/lindes/get-location> | |
latlong=$(/usr/local/bin/get-location 2> /dev/null \ | |
| sed -e 's/.*<\(.*\)>.*/\1/') | |
address=$(curl -Ss "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlong&sensor=false" \ | |
| grep formatted_address \ | |
| head -n 1 \ | |
| sed -e 's/[ \t]*"formatted_address" : "\(.*\)",/\1/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# new_podcast.rb | |
# Create a new Sublime Text workspace with 4 vertical columns and starter note buffers | |
# Brett Terpstra 2014 | |
# Free to use and modify (WTF license) | |
# Usage: new_podcast.rb episode_title | |
require 'fileutils' | |
# By default new workspaces are created in subdirs off the current directory | |
# modify project_root to always have them built in a specific location, (e.g. project_root = "~/Dropbox/Podcasts") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A custom preprocessor for Marked 2 that will export two files after Marked | |
# does initial inclusion and processing, then cancel the processor and have | |
# Marked resume processing. | |
# Install the latest version of MultiMarkdown: | |
# http://fletcherpenney.net/multimarkdown/download/ | |
function main() |
NewerOlder