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 Order < ActiveRecord::Base | |
def processing_fee | |
packages_with_processing_fees = ['Package', 'FamilyPackage', 'LadiesPackage', 'CompletePackage'] | |
fee = 0 | |
# Only apply fee if cart contains an item with processing fees | |
fee = 3.00 if line_items.any? {|line_item| packages_with_processing_fees.include? line_item.item.class.to_s } | |
if customer |
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
#showlinks | |
[email protected] do |link| | |
%p= link_to( link.title, link.url, :title => link.title, :target => '_blank' ) | |
#linknote | |
%p Send this link to your friends: | |
%b | |
%a{:href => "/" } Dude | |
/ This works, but I am trying to put @instance_variable in the "/" and the "Dude" |
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 'feedzirra' | |
# fetching a single feed | |
feed = Feedzirra::Feed.fetch_and_parse("http://feeds.feedburner.com/PaulDixExplainsNothing") | |
# feed and entries accessors | |
feed.title # => "Paul Dix Explains Nothing" | |
feed.url # => "http://www.pauldix.net" | |
feed.feed_url # => "http://feeds.feedburner.com/PaulDixExplainsNothing" | |
feed.etag # => "GunxqnEP4NeYhrqq9TyVKTuDnh0" |
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 | |
# linux firewall/forwarding | |
modprobe iptable_nat | |
echo 1 | tee /proc/sys/net/ipv4/ip_forward | |
iptables -t nat -A POSTROUTING -s 10.10.10.1/2 -o eth0 -j MASQUERADE | |
# install openvpn | |
apt-get update && apt-get install -y openvpn | |
cd /etc/openvpn/ | |
INSTANCE=$(curl http://169.254.169.254/latest/meta-data/public-hostname) | |
openvpn --genkey --secret ${INSTANCE}.key |
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
set :domain, ENV["domain"] | |
set :application, domain | |
set :user, ENV["user"] | |
set :destination, ENV["destination"] || domain | |
set :web_conf, ENV["web_conf"] || ENV["environment"] || 'production' | |
raise "please set domain=app.domain.name.com" unless domain | |
raise "please set user=server_username" unless user | |
set :port, ENV["port"] || 1234 | |
set :repository, "." |
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
# Apt-Proxy hosting image | |
# | |
# VERSION 0.1.0 | |
# Use a modified version of the Ubuntu base image provided by dotCloud | |
FROM fairchild/ubuntu | |
MAINTAINER Michael Fairchild [email protected] | |
ENV APT_PROXY apt.dockerdev.att.io | |
RUN apt-get update && apt-get install -y apt-cacher-ng |
The Simple Ambassador Container (let's just call it the ambassador) is a reusable container which can be added to your stack to represent a remote service. Using an ambassador your application can discover remote services using docker's standard links features.
Example usage:
REDIS_REMOTE_IP=1.2.3.4
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
echo "Flipping tables! (╯°□°)╯︵ ┻━┻" | |
num_rules=3 | |
real=3 # exposed to the ELB as port 443 | |
test=4 # used to install test certs for domain verification | |
health=5 # used by the ELB healthcheck | |
blue_prefix=855 | |
green_prefix=866 |