Skip to content

Instantly share code, notes, and snippets.

View yosshi's full-sized avatar
🦍

Yoshiyuki MIYAGI yosshi

🦍
View GitHub Profile
@yosshi
yosshi / Main.as
Created October 15, 2009 01:58
単純にいろんな言語でロト6の数字を決めてみる
package
{
import flash.display.Sprite;
import flash.text.TextField;
public class Main extends Sprite
{
public function Main()
{
var textField:TextField = new TextField();
てすと
;;バッファ切り替え(C-x b)
(iswitchb-mode t)
(iswitchb-default-keybindings)
(add-hook 'iswitchb-define-mode-map-hook
'iswitchb-my-keys)
(defun iswitchb-my-keys ()
"Add my keybindings for iswitchb."
(define-key iswitchb-mode-map [right] 'iswitchb-next-match)
@yosshi
yosshi / gist:227791
Created November 6, 2009 07:15
意味のないコードを書きためていきたいと思う
['みかん','ともちゃん','なおちゃん'].product(['ねむい','おなかすいた','かえりたい']).shuffle.take(1).join
@yosshi
yosshi / gist:229874
Created November 9, 2009 11:06 — forked from uasi/gist:214109
#
# Show branch name in Zsh's right prompt
#
autoload -Uz VCS_INFO_get_data_git; VCS_INFO_get_data_git 2> /dev/null
function rprompt-git-current-branch {
local name st color gitdir action
if [[ "$PWD" =~ '/¥.git(/.*)?$' ]]; then
return
@yosshi
yosshi / getRandomString.rb
Created January 9, 2010 15:12
ランダムな文字列を生成する
# ランダムな文字列を生成する。
# 引数 _length_ を指定すると生成桁数を指定することができます(デフォルト 8 桁)。
def getRandomString (length = 8)
if length == 0
length = 8
end
source=("a".."z").to_a + ("A".."Z").to_a + (0..9).to_a + ["_","-","."]
key=""
length.times{ key+= source[rand(source.size)].to_s }
return key
@yosshi
yosshi / clear_emacs_backup_file.sh
Created January 9, 2010 15:14
emacs が生成するバックアップファイルを削除
#!/bin/sh
rm -rf `find ~/ -name "*\~"`
#!/bin/sh
for file in $*
do
if [ -f $file ]; then
nkf --utf8 $file > tmpfile
mv tmpfile $file
fi
done
exit
@yosshi
yosshi / ラー油
Created January 24, 2010 13:25 — forked from kotatsumikan/ラー油
自宅で作るラー油レシピ
■材料
 ベース油(食用油を模索中、ごま油がベター):欲しい量
 白ネギ(の青い部分):適量
 ニンニク:適量
 唐辛子:適量
 容器:ベース油が入る容積をもった容器
■作成方法
1.ニンニクと白ネギをみじん切りにする。
2.ベース油を鍋に入れる。
@yosshi
yosshi / irc2mail.rb
Created January 26, 2010 05:44 — forked from naoto/irc2mail.rb
#!/usr/local/bin/ruby
#
require 'sendgmail.rb'
require 'yaml'
@LOG_DIR = "/path/to/log"
@CHANNEL = %w{#xxxxx@freenode #xxxxx@twitter}
@FILE_NAME = Time.now.strftime("%Y.%m.%d.txt")
@KEYWORDS = "key1|key2|key3"
replys = Array.new