Skip to content

Instantly share code, notes, and snippets.

View briankung's full-sized avatar

Brian Kung briankung

  • Chicago
View GitHub Profile
require "minitest/autorun"
TRAFFIC_TRANSITIONS = {
"red" => "green",
"green" => "yellow",
"yellow" => "red",
}
def is_valid_traffic_sequence(sequence)
sequence.each_cons(2) do |before, after|

|Question |ChatGPT Response

@briankung
briankung / aoc.gleam
Last active December 4, 2022 04:45
Advent of Code in Gleam
import gleam/int
import gleam/list
import gleam/erlang/file
import gleam/string
// 01.txt is a list of the caloric values of the snacks that elves are carrying.
// Each elf's personal inventory is separated from the other elves' inventories with
// two newlines "\n\n", and each snack is separated by a single newline "\n".
// In other words, the input string is a list of elf inventories, which is itself a
// list of snacks' caloric values.
@briankung
briankung / resume.json
Created November 5, 2021 02:55
Brian Kung - jsonresume.org
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"meta": { "theme": "onepage" },
"basics": {
"name": "Brian Kung",
"label": "Software Engineer",
"image": "https://briankung.files.wordpress.com/2021/11/diedw00f_400x400.jpg",
"email": "[email protected]",
"phone": "(224) 730-6348",
"url": "https://briankung.dev",
@briankung
briankung / 0 - commits with diff mentioning PAGE_BITMAP_PLANES.gitlog
Last active February 5, 2021 01:51
Investigating HEAP_PAGE_BITMAP_PLANES
commit 6c5f5233db596c2c7708d5807d9a925a3a0ee73a
Author: naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Tue Nov 8 09:31:52 2016 +0000
Moved deleted ChangeLog into doc/ChangeLog-2.4.0
And Add doc/ChangeLog-2016 as an anchor.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
@briankung
briankung / police_brutality.md
Created June 1, 2020 18:00
Police brutality

Keybase proof

I hereby claim:

  • I am briankung on github.
  • I am briankung (https://keybase.io/briankung) on keybase.
  • I have a public key ASAGLS90nXRJADLC_C8m77zVANHLNQ13ByXmfnfqt7m8wAo

To claim this, I am signing this object:

@briankung
briankung / binary to float converter.rb
Created June 29, 2019 19:00
binary to float converter
class String
def prettyb
self.chars.reverse.each_slice(4).map(&:join).join("_").reverse
end
def floatify
string = self.gsub('_', '')
if string.length % 16 != 0
raise RuntimeError, "must be a single or a double precision float"
@briankung
briankung / PlayRustBookmarklet.js
Created June 27, 2019 21:40
Play Rust! Copies selected text into the Rust playground at https://play.rust-lang.org/
javascript:void(
(function() {
window.open(
`https://play.rust-lang.org/?code=${encodeURIComponent(
window.getSelection().toString()
)}`,
"_blank"
);
})();
)