u(ry
現代日本語圏エンジニアにおいてのヴォルデモートのような存在。名前を言うだけで呪われる。
呪われると以下のようなことが起きる
- ブログを書くと「俺様にバグ報告するのだ!」とコメントを書かれる
- Twitter でしつこい @ スパムがくるようになる
| #!perl -w | |
| # usage: fetch.pl [urls...] | |
| use strict; | |
| use Coro; | |
| use Coro::Select; # この行をコメントアウトすると多重化されなくなり時間がかかるようになる | |
| use Furl; | |
| my @coros; | |
| foreach my $url(@ARGV) { | |
| push @coros, async { |
| setlocal foldmethod=expr foldexpr=MyHelpFold(v:lnum) | |
| setlocal foldtext=MyHelpFoldText() | |
| function! MyHelpFold(lnum) " {{{2 | |
| let line = getline(a:lnum) | |
| let next = getline(a:lnum + 1) | |
| let prev = getline(a:lnum - 1) | |
| if line =~ '^=\{78}$' | |
| return 1 | |
| elseif next =~ '^=\{78}$' |
| "----------------------------------------------------------------------------- | |
| " Abbrev | |
| function! util#abbrev(words) | |
| let table = {} | |
| let seen = {} | |
| for word in a:words | |
| let abbrev = substitute(word, '.$', '', '') | |
| let ablen = strlen(abbrev) | |
| while ablen > 0 |
| function! s:join(lines, ...) | |
| return join(map(a:lines, 'substitute(v:val, "^\\s*", "", "")'), a:0 ? a:1 : '; ') | |
| endfunction | |
| """ Test cases | |
| function! s:Test() | |
| """ s:join | |
| call s:assert(exists('*s:join'), 'function s:join does not exist') |
| use v6; | |
| class Brainfuck { | |
| has $!buf; | |
| has $!ptr; | |
| submethod BUILD(:$buf-size = 1024) { | |
| $!buf = Buf.new(0 xx $buf-size); | |
| $!ptr = 0; | |
| } |
| require 'formula' | |
| class Vim < Formula | |
| homepage 'http://www.vim.org/' | |
| url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2' | |
| head 'https://vim.googlecode.com/hg/' | |
| sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d' | |
| version '7.3.682' | |
| def features; %w(tiny small normal big huge) end |
| function InsertTabWrapper() | |
| let col = col('.') - 1 | |
| if !col || getline('.')[col - 1] !~ '\k' | |
| return "\<tab>" | |
| else | |
| return "\<c-p>" | |
| endif | |
| endfunction | |
| inoremap <tab> <c-r>=InsertTabWrapper()<cr> |
| HgDrop (a DropBox clone) | |
| = How To Run | |
| $ hg init hgdrop | |
| $ cd hgdrop | |
| $ echo -e '[ui]\nusername = bot\n[extensions]\nzeroconf =' > .hg/hgrc | |
| $ hg serve -p 12345 & | |
| $ cat >.hg/hgbox.sh | |
| while :; do |
| require 'yaml' | |
| CONFIG = 'script.yaml' | |
| yaml = YAML.load(File.read(CONFIG)) | |
| COMMAND = yaml['command'] | |
| # Normalize | |
| yaml['scripts'].map do |s| |