Subscriptions with stripe
Code examples use the stripe ruby gem. Most of the links are to stripe's documentation.
![stripe's object model][stripe_object_model_diagram]
To start, create some plans.
Someone recently asked the following question in the discussion forum of the Rubyists LinkedIn group: What separates a junior Rails developer from a senior one? | |
My response follows. Join us at http://www.linkedin.com/groups?gid=120725 to weigh in on this and other topics of interest to Rubyists. As of today there are almost 1,200 members, including numerous movers and shakers in the Ruby and Rails communities. | |
“Distinguishing between junior and senior people in the Rails world is not so different from making the distinction in other web development environments. | |
“Junior Rails people have not dealt with scaling issues to the degree that senior people have. Getting a public-facing Rails application to perform under significant stress is more challenging than doing the same with other building materials such as PHP. Senior people know how to performance-test Rails applications, where to look for bottlenecks, and how to eliminate them one after another until performance is acceptable in real conditions. The Ra |
require 'md5' | |
class Chargify::HooksController < ApplicationController | |
protect_from_forgery :except => :dispatch | |
before_filter :verify, :only => :dispatch | |
EVENTS = %w[ test signup_success signup_failure renewal_success renewal_failure payment_success payment_failure billing_date_change subscription_state_change subscription_product_change ].freeze | |
def dispatch | |
event = params[:event] |
Code examples use the stripe ruby gem. Most of the links are to stripe's documentation.
![stripe's object model][stripe_object_model_diagram]
To start, create some plans.
FAYE_TOKEN = 'secretToken' | |
if defined? Rails | |
if Rails.env == 'development' | |
FAYE_URI = "http://#{APP_CONFIG[:nameremoved_service][:host]}:9292/faye" | |
else | |
FAYE_URI = "https://#{APP_CONFIG[:nameremoved_service][:host]}/faye" | |
end |
/* Example tokeninput style #1: Token vertical list*/ | |
ul.token-input-list { | |
overflow: hidden; | |
height: auto !important; | |
height: 1%; | |
width: 400px; | |
border: 1px solid #999; | |
cursor: text; | |
font-size: 12px; | |
font-family: Verdana; |
##Simply annoying Tweets
Annoyingly extended words (4+ of the same letter in a phrase): OOOOHHHHMMMMYYYYGGGGOOOODDDD
([a-z])/1{4}
Tweet w/ just a single hashtag: #omgthissucks
^ *#[^ ]+$
require "rubygems" | |
require "twitter" | |
require "json" | |
# things you must configure | |
TWITTER_USER = "your_username" | |
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted | |
# get these from dev.twitter.com | |
CONSUMER_KEY = "your_consumer_key" |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.
This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.
You are encouraged to fork this and modify it to your heart's content to match your own needs.
class AuthenticatedScraper | |
def initialize(args) | |
if args[:session] | |
@cookie_jar = args[:session] | |
@agent = Mechanize.new | |
@agent.cookie_jar = load_session(@cookie_jar) | |
else | |
@agent = Mechanize.new | |
@agent.login(args[:username], args[ password]) | |
end |