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 is an sample file, put a copy of this file inside /shared/bin | |
# I'm assuming a capistrano directory structure under /var/www/my-project/ | |
# | |
# Called by crontab when the server reboots | |
# | |
# To use this file execute with root privileges: | |
# crontab -e | |
# | |
# then add this line: |
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 way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master) | |
fi | |
JIRA_SERVER=$(git config jira.server) | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) |
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 | |
protected_branch='master' | |
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
if [ $protected_branch = $current_branch ] | |
then | |
read -p "You're about to push master, is that what you intended? [y|n] " -n 1 -r < /dev/tty | |
echo | |
if echo $REPLY | grep -E '^[Yy]$' > /dev/null |
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 ruby | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
message_file = ARGV[0] | |
branches_to_skip = (ENV['BRANCHES_TO_SKIP'] || 'master').split(' ') | |
original_message = File.read(message_file) | |
current_branch = `git symbolic-ref --short HEAD` | |
# Don't do anything if the commit already has a link i.e. in the case of --amend |
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 ruby | |
# See https://workflow.advisory.com/browse/CAM-11198 | |
if __FILE__ != $0 | |
exit 0 | |
end | |
$stderr.sync = true | |
require "optparse" |
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
require 'test_helper' | |
# Make sure to turn `self.use_transactional_fixtures` to false. | |
# | |
# Also, run this before testing: | |
# $ rake db:test:prepare && rake db:test:preload && rake log:clear | |
# | |
class AppointmentRaceConditionTest < ActiveSupport::TestCase | |
context ".build_new!" do |
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 application "Spotify" is running then | |
tell application "Spotify" | |
set theName to name of the current track | |
set theArtist to artist of the current track | |
set theAlbum to album of the current track | |
set theUrl to spotify url of the current track | |
try | |
return "♫ " & theName & " - " & theArtist | |
on error err | |
end try |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 MountainBike | |
def price | |
case @type_code | |
when :rigid | |
(1 + @commission) * @base_price | |
when :front_suspension | |
(1 + @commission) * @base_price + @front_suspension_price | |
when :full_suspension | |
(1 + @commission) * @base_price + @front_suspension_price + | |
@rear_suspension_price |
OlderNewer