Skip to content

Instantly share code, notes, and snippets.

@mori-dev
mori-dev / spacing-rules.md
Created December 14, 2020 01:49 — forked from yuheiy/spacing-rules.md
ウェブデザインの余白に規則性を持たせるためのパターン

ウェブデザインの余白に規則性を持たせるためのパターン

フォントサイズベース

$spacing: 1rem;

body {
  margin: ($spacing * 4) $spacing;
}
@mori-dev
mori-dev / README.md
Created November 24, 2015 04:16 — forked from Dr-Nikson/README.md
Auth example (react + redux + react-router)
// 設定されたbackground-imageのurlを無効にする場合
$('#hoge').css('background-image', 'none');
// background-imageのurlを変更する場合
$('#hoge').css('background-image', 'url(test.png)');
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
/**
* 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';
@mori-dev
mori-dev / routes.rb
Created August 6, 2012 14:44 — forked from kozo002/routes.rb
confirmationを使う場合にRESTfulっぽくなるようにしてみた
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
@mori-dev
mori-dev / rspec-syntax-cheat-sheet.rb
Created August 5, 2012 06:56 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# 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")
@mori-dev
mori-dev / gist:3004354
Created June 27, 2012 14:20 — forked from tokkonopapa/gist:2989052
Emoji cheat sheet for GitHub

People

:bowtie: 😄 😊 😃 ☺️ 😏 😍 😘 :kissing_face: 😳 😌 😆 😁 😉 :wink2: 👅 😒 😓 😔 😞 😖 😨 😰 😣 😢 😭 😂 😲 😱 😠 😡 😪 😷 👿 👽 💛 💙 💜 ❤️ 💚 💔 💓 💗 💘 ✨ ⭐ 🌟 💢 ❗ ❓ ❕ ❔ 💤 💨 💦 🎶 🎵 🔥 💩 💩 💩 👍 👍 👎 👎 👌 👊 ✊ ✌️ 👋 ✋ 👐 ☝️ 👇 👈 👉 🙌 🙏 👆 👏 💪 🤘 🚶 🏃 👫 💃 👯 🙆‍♀️ 🙅 💁 🙇 💏 💑 💆 💇 💅 👦 👧 👩

@mori-dev
mori-dev / gemref
Created April 9, 2011 18:08 — forked from juno/gemref
#!/usr/bin/env ruby
# Prerequisite: $ gem install bundler json
require 'rubygems'
require 'bundler'
require 'json'
require 'open-uri'
class Integer
def to_currency
@mori-dev
mori-dev / align.el
Created November 15, 2010 15:09 — forked from WaYdotNET/align.el
;; my answer
(defun align-to-comma (begin end)
"Align region to comma signs"
(interactive "r")
(align-regexp begin end
",\\(\\s-*\\)[^# \t\n]" 1 1))