Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
find me on twitter: @tcodes0

Thom Ribeiro tcodes0

💭
find me on twitter: @tcodes0
View GitHub Profile
@tcodes0
tcodes0 / machine.js
Last active May 11, 2021
forms machine
View machine.js
const someMachine = Machine({
id: 'form-status',
initial: 'prefill',
states: {
prefill: {
on: {
SEND: 'sent',
SUBMIT: 'completed',
},
},
@tcodes0
tcodes0 / linkedin-reject-ptbr.txt
Created Apr 9, 2021
como rejeitar recruiters
View linkedin-reject-ptbr.txt
Oi <Nome da pessoa>,
Obrigado por entrar em contato 😊
Então, atualmente trabalho com <sua empresa>
<pq sua empresa eh boa>
O trabalho é totalmente remoto e flexível, apenas <fuso> hora de diferença de fuso horário comigo.
Trabalho em uma equipe <pq sua equipe eh boa>
Gosto muito da minha equipe e dos produtos nos quais trabalhamos.
Consigo ter um bom equilíbrio entre a vida pessoal e profissional, nunca trabalho nos fins de semana e sem horas extras.
View rates.gist.sh
node -e 'var rates = new Array(130).fill(0).map((x, i) => (i+4) * 5000).map( year => ({ year, hour: (year/1920.1755589082431).toFixed(0), month: (year/12).toFixed(0) })); console.log(rates)''
@tcodes0
tcodes0 / mac-apfs-terminal-clone.md
Last active Nov 16, 2020
how to clone apfs volumes and make bootable
View mac-apfs-terminal-clone.md
View ppi-calc
var TO_MILIMETER = 25.4
function calc_dpi (widthPixels: number, heightPixels: number, diagonal: float) {
var x = width
var y = height
var ratio = y/x;
var xd = Math.sqrt( Math.pow(diagonal,2) / ( 1 + Math.pow(ratio, 2) ));
var yd = xd * ratio;
var pitch = TO_MILIMETER/(x/xd);
var result = {
displayDiagonalCentimeters : diagonal * 2.54,
View machine.js
const newNoteMachine = Machine({
id: 'newNoteMachine',
type: 'parallel',
context: { id: null },
states: {
userPrompt: {
initial: 'prompting',
states: {
prompting: { on: { INPUT: { target: 'working' } }, invoke: { src: 'userPrompt_prompting' } },
working: {
@tcodes0
tcodes0 / machine.js
Last active Jan 19, 2021
state machine
View machine.js
const someMachine = Machine({
id: "actionPlan",
initial: "view",
type: "parallel",
context: {
goals: [],
canEditCarePlan: false,
canEditActionPlan: false,
draftGoal: {},
},
View c4p-draft.md

Assunto: Palestrante 2020

Raphael "Tom" Thomazella

Florianópolis - Santa Catarina

Fullstack Javascript Engineer - Freelancer

Tema: State Machines (24 👍 nos temas 2020)

@tcodes0
tcodes0 / owasp-notes.md
Last active Jul 17, 2020
security notes
View owasp-notes.md

SQL injection, injection in general

happens when user provided data is poorly or not validated at all. happens when the client is manipulated to send unexpected params to the backend. backend must avoid at all cost to use data in db requests or other operations if needed, data should be filtered and validated on the server side, better yet parametrized, or at the bare minimum, escaped properly

headers and env vars are possible vectors of attack