Skip to content

Instantly share code, notes, and snippets.

namespace :myapp do
desc 'Captures a heroku bundle and downloads it. The downloaded files are stored in backups/'
task :backup do
app_name = RAILS_ROOT.split('/').last
timestamp = `date -u '+%Y-%m-%d-%H-%M'`.chomp
bundle_name = "#{app_name}-#{timestamp}"
puts "Capturing bundle #{bundle_name}..."
`heroku bundles:capture --app #{app_name} '#{bundle_name}'`
# poll for completion (warning, a little hacky)
begin
@Epictetus
Epictetus / bootstrap.sh
Created September 19, 2011 16:47 — forked from anonymous/bootstrap.sh
Django on Heroku with Celery and Sentry
virtualenv --no-site-packages .
source bin/activate
bin/pip install Django psycopg2 django-sentry
bin/pip freeze > requirements.txt
bin/django-admin.py startproject mysite
cat >.gitignore <<EOF
bin/
include/
lib/
EOF
[OptimizeGoogle]
http://itpro.nikkeibp.co.jp/word/*
http://*.ceron.jp/*
http://ceron.jp/*
http://tweetbuzz.jp/*
/http:\/\/(\w+\.)*buzzurl\.jp//i
http://wadaino.jp/*
http://eimg.jp/*
http://*.eimg.jp/*
http://d.hatena.ne.jp/keyword/*
# simple extension to ActiveMerchant for basic support of recurring payments with Express Checkout API
#
# See http://http://clockobj.co.uk/2008/09/07/ruby-on-rails-paypal-express-recurring-payments-using-active-merchant/
# for details on getting started with this gateway
#
#
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class PaypalExpressRecurringNvGateway < Gateway
include PaypalNvCommonAPI
# The MIT License
#
# Copyright (c) 2008 Vuzit.com, Chris Cera, Tobias Luetke
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@Epictetus
Epictetus / gist:1242700
Created September 26, 2011 16:47 — forked from 9876691/gist:640681
Paypal Subscription IPN
class PaypalController < ApplicationController
protect_from_forgery :except => :paypal_ipn
# This will be called when soemone first subscribes
def sign_up_user(custom, plan_id)
logger.info("sign_up_user (#{custom})")
end
# This will be called if someone cancels a payment
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class PaypalGateway < Gateway
RECURRING_ACTIONS = Set.new([:add, :modify, :inquiry, :suspend, :reactivate, :cancel])
# Creates a recurring profile
def create_recurring_profile(*args) #:nodoc:
request = build_recurring_request(:add, *args)
commit('CreateRecurringPaymentsProfile', request)
credit_card = {
:type => '[cc type, e.g. 'visa']',
:number => '[cc number, from test account]',
:verification_value => '123',
:month => '[expiration month, from test account]',
:year => '[expiration year, from test account]',
:first_name => '[first name, can be anything]',
:last_name => '[last name, can be anything]',
:street_1 => '[street address, can be anything]',
:city => '[city, can be anything]',
credit_card = {
:type => '[cc type, e.g. 'visa']',
:number => '[cc number, from test account]',
:verification_value => '123',
:month => '[expiration month, from test account]',
:year => '[expiration year, from test account]',
:first_name => '[first name, can be anything]',
:last_name => '[last name, can be anything]',
:street_1 => '[street address, can be anything]',
:city => '[city, can be anything]',
@Epictetus
Epictetus / recommendation.md
Created October 4, 2011 04:59 — forked from kmizu/recommendation.md
ウォッチすべきScalaエンジニア(海外/日本人)のTwitterアカウント

フォローしておいた方がいいようなScalaエンジニア(海外勢/日本人)のTwitterアカウント

概要

海外勢/日本人のScala(エンジニア/ユーザ)の中で、特にフォローしておくといい方のTwitterアカウントを集めてみました。作成途中なので、突っ込み歓迎。fork歓迎。

海外

  • @robey Twitterの中の人。ScalaによるメッセージキューKestrelを作ったのもこの人。
  • @n8han 今話題のhttpツールキットUnfilteredの作者。NYのScalaエンジニアの中でも有名人。他にも、conscriptを初めとして、多数のプログラムを開発している。詳細は彼のgithub アカウント 参照。