Skip to content

Instantly share code, notes, and snippets.

View bufordtaylor's full-sized avatar

Buford Taylor bufordtaylor

View GitHub Profile
#! /usr/bin/env bash
export [email protected]
export APPLE_PASS=password1
export AUTH_PLIST=$(curl -su "$APPLE_USER:$APPLE_PASS" "https://setup.icloud.com/setup/authenticate/$APPLE_USER")
export DSID=$(/usr/libexec/PlistBuddy -c "Print appleAccountInfo:dsid" /dev/stdin <<< $AUTH_PLIST)
echo $DSID
export TEMP_MME_AUTH_TOKEN=$(/usr/libexec/PlistBuddy -c "Print tokens:mmeAuthToken" /dev/stdin <<< $AUTH_PLIST)
@bufordtaylor
bufordtaylor / icloud-caldav.rb
Created October 27, 2016 16:51 — forked from ericboehs/icloud-caldav.rb
Interface with Apple's iCloud CalDav Calendars
require 'rexml/document'
require 'rexml/xpath'
require 'http'
require 'icalendar'
HTTP::Request::METHODS = HTTP::Request::METHODS + [:report]
module AppleCalDav
class Client
attr_accessor :username, :password
@bufordtaylor
bufordtaylor / adding-for-the-first-time.sh
Created October 27, 2016 16:51 — forked from ericboehs/adding-for-the-first-time.sh
Keybase.io + GitHub Verified Commits + macOS Keychain
# Install keybase and pinentry-mac
brew update
brew install keybase pinentry-mac
# Create a Keybase.io account and key
keybase signup
# Or if you have an account
keybase login

How to create a Ruby Gem

Why create a gem?

  • For code reuse
  • For isolation (easy to test, black box input/output)
  • For important and/or complex code
  • For community features and feedback (if open sourced)

Example code to turn into a gem

# Install services
brew update
brew install ruby memcached beanstalkd mysql redis phantomjs node
brew services start memcached
brew services start beanstalkd
brew services start mysql
brew services start redis
# Install Docker
brew tap caskroom/cask
@bufordtaylor
bufordtaylor / system-pass-paster.applescript
Created October 27, 2016 16:50 — forked from ericboehs/system-pass-paster.applescript
Fill in system password dialogs from 1Password
-- Change E27 to a unique string that will find your system password in 1Password
do shell script "open x-onepassword-helper://search/E27"
-- Give 1Password a smidge of time to open
delay 0.5
-- Copy the password to the clipboard (1Password will auto clear it after 90 seconds)
tell application "System Events" to keystroke "c" using {shift down, command down}
-- Give 1Password a smidge of time to copy
@bufordtaylor
bufordtaylor / upgrade_to_mysql57.sh
Created October 27, 2016 16:50 — forked from ericboehs/upgrade_to_mysql57.sh
Upgrading from MySQL 5.6 to 5.7 on OS X
mysql.server stop # kill the process if it fails
brew uninstall mysql56
brew update
brew install mysql
cp /usr/local/Cellar/mysql/5.7.12/support-files/my-default.cnf /usr/local/etc/my.cnf
brew services start mysql # don't run via tmux
mysql_upgrade -u root --force
brew services restart mysql # don't run via tmux
cd ~/Code/17hats/17hats
bundle exec gem uninstall -a mysql2; bundle install
#! /bin/bash
for file in post-checkout post-commit post-merge post-rewrite; do
curl -sO "https://gist.githubusercontent.com/ericboehs/00d3e27c993b5b951a79312f6b51dbf5/raw/$file"
chmod +x $file
mv $file .git/hooks/
done
@bufordtaylor
bufordtaylor / install.sh
Created October 27, 2016 16:50 — forked from ericboehs/install.sh
Install Docker on El Capitan
# Ensure you have brew cask installed http://caskroom.io
brew install caskroom/cask/brew-cask
# Install Docker Toolbox (this will install docker machine and virtualbox)
brew cask install dockertoolbox
# Create a linux machine for docker container to run on
docker-machine create --driver virtualbox default
# Add ENV variables for the machine to your profile (and restart your terminal)
# This script will create a cron that downloads the latest image from Himawari 8 every 5 minutes. I use it as my wallpaper.
#
# The Himawari 8 weather satellite acquires 5500x5500 images of Earth every 10 minutes. It captures other weather related
# stills but the full disk, true color is the most amazing.
# The latest is accessible at
# http://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/full_disk_ahi_true_color.jpg.
#
# The satellite was launched in July of 2015. It's the highest resolution
# camera we currently have pointing at earth (stationary at the L1 point).
#