Skip to content

Instantly share code, notes, and snippets.

View nefo-mi's full-sized avatar

Mitsuhide Nefo nefo-mi

View GitHub Profile
@nefo-mi
nefo-mi / gist:877316
Created March 19, 2011 07:49
logを見やすくするワンライナー(zsh依存)
% cat nantoka.log
START TIME: 2011/03/17 12:00:22
hoge
END TIME: 2011/3/17 13:00:43
huga
START TIME: 2011/03/17 13:06:22
hago
END TIME: 2011/3/17 13:30:43
START TIME: 2011/03/17 14:01:22
are
@nefo-mi
nefo-mi / gist:996664
Created May 28, 2011 06:25
80個の"="でできた罫線を出力するワンライナー
$ i=0; while [ $i -le 80 ]; do s=$s'='; i=`expr $i + 1`; done;echo $s
$ echo `yes = | head -n 80` |sed 's/\s//g'
$ echo `yes = | head -n 80` |sed 's/ //g'
$ echo ''|dd cbs=80 conv=block |sed 's/ /=/g'
$ perl $ ruby -e "puts '='*80"
$ ruby -e "puts '='*80"
@nefo-mi
nefo-mi / gist:1064163
Created July 5, 2011 02:19
say "hago" on Linux
% sudo aptitude install festival
% festival
festival> (SayText "Hago")
% echo Hago | text2wave -o hago.wav
% echo ShiniHago | text2wave -o shinihago.wav
@nefo-mi
nefo-mi / gist:1105648
Created July 26, 2011 00:43
meadowの設定
;;; Window制御
(when window-system
(tool-bar-mode 0)
(menu-bar-mode 0)
(toggle-scroll-bar nil)
(server-start)
)
;;; グローバルキー
(global-set-key "\C-h" 'delete-backward-char)
@nefo-mi
nefo-mi / gist:1252893
Created September 30, 2011 06:43
CLI DropBoxのLAN Synkを止める
@nefo-mi
nefo-mi / vbtags.rb
Created December 14, 2011 04:48
VB.NETのタグファイルを作るスクリプト
#!/usr/local/bin/ruby
# Ref: http://homepage1.nifty.com/markey/memo/200406.html
tags = []
ARGF.each_line do |line|
ARGF.skip if /tags/i =~ ARGF.filename
if /(Sub|Function|Const|Property)\s+([^\s]+)\s*(\(|=)/ =~ line
tags.push "#{$2}\t#{ARGF.filename}\t/^#{line.chomp}$/;\"\tf"
end
if /Class/ =~ line && /End Class/ !~ line
@nefo-mi
nefo-mi / config.yml
Created February 10, 2012 16:06
Twitterのリストに人を登録するRubyスクリプト ref: http://qiita.com/items/2339
:user_name: YOUR NAME
:list_name: LIST NAME
:consumer_key: CONSUMER KEY
:consumer_secret: CONSUMER SECRET
:oauth_token: ACCESS TOKEN
:oauth_token_secret: ACCESS SECRET TOKEN
@nefo-mi
nefo-mi / export_atnd2twit.rb
Created February 17, 2012 01:34
ATNDから参加者のTwitterアカウントを抜き出すRubyスクリプト ref: http://qiita.com/items/2566
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
if ARGV.first.nil?
puts <<EOF
USAGE: export_atnd2twit.rb [ATND EVENT ID]
e.g. ruby export_atnd2twit.rb 24700
# http://atnd.org/events/24700
@nefo-mi
nefo-mi / file0.rb
Created March 2, 2012 16:08
Rubyで標準出力をナニしたい時に書いたコード ref: http://qiita.com/items/2951
class Display
attr_accessor :print
def initialize
@print = []
end
def write(msg)
@print.push(msg)
end
@nefo-mi
nefo-mi / gist:1974147
Created March 4, 2012 17:56
twittering-modeからデータを抜き出すlispぽいの
M-:
(let((l(twittering-current-timeline-data)))(with-temp-file"~/a.txt"(mapc(lambda(tw)(insert"http://twitter.com/#!/"(cdr(assq'user-screen-name tw))"/status/"(cdr(assq'id tw))"\n"))l)))
で現在表示してるtimelineからデータを抜き出してtwitterのurlっぽいなにをファイルに保存する。
フィルタかけたい。