Skip to content

Instantly share code, notes, and snippets.

View craiglondon's full-sized avatar

Craig London craiglondon

View GitHub Profile
@EhsanCh
EhsanCh / fpm_get_status.php
Created February 19, 2023 10:54
PHP-FPM real-time status page (Single file without the need for web server configuration)
<?php
// Upload to private url or implement authorization...
if (isset($_GET["json"])) {
header("Content-type: application/json");
exit(json_encode( fpm_get_status() ));
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
@64bitint
64bitint / ActiveQueryRelationViaSubquery.php
Last active January 12, 2021 15:05
Yii2 via relations using subqueries
<?php
namespace app\components\db;
use yii\db\ActiveQuery;
use yii\db\Query;
/**
* Class ActiveQueryRelationViaSubquery
*
* This class extends the Yii ActiveQuery class to allow the use
* of sub queries for hasMany relations using the via() method by calling
@jgaydos
jgaydos / ubuntu18.04_php7.3_sqlsrv.sh
Last active November 21, 2022 21:02
Ubuntu 18.04 + PHP7.3 + SQLSRV
#!/bin/bash
#ubuntu 18.04
#php7.3
# install php ppa
apt -y install software-properties-common
add-apt-repository ppa:ondrej/php -y
apt update
@gskema
gskema / noinspection.php
Last active April 2, 2024 10:39
PhpStorm @noinspection list of all tags
<?php
/** @noinspection ? */
// PhpUndefinedGotoLabelInspection Undefined goto label
// PhpUndefinedVariableInspection Undefined variable
// PhpUndefinedMethodInspection Undefined method
// PhpUndefinedNamespaceInspection Undefined namespace
// PhpUndefinedClassInspection Undefined class
// PhpUndefinedFunctionInspection Undefined function
@prestia
prestia / installing_MTGA_on_macOS_with_Retina_support.md
Last active October 13, 2023 23:22
Instructions on how to install Magic the Gathering Arena on macOS with Retina support.

Installing MTGA on macOS using Wine, and making it look pretty!

The following instructions are heavily inspired by /u/uhohohdear. I modified uhohohdear's instructions and then added support for Retina/HiDPI displays and instructions about how to update MTGA.

IMPORTANT UPDATE: This will no longer work if you upgrade to macOS Catalina, as Wine and Wineskin are 32-bit. I'll update this Gist with 64-bit versions when they become available.

We're back in business!

It appears that the workarounds no longer work. A few people with Macs using Nvidia graphics cards are having success, but Macs with Intel and AMD GPUs crash regularly. At this time, the best way to play Arena on Mac is via Boot Camp or GeForce Now.

@GhazanfarMir
GhazanfarMir / Instructions.sh
Last active December 21, 2023 22:55
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@piedpiperRichard
piedpiperRichard / content.js
Last active August 26, 2023 13:03
Web developer 0.4.9 tools hacked and installing adware Decode
function md5cycle(x, k) {
var a = x[0], b = x[1], c = x[2], d = x[3];
a = ff(a, b, c, d, k[0], 7, -680876936);
d = ff(d, a, b, c, k[1], 12, -389564586);
c = ff(c, d, a, b, k[2], 17, 606105819);
b = ff(b, c, d, a, k[3], 22, -1044525330);
a = ff(a, b, c, d, k[4], 7, -176418897);
d = ff(d, a, b, c, k[5], 12, 1200080426);
c = ff(c, d, a, b, k[6], 17, -1473231341);
@bjorn2404
bjorn2404 / wp_kses_post_tags.php
Last active April 22, 2024 15:08
WordPress allow iFrames with wp_kses_post filter
<?php
/**
* Add iFrame to allowed wp_kses_post tags
*
* @param array $tags Allowed tags, attributes, and/or entities.
* @param string $context Context to judge allowed tags by. Allowed values are 'post'.
*
* @return array
*/
@Driver86
Driver86 / config.php
Created August 20, 2016 14:20
Yii2 Config for CDN-assets with current versions from Composer
<?php
$bundles = [];
foreach(json_decode(file_get_contents(__DIR__ . '/composer.lock'))->packages as $package) {
if (!preg_match('#^bower-asset/(.+)$#', $package->name, $name) or !preg_match('#^v?(.+)$#', $package->version, $version)) {
continue;
}
$name = $name[1];
$version = $version[1];
switch ($name) {
@ankurk91
ankurk91 / xdebug-mac.md
Last active March 9, 2024 22:20
php xDebug v3 on Ubuntu/Mac and phpStorm

🪲 Install and Configure xDebug v3 on MacOS for PhpStorm 🐘

  • Assuming that you have already installed php and apache via Homebrew

  • Install xDebug php extension

pecl channel-update pecl.php.net
pecl clear-cache

pecl install xdebug