A novice's attempt to understand binary formatting.
Because I was really fucking curious.
The following is a batshit-insane attempt to manually decode a PGP key file, based on the logic used in OpenPGP.js
/** | |
* Proxy for the `wp` object, with fallback | |
* to experimental names and error throwing | |
* when accessing a non-existent item (intended | |
* for debugging purposes). | |
*/ | |
export default new Proxy( {}, { | |
get( cache, moduleName, reciever ) { | |
if ( typeof cache[ moduleName ] === 'undefined' ) { | |
if ( typeof wp[ moduleName ] === 'undefined' ) { |
.wp-block-premise-map { | |
.google-map-canvas { | |
height: 400px; | |
background: $color-grey; | |
} | |
.google-map-search { | |
font-size: 16px; | |
padding: 10px 80px 0 0; | |
input { |
( function( $ ) { | |
// Store the original method for all other uses | |
var oldRemoveClass = $.fn.removeClass; | |
// Replace existing method iwth new version | |
$.fn.removeClass = function( className ) { | |
if ( className instanceof RegExp ) { | |
// Run a regex replace on each element's class name list | |
return $( this ).each( function() { | |
var classes = $( this ).attr( 'class' ) || ''; |
<?php | |
/* | |
Plugin Name: nLingual localize_here() fix | |
Description: A fix for nLingual to ensure localized URLs have any extras on the end preserved. | |
Version: 1.0.0 | |
Author: Doug Wollison | |
Author URI: http://dougw.me | |
License: GPL2 | |
*/ |
I hereby claim:
To claim this, I am signing this object:
jQuery.fn.maxDimension = function( property ) { | |
var max = 0; | |
jQuery( this ).each( function() { | |
var value = jQuery( this )[ property ](); | |
if ( value > max ) { | |
max = value; | |
} | |
}); |
add_filter('the_content', function($content){ | |
global $shortcode_tags; | |
$tagnames = array_keys($shortcode_tags); | |
$tagregexp = join( '|', array_map('preg_quote', $tagnames) ); | |
// Convert [tagname="mainproperty" to [tagname "mainproperty" (still accessible by $atts[0]) | |
$content = preg_replace("/\\[($tagregexp)=/s", '[$1 ', $content); | |
return $content; |
(function( $ ) { | |
// Convert a className string into a classList array | |
function makeList( string ) { | |
// trim whitespace | |
string = ( string || '' ).replace( /^\s+|\s+$/g,'' ); | |
if ( string ) { | |
return string.split( /\s+/ ); | |
} else { | |
return []; | |
} |