Skip to content

Instantly share code, notes, and snippets.

Avatar

Kazuhito Hokamura hokaccha

View GitHub Profile
View README.md

やりたいこと

  • 親側の変更を子のComponentに伝えたい
  • 子にどうやって渡したらいいのかわからな
  • イベント/ハンドラもどうやって渡せばいいのか
View concern.rb
# coding: utf-8
class Concern < ActiveRecord::Base
belongs_to :publication
end
@hokaccha
hokaccha / answer.txt
Created Nov 22, 2012 — forked from shigeki/hello.js
第1回Node.js入門勉強会 レポート課題
View answer.txt
**課題1
なぜエラーが発生したのかその理由を記述しなさい。
server.close()を呼ぶとこれ以上のコネクションは受け付けなくなるが、
既存のコネクションに関してはそのまま接続された状態になる。
また、HTTPの接続はkeep-aliveで行われるため、明示的にコネクションを
終了させなければ接続がタイムアウトするまでコネクションは生きている。
最初のリクエスト(GET /)のときにserver.close()が呼ばれ、新規接続を
@hokaccha
hokaccha / Rakefile
Created Aug 2, 2012 — forked from jeffreyiacono/Rakefile
rake task for precompiling assets using sprockets within a sinatra app + view helpers
View Rakefile
require 'rubygems'
require 'bundler'
Bundler.require
require './application'
namespace :assets do
desc 'compile assets'
task :compile => [:compile_js, :compile_css] do
end
@hokaccha
hokaccha / caveatPatchor.js
Created Apr 12, 2012 — forked from protocool/caveatPatchor.js
Sample Propane caveatPatchor.js file
View caveatPatchor.js
/**
Sample Propane caveatPatchor.js file based on tmm1's avatar hack.
You'll need at least version 1.1.1 to experiment with this:
http://propaneapp.com/appcast/Propane.1.1.1.zip
Once I'm sure exposing this hack-injection point doesn't cause problems
I'll do an official auto-updating version.
As of version 1.1.1, Propane will load and execute the contents of
View markdown2inao.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Pod::Usage;
use Text::Markdown 'markdown';
use HTML::TreeBuilder;
use List::Util 'max';
@hokaccha
hokaccha / routes.js
Created Oct 15, 2011 — forked from tj/routes.js
Express routes
View routes.js
var app = require('../app');
var colors = require('colors');
function format(method) {
switch (method) {
case 'get': return 'GET '.grey;
case 'post': return 'POST '.cyan;
case 'put': return 'PUT '.green;
case 'delete': return 'DELETE '.magenta;
default: return method.toUpperCase();
@hokaccha
hokaccha / gist:951652
Created May 2, 2011 — forked from tacamy/gist:951646
JavaScript UA Navigator(Android+'Mobile')
View gist:951652
if ((navigator.userAgent.indexOf('iPhone') !== -1 && navigator.userAgent.indexOf('iPad') === -1) || navigator.userAgent.indexOf('iPod') !== -1 || /Android.+Mobile/.test(navigator.userAgent)) {
location.href = '/hoge/';
}
View markdown2inao.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Pod::Usage;
use Text::Markdown 'markdown';
use HTML::TreeBuilder;
use List::Util 'max';
View .vimrc
" Capture {{{
command!
\ -nargs=1
\ -complete=command
\ Capture
\ call Capture(<f-args>)
function! Capture(cmd)
redir => result
silent execute a:cmd
You can’t perform that action at this time.