Skip to content

Instantly share code, notes, and snippets.

View metalinspired's full-sized avatar

Milan Divkovic metalinspired

View GitHub Profile
@danielzen
danielzen / nvm-lazy.sh
Last active August 19, 2024 21:23
nvm lazy-load for zsh
# This script should be sourced from .zprofile to take advantage of the $ZSH_EXECUTION_STRING check
export NVM_DIR="$HOME/.nvm"
export NVM_SYMLINK_CURRENT=true
NODE_VERSION_DIR=$(readlink ~/.nvm/current) # Assumes ~/.nvm/current is linked
__NODE_GLOBALS=("${(@f)$(find "$NODE_VERSION_DIR"/bin -maxdepth 1 -mindepth 1 -type l -print0 | xargs --null -n1 basename | sort --unique)}")
__NODE_GLOBALS+=(node nvm)
found=false
for value in "${__NODE_GLOBALS[@]}"; do
# if zsh is trying to execute a command that matches one of the node globals in the current version
@joe-scotto
joe-scotto / Animation
Last active August 1, 2024 20:21
QMK OLED Displays
#ifdef OLED_ENABLE
// Rotate OLED
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_90;
}
// Animation parameters
#define FRAME_DURATION 333 // How long each frame lasts in milliseconds
@lukeplausin
lukeplausin / transfer_ssm_file.sh
Last active September 16, 2024 08:22
Transfer a file to EC2 SSM instance without using S3 (SSM only)
# This script will explain how to transfer a file to EC2 using SSM ONLY!
# You will need to have permission to run SSM commands on the target machine and have sudo access as well
# Infos
INSTANCE_ID=i-1234567890
FILE_NAME=the_file.tar.gz
# Step 1: Run command on machine to install netcat and dump from port to filename
# < Start session
@carlosal1015
carlosal1015 / debianlatex.md
Last active March 27, 2024 14:51
Installation of LaTeX on Debian.

Installing TeX Live for Debian users

TeX Live for Debian

Hello 😄, I'm Oromion 🇵🇪. I'm an undergraduate student of mathematics and in this video tutorial, we will show how to download and install the last version of the TeX Live Manager in order to use LaTeX for all users on your distribution of Debian.

What is LaTeX? 🚀

@shortjared
shortjared / list.txt
Last active September 19, 2024 00:57
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@grizzm0
grizzm0 / Foo.php
Last active August 9, 2021 14:13
Best practice form/input-filter setup for ZF3
<?php
namespace Application\Entity;
/**
* Class Foo
*
* @package Application\Entity
*/
class Foo
{