Skip to content

Instantly share code, notes, and snippets.

View laduke's full-sized avatar

Travis LaDuke laduke

  • zerotier
  • California
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active April 24, 2024 09:47
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.
@tornqvist
tornqvist / example-memo.js
Last active May 19, 2020 19:02
A series of examples illustrating a new component API I've been working on in conjunction with changes to nanohtml
var { html, render } = require('nanohtml')
var { Component, memo, onupdate } = require('nanohtml/component')
// This example illustrates how memo can be used to maintain form state.
// On first render, getInitialValues is called and read values either
// from the fields argument or from local storage.
// Whenever a field changes its value is persisted to local storage.
var Form = Component(function (fields, values = memo(getInitialValues)) {
var update = onupdate(function (fields, values) {
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@WebReflection
WebReflection / how-to-file-a-github-issue.md
Created November 25, 2019 19:34
How to file a GitHub/Lab issue

How to file a GitHub/Lab issue

helping each others


Original Medium post


Filing an issue is not about delegating your problem to another developer, it’s about helping maintainers solve issues they haven’t encountered yet.

@mattdesl
mattdesl / about.md
Last active June 7, 2023 06:49
canvas-sketch + AxiDraw + pen plotter in 3 commands

canvas-sketch + pen plotter in 3 commands

Install the CLI tool globally:

npm install canvas-sketch-cli -g

Create a new folder and move into it:

@adam-hanna
adam-hanna / TUTORIAL.md
Last active March 28, 2023 11:29
Create and connect macvlan network namespaces

This tutorial was written using Red Hat Fedora 30 but may be similar on other distros.

Discover

You should have an eth0, but if you $ ifconcig -a and don't see it, you should do $ nmcli device status to determine which device is connected to your wifi/ethernet.

Create macvlans and network spaces

$ sudo ip link add macvlan1 link eth0 type macvlan mode bridge
$ sudo ip link add macvlan2 link eth0 type macvlan mode bridge
$ sudo ip netns add net1
@creationix
creationix / rpc.md
Last active December 30, 2020 03:58
Simple RPC design

I've designed a lot of RPC protocols in my career. One pattern that's worked well basically goes as follows:

// Client calls: print('Hello World\n')
-> [1, "print", "Hello World!\n"]
// Server sends return value (or lack of return vvalue)
<- [-1]

// Client calls: add(1, 2)
-> [2, "add", 1, 2]
@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active April 20, 2024 00:05
Ubuntu and Debian Cloud images in Proxmox
@smammy
smammy / macOS-IPv6-Tunnel-DNS-HOWTO.md
Created December 13, 2018 19:14
How to convince macOS to do IPv6 DNS lookups when your only IPv6 address is via a VPN or tunnel of some sort

This was a huge hassle to figure out, so I wrote up a little guide in hopes that others would find it helpful:

How to convince macOS to do IPv6 DNS lookups when your only IPv6 address is via a VPN or tunnel of some sort

The Problem

macOS's domain name resolver will only return IPv6 addresses (from AAAA records) when it thinks that you have a valid routable IPv6 address. For physical interfaces like Ethernet or Wi-Fi it's enough to set or be assigned an IPv6 address, but for tunnels (such as those using utun interfaces) there are some extra annoying steps that need to be taken to convince the system that yes, you indeed have an IPv6 address, and yes, you'd like to get IPv6 addresses back for DNS lookups.

I use wg-quick to establish a WireGuard tunnel between my laptop and a Linode virtual server. WireGuard uses a utun user-space tunnel device to make the connection. Here's how that device gets configured:

@dominictarr
dominictarr / readme.md
Created November 26, 2018 22:39
statement on event-stream compromise

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu