Skip to content

Instantly share code, notes, and snippets.

View pgblu's full-sized avatar

Philipp Blume pgblu

  • SUONO MOBILE USA
  • Champaign, IL
View GitHub Profile
# Usage: ruby commit-prepender this is my commit message without quotation marks
branch_name = %x.git rev-parse --abbrev-ref HEAD.
regex = Regexp.new(/[A-Z]*-[0-9]*/)
string_to_prepend = branch_name.match(regex).to_s
cmd = "git commit -m \"[#{string_to_prepend}] #{ARGV.join(" ")}\""
`#{cmd} >&2`
@captainsafia
captainsafia / mac_dev_setup.sh
Created August 14, 2018 01:06
A set of commands I use to configure my Mac for development
# Create a global gitignore for macOS
cat https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore >> ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
# Send screenshots to a directory that isn't the desktop
mkdir -p ~/Screenshots
defaults write com.apple.screencapture location ~/Screenshots
# Show all hidden files (like dotfiles)
defaults write com.apple.finder AppleShowAllFiles YES; killall Finder;
@pgblu
pgblu / README.md
Last active December 17, 2018 19:11
gray code viewer

Beckett-Gray sequences

viz. https://arxiv.org/pdf/1608.06001.pdf for a definition and discussion. The authors of the linked article were kind enough to provide me with the sequences.

def transform_hash(original, options={}, &block)
original.inject({}){|result, (key,value)|
value = if (options[:deep] && Hash === value)
transform_hash(value, options, &block)
else
value
end
block.call(result,key,value)
result
}