Skip to content

Instantly share code, notes, and snippets.

#!/bin/false
# This file will be sourced in init.sh
# https://raw.githubusercontent.com/ai-dock/comfyui/main/config/provisioning/default.sh
NODES=(
"https://github.com/ltdrdata/ComfyUI-Manager"
)
@PAEz
PAEz / what-forces-layout.md
Created July 4, 2023 04:15 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
var arrayToShuffle= [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];
arrayToShuffle.forEach((el,index,arr) => {
var randomIndex=index;
while(randomIndex==index && arr.length>1) randomIndex = Math.floor(Math.random() * arr.length);
[arr[index],arr[randomIndex]] = [arr[randomIndex],arr[index]];
})
console.log(arrayToShuffle);
@PAEz
PAEz / EmitterObject.js
Last active December 7, 2020 04:26
EmitterObject- Mixing an event emitter with object-path to get me an object that tells me when its changed. I can just subscribe to * to know when a change happens.
let objectPath = require("object-path");
import EventEmitter from "./event-emitter.js";
// Doesnt take into account inherited properties like object-path does
// I was only interested in enumarable properties, so it uses Object.keys
function find(obj, what, all, index, value) {
let result = [];
const isArray = Array.isArray(obj);
const keys = isArray ? undefined : Object.keys(obj);
for (let i = 0, end = isArray ? obj.length : keys.length; i < end; i++) {
@PAEz
PAEz / vlc-delete.lua
Last active June 25, 2023 15:13
vlc-deleteFile - windows working
--[[
Copyright 2015-2016 surrim
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@PAEz
PAEz / dom-helper.js
Created March 31, 2017 07:36 — forked from SitePointEditors/dom-helper.js
Mini jQuery, sort of.
/**
* A collection of helper prototype for everyday DOM traversal, manipulation,
* and event binding. Sort of a minimalist jQuery, mainly for demonstration
* purposes. MIT @ m3g4p0p
*/
window.$ = (function (undefined) {
/**
* Duration constants
* @type {Object}
@PAEz
PAEz / gulpfile.js
Created March 1, 2016 10:47
Simple script for scss/es6/haml. So I can do codepen like stuff offline. Pretty simple, needs some work, but meh, works for me ;p
// https://community.nitrous.io/tutorials/setting-up-gulp-with-livereload-sass-and-other-tasks
// Paths
var paths = {
scripts: ['src/*.es6'],
sass: ['src/*.scss'],
haml: ['src/index.haml'],
body: ['src/body.haml'],
dest: 'build'
};
@PAEz
PAEz / object.js
Last active January 6, 2016 18:58
Object iterate, toPath, map
function objectIterate(obj, callback, stack, cache) {
cache = cache || [];
for (var property in obj) {
if (obj.hasOwnProperty(property)) {
var value = obj[property];
if (typeof value == "object" && value !== null) {
if (cache.indexOf(value) !== -1) {
// Circular reference found, discard key
return;
}
@PAEz
PAEz / promise_while_loop.js
Last active February 5, 2017 06:33 — forked from victorquinn/promise_while_loop.js
Promise "loop" using the Bluebird library Updated to p1nox's comment from the original
/*
p1nox commented 19 days ago
I was digging a bit about this and I found some interesting links:
petkaantonov/bluebird#553 (comment)
http://stackoverflow.com/a/29396005
http://stackoverflow.com/a/24660323
Simplifications:
*/
@PAEz
PAEz / Plugin sockets with NodeBB 0.7.x
Last active August 29, 2015 14:27
Plugin sockets with NodeBB 0.7.x
The gists to plugin sockets with NodeBB 0.7.x
Getting settings/values from the server to the client.
https://community.nodebb.org/topic/5936/retrieve-setting-value-from-the-client-side