Skip to content

Instantly share code, notes, and snippets.

@AlessandroMinali
AlessandroMinali / setup.txt
Created October 21, 2023 02:10
What to install on new laptop (macosx)
lulu helper
ad guard safari
bitbar
db browser for sqlite
discord
rectangle(export the settings)
sublime text
userscripts(export the settings)
whatsapp
@AlessandroMinali
AlessandroMinali / license_plate.md
Last active October 21, 2023 02:08
Interview Question Sample - I/O, DB, Data Structs, Algorithms

You are tasked with writing the code that generates license plates for the province of Ontario.
You can use any language and tools you are comfortable with to accomplish the task.

Here are some examples of valid plate numbers:

skfz 597
lxgq 621
lxna 211
uixq 289
boiq 999
export BASH_SILENCE_DEPRECATION_WARNING=1
alias p='ping google.ca'
alias lofi="mpv https://www.youtube.com/watch?v=jfKfPfyJRdk --no-video --no-terminal &"
play(){
trap 'murder' 1 3 9 # cleanup when terminal closes
SAVEIFS=$IFS
IFS=$'\n' # allow for filenames with spaces
music=$(find ~/Downloads/music ~/Desktop/All\ Song/ -name "*.mp3" | shuf) # shuffle music files
@AlessandroMinali
AlessandroMinali / sun.c
Last active March 21, 2023 20:24
Calculate Sun Rise and Set times based. Takes two args: <lat> <lon>
// reference: https://en.wikipedia.org/wiki/Sunrise_equation#Complete_calculation_on_Earth
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
double rad(double deg) {
// PI / 180
return deg * 0.017453292519943295;
}
@AlessandroMinali
AlessandroMinali / bets.txt
Created July 31, 2022 19:37
bets by 2050
BY 2050
- Nigeria will enter into armed conflict with a neighbouring state
- Taiwan will be under mainland China’s governance
- China will be the global leader in the manufacture of semiconductors
- China will be the global leader in the manufacture of biodiesels
- Global population will surpass UN estimate of 9.73 billion
@AlessandroMinali
AlessandroMinali / helpx.rb
Created July 4, 2020 18:20
Quickly scan all of helpx for jobs.
require 'capybara/poltergeist'
session = Capybara::Session.new(:poltergeist)
puts "Search for: "
input = gets.chomp
[1,2,3,4,5,9].each do |i|
session.visit(
"https://www.helpx.net/hostlist.asp?search=#{input}&network=#{i}"
)
#!/bin/sh
echo "Time to FIX IT"
git reset HEAD~1 --soft
git commit --amend --no-edit
@AlessandroMinali
AlessandroMinali / git-reap
Created April 20, 2017 13:47
Reap all branches on project
#!/bin/sh
echo "I'm the grim bloody reaper"
git checkout master
git branch | grep -v "master" | xargs git branch -D
git pull
@AlessandroMinali
AlessandroMinali / berenstein.rb
Created October 26, 2016 15:32
The one true parallel universe.
# inspired by https://gist.github.com/techiferous/235068
require 'nokogiri'
module Rack
class Berenstein
def initialize(app, options = {})
@app = app
@options = options
end