Skip to content

Instantly share code, notes, and snippets.

@mtsmfm
mtsmfm / debug log
Created April 20, 2014 14:49
poltergeist with ckeditor debug log
{"name"=>"set_debug", "args"=>[true]}
{"response"=>true}
{"name"=>"visit", "args"=>["http://127.0.0.1:37796/users/new"]}
poltergeist [1398005093288] state default -> loading
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
poltergeist [1398005093702] state loading -> default
{"response"=>{"status"=>"success"}}
{"name"=>"find", "args"=>[:css, "body"]}
{"response"=>{"page_id"=>1, "ids"=>[0]}}
{"name"=>"visible", "args"=>[1, 0]}
@mtsmfm
mtsmfm / Gemfile
Last active August 29, 2015 14:07
Capybara minimal sample
source 'https://rubygems.org'
gem 'capybara'
gem 'poltergeist', require: 'capybara/poltergeist'
@mtsmfm
mtsmfm / projections.json
Created February 12, 2015 23:21
projections.json (Rails + flux)
{
"app/assets/javascripts/components/*.js.cjsx": {
"command": "jcomponent",
"template": "@{camelcase|capitalize|colons} = React.createClass\n render: ->"
},
"app/assets/javascripts/actions/*.js.coffee": {
"command": "jaction",
"template": "class @{camelcase|capitalize|colons}"
},
"app/assets/javascripts/constants/*.js.coffee": {
require 'active_support'
require 'active_support/core_ext/object/to_query'
require 'active_support/core_ext/string/strip'
params = {
title: '問題を一言で',
labels: %w(bug),
body: <<-EOS.strip_heredoc
## 出す前に確認しよう
CSON = require 'season'
ObjectAssign = require 'object-assign'
linuxCson = CSON.readFileSync('linux.cson')
darwinCson = CSON.readFileSync('darwin.cson')
obj = {}
for k1, v1 of linuxCson
obj[k1] = {}
@mtsmfm
mtsmfm / Gemfile
Last active October 23, 2015 16:36
esm_doukaku_20151022
source 'https://rubygems.org'
gem 'activesupport', require: 'active_support/all'
gem 'pry-byebug'
@mtsmfm
mtsmfm / README.md
Last active October 26, 2015 07:33
ESM オフラインどう書く

行列のできるラーメン屋 ESM オフラインどう書く (2015/10/22)

オフラインリアルタイムどう書く という、 @Nabetani さん主催のイベントを模したものを ESM の社内向けに行ったものです。

出題者: @mtsmfm スペシャルサンクス: @mattsan

問題

#coding:utf-8
def fuga(n, i, n_max)
kugiru = 2 ** (i+1)
tonari = 2 ** i
if(n % kugiru < kugiru/2)
n + tonari
else
n - tonari
@mtsmfm
mtsmfm / Gemfile
Last active December 13, 2015 14:18
esm_doukaku #02 (素振り)
source "https://rubygems.org"
gem 'pry'
gem 'activesupport', require: 'active_support/all'
@mtsmfm
mtsmfm / template.rb
Created April 19, 2013 03:57
Rails Application Template for Rails Tutorial Chapter 3
run 'echo "" > Gemfile'
add_source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem_group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.11.0'
end