Skip to content

Instantly share code, notes, and snippets.

View cliffordfajardo's full-sized avatar
🏠
Working from home

Clifford Fajardo cliffordfajardo

🏠
Working from home
View GitHub Profile
@kiliman
kiliman / ts2js.sh
Last active October 11, 2023 00:43
Script to convert TypeScript files to JavaScript
#!/bin/bash
# Check if the correct number of arguments is provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 source_folder target_folder"
exit 1
fi
source_folder="$1"
target_folder="$2"
@veekaybee
veekaybee / normcore-llm.md
Last active April 23, 2024 16:03
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@chaance
chaance / use-transition.ts
Last active January 10, 2023 02:00
Convert `useNavigation` to `useTransition`
import * as React from "react";
import { useNavigation, type Navigation } from "@remix-run/react";
export function useTransition(): Transition {
let navigation = useNavigation();
return React.useMemo(
() => convertNavigationToTransition(navigation),
[navigation]
);

History

For a long time I've been really impacted by the ease of use Cassandra and CockroachDB bring to operating a data store at scale. While these systems have very different tradeoffs what they have in common is how easy it is to deploy and operate a cluster. I have experience with them with cluster sizes in the dozens, hundreds, or even thousands of nodes and in comparison to some other clustered technologies they get you far pretty fast. They have sane defaults that provide scale and high availability to people that wouldn't always understand how to achieve it with more complex systems. People can get pretty far before they have to become experts. When you start needing more extreme usage you will need to become an expert of the system just like any other piece of infrastructure. But what I really love about these systems is it makes geo-aware data placement, GDPR concerns potentially simplified and data replication and movement a breeze most of the time.

Several years ago the great [Andy Gross](ht

@na2hiro
na2hiro / Remix-request-cheatsheet.md
Last active March 18, 2024 02:42
Remix request cheatsheet
import { multiSortBy } from 'src/shared/utils'
export type PathNode<T> = {
id: string
path: string
parentId: string
meta: T
children?: PathNode<T>[]
}
@tannerlinsley
tannerlinsley / useBroadcastLeader.ts
Created June 4, 2021 14:37
A React Hook to determine if a tab of your application is the "leader" using BroadcastChannel and leader election
import { BroadcastChannel, createLeaderElection } from 'broadcast-channel'
import React from 'react'
const channels = {}
export function useBroadcastLeader(id = 'default') {
const [isBroadcastLeader, setIsBroadcastLeader] = React.useState(false)
React.useEffect(() => {
if (!channels[id]) {

About variadics in Rust

This is an analysis of how variadic generics could be added to Rust. It's not a proposal so much as a summary of existing work, and a toolbox for creating an eventual proposal.

Introduction

Variadic generics (aka variadic templates, or variadic tuples), are an often-requested feature that would enable traits, functions and data structures to be generic over a variable number of types.

To give a quick example, a Rust function with variadic generics might look like this:

@jsgoller1
jsgoller1 / interviews.md
Last active April 2, 2023 12:17
How to Slay Programming Interviews

How to slay programming interviews

This gist is currently under re-development after my most recent round of interview prep and will be re-posted with major edits soon.

@sharplet
sharplet / AnyEventPublisher.swift
Last active February 17, 2024 02:18
PublisherQueue — Serialise the execution of multiple publishers like OperationQueue
import Combine
public enum AnyError: Error {
case never(Never)
case failure(Error)
}
public enum AnyEvent {
case output(Any)
case completion(Subscribers.Completion<AnyError>)