Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / esm-package.md
Last active March 28, 2024 21:06
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.
@Khaadahmed
Khaadahmed / index.html
Created March 28, 2024 21:03
Responsive Dashboard | Chart.js
<body>
<nav class="main-menu">
<div>
<div class="user-info">
<img
src="https://github.com/ecemgo/mini-samples-great-tricks/assets/13468728/e5a707f4-d5ac-4f30-afd8-4961ae353dbc"
alt="user" />
<p>Mia Taylor</p>
</div>
<ul>
@gabe565
gabe565 / change-arc-icon.md
Last active March 28, 2024 21:02
Change Arc Browser Icon

Change Arc Browser Icon

arc

A collection of commands that change the Arc Browser icon.

Commands

Theme Command
Candy Arc defaults write company.thebrowser.Browser currentAppIconName candy

A good way to think about a buffer or an image descriptor is to imagine it as a very fat pointer. This is, in fact, not too far removed from reality, as we shall see.

Taking a peek at radv, we find the uniform buffer and storage buffer descriptors to be a 4-word tuple, where the first two words make up the address, followed by length in bytes for bounds checking and an extra word, which holds format information and bounds checking behavior [^1].

Similarly, the sampled image descriptor is a 16-word tuple containing an

@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 21:01
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@porjo
porjo / pulseaudio_rtp.md
Last active March 28, 2024 21:01
Use Pulseaudio to stream audio file to network via RTP

RTP Server

Setup

pacmd load-module module-null-sink sink_name=rtp format=s16le channels=1 rate=16000
pacmd load-module module-rtp-send source=rtp.monitor

This sets up a multicast socket for RTP streams. When I tested this was 224.0.0.56:46136

@jbaranski
jbaranski / SelfHostOpenStreetMapDocker.md
Created August 1, 2020 14:52
How to self host an Open Street Map server (using Docker)

Here are the steps needed to run a self hosted Open Street Map server (using Docker):

  1. Download desired pbf files (like south-carolina-latest.osm.pbf) from https://download.geofabrik.de or just use the following empty planet below:

    
      <?xml version='1.0' encoding='UTF-8'?>
      <osm version="0.6" generator="osmconvert 0.8.8" timestamp="2019-10-23T20:18:02Z">
        <bounds minlat="42.4276" minlon="1.412368" maxlat="42.65717" maxlon="1.787481"/>
      </osm>
    
@MarkWarneke
MarkWarneke / Makefile
Created June 18, 2020 12:25
Makefile for python code
# Makefile for python code
#
# > make help
#
# The following commands can be used.
#
# init: sets up environment and installs requirements
# install: Installs development requirments
# format: Formats the code with autopep8
# lint: Runs flake8 on src, exit if critical rules are broken