Skip to content

Instantly share code, notes, and snippets.

View tyru's full-sized avatar
🏠
Working from home

Fujiwara Takuya tyru

🏠
Working from home
View GitHub Profile
@h1mesuke
h1mesuke / conque_term_settings.vim
Created June 23, 2010 23:07
Vim - My current settings for ConqueTerm
" Conque
" http://www.vim.org/scripts/script.php?script_id=2771
" ~/.vim/after/ftplugin/conque_term.vim
augroup MyConqueTerm
autocmd!
" start Insert mode on BufEnter
autocmd BufEnter *
\ if &l:filetype ==# 'conque_term' |
@hitode909
hitode909 / always_140.rb
Created June 26, 2010 02:39
termtterで必ず140文字投稿する
module Termtter::Client
register_hook(
:name => :always_140,
:points => [:modify_arg_for_update],
:exec_proc => lambda {|cmd, body|
body.chomp!
max = 140
len = body.split(//).length
mod = max % len
ext = (0...len).to_a.sort_by{ rand }.take(mod)
// ==UserScript==
// @name decode hitode909
// @namespace http://d.hatena.ne.jp/send/
// @description twitter filter
// @include http://twitter.com/*
// @include http://mobile.twitter.com/*
// ==/UserScript==
//
(function (){
↑のStar押してみて!
function! JavaScriptUnderScoreBecomesCamelCase()
if matchstr(getline('.'), '.', col('.')-2) =~ '\w'
return "\<Plug>(stickykey-shift)"
else
return '_'
endif
endfunction!
imap <buffer><expr> _ JavaScriptUnderScoreBecomesCamelCase()
// g++ -std=c++0x cxx0x-deferred.cxx
#include <iostream>
template <typename T>
class Deferred {
private:
T r;
public:
Deferred() {}
Deferred(T v) : r(v) {}
@anekos
anekos / commandline-filter.js
Created July 30, 2010 07:16
コマンドライン確定前に、実行していいかチェックできるよ!
plugins.libly.$U.around(
commandline._callbacks.submit,
modes.EX,
function (next, [arg]) {
if (/^viewSBMComments/(arg) && buffer.URL == 'about:blank')
return;
else
return next();
}
)
diff --git string.c string.c
index 0aa2e6c..6c9be57 100644
--- string.c
+++ string.c
@@ -2055,6 +2055,43 @@ rb_str_concat(VALUE str1, VALUE str2)
}
}
+/*
setlocal foldmethod=expr foldexpr=DiffFold(v:lnum)
function! DiffFold(lnum)
let line = getline(a:lnum)
let next = getline(a:lnum + 1)
if line =~ '^[-=]\{3}'
return 1
elseif next =~ '^[-=]\{3}'
return '<1'
elseif line =~ '^@@'
#!/usr/bin/perl
# Author: Todd Larason <[email protected]>
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
# colors 16-231 are a 6x6x6 color cube
for ($red = 0; $red < 6; $red++) {