Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
[ -z `which emacsclient 2>&1` ] && { echo 'emacsclient not found' >&2; exit 1; }
[ -z `which git 2>&1` ] && { echo 'git not found' >&2; exit 1; }
[ -z `which peco 2>&1` ] && { echo 'peco not found' >&2; exit 1; }
function open_emacsclient {
if [ $# -eq 0 ]; then
TMP_FILE=`mktemp /tmp/emacsclient.XXXXXX`
cat > $TMP_FILE
@mori-dev
mori-dev / file0.js
Created September 5, 2016 09:41
React.js/redux のコンポーネントの機能拡張、ストアの機能拡張でよくみかけるアプローチの紹介 ref: http://qiita.com/mori-dev@github/items/27a35a8573b52595e612
function hoge() {
var foo = 'aaa';
return function(arg) {
return foo + arg;
}
}
var fuga = hoge();
fuga('Z');
//=> aaaZ
@mori-dev
mori-dev / Dante - Medium Editor.markdown
Created April 27, 2016 04:24
Dante - Medium Editor
@mori-dev
mori-dev / Portfolio sample with Flexbox.markdown
Created February 18, 2016 07:10
Portfolio sample with Flexbox
@mori-dev
mori-dev / Portfolio sample with Flexbox.markdown
Created February 18, 2016 07:05
Portfolio sample with Flexbox
@mori-dev
mori-dev / README.md
Created November 24, 2015 04:16 — forked from Dr-Nikson/README.md
Auth example (react + redux + react-router)
@mori-dev
mori-dev / file0.html
Created August 14, 2015 04:01
AngularJS のディレクティブのコントローラでインジェクトするサービスを動的に決めるには ref: http://qiita.com/mori-dev@github/items/1dbb3a7d96ce6a0d4549
<my-hoge filter="AaaFilter"></my-hoge>
@mori-dev
mori-dev / my-brew-bundle.sh
Last active August 29, 2015 14:11
my-brew-bundle
#!/bin/sh
# Original: http://masutaka.net/chalow/2014-03-19-2.html
echo "brew updating..."
brew update
outdated=`brew outdated`
if [ -n "$outdated" ]; then
// 設定された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