Skip to content

Instantly share code, notes, and snippets.

@tomasgeci
tomasgeci / install nano.sh
Created November 11, 2024 10:29 — forked from BlakeGardner/install nano.sh
Syntax highlighting in nano on Mac OS
# Last updated May, 2024 for Apple silicon Macs
# Install Homebrew if you don't already have it: https://brew.sh
# install nano from homebrew
brew install nano nanorc
# update your nanorc file
echo 'include "'"$(brew --cellar nano)"'/*/share/nano/*.nanorc"' >> ~/.nanorc
# close and re-open your terminal and you'll have syntax highlighting

Do not use forEach with async-await

TLDR: Use for...of instead of forEach() in asynchronous code.

For legacy browsers, use for...i or [].reduce()

To execute the promises in parallel, use Promise.all([].map(...))

The problem

@tomasgeci
tomasgeci / ISSAlert.ino
Created April 3, 2023 19:26 — forked from polluxlabs/ISSAlert.ino
ISS Alert
/*********
pollux labs, 2020
*********/
/*** Your WiFi Credentials ***/
const char* ssid = "your ssid";
const char* password = "your password";
@tomasgeci
tomasgeci / yota.js
Last active December 13, 2022 07:42
YOTA callsigns
/*
https://events.ham-yota.com/logbook?search=om5ast&eventStation=
Dropdown from LogBook filter in browser console
*/
var options = $('#logbook-search-form > div.form-group.form-group--station > label > select option');
var values = $.map(options ,function(option) {
return option.value;
});
console.log(values.join(','));
/*
@tomasgeci
tomasgeci / vagrant-cheat-sheet.md
Created November 13, 2022 09:07 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@tomasgeci
tomasgeci / 01.bash_shortcuts_v2.md
Last active November 30, 2022 15:31 — forked from tuxfight3r/01.bash_shortcuts_v2.md
Bash keyboard shortcuts

Bash Shortcuts

Moving

command description
ctrl + a Goto BEGINNING of command line
ctrl + e Goto END of command line
ctrl + b move back one character
@tomasgeci
tomasgeci / readme.md
Last active November 11, 2022 11:10
powershell

Fix error

  • File C:\temp\GenerateRpt.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https://go.microsoft.com/ fwlink/?LinkID=135170
  • Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
@tomasgeci
tomasgeci / oh-my-posh_WinPS_Install.md
Created November 11, 2022 10:32 — forked from adojos/oh-my-posh_WinPS_Install.md
Oh-my-posh Installation on Win PowerShell

Oh-my-posh Installation on Windows PowerShell


Installation

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
@tomasgeci
tomasgeci / readme.md
Last active October 19, 2022 10:52
Github CLI batch delete repos

Github CLI cheatsheet

List examples

  • gh repo list --limit 100 --visibility private
  • gh repo list --limit 100 --visibility public
  • gh repo list --limit 100 --visibility public --fork
  • gh repo list --limit 100 --visibility public --source
  • gh repo list --limit 100 --visibility public --json nameWithOwner
  • gh repo list --limit 100 --visibility public --json nameWithOwner | jq '.[] | .nameWithOwner'
@tomasgeci
tomasgeci / gitignore.md
Created October 14, 2022 13:17
terraform .gitignore

Local .terraform directories

*/.terraform/

.tfstate files

*.tfstate .tfstate.

Crash log files

crash.log crash.*.log