Skip to content

Instantly share code, notes, and snippets.

View takuoka's full-sized avatar
Let's Rock

Takuya Okamoto takuoka

Let's Rock
View GitHub Profile
@takuoka
takuoka / file0.txt
Last active August 29, 2015 14:24
[CocoaPods]実機起動時の「Symbol not found」エラーでクソ詰まった ref: http://qiita.com/taku_oka/items/9162e02d51bd73bbcdad
dyld: Symbol not found: __TWPCSo7NSError13BrightFutures9ErrorTypeS0_
Referenced from: /private/var/mobile/Containers/Bundle/Application/E5242F00-6D45-4101-964C-6D42B2CDDA87/APlayerViewController.app/APlayerViewController
Expected in: /private/var/mobile/Containers/Bundle/Application/E5242F00-6D45-4101-964C-6D42B2CDDA87/APlayerViewController.app/Frameworks/BrightFutures.framework/BrightFutures
in /private/var/mobile/Containers/Bundle/Application/E5242F00-6D45-4101-964C-6D42B2CDDA87/APlayerViewController.app/APlayerViewController
(lldb)
@takuoka
takuoka / file0.txt
Last active August 29, 2015 14:26
Elixirのデータ構造的なやつまとめ ref: http://qiita.com/taku_oka/items/083aa97f17a7e552d74b
iex> [a: a] = [a: 1]
[a: 1]
iex> a
1
iex> [a: a] = [a: 1, b: 2]
** (MatchError) no match of right hand side value: [a: 1, b: 2]
iex> [b: b, a: a] = [a: 1, b: 2]
** (MatchError) no match of right hand side value: [a: 1, b: 2]
import UIKit
import CollectionViewWaterfallLayout
class WaterfallCollectionViewController: UIViewController, UICollectionViewDataSource, CollectionViewWaterfallLayoutDelegate {
var collectionView: UICollectionView!
init () {
@takuoka
takuoka / file0.txt
Created January 5, 2013 07:20
Mongooseで、日付順で投稿を取り出す。(node.js) ref: http://qiita.com/items/9ecee35dad1c61bdf1ac
Post.find({}).sort('-created').execFind( function(err, items){
console.log( err );
res.render('index.jade', { title: title, posts: items });
});
@takuoka
takuoka / file0.swift
Last active December 16, 2015 09:34
[iOS8~]セルの高さ可変UITableView(コードベース) ref: http://qiita.com/taku_oka/items/c3f9281c4a0c56218c2e
tableView.estimatedRowHeight = 464//だいたいの高さの見積もり?
tableView.rowHeight = UITableViewAutomaticDimension
@takuoka
takuoka / file0.txt
Created June 13, 2013 14:34
URLから特定のパラメータの値をとりだす ref: http://qiita.com/items/b4b0f361863c6d578ea6
slicePalamValue = function(url, key){
return url.split(key+"=")[1].split("&")[0];
}
var url = http://aaaaaaaaa.com/code=ABCDEFG
console.log(slicePalamValue(url,"code")); //ABCDEFG
@takuoka
takuoka / file0.txt
Created June 19, 2013 07:56
JavaScriptで確実にCSSを取得する ref: http://qiita.com/entotsu@github/items/c613781c11cebdde63c7
var style = element.currentStyle || document.defaultView.getComputedStyle(element, '')
@takuoka
takuoka / file0.txt
Created June 21, 2013 16:18
[CoffeeScript]TwitterAPIのcreated_atからDateオブジェクトを返す関数 ref: http://qiita.com/entotsu@github/items/2fabf9a34d1e0bff620b
newDate_from_tweetCreatedAt = (created_at)->
created_at = created_at.split ' '
# 投稿日時変換 "Mon Dec 01 14:24:26 +0000 2008" -> "Dec 01, 2008 14:24:26"
post_date = created_at[1] + " " + created_at[2] + ", " + created_at[5] + " " + created_at[3]
# 日時データ処理
date = new Date post_date # 日付文字列 -> オブジェクト変換
date.setHours(date.getHours() + 9) # UTC -> JST (+9時間)
return date
@takuoka
takuoka / file0.txt
Created June 21, 2013 19:28
[CoffeeScript] Facebookのcreated_timeからDateオブジェクトを返す関数 ref: http://qiita.com/entotsu@github/items/bbf1ee3cbef998b25f2f
newDate_from_facebook_created_time = (created_time)->
return new Date((created_time or "").replace(/-/g, "/").replace(/[TZ]/g, " "))
for i in [0..n-1]
for j in [i+1..n-1]