Skip to content

Instantly share code, notes, and snippets.

@naoisegolden
naoisegolden / nextjs.md
Last active September 30, 2023 07:48
SSR and Code-splitting in Stuart FE apps

Next.js compared to our and other solutions

Figuring out how Next.js handles code splitting and routing so that we can decide if it fits our needs or if we can take inspiration from it for our own internal solution.

SSR

SSR with Next.js

There is no special documentation about Next.js SSR, since it's supported out of the box and handled transparently.

@LeaVerou
LeaVerou / dabblet.css
Last active March 28, 2024 06:22
Two column <dl> with two lines of CSS! Thank you Grid Layout!
/**
* Two column <dl> with two lines of CSS! Thank you Grid Layout!
* Limitation: Breaks if we have multiple consecutive <dt>s or <dd>s
*/
dl {
display: grid;
grid-template: auto / 10em 1fr;
}
@samcorcos
samcorcos / collision.js
Last active November 11, 2021 11:27
Algorithm for calculating hash collision probability
const calculate = (n, k) => {
const exponent = (-k * (k - 1)) / (2 * n)
return 1 - Math.E ** exponent
}
// where `n` is the number of possible unique hashes
// where `k` is the number of values created
// calculate(100000, 25) => 0.0029955044966269995 aka 0.29% chance of collision
@olivierlacan
olivierlacan / assistive_devices.md
Created June 21, 2013 07:31
How to re-enable Divvy in OS X 10.9 Mavericks when it complains about needing to "enable access to assistive devices".

At the time of this writing Divvy hasn't been updated for OS X 10.9 so it tries to direct you to the Accessibility panel of the System Preferences. Actually the assistive device settings have been moved to the Security pane as shown below:

@erotte
erotte / private.xml
Created August 25, 2012 23:09
KeyRemap4MacBook Umlaute mit ALT-Modifier
<?xml version="1.0"?>
<!-- Key Mappimgs for http://pqrs.org/macosx/keyremap4macbook/ -->
<root>
<item>
<name>German Umlaute on US Keyboard Layout with ALT modifier</name>
<appendix>Change Option+o to ö</appendix>
<appendix>Change Option+a to ä</appendix>
<appendix>Change Option+u to ü</appendix>
<identifier>remap.org.openhort.german_umlaute_with_ALT_modifier</identifier>