Skip to content

Instantly share code, notes, and snippets.

View ArrayIterator's full-sized avatar

ArrayIterator ArrayIterator

View GitHub Profile
@ArrayIterator
ArrayIterator / helper.js
Last active April 23, 2024 08:23
Helper for React.js (just like some php functions) to easier manage code
// noinspection RegExpRedundantEscape
export const RegexEmail = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
// username is start & end with alphanumeric, and only contains alphanumeric & underscore only
// minimum 3 characters & maximum 120 ((?i)[a-z0-9][a-zA-Z0-9_]{1,118}[0-9a-zA-Z])
// 118 = 120 - 2 ( 2 as start & end )
export const RegexUsername = /^[a-zA-Z0-9][a-zA-Z0-9_]{1,118}[0-9a-zA-Z]$/;
/**
* Copy text to clipboard
* @param {Blob|string|*} blob
@ArrayIterator
ArrayIterator / PasswordHash.php
Last active April 6, 2024 23:25
Password Hashing Library with OpenWall PasswordHash Compat
<?php
declare(strict_types=1);
namespace ArrayIterator\Hashing;
use Exception;
use function chr;
use function crypt;
use function max;
use function min;
// stpd! chatgpt 3.5 generated
// phpDateConverter.js
/**
* Converts PHP date format to JavaScript date format.
* @param {string} phpFormat - PHP date format string.
* @returns {string} - JavaScript date format string.
*/
function convertPhpToJsDateFormat(phpFormat) {
// Mapping of PHP date format characters to JavaScript equivalents
@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 / FileResponder.php
Created October 24, 2023 19:26
File Serve Responder
<?php
namespace MyNamespace;
class FileResponder
{
protected $file = null;
protected $mimetype = 'application/octet-stream';
/**
@ArrayIterator
ArrayIterator / KINSING-KDEVTMPFSI.md
Last active October 18, 2023 19:29
Kil the kinsing & kdevtmpfsi malware

Kinsing File Affected

Too many problem solver on the internet does not resolve the malware infection about kinsing. The kinsing malware also infected the network & listen into network port.

Edit the crontab

Do not delete the url of wget or curl command from kinsing malware, just comment it like. There are script checking about the crontab file

# your another crontab
If you'r using MAC Intel CPU you want to use VMware to virtual your desired OS such Windows or Ubuntu on the MAC OS you need to download VMware Fusion Player first then it has two version Pro and Player, the Player version is free for personal use but you need to create VM account to download and licence key.
You can create account to download yourself here:
https://customerconnect.vmware.com/group/vmware/evalcenter?p=fusion-player-personal
If you don't want to create account to get license, you can try below original license key for VMware Fusion Player:
COMPONENT:
VMware Fusion Player – Personal Use
@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 / stateless-cookie-user-using-password_hash.php
Last active December 17, 2022 04:48
Php very simple stateless cookie with user id & sign using password_hash
@ArrayIterator
ArrayIterator / Simple.php
Created December 2, 2022 19:25
Simple Event Dispatcher
<?php
declare(strict_types=1);
namespace Events;
use Closure;
class Simple
{
/**