Run each chain:
$ ruby full_chain.rb
$ ruby half_chain.rb
$ ruby no_chain.rb
#!/usr/bin/env ruby | |
require 'izanami/app' | |
$stdout.puts '>>> Izanami configuration' | |
ENV.each do |var, value| | |
if var.to_s.match(/\AIZANAMI_/) | |
$stdout.puts ">>> #{var}=#{value}" | |
end | |
end |
# A sample Gemfile | |
source "https://rubygems.org" | |
gem 'mechanize' | |
gem 'chronic' |
#!/usr/bin/env ruby | |
# @see http://stackoverflow.com/a/11522507 | |
if ARGV.empty? | |
$stdout.puts "Usage: cleanup.rb dump.sql table_a [table_b ...]" | |
else | |
args = ARGV.reverse | |
file = args.pop |
require_relative 'visitor' | |
require_relative 'visitable' | |
class Object | |
include Visitable | |
end | |
class Log < Visitor | |
def visit_Array(array) | |
puts 'Logging array:' |
#! /usr/bin/perl | |
# @link: http://unix.stackexchange.com/questions/4527/program-that-passes-stdin-to-stdout-with-color-codes-stripped | |
use strict; | |
use warnings; | |
while (<>) { | |
s/\e\[?.*?[\@-~]//g; # Strip ANSI escape codes | |
print; |
# encoding: utf-8 | |
# Gemfile | |
source 'https://rubygems.org/' | |
gem 'rake' # up to date version | |
gem 'rack', '~> 1.4.1' # pessimistic version | |
gem 'thin', '= 1.5' # exact version | |
group :test do | |
gem 'rspec' |
# encoding: utf-8 | |
use Rack::Static, | |
:urls => ['/css', '/img', '/js', '/less'], | |
:root => 'public' | |
run lambda { |env| | |
[ | |
200, | |
{ |
# encoding: utf-8 | |
# | |
# Extract from: | |
# @link: http://www.mattsears.com/articles/2011/11/27/ruby-blocks-as-dynamic-callbacks | |
# @link: http://techscursion.com/2011/11/turning-callbacks-inside-out | |
class ProcCallback | |
def initialize(callable, *args) | |
@callable = callable.to_s | |
@arguments = args.dup |
-# Code... | |
%body{ :"data-controller" => controller_name, :"data-action" => action_name } | |
-# Code... |