This file contains hidden or 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
name "application" | |
run_list "application" |
This file contains hidden or 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
[2012-08-30T15:02:18-07:00] INFO: Processing directory[/var/apps/outight_app/current/log] action delete (outright-application::default line 60) | |
[2012-08-30T15:02:18-07:00] INFO: Processing directory[/var/apps/outight_app/current/public/system] action delete (outright-application::default line 60) | |
[2012-08-30T15:02:18-07:00] INFO: Processing directory[/var/apps/outight_app/current/tmp/pids] action delete (outright-application::default line 60) | |
[2012-08-30T15:02:18-07:00] INFO: Processing execute[test ! -d /var/apps/outright_app/current/log] action run (outright-application::default line 66) | |
[2012-08-30T15:02:18-07:00] ERROR: execute[test ! -d /var/apps/outright_app/current/log] (outright-application::default line 66) has had an error | |
[2012-08-30T15:02:18-07:00] ERROR: execute[test ! -d /var/apps/outright_app/current/log] (/var/chef/cache/cookbooks/outright-application/recipes/default.rb:66:in `from_file') had an | |
error: | |
execute[test ! -d /var/apps/outright_app/current/log] (outright-application::default line 6 |
This file contains hidden or 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
require 'rest-client' | |
req = RestClient::Request.new( | |
:method => :post, | |
:url => "https://snapi.sincerely.com/shiplib/create", | |
:payload => { | |
:appkey => ENV["SINCERELY_APP_KEY"], | |
:debugMode => true, | |
:frontPhotoId => image["id"], | |
:recipients => [ |
This file contains hidden or 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
alias gd='git diff' | |
alias gdc='git diff --cached' | |
alias gpq='git pull-request' | |
alias gld="gl | grep Updating | cut -d ' ' -f2 | xargs git diff" | |
alias grm="git status | awk '/deleted/{print \$3}' | xargs git rm" | |
alias gm='git merge --no-ff' | |
alias gmff='git merge' | |
alias gf='git fetch -p' | |
alias clean='find ./**/*.orig | xargs rm' | |
alias migrate='rake db:migrate db:test:prepare parallel:prepare' |
This file contains hidden or 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 | |
git_clean_remote() | |
{ | |
remote=$1 | |
[[ -z "$remote" ]] && echo "Must provide a remote" && return 1 | |
for branch in $(git branch -r | grep $remote | grep -v master) | |
do | |
diff=$(git cherry -v master $branch | wc -l) |
This file contains hidden or 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 Calculator | |
def exec(expression) | |
while op = expression.match(/\([^()]+\)/) | |
offsets = op.offset(0) | |
out = exec op[0].gsub(/[()]/,'') | |
expression[offsets.first...offsets.last] = out.to_s | |
end | |
while op = expression.match(/\d+ ?[\*\/] ?\d+/) | |
run_expression op, expression |
This file contains hidden or 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 Queue | |
attr_reader :elements | |
def initialize | |
@elements = Buffer.new | |
end | |
def push(element) | |
@elements << element | |
end |
This file contains hidden or 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 Queue | |
def initialize | |
@first = nil | |
@last = nil | |
@length = 0 | |
end | |
def push(element) | |
node = Node.new | |
node.value = element |
This file contains hidden or 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
-> % bundle | |
.... | |
Installing unf (0.0.5) | |
Bundler::GemNotFound: Could not find unf-0.0.5-jruby.gem for installation | |
An error occured while installing unf (0.0.5), and Bundler cannot continue. | |
Make sure that `gem install unf -v '0.0.5'` succeeds before bundling. |
This file contains hidden or 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/zsh | |
power=$(/usr/sbin/ioreg -l | awk 'BEGIN{a=0;b=0} | |
$0 ~ "MaxCapacity" {a=$5;next} | |
$0 ~ "CurrentCapacity" {b=$5;nextfile} | |
END{printf("%.2f%%", b/a * 100)}') | |
charging=$(/usr/sbin/ioreg -l | awk '/IsCharging/{ print $5 }') | |
power_int=$(echo $power | sed 's/\..*//') |