Skip to content

Instantly share code, notes, and snippets.

View kkosuge's full-sized avatar
🐇
busy

Kosuge Kazuya kkosuge

🐇
busy
View GitHub Profile
@kkosuge
kkosuge / parse.t
Created April 13, 2012 15:08 — forked from Shinpeim/parse.t
https://gist.github.com/2367607 これのparseのとこ
use strict;
use warnings;
use Test::More;
use resize;
subtest "valid case (with option)" => sub{
my $valid_uri = "http://example.com/scale/c.120x240.sushi.png";
my $file_info = resize::parse_uri($valid_uri);
is $file_info->{option}, "c", "option";
@kkosuge
kkosuge / Gemfile
Created May 24, 2012 14:21 — forked from rummelonp/Gemfile
guard で *.less と *.coffee 監視してコンパイル
source 'http://rubygems.org'
gem 'guard'
gem 'guard-less'
gem 'guard-coffeescript'
@kkosuge
kkosuge / hoge
Created May 25, 2012 17:42 — forked from anonymous/hoge
UEsDBBQAAAAIAC4yt0BmW8+MXQEAAHsDAAATAAAAc29mdGNhcy9zb2Z0Y2Fz
LnNsbqWSwU6DQBCGzyXhHQheatIluxQrHDywC+hBTSOJXrxQWJo1K9ssUE1q
n8yDj+QruETA1jbGtLeZ+WdnvpnZz/cPXbthqRSlyCvjnpV1wo24qjMmjFjw
umKiMCLG6ciIhHxOVA6VZRNEyIJQ105+PbIhUtGpFE80rYbmysXEIyF2gYsd
HyAUQOAGCAEIfUg8pFTHXpunxoVhvrCiTBOZmaMf+7EzrGX6ulBVG3HlTJwx
OrcxmIxDDziEEODhCIGJh30/sM8cH8O1qWthkbUkunbJxSzhujb4NmIVVGMM
uyGJKHI2r2XSOFOeVLkat2y4FpJ2Ser1IKCzev72wIqxrcQNrxHvKKdJSXu5
9fsEBbTVfgenxf2DRpTVJs7/dmFtcFq+arWkJJ9v8x9YDdeMZxY8uFa3ol22
VjmyYst3yDG6PaujLKisGN33H65Y1vu3IqMqI/Kv43Bvgz6ia19QSwMEFAAA
AAgATzS3QDRgqbzvBwAAACoAABMAAABzb2Z0Y2FzL3NvZnRjYXMuc3Vv7VpH
@kkosuge
kkosuge / intelligent.rb
Created October 17, 2012 10:05
会話できる人工知能のプログラム (Ruby)
# coding: utf-8
puts %w(ワロタ ? それな).sample while gets != "\n"
@kkosuge
kkosuge / gist:3927099
Created October 21, 2012 14:14
Twitter公式クライアントのコンシューマキー

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@kkosuge
kkosuge / ディスプレイの前でニヤニヤしてる人たちをカメラで撮る仕組み.rb
Created November 8, 2012 16:53
ディスプレイの前でニヤニヤしてる人たちをカメラで撮る仕組み.rb
# coding: utf-8
require "chatroid"
Chatroid.new do
set :service, "Twitter"
set :consumer_key, "..."
set :consumer_secret, "..."
set :access_key, "..."
set :access_secret, "..."
@kkosuge
kkosuge / お祝いください.md
Created November 21, 2012 16:12 — forked from rummelonp/転職しました.md
転職してません
@kkosuge
kkosuge / glitch.rb
Created December 11, 2012 04:23 — forked from rummelonp/glitch.rb
テキストをグリッチ(参考: http://nekogata.hatenablog.com/entry/2011/11/13/040535
# -*- coding: utf-8 -*-
class String
GLITCH_CHARS = ("\u0300".."\u036f").to_a
def glitch
self.each_char.reduce("") do |r, c|
r + c + rand(2).times.map { GLITCH_CHARS.sample }.join('')
end
end
@kkosuge
kkosuge / unicorn
Last active December 11, 2015 12:39 — forked from mguterl/gist:308216
#!/bin/sh
set -u
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
APP_ROOT=/home/deploy/public_html/rm/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
ENV=production