Skip to content

Instantly share code, notes, and snippets.

View ArrayIterator's full-sized avatar

ArrayIterator ArrayIterator

View GitHub Profile
@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
@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 / CreditCard.php
Last active December 28, 2022 18:20
PHP Credit Card Generator / Validator
<?php
declare(strict_types=1);
namespace ArrayIterator\Generator;
/**
* Credit card validator & generator
*/
class CreditCard
{
@ArrayIterator
ArrayIterator / as-numbers.php
Last active October 31, 2023 20:54
array list of tld domain + supported sub domains, ipv4, ipv6, as-number include whois server
<?php
declare(strict_types=1);
// auto generated at : 2023-10-28T05:03:52+07:00
return [
'0-0' => [
'range' => [
0,
0,
],
@ArrayIterator
ArrayIterator / OATH.js
Last active December 27, 2024 16:47
OATH - HOTP (HMAC-based One-time Password Algorithm) - TOTP (Time-based One-time Password Algorithm)
/**
* OATH - HOTP (HMAC-based One-time Password Algorithm)
*
* @author ArrayIterator
* @link https://tools.ietf.org/html/rfc4226
* @link https://en.wikipedia.org/wiki/HMAC-based_One-time_Password_Algorithm
*/
class HOTP {
/**