Skip to content

Instantly share code, notes, and snippets.

@masaru-tech
masaru-tech / template.rb
Last active September 26, 2016 11:17
rails new template
# 1. Railsプロジェクトの作成
# rspecを使うので、testディレクトリを削除
run 'rm -rf test'
# 不必要なファイルを削除
# run "rm README.rdoc"
# 2. Gitにプロジェクトを登録
#git :init
#git add: '.'
#git commit: %Q{ -m 'initial commit' }
@masaru-tech
masaru-tech / Dockerfile
Created August 6, 2016 05:07
MecabをWeb API利用できるDockerコンテナ
FROM debian:jessie
WORKDIR /root
RUN apt-get update -qq && apt-get upgrade -qq
RUN apt-get install -qq libmecab-dev git wget g++ make curl sudo
RUN apt-get install -qq mecab libmecab-dev mecab-ipadic-utf8 golang mercurial xz-utils file
RUN git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git
RUN cd mecab-ipadic-neologd && ( echo yes | ./bin/install-mecab-ipadic-neologd )
@masaru-tech
masaru-tech / Dockerfile
Created July 21, 2016 05:05
とりあえずipythonでscikit-learn使える環境をDockerで作る
FROM ubuntu:14.04
# proxyがある場合
ENV http_proxy http://proxy_host:proxy_port
ENV https_proxy http://proxy_host:proxy_port
ENV no_proxy localhost
ENV HOME /root
RUN apt-get update -qq && apt-get install -y git wget graphviz graphviz-dev
RUN git clone https://github.com/yyuu/pyenv.git $HOME/.pyenv
Rake::TaskManager.class_eval do
def alias_task(fq_name)
new_name = "#{fq_name}:original"
@tasks[new_name] = @tasks.delete(fq_name)
end
end
def alias_task(fq_name)
Rake.application.alias_task(fq_name)
end
@masaru-tech
masaru-tech / twitterTimeline.swift
Last active December 8, 2015 05:15
twitterのタイムラインを表示してみました。 http://himaratsu.hatenablog.com/entry/twitter/apiを参考にしてます。
import UIKit
import Social
import Accounts
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet var tableView: UITableView!
var accountStore = ACAccountStore()
var twAccount: ACAccount?
@masaru-tech
masaru-tech / UITableViewCell_image.swift
Created January 7, 2015 13:26
UITableViewで画像とテキストを表示するド初級サンプル
import UIKit
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet weak var tableView: UITableView!
let list: NSArray = ["rain", "cloud_sunny", "sunny", "cloudy"]
override func viewDidLoad() {
super.viewDidLoad()
@masaru-tech
masaru-tech / UITableView_Storybord.swift
Created January 5, 2015 13:17
swift docsのUIKit 006 UITableViewでテーブルを表示をStorybordで実現する場合のソースコード部
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tableView: UITableView!
// Tableで使用する配列を設定する
let myItems: NSArray = ["TEST1", "TEST2", "TEST3"]
override func viewDidLoad() {
super.viewDidLoad()