Skip to content

Instantly share code, notes, and snippets.

View frank-dspeed's full-sized avatar
🇩🇪
I Engineer

Frank Lemanschik frank-dspeed

🇩🇪
I Engineer
View GitHub Profile
@frank-dspeed
frank-dspeed / 1_.README.md
Last active April 14, 2022 09:37
Example .cjs wrapper for real ESM .mjs code introduction pure modules aka Stealify Lang ECMAScript Module Standard

How to use ESM code in a CJS Project

This examples illustrate how to code a wrapper around 1 or more ESM Modules the wrapper gets written in CJS

exposing only namedExports avoid default export by design to make the shift to ESM more easy

also it exposes only Functions (methods) that do handle the import of the ESM dependencies.

also at the end there is a little introduction

@frank-dspeed
frank-dspeed / Stealify Lang ECMAScript Package Consumption via Wrapper Packages Pattern.md
Last active March 30, 2022 09:24
Stealify Lang ECMAScript Package Consumption via Wrapper Packages Pattern:

no matter what package and package manager for the code no matter if you consume the git source or the packaged version that gets distributed via other channels

./wrapper_module_name/<git_repo or node_modules/dependencie_name>
./wrapper_module_name/<optional other wrappers like eslint if needed>
./wrapper_module_name/main_or_module_name.js // Source of your wrapper maybe the only file with package.json if all goes well
./wrapper_module_name/main_or_module_name.d.ts // gets generated from the main of the wrapper that is defined in the package.json generated via tsconfig.json settings
./wrapper_module_name/tsconfig.json // contains fixes for the typescript consumption if needed
./wrapper_module_name/package.json // contains fixes for the consumption
./node_modules // contains the workspaces so the wrapper_module_name
@sindresorhus
sindresorhus / esm-package.md
Last active May 8, 2024 22:50
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.
@Dawgora
Dawgora / gist:0c43f5759287f7e87d37f4ca537c33ca
Created February 17, 2021 19:32
Nvidia 3080 ( hashcat -b -D 1,2 --force )
CUDA API (CUDA 11.2)
====================
* Device #1: GeForce RTX 3080, 9358/10014 MB, 68MCU
OpenCL API (OpenCL 1.2 CUDA 11.2.136) - Platform #1 [NVIDIA Corporation]
========================================================================
* Device #2: GeForce RTX 3080, skipped
Benchmark relevant options:
===========================
@frank-dspeed
frank-dspeed / Cheatsheet-CONTENT_STREAM_PRODUCTION.md
Last active August 30, 2023 23:39
Cheatsheet Conten Production Streaming Linux Virtual Desktop Webcam

Linux Video

ffmpeg - is the default standard for video operations of all kind

drawtext filter

If you just want to update some text on the screen the easiest method is to use the drawtext filter with the textfile and reload options.

ffmpeg -i input -vf "drawtext=textfile=songs.txt:reload=1" output songs.txt will be reloaded once per frame. Be sure to update it atomically, or it may be read partially, or even fail.

overlay filter

@wllmsash
wllmsash / assigning-static-ip-addresses-in-wsl2.md
Last active May 8, 2024 16:52
Assigning Static IP Addresses in WSL2

Assigning Static IP Addresses in WSL2

WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".

Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios:

@lazar-mitrovic
lazar-mitrovic / buildGraal.py
Last active February 2, 2022 15:51
Build latest GraalVM CE (Java 8 / 11)
#!/usr/bin/python3
import os, sys
import platform
import subprocess
import shutil
from argparse import ArgumentParser, REMAINDER
my_env = os.environ.copy()
current_os = platform.system().lower()
version = "python-1.0.5"
@jklingsporn
jklingsporn / Mixed handler registration fails
Last active September 21, 2020 11:54
After both handlers have been registered and received a message the unregistration of the second handler fails
import com.hazelcast.core.Hazelcast;
import io.vertx.core.Promise;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.eventbus.MessageConsumer;
import io.vertx.spi.cluster.hazelcast.HazelcastClusterManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
@frank-dspeed
frank-dspeed / BOOK.md
Last active June 1, 2021 07:05
BOOK

How to use Webworkers

Do always use a webworker always with a single file bundle do never split web worker code into modules. WebWorkers have a limited life cycle thats why they are not designed to run multiple modules they are designed to shift of long running processing from the main th and should not get abused for other stuff

The costs of context switching between the Main and the Worker is to high so only use it for operations that take at last 500ms in general even a operation that takes 100ms is a valid usecase but it depends on the overall time that your app blocks the main th. So batch processing is also a valid usecase.

@asad-awadia
asad-awadia / vertx-tcp-prom.kt
Created July 5, 2020 19:34
Vert.x tcp server with prometheus metrics
fun main() {
// init prometheus registry
val registry = PrometheusMeterRegistry(PrometheusConfig.DEFAULT)
// bind micrometer metrics
ClassLoaderMetrics().bindTo(registry)
JvmMemoryMetrics().bindTo(registry)
JvmGcMetrics().bindTo(registry)
ProcessorMetrics().bindTo(registry)
JvmThreadMetrics().bindTo(registry)
UptimeMetrics().bindTo(registry)