Skip to content

Instantly share code, notes, and snippets.

@wtnabe
wtnabe / npmfile
Created May 3, 2014
npm install helper ( ruby script )
View npmfile
# -*- mode: ruby -*-
def main
if npm_installed?
list = npm_list
DATA.to_a.map(&:chomp).select {|l|
l.size > 0
}.each {|pkg|
if list.include?(pkg)
@wtnabe
wtnabe / config.ru
Last active Aug 29, 2015
Sinatra + Sinatra::Sprockets + rails-asset.org + append paths
View config.ru
require 'find'
map "/#{Sinatra::Sprockets.config.prefix}" do
env = Sinatra::Sprockets.environment
installed_assets = Bundler.definition.resolve.select {|e|
e.name =~ /^rails-assets/
}.map {|e|
spec = e.instance_variable_get(:@specification)
[spec.name, spec.version].join('-')
@wtnabe
wtnabe / .gitignore
Last active Aug 29, 2015
gulp + coffee + sass + watch + minify + cache buster sample
View .gitignore
/node_modules
*.map
/bower_components
@wtnabe
wtnabe / example.html.php
Last active Aug 29, 2015
asset helper for limonade-php
View example.html.php
<html>
<head>
<?= javascript_include_tag(); ?>
<?= stylesheet_include_tag(); ?>
</head>
<body>
<p>body</p>
</body>
</html>
@wtnabe
wtnabe / Rakefile
Created Aug 26, 2014
rake task that make any test tools exclude a specific pattern
View Rakefile
Rake::TestTask.new do |t|
test_files = FileList['test/**/*_test.rb']
test_files -= FileList['test/**/*_request_test.rb'] unless ENV['FORCE_REQUEST']
t.test_files = test_files
end
@wtnabe
wtnabe / Rakefile
Last active Aug 29, 2015
rake dependencies for starting server outside ruby ( e.g. PythonSimpleHTTPServer ) and cleanup
View Rakefile
require "rake/testtask"
Rake::TestTask.new do |t|
t.description = nil
t.pattern = 'spec/**/*_spec.rb'
end
desc 'start server and do spec and cleanup'
task :spec => :test do
Process.kill(:INT, @pid)
@wtnabe
wtnabe / gist:51950ea51c7860569ae3
Last active Aug 29, 2015
Kanazawa.rb meetup28 LT大会 演目
View gist:51950ea51c7860569ae3
ical2gcalがGoogle Calendar API v3対応したよ
AndroidWearドヤぁ
モデリングしてますか?
Riemoh
RubyKaigiとYAPC::Asia
俺とDockerfileとtDiaryとKubernets
Webの歴史をふり返る
EngineYard触ってみた
5分でわかるオブジェクト指向
ライフゲーム最後まで作ってみました
@wtnabe
wtnabe / gist:7f8747f14f8a34d826a9
Created Feb 1, 2015
artisan commandに追加しとくとよさげなもの
View gist:7f8747f14f8a34d826a9
command:test
system(__DIR__.'/../../vendor/bin/phpunit');
command:untracked
system('git ls-files -o --exclude-per-directory=.gitignore');
@wtnabe
wtnabe / gist:bc74acd1ea60a90486ec
Created Feb 8, 2015
How to extract pdf from showoff 0.9.10+ with /print path and wkhtmltopdf
View gist:bc74acd1ea60a90486ec
wkhtmltopdf -O landscape -s Letter http://localhost:9090/print pdf.pdf
@wtnabe
wtnabe / gist:4469825d23e919745538
Created Mar 2, 2015
Rails' allow_concurrency
View gist:4469825d23e919745538
def allow_concurrency?
if config.allow_concurrency.nil?
config.cache_classes && config.eager_load
else
config.allow_concurrency
end
end