Skip to content

Instantly share code, notes, and snippets.

A black belt is a white belt that never quit.

Davide Nastri ltpitt

A black belt is a white belt that never quit.
View GitHub Profile
ltpitt /
Created Nov 18, 2021 — forked from stuartsaunders/
Versioning and Git Workflow

Semantic Versioning


Versions are denoted using a standard triplet of integers: MAJOR.MINOR.PATCH. The basic intent is that MAJOR versions are incompatible, large-scale upgrades of the API. MINOR versions retain source and binary compatibility with older minor versions, and changes in the PATCH level are perfectly compatible, forwards and backwards.

ltpitt /
Created Nov 13, 2021
How to create a cli tool in go using cobra
go get -v
cobra init --pkg-name -a ltpitt
go mod init
go get
go get
go build
ltpitt /
Created Oct 28, 2021
Create 4 pane in tmux via script
tmux new-session -s "CDT" -d
tmux split-window -h
tmux split-window -v
tmux split-window -v -t 0
tmux send-keys -t %0 'echo first cdt'
tmux send-keys -t %1 'echo second cdt'
tmux send-keys -t %2 'echo third cdt'
tmux send-keys -t %3 'echo fourth cdt'
ltpitt /
Created Sep 1, 2021
Create a VM in Microsoft Azure via az and access it via SSH
az group create --location eastus2 --name MyResourceGroup
az vm create -n myVM -g MyResourceGroup --image UbuntuLTS --generate-ssh-keys
# Then search for myVM in Azure, get its ip and connect via ssh.
# Once done you can destroy the resource group using:
az group delete -n MyResourceGroup
ltpitt /
Created Aug 18, 2021
This oneliner executes the find_packages method in order to troubleshoot
python -c "from setuptools import setup, find_packages; print(find_packages())"
ltpitt /
Created Aug 5, 2021
A quick and dirty hack to type into fields where you cannot paste
import time
from pyautogui import typewrite
import easygui
text = easygui.textbox("Paste your text here, click on ok and then click in the field where you want the text to be pasted and wait for 10 seconds.", "Paste-into-anything-3000")
typewrite(text, 0.01)
ltpitt /
Last active Jul 7, 2021
Another template

Building a Peanut Butter and Jelly Sandwich


In this project, you will build a Peanut Butter and Jelly Sandwich (PB&J).

Getting Started

Before you build a PB&J, you will need to:

  • Set up a clean table
  • Get a clean dull knife
  • Have some kitchen paper handy in case of errors
ltpitt / autoScroller.js
Created Jun 6, 2021
A simple auto scroller button, can be pasted in browser console or injected in other ways in any website
View autoScroller.js
(function () {
let btn = document.createElement("button");
var isScrolling = false;
btn.innerHTML = "start scroll"; =
let onclick = function() {console.log("click"); isScrolling=!isScrolling; autoScroll()};
btn.addEventListener("click", onclick);
let autoScroll = () => {if(isScrolling){window.scrollBy(0, 1);
setTimeout(autoScroll, 10)}};
ltpitt / weatherwidget.html
Created May 21, 2021
Just a nifty weather widget
View weatherwidget.html
<div class="background">
<div class="container">
@import '';
@import '';
html, body, .background {
width: 100%;
height: 100%;
margin: 0;