Skip to content

Instantly share code, notes, and snippets.

View urouro's full-sized avatar

Kenta Nakai urouro

View GitHub Profile
@urouro
urouro / Brewfile
Last active August 29, 2015 13:58
Brewfile
# update homebrew
update
# upgrade already-installed packages
upgrade
# add repositories
tap homebrew/binary
tap homebrew/versions
@urouro
urouro / gist:10114613
Created April 8, 2014 12:01
Spec for Kiwi + MagicalRecord
#import "Kiwi.h"
#import "APMApp.h" // NSManagedObject subclass
#import <MagicalRecord/CoreData+MagicalRecord.h>
SPEC_BEGIN(APMAppSpec)
describe(@"APMApp", ^{
beforeAll(^{
[MagicalRecord setDefaultModelFromClass:[self class]];
[MagicalRecord setupCoreDataStackWithInMemoryStore];
@urouro
urouro / gist:b9db41480cadd480d894
Created May 6, 2014 01:53
git submodule 削除
git submodule deinit -f path
git config -f .gitmodules --remove-section submodule.path
@urouro
urouro / file0.m
Created May 6, 2014 12:07
複数のUITextFieldに同じプロパティを設定する ref: http://qiita.com/uro_uro_/items/007bb81e060efa77c818
self.firstField.delegate = self;
self.firstField.layer.borderWidth = 2;
self.firstField.layer.borderColor:[UIColor redColor].CGColor;
self.secondField.delegate = self;
self.secondField.layer.borderWidth = 2;
self.secondField.layer.borderColor:[UIColor redColor].CGColor;
// 以降続く...
@urouro
urouro / .m
Created August 28, 2014 06:16
UITableView DataSource/Delegate
#pragma mark - UITableView DataSource/Delegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
@urouro
urouro / gist:2772027e0bab099f38e1
Created September 12, 2014 11:27
NSString+ConvertDateFormat
NSDateFormatter *formatter = [NSDateFormatter new];
[formatter setDateFormat:@"yyyy-MM-dd"];
cell.textLabel.text = [[formatter dateFromString:master.date] stringValueWithFormat:@"yyyy.MM.dd”];
@urouro
urouro / openssl コマンドで SHA256 の文字列を生成.md
Created September 12, 2014 11:37
openssl コマンドで SHA256 の文字列を生成.md
@urouro
urouro / gist:9c22597b4dd037753228
Created October 3, 2014 08:56
PHP 都道府県 配列
$prefNames = array(
'北海道',
'青森県',
'岩手県',
'宮城県',
'秋田県',
'山形県',
'福島県',
'茨城県',
'栃木県',
@urouro
urouro / gist:846906ba84ec0f6a257c
Created October 21, 2014 05:31
Obj-C 都道府県 配列
NSArray *array = @[@"北海道",
@"青森県",
@"岩手県",
@"宮城県",
@"秋田県",
@"山形県",
@"福島県",
@"茨城県",
@"栃木県",
@"群馬県",
@urouro
urouro / gist:decbc88708b3e2b35ea8
Last active August 29, 2015 14:07
ディレクトリ内のタスクリストを参照して日ごとの所要時間を計算
#!/usr/bin/ruby
days = Hash::new
if ARGV[0].nil?
# get latest file name
file_names = Dir::glob(File.expand_path("~/Dropbox/Tasks/*.md")).sort{|x, y| y <=> x}
target_file_name = file_names[0]
else
# get selected file name