Skip to content

Instantly share code, notes, and snippets.

View InfamousStarFox's full-sized avatar

Kyle McCaf InfamousStarFox

View GitHub Profile
@InfamousStarFox
InfamousStarFox / docker-compose update.md
Created November 8, 2022 07:00
How to update a docker-compose image to the latest

Docker compose update

List the cached images docker image ls

Copy the image id and delete it with docker image rm $IMAGE_ID

Verify the image was deleted, then rebuild the container with docker-compose up -d

@InfamousStarFox
InfamousStarFox / SeattleSolarData.json
Last active January 26, 2022 07:57
Sunrise and Sunset Data for Seattle, WA
{
"01-01": {
"SolarNoon": "12:13 PM",
"Sunrise": "7:57 AM",
"Sunset": "4:28 PM",
"SunlightMinutes": 511
},
"01-02": {
"SolarNoon": "12:13 PM",
"Sunrise": "7:57 AM",
@InfamousStarFox
InfamousStarFox / alpine-upgrade.md
Last active October 21, 2021 04:50
Upgrade instructions for alpine linux

Alpine Linux Upgrade Instructions

Find the latest stable version from https://alpinelinux.org/releases/

Edit the repository number to the latest stable version

nano /etc/apk/repositories
@InfamousStarFox
InfamousStarFox / Netflix movies by year.md
Last active April 20, 2021 22:45
Netflix movies by year

Netflix movies by year

Graph

Year Movies
2010 6755
2014 6494
2015 4526
@InfamousStarFox
InfamousStarFox / throttle.tsx
Created April 3, 2021 00:06
Typescript Throttle
// Limit a function to run at max once per interval
// Example, throttle(callback, 100) called every 10ms. Callback will return once every 100ms.
// Example, throttle(callback, 100) called 30 times in 10ms, then not called again. Callback will return once.
export function throttle(callback:Function, time:number) {
let free:boolean = true;
return function(this:any){
if(free) {
callback.apply(this, arguments);
free = false;
@InfamousStarFox
InfamousStarFox / debounce.tsx
Last active April 3, 2021 00:07
Typescript Debounce
// Debounce calls a function after N amount of time passes since its last call
// Example, debounce(callback, 100) called every 10ms. Callback will never run.
// Example, debounce(callback, 100) called 30 times in 10ms, then not called again. Callback will run 100ms after the last call.
export function debounce(callback:Function, time:number){
let timeout: ReturnType<typeof setTimeout>;
return function(){
clearTimeout(timeout);
timeout = setTimeout(function(this:any){
callback.apply(this, arguments);
This file has been truncated, but you can view the full file.
[
{
"title":"#Alive ",
"type":"Movie",
"titlereleased":"2020",
"image_landscape":"https:\/\/occ-0-299-300.1.nflxso.net\/dnm\/api\/v6\/XsrytRUxks8BtTRf9HNlZkW2tvY\/AAAABZ7RwtOMRFtLvw2U9R7Yb7W9mPxmaSgKYsrlimihHLQ7PhMz7y3lFMH72lAV1wq9K1FJh4yK4_fUBdeCzJyHn6_wUbkc.jpg",
"image_portrait":"https:\/\/www.whats-on-netflix.com\/wp-content\/uploads\/covers\/alive.jpeg",
"rating":"TV-MA",
"quality":null,
"actors":"Yoo Ah-in, Park Shin-hye",
@InfamousStarFox
InfamousStarFox / NameSilo_DDNS.sh
Created February 20, 2021 00:59
Ubiquiti EdgeRouter NameSilo Dynamic DNS
#!/bin/bash
# For Ubiquiti EdgeOS
# This script will set the NameSilo ip address to the router's external ip address
# Place the file in /etc/cron.hourly
# Domain name:
DOMAIN="mydomain.tld";
# Host name (subdomain). Optional. If present, must end with a dot (.)
HOST="subdomain.";
@InfamousStarFox
InfamousStarFox / Vmmem.md
Last active February 9, 2021 19:32
Docker - Limit Vmmem RAM usage

Docker - Limit Vmmem RAM usage

Create a file %UserProfile%\.wslconfig

Then add:

[wsl2]
memory=3GB
@InfamousStarFox
InfamousStarFox / docker-rebuild.sh
Created January 26, 2021 00:04
Stops, deletes, rebuilds, and starts docker containers
# Stops, deletes, rebuilds, and starts docker containers
# Run in bash with ./docker-rebuild.sh
echo "STOP CONTAINERS";
docker-compose down
docker ps -aq | xargs --no-run-if-empty docker stop
echo "REMOVE CONTAINERS";
docker ps -aq | xargs --no-run-if-empty docker rm -f