Skip to content

Instantly share code, notes, and snippets.

View lgo's full-sized avatar
🚀
Launching to the future

Joey Pereira lgo

🚀
Launching to the future
View GitHub Profile
@lgo
lgo / test.ts
Last active August 19, 2019 03:22
VSCode typescript LSP highlight functionality. You can observe the behaviour by dropping this into a `.ts` file in VSCode and moving the cursor.
// 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
@lgo
lgo / test.rb
Last active August 19, 2019 03:19
Ruby test example for highlight functionality with Sorbet LSP
# typed: true
class TestClass
def method(a, b, &block)
c = a + b
d = c + 3
block.call
foo
@lgo
lgo / aoc_p6.rb
Created December 6, 2020 05:22
advent-of-code 2020, problem 6
# 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
@lgo
lgo / 0_MORGAN-WEI_IPLG_ROCKET_MARK_152_MANUAL.MD
Last active July 2, 2022 05:07
Morgan-Wei IPLG Simulation Code (https://keri.warr.ca/rockets/) [do not remove: rockets-gist]

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/

@lgo
lgo / fabman.rb
Last active October 28, 2023 16:24
Export https://fabman.io/ invoices in a quickbooks-like CSV format
# frozen_string_literal: true
#
# usage:
#
# fabman.rb <AUTH_TOKEN> <OUTPUT_FILE>
#
require 'net/http'
require 'json'
require 'csv'