Skip to content

Instantly share code, notes, and snippets.

View Zackio's full-sized avatar

Zackary Allnutt Zackio

View GitHub Profile
@hgrimelid
hgrimelid / php-dyld.md
Created August 17, 2018 07:36
php: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib

After upgrading to Node v.10.9.0 via Homebrew the following error message was thrown from PHP:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found

Reinstall PHP to fix, for me that's:

@2aces
2aces / futta-gutenprint.php
Created February 6, 2018 21:55
Frank Goossens (Futta) function to extract blocks from WP Gutenberg (Proof of Concept) as https://blog.futtta.be/2018/01/25/how-to-extract-blocks-from-gutenberg/
// proof-of-concept to extract all WordPress Gutenberg's blocks as array
// author: Frank Goossens (Futta)
// source: https://blog.futtta.be/2018/01/25/how-to-extract-blocks-from-gutenberg/
add_action('the_content','gutenprint',10,1);
function gutenprint($html) {
// check if we need to and can load the Gutenberg PEG parser
if ( !class_exists("Gutenberg_PEG_Parser") && file_exists(WP_PLUGIN_DIR."/gutenberg/lib/load.php") ) {
include_once(WP_PLUGIN_DIR."/gutenberg/lib/load.php");
}
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active January 31, 2024 14:45
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@amix
amix / sorts.py
Created March 19, 2016 11:10
The confidence sort in pure Python (from Reddit's codebase)
# Rewritten code from /r2/r2/lib/db/_sorts.pyx
from math import sqrt
def _confidence(ups, downs):
n = ups + downs
if n == 0:
return 0
z = 1.281551565545
<?php
// To be used by theme authors to avoid duplicate favicon code now that Site Icons have been added to WordPress 4.3
// If a Site Icon hasn't been set or if the `has_site_icon` function doesn't exist (ie older than WordPress 4.3)
if ( ! ( function_exists( 'has_site_icon' ) && has_site_icon() ) ) {
// your theme specific custom favicon code goes here
}
<?php
/**
* Escape all translations with
*/
__( ‘Some String’, ‘text-domain’ ); _e( ‘Some string’, ‘text-domain’ );.
/**
* When there is no HTML use:
*/
<?php
/*
Register Fonts
*/
function studio_fonts_url() {
$font_url = '';
/*
Translators: If there are characters in your language that are not supported
by chosen font(s), translate this to 'off'. Do not translate into your own language.
@grappler
grappler / Theme-review-links
Last active May 19, 2022 06:08
WordCamp Köln Contributor Day Theme Review Info Links
@dtbaker
dtbaker / envato.lib.php
Created May 26, 2015 10:19
Envato PHP library by @sowailem
<?php
/**
* @file
* Integration layer to communicate with the Envato API.
*
* @see https://build.envato.com/api
*
* @outher Abdullah Sowailem.
*/
@UltimateWoo
UltimateWoo / custom-woocommerce-loop.php
Created March 21, 2015 21:20
Custom query and loop for WooCommerce
<?php
if ( is_shop() || is_product_category() || is_product_tag() ) { // Only run on shop archive pages, not single products or other pages
// Products per page
$per_page = 24;
if ( get_query_var( 'taxonomy' ) ) { // If on a product taxonomy archive (category or tag)
$args = array(