Skip to content

Instantly share code, notes, and snippets.

Hiroki Yoshioka irohiroki

Block or report user

Report or block irohiroki

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@irohiroki
irohiroki / go-spartan.md
Last active Dec 29, 2015
実現したい機能に対してリソース(時間)が足りないときの開発ポリシー
View go-spartan.md

緊急時の開発

本文書は、実現したい機能に対してリソース(時間)が足りないときの開発ポリシーをまとめたものである。これらのポリシーを一律にプロジェクトに適用するのが難しい場合は、機能毎に個別に適用を検討する。各項目には、機能実現の代償となるものも書き添える。

ファンシーな作り込みをしない

機能の実現に直接関係ない実装をしない。例えば、ページ遷移せずにJavaScriptでデータや画面を操作するなど。工数の少ない代替案がある場合は、開発者が仕様を提案する。

代償
@irohiroki
irohiroki / abc.rb
Created Aug 23, 2012
Formatting metric_abc output of your Rails app
View abc.rb
#!/usr/bin/env ruby
#
# usage: ./abc.rb
#
# Shows the total, average, and the worst 10 methods in the project.
def pt(line)
line[/(?<=: )\d+/].to_i
end
@irohiroki
irohiroki / README
Created Jul 2, 2012
The K combinator in JavaScript
View README
This is a leaner version of K combinator and can be included directly by a script tag.
See https://gist.github.com/7727 for a mature one.
@irohiroki
irohiroki / rspec-syntax-cheat-sheet.rb
Created Mar 27, 2012 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
View rspec-syntax-cheat-sheet.rb
# 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")
@irohiroki
irohiroki / singleton.coffee
Created Jan 17, 2012
Singleton class in CoffeeScript
View singleton.coffee
app = window.app
class app.Singleton
instance = null
@get: ->
unless instance
instance = new this
instance.init()
instance
@irohiroki
irohiroki / cairo-test.rb
Created Jan 11, 2012
make a pdf doc of an image
View cairo-test.rb
require 'base64'
require 'cairo'
require 'stringio'
png_b64 = <<END
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAC7mlDQ1BJQ0Mg
UHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzb
H7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3x
zW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQl
VdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkS
@irohiroki
irohiroki / singleton.coffee
Created Dec 1, 2011 — forked from meltingice/singleton.coffee
Example singleton class and example for Coffeescript
View singleton.coffee
class Singleton
# We can make private variables!
instance = null
# Static singleton retriever/loader
@get: ->
unless instance
instance = new @
instance.init()
@irohiroki
irohiroki / blackhole.rb
Created Oct 28, 2011
A sinatra server that accepts POSTs from anywhere(!) ... and disposes them ;p
View blackhole.rb
require 'sinatra'
configure do
set :port, 9999
end
allow_all = {
'Access-Control-Allow-Headers' => 'X-Requested-With, X-File-Name, Content-Type',
'Access-Control-Allow-Origin' => '*',
}
@irohiroki
irohiroki / gist:1300090
Created Oct 20, 2011
webrick oneliner function
View gist:1300090
function webrick {
if [ -z "$1" ] ; then
port=3333
else
port=$1
fi
ruby -rwebrick -e "WEBrick::HTTPServer.new(:DocumentRoot => './', :Port => ${port}).tap{|w| Signal.trap(:INT){w.shutdown()} }.start"
}
@irohiroki
irohiroki / gist:909284
Created Apr 8, 2011
jQuery Mobile Red theme for Buttons
View gist:909284
.ui-btn-up-f, .ui-btn-hover-f, .ui-btn-down-f {
color: white;
font-weight: bold;
text-decoration: none; }
.ui-btn-up-f {
border: 1px solid #711414;
background: #ab2525;
text-shadow: 0 -1px 1px #711414;
background-image: -moz-linear-gradient(top, #c44f4f, #ab2525);
You can’t perform that action at this time.