Skip to content

Instantly share code, notes, and snippets.

View tyriis's full-sized avatar
🏡
Working from home

Nils Müller tyriis

🏡
Working from home
View GitHub Profile
@tyriis
tyriis / config.yaml
Last active April 22, 2021 11:50
hue scene to ha
productivity:
brightness: 100
light_color: 233
energy:
brightness: 100
light_color: 156
chill:
brightness: 57
light_color: 447
read:
@tyriis
tyriis / package.json
Last active December 13, 2022 21:39
split a yaml file into multiple ones based on the first level key
{
"name": "split-yaml",
"version": "1.0.0",
"main": "split-yaml.js",
"scripts": {
"split": "node split-yaml.js"
},
"dependencies": {
"js-yaml": "^3.14.0",
"readline": "^1.3.0"
@tyriis
tyriis / esm-package.md
Created May 1, 2023 20:35 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@tyriis
tyriis / esm-package.md
Created May 1, 2023 20:35 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.

⚠️ This gist is no longer updated! For maintained, improved and even more extended guide click here.


How to use Discord Webhook

It's a JSON

First, learn JSON. It's not programming language, not even close. Just follow syntax rules and you will be fine.