Skip to content

Instantly share code, notes, and snippets.

View vnys's full-sized avatar

Victor Nystad vnys

View GitHub Profile
@vnys
vnys / launch.json
Created December 20, 2019 08:29 — forked from cecilemuller/launch.json
Run ts-node in VSCode Debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Node Inspector",
"type": "node",
"request": "launch",
"args": ["${workspaceRoot}/src/service.ts"],
"runtimeArgs": ["-r", "ts-node/register"],
"cwd": "${workspaceRoot}",
@vnys
vnys / adding-props-to-styled-components.md
Last active April 20, 2020 09:31
adding props to styled components

Sometimes it’s useful to extend an existing component and add style props similar to styled-system

const addMarginRightProp = () => ({ marginRight }) =>
  marginRight && { marginRight: `${marginRight}px` }

const IconWithMarginProp = styled(Icon)(addMarginRightProp)
const ButtonWithMarginProp = styled(Button)(addMarginRightProp)
@vnys
vnys / figma-project-stats.js
Created May 1, 2020 05:57 — forked from rsms/figma-project-stats.js
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
/*
* 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.

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
@vnys
vnys / star-wars-planets.html
Created June 8, 2020 19:52 — forked from richard-flosi/star-wars-planets.html
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"]; }
@vnys
vnys / prelude.ts
Created August 14, 2020 11:15 — forked from reidev275/prelude.ts
//
// 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 arity 1
export type Fn<A, B> = (a: A) => B;
// alias for a function with arity 2
@vnys
vnys / mac-setup-redis.md
Created September 30, 2020 09:31 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis

AutoHotkey.ahk

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

; --------------------------------------------------------------
; NOTES
; --------------------------------------------------------------
; ! = ALT
@vnys
vnys / agenda.md
Last active June 11, 2021 08:09
EnergyVision and EDS

Why do we use the EDS in Energy Vision

  • The EDS
  • Main problem
    • EDS is made for white backgrounds
    • Need components EDS don’t have

Contributions

  • Tokens