Skip to content

Instantly share code, notes, and snippets.

View pauliusef's full-sized avatar

Paulius Friedt pauliusef

View GitHub Profile
@pesterhazy
pesterhazy / tech-interviews.md
Last active June 1, 2024 19:43
Interviewing for Jobs in Tech: a Reading List

Behavioral questions (aka "Tell me about a time when...")

@pesterhazy
pesterhazy / mit-kindern-in-berlin.md
Last active June 1, 2024 19:37
Mit kleinen Kindern in Berlin / Berlin with kids
@pesterhazy
pesterhazy / building-sync-systems.md
Last active June 6, 2024 08:53
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@mjackson
mjackson / redirects-in-react-router-v6.md
Last active November 12, 2023 07:32
Notes on handling redirects in React Router v6, including a detailed explanation of how this improves on what we used to do in v4/5

Redirects in React Router v6

An important part of "routing" is handling redirects. Redirects usually happen when you want to preserve an old link and send all the traffic bound for that destination to some new URL so you don't end up with broken links.

The way we recommend handling redirects has changed in React Router v6. This document explains why.

Background

In React Router v4/5 (they have the same API, you can read about why we had to bump the major version here) we had a <Redirect> component that you could use to tell the router when to automatically redirect to another URL. You might have used it like this:

@heyitsaamir
heyitsaamir / withCurrentSelection.ts
Created May 23, 2020 18:11
Simple HOC to maintain current selection of the editor (slatejs)
import React, { useContext, useRef } from 'react';
import { isEqual } from 'lodash';
import { Range } from 'slate';
import { ReactEditor, useSlate } from 'slate-react';
export const CurrentSelectionContext = React.createContext<{
current: Range | null;
}>({ current: null });
@mattdesl
mattdesl / ComplexSketch.svelte
Last active October 3, 2021 21:32
svelte musings
<script>
import delaunay from 'delaunay-triangulate';
import { Slider, Color } from 'texel/ui';
// This will get passed in with the P5 instance
export let p5;
// Size of the canvas in pixels
export let width = 256;
export let height = 256;
@yogthos
yogthos / clojure-beginner.md
Last active June 4, 2024 08:52
Clojure beginner resources

Introductory resources

const sanityClient = require('@sanity/client');
const crypto = require('crypto');
const {
SANITY_API_TOKEN,
SANITY_PROJECT_ID,
SANITY_DATASET,
SHOPIFY_SECRET
} = process.env;
@kelset
kelset / build-time-improvements.md
Last active June 21, 2023 19:25
This is kind of a blogpost about my experience of diving deep to improve some timings for an iOS React Native app

Improving times for both iOS build and CI for a React Native app

Intro

Hello there.

So, if you are here you probably saw my previous tweet where I asked for tips & tricks on improving the timing on an iOS/React Native app build time.

What will follow was how I mixed those suggestions + some good old GoogleSearch-fu + me deep diving on this for ~2 days.

@dsherret
dsherret / find-unused-exports.ts
Last active December 22, 2023 00:03
Searches files for any exported declarations that aren't used in other files.
// this could be improved... (ex. ignore interfaces/type aliases that describe a parameter type in the same file)
import { Project, TypeGuards, Node } from "ts-morph";
const project = new Project({ tsConfigFilePath: "tsconfig.json" });
for (const file of project.getSourceFiles()) {
file.forEachChild(child => {
if (TypeGuards.isVariableStatement(child)) {
if (isExported(child))
child.getDeclarations().forEach(checkNode);