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
#!/usr/bin/env bash | |
. $HOME/.bashrc | |
. $HOME/.rvm/scripts/rvm | |
NOW=`date "+%Y%m%d%H%M%S"` | |
# set up target directories | |
CURRENT_DIR=$HOME/apps/current | |
RELESE_DIR=$HOME/apps/releases/$NOW |
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 Jekyll | |
class Foo < Liquid::Tag | |
def render(context) | |
context.registers[:site].config["your_config_var"] | |
end | |
end | |
end | |
Liquid::Template.register_tag('foo', Jekyll::Foo) |
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
# A sample Gemfile | |
source "https://rubygems.org" | |
gem "rails", "4.0.0.beta1" |
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 C | |
attr_accessor :m | |
def initialize(&block) | |
instance_eval(&block) | |
end | |
end | |
x = "hoge" | |
c = C.new { self.m = x } |
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 book_title | |
book_title_lookup(@isbn, @isbn_typ) | |
end | |
private | |
def book_title_lookup(isbn, isbn_type) | |
response = @client.item_lookup do | |
category 'Books' | |
id isbn | |
id_type isbn_type |
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
VCR.configure do |c| | |
c.cassette_library_dir = 'spec/factories/vcr_cassettes' | |
c.allow_http_connections_when_no_cassette = true | |
c.hook_into :webmock | |
c.default_cassette_options = { | |
:match_requests_on => [:query, VCR.request_matchers.uri_without_param(:Timestamp)] | |
} | |
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
namespace :admin do | |
task :host01 => :environment do | |
set :rails_env, :production | |
set :deploy_to, '/home/admin/apps' | |
set :domain, 'admin01' | |
end | |
task :host02 => :environment do | |
set :rails_env, :production | |
set :deploy_to, '/home/admin/apps' |
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/bash | |
export DEPLOY=true | |
export WERCKER_AIRBRAKE_NOTIFY_API_KEY=1qazxsw23edcvfr4 | |
export WERCKER_AIRBRAKE_NOTIFY_HOST=example.com | |
export WERCKER_AIRBRAKE_NOTIFY_SECURE=true | |
#export WERCKER_AIRBRAKE_NOTIFY_ENVIRONMENT=preview | |
export WERCKER_AIRBRAKE_NOTIFY_MESSAGE=OK | |
export WERCKER_GIT_DOMAIN=github.com | |
export WERCKER_GIT_OWNER=1syo |
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
mkdir -p config/deploy | |
create config/deploy.rb | |
create config/deploy/staging.rb | |
create config/deploy/production.rb | |
mkdir -p lib/capistrano/tasks | |
Capified |
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 | |
host=localhost | |
database=db | |
user=dbuser | |
password=password | |
from_date=`date --date '1 days ago' +\%Y-\%m-\%d` | |
to_date=`date +\%Y-\%m-\%d` | |
[email protected] |