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
# make your repos on github | |
git clone [email protected]:YOU/NEW_REPOS.git | |
# Initialized empty Git repository in /Users/timruffles/Development/CapistranoLearning/.git/ | |
# warning: You appear to have cloned an empty repository. | |
touch README | |
nano README # add readme | |
git add . | |
git commit -m 'Initial import' | |
git push origin master |
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 'net/http' | |
require 'yaml' | |
module Configable | |
def configure(setup) | |
setup.each_pair do |key,val| | |
if self.respond_to? key + '=' | |
self.send(key + '=', val) | |
else | |
instance_variable_set('@' + key, val) |
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
# cruisecontrol/app/views/build_mailer/build_report.html.erb | |
<% if Configuration.dashboard_url -%> | |
<%= @message %> | |
CHANGES | |
------- | |
<% | |
require 'uri' | |
repos = URI.parse(@build.project.source_control.repository) | |
for_viewing_url = "https://#{repos.host}#{repos.path.gsub(/\.git\/?$/,'')}" |
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
div#comwrapper{ | |
position:relative; | |
height: 70px; | |
overflow: hidden; | |
zoom: 1; | |
background: $main_bg; | |
color: #fff; | |
font-size: 12px; | |
margin-bottom: 10px; |
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
# To specify custom behavior that will be taken if the validation fails, pass a block to this method. | |
# It'll be called with |reason, default_action_as_proc| | |
def validate_rights(action, object = nil, message = nil) | |
@validate_rights_has_been_called = true | |
return true if action == :unprotected | |
take_action = false | |
respond_to do |format| | |
if !logged_in? | |
reason = :not_logged_in | |
format.html do |
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
def user_allowed_to_deposit? | |
validate_rights :deposit do |reason, default| | |
if reason == :acl_failed | |
flash[:notice] = "We need to verify your identity before you can deposit." | |
redirect_to(new_account_idcheck_path) | |
else | |
default.call | |
end | |
end | |
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
end | |
end | |
previous_last_bonus = @user.bonuses.any? && @user.bonuses.last | |
if !problems && @user.save_with_identity(@identity) | |
flash[:notice] = "The user has been updated." | |
if @user.bonuses.any? && @user.bonuses.last.bonus_offer.is_bet_for_free? && @user.bonuses.last != previous_last_bonus | |
flash[:notice] += " We have awarded the bet for free bonus for the user." | |
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
<%= | |
if not logged_in? | |
# Log in | |
# A button for each stake | |
@real_game.stake_amounts.sum do |stake_amount| | |
render 'games/buttons/login_to_play_stake', :stake_amount => stake_amount | |
end | |
elsif current_user.has_enough_funds_to_bet? |
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
# assign failers via export FAILERS = ' | |
# paste after opening the quote, and close after the pasted contents | |
echo $FAILERS | ruby -e 'puts STDIN.read.split("cucumber").map {|l| l.gsub(/^ (\S*):\d*.*/,"\\1")}.uniq.join(" ")' |
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
# sass handler | |
get /\/(.*)\.css/ do |stylesheet| | |
headers 'Content-Type' => 'text/css; charset=utf-8' | |
sass stylesheet.to_sym | |
end | |
# coffee script handler | |
get %r{/(.*)\.js} do |js| | |
# compile coffee script and place in respective JS folder | |
coffee = "#{ROOT_DIR}/js/#{js}.coffee" |
OlderNewer