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
# 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 |
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
-- 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 |
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
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 |
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 | |
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 |
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
# 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 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
# 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). | |
# |
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
class CreateAdminDoppelgangerSession < ActiveRecord::Migration | |
def change | |
create_table :admin_doppelganger_sessions do |t| | |
t.integer "admin_user_id", null: false | |
t.references :user | |
t.boolean "active", default: true | |
t.date "logout_date" | |
t.string "token", null: false | |
t.string "return_to" |
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
# in routes | |
namespace :admin do | |
resources :sample, only: :index | |
end | |
# app/controllers/admin/sample_controller.rb | |
class Admin::SampleController < ApplicationController | |
before_filter :authorize_admin | |
def index |
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
echo "---> Set up pair user" | |
if [[ -z $(sudo dscl . read /Users/pair 2>/dev/null) ]]; then | |
sudo dscl . create /Users/pair | |
sudo dscl . create /Users/pair RealName "Pair" | |
sudo dscl . create /Users/pair UniqueID $(($(dscl . -list /Users UniqueID | awk '{print $2}' | sort -n | tail -1) + 1)) | |
sudo dscl . create /Users/pair PrimaryGroupID 20 | |
sudo dscl . create /Users/pair UserShell /usr/local/bin/zsh | |
sudo dscl . create /Users/pair NFSHomeDirectory /Users/pair | |
sudo dscl . -append /Groups/staff GroupMembership pair | |
fi |
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
# Gemfile | |
gem 'clockwork' | |
# config/clock.rb | |
require 'clockwork' | |
require './config/boot' | |
require './config/environment' | |
module Clockwork |