Skip to content

Instantly share code, notes, and snippets.

View yvele's full-sized avatar
🧐
ᕕ( ᐛ )ᕗ

Yves M. yvele

🧐
ᕕ( ᐛ )ᕗ
View GitHub Profile
# Node.js Structured Logging API - RFC
**Author:** @mertcanaltin
**Status:** REVIEW
**Date:** 2025-01-22
**Issue:** [#49296](https://github.com/nodejs/node/issues/49296)
---
## Summary
@ngxson
ngxson / FAQ.md
Last active August 5, 2025 17:29
convert ARM NEON to WASM SIMD prompt

Why did you do this?

Relax, I only have one Sunday to work on idea, literally my weekend project. So I tried Deepseek to see if it can help. Surprisingly, it works and it saves me another weekend...

What is your setup?

Just chat.deepseek.com (cost = free) with prompts adapted from this gist.

Does it work in one-shot or I have to prompt it multiple times?

@yvele
yvele / ULN2003StepperMotor.js
Created April 1, 2023 23:11
Stepper Motor and ULN2003 Driver Board on Raspberry Pi with Node.js
// Inspired from:
// https://ben.akrin.com/driving-a-28byj-48-stepper-motor-uln2003-driver-with-a-raspberry-pi/
// https://gist.github.com/wolli2710/9ae48c9f39737896c1f6
const { Gpio } = require("onoff");
const in1ToGpio = 17; // IN1
const in2ToGpio = 18; // IN2
const in3ToGpio = 27; // IN3
const in4ToGpio = 22; // IN4
const timeout = 1; // milliseconds
@domenic
domenic / README.md
Last active January 3, 2026 21:30
Generic zero-copy ArrayBuffer

Generic zero-copy ArrayBuffer usage

Most APIs which accept binary data need to ensure that the data is not modified while they read from it. (Without loss of generality, let's only analyze ArrayBuffer instances for now.) Modifications can come about due to the API processing the data asynchronously, or due to the API processing the data on some other thread which runs in parallel to the main thread. (E.g., an OS API which reads from the provided ArrayBuffer and writes it to a file.)

On the web platform, APIs generally solve this by immediately making a copy of the incoming data. The code is essentially:

function someAPI(arrayBuffer) {
  arrayBuffer = arrayBuffer.slice(); // make a copy
@sindresorhus
sindresorhus / esm-package.md
Last active January 21, 2026 15:40
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.
@hybrist
hybrist / index.md
Last active September 13, 2024 06:14
JavaScript: Classic Scripts vs. Modules vs. CommonJS

JavaScript File Format Differences

There's the pervarsive notion that all JS is created equal and that there's only minor and easily detectable differences between the various file formats used to author JavaScript. This is correct, from a certain point of view.

A certain point of view?

For many people writing JavaScript that gets passed into build tools,

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active January 17, 2026 06:07
set -e, -u, -o, -x pipefail explanation
@pcattori
pcattori / gist:2bb645d587e45c9fdbcabf5cef7a7106
Last active February 20, 2022 00:01
relay-style cursor-based pagination capable of filtering/sorting for SQL
import { Base64 } from 'js-base64'
import { Op } from 'sequelize'
import { fromGlobalId } from 'graphql-relay'
// https://github.com/graphql/graphql-relay-js/issues/94#issuecomment-232410564
const effectiveOrder = ({ last }, orderBy) => {
/* adds `id ASC` to end of `ORDER BY` if `id` is not already in the `ORDER BY` clause
flips `ASC` to `DESC` (and vice-versa) if pagination arg `last` is defined
*/
@troyfontaine
troyfontaine / 1-setup.md
Last active January 20, 2026 15:10
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.