Skip to content

Instantly share code, notes, and snippets.

@CorvusCorax
CorvusCorax / ISS-SIM-Customizer.user.js
Last active September 30, 2021 14:58
A Greasemonkey user script for SpaceX ISS SIM - useful to enable hard mode (no HUD) - optionally disable collissions, realistic orbital mechanics and other fun stuff
// ==UserScript==
// @name SpaceX ISS-SIM-Customizer
// @version 0.000016
// @author CorvusCorax
// @match https://iss-sim.spacex.com/
// @description A Greasemonkey user script for SpaceX ISS SIM - useful to enable hard mode (no HUD) - optionally disable collissions, realistic orbital mechanics and other fun stuff
// @include https://iss-sim.spacex.com/
// @license Creative Commons - CC BY 4.0
// ==/UserScript==
@paulirish
paulirish / what-forces-layout.md
Last active December 15, 2025 09:56
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@nikmartin
nikmartin / A: Secure Sessions Howto
Last active July 29, 2025 11:54
Secure sessions with Node.js, Express.js, and NginX as an SSL Proxy
Secure sessions are easy, but not very well documented.
Here's a recipe for secure sessions in Node.js when NginX is used as an SSL proxy:
The desired configuration for using NginX as an SSL proxy is to offload SSL processing
and to put a hardened web server in front of your Node.js application, like:
[NODE.JS APP] <- HTTP -> [NginX] <- HTTPS -> [PUBLIC INTERNET] <-> [CLIENT]
Edit for express 4.X and >: Express no longer uses Connect as its middleware framework, it implements its own now.
#!/bin/bash
SLEEP=`echo "$1*3600" | bc`
echo "Alarm triggered in $1 hours"
sleep $SLEEP > /dev/null
echo "Starting playing"
mpc volume 50 > /dev/null
mpc play > /dev/null
mpcfade.sh 50 65 0
mpcfade.sh 65 75 1
echo "Turning on TV and switching input to me"