Skip to content

Instantly share code, notes, and snippets.

View halsk's full-sized avatar

Hal Seki halsk

View GitHub Profile
@halsk
halsk / bash
Created March 25, 2014 13:48
Locomotive Engine を Heroku で動かすまで ref: http://qiita.com/hal_sk/items/0512a4a9cb215fb016f5
heroku config:add HEROKU_API_KEY=<YOUR HEROKU API KEY>
heroku config:add HEROKU_APP_NAME=<YOUR APP NAME>
@halsk
halsk / _form.html.haml
Created March 30, 2014 16:31
LocomotiveCMS のページにユーザー認証機能を組み込む(Engineの拡張) ref: http://qiita.com/hal_sk/items/c6d4f5582d23bc4dd415
= f.input :published, as: :'Locomotive::Toggle', input_html: { class: 'simple-toggle' }
= f.input :require_login, as: :'Locomotive::Toggle', input_html: { class: 'simple-toggle' } #この行を追加
= f.input :listed, as: :'Locomotive::Toggle', input_html: { class: 'simple-toggle' }
@halsk
halsk / content_type_templates.liquid.haml
Created April 6, 2014 01:29
LocomotiveCMS でニュース記事一覧機能を作る ref: http://qiita.com/hal_sk/items/b72db4a288566e92096c
---
title: Content type templates
slug: content_type_template
listed: false
published: true
position: 100
content_type: news
---
{% extends parent %}
{% block main %}
@halsk
halsk / file2.txt
Created April 8, 2014 03:12
LocomotiveCMS + Devise を使って作ったログインページのデザインをCMS側でできるようにする(1) ref: http://qiita.com/hal_sk/items/50c45f764cb95615dd59
include Locomotive::Routing::SiteDispatcher
include Locomotive::Render
include Locomotive::ActionController::LocaleHelpers
@halsk
halsk / confirmations_controller.rb
Created April 8, 2014 09:04
LocomotiveCMS + Devise を使って作ったログインページのデザインをCMS側でできるようにする(2) ref: http://qiita.com/hal_sk/items/c0f56736398f1154ddca
class Users::ConfirmationsController < Devise::ConfirmationsController
protected
# The path used after confirmation.
def after_confirmation_path_for(resource_name, resource)
if signed_in?
'/registrationfinished'
else
new_session_path(resource_name)
end
end
@halsk
halsk / devise.ja.yml
Created April 8, 2014 10:44
LocomotiveCMS + Devise を使って作ったログインページのデザインをCMS側でできるようにする(3) ref: http://qiita.com/hal_sk/items/92d653f47ddadb6d879c
ja:
errors:
messages:
not_found: "は見つかりませんでした"
# not_found: "not found"
already_confirmed: "は既に登録済みです"
# already_confirmed: "was already confirmed"
not_locked: "は凍結されていません"
# not_locked: "was not locked"
@halsk
halsk / carrierwave.rb
Created April 9, 2014 06:07
LocomotiveCMS で、複数の Heroku インスタンスを使う ref: http://qiita.com/hal_sk/items/aba8d324638d205b2ce1
(中略)
when :staging
# the following configuration works for Amazon S3
config.storage = :fog
config.fog_credentials = {
provider: 'AWS',
aws_access_key_id: ENV['S3_KEY_ID'],
aws_secret_access_key: ENV['S3_SECRET_KEY'],
region: ENV['S3_BUCKET_REGION']
}
@halsk
halsk / file0.txt
Created April 16, 2014 15:16
テストデータジェネレータに Fabrication-gem を使う ref: http://qiita.com/hal_sk/items/e301259c8c49f5266699
group :test do
gem 'fabrication' #追加
end
@halsk
halsk / gist:829fb19980af48087c70
Last active August 29, 2015 14:04
D3.js で csvのforEach
<html>
<!--
D3.js でこんなことをやりたいらしい。
【BEFORE】
Prefecture,教授,芸術,宗教,報道,投資・経営
北海道,249,6,207,0,152
青森,19,0,19,0,17
【AFTER】
[Prefecture: 北海道,
values : [
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0nxW60xhlKwxA9PylG/1x8C7bEr1tRZKX73oUkzJ3Kto40zVJGUARpJ8fEH7joobMKedDPhWg/w2dLVraB5qFU9jK0UWfauxQPfd5QzwQtsrpB+eI+kn3jsCIkA928ybbRzxfmiSAANv451Cj1qK2dqqSgrMFbGL7XwJbWE3n83nN/YvpOskTSiolr3kAICpdGYzki/cqUYiAoaGO+6NpmBeFQXNXKXanuPQiMTnfMJgZdXZiwNnza75AMmNKjXx6Zs67cLSQz1iaBI+fgiMPZ79dwmlSSsrIpdNI4B+n7zTQJMLgnq/hZlR09s831jXKqGeO0N9YJlnqrAGCXdZ7Q==