転職してないけど祝いください
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
require "chatroid" | |
Chatroid.new do | |
set :service, "Twitter" | |
set :consumer_key, "..." | |
set :consumer_secret, "..." | |
set :access_key, "..." | |
set :access_secret, "..." |
Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU
Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
Consumer key: CjulERsDeqhhjSme66ECg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
puts %w(ワロタ ? それな).sample while gets != "\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def link_to_with_human_readable(*args) | |
if args.size == 1 and args.first.is_a? ActiveRecord::Base | |
model = args.first | |
attributes = model.class.columns.map(&:name) | |
[:name, :title].each do |attr| | |
next unless attributes.include? attr.to_s | |
return link_to_without_human_readable(model.__send__(attr), model) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UEsDBBQAAAAIAC4yt0BmW8+MXQEAAHsDAAATAAAAc29mdGNhcy9zb2Z0Y2Fz | |
LnNsbqWSwU6DQBCGzyXhHQheatIluxQrHDywC+hBTSOJXrxQWJo1K9ssUE1q | |
n8yDj+QruETA1jbGtLeZ+WdnvpnZz/cPXbthqRSlyCvjnpV1wo24qjMmjFjw | |
umKiMCLG6ciIhHxOVA6VZRNEyIJQ105+PbIhUtGpFE80rYbmysXEIyF2gYsd | |
HyAUQOAGCAEIfUg8pFTHXpunxoVhvrCiTBOZmaMf+7EzrGX6ulBVG3HlTJwx | |
OrcxmIxDDziEEODhCIGJh30/sM8cH8O1qWthkbUkunbJxSzhujb4NmIVVGMM | |
uyGJKHI2r2XSOFOeVLkat2y4FpJ2Ser1IKCzev72wIqxrcQNrxHvKKdJSXu5 | |
9fsEBbTVfgenxf2DRpTVJs7/dmFtcFq+arWkJJ9v8x9YDdeMZxY8uFa3ol22 | |
VjmyYst3yDG6PaujLKisGN33H65Y1vu3IqMqI/Kv43Bvgz6ia19QSwMEFAAA | |
AAgATzS3QDRgqbzvBwAAACoAABMAAABzb2Z0Y2FzL3NvZnRjYXMuc3Vv7VpH |
NewerOlder