Skip to content

Instantly share code, notes, and snippets.

View tjallingt's full-sized avatar
🕊️
Dancing is for people who are free

tjallingt tjallingt

🕊️
Dancing is for people who are free
View GitHub Profile
@Ocramius
Ocramius / git-flow_vs_github-flow.md
Created October 7, 2022 08:38
Git-flow vs GitHub-flow

Git-flow vs GitHub-flow

What we want

A list of requirements:

  • stakeholders expect a list of provided features, every few days, in a human-friendly report
  • every change must have been reviewed, before being deployed
  • every change must have passed our automated checks, before being deployed
  • every change must have been verified by QA staff, before being deployed
@enjoy-digital
enjoy-digital / arty.py
Last active January 27, 2022 22:37
LiteEth Interboard demo between Arty and Butterstick
#!/usr/bin/env python3
# LiteEth UDP Inter-board stream demo.
#
# Copyright (c) 2022 Florent Kermarrec <florent@enjoy-digital.fr>
# SPDX-License-Identifier: BSD-2-Clause
# ./arty.py --build --load
import os
@jaredpalmer
jaredpalmer / oauth-device-flow.md
Last active September 1, 2021 09:35
OAuth 2.0 Device Flow

OAuth Device Flow

This is flow used by apps on Apple TV / Roku. However, it is also useful for CLIs.

Here is my rundown. Please correct me in comments if something is wrong or if there is a better way to do this.


Device pings the server to begin activation process

@ggoodman
ggoodman / README.md
Created February 25, 2021 15:14
Using the concept of defer from golang to simplify resource cleanup in Javascript

The withCleanup helper

Example

const result = await withCleanup(async (defer) => {
  const fileHandle = await getFileHandle();
  defer(() => fileHandle.close());
   
 // Carry on
import { crc32 } from 'common/components/Features/Experiment/crc32';
import { Config } from 'common/api/models/Config';
const sortBy = require('lodash.sortby');
export interface Experiments {
[name: string]: Variant[];
}
export interface Variant {
name: string;

assert() (sometimes called invariant())

Instead of checks like:

if (value === null) {
  throw new Error("missing value")
}
doSomethingThatNeedsValue(value)
@tannerlinsley
tannerlinsley / README.md
Last active April 12, 2024 17:04
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

@davidkpiano
davidkpiano / ts-0-60.ts
Last active January 22, 2021 04:55
TypeScript from 0 to 60
// No TypeScript
function add(a, b) {
return a + b;
}
// Type function arguments
// vvvvvv vvvvvv
function add(a: number, b: number) {
return a + b;
}
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
const {useCallback, useEffect, useReducer, useRef} = require('react');
let effectCapture = null;
exports.useReducerWithEmitEffect = function(reducer, initialArg, init) {
let updateCounter = useRef(0);
let wrappedReducer = useCallback(function(oldWrappedState, action) {
effectCapture = [];
try {
let newState = reducer(oldWrappedState.state, action.action);