memorandum

IT技術の習得を記録します

2016-12-01から1ヶ月間の記事一覧

「Rails をはじめよう」をはじめる (2)

Rails をはじめよう | Rails ガイド アプリケーションの実装と実行 config/routes.rbで articleリソース を宣言する Rails.application.routes.draw do resources :articles root 'welcome#index' end Railsは「articles」というリソース名から単数形の「art…

atomにプログラムの書き方を指摘してくれるrubocopをインストールする

atom.io atom.io

githubの公開鍵を作成しgithubに登録

Generating a new SSH key and adding it to the ssh-agent - User Documentation #Open Terminal. #Paste the text below, substituting in your GitHub email address. ssh-keygen -t rsa -b 4096 -C "your_email@example.com" #This creates a new ssh ke…

「Rails をはじめよう」をはじめる (1)

railsguides.jp アプリケーションの作成 rails new blog で新しいRails アプリケーションの作成 場所は自分が作成したいディレクトリ内で実行 すると cd blog そこに移動 rails server rails serverを起動 http://localhost:3000/にアクセスすると となる Ra…

コマンドのヘルプを見る

git

rm のヘルプを見たい場合には man rm

中身のあるディレクトリを削除する

rm -fr ディレクトリ名 -r, -Rはディレクトリを削除するオプション fはアクセス権に関わらず、確認を要求しないでファイルを削除するオプション

巨大ファイルを取り込むとき

sql

set global max_allowed_packet = 16777216

mysqlの基礎

sql

update update people set birth_date = '1987-11-27' where id = 10096; # updateする テーブル名 set 変更内容 where 変更箇所 # peopleテーブルのidが10096のbirth_dateを'1987-11-27'にアップデートする delete delete from テーブル名 where 該当箇所; …

コミットをまとめる

git

git rebase -i --keep-empty --autosquash $(git show-branch --merge-base master HEAD) vimに以下のような状態で開かれる pick 05eb1e4 test2rb pick 7dc17cc add test.rb # Rebase 7802bc5..7dc17cc onto 7802bc5 (2 commands) # # Commands: # p, pick =…

CSVファイルの中身を置換する sed

sedは与えられた文字列を,ルールに従って変換するコマンド 置換したいと思って調べたら、かなり色々できるようですとりあえずよく使用するであろうCSVの中身の置換を覚えてみる sed -e s/置換条件/置換文字/ list.csvの株式会社を(株)にしてlist_new.csvに…