Skip to content

Instantly share code, notes, and snippets.

View dhigginbotham's full-sized avatar
😸
happycat

David Higginbotham dhigginbotham

😸
happycat
View GitHub Profile
[user]
email = [email protected]
name = David Higginbotham
[core]
mergeoptions = --no-commit
[alias]
pff = pull --ff-only
quick = log -1 --format='%h - %an - %ad - %s' --date=local --name-status
squash = merge --squash
blog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
@dhigginbotham
dhigginbotham / backup_collection_mongo.sh
Created June 20, 2025 02:33 — forked from dungmanh88/backup_collection_mongo.sh
Dump multiple collections of a db in mongodb
#!/bin/bash
db=<db>
collection_list="<collection1> <collection2> <collection3>"
host=127.0.0.1
port=<port>
out_prefix=/Temp
for collection in $collection_list; do
echo $collection
out_dir="${out_prefix}/${db}_${collection}/"
@dhigginbotham
dhigginbotham / backup_collection_mongo.sh
Created June 20, 2025 02:33 — forked from dungmanh88/backup_collection_mongo.sh
Dump multiple collections of a db in mongodb
#!/bin/bash
db=<db>
collection_list="<collection1> <collection2> <collection3>"
host=127.0.0.1
port=<port>
out_prefix=/Temp
for collection in $collection_list; do
echo $collection
out_dir="${out_prefix}/${db}_${collection}/"
@dhigginbotham
dhigginbotham / extract-styles.js
Last active June 6, 2025 23:32
7tv.app is an awesome website, with these cool css "paint" effects. Here's the majority of the ones that I have access to (3 years+ subscriber)
// ty 7tv.app I love their paints yall the best
const els = [...document.querySelectorAll('[class*="paint svelte-"]')]
const sanitizeKey = (key) => {
key = key.replace('&', 'and').replace(/'+/g, '').replace(/\s+/g, '-').toLowerCase()
return key
}
const paintCss = els.map((el) => {
GOD SWORD
/give @p netherite_sword{Unbreakable:1,Enchantments:[{id:sweeping,lvl:1000},{id:knockback,lvl:1000},{id:fire_aspect,lvl:1000},{id:mending,lvl:1000},{id:sharpness,lvl:1000},{id:looting,lvl:3}]}
GOD HELMET
/give @p minecraft:netherite_helmet{Unbreakable:1,Enchantments:[{id:thorns,lvl:1000},{id:respiration,lvl:1000},{id:protection,lvl:1000},{id:fire_protection,lvl:1000},{id:blast_protection,lvl:1000},{id:aqua_affinity,lvl:1000}]}
GOD CHESTPLATE
/* this assumes you have a div, somewhere near
your containing div that is setup like this:
const hiddenMaskStyles = {
display: 'none',
};
const errorMaskStyles = {
minHeight: '560px',
height: '560px',
{
"editor.tabSize": 2,
"editor.fontFamily": "Fira Code",
"editor.fontSize": 16,
"editor.fontLigatures": true,
"editor.minimap.enabled": false,
"editor.cursorStyle": "line",
"editor.tokenColorCustomizations": {
"textMateRules": [
{
var latentImages = (function(w,d) {
var state = {};
state.dom = [];
function eventWrapper(type, name, obj) {
obj = obj || window;
var running = false;
function func() {
if (running) { return; }
@dhigginbotham
dhigginbotham / cacheable.js
Last active April 14, 2017 21:00
Volatile cache
const log = require('debug')('bot:app:shared:cacheable:');
const ms = require('ms');
/**
* Volatile state/cache machine
* @param { object } settings - Settings for cache, includes
*/
function cacheable(settings = {}) {
const { key = 'cacheable', ttl = '3h', staleMaths = 0.65 } = settings;
const store = {
cache: {},
expires: 0,
ttl: '1h'
};
function cacheable(settings) {
return function cache() {
const now = Date.now();
let isExpired = false;