Skip to content

Instantly share code, notes, and snippets.

View ursm's full-sized avatar

Keita Urashima ursm

View GitHub Profile
function! s:Todo()
call s:OpenBufferFromCommand('ditz todo', function('s:IssueCallback'))
endfunction
function! s:TodoAll()
call s:OpenBufferFromCommand('ditz todo --all', function('s:IssueCallback'))
endfunction
function! s:Grep(args)
call s:OpenBufferFromCommand(printf('ditz grep "%s"', a:args), function('s:IssueCallback'))
require 'time'
module Ditz
class Issue
def hg_commits
return @hg_commits if @hg_commits
output = `hg log --template '{date|rfc822date}\t{author}\t{node|short}\t{desc|firstline}\n' #{pathname}`
@hg_commits = output.split("\n").map {|line|
date, *vals = line.split("\t")
class Ditz::HookManager
on :after_add do |project, config, issues|
issues.each do |i|
`hg add #{i.pathname}`
end
end
on :after_delete do |project, config, issues|
issues.each do |i|
`hg remove #{i.pathname}`
#UseHook
SetStoreCapslockMode Off
+vkF4::Send ~
vkF4::Send {``}
vkF3::Send {``}
+2::Send @
+6::Send {^}
+7::Send {&}
#!/usr/bin/env ruby
require 'fileutils'
require 'tempfile'
unless ARGV.size == 2
$stderr.puts "usage: #{$0} SOURCE DEST"
exit(1)
end
src, dest = ARGV
!!! 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'}
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>"
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 = '"'
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
<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