Skip to content

Instantly share code, notes, and snippets.

View 0-vortex's full-sized avatar
:shipit:
looking out for #0

TED Vortex (Teodor-Eugen Duțulescu) 0-vortex

:shipit:
looking out for #0
View GitHub Profile
@Kartones
Kartones / postgres-cheatsheet.md
Last active June 13, 2024 20:14
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@vasanthk
vasanthk / System Design.md
Last active June 14, 2024 01:19
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@ericclemmons
ericclemmons / example.md
Last active April 24, 2024 18:09
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@jcouyang
jcouyang / README.org
Last active May 31, 2024 14:30
Promise All with Limit of Concurrent N

The Promise All Problem

in case of processing a very large array e.g. Promise.all(A_VERY_LARGE_ARRAY_OF_XHR_PROMISE)

which would probably blow you browser memory by trying to send all requests at the same time

solution is limit the concurrent of requests, and wrap promise in thunk

Promise.allConcurrent(2)([()=>fetch('BLAH1'), ()=>fetch('BLAH2'),...()=>fetch('BLAHN')])

@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@elliette
elliette / ManyToManyRelationships.md
Last active October 31, 2023 16:03
Describing `belongsToMany` and `hasMany` methods in Sequelize

Defining Many-to-Many Associations in Sequelize

Reference: Sequelize docs on association

Let’s say we have two models: Films and Festivals

We know that a film can be shown at many film festivals and that, conversely, a festival can show many films. This is what is known as a many-to-many relationship.

Knowing this, we can set up our associations:

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active June 15, 2024 12:13 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@FrankSpierings
FrankSpierings / ipa-resign.sh
Last active February 13, 2023 02:39
IPA Resigning (Frida Injection) Script (OSX)
#!/bin/bash
#
# Script requires `brew`
# - `/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
#
# Variables
# - $IPA -> Source IPA
# - $MOBILEPROVISION -> Source embedded.mobileprovision
# find ~/Library/Developer/Xcode | grep embedded.mobileprovision
const {generate} = require('escodegen')
const {parse} = require('acorn')
const fs = require('fs')
const walk = require('acorn/dist/walk')
const vm = require('vm')
const standard = require('standard')
function inline (call, decl) {
if (decl.body.body.length > 1) return
if (decl.body.body[0].type !== 'ReturnStatement') return