Skip to content

Instantly share code, notes, and snippets.

View aziis98's full-sized avatar

Antonio De Lucreziis aziis98

View GitHub Profile
@aziis98
aziis98 / sync.md
Last active January 26, 2022 12:56
Syncronization Primitives Equivalence
@aziis98
aziis98 / !launch.md
Last active January 19, 2022 04:56
Launch commands in new detached tmux sessions.

Tmux launcher

Launch commands in a new detached tmux session. This needs tmux and sqlite3 to be installed, see launch --help for usage.

Sqlite is used for storing the command history in ~/.cache/aziis98.scripts.launch/history.db that can be run with launch past <SESSION_NAME>.

Info

@aziis98
aziis98 / !symlink-manager.md
Last active January 19, 2022 04:47
Script to automatically symlink all scripts to the correct directories with the TARGET_PATH directive.

My Scripts

Some of my scripts (bashrc, ...)

  • bashrc
  • ...

Esercizio

Option<T> := None | Some T
List<T> := Nil | Append List<T> T
Tree<T> := Leaf T | Branch List<Tree<T>>

Si possono anche assumere funzioni comode come get :: (List<T>, Int) -> T

const apiResponse1 = {
post: "Questa è la domanda di questo thread",
votes: 1,
timestamp: "un po' di fantasia",
children: [
{
content: "Questa è la prima riposta",
votes: 1,
timestamp: "un po' di fantasia",
children: []
@aziis98
aziis98 / !README.md
Created May 2, 2021 00:15
Small snippet of JS to generate some random looking text instead of using lorem ipsum.

Random-Looking Text

Small snippet of JS to generate some random looking text instead of using lorem ipsum.

Usage

In HTML put some <span class="random-text"></span>

@aziis98
aziis98 / embed-eval-component.js
Created April 20, 2021 14:15
A Javascript function to embed an HTML component inside a scirpt tag that also loads all necessary JS in the right order
const TICK = '`';
const componentEmbedTemplate = ({ uid, code }) => `
<div class="embed">
<script id="embed-${uid}">
(async function() {
const $self = document.getElementById('embed-${uid}');
const $embedContainer = document.createElement('div');
$embedContainer.classList.add('container');
const $shadow = $embedContainer.attachShadow({ mode: 'open' });
@aziis98
aziis98 / !notifica-esami.md
Last active September 18, 2020 14:36
Controlla un sito per degli aggiornamenti

notifica-esami

Telgram

  • Crea un bot
  • Invia un messaggio al nuovo bot
  • Questo comando richiede gli ultimi messaggi da processare del Bot e permette di estrarre l'ID dell'utente.
    curl -s https://api.telegram.org/bot$BOT_TOKEN/getUpdates | jq .result[].message.chat.id
    
@aziis98
aziis98 / !README.md
Last active November 20, 2021 13:42
Stylus Theme - If Donald Knuth had designed Wikipedia