Skip to content

Instantly share code, notes, and snippets.

@hitode909
hitode909 / duel.rb
Created November 11, 2012 01:00
並列に実行して最初に返ってきた結果を得るやつ
class Duel
def initialize(*jobs)
@lock = Mutex.new
@done = false
make_thread(jobs)
end
def join
return if @done
@threads.first.join

Vim勉強会#11

Sun Nov 11 JST 2012 尼崎市 小田公民館

公式ハッシュタグ #vim11

ujihisa

Vim勉強会主催者 Vim + Gentoo

@onishi
onishi / wget.pl
Created November 14, 2012 09:30
HTMLまるごと保存
#!/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
@amatsuda
amatsuda / deploy.rb
Created November 15, 2012 06:55
perform precompile only when any of the asset files has changed since the last deploy
# 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
@mirakui
mirakui / compile_assets_and_rsync_with_remote_cache.rb
Created November 15, 2012 13:19
Fast deploy using capistrano_rsync_with_remote_cache and turbo-sprockets-rails3
# 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
@tenderlove
tenderlove / .rspec
Created December 3, 2012 00:11 — forked from coreyhaines/.rspec
Active Record Spec Helper - Loading just active record
--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) +
@dnpp73
dnpp73 / after_jailbreak.md
Last active October 28, 2015 13:54
俺の iPhone の JB 環境まとめ。

俺の iPhone 5 (iOS 6.1.2) の JB 環境まとめ。

iOS 6 に上げたついでに、一時期入れまくってたのと比べると随分ミニマムになった。
iPhone 4 とか iPad mini とか iPad 4 th も大体こんな感じで、 Retina Pad とか FullForce が入る程度かな。たぶん。


Sources

BigBoss