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
data = [] | |
data << {:field_1 => 'abcde', :field_2 => 10, :field_3 => '2727291'} | |
data << {:field_1 => 'fghij', :field_2 => 200, :field_3 => '12177'} | |
# more data | |
data.each do |d| | |
SomeModel.new d | |
d.save! | |
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
{ | |
"data":[ | |
{ | |
"0":13101, | |
"1":100, | |
"2":1000000, | |
"3":"トウキョウト", | |
"4":"チヨダク", | |
"5":"イカニケイサイガナイバアイ", | |
"6":"東京都", |
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 SimpleSearchForm | |
include ActiveAttr::Model | |
class_attribute :_search_model | |
class_attribute :_like_attributes | |
class_attribute :_equal_attributes | |
class_attribute :_join_tables | |
self._like_attributes = [] | |
self._equal_attributes = [] |
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
<?php | |
$max = 1000; | |
for($i = 2;$i <= 1000;$i++){ | |
$devidable = false; | |
for($j = ($i - 1);$j > 1;$j--){ | |
if($i % $j == 0){ | |
$devidable = true; | |
} |
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
# morimorihoge screenrc | |
escape \233\233 | |
zombie | |
hardstatus on | |
defbce on | |
# Protection from attacks | |
multiuser off |
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
="00001" テストデータ 0 スペース 入り データ ←には空データがあります |
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 | |
# requireや初期化を書く | |
require 'optparse' | |
opt = OptionParser.new | |
opt.version = '1.0' | |
# opt.banner = 'Usage: command [options]' | |
option_a = nil | |
# option別の#onを実装 |
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 'aws-sdk' | |
require 'json' | |
# Environments: | |
# AWS_REGION = 'ap-northeast-1' as default | |
# TARGET_INSTANCE_IDS = 'i-1234567890abcdef,i-2234567890abcdef' like comma-separated string | |
AWS_REGION = ENV['AWS_REGION'] || 'ap-northeast-1' | |
def lambda_handler(event:, context:) | |
target_instance_ids = ENV['TARGET_INSTANCE_IDS'].split(',') |
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 'aws-sdk' | |
require 'json' | |
# Environments: | |
# AWS_REGION = 'ap-northeast-1' as default | |
# TARGET_INSTANCE_IDS = 'i-1234567890abcdef,i-2234567890abcdef' like comma-separated string | |
AWS_REGION = ENV['AWS_REGION'] || 'ap-northeast-1' | |
def lambda_handler(event:, context:) | |
target_instance_ids = ENV['TARGET_INSTANCE_IDS'].split(',') |
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
/****************************************************************************** | |
Compensating the CCS811 with humidity readings from the BME280 | |
Marshall Taylor @ SparkFun Electronics | |
April 4, 2017 | |
https://github.com/sparkfun/CCS811_Air_Quality_Breakout | |
https://github.com/sparkfun/SparkFun_CCS811_Arduino_Library |