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
# delayed job priority ranges. Higher values represent lower priority. | |
PRIORITY_RANGES = [(0..9), (10..19)] | |
2.times do |num| | |
God.watch do |w| | |
w.name = "dj-#{num}" | |
w.group = 'dj' | |
w.interval = 30.seconds | |
w.start = "rake -f #{RAILS_ROOT}/Rakefile RAILS_ENV=production MIN_PRIORITY=#{PRIORITY_RANGES[num].first} MAX_PRIORITY=#{PRIORITY_RANGES[num].last} jobs:work" | |
w.log = "/var/log/god/god.log" |
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/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: nginx init.d dash script for Ubuntu <=9.10. | |
# Description: nginx init.d dash script for Ubuntu <=9.10. | |
### END INIT INFO |
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
# built application files | |
*.apk | |
*.ap_ | |
# files for the dex VM | |
*.dex | |
# Java class files | |
*.class |
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
- Run software update | |
- Install Purchased Apps from App Store | |
- Disable caps lock key (Sys Pref => Keyboard => Modifier Keys) | |
- System Pref -> Expose -> Setup corners for spaces and expose | |
+ System Pref -> Security -> Sleep Password | |
- Setup Dropbox to Get Files | |
- Install 1Password | |
- Use dropbox synced file for keychain | |
- Install browser extension for chrome | |
- Install Prey |
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
# COLORS | |
LIGHT_GRAY="\[\033[0;37m\]"; BLUE="\[\033[1;36m\]"; RED="\[\033[0;31m\]"; LIGHT_RED="\[\033[1;31m\]"; | |
GREEN="\[\033[0;32m\]"; WHITE="\[\033[1;37m\]"; LIGHT_GRAY="\[\033[0;37m\]"; YELLOW="\[\033[1;33m\]"; | |
# GIT PROMPT (http://gist.github.com/120804) | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \(\1\)/'; | |
} | |
function parse_git_status { | |
git status 2> /dev/null | sed -e '/(working directory clean)$/!d' | wc -l; | |
} |
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
public abstract class MainThreadCallback implements Callback { | |
private static final String TAG = MainThreadCallback.class.getSimpleName(); | |
abstract public void onFail(final Exception error); | |
abstract public void onSuccess(final String responseBody); | |
@Override | |
public void onFailure(final Request request, final IOException e) { |
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
project :test => :shoulda, :orm => :activerecord | |
generate :model, "account username:string password:string" | |
generate :model, "post title:string body:text" | |
generate :controller, "posts get:index get:new post:new" | |
generate :migration, "AddEmailToAccount email:string" | |
require_dependencies 'nokogiri' | |
git :init | |
git :add, "." | |
git :commit, "initial commit" |
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
if Rails.env.test? | |
module Backburner | |
def self.test_mode | |
@test_mode ||= :fake | |
end | |
def self.test_mode=(mode) | |
@test_mode = mode | |
end |
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
Rails.logger.info "REQUEST INSPECTOR" | |
Rails.logger.info " [REQUEST_URI] #{request.headers['REQUEST_URI'].inspect}" | |
Rails.logger.info " [RAW_POST]: #{request.raw_post.inspect}" | |
Rails.logger.info " [PARAMS]: #{request.params.inspect}" | |
Rails.logger.info " [HTTP_AUTHORIZATION] #{request.headers['HTTP_AUTHORIZATION'].inspect}" | |
Rails.logger.info " [CONTENT_TYPE]: #{request.headers['CONTENT_TYPE'].inspect}" | |
Rails.logger.info " [HTTP_ACCEPT] #{request.headers['HTTP_ACCEPT'].inspect}" | |
Rails.logger.info " [HTTP_HOST] #{request.headers['HTTP_HOST'].inspect}" | |
Rails.logger.info " [HTTP_USER_AGENT] #{request.headers['HTTP_USER_AGENT'].inspect}" |
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
## DNS | |
@dns = Fog::DNS.new(:provider => 'Linode', :linode_api_key => LINODE_KEY) | |
if @zone = @dns.zones.all.find { |z| z.domain == ZONE } | |
puts "Found zone #{@zone.inspect}" | |
else | |
@zone = @dns.zones.create(:domain => ZONE, :email => ZONE_EMAIL) | |
puts "Creating zone #{@zone.inspect}" | |
end |