Skip to content

Instantly share code, notes, and snippets.

View beatinaniwa's full-sized avatar

Mitsumasa Kubo beatinaniwa

View GitHub Profile
@beatinaniwa
beatinaniwa / .vimrc
Created August 12, 2012 14:23 — forked from mickey24/.vimrc
.vimrc
" $HOME/.vimrc
" MyAutoCmd : an augroup for my autocmd {{{1
augroup MyAutoCmd
autocmd!
augroup END
" Encoding {{{1
scriptencoding utf-8
set encoding=utf-8
@beatinaniwa
beatinaniwa / app_delegate.rb
Created July 23, 2012 16:57
ActionSheet Test
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@viewController = UIViewController.alloc.init
@viewController.navigationItem.rightBarButtonItem = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemAction, target:self, action:'tapped:')
@window.rootViewController = UINavigationController.alloc.initWithRootViewController(@viewController)
@window.rootViewController.wantsFullScreenLayout = true
@window.makeKeyAndVisible
true
end
@beatinaniwa
beatinaniwa / Gemfile
Created February 29, 2012 08:17
Gemfile for tweet_strem_mongo.rb
source :rubygems
gem 'tweetstream'
gem 'mongo'
gem 'bson'
gem 'bson_ext'
gem 'eventmachine'
@beatinaniwa
beatinaniwa / tweet_stream_mongo.rb
Created February 29, 2012 07:05
Store tweets in MongoDB using twitter streaming api
#encoding: utf-8
require 'rubygems'
require 'tweetstream'
require 'mongo'
require 'eventmachine'
db = Mongo::Connection.from_uri('mongodb://username:password@ds031087.mongolab.com:31087/dbname').db('dbname')
@items = db.collection('items')
TweetStream.configure do |config|
@beatinaniwa
beatinaniwa / sqlite3_sample.rb
Created January 26, 2012 10:59
simple sample code of sqlite3 with ActiveRecord
require 'rubygems'
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:database => 'hoge.db'
)
ActiveRecord::Base.connection.create_table("logs") do |t|
t.string :hage