Skip to content

Instantly share code, notes, and snippets.

View gurgeous's full-sized avatar

Adam Doppelt gurgeous

  • Seattle, WA
View GitHub Profile
############################################################
# ruby one-liners
############################################################
alias avg="ruby -e 'x = STDIN.each_line.map(&:to_f) ; p x.reduce(:+) / x.size'"
alias min="ruby -e 'p STDIN.each_line.map(&:to_i).min'"
alias max="ruby -e 'p STDIN.each_line.map(&:to_i).max'"
alias sum="ruby -e 'p STDIN.each_line.map(&:to_i).reduce(:+)'"
alias upcase="ruby -e 'STDIN.each_line { |i| puts i.upcase }'"
alias downcase="ruby -e 'STDIN.each_line { |i| puts i.downcase }'"
word gscore date
abc 10 2018-04-19
access 10 2018-03-29
ace 10 2018-04-13
acrobat 10 2018-03-29
admiral 10 2018-04-30
adobe 10 2018-03-29
airport 10 2018-04-23
aloft 10 2018-04-06
alphabet 10 2018-04-12
@gurgeous
gurgeous / io.csv
Created September 23, 2018 22:42
Here are .io domains that are available as of 2018-10-23, sorted by gscore.
domain gscore
firetrap.io 10
devotional.io 7
connective.io 5
finery.io 5
squaw.io 5
taillight.io 5
inpatient.io 4
whoever.io 3
aclu.io 2
@gurgeous
gurgeous / ai.csv
Created September 25, 2018 02:16
Here are .ai domains that are available as of 2018-10-23, sorted by gscore.
domain gscore
asylum.ai 10
ballpark.ai 10
barium.ai 10
campanile.ai 10
caviar.ai 10
chaperon.ai 10
crowded.ai 10
evasion.ai 10
finagle.ai 10
// Copyright 2020 seattleswift
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// Copyright 2020 seattleswift
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
#
# amd, June 2020
# ~/Library/Application Support/Dungeon Crawl Stone Soup/init.txt
# see http://crawl.akrasiac.org/docs/options_guide.txt
#
#
# quality of life
#
@gurgeous
gurgeous / remote-learning-allowlist.txt
Last active August 22, 2020 17:13
Kid Remote Learning Allowlist
#
# Extract from nextdns.io using:
#
# $$(".notranslate").forEach($i => console.log($i.innerText))
#
# To flush DNS:
#
# 1) sudo killall -HUP mDNSResponder ; sudo killall mDNSResponderHelper ; sudo dscacheutil -flushcache
# from https://help.dreamhost.com/hc/en-us/articles/214981288-Flushing-your-DNS-cache-in-Mac-OS-X-and-Linux
# 2) restart chrome (easiest)
OX = [ -1, 0, 1, 1, 1, 0, -1, -1 ].freeze
OY = [ -1, -1, -1, 0, 1, 1, 1, 0 ].freeze
data = IO.read('inputs/11.txt').lines.map(&:chomp)
w = (0...data.first.length)
h = (0...data.length)
#
# part 1
#
# part 1
x = y = deg = 0
data.lines.each do |s|
d = s[1..].to_i
case s[0]
when 'N' then y += d
when 'S' then y -= d
when 'E' then x += d
when 'W' then x -= d
when 'L' then deg += d