most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
# = YERB | |
# | |
# Who needs HAML when you have YAML + ERB? ;) | |
# | |
# See example.yaml below for an example. You can run this code | |
# by cloning this gist and then `ruby _yerb.rb example.yaml`. | |
# | |
# Notice that you need Ruby 1.9 so the hash order is preserved. | |
# Obviously, this is just for fun. Definitely slow as hell. | |
# |
module DateTimeHelper | |
def time_to_next_quarter_hour(time) | |
array = time.to_a | |
quarter = ((array[1] % 60) / 15.0).ceil | |
array[1] = (quarter * 15) % 60 | |
Time.local(*array) + (quarter == 4 ? 3600 : 0) | |
end | |
end |
#!/usr/bin/env bash | |
# | |
# Script to initiate (or connect to) a rails project | |
# tmux session. | |
if [[ "$1" != "" ]]; then | |
app=$1 | |
APPDIR=$HOME/src/$app | |
cd $APPDIR | |
else |
# what? why does your production code care what environment it is in? SILLY! | |
unless Rails.development? || Rails.test? | |
Slottd::CreatesReservationTimer.for(slot.id) | |
end |
tell application "Mail" | |
set theSubject to "Subject" -- the subject | |
set theContent to "Content" -- the content | |
set theAddress to "[email protected]" -- the receiver | |
set theSignatureName to "signature_name"-- the signature name | |
set theAttachmentFile to "Macintosh HD:Users:moligaloo:Downloads:attachment.pdf" -- the attachment path | |
set msg to make new outgoing message with properties {subject: theSubject, content: theContent, visible:true} |
This is a quick guide on installing HTTPie for Mac OS X systems. This is also useful if you want the python package management utility pip
. An installed copy of Homebrew is a prerequisite.
brew install httpie
This is an adaptation of https://twitter.com/jasonneylon script.
In the terminal window, you can open your current repo (at the current branch) in your default browser.
My adaptation was adding options to view the commits, branches, pull requests or issues for the repo using one of the additional options (added support for wiki, settings, pulse, graphs, network):
[h] => View help
[c] => View commits
[c {SHA}] => View specific commit from commit SHA
[b] => View branches
# Call scopes directly from your URL params: | |
# | |
# @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
module Filterable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Call the class methods with names based on the keys in <tt>filtering_params</tt> | |
# with their associated values. For example, "{ status: 'delayed' }" would call |
Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.
This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.
You are encouraged to fork this and modify it to your heart's content to match your own needs.