Skip to content

Instantly share code, notes, and snippets.

View ajmoorexyz's full-sized avatar
🌎

AJ Moore ajmoorexyz

🌎
  • Verily
  • Boulder, CO
View GitHub Profile
@stuartmclean
stuartmclean / aoc_2024_day_2.py
Created December 3, 2024 16:09
Advent of Code 2024 Day 2 Python Solution
asc = "ASC"
desc = "DESC"
tolerance = 3
def get_lines(test=False):
with open(("test" if test else "input") + ".txt") as file:
for ln in file:
yield ln.strip()
@gaearon
gaearon / Wordle.js
Created January 22, 2022 20:49
wordle v3 (tiny wordle clone i built during a stream) https://www.youtube.com/watch?v=Qxn4-bTOx0g
import { useState, useEffect, useRef, useMemo } from 'react'
export default function Wordle() {
let [currentAttempt, setCurrentAttempt] = useState('')
let [bestColors, setBestColors] = useState(() => new Map())
let [history, setHistory] = usePersistedHistory(h => {
waitForAnimation(h)
})
useEffect(() => {
@sivinnguyen
sivinnguyen / wsl2_200915_fix_dns_resolution.md
Last active July 13, 2025 15:48
Fix DNS resolution in WSL2

Error

$ sudo apt-get update
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
Temporary failure in name rerolution

$ host google.com
;; connection timed out; no servers could be reached
@gaearon
gaearon / Classes.js
Created May 27, 2020 17:38
Beneath Classes: Prototypes
class Spiderman {
lookOut() {
alert('My Spider-Sense is tingling.');
}
}
let miles = new Spiderman();
miles.lookOut();
@MateuszKubuszok
MateuszKubuszok / .tmux.conf
Created May 18, 2020 11:31
Poor man's iTerm2-like Tmux + Alacritty
# Open window/pane in the same PATH
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Reload config
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
# Window tab menu
bind-key -T root MouseDown3Status display-menu -T "#[align=centre]#{window_index}:#{window_name}" -t = -x W -y S \
"Swap Left" l "swap-window -t:-1" \
@ishad0w
ishad0w / sources.list
Created April 30, 2020 16:55
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@obbap1
obbap1 / solution.js
Last active January 14, 2022 21:41
Hacker rank's 'Stock Open Close Price' Solution with JS
const https = require("https");
const monthNames = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
@satr
satr / LambdaRequestHandlerWithLoggerTest.java
Created May 15, 2019 18:52
Mock Lambda Context and Logger while testing AWS Lambda RequestHandler (with JUnit4)
//In the test class
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.LambdaLogger;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.Mock;
import org.junit.Before;
import org.junit.Test;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.doAnswer;
@technolo-g
technolo-g / problem_solving_framework.md
Last active July 10, 2025 21:47
Problem Solving Framework
  • What is the problem?
  • What exactly does this problem mean? Spend 5 minutes of quiet time thinking to yourself the implications of what is happening and why it may be happening. Are there recent changes going on? Did someone mention this at standup?
  • Does it happen in prod too? (run the build right now, etc.)
  • Does it happen consistently or only sometimes?
  • If not consistent, what seems to be the variability? (build slave, environment)
  • Does the documentation of the project mention anything like this?
  • What systems could potentially be involved in this issue?