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
// 指定したタスクが2秒以内に終わらなかったらTimeoutを発生させる。リトライは3回したい。 | |
// 期待する動作: タスクA実行 -> 2秒経過Timeout -> すぐにタスクA実行 -> Timeout -> タスクA実行 -> Timeout -> Exception投げて終了 | |
// 実際の動作: タスクA実行 -> 2秒経過Timeout -> 前の処理が終わるまで待ってるので8秒の待ち時間 -> タスクA実行 -> 以下略 | |
// Create無いでObservable.Startとかして非同期処理走らせる? | |
// でもそうするとタスクAが二重で走ることになってしまい困る。スレッドAbortしたいけどできない。さてどうしよう | |
// 実際はタスクAが3時間とか10時間とかそんな感じなんで、前の処理が終わるまで待ってるのはつらい。。。 |
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 'bundler' | |
# Bundler.require | |
require 'active_record' | |
require 'rails' | |
require 'minitest/autorun' | |
require 'logger' | |
db_name = 'rails-check' |
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 | |
# | |
# .git/hooks/prepare-commit-msg に配置する | |
# RAILS用コミットメッセージ追加 | |
if ARGV[1] && ARGV[1].include?("message") | |
files = `git diff --cached --name-only` | |
change_files = files.split("\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
require 'active_record' | |
require 'active_support' | |
require 'squeel' | |
require 'minitest/autorun' | |
require 'logger' | |
require 'pry' | |
db_name = 'qiita_58ab6409' | |
ActiveRecord::Base.establish_connection adapter: 'mysql2', database: 'mysql', host: 'localhost' |
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
import {bootstrap, Component, View, FORM_DIRECTIVES, CORE_DIRECTIVES, Inject, forwardRef} from 'angular2/angular2'; | |
class Hero { | |
id: number; | |
name: string; | |
birthday: Date; | |
} | |
@Component({ | |
selector: 'hero-app' |
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
{ | |
"result": [ | |
{ | |
"id": 67519, | |
"is_incomplete": false, | |
"github_item_id": 4162554, | |
"name": "params_extractor", | |
"full_name": "kristianmandrup/params_extractor", | |
"owner_id": 125005, | |
"owner_login_name": "kristianmandrup", |
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
gem install gamma |
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
import glob | |
import pandas as pd | |
pd.options.display.max_columns = None | |
JA_DIR = "./All_20053_20193_ja" | |
EN_DIR = "./All_20053_20193_en" | |
# JA file has PricePerUnit column | |
JA_FILE_HEADERS = [ |
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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
gem "rails", "~> 6.1.4" |
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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
gem "rails", "~> 6.1.4" |
OlderNewer