Skip to content

Instantly share code, notes, and snippets.

View carlalexander's full-sized avatar

Carl Alexander carlalexander

View GitHub Profile
@carlalexander
carlalexander / expect-header-fix.php
Last active August 13, 2021 00:40
WordPress "Expect" header fix
<?php
/**
* By default, cURL sends the "Expect" header all the time which severely impacts
* performance. Instead, we'll send it if the body is larger than 1 mb like
* Guzzle does.
*/
function add_expect_header(array $arguments)
{
$arguments['headers']['expect'] = '';
@carlalexander
carlalexander / keybase.md
Last active April 28, 2021 20:47
keybase.md

Keybase proof

I hereby claim:

  • I am carlalexander on github.
  • I am carlalexander (https://keybase.io/carlalexander) on keybase.
  • I have a public key ASAeNjSudK8Ar5DH54HtLiabfIcP4VDFerAVPQwo_HSvbwo

To claim this, I am signing this object:

@carlalexander
carlalexander / AdminPage.php
Last active January 27, 2024 14:07
WordPress and the single responsibility principle
<?php
namespace WPMemeShortcode;
/**
* The WordPress Meme Shortcode admin page.
*
* @author Carl Alexander
*/
class AdminPage
@carlalexander
carlalexander / bootstrap-formlabel.js
Created November 9, 2011 04:02
Form label plugin for bootstrap
!function( $ ){
/* FORM LABEL PLUGIN DEFINITION
* ============================ */
$.fn.formLabel = function ( options ) {
var options = $.extend({}, $.fn.formLabel.defaults, options);
return this.each(function () {
var $holding = $(this),
$input = $holding.find(':input'),