0900 | 0000 |
---|---|
2016-03-01 00:00:00 +0900 | 2016-02-29 15:00:00 UTC |
2016-03-01 01:00:00 +0900 | 2016-02-29 16:00:00 UTC |
2016-03-01 02:00:00 +0900 | 2016-02-29 17:00:00 UTC |
2016-03-01 03:00:00 +0900 | 2016-02-29 18:00:00 UTC |
2016-03-01 04:00:00 +0900 | 2016-02-29 19:00:00 UTC |
2016-03-01 05:00:00 +0900 | 2016-02-29 20:00:00 UTC |
2016-03-01 06:00:00 +0900 | 2016-02-29 21:00:00 UTC |
2016-03-01 07:00:00 +0900 | 2016-02-29 22:00:00 UTC |
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
require 'find' | |
class Watchlog | |
class LogFile | |
def initialize(path) | |
@path = path | |
@pid = nil | |
@wth = nil | |
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
# -*- mode: ruby -*- | |
Vagrant.configure(2) do |config| | |
config.vm.box = 'ubuntu/xenial64' | |
config.vm.network 'forwarded_port', guest: 5432, host: 15432 | |
config.vm.network 'forwarded_port', guest: 8000, host: 18000 | |
config.vm.provider 'virtualbox' do |vb| | |
vb.cpus = 4 | |
vb.memory = 4094 | |
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
require 'web_push' | |
# Generate a keys and puts it to Rails.application.secrets.web_push_public_key | |
pkey = WebPush::Utils.generate_vapid_pkey | |
# Rails.application.secrets.web_push_private_key | |
vapid_private_key = Base64.urlsafe_encode64(pkey.private_key.to_bn.to_s(2)).delete('=') | |
puts "vapid_private_key = #{vapid_private_key}" | |
# Rails.application.secrets.web_push_public_key |
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
require 'restclient' | |
require 'json' | |
namespace :sentry do | |
class SentryReleaseAPI | |
def initialize(organization_slug: nil, project_slug: nil, api_key: nil) | |
@organization_slug = organization_slug || ENV['SENTRY_ORGANIZATION_SLUG'] | |
@project_slug = project_slug || ENV['SENTRY_PROJECT_SLUG'] | |
@api_key = api_key || ENV['SENTRY_API_KEY'] | |
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
const actionCreator = () => ({ type: 'SOME_ACTION' }); | |
const noopReducer = (state, action) => state; | |
const noopEnhancer = (store) => store; | |
const noopMiddleware = store => next => action => next(action); | |
export function createStore(reducer = noopReducer, initialState = undefined, enhancer = noopEnhancer) { | |
let state = initialState; | |
let listeners = []; | |
const dispatch = (action) => { |
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 | |
old_sha, new_sha, ref = STDIN.read.split(' ') | |
diff = %x{ git diff --raw --name-only #{old_sha} #{new_sha} 2> /dev/null } | |
diff.each_line do |line| | |
file = line.chomp | |
next unless file =~ /\.rb\Z/i |
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
require 'active_support/core_ext/string/inflections' | |
require 'active_support/core_ext/hash/indifferent_access' | |
module Snaky | |
refine Hash do | |
def to_snake_case(value = self) | |
case value | |
when Hash | |
value.map { |k, v| [k.underscore, to_snake_case(v)] }.to_h.with_indifferent_access | |
when Array |
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
require 'thread' | |
class QuWk | |
NUM = 3 | |
def initialize | |
@queue = Queue.new | |
@workers = [] | |
@num = NUM | |
@block = proc {} |
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
class Rewinder | |
def self.repository | |
Thread.current[:rewinder] | |
end | |
def self.repository=(v) | |
Thread.current[:rewinder] = v | |
end | |
def self.start |