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
require 'open3' | |
def system!(*args) | |
out, status = Open3.capture2e(*args) | |
raise RuntimeError, out unless status.success? | |
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
#!/usr/bin/env ruby | |
require 'fileutils' | |
require 'tempfile' | |
unless ARGV.size == 2 | |
$stderr.puts "usage: #{$0} SOURCE DEST" | |
exit(1) | |
end | |
src, dest = ARGV |
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
!!! XML | |
!!! 1.0 | |
%html | |
%head | |
%title multiple selection demo | |
%script{:type => 'text/javascript', :src => 'prototype.js'} | |
%script{:type => 'text/javascript', :src => 'effects.js'} | |
%script{:type => 'text/javascript', :src => 'controls.js'} | |
%style{:type => 'text/css'} |
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
let s:prefix = 'HG: changed ' | |
let s:files = map(filter(getline(0, '$'), 'v:val =~ "^" . s:prefix'), 'strpart(v:val, strlen(s:prefix))') | |
if len(s:files) == 0 | |
finish | |
end | |
new | |
setlocal filetype=diff bufhidden=delete buftype=nofile previewwindow nobackup noswapfile | |
execute 'normal! :0r!hg diff ' . join(s:files) . "¥n¥<CR>" |
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
diff --git a/hgpushsvn.py b/hgpushsvn.py | |
--- a/hgpushsvn.py | |
+++ b/hgpushsvn.py | |
@@ -11,14 +11,18 @@ | |
def shell_quote(s): | |
- return "'" + s.replace('¥¥', '¥¥¥¥').replace("'", "'¥"'¥"'") + "'" | |
+ if os.name == "nt": | |
+ q = '"' |
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
<VirtualHost *:80> | |
ServerName watch-night.ursm.jp | |
ServerAdmin ursm@ursm.jp | |
DocumentRoot "/u/apps/watch-night/current/tmp/build" | |
<Directory "/u/apps/watch-night/current/tmp/build"> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Order allow,deny | |
Allow from all |
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
set :application, 'watch-night' | |
set :scm, :mercurial | |
set :repository, "https://bitbucket.org/ursm/#{application}/" | |
set :deploy_via, :remote_cache | |
server = 'ursm.jp' | |
role :app, server | |
role :web, server | |
role :db, server, :primary => true |
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
out = `rake --help` | |
sss = out.lines.map(&:strip).grep(/^-/).map {|s| | |
opt = /(?:-¥w|--[-¥w]+?)/ | |
arg = /¥[?([A-Z]+)¥]?/ | |
s.match(/(#{opt}(?:, #{opt})*)(?: #{arg})? {2,}(.*)/).to_a[1..-1] | |
}.reject(&:nil?) | |
hs = sss.map {|opts, arg, desc| |
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
>> require 'csv' | |
=> true | |
>> CSV.parse("hoge\tfuga\n1\t2\n", col_sep: "\t") | |
=> [["hoge", "fuga"], ["1", "2"]] |
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
CFLAGS="-march=nocona -O2 -ssse3 -fomit-frame-pointer -pipe" | |
CXXFLAGS=$CFLAGS | |
MAKEOPTS="-j4" | |
USE="unicode nls cjk ipv6 threads vim-syntax -fortran jpeg svg tiff gif" | |
LINGUAS="ja" | |
FEATURES="ccache" | |
source /opt/gentoo/usr/local/portage/layman/make.conf |