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 | |
# This tool checks if there are any uncommitted changes in the current git branch. | |
# If it finds any uncommited changes it exits with an error. | |
# We use it to prevent pushing dirty changes to production. | |
clean=$(git status | grep "nothing to commit (working directory clean)") | |
if [ -z "$clean" ]; then | |
echo There are uncommitted changes. | |
exit 1 | |
else |
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 | |
sudo /usr/local/sbin/nginx; | |
sudo apachectl start | |
mysql.server start; | |
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start | |
exit; |
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/ruby env | |
guardfile = <<-'END' | |
def determine_rspec_version | |
if File.exist?("#{Dir.pwd}/spec/spec_helper.rb") | |
File.new("#{Dir.pwd}/spec/spec_helper.rb").read.include?("Spec::Runner") ? 1 : 2 | |
elsif bundler? | |
# Allow RSpactor to be tested with RSpactor (bundle show inside a bundle exec) | |
ENV['BUNDLE_GEMFILE'] = "#{Dir.pwd}/Gemfile" |
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
$(document).ready(function(){ | |
if(!localStorage.lastOpenPage){ | |
localStorage.lastOpenPage = "logins"; | |
} | |
$("body").addClass(localStorage.lastOpenPage); | |
$("nav#tabBar ul li").click(function(){ | |
localStorage.lastOpenPage = $(this).attr('id'); | |
$("body").addClass($(this).attr('id')); | |
} |
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 Device < ActiveRecord::Base | |
... | |
def push_message(message) | |
case device_type | |
when "android" | |
notification = { :registration_id => registration_id, | |
:data => { | |
:message_body => message.body, | |
:message_recipient => message.recipient | |
} |
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 Application < ActiveRecord::Base | |
require 'httparty' | |
... | |
def push_message(message) | |
if self.post_url | |
post(self.post_url, :body => message) | |
end | |
end | |
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
group :test do | |
... | |
gem 'timecop' | |
... | |
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
... | |
def update | |
@platforms = Platform.find parmas[:id] | |
#Option 1 | |
Pusher['event'].trigger($Q{$("#box_qa_app_geolocation").html("<%= escape_javascript(render :partial => "/shared", :object => @platform) %>");}) | |
#Option 2 |
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
def trackLocation | |
%x(osascript -e 'tell app "iTunes"' -e "set trk to current track" -e 'if kind of trk is "MPEG audio stream" then' -e "return address of trk" -e "else" -e "set l to trk's location" -e "return POSIX path of l" -e "end if" -e "end tell").rstrip | |
end | |
def trackArtwork | |
dbid = %x(osascript -e 'tell app "iTunes" to return database id of current track').rstrip | |
location = "/tmp/iTunesArtwork.pict" | |
%x(touch #{location}) | |
%x(osascript -e 'tell app "iTunes"' -e 'set aTemp to POSIX file "#{location}" as alias' -e 'set aTrackArtwork to null' -e "set response to null" -e "if (count of artwork of current track) > 0 then" -e "set aTrackArtwork to data of artwork 1 of current track" -e "set fileRef to (open for access aTemp with write permission)" -e "try" -e "set eof fileRef to 512" -e "write aTrackArtwork to fileRef starting at 513" -e "close access fileRef" -e 'set response to "/tmp/iTunesArtwork.pict"' -e "on error" -e "try" -e "close access fileRef" -e "set response to null" -e "end try" -e "en |
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
# Each site directory uses its own Gemset and specifies its Ruby version. | |
rvm use 1.9.2@personal_ictunes --create | |
passenger start -a 127.0.0.1 -p 8090 -d |