Skip to content

Instantly share code, notes, and snippets.

View JustFly1984's full-sized avatar

Alexey Lyakhov JustFly1984

  • Thailand
View GitHub Profile
@timbenniks
timbenniks / AI_Agent_migrate_to_void_Zero_Toolchain.md
Last active September 8, 2025 19:08
Migrate any TypeScript Library to the Void Zero Toolchain using an AI agent

🤖 AI Agent Instructions: Migrate TypeScript Library to Void Zero Toolchain

Agent Role: You are tasked with migrating any TypeScript library from its current build system to the high-performance Void Zero toolchain. Follow these instructions systematically.

🎯 Mission Overview

Transform any TypeScript library (regardless of current setup) to use:

  • TSDown for both JavaScript bundling AND TypeScript declarations (primary approach)
  • Oxlint for linting (optional, can keep existing)
@sindresorhus
sindresorhus / esm-package.md
Last active October 21, 2025 13:33
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.
@SarasArya
SarasArya / handler.js
Last active May 15, 2021 22:05
Serverless Sentry Error Handler example
// Node version 10.x AWS Lambda Serverless framework
const Sentry = require('@sentry/node'); // sentry version "@sentry/node": "^5.5.0",
Sentry.init({
dsn: 'https://[email protected]/1234567',
async beforeSend(event) {
console.log('\n Caught an exception \n');
return event;
},
@acdlite
acdlite / app.js
Last active July 22, 2025 08:36
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
@bradwright
bradwright / websockets-server.js
Created June 11, 2011 23:29
Pure Node.js WebSockets server
/*
* node-ws - pure Javascript WebSockets server
* Copyright Bradley Wright <[email protected]>
*/
// Use strict compilation rules - we're not animals
'use strict';
var net = require('net'),
crypto = require('crypto');