This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ■クライアントにブロードキャストで送る方法 | |
# サーバ側 | |
WebsocketRails[:message_channel].trigger "message", message | |
# クライアント側 | |
var dispatcher = new WebSocketRails(location.host + '/websocket', true); | |
var channel = dispatcher.subscribe("message_channel"); | |
// メッセージ受信時の処理 | |
channel.bind("message", function(message){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. rails new project | |
rails new test-app --database=postgresql --skip-test-unit --skip-bundle | |
# 2. .ignoreファイルの編集 | |
gibo OSX Ruby Rails Sass SublimeText > .gitignore | |
#.gitignoreから以下のファイルを削除する。 | |
/config/initializers/secret_token.rb | |
#secret_token.rbの編集 ※Herokuはアプリケーション名 application.rbにアプリケーション名が記載されている。 | |
/config/initializers/secret_token.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. スケルトンを生成 | |
bin/rails g model Administrator #モデルはクラス名を指定する(単数形) | |
2. マイグレーションスクリプトファイルの編集 | |
# カラムの追加 | |
t.string :email, null: false | |
t.boolean :suspended, null: false, dafault: false | |
t.date :start_date, null: false | |
# 索引の追加 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if Rails.env.production? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#git インストール | |
sudo apt-get install -y git gitk git-gui | |
#rbenv本体のインストール | |
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
source ~/.bashrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"PHP": { | |
"php": "/usr/bin/php", | |
"phpExtraPaths": [], | |
"phpConfigFile": "php.ini" | |
}, | |
"JavaScript": { | |
"javascriptExtraPaths": [] | |
}, | |
"Perl": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
【jQuery 1.x 系の最新】 | |
http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js | |
【jQuery 1.8 系の最新】 | |
http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js | |
【jQuery 2.1.1】 | |
http://code.jquery.com/jquery-2.1.1.min.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TragetTestClass tragetTestClass = spy(/*ターゲットテストクラスのオブジェクト*/); | |
doReturn(3L).when(tragetTestClass).getA(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<kml xmlns="http://www.opengis.net/kml/2.2"> | |
<Document><Folder><name>shimane</name> | |
<Placemark> | |
<!-- ▼▼▼ ここを編集します。▼▼▼ --> | |
<Style> | |
<LineStyle> | |
<color>ff0000ff</color><!--透明度+カラーコード(#ff0000)の逆順(a+bgr)--> | |
<width>1</width><!--線の太さ--> | |
</LineStyle> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
<meta charset="utf-8"> | |
<title>KML Layers</title> | |
<style> | |
html, body, #map-canvas { | |
height: 100%; | |
margin: 0px; |