Welcome to your computer terminal connected to the network of Morgan-Wei Interplanetary Logistics Group. Please see your submissions for training below. To resume training, visit https://keri.warr.ca/rockets/
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
| # frozen_string_literal: true | |
| # | |
| # usage: | |
| # | |
| # fabman.rb <AUTH_TOKEN> <OUTPUT_FILE> | |
| # | |
| require 'net/http' | |
| require 'json' | |
| require 'csv' |
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
| # frozen_string_literal: true | |
| def solve(path) | |
| soln_inc = 0 | |
| soln_inc_b = 0 | |
| lines = File.read(path).split("\n\n") | |
| lines.each do |line| | |
| chars = line.split("\n").map(&:chars).flatten | |
| # Part A | |
| soln_inc += chars.uniq.count |
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
| # typed: true | |
| class TestClass | |
| def method(a, b, &block) | |
| c = a + b | |
| d = c + 3 | |
| block.call | |
| foo |
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
| // literal string: only contents, read-references for all exact strings in the file. | |
| function literalString(person) { | |
| return "string"; | |
| } | |
| "string"; | |
| "string"; | |
| "string abc"; | |
| // literal numbers: nothing |
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
| // literal string: only contents, read-references for all exact strings in the file. | |
| function literalString(person) { | |
| return "string"; | |
| } | |
| "string"; | |
| "string"; | |
| "string abc"; | |
| // literal numbers: nothing |
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
| case {1, "hi"} | |
| when {1, .empty?} then "OK" | |
| end | |
| t = {1, "hi"} | |
| case t | |
| when {1, "h"} then "OK" | |
| end | |
| case t # causes "unterminated tuple literal" on the line below |
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
| package main | |
| import ( | |
| "database/sql" | |
| "log" | |
| "time" | |
| _ "github.com/lib/pq" | |
| ) |
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
| # Redis lease pseudo-code | |
| FUNCTION INIT_LEASES(lock_key, amt) | |
| FOR i := 0; i < amt; i++ DO | |
| LPUSH(lock_key, 0) | |
| END | |
| END | |
| FUNCTION ACQUIRE_LEASE(lock_key) |
I hereby claim:
- I am lgo on github.
- I am xlegoz (https://keybase.io/xlegoz) on keybase.
- I have a public key ASCxXa_qKMdSgjCBS-yMUxezx9auonu320_y7e2-bRtxRgo
To claim this, I am signing this object:
NewerOlder