Skip to content

Instantly share code, notes, and snippets.

@devinsays
devinsays / ActionSchedulerHighVolume.php
Last active March 24, 2023 14:25
Modifications to Action Scheduler in order to run higher volumes of actions.
View ActionSchedulerHighVolume.php
<?php
/**
* High volume modifications to Action Scheduler.
*
* Adapted from https://github.com/woocommerce/action-scheduler-high-volume/
*
* Increase Action Scheduler batch size, concurrency, timeout period, and claim action query
* ORDER BY to process large queues of actions more quickly on servers with more server resources.
*
* @package UniversalYums\ActionScheduler
@heyMP
heyMP / utils.js
Last active March 24, 2023 14:25
Recursively find elements through multiple layers of shadow dom.
View utils.js
/**
* Example usage:
* const hotspots = findAllDeep(element, `[slot*="hotspot"]`, 10);
*/
const findAllDeep = (parent, selectors, depth = null) => {
let nodes = new Set();
let currentDepth = 1;
const recordResult = (nodesArray) => {
for (const node of nodesArray) {
nodes.add(node)
@bszwej
bszwej / echo.js
Last active March 24, 2023 14:24
Pure Node.js echo server, that logs all incoming http requests (method, path, headers, body).
View echo.js
const http = require('http');
const server = http.createServer();
server.on('request', (request, response) => {
let body = [];
request.on('data', (chunk) => {
body.push(chunk);
}).on('end', () => {
body = Buffer.concat(body).toString();
View การทำระบบอนุมัติด้วย Google Form + Sheet + Notify + Email + PDF
//สำหรับฟอร์ม
function onFormSubmit() {
var token1 = ["token1"];//โทเค่นไลน์ผู้มีสิทธิ์อนุมัติ
var form = FormApp.openById('id form');
var fRes = form.getResponses();
var formResponse = fRes[fRes.length - 1];
var itemResponses = formResponse.getItemResponses();
@kurtis318
kurtis318 / How_to_install_ffmpef_on_CentOS_7.txt
Created October 7, 2017 05:06
How to install ffmpef on CentOS 7
View How_to_install_ffmpef_on_CentOS_7.txt
I needed to install ffmpeg on my CentOS 7 server. The following web site shows how to install the nux repo.
https://www.vultr.com/docs/how-to-install-ffmpeg-on-centos
Here are the commands:
sudo rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
sudo yum install http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
@notmandatory
notmandatory / gist:a7cade3468e90c699037292123a1ca1a
Last active March 24, 2023 14:17
Create core descriptor wallet
View gist:a7cade3468e90c699037292123a1ca1a
# install bitcoind via your favorite method
# start regtest bitcoind
mkdir -p /tmp/regtest1/bitcoind
bitcoind -datadir=/tmp/regtest1/bitcoind -regtest -server -fallbackfee=0.0002 -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0 -blockfilterindex=1 -peerblockfilters=1 -daemon
# cookie file location: /tmp/regtest1/bitcoind/regtest/.cookie
# create test bitcoind wallet
bitcoin-cli -datadir=/tmp/regtest1/bitcoind -regtest -named createwallet wallet_name="regtest1" disable_private_keys=true blank=true
@GaryJones
GaryJones / phpmd.xml
Created September 12, 2014 15:04
PHPMD Ruleset for a WordPress Theme
View phpmd.xml
<?xml version="1.0"?>
<ruleset name="phpmd.xml"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>PHPMD Ruleset for a WordPress Theme</description>
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag" />
<rule ref="rulesets/cleancode.xml/ElseExpression" />
<rule ref="rulesets/cleancode.xml/StaticAccess" />
@gnuton
gnuton / Mixamo.js
Last active March 24, 2023 14:10
Script which downloads all mixamo animations for one character.
View Mixamo.js
// Mixamo Animation downloadeer
//
// Author: Antonio Aloisio <gnuton@gnuton.org>
// Contributions: kriNon
//
// The following script make use of mixamo2 API to download all anims for a single character that you choose.
// The animations are saved with descriptive long names instead of the short ones used by default by mixamo UI.
//
// This script has been written by gnuton@gnuton.org and the author is not responsible of its usage
//