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 | |
use Swoole\Http\Request; | |
use Swoole\Http\Response; | |
use Swoole\Http\Server; | |
$user = 'World'; | |
$server = new Server("0.0.0.0", 8003); |
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
{ | |
"require": { | |
"league/plates": "^3.4", | |
"slim/slim": "4.*", | |
"ilexn/swoole-convert-psr7": "^0.6.0", | |
"nyholm/psr7": "^1.5" | |
} | |
} |
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 textContent = "Some Text to be copied"; | |
const textBlob = new Blob([textContent], { type: "text/plain" }); | |
const data = [new ClipboardItem({"text/plain": textBlob})]; | |
navigator.clipboard.write(data).then(function() { | |
console.log("Copied to clipboard successfully!"); | |
}, function() { | |
console.error("Unable to write to clipboard. :-("); | |
}); |
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 nodeBase { | |
docker run --rm -v $(pwd):/app -w /app node:13 $1 $2 $3 $4 | |
} | |
function node { | |
nodeBase node $1 $2 $3 | |
} | |
function npm { | |
nodeBase npm $1 $2 $3 | |
} |
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
FROM php:7.4 | |
RUN apt-get update && apt-get install -y \ | |
libfreetype6-dev \ | |
libjpeg62-turbo-dev \ | |
libpng-dev \ | |
&& docker-php-ext-configure gd --with-freetype --with-jpeg \ | |
&& docker-php-ext-install -j$(nproc) gd | |
RUN apt-get install -y libzip-dev \ |
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
#!/usr/bin/env bash | |
# Start the supervisor program. | |
# /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf & | |
WORK_DIR=$1 | |
if [ ! -n "${WORK_DIR}" ] ;then | |
WORK_DIR="." | |
fi |
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 | |
/* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2014 Rob Dunham | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |
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 | |
function show_registered_filters( $hook = '' ) { | |
global $wp_filter; | |
if( empty( $hook ) || !isset( $wp_filter[$hook] ) ) | |
return; | |
echo '<pre>'; | |
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
var wpddb = {} | |
wpddb.contentTag = 'p'; | |
wpddb.contentClass = 'wpddb-content'; | |
(function (blocks, editor, element) { | |
var el = wp.element.createElement; | |
var RichText = editor.RichText; | |
blocks.registerBlockType('wpddb/promotion', { | |
title: 'WPDDB Promotion', |
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
#!/bin/bash | |
git diff $(echo $1 | git hash-object -w --stdin) $(echo $2 | git hash-object -w --stdin) --color-words=. |