Skip to content

Instantly share code, notes, and snippets.

View joaomilho's full-sized avatar
🐫

Yo Lulkin joaomilho

🐫
  • Personio.de
  • Berlin, Germany
View GitHub Profile
@joaomilho
joaomilho / gcal-keywoards.txt
Created October 10, 2021 23:02
gcal keywords
americanfootball: American Football, Football, Super Bowl, Superbowl
archery: archery
art: art workshop, art workshops, drawing workshop, painting, sketching workshop
artisticgymnastics: artistic gymnastics
athleticsjumping: Jumping
athleticsthrowing: discus, hammer throw, javelin, shot put
babyshower: baby shower, babyshower, maternity
backtoschool: back 2 school, back to school, back2school, backtoschool, first day of school, first school day
badminton: badminton
baseball: baseball
@joaomilho
joaomilho / upload.ts
Last active December 6, 2020 00:29
Type safe event handlers
type Events = {
start: [];
progress: [number];
complete: [string, boolean];
};
class Uploader {
listeners: {
[key in keyof Events]: ((...params: Events[key]) => void)[];
};
@joaomilho
joaomilho / peano.ts
Created November 3, 2020 16:43
Fully typed arithmetics with TypeScript 😨
type Nat = ["S", Nat] | ["Z"];
type Succ<N extends Nat> = ["S", N]
type S<N extends Nat> = Succ<N>
type Prev<N extends Nat> = N[1]
type Z = ["Z"]
type Zero = Z
type One = S<Z>
type Two = S<S<Z>>
@joaomilho
joaomilho / log.ts
Last active September 17, 2022 06:41
A printf with dependant types in TypeScript, similar to Idris (https://gist.github.com/chrisdone/672efcd784528b7d0b7e17ad9c115292)
type FieldType<Field> =
's' extends Field ? string :
'f' extends Field ? number :
'i' extends Field ? number :
'd' extends Field ? number :
'o' extends Field ? HTMLElement :
'O' extends Field ? object :
'c' extends Field ? string :
never;

burp guide

  1. Install https://portswigger.net/burp/communitydownload;

  2. Browser:

  • Chrome The Chrome browser picks up the HTTP proxy settings configured on the host computer. If you are using Chrome, you can open your computer's built-in browser and follow the instructions for configuring that. If you aren't sure where the built-in proxy settings are, open Chrome, go to the Customize menu, select Settings, click on "Show advanced settings",

foo bar baz

@joaomilho
joaomilho / counter.js
Created February 26, 2017 13:58
Act's <1.0 counter
const view = (count) =>
['p', [
['h1', count],
['button', {click: {add: 1}}, '+'],
['button', {click: {add: -1}}, '-']
]]
const reducer = (state, {type, payload}) =>
type === 'add' ? state + payload : state
@joaomilho
joaomilho / boot.day.zip.sh
Last active August 1, 2016 08:51
day.zip boot script
cd /home/pi/ && git clone https://github.com/klarna/day.zip.git && cd day.zip && bash boot.sh
Juan was just a regular kid until one day he bet his soul with the devil and lost. Then, he suddenly learned to play blues and started working with software development making fortunes with the dotcom bubble. He mastered many open source technologies while studying physics, where he couldn't find any evidence for, and philosophy, where he couldn't find any good argument for the existence of souls. Given an approaching deadline set by the dark lord, he decided to move to Israel and learn Hebrew, in order to read God's words and to seek atonement for his sins. Nowadays he works at Klarna Tel Aviv mainly with React and other front end technologies, since he couldn't find anything more self flagellating to do.
const load = equals('load')
const unload = complement(load)
const loading = set(lensProp('loading'))
const loadReducer = guard([
[load, loading(true)],
[unload, loading(false)] // runs for all actions except `'load'`
])