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
@cliffordfajardo
cliffordfajardo / toc.md
Last active October 5, 2019 05:45
Fundamentals to Functional JavaScript, v3

Fundamentals to Functional JavaScript, v3

Day 1: Data Structures

Topics: Access, Assignment, Transformations & Organization

9:15 Data Structures: Accessing + Assignment

  • Lecture/Slides:
  • Exercise:
  • _.get()
@cliffordfajardo
cliffordfajardo / typescript-migration.md
Last active December 5, 2022 15:15
typescript migration

Credits to Mike North Sr.Staff Engineer from LinkedIn’s UI Infra team for the inspiration for the stuff below 🙏

What not to do

  • functional changes at the same time
  • attempt this with low test coverage
  • publish your types for consumers while they’re in a weak state

Compiling in lose mode:

  • allow implicit any in your tsconfig # TODO show a breif code snippet example of value to change in tsconfig.
  • start with tests passing

Remix request cheatsheet

Navigates? declarative? Makes GET, triggers loader Makes POST, triggers action No requests
navigates declarative <Link to="">
<Form method="get">
<Form method="post"> <Link to="#...">
navigates imperative navigate()
setSearchParams()
submit() navigate("#")
stays declarative <fetcher.Form method="get"> <fetcher.Form method="post"> (doesn't make sense)
stays imperative fetcher.load() fetcher.submit() (doesn't make sense)

where

@cliffordfajardo
cliffordfajardo / css_grid_draggable.html
Created March 11, 2022 15:20 — forked from ismasan/css_grid_draggable.html
Example for reordering CSS grids layout
<html>
<head>
<title>grid</title>
<style>
body {padding: 0; margin: 0;}
.container {
display: grid;
grid-template-rows: 200px repeat(4, 100px);
grid-template-columns: repeat(4, 1fr);
grid-template-areas: "header header header header"
@cliffordfajardo
cliffordfajardo / github-proxy-client.js
Created March 18, 2022 20:59 — forked from DavidWells/github-proxy-client.js
Full Github REST api in 34 lines of code
/* Ultra lightweight Github REST Client */
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const token = 'github-token-here'
const githubClient = generateAPI('https://api.github.com', {
headers: {
'User-Agent': 'xyz',
'Authorization': `bearer ${token}`
}
})
@cliffordfajardo
cliffordfajardo / fetch-server.d.ts
Created August 23, 2023 18:29 — forked from jacob-ebey/fetch-server.d.ts
Node Fetch Server
import type { Server } from "node:http";
export type Handler = (request: Request) => Response | Promise<Response>;
export type CreateServerOptions = {
onError?: (error: unknown) => void;
};
export declare function createServer(
handler: Handler,
@cliffordfajardo
cliffordfajardo / normcore-llm.md
Created August 25, 2023 15:41 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads