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 / 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
@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 / ffmpegFifo.cc
Created January 13, 2015 19:51
example of piping raw video to ffmpeg
// bash, trying mkfifo to do this in c
// $ mkfifo image_pipe
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <fstream>
#include <string>
@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 / glfwSample.cc
Last active July 21, 2023 20:42
glfw opengl sample program
#include <GLFW/glfw3.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
using namespace std;
static void error_callback(int error, const char* description)
{
fputs(description, stderr);
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".
@victusfate
victusfate / test.cc
Created February 25, 2014 18:35
opengl shader test, glut
#include <OpenGL/OpenGL.h>
#include <GLUT/GLUT.h>
#include <string>
#include <vector>
#include <iostream>
#include "glInfo.h"
using namespace std;
@victusfate
victusfate / jquery.cycle.all.js
Created May 15, 2011 13:13
jquery cycle all
/*!
* jQuery Cycle Plugin (with Transition Definitions)
* Examples and documentation at: http://jquery.malsup.com/cycle/
* Copyright (c) 2007-2010 M. Alsup
* Version: 2.99 (12-MAR-2011)
* Dual licensed under the MIT and GPL licenses.
* http://jquery.malsup.com/license.html
* Requires: jQuery v1.3.2 or later
*/
;(function($) {
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})