Skip to content

Instantly share code, notes, and snippets.

View dhigginbotham's full-sized avatar
😸
happycat

David Higginbotham dhigginbotham

😸
happycat
View GitHub Profile
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;
const emojiContainer = document.getElementById('custom_emoji');
const emojis = emojiContainer.querySelectorAll('tr.emoji_row');
const scrapped = Array.prototype.slice.call(emojis).map((row) => {
const url = row.querySelector('span.emoji-wrapper').getAttribute('data-original');
const name = row.querySelector('[headers="custom_emoji_name"]').innerText;
return { name, url };
});
console.log('total emojis: ', scrapped.length);
console.log('data model: ', scrapped[Math.floor(Math.random() * scrapped.length)]);
const EventEmitter = require('events');
class Eventry extends EventEmitter {
constructor(type = 'none', ...args) {
super(args);
this.type = type;
}
// overload .on and .emit func to
// support special event syntax
on(ev, fn) {
// transformy is an object mapping tool to
// transform objects to another object defaults
function extenze() {
const args = Array.prototype.slice.call(arguments);
const source = args.shift();
let current;
while (current = args.shift()) {
Object.keys(current).forEach((key) => {
source[key] = typeof current[key] === 'object'
const gulp = require('gulp');
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
// path prefix
const prefix = 'assets/';
const vendorPrefix = `${prefix}src/vendor/`;
const bowerPrefix = `${prefix}src/bower/`;
const files = {