Skip to content

Instantly share code, notes, and snippets.

View ta1kt0me's full-sized avatar
🐢
slow

ta1kt0me

🐢
slow
View GitHub Profile
@ta1kt0me
ta1kt0me / Gemfile
Created October 21, 2015 16:17
(大体)Single file Rails Application - https://github.com/suburi/simple-app
source "https://rubygems.org"
gem "rails"
gem "sqlite3"
@ta1kt0me
ta1kt0me / ar_innodb_row_format.rb
Last active August 29, 2015 14:27 — forked from keitaj/ar_innodb_row_format.rb
It is forked from https://gist.github.com/keitaj/773c6ba89ffc722d60a5 . It changes ROW_FORMAT to COMPRESSED.
ActiveSupport.on_load :active_record do
module ActiveRecord::ConnectionAdapters
class AbstractMysqlAdapter
def create_table_with_innodb_row_format(table_name, options = {})
table_options = options.merge(:options => 'ENGINE=InnoDB ROW_FORMAT=COMPRESSED')
create_table_without_innodb_row_format(table_name, table_options) do |td|
yield td if block_given?
end
end
alias_method_chain :create_table, :innodb_row_format
@ta1kt0me
ta1kt0me / vvv
Last active August 29, 2015 14:23
become a vimmer
# first
- https://getpocket.com/a/read/961571271
# useful
- http://matome.naver.jp/odai/2131556055506548701
- http://qiita.com/wadako111/items/5eb8e30aca1737ba6ba5
- http://postd.cc/how-to-boost-your-vim-productivity/

Switch To Vim For Good

This guide is coming from an email I used to send to newcomers to Vim. It is not intended to be a complete guide, it is about what worked for me.

Some background: my decision to switch to Vim has been made a long time ago. Coming from TextMate 1, I wanted to learn an editor that is Open Source (so I don’t lose my time learning a tool that can be killed), cross platform (so I can use it everywhere), and powerful enough (so I won’t regret TextMate). For these reasons, Vim has always been the editor I wanted to learn, but it took me several years before I did it in a way that works for me. I tried to switch progressively, using the Janus Vim distribution for a few months, then got back to using TextMate 2 for a time, waiting for the next attempt… here is what finally worked for me.

Non Optional

  1. Watch the Derek Wyatt videos in order (at least the “Novice” ones for now): http://derekwyatt.org/vim/tutorials/
  2. Read the first part of this Stack
@ta1kt0me
ta1kt0me / gist:ecf1ede307d6a93a90a7
Last active August 29, 2015 14:07
CSVのデータ行の合計を出力する
###```csv test.csv
# j,m,h,s
# 1,2,3,4
# 5,6,7,8
# 9,0,1,2
###```
data = CSV.open("test.csv","r")
header = data.take(1)[0]
calc = Array.new(header.size).map{[]}
UIAlertView *alert = [UIAlertView new];
alert.title = @"Complete!!!";
alert.message = @"You are Perfect!";
[alert addButtonWithTitle:@"OK"];
[alert show];
-(NSMutableArray *)createNSMutableArray:(int)max
{
NSMutableArray *numberArray = [NSMutableArray new];
for (int i=1; i<=max; i++) {
[numberArray addObject:[NSNumber numberWithInt:i]];
}
[self sortByRandom:numberArray];
return numberArray;
}