Skip to content

Instantly share code, notes, and snippets.

View mattkrick's full-sized avatar

Matt Krick mattkrick

View GitHub Profile
@mattkrick
mattkrick / tsconfig.json
Created November 9, 2023 18:33
Default tsconfig.json
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
@mattkrick
mattkrick / dspToTailwind.js
Created November 16, 2022 04:19
Convert Material Theme Tokens (DSP) to a Tailwinds color file
const dspToTailwind = (dsp) => {
const colors = dsp.entities.filter((e) => e.type === 'color')
const obj = {}
colors.forEach((c) => {
const isSys = c.id.startsWith('md.sys')
if (isSys) {
const [name, theme] = c.id.slice(13).split('.')
const camelName = name
.toLowerCase()
.replace(/[-_][a-z]/g, (group) => group.slice(-1).toUpperCase())
sequenceDiagram
participant Matt
participant Cashier 1
participant Kitchen
participant Barista
Matt->>Cashier 1: Can I have a latte? My name is Matt
Cashier 1->>Kitchen: Make Matt a latte
Kitchen->>Barista: Make Matt a latte
Barista->>Cashier 1: Latte for Matt
Cashier 1->>Matt: Here's your latte, Matt
@mattkrick
mattkrick / hotSwap.ts
Last active March 31, 2022 18:19
Smart code, might reuse later
// This is a way to emulate webpack's HMR but it actually works more reliably, but doesn't work with a single output
import fs from 'fs'
import util from 'util'
const readFile = util.promisify(fs.readFile)
const writeFile = util.promisify(fs.writeFile)
const isReady = (watcher) => {
return new Promise((resolve) => {
watcher.on('ready', resolve)
@mattkrick
mattkrick / 1.graphql
Created August 27, 2021 18:48
Upgrade to Relay Hooks
{
content @__clientField(handle: "contentText")
contentText
}
@mattkrick
mattkrick / 1.graphql
Last active May 5, 2021 19:35
nest-github-schema
# Application Schema
{
viewer {
name
githubApi {
# GitHub Schema
query {
viewer {
bio
}
@mattkrick
mattkrick / parseBody.ts
Created February 23, 2021 17:46
parseBody Challenge
type Json = null | boolean | number | string | Json[] | {[key: string]: Json}
const defaultParser = <T>(buffer: Buffer): T => JSON.parse(buffer.toString())
const parseBody = <T = Json>({
res,
parser = defaultParser
}: {
res: HttpResponse
parser?: (buffer: Buffer) => T
}) => {
Update to newest OS
Copy over ~/.ssh, .gitconfig, .bashrc, .gnupg from old computer (webstorm doesn't support forced ssh for openssh keys!)
chmod 600 ~/.ssh/id_rsa
chown -R $(whoami) ~/.gnupg/
find ~/.gnupg -type f -exec chmod 600 {} \;
find ~/.gnupg -type d -exec chmod 700 {} \;
ssh-add
Install Chrome, Firefox, VSCode
Install docker
Install qbittorrent
TERSER
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
AgendaAndTasksRoot_1baade6d2fcf4b102c87.js (257 KiB)
DashboardWrapper_018af80128e05855c610.js (505 KiB)
DemoMeeting_92f365e48a456524bd59.js (1.1 MiB)
MeetingRoot_dc596ff3db9ff7239eee.js (1.03 MiB)
RetroRoot_f5f44240a44e41d8d2fb.js (1.1 MiB)
vendors~GraphqlContainer_961b6996164fa5de3cc1.js (643 KiB)
@mattkrick
mattkrick / gist:d294c6cf3127203e9c75c4d9c907e6a1
Last active January 20, 2019 15:07
Deep learning theories to test
1. "Study" an image by doing multiple passes on it before moving on. This should cause overfitting since we're changing the entire model for just 1 example.
2. "Grow up" greatly simplify the images in earlier epochs & then grown more detailed. images start out as being black & white blobs, then get color & sharpness
3. "myelinate" the first layer of a convnet by removing it & going straight to the 2nd layer. maybe this could reduce inference time?
4. "symmetricize" simple features like 45 deg angles by manually replacing the generated feature map with a human-perfected one. this should reduce noise & possible error in later layers