Skip to content

Instantly share code, notes, and snippets.

View RichardTMiles's full-sized avatar
Kick it to Richard@Miles.Systems

Richard T. Miles RichardTMiles

Kick it to Richard@Miles.Systems
View GitHub Profile
@giladdarshan
giladdarshan / macos_php_build.md
Last active April 16, 2024 05:34
Steps to build / compile PHP from source on macOS

The following steps will describe how to build PHP from source including PHP's Apache module as it is no longer part of macOS starting with macOS Monterey.
If this is for a development environment, you can simply install PHP with Homebrew using the command brew install php. This guide is for cases where you need a more portable PHP without heavily dependening on external libraries.

  1. Install Homebrew
  2. Install the following Homebrew packages
    • libxml2
    • libiconv
    • apr
    • apr-util
  3. Build Apache, if PHP's Apache module is not required, skip to step 4.
@marshallswain
marshallswain / states.js
Created March 18, 2018 02:01
US States & Abbreviations as JavaScript Array
var usStates = [
{ name: 'ALABAMA', abbreviation: 'AL'},
{ name: 'ALASKA', abbreviation: 'AK'},
{ name: 'AMERICAN SAMOA', abbreviation: 'AS'},
{ name: 'ARIZONA', abbreviation: 'AZ'},
{ name: 'ARKANSAS', abbreviation: 'AR'},
{ name: 'CALIFORNIA', abbreviation: 'CA'},
{ name: 'COLORADO', abbreviation: 'CO'},
{ name: 'CONNECTICUT', abbreviation: 'CT'},
{ name: 'DELAWARE', abbreviation: 'DE'},
@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active May 5, 2024 06:11
UPDATE 2024/03: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@yajra
yajra / axios-401-response-interceptor.js
Last active September 20, 2023 06:24
Axios 401 response interceptor.
// Add a 401 response interceptor
window.axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
if (401 === error.response.status) {
swal({
title: "Session Expired",
text: "Your session has expired. Would you like to be redirected to the login page?",
type: "warning",
showCancelButton: true,
@MeLlamoPablo
MeLlamoPablo / nvmlink
Created February 1, 2017 11:34
Creates a symlink to /usr/bin/node after using nvm
@Wack0
Wack0 / 86box-td0.php
Last active March 20, 2018 22:34
Heap Overflow in .TD0 File Parser in 86Box build 204/205 (200c966/d3d2699) Code Execution PoC
<?php
/*
Heap Overflow in .TD0 File Parser in 86Box build 204/205 (200c966/d3d2699) can cause code execution
calc.exe PoC for both builds (the x86 AMD and Intel binaries!)
a *Ring of Lightning* production by slipstream/RoL!
Please note that due to lack of available hardware, exploitation of the AMD binaries has not been tested.
So you may have to fix that yourself.
86Box is a fork of PCem maintained by Battler aka Tenshi aka Kiririn/RoL.
@oh-ren
oh-ren / jquery.pjax.js
Last active February 28, 2024 06:20
pjax hacked, so it works with jQuery 3.0
/*!
* Copyright 2012, Chris Wanstrath
* Released under the MIT License
* https://github.com/defunkt/jquery-pjax
*/
(function($){
// When called on a container with a selector, fetches the href with
// ajax into the container or with the data-pjax attribute on the link
@nnja
nnja / gist:9136152c163091614e70defcf3753d06
Created May 26, 2016 20:25
How to access the raw markdown source for a github wiki page
https://raw.github.com/wiki/user/repo/page.md?login=login&token=token
@valfer
valfer / sendPush.txt
Last active April 29, 2024 12:29
Sending Push Notification with HTTP2 (and PHP) see entire post at: http://coding.tabasoft.it/ios/sending-push-notification-with-http2-and-php/
<?php
/**
* @param $http2ch the curl connection
* @param $http2_server the Apple server url
* @param $apple_cert the path to the certificate
* @param $app_bundle_id the app bundle id
* @param $message the payload to send (JSON)
* @param $token the token of the device
* @return mixed the status code (see https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH101-SW18)
@julienhay
julienhay / Selenium2TestCase-cheat-sheet.md
Last active July 17, 2021 20:50
Cheat sheet for using Selenium2TestCase v1.4 extension PHPUnit (PHPUnit_Extensions_Selenium2TestCase)

Cheat sheet for using Selenium2TestCase v1.4 extension PHPUnit

Prepare browser

  • Full screen browser
class ClassTest extends \PHPUnit_Extensions_Selenium2TestCase
{
    public static $browsers = array(
        array(