psql DATABASE_URL -c "select id,title from articles" -A -F, | pbcopy
-A
位置揃えなし-F,
カンマ区切りDATABASE_URL
はpostgres://user:password@host:port/database
# target_version: | |
# rubocop v0.34.2 | |
# 自動生成されるものはチェック対象から除外する | |
AllCops: | |
Exclude: | |
- "vendor/**/*" # rubocop config/default.yml | |
- "db/schema.rb" | |
DisplayCopNames: true |
Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.
This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.
There is a companion feature matrix of various tools. Comments are welcome in the same manner.
shared_context "for_extending" do | |
context "extended with MyModule" do | |
before(:all){ subject.extend(MyModule) } | |
it "should define #some_method" do | |
subject.should respond_to(:some_method) | |
end | |
yield | |
end | |
end |
This tutorial guides you through creating your first Vagrant project.
We start with a generic Ubuntu VM, and use the Chef provisioning tool to:
Afterwards, we'll see how easy it is to package our newly provisioned VM
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# David Lutz's Multi VM Vagrantfile | |
# inspired from Mark Barger's https://gist.github.com/2404910 | |
boxes = [ | |
{ :name => :web, :role => 'web_dev', :ip => '192.168.33.1', :ssh_port => 2201, :http_fwd => 9980, :cpus =>4, :shares => true }, | |
{ :name => :data, :role => 'data_dev', :ip => '192.168.33.2', :ssh_port => 2202, :mysql_fwd => 9936, :cpus =>4 }, | |
{ :name => :railsapp, :role => 'railsapp_dev', :ip => '192.168.33.3', :ssh_port => 2203, :http_fwd => 9990, :cpus =>1} | |
] |
class ApplicationController < ActionController::Base | |
... | |
# FORCE to implement content_for in controller | |
def view_context | |
super.tap do |view| | |
(@_content_for || {}).each do |name,content| | |
view.content_for name, content | |
end | |
end | |
end |
# 2. Include Sweeping module in your controller(s) to have cache_sweeper | |
# method to be avaliable, or right in ApplicationController so it will be | |
# available in all controllers inheriting from it. | |
class ApplicationController < ActionController::Base | |
include ActionController::Caching::Sweeping | |
# ... | |
end |
#!/usr/bin/env perl | |
=head1 Examples | |
$ tail -f access_log | perl colorize.pl | |
$ plackup app.psgi 2>&1 | perl colorize.pl | |
=cut | |
use strict; |
#!/usr/bin/env ruby | |
# usage: | |
# taifu http://www.youtube.com/watch?v=KPWfBfFFrwsx | |
# taifu depends on VLC.app and rb-appscript gem | |
require 'rubygems' | |
require 'appscript' | |
require 'fileutils' |