Skip to content

Instantly share code, notes, and snippets.

Benji Bilheimer benjibee

Block or report user

Report or block benjibee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Block.php
<?php
namespace YourPlugin\Blocks;
abstract class Block{
/**
* Block title
*
* @var string
@tylerlwsmith
tylerlwsmith / cpt-example.php
Last active Sep 30, 2019
Custom Post Rewrites for Josh
View cpt-example.php
<?php
/*
Plugin Name: Example Custom Post Types
Plugin URI: https://deadhandmedia.com/
Description: Adds custom post types and taxonomies.
Version: 1.0.0
Author: Tyler Smith
Author URI: https://deadhandmedia.com/
License: GPL2
@croxton
croxton / SSL-certs-OSX.md Generate ssl certificates with Subject Alt Names
View SSL-certs-OSX.md

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@ethicka
ethicka / wp-start.sh
Last active Sep 20, 2019
WordPress Installation with the Roots/Sage Framework and VirtualHost Creation
View wp-start.sh
#!/bin/bash -e
##
# WordPress Installation and VirtualHost Creation
#
# Description: Installs a WordPress website in the ~/Sites folder, creates a homepage,
# cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks,
# clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes,
# installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file
# to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress
@nrollr
nrollr / ApacheHTTPSConfig.md
Last active Oct 19, 2019
Enable SSL in Apache for 'localhost' (OSX, El Capitan)
View ApacheHTTPSConfig.md

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /etc/apache2/ using Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys:

@macmladen
macmladen / rsync.sh
Last active Apr 10, 2019
rsync exclude patterns
View rsync.sh
# /dir/ means exclude the root folder /dir
# /dir/* means get the root folder /dir but not the contents
# dir/ means exclude any folder anywhere where the name contains dir/
# Examples excluded: /dir/, /usr/share/mydir/, /var/spool/dir/
# /dir means exclude any folder anywhere where the name contains /dir
# Examples excluded: /dir/, /usr/share/directory/, /var/spool/dir/
# /var/spool/lpd//cf means skip files that start with cf within any folder within /var/spool/lpd
#
# include, +
# exclude, -
@jjmu15
jjmu15 / in_viewport.js
Created Jan 27, 2014
check if element is in viewport - vanilla JS. Use by adding a “scroll” event listener to the window and then calling isInViewport().
View in_viewport.js
// Determine if an element is in the visible viewport
function isInViewport(element) {
var rect = element.getBoundingClientRect();
var html = document.documentElement;
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || html.clientHeight) &&
rect.right <= (window.innerWidth || html.clientWidth)
);
@joaocunha
joaocunha / How To Hide The Select Arrow On Firefox.md
Last active Feb 25, 2019
How to hide <select> dropdown's arrow in Firefox when using "-moz-appearance: none;".
View How To Hide The Select Arrow On Firefox.md

This is no longer a bug. I'm keeping the gist for historical reasons, as it helped to get it fixed. Make sure to read the notes by the end of the post.

How to remove hide the select arrow in Firefox using -moz-appearance:none;

TL;DR (or, the fix)

  1. Set -moz-appearance to none. This will "reset" the styling of the element;
  2. Set text-indent to 0.01px. This will "push" the text a tiny bit[1] to the right;
@charleslouis
charleslouis / custom-search-acf-wordpress.php
Last active Oct 17, 2019
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
View custom-search-acf-wordpress.php
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
You can’t perform that action at this time.