Skip to content

Instantly share code, notes, and snippets.

Takuo Kitame takuo

Block or report user

Report or block takuo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
takuo / gist:282683
Created Jan 21, 2010
mime decode for ruby1.9
View gist:282683
# 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')
ret = input.sub!( /=\?([A-Za-z0-9_-]+)\?([BQbq])\?([^\?]+)\?=/ ) {
charset = $1
enc = $2.upcase
word = $3
word = word.unpack( { "B"=>"m*", "Q"=>"M*" }[enc] ).first
View coincheck_market_price.10s.go
package main
import (
takuo /
Created Oct 20, 2011
Android code snippet - OAuth verifier process (with Twitter4J)
public class OAuthVerify extends Activity {
private static final String CONSUMER_KEY = "";
private static final String CONSUMER_SECRET = "";
private static final String CALLBACK_URL = "myoauthapp://oauthcallback/";
private Context mContext;
private WebView mWebView;
private Twitter mTwitter;
private RequestToken mRequestToken;
private AccessToken mAccessToken;
takuo / nmagw.rb
Created Dec 29, 2012
nma http gateway
View nmagw.rb
# -*- coding: utf-8 -*-
require 'oauth'
require 'json'
require 'sinatra/base'
require 'net/http'
class NmaGw < Sinatra::Base
set :logging, true
takuo / amazonlink.user.js
Created Sep 26, 2012
View amazonlink.user.js
takuo / AndroidManifest.xml
Created Mar 6, 2012
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="4" />
takuo / AndroidManifest.xml
Created Feb 28, 2012
twicca plugin - share a status url
View AndroidManifest.xml
android:label="@string/app_name" android:theme="@android:style/Theme.Translucent">
<action android:name="jp.r246.twicca.ACTION_SHOW_TWEET" />
<category android:name="android.intent.category.DEFAULT" />
takuo / gist:1294790
Created Oct 18, 2011
Android code snippet - using Thread
View gist:1294790
public void onClick(View v) {
new Thread(new Runnable() {
public void run() {
final Bitmap bitmap = loadImageFromNetwork(""); Runnable() {
public void run() {
takuo / gist:1294791
Created Oct 18, 2011
Android code snippet - using AsyncTask
View gist:1294791
public void onClick(View v) {
new DownloadImageTask().execute("");
private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
/** The system calls this to perform work in a worker thread and
* delivers it the parameters given to AsyncTask.execute() */
protected Bitmap doInBackground(String... urls) {
return loadImageFromNetwork(urls[0]);
takuo /
Created Oct 18, 2011
Android code snippet - using IntentService
public void onClick(View v) {
startService(new Intent(this, MyService.class));
You can’t perform that action at this time.