Skip to content

Instantly share code, notes, and snippets.

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@Bilka2
Bilka2 / gist:52697e925d34e6266c65b0e2b4768238
Last active August 15, 2024 16:14
factorio: 256:256 balancer (fractal)
0eNqkvd2ONc2NXnkv37GqkSTjt29lMBi0bcEQ0FYLkhqwYejep7qMUaWmd+03Y60jSZ+k/RSTmU8ygisZ//u3//Kv//77P/35D3/862///L9/+8N//bc//uW3f/6//vdvf/nDf//jv/zrf/yzv/6vP/3+t3/+7Q9//f3/+O13v/3xX/7Hf/yn3//PP/3593/5y8e///G//f7P//3P//b5rx//5ff/+tff/va73/7w+c/+52//HH/7v3/32+//+Nc//PUPv/8/v/n1H/7X//PHf/8f/+X3f/78H/ynX/vLn/71D3/96+d/97vf/vRvf/n8P/7bH//jL/j8sY9a1+9++1+f/yZy/lP/VPlvf/jz7//r//lf5N9+959+PP/Tj//1z//yx7/86d/+/Nf/84e+kJj7/5NYvxYoIrAOBBoRmD8ItBcCnQiMA4FBBPoPAuOFwCQC7SAHiwjUgcA+egZmHj0Dcf36eX2lEj8F8Lu/m8Ef//Tv//Gs/2fJQJJj/FLy3/79rz9pJtPsIsxikpcJsyHNvkWYnUl2EyZxjX7yUMc8euh6nT10xDN6nvz9myjEgUIy4+gXv9WSGUczt1oy42hNhMmMo7YJkxlHLREmM44qE+ZgminCnEgypwlzMc0hwtxMsokw6zoy6Twz6QpgoXli0sW8JUXtVcxbwtRexbwlRO1VzFvC1F7FvOUStVcxb7nUQ0dql+tkvVPMSi5h0u0iQZ2US424yXUdrKQbcpPcpmxoYIcj99EORzvx+NzzyONbZ9dMvCjbYJLC9NtkkmnuDFSC5BKm3zaTNO+2jlZBOYXp92BhmndbZ94yS4RZTNK82zqqVHJMESZzoLFMmMyChrCgzixoGAvqzIK6sKDOLKgbCxrMgnoYTeZBZvNnMAtSmz+DeZDZ/BnMgtTmz2AeZDZ/BrMgtfkzmAeZzZ/BLEht/gzmQWbzZzILSmNBk1lQCguazILCWNBkFhTCgiazoMtY0GQWdAkLmsyCLmNBk1mQ2dqYyIJiGwuam2m
@brandonroberts
brandonroberts / async-ng-module-loader.ts
Last active April 26, 2019 12:40
Webpack Async NgModule Loader
import {Injectable, NgModuleFactory, NgModuleFactoryLoader, Compiler, Type} from '@angular/core';
class LoaderCallback {
constructor(public callback) {}
}
export let load: Type = (callback: Function) => {
return new LoaderCallback(callback);
};
@gilyes
gilyes / Backup, restore postgres in docker container
Last active October 8, 2024 11:59
Backup/restore postgres in docker container
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres
@samiraguiar
samiraguiar / MC Cheat Sheet
Last active November 2, 2024 12:58 — forked from maciakl/MC Cheat Sheet
Midnight Commander Cheat Sheet / Shortcuts
Note for newcomers:
In the shortcuts below, "C" stands for CTRL and "A" stands for "ALT". This is a convention
used in the Midnight Commander documentation and was kept here.
You can also use "ESC" instead of "ALT", which is useful on Macbooks.
Main View
---------------------------------------------------------------
- File/directory operations
@marcobiedermann
marcobiedermann / snippets.md
Last active May 25, 2022 19:57
Mac OS Command Line Snippets

Compression

Archive tar and gzip

tar -czf output.tar.gz input_folder1 input_folder2 input_file …

Extract tar and gzip

@nrollr
nrollr / MySQL.md
Last active October 28, 2020 02:53
Install MySQL on El Capitan using Homebrew

Install MySQL on OS X El Capitan

Normally the installation of MySQL can be achieved with a single command, which executes a script provided by MacMiniVault : bash <(curl -Ls http://git.io/eUx7rg)

However, at the time of writing the script is not compatible with OS X El Capitan (10.11)

Install MySQL using Homebrew

An alternative to the aforementioned installation script is installing MySQL using Homebrew. This gist assumes you already have Homebrew installed, if not first read the article "Homebrew and El Capitan"

Make sure Homebrew has the latest formulae, so run brew update first

@praphull27
praphull27 / Jenkins_Protractor_Headless_Chrome_Setup_Ubuntu_14.04.md
Last active April 9, 2024 11:44
Jenkins, Protractor and Headless Chrome Browser Setup on Ubuntu 14.04

Jenkins, Protractor and Headless Chrome Browser Setup on Ubuntu 14.04

Update Ubuntu

sudo apt-get update
sudo apt-get upgrade

Install Java

@danharper
danharper / CatchAllOptionsRequestsProvider.php
Last active August 3, 2024 16:44
Lumen with CORS and OPTIONS requests
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
/**
* If the incoming request is an OPTIONS request
* we will register a handler for the requested route
*/
class CatchAllOptionsRequestsProvider extends ServiceProvider {