Skip to content

Instantly share code, notes, and snippets.

View victusfate's full-sized avatar
🚀

Mark Essel victusfate

🚀
View GitHub Profile
@victusfate
victusfate / install.sh
Last active February 23, 2024 15:02
python dependencies macOS M2
brew reinstall openssl gettext readline sqlite3 xz zlib tcl-tk
@victusfate
victusfate / gist:6662335665490758720e7ff8f9c40937
Created October 26, 2023 14:55
convert_last_commit_to_different_branch.txt
# Stash the changes: This will take your current changes and stash them.
git reset HEAD~1
# Copy code
git stash
#Switch to the desired branch:
git checkout [branch-name]
# Apply the stash to the branch:
@victusfate
victusfate / sample.vue
Created July 31, 2023 15:23
simple vue sample with interactive date inputs
<template>
<div class="flex justify-between">
<div>
<label class="tw-inline-block tw-pt-2 tw-leading-tight tw-mb-1 tw-text-base mr-2">Start Date</label>
<input type="date" id="start_date" v-model="start_date" class="mb-4 w-32 h-8" />
</div>
<div>
<label class="tw-inline-block tw-pt-2 tw-leading-tight tw-mb-1 tw-text-base mr-2">End Date</label>
<input type="date" id="end_date" v-model="end_date" class="mb-4 w-32 h-8" />
</div>
@victusfate
victusfate / redis-inventory-install.sh
Last active February 16, 2024 16:11
install redis-inventory and go
trying https://github.com/obukhov/redis-inventory first
install go 1.15
https://www.5gfundamental.com/2021/04/install-go-lang-latest-version-1155-in.html
git clone https://github.com/obukhov/redis-inventory
sudo wget https://golang.org/dl/go1.15.5.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.15.5.linux-amd64.tar.gz
Dijkstra's algorithm is a popular algorithm used to find the shortest path between two nodes in a graph. It is a greedy algorithm that iteratively expands the frontier of visited nodes from the starting node towards the target node, while updating the cost of each node. The algorithm maintains a priority queue of nodes to visit, with the node with the lowest current cost at the front of the queue.
Here are the basic steps of Dijkstra's algorithm:
Initialize the cost of the starting node to 0, and the cost of all other nodes to infinity.
Add the starting node to the priority queue.
While the priority queue is not empty:
Remove the node with the lowest cost from the priority queue (call it "current").
For each neighbor of "current":
Calculate the cost of getting to that neighbor through "current".
const fs = require('fs')
if (process.argc < 3) {
console.log('Usage: node timing.js <filename>')
process.exit(1)
}
const sFile = process.argv[2]
console.log({sFile})
export default function AppWs() {
const [isPaused, setPause] = useState(false);
const ws = useRef(null);
useEffect(() => {
ws.current = new WebSocket("wss://ws.kraken.com/");
ws.current.onopen = () => console.log("ws opened");
ws.current.onclose = () => console.log("ws closed");
const wsCurrent = ws.current;
@victusfate
victusfate / multi_process_dictionary.py
Created May 20, 2021 20:38
thread safe multiprocess python dictionary example https://stackoverflow.com/a/46228938/51700
from multiprocessing import Process, Manager
manager = Manager()
d = manager.dict()
def f():
d[1].append(4)
# the __str__() method of a dict object invokes __repr__() on each of its items,
# so explicitly invoking __str__() is required in order to print the actual list items
print({k: str(v) for k, v in d.items()}
@victusfate
victusfate / Alela.md
Created May 5, 2021 15:17
Alela Brawl Deck

Commander 1 Alela, Artful Provocateur (ELD) 324

Deck 1 Righteous Valkyrie (KHM) 24 1 Glacial Floodplain (KHM) 257 6 Snow-Covered Swamp (KHM) 281 1 Lagonna-Band Storyteller (THB) 27 1 Demonic Embrace (M21) 95 6 Snow-Covered Plains (KHM) 276

This file has been truncated, but you can view the full file.
[[{"score":5.141071428571431,"points":[{"lat":30.27594797018001,"lng":-97.74167025909962},{"lat":30.264482588643258,"lng":-97.74167025909962},{"lat":30.26512499911168,"lng":-97.73080697363837},{"lat":30.2765905258849,"lng":-97.73080697363837},{"lat":30.27594797018001,"lng":-97.74167025909962}]},{"score":2.126785714285714,"points":[{"lat":30.275304409960153,"lng":-97.75253521988041},{"lat":30.26383917389268,"lng":-97.75253521988041},{"lat":30.264482588643258,"lng":-97.74167025909962},{"lat":30.27594797018001,"lng":-97.74167025909962},{"lat":30.275304409960153,"lng":-97.75253521988041}]},{"score":1.2714285714285711,"points":[{"lat":30.26512499911168,"lng":-97.73080697363837},{"lat":30.25365847735911,"lng":-97.73080697363837},{"lat":30.254299738793186,"lng":-97.71994536457991},{"lat":30.26576640566484,"lng":-97.71994536457991},{"lat":30.26512499911168,"lng":-97.73080697363837}]},{"score":0.9375,"points":[{"lat":30.25493999691198,"lng":-97.70908543300678},{"lat":30.243472191103944,"lng":-97.70908543300678},{"lat"