Skip to content

Instantly share code, notes, and snippets.

View beelarr's full-sized avatar
🍩

Bryon Larrance beelarr

🍩
  • Software Development Consultant (React, Typescript, GraphQL, Next.js, CMS integration, Segment - GTM, Leanplum, Pixel Integration, Design Systems)
  • Remote
  • LinkedIn in/beelarr
View GitHub Profile
@beelarr
beelarr / System Design.md
Created February 22, 2023 19:18 — forked from vasanthk/System Design.md
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?
@beelarr
beelarr / gist:5df417632b0b24392624a80c14bdeb95
Created September 21, 2022 13:25
Sort based on array of sorted values
const ORDERED_LIST = ['firstSortItem', 'secondSortItem', 'thirdSortItem']
const sorted = [...itemsToSort];
sorted.sort(
(a, b) =>
ORDERED_LIST.findIndex(
(orderedAttribute) => orderedAttribute === a.orderedAttribute,
) -
ORDERED_LIST.findIndex(
if (Math.random() < 0.5) throw Error('BOOM');

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@beelarr
beelarr / Simple Pagination
Created November 30, 2020 20:50
A simple JS pagination example.
export const pagination = ({data = [], pageSize = 5}) => {
const page = data.slice(0, pageSize)
const otherPages =
data.slice(pageSize).length > pageSize
? pagination(data.slice(pageSize))
: [data.slice(pageSize)]
return [page, ...otherPages]
}
// Modified from @mutsuda's https://medium.com/@mutsuda/create-an-ios-widget-showing-google-spreadsheets-data-856767a9447e
// by @levelsio
// HOW TO
// 1) Make a Google Sheet, we'll pull the first cell e.g. A1
// 2) Publish your Google Sheet, File -> Publish To Web
// 3) Copy the SHEET_ID in the URL, put it in here below:
const endpoint = "https://spreadsheets.google.com/feeds/cells/SHEET_ID/1/public/full?alt=json"
// 4) Install Scriptable @ https://apps.apple.com/us/app/scriptable/id1405459188
// 5) Copy this entire script in to Scriptable (tip: you can send it to your iPhone via Whatsapp/Messenger/Telegram etc)
// Modified from @mutsuda's https://medium.com/@mutsuda/create-an-ios-widget-showing-google-spreadsheets-data-856767a9447e
// by @levelsio
// HOW TO
// 1) Make a Google Sheet, we'll pull the first cell e.g. A1
// 2) Publish your Google Sheet, File -> Publish To Web
// 3) Copy the SHEET_ID in the URL, put it in here below:
const endpoint = "https://spreadsheets.google.com/feeds/cells/SHEET_ID/1/public/full?alt=json"
// 4) Install Scriptable @ https://apps.apple.com/us/app/scriptable/id1405459188
// 5) Copy this entire script in to Scriptable (tip: you can send it to your iPhone via Whatsapp/Messenger/Telegram etc)
https://ui.dev/imperative-vs-declarative-programming/
"Before we dive into the code, it’s important to realize that many declarative approaches have some sort of imperative abstraction layer."
Declarative programming is “the act of programming in languages that conform to the mental model of the developer rather than the operational model of the machine.”

Keybase proof

I hereby claim:

  • I am beelarr on github.
  • I am beelarr (https://keybase.io/beelarr) on keybase.
  • I have a public key ASA2qPqJzkpCaUW-t9NyA0RGFO_ZhnytKFfm2hnwupeZpgo

To claim this, I am signing this object:

Keyboard Shortcuts - use function keys.
Loom
Rectangle
Dropbox
1Password || Bitwarden
Webstorm
Postico