Sun Nov 11 JST 2012 尼崎市 小田公民館
公式ハッシュタグ #vim11
Vim勉強会主催者 Vim + Gentoo
class Duel | |
def initialize(*jobs) | |
@lock = Mutex.new | |
@done = false | |
make_thread(jobs) | |
end | |
def join | |
return if @done | |
@threads.first.join |
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use DateTime; | |
use Digest::SHA1 qw(sha1_hex); | |
use Encode; | |
use File::Path qw/make_path/; | |
use HTML::Parser; |
class ApplicationController < ActionController::Base | |
# see also: http://stackoverflow.com/questions/2385799/how-to-redirect-to-a-404-in-rails | |
def not_found! | |
raise ActionController::RoutingError.new('Not Found') | |
end | |
end |
# do not shallow_clone from Git repo | |
namespace :deploy do | |
namespace :assets do | |
# perform precompile only when any of the asset files has changed since the last deploy | |
task :precompile, :roles => :web, :except => {:no_release => true} do | |
from = source.next_revision(current_revision) | |
asset_changing_files = ['vendor/assets/', 'app/assets/', 'lib/assets', 'Gemfile', 'Gemfile.lock'].select {|f| File.exists? f} | |
if capture("cd #{latest_release} && #{source.local.log(from)} #{asset_changing_files.join(' ')} | wc -l").to_i > 0 |
# Requirements: | |
# https://github.com/vigetlabs/capistrano_rsync_with_remote_cache | |
# https://github.com/ndbroadbent/turbo-sprockets-rails3 | |
require 'capistrano/recipes/deploy/strategy/rsync_with_remote_cache' | |
Capistrano::Deploy::Strategy::RsyncWithRemoteCache.class_eval do | |
def deploy! | |
update_local_cache | |
prepare_assets | |
update_remote_cache | |
finalize_assets |
module History | |
module Shell | |
def zsh_history_file | |
@zsh_history_file ||= File.expand_path('~/.zsh_history') | |
end | |
def zsh_history | |
@zsh_history ||= File.read(zsh_history_file) | |
end |
--colour | |
-I app |
class Color | |
@regex: /(?:#([0-9a-f]{3,6})|rgba?\(([^)]+)\))/i | |
@fromHex: (hex) -> | |
if hex[0] is '#' | |
hex = hex.substring(1, 7) | |
if hex.length is 3 | |
hex = hex.charAt(0) + hex.charAt(0) + | |
hex.charAt(1) + hex.charAt(1) + |