Skip to content

Instantly share code, notes, and snippets.


Jari Pennanen Ciantic

  • Finland, Jyväskylä
View GitHub Profile
// Please find the full, tested version in
pub struct DedicatedExecutor {
state: Arc<Mutex<State>>,
/// Runs futures (and any `tasks` that are `tokio::task::spawned` by
/// them) on a separate Tokio Executor
struct State {
pirate / request_logging_with_filenames.js
Created Mar 12, 2021
Show filename:lineno for every log message in node. Log the time, origin ip, method, and url for every express.js request.
View request_logging_with_filenames.js
// patch console.log to show filename and line number for every logged message
// ./src/index.js:68:9 √ Connected to Sentry
// ./src/index.js:72:9 √ Connected to Stripe
// ./src/index.js:82:9 √ Connected to Backblaze
// ./src/index.js:99:9 √ Connected to FireBase
// ./src/routes/paypal.js:68:17 Error: Request failed with status code 401
// at createError (./node_modules/axios/lib/core/createError.js:16:15)
// at settle (./node_modules/axios/lib/core/settle.js:17:12)
// at IncomingMessage.handleStreamEnd (./node_modules/axios/lib/adapters/http.js:236:11)
Ciantic /
Last active Feb 7, 2022
cloudflare dyndns script / update a A and AAAA record using bash script
# Author: Jari Pennanen
# Url:
AUTH_EMAIL="" # Your Cloudflare email
AUTH_KEY="" # Get this from My profile -> API Keys -> View
DOMAIN="" # main domain
SUBDOMAIN="" # set A and AAAA-record of this subdomain
jakub-g /
Last active Apr 24, 2022
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)

Pindar /
Last active Nov 13, 2021 — forked from mill1000/
Headless A2DP Audio Streaming on Raspbian Stretch


This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.


A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date


davejm / latex-short-captions.lua
Created Apr 26, 2018 — forked from tarleb/latex-short-captions.lua
Filter to turn figure titles into short captions in LaTeX
View latex-short-captions.lua
-- don't do anything unless we target latex
if FORMAT ~= "latex" then
return {}
local List = require'pandoc.List'
local function latex(str)
return List:new{pandoc.RawInline('latex', str)}
alirobe / reclaimWindows10.ps1
Last active May 13, 2022
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of (different defaults). N.…
View reclaimWindows10.ps1
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <>
# Modified by: alirobe <> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source:
# Tweaked Source:
# Tweak difference:
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
keijiro / prng.cginc
Last active May 4, 2022
One liner pseudo random generator with HLSL
View prng.cginc
float nrand(float2 uv)
return frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453);
ekmett / fmap.markdown
Last active Apr 14, 2021
Proof that fmap f . fmap g = fmap (f . g) given fmap id = id, and the free theorem for fmap's signature.
View fmap.markdown


Given fmap id = id:

fmap f . fmap g = fmap (f . g)

To prove this we're going to need a few lemmas:

View gist:3b19447b304616f18657
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\n",
"sources" : [ "" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "" ],