Skip to content

Instantly share code, notes, and snippets.

View sebvilhelm's full-sized avatar

Sebastian Vilhelm Juhl sebvilhelm

  • Copenhagen, Denmark
  • 18:04 (UTC +02:00)
View GitHub Profile
@fabiospampinato
fabiospampinato / fast_css_reset.css
Last active July 18, 2023 18:07
The fastest CSS reset possible
:where(abbr), :where(address), :where(area), :where(article), :where(aside), :where(audio), :where(b), :where(base), :where(bdi), :where(bdo), :where(big), :where(blockquote), :where(body), :where(br), :where(caption), :where(cite), :where(code), :where(col), :where(colgroup), :where(data), :where(datalist), :where(dd), :where(del), :where(details), :where(dfn), :where(dialog), :where(dl), :where(dt), :where(em), :where(embed), :where(fieldset), :where(figcaption), :where(figure), :where(footer), :where(form), :where(h1), :where(h2), :where(h3), :where(h4), :where(h5), :where(h6), :where(head), :where(header), :where(hgroup), :where(hr), :where(i), :where(input), :where(ins), :where(kbd), :where(keygen), :where(label), :where(legend), :where(li), :where(link), :where(main), :where(map), :where(mark), :where(menu), :where(menuitem), :where(meta), :where(meter), :where(nav), :where(object), :where(ol), :where(optgroup), :where(option), :where(output), :where(param), :where(picture), :where(pre), :where(progress

Bump all npm outdated dependencies

npm install $(npm outdated --json | jq -r 'to_entries | map("\(.key)@^\(.value.latest)") | join(" ")')
npm run typecheck
#!/usr/bin/env node
const fs = require("fs/promises")
const globby = require("globby")
const makeDir = require("make-dir")
const path = require("path")
const svgo = require("svgo")
const REPO_ROOT = path.join(__dirname, "..")
async function main() {
import React from "react";
import { Link } from "react-router-dom";
export function createResource(getPromise) {
let cache = {};
let inflight = {};
let errors = {};
function load(key) {
inflight[key] = getPromise(key)
@alisdair
alisdair / intensify.sh
Created May 21, 2019 23:44
intensifies Slack emoji creator
#!/bin/bash
# Generate a `:something-intensifies:` Slack emoji, given a reasonable image
# input. I recommend grabbing an emoji from https://emojipedia.org/
set -euo pipefail
# Number of frames of shaking
count=10
# Max pixels to move while shaking
@stolinski
stolinski / keybindings.json
Created June 21, 2017 23:10
VSCode Tab Switching Keybindings
[
{ "key": "ctrl+1", "command": "workbench.action.focusFirstEditorGroup" },
{ "key": "ctrl+2", "command": "workbench.action.focusSecondEditorGroup" },
{ "key": "ctrl+3", "command": "workbench.action.focusThirdEditorGroup" },
{ "key": "cmd+1", "command": "workbench.action.openEditorAtIndex1" },
{ "key": "cmd+2", "command": "workbench.action.openEditorAtIndex2" },
{ "key": "cmd+3", "command": "workbench.action.openEditorAtIndex3" },
{ "key": "cmd+4", "command": "workbench.action.openEditorAtIndex4" },
{ "key": "cmd+5", "command": "workbench.action.openEditorAtIndex5" },
{ "key": "cmd+6", "command": "workbench.action.openEditorAtIndex6" },
@codediodeio
codediodeio / database.rules.json
Last active June 22, 2024 07:03
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@elliette
elliette / ManyToManyRelationships.md
Last active October 31, 2023 16:03
Describing `belongsToMany` and `hasMany` methods in Sequelize

Defining Many-to-Many Associations in Sequelize

Reference: Sequelize docs on association

Let’s say we have two models: Films and Festivals

We know that a film can be shown at many film festivals and that, conversely, a festival can show many films. This is what is known as a many-to-many relationship.

Knowing this, we can set up our associations:

@toddmotto
toddmotto / gist:6596373
Created September 17, 2013 15:56
Disable Web Security in Chrome Canary to make cross-domain XHR requests (local servers obvs).
open -a Google\ Chrome\ Canary --args --disable-web-security
@gre
gre / easing.js
Last active June 27, 2024 15:37
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {