Skip to content

Instantly share code, notes, and snippets.

# ORIGINAL CODE
# https://gist.github.com/wakaba/3944550#file-oauth_consumer-rb
require 'rubygems'
require 'sinatra'
require 'oauth'
require 'erb'
require 'json'
set :sessions, true
@yasuoza
yasuoza / LTSV.pm
Last active December 16, 2015 05:09
TDDBC Tokyo 2013-03 のお題にチャレンジしてみた (お題の参考)https://github.com/sue445/tddbc_tokyo_20130316
package LTSV;
use strict;
use warnings;
use feature qw/ say /;
sub new {
my $pkg = shift;
bless{
attributes => {},
@yasuoza
yasuoza / Rakefile
Last active December 11, 2015 11:28
namespace :scala do
download_scala = 'scala-2.10.0'
def bin_files
Dir['/usr/share/scala/bin/**'].select { |file_name| file_name !~ /\.+/ }.map { |file_name| file_name.match(/(\w+)$/).captures[0] }
end
desc "Download #{download_scala}"
task :download do
if File.exist?("/tmp/#{download_scala}.tgz")
@yasuoza
yasuoza / TDD_advent_calender_2012_22.md
Created December 22, 2012 09:11
TDDを取り入れたい誰かのために

このエントリはTDD Advent Calendar jp: 2012の22日目のエントリです。 昨日は@fukayatsuさんのTDDを続けるためにでした。

世界終わらなくてよかったですね!Hello world!

というわけで今日はTDDをチームや社内で導入するために僕がやったことや、失敗したことなどを共有できたらいいなと思い、エントリを書きます。

まず、すでに社内全体でTDDを導入できている人はこのエントリを読む必要はありません。僕に伝えられることは何もありません。ここで読み終わってOKです。

つぎに、社内やチーム内の重要ポストの人がTDDやテスト自動化なんて意味なし、無駄なことだと思っている場合は、TDDがすでに定着している会社に転職をするといいと思います。僕に伝えられることは何もありません。ここで読み終わってOKです。

@yasuoza
yasuoza / rails3_application_template.rb
Created November 14, 2012 09:02
Rails3 Application template
# -*- coding: utf-8 -*-
#
# Usage
#
# rails new yourapp -m https://raw.github.com/gist/4071096/4541b3f89f63d906156b429c7d5779231a1d23bb/rails3_application_template.rb -T --skip-bundle
#
use_rspec = yes?('Do you want to use rspec?')
use_slim = yes?('Do you want to use slim?')
unless use_slim
@yasuoza
yasuoza / dynamic.html
Created November 13, 2012 01:47
Web site with retina display
<!DOCTYPE html>
<head>
<script src="js/dynamic_retina.js"></script>
</head>
<body>
<img src="img/google.png" style="width:138px;height:48">
</body>
</html>
@yasuoza
yasuoza / bench_mroonga.rb
Created October 11, 2012 15:10
Benchmark for mroonga
require 'benchmark'
require 'mysql2'
DB_NAME = 'bench_mroonga'
DB_USERNAME = 'username'
DB_USERPASS = 'password'
TABLE_NAME = 'benches'
insert_cols = ['none', 'mysql', 'mroonga'].join(', ')
@yasuoza
yasuoza / index.html
Created August 21, 2012 05:04
Jenkins websocket XFD
<html>
<style>
.project {
height: 150px;
padding-top: 50px;
margin-bottom: 10px;
}
.project_label {
width: 600px;
line-height: 100px;
@yasuoza
yasuoza / Capfile
Created August 17, 2012 08:32
Capistrano sample setting file
require "bundler/capistrano"
load 'deploy'
load 'deploy/assets'
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
@yasuoza
yasuoza / application.rb
Created August 16, 2012 08:32
Rails customize error Message HTML
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
errors = Array(instance.error_message).join(',')
%(#{html_tag}<span class="validation-error">&nbsp;#{errors}</span>).html_safe
end