Skip to content

Instantly share code, notes, and snippets.

@eban
eban / gist:14054
Created October 1, 2008 08:49
commit-email.rb
#!/usr/bin/env ruby
require "optparse"
require "ostruct"
SENDMAIL = "/usr/sbin/sendmail"
def parse(args)
options = OpenStruct.new
options.to = []
@eban
eban / README.txt
Created October 15, 2008 08:22
update version.h
Rubyのversion.hの日付けを更新するscript
@eban
eban / scim_skk_dictionary.cpp.diff
Created December 1, 2008 15:23
scim-skkがSEGVするのを直すpatch
--- src/scim_skk_dictionary.cpp.orig 2005-12-18 22:02:39.000000000 +0900
+++ src/scim_skk_dictionary.cpp 2008-11-30 04:38:13.000000000 +0900
@@ -545,5 +545,7 @@
list<CandPair> &cl = m_dictdata[key];
- for (list<CandPair>::iterator it = cl.begin(); it != cl.end(); it++) {
+ for (list<CandPair>::iterator it = cl.begin(); it != cl.end();) {
if (it->first == data.first) {
- cl.erase(it);
+ it = cl.erase(it);
+ } else {
@eban
eban / temp.xml
Created January 7, 2009 05:51
現在の気温
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="現在の気温"
height="200"
description="livedoor 天気情報(現在の気温)1.01"
author="みやけむし"
author_email="miya.mail@gmail.com"
author_location="http://www7.plala.or.jp/miyake/"
screenshot="http://www7.plala.or.jp/miyake/Gadget/Temperature.png"
thumbnail="http://www7.plala.or.jp/miyake/Gadget/Temperature_thumbnail.png"
@eban
eban / ldr_favicon_hack.user.js
Created January 7, 2009 16:24
ldr favicon hack
// ==UserScript==
// @name ldr favicon hack
// @namespace http://d.hatena.ne.jp/javascripter/
// @include http://reader.livedoor.com/reader/
// @include http://fastladder.com/reader/
// ==/UserScript==
(function() {
unsafeWindow.document.watch('title',
function(id, before, after) {
updateFavicon();
@eban
eban / ruby-mltag.user.js
Created February 6, 2009 07:54
linkfy ML-tag
// ==UserScript==
// @name mltag
// @namespace http://jarp.does.notwork.org/userscripts
// @description Looks for things in the page that look like ML-tags but aren't hyperlinked, and converts them to clickable links.
// @include *
// ==/UserScript==
(function () {
const urlRegex = /\[(ruby[\w\-]+):(\d+)\]/ig;
@eban
eban / cal.sh
Created March 27, 2009 16:49
Calender Image
#! /bin/sh
export LC_TIME
LC_TIME=C
day=`date +%e`
plain=`cal -3`
sat=`cal -3 |sed '1s/./ /g;s/.\{18\}\(..\)\( \|$\)/ \1\2/g'`
sun=`cal -3 |sed '1s/./ /g;s/\(..\).\{18\}\( \|$\)/\1 \2/g'`
today=`cal -3 |sed 's/^\(.\{21,\}\) '"$day"' \(.\{21,\}\)$/\1 @ \2/' |tr -c '@\n' ' ' |sed s/@/"$day"/`
xy="${xy:=text 40,660}"
convert \
@eban
eban / ruby-1.8.7-p248-cygwin-1.7.1.patch
Created December 25, 2009 10:44
ruby-1.8.7-p248 cygwin 1.7.1 quick hack
--- eval.c.orig 2009-12-21 17:11:42.000000000 +0900
+++ eval.c 2009-12-24 19:18:21.671875000 +0900
@@ -210,3 +210,3 @@
# ifdef __CYGWIN__
-int _setjmp(), _longjmp();
+int _setjmp(); void _longjmp();
# endif
--- gc.c.orig 2009-12-24 17:28:08.000000000 +0900
+++ gc.c 2009-12-24 19:18:17.875000000 +0900
@@ -42,3 +42,3 @@
@eban
eban / save-tweets.rb
Created March 24, 2011 08:24
~/.earthquake/plugin/save-tweets.rb
# -*- coding: utf-8 -*-
require "fileutils"
require "time"
require "cgi"
Earthquake.init do
logdir = config[:logdir] || File.expand_path("~/.earthquake/log")
FileUtils.mkdir_p logdir
output do |item|
@eban
eban / .vimrc
Created May 14, 2011 07:18
dot files
"scriptnames
set nocp
set completeopt=
set viminfo='100,\"500,h,%
set fileencodings=iso-2022-jp,ucs-bom,utf-8,euc-jp,default
set incsearch
set notitle
set ambiwidth=double
set nf=alpha,hex
set clipboard=unnamed