Skip to content

Instantly share code, notes, and snippets.

Avatar

Takuma Nakajima penguin2716

View GitHub Profile
@penguin2716
penguin2716 / fpcidsrc.sh
Created Oct 2, 2011
Shellscript to help find linux module sources for pci devices
View fpcidsrc.sh
#!/bin/sh
if [ $# -ne 1 ]
then
echo "Error: Please run with a keyword for searching pci devices."
echo "keyword example: ether, vga, audio, etc..."
exit 1
fi
echo "* symlink: /usr/src/linux -> `readlink /usr/src/linux`"
@penguin2716
penguin2716 / gtk_mtk.rb.patch
Created Oct 4, 2011
invisible character patch for mikutter
View gtk_mtk.rb.patch
--- core/mui/gtk_mtk.rb 2011-10-04 02:08:16.324056729 +0900
+++ core/mui/gtk_mtk.rb.new 2011-10-04 02:05:46.883627688 +0900
@@ -133,6 +133,7 @@
container = Gtk::HBox.new(false, 0)
input = Gtk::Entry.new
input.text = proc.call(nil)
+ input.invisible_char = "〄".encode("UTF-8").ord
input.visibility = visibility
container.pack_start(Gtk::Label.new(label), false, true, 0) if label
container.pack_start(Gtk::Alignment.new(1.0, 0.5, 0, 0).add(input), true, true, 0)
@penguin2716
penguin2716 / proxy.rb.patch
Created Oct 4, 2011
proxy password patch for mikutter
View proxy.rb.patch
--- core/addon/proxy/proxy.rb 2011-10-04 02:08:16.323056752 +0900
+++ core/addon/proxy/proxy.rb.new 2011-10-04 02:07:12.196160474 +0900
@@ -1,4 +1,4 @@
-# -*- coding: utf-8
+# -*- coding: utf-8 -8
miquire :addon, 'addon'
miquire :core, 'environment'
@@ -92,7 +92,7 @@
sv = Mtk.input(:proxy_server, "サーバ")
@penguin2716
penguin2716 / repfav2t.rb
Created Oct 21, 2011
mikutterでのf2t支援スクリプト
View repfav2t.rb
# プラグインではありません.
# みんなで時刻を合わせてM-xして貼り付けましょう!
Thread.new{
start = Time.local(2011,12,3,9,39,39)
sleep(0.5) while start - Time.new > 0
Thread.new{
7.times{
20.times{|x|
Thread.new{
@penguin2716
penguin2716 / altfav.rb
Created Nov 9, 2011
ふぁぼれなかったら非公式ふぁぼ飛ばすmikutterプラグイン
View altfav.rb
# -*- coding: utf-8 -*-
Plugin.create(:altfav) do
def self.altfav(m)
if Post.primary_service.twitter.favorite(m.message.id).code != '200' then
Post.primary_service.update(:message => "@#{m.message.user.to_s}#{" " * rand(40)}", :replyto => m.message)
end
end
@penguin2716
penguin2716 / airfav.rb
Created Nov 9, 2011
えあふぁぼするmikutterプラグイン
View airfav.rb
# -*- coding: utf-8 -*-
Plugin.create(:airfav) do
def self.airfav(m)
Thread.new{
sleep(0.5 + rand(500) / 1000.0)
m.message.add_favorited_by(Post.primary_service.user_obj)
m.message.remove_favorited_by(Post.primary_service.user_obj)
}
@penguin2716
penguin2716 / xprofile
Created Feb 5, 2012
~/.xprofile for ibus
View xprofile
# do not forget to run dbus
export XIM=ibus
export XIM_PROGRAM=/usr/bin/ibus-daemon
export XIM_ARGS="--xim"
export XMODIFIERS=@im=ibus
export GTK_IM_MODULE="ibus"
export QT_IM_MODULE="ibus"
export DefaultIMModule=ibus
ibus-daemon -d -x
View gist:1758318
[penguin@ThinkPadX220 mikutter]% uname -a
Linux ThinkPadX220 3.2.2-gentoo #1 SMP PREEMPT Tue Feb 7 16:46:35 JST 2012 x86_64 Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz GenuineIntel GNU/Linux
[penguin@ThinkPadX220 mikutter]% svn update
At revision 660.
[penguin@ThinkPadX220 mikutter]% ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
[penguin@ThinkPadX220 mikutter]% gem -v
1.8.15
[penguin@ThinkPadX220 mikutter]% emerge -s ruby-gtk2 | grep installed
Latest version installed: 1.1.0
@penguin2716
penguin2716 / gtk_emacslike_textview.rb
Created Feb 29, 2012
mikutterの投稿ボックスにEmacsっぽいキーバインドを付けるやつ(スタックがStringになるバグを除去)
View gtk_emacslike_textview.rb
#-*- coding: utf-8 -*-
=begin
* これは何?
mikutterの投稿ボックスにEmacsっぽいキーバインドを付けます.
だいたい次みたいなことができます.
・C-[fbnpae] カーソルの移動
・C-[dh] 文字の削除
・C-SPC 選択のトグル
・C-[/z] 戻る
@penguin2716
penguin2716 / opening.rb.diff
Created Mar 4, 2012
mikutterの画像表示ウィンドウでCtrl+wかEscすると閉じるパッチ
View opening.rb.diff
--- core/addon/openimg/openimg.rb.org 2012-03-04 12:03:17.013064940 +0900
+++ core/addon/openimg/openimg.rb 2012-03-04 12:13:38.603705833 +0900
@@ -30,6 +30,14 @@
w.set_size_request(320, 240)
w.set_default_size(*@size).move(*@position)
w.signal_connect(:destroy){ w.destroy }
+ w.signal_connect(:key_press_event){ |w,e|
+ if Gdk::Keyval.to_name(e.keyval) == 'Escape' or
+ (Gdk::Window::ModifierType::CONTROL_MASK ==
+ e.state & Gdk::Window::CONTROL_MASK and
You can’t perform that action at this time.