Skip to content

Instantly share code, notes, and snippets.

Avatar

ujihisa

View GitHub Profile
View distance-from-costco1.txt
Assuming you walk by 4km/h
Vancouver Canucks - 32.913 seconds - Vancouver, British Columbia
Ottawa Senators - 30 minutes - Kanata, Ontario
Chicago Blackhawks - 42 minutes - Chicago, Illinois
Montréal Canadiens - 45 minutes - Montréal, Quebec
San Jose Sharks - 1 hours - Santa Clara, California
Winnipeg Jets - 1 hours - Winnipeg, Manitoba
Washington Capitals - 2 hours - Arlington, Virginia
Seattle Kraken - 2 hours - Seattle, Washington
View Oxygen Not Included攻略.md

Oxygen Not Included攻略

ゲームの進行度を以下に10区切りしてみる

  1. 開始直後から、トイレ手洗い浄水,酸素生成,食品貯蔵,食卓まわり最低限揃うまで
  2. 貯水池などからSPOM作って酸素と電力がひとまず余裕を持つ
  3. 間欠泉などから無限水源を確保 (蒸気タービンはまだ)。ハッチ厩舎と石炭発電。仮組みの鋼鉄精錬
    • 汚染水間欠泉、雪氷間欠泉、塩水間欠泉、間欠泉の4択
  4. アトモスーツによる居住区と非居住区の完全分離
  5. 原油からの石油入手。蒸気タービンによる拠点の保冷。地熱発電
View ONIチートシート.md
  • 気体用パイプ 1kg/m

  • 吸気ポンプ 500g/s

  • 液体用パイプ 10kg/m

  • 吸水ポンプ 液体10kg/s

  • コンベアレール 20kg/m

  • コンベアローダー 1000kg

View arbor_tree_pokeshell.rb
# g/s
# both plants and critters are domestic
num_arbor_tree = 6
lumber = 555.56 * num_arbor_tree
# ethanol_distiller
num_ethanol_distiller = lumber / 1000.0
lumber = 0
ethanol = 500.0 * num_ethanol_distiller
View grouse-revelstoke.txt
[🐻Grouse](Green) Chalet Road 6.68%
[🚗Seymour](Blue) Boomerang 8.33%
[🚗Seymour](Blue) Sammy's Express 8.52%
[🚗Seymour](Green) Mushroom 8.72%
[🌮Revelstoke](Green) Ripper Connector 9.55%
[🌮Revelstoke](Blue) Ninja Traverse 10.20%
[🌮Revelstoke](Green) Downtowner 10.25%
[🐻Grouse](Green) Paradise 10.29%
[🚗Seymour](Blue) Maverick 11.11%
[🐻Grouse](Blue) Lower Peak 11.70%
View shortest_date_to_be_positive_on_the_worst_purchase.rb
require 'csv'
# { date => dividends, ... }
dividends = CSV.parse(File.read('/tmp/Downloads/ZSP.TO (1).csv'))[1..].to_h {|date, dividend| [date, dividend.to_f] }
unit = nil
total_return_date_values = CSV.parse(File.read('/tmp/Downloads/^GSPC.csv'))[1..].map {|date, _, _, _, price|
price = price.to_f
unit ||= 1 / price
View private_class_method_thats_visible_also_to_instance_methods.rb
# See line 5
class C
using(Module.new do
refine C.singleton_class do
def secret
123
end
end
end)
View ad-hoc-parser.rb
def parse(str, constants)
parse_(RubyVM::AbstractSyntaxTree.parse(str), constants)
end
def parse_(node, constants)
case node.type
when :SCOPE
parse_(node.children[2], constants)
when :LIST
node.children[..-2].map { parse_(_1, constants) }
View SP500-last-30-years-log-least-square-simulator.rb
require 'csv'
def least_square(ys)
ave_x = ys.size / 2.0
ave_y = ys.sum / ys.size.to_f
a = ys.zip(0..).sum {|y, i| (i - ave_x) * (y - ave_y) } / ys.zip(0..).sum {|_, i| (i - ave_x) ** 2 }
b = ave_y - a * ave_x
[a, b]
end
View UjiTech.md

UjiTech

We, Tatsuhiro and Katie, serve the following tech consulting and training services.

  • Software/Hardware Consulting
    • Resolve particular web service issues that customer has, and other related things
    • Advise computer hardware setup, particularly for software engineers who work remotely at home
      • If if need we build up for our customer
  • Software development
    • Anything commissined for customer (commission-based contract charge)