Skip to content

Instantly share code, notes, and snippets.

@reima21
reima21 / count_noun.py
Last active September 18, 2018 11:21
【Python3】MeCabでテキストファイルから名詞を頻出順に抽出 ref: https://qiita.com/reima21/items/cb73aeb569af48877261
import MeCab
import sys
import re
from collections import Counter
# ファイル読み込み
cmd, infile = sys.argv
with open(infile) as f:
data = f.read()
@reima21
reima21 / file0.swift
Last active February 4, 2019 07:34
iOS11でのUIBarButtonItemのサイズについて ref: https://qiita.com/reima21/items/285f9d870248cc740e76
if #available(iOS 9.0, *) {
leftbtn.widthAnchor.constraint(equalToConstant: 44).isActive = true
leftbtn.heightAnchor.constraint(equalToConstant: 23).isActive = true
}
$post = Post::all( );
yum -y install php
@reima21
reima21 / file0.txt
Created September 20, 2017 06:21
dockerの既存コンテナをベースに新規コンテナを作成する ref: http://qiita.com/reima21/items/409265a1a1d5a1e5b848
docker stop コンテナID
@reima21
reima21 / example.swift
Last active February 4, 2019 07:32
【Swift3】要求バージョンの指定 ref: https://qiita.com/reima21/items/ef02b865496528f0dc6b
// iOS 10以降を要求
@available(iOS 10, *)
func f() {
}
@reima21
reima21 / file0.txt
Last active September 16, 2018 08:04
【Swift3】indexPathについて ref: https://qiita.com/reima21/items/a95aaf2a71dabe19fb7c
NSIndexPath(forRow: Int, inSection: Int)
@reima21
reima21 / file0.swift
Last active February 4, 2019 07:38
【Swift3】Rxswiftの記法変更に伴って ref: https://qiita.com/reima21/items/96ba769422bdefcda844
.subscribeNext( { } )
@reima21
reima21 / file0.txt
Created September 20, 2017 06:07
CocoaPodsの環境構築について ref: http://qiita.com/reima21/items/841bd0e7c6a4646cec7d
sudo gem install cocoapods
//cellがタップされた時
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
//xibカスタムセル設定によりsegueが無効になっているためsegueを発生させる
self.performSegue(withIdentifier: "segue名", sender: self.tableView)
}