Skip to content

Instantly share code, notes, and snippets.

View takuo's full-sized avatar

Takuo Kitame takuo

  • Bandai Namco Studios, Inc.
  • Saitama, Japan
  • 00:16 (UTC +09:00)
View GitHub Profile
@takuo
takuo / rakuten_uncheck_news.user.js
Created June 13, 2011 08:43
楽天のメルマガチェックはずし
// ==UserScript==
// @name Rakuten uncheck news
// @namespace http://takuo.jp/
// @description 楽天の購入時メルマガチェックはずし
// @match https://*.rakuten.co.jp/*
// ==/UserScript==
var elems = document.getElementsByTagName("input");
for (var i = 0; i < elems.length; i++) {
var elem = elems[i];
if (elem.type == "checkbox" && elem.name.match(/^(newsId|news_?check|rmail_check|shop_rating_check)/)) {
@takuo
takuo / gist:282683
Created January 21, 2010 09:14
mime decode for ruby1.9
# mime decode for ruby 1.9
def mime_decode( input, out_charset = 'utf-8' )
while input.sub!(/(=\?[A-Za-z0-9_-]+\?[BQbq]\?[^\?]+\?=)(?:(?:\r\n)?[\s\t])+(=\?[A-Za-z0-9_-]+\?[BQbq]\?[^\?]+\?=)/, '\1\2')
end
begin
ret = input.sub!( /=\?([A-Za-z0-9_-]+)\?([BQbq])\?([^\?]+)\?=/ ) {
charset = $1
enc = $2.upcase
word = $3
word = word.unpack( { "B"=>"m*", "Q"=>"M*" }[enc] ).first
@takuo
takuo / gwibber.diff
Created November 30, 2009 07:39
Gwibber Native Retweet patch
diff -uNr gwibber.orig/actions.py gwibber/actions.py
--- gwibber.orig/actions.py 2009-08-28 16:28:19.000000000 +0900
+++ gwibber/actions.py 2009-11-30 16:36:42.000000000 +0900
@@ -65,6 +65,26 @@
def include(self, client, msg):
return msg.account.supports(microblog.can.RETWEET)
+
+class RetweetNative(MessageAction):
+ icon = "mail-forward"
@takuo
takuo / gist:245289
Created November 30, 2009 05:51
show native RT in gwibber's timeline
--- gwibber/microblog/twitter.py.orig 2009-11-30 14:50:00.000000000 +0900
+++ gwibber/microblog/twitter.py 2009-11-30 14:50:13.000000000 +0900
@@ -169,7 +169,7 @@
def get_messages(self):
return simplejson.loads(self.connect(
- "https://twitter.com/statuses/friends_timeline.json" +'?'+
+ "https://twitter.com/statuses/home_timeline.json" +'?'+
urllib.urlencode({"count": self.account["receive_count"] or "20"})))