View prev_page_view.rb
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
# 参考
# http://qiita.com/kazuph/items/2cf81a84985e894e9682
# http://bekkou68.hatenablog.com/entry/2014/08/20/222032
#
# api試すページ
# https://developers.google.com/apis-explorer/#s/analytics/v3/
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:9264978

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

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA
View deploy.rb
load 'deploy/assets'
namespace :deploy do
namespace :assets do
desc 'Run the precompile task locally and rsync with shared'
task :precompile, :roles => :web, :except => { :no_release => true } do
%x{bundle exec rake assets:precompile}
%x{rsync --recursive --times --rsh=ssh --compress --human-readable --progress public/assets #{user}@#{host}:#{shared_path}}
%x{bundle exec rake assets:clean}
end
View unicorn
#!/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
View glitch.rb
# -*- 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
View ディスプレイの前でニヤニヤしてる人たちをカメラで撮る仕組み.rb
# coding: utf-8
require "chatroid"
Chatroid.new do
set :service, "Twitter"
set :consumer_key, "..."
set :consumer_secret, "..."
set :access_key, "..."
set :access_secret, "..."
View gist:3927099

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
View intelligent.rb
# coding: utf-8
puts %w(ワロタ ? それな).sample while gets != "\n"