Skip to content

Instantly share code, notes, and snippets.

View joeyboli's full-sized avatar
💭
I may be slow to respond.

Joey 😎 joeyboli

💭
I may be slow to respond.
View GitHub Profile
@joeyboli
joeyboli / DomainValidation.php
Created April 2, 2024 22:37
Domain Validation in php
function checkDomain(string $url, string $remark = 'Domain Offline/invalid', int $timeout = 10): mixed
{
// Parse the URL to extract the host, port, and scheme
$parsedUrl = parse_url($url);
$host = $parsedUrl['host'] ?? $url;
$port = $parsedUrl['port'] ?? -1; // Use -1 if port is not specified
$scheme = $parsedUrl['scheme'] ?? 'http'; // Default to HTTP if scheme is not specified
// Check if the input is an IP address
$isIp = filter_var($host, FILTER_VALIDATE_IP);
@joeyboli
joeyboli / demo.php
Created June 14, 2023 20:30 — forked from freekrai/demo.php
PHP session-based rate limiter for APIs
<?php
date_default_timezone_set('America/Los_Angeles');
session_start();
include("ratelimiter.php");
// in this sample, we are using the originating IP, but you can modify to use API keys, or tokens or what-have-you.
$rateLimiter = new RateLimiter($_SERVER["REMOTE_ADDR"]);
$limit = 100; // number of connections to limit user to per $minutes
$minutes = 1; // number of $minutes to check for.
@joeyboli
joeyboli / myinternetradio
Created October 21, 2021 03:05
my personal internet radio
BOX MEDIA'S RADIO DATA.
---------------------------------------------------------------------
Station : BOX : 80's Radio
Stream URL : https://play.streamafrica.net/80sradio
Location : London, United Kingdom
Logo URL : https://icdn.streamafrica.net/boxradio/80s.jpg
@joeyboli
joeyboli / ukradio.m3u
Created October 10, 2021 16:51
UK Internet Radio List
All Stream URLS will be wrapped in https://play.streamafrica.net Links for permanent updates without us modifying links here.
BBC Radio 1
STREAM URL - https://stream.live.vc.bbcmedia.co.uk/bbc_radio_one
STATIC STREAM URL - https://play.streamafrica.net/bbcradio1
LOGO - https://i.ibb.co/DMVLTGJ/BFc-U2vj-UXh.png
BBC Radio 2
STREAM URL -
STATIC STREAM URL -