Skip to content

Instantly share code, notes, and snippets.

View ericmann's full-sized avatar
⚒️
Creating ...

Eric Mann ericmann

⚒️
Creating ...
View GitHub Profile
php-8.3.0RC4.tar.bz2
SHA256 hash: 3d0fe29e0a4ed225840f93f6fbbb2ff1cb14f7f2307f76a9d926f326e6eddda0
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEESx/A2d+SMhztn2FdvsVV4ioUNVMFAmUlZHoACgkQvsVV4ioU
NVO9YA//ThXvAaabRCIbry2kY2IUt/z+6l/tIoO3u0D4Q1OoZGEf9/jCZ6ZXc1eP
az0/D39kJIYkot04B2Uj2ZGbHTJLMHYGh5AaHheEfgPKAaJd19nqtwke60M79J9N
cWkUEeK+aOnfjeTqDw85mF76YzkPbThAidcSnJOgrOmB5VkOOwRJyEA934umigPj
2OiSK5Ax5LeTqyqW09mgq0xOu+lJsoVFsP6u6HV8L3tFYvnJNIXmjI12bNIS/S2h
@ericmann
ericmann / Fortress.Options.php
Last active September 20, 2023 04:13
Encrypted Options
<?php
/**
* Encryption operations for working with WordPress options to store data
* in the options table. Not all options will be encrypted. You will need
* to wire up selection of options to be protected separately.
*
* @package Fortress
*/
namespace DisplaceTech\Fortress\Options;
php-8.3.0RC2.tar.bz2
SHA256 hash: fa6c59a3f173004f67f4c88324529419fcd3c58bb211150beabf90cfcf83963c
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEESx/A2d+SMhztn2FdvsVV4ioUNVMFAmUATH0ACgkQvsVV4ioU
NVPybRAAsdGSjD1rHra7RldOjk6gHW+a1445aqDBNEALkmQ4N9X6UB+mlRG14WfZ
sjKUVxDSpQWM1DFn8e5YedfuIzC8U7z+Hx90IR06TOU3TXAfGuzUAnnrNucXxiC8
YP6dbxN9GEKKwaBKVcQx/0wJzuOjU77bUON6GRwXVm3Of6IVicQnSCv+K4HuraIu
qSS+FOpG4WQXkSeReGsmySL8V5zpHANGrV7bZhjYwh/O/bFzziNj/4CWMnTTizlP
php-8.3.0beta3.tar.bz2
SHA256 hash: 5eb68715570583d9fb7ba1c713223c580b313835f16bef64e53bb913e865465a
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEESx/A2d+SMhztn2FdvsVV4ioUNVMFAmTb0tMACgkQvsVV4ioU
NVNkjw//b+RjklyCcRrBFGPOLCfvSZzsopU0K5MOB0EVPZRmoGsUF9XINKvCJBNH
Y7oigJthkoTTLUrj2IA8aG3lwFPkmKSsQvbVGADdCru+O72lj9GZq1gCumOKNJ0s
Yj+0jok07BrcoxtRaNU5YB4qBpcc8h4PqDai1tkmnJNeYsUFGiCytdwgoybnJZzf
ECd7//61unYgBoHszIlScBRNHup6j4ZOwNfkKb6lDIVhR6LJiiy2xbqfYsTI/qw8
php-8.3.0beta1.tar.bz2
SHA256 hash: b0396cd69708d1b370d21ff0b2cc20114e00318d43b4ae4c1039755508cee671
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEESx/A2d+SMhztn2FdvsVV4ioUNVMFAmS3FlcACgkQvsVV4ioU
NVMyDQ//X+cGRPKd6I6tar67t1Fwso+FH8di0395VLiT/nG91x10ZZPIEU8tsv0S
3w4lygsfge37tZTukWabuDI/PH04Vz76yLKP9B5QlWGY3Sf+KcKugfuDv/EIon6r
vC7t5vwxlpQ1CC3q3WwCHgf4Wzipud508n9XJnnaRv1RkKSbM579CwTHsdvotOYo
oU9md+MT/IdhF2bRJ5ZRn2iniKiYYcswUfKSh5wca58F/80jG49tDLj7K6EvwEWf
php-8.3.0alpha2.tar.bz2
SHA256 hash: 96bc4ba7f0664810ae72d12f31dd322bcac19639b2d2c9949d51e7e8b6b7822e
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEESx/A2d+SMhztn2FdvsVV4ioUNVMFAmSR0MgACgkQvsVV4ioU
NVMJrQ/+IzWl+Hpo6BAyOv19Gg3ggQgR2n017DT9AzKwXGugxrBSDIpBpAk+tBSh
efezJ3NWPgRjQu/n4XleDjY7B5qPs6pe8O+494IQO6R+eDsxlFB/GeuRVpzdm+ir
iV5Mx//eu7Nd4WMf1HalJAhAUNRlegQTf9PvqlvtOXYnNBRw6IuNZ2heEn+nBIKh
zenaCJhQSZ6y5fPmm8iEeDYwgbs/KH/qEtYuVtSvtpYSNcQFO9kaKrKpIdNgBhzF
@ericmann
ericmann / gist:3788867
Created September 26, 2012 16:00
Auto-generate URLs

#The Problem

I need to create custom links based on the current page URL within WordPress. The system needs to work with both pretty and default permalinks. I have a custom rewrite endpoint defined that needs to be added.

So if the URL of the page is http://site.url/?p=25 I need to create http://site.url/?p=25&custom=1

If the URL is http://site.url/2012/post-slug I need to create http://site.url/2012/post-slug/custom

I can't find a built-in function to do this, so I'm thinking I'll need to build my own to do this. Some pseudo-code:

@ericmann
ericmann / wp-index-redis.php
Last active September 3, 2019 07:48
Alternative Index file for WordPress that uses Redis as a full-page cache.
<?php
/**
* WP Redix Index
*
* Redis caching system for WordPress. Inspired by Jim Westergren.
*
* @author Jeedo Aquino
* @see http://www.jeedo.net/lightning-fast-wordpress-with-nginx-redis/
* @see http://www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/
*/
@ericmann
ericmann / default-cached.conf
Last active August 8, 2019 14:41
Redis-cached WordPress Nginx configuration file.
server {
listen 80;
server_name XX.XX.XX.XX;
root /var/www/html/default;
location /index.php {
alias /var/www/html/default/wp-index-redis.php;
}
location / {
@ericmann
ericmann / predis.php
Created May 11, 2013 23:59
Predis - a flexible Redis client for PHP
<?php
namespace Predis;
class PredisException extends \Exception { }
class ClientException extends PredisException { } // Client-side errors
class AbortedMultiExec extends PredisException { } // Aborted multi/exec
class ServerException extends PredisException { // Server-side errors
public function toResponseError() {
return new ResponseError($this->getMessage());