Skip to content

Instantly share code, notes, and snippets.

View crispy-computing-machine's full-sized avatar

Crispy Computing Machine. crispy-computing-machine

View GitHub Profile
<?php
/**
* @see https://crispy-computing-machine.github.io/Winbinder-Docs/
*/
/** @noinspection ALL */
const AppWindow = 1;
const ModalDialog = 2;
const ModelessDialog = 3;
const NakedWindow = 4;
diff -bur gd.c gd.c
--- gd.c 2024-04-10 10:19:28.000000000 -0400
+++ gd.c 2024-04-19 08:41:01.205119300 -0400
@@ -129,6 +129,13 @@
/* output streaming (formerly gd_ctx.c) */
static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn);
+
+/* Functions for BITMAP 24bits */
+static inline unsigned char *_gdex_write_uint16le(unsigned char *ptr, uint16_t n);
<?php
class Rule30ImageGenerator {
private $width;
private $height;
private $image;
public function __construct($width, $height) {
$this->width = $width;
$this->height = $height;
@crispy-computing-machine
crispy-computing-machine / algos.php
Created December 16, 2023 15:35
PHP Algorithms
<?php
function binarySearch(array $arr, $x): int {
$l = 0;
$r = count($arr) - 1;
while ($l <= $r) {
$mid = floor(($l + $r) / 2);
// Check if $x is present at mid
<?php
class SocketTransfer {
private $sock;
private $client;
private $publicKey;
private $privateKey;
private $verbose;
public function __construct($host, $port, $publicKeyPath, $privateKeyPath, $verbose = false) {
$this->publicKey = file_get_contents($publicKeyPath);
# Navigate to your project directory using the command prompt
cd path\to\your\project
# Initialize a new Git repository
git init
# Add all files to the staging area
git add .
# Commit the changes
@crispy-computing-machine
crispy-computing-machine / guzzleloadtest.php
Created December 10, 2023 13:37
Guzzle PHP Load Test
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Promise;
const TARGET_URL = 'https://example.com';
const CONCURRENT_REQUESTS = 100;
@crispy-computing-machine
crispy-computing-machine / curlloadtest.php
Created December 10, 2023 13:35
PHP Curl Load Test
<?php
// Define the URL of the website you want to test.
$targetUrl = 'https://example.com';
// Define the number of concurrent requests you want to make.
$concurrentRequests = 10;
// Create an array to store cURL handles.
$handles = array();
@crispy-computing-machine
crispy-computing-machine / feedreader.html
Created December 10, 2023 13:34
RSS JS Feed Reader
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RSS Feed Reader</title>
</head>
<body>
<div id="rssContainer"></div>
<?php
if(!defined('COMMONWORDS')) {
define('COMMONWORDS', [
"the",
"of",
"and",
"to",
"a",
"in",
"for",