Skip to content

Instantly share code, notes, and snippets.

View DarkGL's full-sized avatar

Rafał Więcek DarkGL

View GitHub Profile
@debasishg
debasishg / dod.md
Last active November 4, 2024 12:49
Data oriented design, hardware awareness, cache awareness in data structures & algorithms
@colinhacks
colinhacks / .zshrc
Last active October 25, 2024 03:54
`howto` shell alias for recommending terminal commands
alias howto="gh copilot suggest -t shell"
@umstek
umstek / dedupe.ts
Created June 8, 2024 14:15
Deduplicate ESLint configs migrated with Biome
// Needs Bun
import biome from './biome.json';
// Extracted from https://biomejs.dev/linter/rules/#recommended-rules
const recommended = (await Bun.file('./recommended.txt').text())
.split('\n')
.map((x: string) => x.trim())
.filter(Boolean);
@Boshen
Boshen / machette.js
Last active April 17, 2024 05:50
npm machette - find unused dependencies by grepping the dependency name
// pnpm -r -c exec 'node /path/to/machette.js'
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const process = require('process');
const path = require('path');
async function main() {
const cwd = process.cwd();
@guest271314
guest271314 / javascript_engines_and_runtimes.md
Last active November 10, 2024 12:32
A list of JavaScript engines, runtimes, interpreters

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on

@sindresorhus
sindresorhus / esm-package.md
Last active November 15, 2024 15:20
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.
@fedek6
fedek6 / opcache-preload.php
Created October 30, 2020 09:18
Working WordPress opcache preloading config
<?php
/**
* WordPress opcache preloading.
* Requires PHP >= 7.4.
*
* @author Konrad Fedorczyk <[email protected]>
* @link https://stitcher.io/blog/preloading-in-php-74
*
* @version 1.0.0
*/
@paskal
paskal / Readme.md
Last active June 17, 2024 09:09
How to set up the Percona Monitoring and Management (PMM) v2 with docker-compose

Set up PMM Server v2

Let's start by creating entry for server in docker-compose.yaml:

version: '2'
# version 2 of docker-compose is not "old" version, it's the actual version,
# see below for explanation:
# https://stackoverflow.com/a/53636006/961092
services:
@timhwang21
timhwang21 / missing_indexes.sql
Created July 23, 2020 04:05
Spotting missing indexes for MariaDB & MySQL
SELECT
t.TABLE_SCHEMA,
t.TABLE_NAME,
c.COLUMN_NAME,
IFNULL(
kcu.CONSTRAINT_NAME, 'Not indexed'
) AS `Index`
FROM
information_schema.TABLES t
INNER JOIN information_schema.`COLUMNS` c ON c.TABLE_SCHEMA = t.TABLE_SCHEMA
@GusAntoniassi
GusAntoniassi / README.md
Last active September 30, 2024 07:03
Configure autocompletion to kubectl with zsh

kubectl with ZSH (oh-my-zsh)

How to configure

Use the following commands to add the kubectl autocomplete to zsh:

mkdir -p ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/
kubectl completion zsh > ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/kubectl-autocomplete.plugin.zsh