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
atnd.json |
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
# NOTE: https://github.com/refile/refile/pull/486 | |
# NOTE: https://github.com/refile/refile/issues/447 | |
gem 'refile', github: 'jastkand/refile', branch: 'mime-types-v3', require: 'refile/rails' | |
gem 'sinatra', '~> 2.0.0.beta2', require: false | |
# gem 'refile-s3' |
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 -e | |
case "$1" in | |
"start" ) | |
title="Started deploying to $2!" | |
title_link="${CIRCLE_BUILD_URL}" | |
text="<$3|$2>へのdeployを開始します..." | |
fallback="$2へのdeployを開始します" | |
color="#28d7e5" |
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 ApplicationEnum | |
class << self | |
attr_writer :attribute_names | |
def all | |
@all ||= Set.new | |
end | |
def attribute_names | |
@attribute_names ||= Set.new |
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 HogeError < StandardError | |
attr_reader :messages | |
def initialize(*messages) | |
@messages = messages | |
end | |
end | |
begin | |
raise HogeError.new(%w(err1 err2 err3)) |
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
# spec/support/factory_girl.rb | |
module FactoryGirl | |
module Strategy | |
class AttributesWithForeignKey | |
def association(runner) | |
runner.run | |
end | |
def result(evaluation) | |
instance = evaluation.object |
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 Devise | |
SCOPES = [:user] | |
module ResourceHelper | |
def create_resource(name) | |
send("current_#{name}") | |
rescue NameError | |
create(name) | |
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
# config/initializers/faker.rb | |
if defined?(Faker) | |
module Faker | |
class Internet < Base | |
class << self | |
def user_name_with_ignoring_locale(specifier = nil, separators = %w(. _)) | |
ignore_locale do | |
user_name_without_ignoring_locale(specifier, separators) |
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
traceroute google.com | head -1 | cut -f4 -d" " |
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
# lib/tasks/postgres.rake | |
namespace :db do | |
namespace :pg do | |
namespace :session do | |
desc 'reset postgres session/connection' | |
task :reset do | |
sql = %{ | |
SELECT pg_terminate_backend(pid) | |
FROM pg_stat_activity | |
WHERE datname = '#{ActiveRecord::Base.connection_config[:database]}' |
NewerOlder