Skip to content

Instantly share code, notes, and snippets.

View josefaidt's full-sized avatar
🦉

josef josefaidt

🦉
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active May 3, 2024 12:42
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@kamilogorek
kamilogorek / _screenshot.md
Last active May 2, 2024 13:48
Clutter-free VS Code Setup
image
@ixahmedxi
ixahmedxi / tsup.config.ts
Created December 2, 2023 13:38
tsup multi entrypoint
import fs from 'fs';
import path from 'path';
import { defineConfig } from 'tsup';
// INFO: This is the only place you need to update when adding new entry folders
const entryFolders = ['primitives', 'ui'];
function getAllFilesInDirectory(dirPath: string): string[] {
return fs.readdirSync(dirPath).reduce<string[]>((allFiles, file) => {
@brandonmcconnell
brandonmcconnell / getTimeSince.js
Last active July 26, 2022 04:11
getTimeSince - function for getting a human-readable value of the time since/between datetimes
const ordinalizeNumber = n => {
const rule = new Intl.PluralRules('en-US', { type: 'ordinal' }).select(n);
const suffix = ({
one: 'st',
two: 'nd',
few: 'rd',
other: 'th',
})[rule];
return `${n}${suffix}`;
}
@evankirkiles
evankirkiles / override.ts
Created March 7, 2022 06:09
Cognito User Pool Auth for AWS Amplify Function CFN Override
// This file is used to override the REST API resources configuration
import { AmplifyApiRestResourceStackTemplate } from "@aws-amplify/cli-extensibility-helper";
export function override(resources: AmplifyApiRestResourceStackTemplate) {
// Add our user pool id as a parameter so we can create authorizers with it
// Note that you have to replace <your auth name here> with the name of your auth!
// It's the name of the folder in amplify/backend/auth that was created when you
// added the auth to the project (NOT userPoolGroups). Also make sure you keep
// the preceding "auth" part of the string before the auth name, it's necessary.
resources.addCfnParameter(
This is an example with a simple TODO schema:
```graphql
type Todo @model {
id: ID!
name: String!
description: String
}
```

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@DavidWells
DavidWells / reset.css
Last active April 11, 2024 19:03 — forked from karbassi/reset.css
CSS reset. Follow me on the twitters for more tips: https://twitter.com/davidwells
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@robertkowalski
robertkowalski / npm-registry-licenses.txt
Created November 23, 2013 22:31
The licenses in the npm-registry from their package.json, from the latest version of each module 23.11.2013
The licenses in the npm-registry from their package.json, from the latest version of each module
23.11.2013
[ { key: 'undefined', value: 27785 },
{ key: 'MIT', value: 20811 },
{ key: 'BSD', value: 5240 },
{ key: 'BSD-2-Clause', value: 621 },
{ key: 'Apache 2.0', value: 263 },
{ key: 'GPL', value: 233 },
@awidegreen
awidegreen / vim_cheatsheet.md
Last active April 30, 2024 16:14
Vim shortcuts

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