Skip to content

Instantly share code, notes, and snippets.

View irohiroki's full-sized avatar

Hiroki Yoshioka irohiroki

View GitHub Profile
module github.com/irohiroki/aws-sdk-go-v2-test
go 1.18
require github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3
require (
github.com/aws/aws-sdk-go-v2/credentials v1.12.23 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.19 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.26 // indirect
@irohiroki
irohiroki / go-spartan.md
Last active December 29, 2015 07:28
実現したい機能に対してリソース(時間)が足りないときの開発ポリシー

緊急時の開発

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

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

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

代償
@irohiroki
irohiroki / abc.rb
Created August 23, 2012 06:11
Formatting metric_abc output of your Rails app
#!/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 July 2, 2012 04:05
The K combinator in JavaScript
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 March 27, 2012 06:23 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# 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 January 17, 2012 00:30
Singleton class in CoffeeScript
app = window.app
class app.Singleton
instance = null
@get: ->
unless instance
instance = new this
instance.init()
instance
@irohiroki
irohiroki / cairo-test.rb
Created January 11, 2012 11:31
make a pdf doc of an image
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 December 1, 2011 02:11 — forked from meltingice/singleton.coffee
Example singleton class and example for Coffeescript
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 October 28, 2011 16:18
A sinatra server that accepts POSTs from anywhere(!) ... and disposes them ;p
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 October 20, 2011 00:32
webrick oneliner function
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"
}