Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / esm-package.md
Last active April 23, 2024 09:02
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.
@Platane
Platane / setEnv.js
Created July 23, 2019 12:01
Set the env var in circle project from a .env file
const fs = require("fs");
const https = require("https");
/**
*
* Set the env var in circle project from a .env file
*
* usage:
*
* ```bash
@zentralwerkstatt
zentralwerkstatt / instructions.md
Last active February 20, 2023 23:55
Install Syncthing on Linux
  • Install the necessary packages:
sudo apt-get install apt-transport-https ca-certificates
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt-get update
sudo apt-get install syncthing
sudo apt-get install git
  • Start syncthing once:
@scturtle
scturtle / gist:15685020c01e4c5a8072
Last active July 8, 2017 13:21
ffmpeg cheatsheet
# https://support.twitter.com/articles/20172128?lang=en#video-formats
# https://trac.ffmpeg.org/wiki/Encode/H.264
# gif to mp4 for twitter
ffmpeg -i in.gif -pix_fmt yuv420p -vf crop="floor(in_w/2)*2:floor(in_h/2)*2" out.mp4
# extract part of video (-t duration)
ffmpeg -i in.mp4 -ss 00:00:00.000 -to 00:00:15.000 -vcodec copy -acodec copy part.mp4
# convert to mp4 for twitter
@bloodyowl
bloodyowl / 00.Intro.md
Last active December 13, 2017 13:36
Introduction to React

React

A JavaScript library that manages the UI.

What does it do?

React enables you to express in a declarative way what your UI should look like at any point in time; while building your app with little, reusable blocks: components.