Skip to content

Instantly share code, notes, and snippets.

View frozenspider's full-sized avatar

Alex Abdugafarov frozenspider

View GitHub Profile
@frozenspider
frozenspider / macos-ramdisk.md
Created April 29, 2024 08:34 — forked from htr3n/macos-ramdisk.md
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

function debounce(func, wait, immediate) {
let timeout;
return function() {
let context = this, args = arguments;
let later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
let callNow = immediate && !timeout;
clearTimeout(timeout);