Skip to content

Instantly share code, notes, and snippets.

tombigel / utils.ts
Last active August 8, 2023 07:00
Helpful Javascript functions I use frequently, mainly vanilla alternatives to lodash etc.
* Deep merge two or more objects together.
* (c) 2019 Chris Ferdinandi, MIT License,
* @param {Object} objects The objects to merge together
* @returns {Object} Merged values of defaults and options
export function deepMerge(...args: any[]) {
// Setup merged object
const newObj: Record<string, any> = {};
tombigel / PromiseQueue.js
Last active May 2, 2022 22:42
Promise Queue
* @class PromiseQueue Manage a queue of promises
function PromiseQueue() {
const queue = {};
let idCount = 0;
return {
* Add a promise to the queue and remove it once resolved
* todo: handle reject()
tombigel /
Last active June 3, 2024 00:19 — forked from a2ikm/limit.maxfiles.plist
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in's Wayback Machine

Mac OS X

To check the current limits on your Mac OS X system, run:

tombigel / border-radius-input.scss
Last active October 9, 2017 07:33
SCSS Functions to manipulate border radius values
// ----
// libsass (v3.2.5)
// ----
$br: 1px 2px 3px;
@function blowup-border-radius($br) {
$long-br: $br;
@if length($br) == 1 {
$long-br: ($br $br $br $br);
tombigel / pre-commit
Created July 13, 2011 16:31
GIT pre-commit test for capital letters in image file names and for debug commands
# A hook script to verify that no images with capital letters are committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
# Go through all the changed files (except for deleted and unmerged)
# Check for lines containing "debugger" "console." or "alert("