Skip to content

Instantly share code, notes, and snippets.

View mambocab's full-sized avatar

Jim Witschey mambocab

  • Rapid7
  • Reston, VA
  • 14:29 (UTC -04:00)
View GitHub Profile
--- Day 12: Hill Climbing Algorithm ---
You try contacting the Elves using your handheld device, but the river you're following must be too low to get a decent signal.
You ask the device for a heightmap of the surrounding area (your puzzle input). The heightmap shows the local area from above broken into a grid; the elevation of each square of the grid is given by a single lowercase letter, where a is the lowest elevation, b is the next-lowest, and so on up to the highest elevation, z.
Also included on the heightmap are marks for your current position (S) and the location that should get the best signal (E). Your current position (S) has elevation a, and the location that should get the best signal (E) has elevation z.
You'd like to reach E, but to save energy, you should do it in as few steps as possible. During each step, you can move exactly one square up, down, left, or right. To avoid needing to get out your climbing gear, the elevation of the destination square can be at most one higher than the ele
@mambocab
mambocab / waitForKeyElements.js
Created February 7, 2021 21:01 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@mambocab
mambocab / index.pug
Created September 5, 2020 20:01
Random Gif Generator w/ Giphy API
#gif-wrap
#gif-logo
img(src="https://storage.googleapis.com/chydlx/codepen/random-gif-generator/giphy-logo.gif")
button#new-gif New Gif
@mambocab
mambocab / writeup.md
Last active November 12, 2019 16:31
Building a PC

Ok, I think I'm gonna actually build myself a PC this Black Friday season instead of just talking about it. Goals:

  • Living room PC attached to TV
  • Will be hooking it up to this TV via HDMI [1] -- advertized as 4K HDR
  • Want to play some games, mostly via controller. Mostly older stuff and less resource-intensive indie games. I think the most resource-intensive stuff I'm looking to play is, like, Outer Worlds and Control? I have no need to make them look great, and I won't be upset if I can't play them until I upgrade the box in a few years when prices are lower.
  • I'm thinking I'll install Windows as well so I can get on GamePass when I feel like playing newer stuff, and just to generally avoid thinking too hard about administering the box.

I found a build on r/buildmeapc that that someone recommended for a user who had more or less my goals. The build is a

#!/usr/bin/env sh
set -x
set -e
for branch in instrument-master instrument-asyncore-coalescing ; do
virtualenv $branch
git checkout $branch
set +x
. ./$branch/bin/activate
set -x
#!/usr/bin/env python
from __future__ import print_function
import errno
import logging
import os
import shutil
import time
import uuid
from collections import namedtuple
iteration 1
...
----------------------------------------------------------------------
Ran 3 tests in 92.452s
OK
java: no process found
iteration 2
...
----------------------------------------------------------------------
__ __ __ _ __ _______________________ ____________ _________
__ __/ /_ / /_ __ __/ /_ (_) /______ /_ __/ ____/ ___/_ __/ /_ __/ _/ |/ / ____/
/ / / / __ \ / __ \/ / / / __ \ / / __/ ___/ / / / __/ \__ \ / / / / / // /|_/ / __/
/ /_/ / / / / / / / / /_/ / / / / / / /_(__ ) / / / /___ ___/ // / / / _/ // / / / /___
\__,_/_/ /_/ /_/ /_/\__,_/_/ /_/ /_/\__/____/ /_/ /_____//____//_/ /_/ /___/_/ /_/_____/
no CassandraDaemon
+ CASSANDRA_VERSION=git:trunk ./run_dtests.py --vnodes false --nose-options= --with-id --verbosity=2 --stop --nocapture upgrade_tests/upgrade_through_versions_test.py:Prot
======================================================================
FAIL: consistency_test.py:TestAccuracy.test_network_topology_strategy_users
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mambocab/cstar_src/cassandra-dtest/consistency_test.py", line 622, in test_network_topology_strategy_users
self._run_test_function_in_parallel(TestAccuracy.Validation.validate_users, self.nodes, self.rf.values(), combinations),
File "/home/mambocab/cstar_src/cassandra-dtest/consistency_test.py", line 539, in _run_test_function_in_parallel
assert False, err.message
AssertionError: Got [] from ['127.0.0.1'], expected [[14, 38]] at ALL
-------------------- >> begin captured logging << --------------------
require "spec"
module ReturnsStringList
def self.get_string_list
[] of String
end
end
describe ReturnsStringList do
describe "#get_string_list" do