Skip to content

Instantly share code, notes, and snippets.


Benji Bilheimer benjibee

View GitHub Profile
View Block.php
namespace YourPlugin\Blocks;
abstract class Block{
* Block title
* @var string
tylerlwsmith / cpt-example.php
Last active Nov 10, 2019
Custom Post Rewrites for Josh
View cpt-example.php
Plugin Name: Example Custom Post Types
Plugin URI:
Description: Adds custom post types and taxonomies.
Version: 1.0.0
Author: Tyler Smith
Author URI:
License: GPL2
paulund / phpcs.xml
Created Aug 20, 2017
PHP PSR-2 CodeSniffer Config for Laravel
View phpcs.xml
<?xml version="1.0"?>
<ruleset name="Laravel Standards">
The name attribute of the ruleset tag is displayed
when running PHP_CodeSniffer with the -v command line
argument. The description tag below is not displayed anywhere
except in this file, so it can contain information for
developers who may change this file in the future.

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   =

Additional FQDNs can be added if required:

ethicka /
Last active Feb 19, 2020
WordPress Installation with the Roots/Sage Framework and VirtualHost Creation
#!/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
Rodrigo54 / php-html-css-js-minifier.php
Last active Nov 18, 2020 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
View php-html-css-js-minifier.php
* -----------------------------------------------------------------------------------------
* Based on ``
* -----------------------------------------------------------------------------------------
// HTML Minifier
function minify_html($input) {
nrollr /
Last active Nov 20, 2020
Enable SSL in Apache for 'localhost' (OSX, El Capitan)

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 sudo mkdir /etc/apache2/ssl
Next, generate two host keys:

macmladen /
Last active Jul 12, 2020
rsync exclude patterns
# /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 / 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 ( >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || html.clientHeight) &&
rect.right <= (window.innerWidth || html.clientWidth)
joaocunha / How To Hide The Select Arrow On
Last active Apr 22, 2020
How to hide <select> dropdown's arrow in Firefox when using "-moz-appearance: none;".
View How To Hide The Select Arrow On

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;
You can’t perform that action at this time.