Skip to content

Instantly share code, notes, and snippets.

View reconbot's full-sized avatar
🏴‍☠️
Building at @github

Francis Gulotta reconbot

🏴‍☠️
Building at @github
View GitHub Profile
[package]
name = "hackerchat-rust"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0.69"
async-channel = "1.8.0"
package main
import (
"bufio"
"encoding/json"
"fmt"
"net"
"os"
"sync"
"time"

Database Workflows

  • local development workflow
    • ensure there's a dev branch that matches the machine ID and force schema, truncate tables, load dev data, write branch name/access keys to envs
    • ensure there's a test branch that matches the machine ID and force schema, truncate tables, write branch name/access keys to envs
  • github branch workflow
    • ensure there's a test branch that matches 'github', branch_name, and force schema, truncate data, write branch name/access keys to envs
  • deployment workflows
    • deploying to staging, create a branch off of staging if schema changed, force schema, try to merge, block code deploy if you can't merge
  • deploying to production, create a branch off of production if schema changed, force schema, try to merge, block code deploy if you can't merge
export interface SpacePacketHeader {
versionNumber: string | number
identification: {
apid: number
secondaryHeader: number
type: number
}
sequenceControl: {
packetName: number
sequenceFlags: number
@reconbot
reconbot / my-git.zsh
Created November 4, 2021 04:06
My git shortcuts
alias gb='gh pr view -w'
alias gp='git push origin HEAD'
alias gpf='git push --force-with-lease origin HEAD'
alias gpfo='git push --force-with-lease origin HEAD && gb'
alias gpo='git push origin HEAD && gb'
alias gcm='git checkout $(git_detect_main_branch)'
alias gcmp='git checkout $(git_detect_main_branch) && git pull origin $(git_detect_main_branch) --ff-only'
alias grom='git fetch && git rebase --autostash origin/$(git_detect_main_branch)'
function git_detect_main_branch() {
@reconbot
reconbot / test.js
Created June 21, 2021 03:25
How to use import to import an ems module form a cjs file
const slugifyP = import('@sindresorhus/slugify')
slugifyP.then(slugify => console.log(slugify.default('I ♥ Dogs')))
@reconbot
reconbot / build.ts
Created June 14, 2021 01:39
Build and watch commands for esbuild and architect https://arc.codes
import { buildFunctions, findFunctions } from './lib-build'
async function run() {
const funcs = await findFunctions()
await buildFunctions(funcs)
}
run()
@reconbot
reconbot / AsyncFunctionReturn.ts
Last active April 4, 2021 01:05
This type will unwrap an async function and give you the type of the returned promise
type AsyncFuncReturn<T> = T extends (...args: any[]) => Promise<infer U> ? U : never
// eg
const randomFunction = async () => ({ a: 4, b: "string" })
type RandomReturn = AsyncFuncReturn<typeof randomFunction>
const foo: RandomReturn = await randomFunction()

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

Hi

digraph finite_state_machine {
	rankdir=LR;
	size="8,5"
	node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
	node [shape = circle];
      
	LR_0 -&gt; LR_2 [ label = "SS(B)" ];