This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Source Image: https://pixeljoint.com/pixelart/34353.htm | |
* | |
* How to source hexStr data: | |
* - Download image. | |
* - Resave as `input.bmp` in suitable bitmap editor (e.g. Aseprite) if necessary. | |
* - Rename to `input.txt`. | |
* - Open up & format with `([^ \n]{2})([^ \n]{2})( |\n)` -> `\1 \2 ` replacement regex. | |
* - Trim off trailing space. | |
* - Profit?! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 2be9bbc6b7996112c56c788a33907871bdc20bb1 Mon Sep 17 00:00:00 2001 | |
From: Andy Thomas <git@andythom.as> | |
Date: Thu, 8 Oct 2020 08:32:33 +0100 | |
Subject: [PATCH] S3AssetSourceType: Non-AWS Compatibility | |
- Add overridable default configuration for various S3 Asset Source attributes to allow compatibility with other S3-Compatible services (eg. DigitalOcean Spaces). | |
- Update/amend S3AssetSourceType to utilise new configuration. | |
- Amended S3 library class to support parsing of XML responses with a `text/xml` header. | |
--- | |
src/assetsourcetypes/S3AssetSourceType.php | 72 +++++++++++++++------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// UK telephone formats (ref: http://www.area-codes.org.uk/formatting.php#programmers) | |
// prefix:chunks (eg. 434 -> 4444 333 4444) - # = any 0-9 digit | |
$formats = array( | |
'1:45', | |
'1:46', | |
'11:334', | |
'1#1:334', | |
'13873:55', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var padleft = function(value,padding,chr) { | |
return (Array(++padding).join(chr || '0') + value).slice(-padding); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function quote_array_values($array) { | |
return explode(',', sprintf( | |
'"%s"', | |
implode('","', $array) | |
)); | |
} | |
$params = array( | |
'one', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$gd_functions = array( | |
'gd_info', | |
'getimagesize', | |
'getimagesizefromstring', | |
'image_type_to_extension', | |
'image_type_to_mime_type', | |
'image2wbmp', | |
'imageaffine', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('SHORTINIT',true); | |
$wp_dir = getcwd(); | |
// if WordPress isn't in the root (eg. set up for Git), do something like this: | |
// $wp_dir = getcwd() . '/path/to/wordpress/subdirectory'; | |
require_once($wp_dir . '/wp-load.php'); | |
if (isset($_GET['to'])) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function str_list_ended($value, $glue = ', ', $last = ' and ') { | |
return preg_replace( | |
"/($glue)(?!.+$glue)/", | |
$last, | |
(is_array($value) ? implode($glue, $value) : $value) | |
); | |
} |