This file contains hidden or 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 CONFIG = { | |
// ChatworkのWebhook設定画面で取得したトークン(Base64エンコード済み) | |
CHATWORK_WEBHOOK_TOKEN: '', | |
// DiscordのWebhook URL | |
DISCORD_WEBHOOK_URL: '', |
This file contains hidden or 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
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
This file contains hidden or 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
function ghql() { | |
local selected_file=$(ghq list --full-path | peco --query "$LBUFFER") | |
if [ -n "$selected_file" ]; then | |
if [ -t 1 ]; then | |
echo ${selected_file} | |
cd ${selected_file} | |
pwd | |
fi | |
fi | |
} |
This file contains hidden or 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
City.seed(:id, | |
{:id=>1, :prefecture_id=>1, :name=>"札幌市中央区", :name_en=>"sapporoshichuoku"}, | |
{:id=>2, :prefecture_id=>1, :name=>"札幌市北区", :name_en=>"sapporoshikitaku"}, | |
{:id=>3, :prefecture_id=>1, :name=>"札幌市東区", :name_en=>"sapporoshihigashiku"}, | |
{:id=>4, :prefecture_id=>1, :name=>"札幌市白石区", :name_en=>"sapporoshishiroishiku"}, | |
{:id=>5, :prefecture_id=>1, :name=>"札幌市豊平区", :name_en=>"sapporoshitoyohiraku"}, | |
{:id=>6, :prefecture_id=>1, :name=>"札幌市南区", :name_en=>"sapporoshiminamiku"}, | |
{:id=>7, :prefecture_id=>1, :name=>"札幌市西区", :name_en=>"sapporoshinishiku"}, | |
{:id=>8, :prefecture_id=>1, :name=>"札幌市厚別区", :name_en=>"sapporoshiatsubetsuku"}, | |
{:id=>9, :prefecture_id=>1, :name=>"札幌市手稲区", :name_en=>"sapporoshiteineku"}, |
This file contains hidden or 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
@charset "UTF-8"; | |
/* common */ | |
* { | |
box-sizing: border-box; | |
} | |
html, body, h1, p, ul { | |
margin: 0; |
This file contains hidden or 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 'open-uri' | |
require 'nokogiri' | |
require 'pry' | |
def check_stock(url:) | |
html = open(url).read | |
doc = Nokogiri.parse(html) | |
puts doc.title |
This file contains hidden or 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 'open-uri' | |
require 'csv' | |
require 'pry' | |
class Color | |
attr_reader :id, :color_name, :r, :g, :b | |
def initialize(id:, color_name:, r:, g:, b:) | |
@id = id | |
@color_name = color_name |
This file contains hidden or 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/bash | |
# *.html.erb -> *.html.haml | |
find . -type f -name "*.html.erb" -print0 | while read -r -d '' file; do mv "$file" "${file%%.html.erb}.html.haml";done |
This file contains hidden or 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
base_sql = ->(prefix) { %(INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at", "prefecture_code", "newly_hired_year", "confirmation_token", "confirmation_sent_at", "information_updated_at", "nurse_license_number") VALUES ('raw_sql_test_#{prefix}@gmail.com', '$2a$10$.nem4Wlxbur4nXpxpC3EJuJXbS/LOYJVomyHyAbxLPDw2UPYN29G.', NOW(), NOW(), 3, 1951, '#{prefix}_eth46u5ejrs', NOW(), NOW(), '53479ty93');) } | |
File.open("users.sql", "w") do |f| | |
2_000_000.times do |i| | |
f.puts base_sql.(i) | |
end | |
end |
This file contains hidden or 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 -*- | |
# | |
# | |
# http://qiita.com/takashibagura/items/8b49b8b02bb797210c5b | |
# 上記サイトを参考にAWS SDK for Ruby v2で作成 | |
require 'aws-sdk-core' | |
require 'yaml' | |
require 'pp' |
NewerOlder