Skip to content

Instantly share code, notes, and snippets.

View vnys's full-sized avatar

Victor Nystad vnys

View GitHub Profile
@robweychert
robweychert / python-easing-function.md
Last active June 2, 2024 08:46
Python easing functions
//
// Prelude
// A zero dependency, one file drop in for faster Typescript development with fewer bugs
// through type safe, functional programming. Comments are inline with links to blog posts motiviating the use.
// alias for a function with airity 1
export type Fn<A, B> = (a: A) => B;
// alias for a function with airity 2

How to add SSL binding for Equinor domains in azure

In this readme we will use the eds.equinor.com domain as an example. Can be done for any sub domain, given you have setup correct DNS/Re-routing.

1. Generate new key & request (needs to be be done only once)

Run in terminal

openssl req -new -newkey rsa:2048 -nodes -keyout eds.equinor.com.key -out request.csr

How to add SSL binding for Equinor domains in azure

In this readme we will use the eds.equinor.com domain as an example. Can be done for any sub domain, given you have setup correct DNS/Re-routing.

1. Generate new key & request (needs to be be done only once)

Run in terminal

openssl req -new -newkey rsa:2048 -nodes -keyout eds.equinor.com.key -out request.csr
@Merott
Merott / tailwind-colors-as-css-variables.md
Last active June 23, 2024 12:06
Expose Tailwind colors as CSS custom properties (variables)

This is a simple Tailwind plugin to expose all of Tailwind's colors, including any custom ones, as custom css properties on the :root element.

There are a couple of main reasons this is helpful:

  • You can reference all of Tailwind's colors—including any custom ones you define—from handwritten CSS code.
  • You can define all of your colors within the Tailwind configuration, and access the final values programmatically, which isn't possible if you did it the other way around: referencing custom CSS variables (defined in CSS code) from your Tailwind config.

See the Tailwind Plugins for more info on plugins.

/*
* This script fetches all color styles from a Figma team/document.
*
* Dependencies:
*
* - node-fetch
*
* Due to a limitation in the Figma /styles endpoint, we need to use a
* document for actually using the colors in a color grid 🙄That's why
* we're both fetching from /styles and /files below.
@RienNeVaPlus
RienNeVaPlus / easing.js
Last active June 2, 2024 08:47 — forked from gre/easing.js
🔀 Simple Easing Functions in JavaScript using `export`
/**
* Easing functions
*
* https://gist.github.com/gre/1650294
* http://easings.net
*/
// no easing, no acceleration
export function easeLinear(t){ return t }
// accelerating from zero velocity
export function easeInQuad(t){ return t*t }

AutoHotkey.ahk

;-----------------------------------------
; Mac keyboard to Windows Key Mappings
;=========================================

; --------------------------------------------------------------
; NOTES
; --------------------------------------------------------------
; ! = ALT
@richard-flosi
richard-flosi / star-wars-planets.html
Last active June 26, 2024 14:46
Web Component using Custom Element, Shadow DOM, fetch, async/await, and the Star Wars API
<html>
<head>
<script>
customElements.define("star-wars-planets", class extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: "open" });
}
static get observedAttributes() { return ["loading", "planets"]; }
@rsms
rsms / figma-project-stats.js
Created June 21, 2018 19:17
Script that generates statistics for a Figma project, like number of files, frames, versions etc
//
// Figma project stats
// Pulls statistics like number of files, frames, versions etc for a project.
//
// Usage:
// export FIGMA_API_ACCESS_TOKEN='your-token'
// node figma-project-stats.js <project-id>
//
// You can generate tokens in your account settings or at
// https://www.figma.com/developers/explorer#personal-access-token