$spacing: 1rem;
body {
margin: ($spacing * 4) $spacing;
}
react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux
This file contains 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
// 設定されたbackground-imageのurlを無効にする場合 | |
$('#hoge').css('background-image', 'none'); | |
// background-imageのurlを変更する場合 | |
$('#hoge').css('background-image', 'url(test.png)'); |
This file contains 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
class ErrorsEngine < Rails::Engine | |
routes.draw do | |
Site.all.each do |site| | |
match '(errors)/:status', via: [:get, :post, :put, :patch, :delete], to: 'errors#show', constraints: { host: site.hostname, status: /\d{3}/ } | |
end | |
end | |
end | |
unless Rails.application.config.consider_all_requests_local | |
Rails.application.config.exceptions_app = ErrorsEngine.routes |
This file contains 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
/** | |
* Modify the parts you need to get it working. | |
*/ | |
var should = require('should'); | |
var request = require('../node_modules/request'); | |
var io = require('socket.io-client'); | |
var serverUrl = 'http://localhost'; |
This file contains 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
resources :products, only: [:index, :show] | |
namespace :products do | |
resources :registrations, only: [:new, :create, :edit, :update] | |
resources :confirmations, only: [:show, :update] do | |
get :completion, on: :collection | |
end | |
end | |
namespace :admin do |
This file contains 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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
This file contains 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
#!/usr/bin/env ruby | |
# Prerequisite: $ gem install bundler json | |
require 'rubygems' | |
require 'bundler' | |
require 'json' | |
require 'open-uri' | |
class Integer | |
def to_currency |
This file contains 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
;; my answer | |
(defun align-to-comma (begin end) | |
"Align region to comma signs" | |
(interactive "r") | |
(align-regexp begin end | |
",\\(\\s-*\\)[^# \t\n]" 1 1)) | |
NewerOlder