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 request(flow): | |
if flow.request.url.startswith('https://api.mrdfood.com/landing-items'): | |
flow.request.query["latitude"] = -33.9056222 | |
flow.request.query["longitude"] = 18.596244 |
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 rvm list strings | grep -q "ruby-1.9.2-p180-patched" ; then | |
rvm use ruby-1.9.2-p180-patched | |
else | |
rvm use ruby-1.9.2-p180 | |
fi |
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 self.active_roles | |
active_roles = Model::ROLES_MASK | |
[:deleted, :roles].each do |dr| | |
active_roles.delete(dr.to_s) | |
end | |
active_roles | |
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
# User: has_many :debtors | |
# Debtor: belongs_to :user | |
user = User.where(:name => "Bob").first | |
user.debtors.all.delete_all | |
# The above command deleted ALL the debtors in the DB? |
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
%p.normal | |
%label{ :for => "statusboard_url" } Statusboard URL | |
%input.text#statusboard_url{ :name => "notifiers[Statusboard][url]", :type => "text", :value => config["url"] } |
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
<?php | |
global $memcache_obj; | |
global $memcache_key; | |
global $html; | |
$server = 'localhost'; | |
$port = '11211'; | |
$protocol = ($_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; | |
$memcache_key = md5($protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'|'.serialize($_POST).'|'.serialize($_SESSION)); |