Skip to content

Instantly share code, notes, and snippets.

View jmoyers's full-sized avatar

Joshua Moyers jmoyers

View GitHub Profile
// quicksort an array, then map into li elements inside a ul
const ul = document.querySelector('ul');
const li = document.querySelectorAll('li');
const quicksort = (arr) => {
if (arr.length <= 1) return arr;
const pivot = arr[0];
const left = [];
const right = [];
@jmoyers
jmoyers / 1. README.md
Last active June 23, 2023 17:00
Get up and running with a terminal, vim, and c++
  • color scheme
  • terminal
  • z proj, takes you to /some/deep/directory/project
@jmoyers
jmoyers / 1242-futures.cpp
Last active August 8, 2020 03:04
Futures vs Shared Memory/Locks/Conditional Variable
#include <future>
#include <iostream>
#include <string>
#include <unordered_set>
#include <queue>
using namespace std;
class Solution {
public:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDCE+bwSh4bbwi34u4EjIp4kcNLZm/GFpBknId0kMwj6C9yOHobuCeUh16CgReY9Fspxt5h4alBYNFv2ZEPAou01qXk+X/s2xFPsZEBIfJO/tH9LCbfCBl4Ujauy8RwCp/E/d/70uI9/QbnGL4UzfcZ/lIYQmxjUO4Dsl0Q8uTpko6j6nE5d/BHZjfwbMot933hp6Nsftz3lhwedPMbBsv4X2CPMB+K7SAXxbICc703X0cKXTYEtE1v2yfRhusp/t/2IOPxISCVzM4yiUnIk7I7QThFUttyJKzHXWB/hG8hnvDtlxl+ZLrOmlwfcQrsM4YsiGxOYX/f1+OpFeLcV82A/w3oMKIgu7SKw4QhKRZfqaZeNjaKv+3awIcjSvcxP5r0WMzS0CFD1nYWd2qC9QtNNF94B8z1O0YoRM5RxG2ZIbfJE0WHzcNA8TBT1dt/TB8lw0EwZ0lHtc/MfmnE5uSd5/WAL7GcDm2s7+tDVhH0R9+JUqkMz8KZUs116ZqpnY0= jmoyers@DESKTOP-1L4V9LH
#NoEnv
#HotkeyModifierTimeout -1
SetStoreCapsLockMode, Off
SetWorkingDir %A_ScriptDir%
SetKeyDelay, 50, 50
$z::
SetTimer, NoSleep, 30000
Send, z
return
#NoEnv
#HotkeyModifierTimeout -1
SetStoreCapsLockMode, Off
SendMode Input
SetWorkingDir %A_ScriptDir%
$f3::reload
$2::
if !WinActive("ahk_exe eqgame.exe") {
[Socials]
Page2Button1Name=Heal
Page2Button1Color=0
Page2Button1Line2=/cast 1
Page2Button7Name=T1
Page2Button7Color=0
Page2Button7Line1=/target Chagrin
Page2Button3Name=T2
Page2Button3Color=0
Page2Button3Line1=/target Disquiet
[ShortDurationBuffWindow]
INIVersion=1
FirstTimeAlert=0
DBGTint.red=255
DBGTint.green=255
DBGTint.blue=255
Border=1
ClickThrough=0
Escapable=0
RestoreYPosWindowed=2
@jmoyers
jmoyers / README.md
Last active July 15, 2022 12:46
Automatically parse docker stack yml, hash stack configs with md5, replace environment variables, rotate new config on deploy

This script lets you parse your docker stack yml file for configs, and set some environment variables that will allow you to roll updates to your configs without manually changing names, adding or removing configs manually.

  • Note the yaml parser is not complete (I didn't write it, its from a convenient stackoverflow post, thanks!)
  • Currently dev.yml is hardcoded into the script, fix that!
  • Note the use of source -- we export environment variables here so I believe thats required. Not a super bashlord, so fix it up if you'd like.

Example usage:

jmoyers @ Joshua-PC stack > source hash_configs.sh
jmoyers@server ~ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 3 2017 18:35:35)
MacOS X (unix) version
Included patches: 1-1050
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors