Discover gists
View ActionSchedulerHighVolume.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
View utils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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) |
View echo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//สำหรับฟอร์ม | |
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(); | |
View How_to_install_ffmpef_on_CentOS_7.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View gist:a7cade3468e90c699037292123a1ca1a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
View phpmd.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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" /> |
View Mixamo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
// |
NewerOlder