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 / prev_page_view.rb
Last active December 6, 2015 02:17 — forked from soramugi/Gemfile
GoogleAnalyticsに登録してるサイト全ての昨日のPV数出すやつ
#!/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/
@kkosuge
kkosuge / 0_reuse_code.js
Created March 20, 2014 05:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

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

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
@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
@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 / お祝いください.md
Created November 21, 2012 16:12 — forked from rummelonp/転職しました.md
転職してません
@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 / 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 / intelligent.rb
Created October 17, 2012 10:05
会話できる人工知能のプログラム (Ruby)
# coding: utf-8
puts %w(ワロタ ? それな).sample while gets != "\n"