Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Clifford Fajardo cliffordfajardo

🏠
Working from home
View GitHub Profile
@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
View github-proxy-client.js
/* 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 / css_grid_draggable.html
Created March 11, 2022 15:20 — forked from ismasan/css_grid_draggable.html
Example for reordering CSS grids layout
View css_grid_draggable.html
<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"
View Remix-request-cheatsheet.md

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 / typescript-migration.md
Last active December 5, 2022 15:15
typescript migration
View typescript-migration.md

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

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 / file1.1.txt
Last active August 16, 2019 22:44
new description
View file1.1.txt
file1content
new line
@cliffordfajardo
cliffordfajardo / deep-work-quotes.md
Last active February 15, 2022 18:08
Quotes from Cal Newport's Deep Work book
View deep-work-quotes.md

Deep Work Quotes

Deep Work Video


Introductory Quotes into the Topic of Deep Work:

  • “Deep Work: Professional activities performed in a state of distraction-free concentration that push your cognitive capabilities to their limit. These efforts create new value, improve your skill, and are hard to replicate.” (3)

    • Deep work is necessary to wring every last drop of value out of your current intellectual capacity. We now know from decades of research in both psychology and neuroscience that the state of mental strain that accompanies deep work is also necessary to improve your abilities.” (3)
  • “Shallow Work: Noncognitively demanding, logistical-style tasks, often performed while distracted. These efforts tend to not create much new value in the world and are easy to replicate.” (6)

@cliffordfajardo
cliffordfajardo / trello-md-code-highlight.js
Created July 29, 2017 20:31 — forked from AsyncWizard/trello-md-code-highlight.js
Trello markdown code syntax highlight.
View trello-md-code-highlight.js
// ==UserScript==
// @name Trello Syntax Highlight
// @namespace https://gist.github.com/AsyncWizard
// @version 0.1
// @description try to take over the world!
// @author AsyncWizard
// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js
// @resource https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/github.min.css
// @match https://trello.com/*
// @grant none
View vim_cheatsheet.md

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@cliffordfajardo
cliffordfajardo / string_search.js
Created March 16, 2016 20:25 — forked from amoilanen/string_search.js
Rabin-Karp Algorithm for Searching Strings Implemented in JavaScript
View string_search.js
function simpleSearch(text, str) {
var matches = [];
for (var i = 0; i <= text.length; i++) {
if (matchesAtIndex(i, text, str)) {
matches.push(i);
}
}
return matches;
}