Skip to content

Instantly share code, notes, and snippets.

View ArrayIterator's full-sized avatar

ArrayIterator ArrayIterator

View GitHub Profile
@ArrayIterator
ArrayIterator / Renderer.php
Created February 11, 2022 04:41
custom wordpress sitemap styling & sitemap generator
<?php
namespace ArrayIterator\WP\Components\Sitemap;
use DOMDocument;
use WP_Sitemaps_Renderer;
if (!class_exists(WP_Sitemaps_Renderer::class)) {
return;
}
@ArrayIterator
ArrayIterator / ubuntu (16|18).04 - network interface (ifup down)
Last active November 4, 2022 13:45
assign / implement ip6 OVH Ubuntu
# /etc/network/interfaces.d/50-cloud-init.cfg
# command : ifup -a
# 2001:4860:4860::8888 2001:4860:4860::8844 is a google dns
iface ens3 inet6 static
address ipv_6
netmask 64
gateway ipv_6_gateway
dns-nameservers 2001:4860:4860::8888 2001:4860:4860::8844
@ArrayIterator
ArrayIterator / example.com.host.conf
Last active December 18, 2021 16:10
php-fpm 8.0 + nginx server block.
server {
# http
listen 80;
# https
# pastikan sudah di deklarasi untuk
# ssl_certificate & ssl_certificate_key
# atau deklarasi server block ini
listen 443 ssl http2;
#!/usr/bin/env bash
C_USER='user'
CWD_DIR=/home/${C_USER}/host/aurys.fr
CONFIG_DIR=${CWD_DIR}/config
BACKUP_DIR=${CWD_DIR}/database
CONFIG_FILE=${CWD_DIR}/public/wp-config.php
COMMITDATE=`date '+%Y-%m-%d %H:%M:%S'`
C_NAME='${C_USER}'
C_EMAIL='${C_USER}@127.0.0.1'
@ArrayIterator
ArrayIterator / root.color.css
Last active January 5, 2023 05:13
CSS :root Based Color - flatuicolor https://www.flatuicolorpicker.com/
/*!
* Factory Color
* Based On: https://www.flatuicolorpicker.com/
*/
:root {
/* BLUE */
--shark-blue: #24252a;
--serpa-blue: #013243;
--ebony-clay-blue: #22313f;
--pickled-bluewood: #34495e;
@ArrayIterator
ArrayIterator / random_char_permutations.php
Last active December 28, 2022 18:34
Random Character Permutation
<?php
/**
* Create possible random array permutation by characters
*/
function random_array_permutations($array_or_string, int $length, int $max = 10, array $must_be_not_in = []) : array
{
if (!is_array($array_or_string)) {
$array_or_string = str_split((string) $array_or_string);
}
$count = count($array_or_string);
<?php
class Event
{
protected static $events = [];
public static function register(
$name,
$callable,
$priority = 10
) {
@ArrayIterator
ArrayIterator / Events.php
Last active February 24, 2022 03:38
Simple Event Dispatcher (Just Like Simple WordPress Hooks - Without Accepted Args)
<?php
declare(strict_types=1);
namespace ArrayIterator\SimpleEvent;
use Countable;
use RuntimeException;
/**
* Class Events
# google
64.233.160.0/19 1;
66.102.0.0/20 1;
66.249.64.0/20 1;
72.14.192.0/18 1;
74.125.0.0/16 1;
209.85.128.0/17 1;
216.239.32.0/19 1;
64.18.0.0/20 1;
108.177.8.0/21 1;
<?php
// this route for git push notification and pull request
$this->post('/git_pull', function (ServerRequestInterface $request, ResponseInterface $response) {
$body = $request->getParsedBody();
$auth = $body['auth']??$request->getQueryParams()['auth']??null;
if ($auth !== null) {
$body['auth'] = $auth;
}
$payload = null;