See http://jordan.broughs.net/archives/2014/09/provide-separate-rails-log-files-for-each-unicorn-worker
View compliments.sh
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
# from https://gist.github.com/jordan-brough/fc085fa50f520ef022c9 | |
# inspired by http://emergencycompliment.com/ | |
function emergency_compliment { | |
ruby <<RUBY | |
require "rubygems" | |
require "json" | |
today = Time.now.strftime('%Y-%m-%d') | |
today_filename = "/tmp/compliments-#{today}.json" | |
latest_filename = "/tmp/compliments-latest.json" | |
json = if File.exist?(today_filename) |
View sandbox.sh
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/env bash | |
set -e | |
cd ~/repos/spree | |
bundle install --quiet 1> /dev/null || bundle update --quiet | |
bundle exec rake sandbox |
View parallel_processor.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
class ParallelProcessor | |
attr_accessor :pid_params | |
def initialize | |
@pid_params = {} | |
end | |
def spawn_worker(start, finish, writer) | |
pid = fork do | |
puts "worker working on #{start} to #{finish}" |
View gist:1684779
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
cookie = 'XXX--YYY' | |
ActiveSupport::MessageVerifier.new(Rails.application.config.secret_token).verify(cookie) |
View github_dashboard_twitter.user.js
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
// ==UserScript== | |
// @name GitHub Dashboard Twitter | |
// @namespace http://tekkub.net/ | |
// @include https://github.com/ | |
// ==/UserScript== | |
$("div.news h1").before( | |
$("<div>").attr("id", "twitter_div2").append( | |
$("<h1>").text("GitHub status ").css({ |
View gist:3452180
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
# 31536000 == 1 year (365 days) in seconds | |
curl -u <USERNAME>:<PASSWORD> --insecure https://<SPLUNK_URL>:8089/services/search/jobs/<JOB_ID>/control -d action=setttl -d ttl=31536000; echo |
View Git branch bash autocomplete *with aliases*
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
# To Setup: | |
# 1) Save the .git-completion.bash file found here: | |
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash | |
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect: | |
# Git branch bash completion | |
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
# Add git completion to aliases |
View DefaultKeyBinding.dict
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
// Installation: | |
// 1. Save this file as /Users/YOUR_USER_NAME_HERE/Library/KeyBindings/DefaultKeyBinding.dict | |
// 2. Log out and log back in (or just restart any app where you'd like to use the shortcut) | |
// What: Keyboard shortcut to easily insert checkmarks. (Or whatever text you'd like to insert). | |
// By default option+v in MacOS inserts a square-root symbol: √ | |
// I've often used option+v as a quick-and-dirty checkmark. This shortcut lets me get a real checkmark. | |
{ | |
// Insert a checkmark with option+v |
View instructions.markdown
-
Choose: Tools > New Plugin
-
Paste in the contents of "timestamp.py" below
-
Save as timestamp.py in
~/Library/Application Support/Sublime Text 2/Packages/User/
(should be the default directory that pops up when you save) -
Choose: Sublime Text 2 > Preferences > Key Bindings - User
-
Add:
{ "keys": ["super+ctrl+t"], "command": "timestamp" }
To make command+ctrl+t perform the insertion.
Make sure to add a comma after the previous keymap entry, if present.
OlderNewer