60秒毎にpingする。更にsshしてたら/tmpにファイルを作る。
# ~/.ssh/config
ServerAliveInterval 60
ControlMaster auto
ControlPath /tmp/%r@%h:%p
null |
# config/locales/en.yml | |
en: | |
exception: | |
show: | |
not_found: | |
title: "Not Found" | |
description: "The page you were looking for does not exists." | |
internal_server_error: | |
title: "Internal Server Error" |
#!/usr/bin/env ruby | |
require 'securerandom' | |
# Example | |
# class User | |
# include GenerateTokenFor[:confirmation_token] | |
# end | |
# | |
# @user = User.new |
module Utils | |
module S3 | |
# Example | |
# Utils::S3::Bucket.all_objects_in('images') | |
module Bucket | |
class << self | |
def all_objects_in(bucket_name) | |
all_objects_from_marker(bucket_name, nil) | |
end |
class PagesController < ApplicationController | |
def async | |
EM.defer do | |
env['async.callback'].call [200, {}, ['Hello from callback.']] | |
end | |
throw :async | |
end | |
end |
/.bundle | |
/db/*.sqlite3 | |
/doc | |
/log | |
/public/assets | |
/tmp | |
/vendor/assets/components |
-- MySQL port of "Sharding & IDs at Instagram" | |
-- http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram | |
CREATE TABLE account_id_seq ( | |
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
stub CHAR(1) NOT NULL, | |
UNIQUE KEY stub (stub) | |
); | |
INSERT INTO account_id_seq (stub) VALUES ('a'); |
/docs | |
/target | |
/lib | |
/classes | |
/checkouts | |
pom.xml | |
*.jar | |
*.class | |
.lein-deps-sum | |
.lein-failures |
class CreateBookmarks < ActiveRecord::Migration | |
def up | |
execute <<-SQL | |
CREATE SEQUENCE bookmarks_id_seq; | |
CREATE FUNCTION next_bookmark_id(OUT result bigint) AS $$ | |
DECLARE | |
epoch bigint := 1420070400000; | |
seq_id bigint; | |
now bigint; |