Skip to content

Instantly share code, notes, and snippets.

View myfreax's full-sized avatar

myfreax myfreax

View GitHub Profile
myfreax /
Created July 30, 2022 01:37 — forked from aleclarson/
The best Rollup config for TypeScript libraries


🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking
🧐 Source maps


myfreax /
Created May 27, 2022 07:53 — forked from ef4/
Webpack 5 Node Polyfills Upgrade Cheatsheet

Webpack 5 Node Polyfills Upgrade Cheatsheet

Webpack 4 automatically polyfilled many Node APIs in the browser. This was not a great system, because it could lead to surprisingly giant libraries getting pulled into your app by accident, and it gave you no control over the exact versions of the polyfills you were using.

So Webpack 5 removed this functionality. That means you need to make changes if you were relying on those polyfills. This is a quick reference for how to replace the most common patterns.

List of polyfill packages that were used in webpack 4

For each automatically-polyfilled node package name on the left, this shows the name of the NPM package that was used to polyfill it on the right. Under webpack 5 you can manually install these packages and use them via resolve.fallback.

myfreax / concat.array.buffers.js
Created May 6, 2022 03:50 — forked from 72lions/concat.array.buffers.js
Concatenates two ArrayBuffers
* Creates a new Uint8Array based on two different ArrayBuffers
* @private
* @param {ArrayBuffers} buffer1 The first buffer.
* @param {ArrayBuffers} buffer2 The second buffer.
* @return {ArrayBuffers} The new ArrayBuffer created out of the two.
var _appendBuffer = function(buffer1, buffer2) {
var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);
myfreax /
Created May 6, 2022 01:38 — forked from sturgle/
A java nio tcp client. Keep it here as notes.
// TCP Client (Java NIO)
// A minimalistic Java NIO TCP client. Stays always connected. Disconnects and reconnects on any exception in the event handlers (onConnect, onDisconnect, onRead).
package net.bobah.nio;
import java.nio.ByteBuffer;
import java.nio.channels.ReadableByteChannel;
myfreax /
Created April 10, 2022 07:59 — forked from ChrisWellsWood/
Initialising empty structs in Rust.

Initialising Empty Structs in Rust

In C/C++, you can initialise a struct without giving values for any of the fields:

struct Point {
  float x;
  float y;
  float z;
myfreax /
Created December 12, 2021 03:31 — forked from mariotacke/
Default nginx log format (combined) and grok pattern
myfreax /
Created August 23, 2021 06:15 — forked from bsorrentino/
Cordova Plugin Developer Guide

Cordova Plugin Development Guide for Android

Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.

This simple guide, walks through the what, when, why, and how of Cordova plugin development for Android.


Before start, understand their

myfreax /
Created July 7, 2021 06:24 — forked from lionello/
Playing SteamVR games on the Oculus Quest

Playing SteamVR games on the Oculus Quest, without owning a PC

Setting up your Virtual Machine

We'll be creating a new Virtual Machine on Microsoft's cloud platform, Azure. The VM will have a beefy GPU just like a home computer so it can be used for playing games.

  1. Go to [the Azure portal][azure] and sign up or log in.
  2. If you are on a Free account, first go to Subscriptions and upgrade it to a Pay-as-you-go plan. Don't worry, you will get to keep any free credits you have. Azure's interface is a bit slow so this will take a minute.

⚠️ Make sure to not include any support plan because they will charge you monthly!

myfreax / dev.yml
Created June 5, 2021 03:16 — forked from maxkostinevich/dev.yml
Github Actions - Deploy Serverless Framework (AWS)
# Github Actions for Serverless Framework
# Create AWS_KEY and AWS_SECRET secrets in Github repository settings
# If you're using env.yml file, store its content as ENV Github secret
# Master branch will be deployed as DEV and every new tag starting with "v**" (e.g. v1.0, v1.2, v2.0, etc) will be deployed as PROD
# Learn more:
myfreax /
Created May 8, 2021 03:02 — forked from evantoli/
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like: