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 apply_coupons | |
applied_coupons = [] | |
active_coupons = family.family_coupons.active.order(:created_at).map(&:coupon).flatten | |
total = self.subtotal | |
while !total.zero? && !active_coupons.empty? | |
active_coupons.filter { |c| c.coupon_type == "permanent_percent" }.each do |coupon| | |
total = total * coupon.amount / 100.0.to_i | |
applied_coupons.push(coupon) | |
active_coupons -= [coupon] | |
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
var stream = require('stream'); | |
var liner = new stream.Transform( { objectMode: true } ); | |
liner._buffer = ''; | |
liner._transform = function (chunk, encoding, done) { | |
var self = this; | |
var data = chunk.toString(); | |
this._buffer = this._buffer + data | |
done(); |
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
http://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/ | |
http://blog.cloudflare.com/cloudflare-prism-secure-ciphers |
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 'mogli' | |
module FacebookIntegrationHelpers | |
shared_context "with unconnected facebook user" do | |
let(:fb_user) { create_test_user(installed: false) } | |
after { fb_user.destroy } | |
end | |
def app_client | |
Mogli::AppClient.new(AppConfig.facebook.access_token, AppConfig.facebook.app_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
var Robot = function(robot){ | |
robot.turnLeft(robot.angle % 90); | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
if (robot.parentId) { | |
robot.ahead(1); | |
robot.turnGunRight(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
var Robot = function(robot){ | |
robot.turnLeft(robot.angle % 90); | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
if (robot.parentId) { | |
robot.ahead(1); | |
robot.turnGunRight(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
module SessionMethods | |
protected | |
def admin_logged_in? | |
unless current_user(Admin) | |
return false | |
else | |
return true | |
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
foreman: | |
nginx: 1 | |
riak: 1 | |
unicorn: 1 | |
sidekiq: 1 | |
nginx: | |
daemon: 'off' | |
listen: 8080 | |
pid: tmp/pids/nginx.pid | |
path: /Users/fotoverite/github/generalassembly |
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
Most of you who know me, know I can be very loud and more than a bit obnoxious. I know I've been very loud the past few days about SOPA. | |
We all know what is at stake. I won't talk down to you or think you don't realize how this concerns us. We are being fucking lazy. | |
We are so concerned with our day to day lives that we are forgetting how much Federal government can affect us and or interest. | |
What we do today could be made much more difficult to do well without good reason. | |
But more importantly, even if it doesn't, nothing much of substance will have changed. Because we were not the ones to stop it. | |
We, beyond anyone else, know how amazing the web is. How important it is to our lives and our communities. We have power, people. | |
We command million dollar businesses, we bring so much and money to the cities and states we reside in. We need to use this. | |
We need to call our representatives; but more than that, we need to state that we matter. |
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
mismatch in remote request : | |
{ method: 'GET', | |
uri: 'http://api.mockjitsu.com:90210/apps/mickey/example-app', | |
headers: | |
{ Authorization: 'Basic bWlja2V5OnBvaXV5dHJld3E=', | |
'Content-Type': 'application/json' } } | |
{ method: 'GET', | |
uri: 'http://api.mockjitsu.com:90210/apps/mickey/jitsu', | |
headers: |
NewerOlder