Skip to content

Instantly share code, notes, and snippets.

<?php
namespace YourPlugin\Blocks;
abstract class Block{
/**
* Block title
*
* @var string
@tylerlwsmith
tylerlwsmith / cpt-example.php
Last active November 10, 2019 16:40
Custom Post Rewrites for Josh
<?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
@paulund
paulund / phpcs.xml
Created August 20, 2017 16:50
PHP PSR-2 CodeSniffer Config for Laravel
<?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.
-->
@macmladen
macmladen / rsync.sh
Last active August 11, 2023 22:43
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, -
@joaocunha
joaocunha / How To Hide The Select Arrow On Firefox.md
Last active December 10, 2023 13:05
How to hide <select> dropdown's arrow in Firefox when using "-moz-appearance: none;".

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 December 15, 2023 09:11
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?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;
}
@ethicka
ethicka / wp-start.sh
Last active December 27, 2023 07:10
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
@croxton
croxton / SSL-certs-OSX.md
Last active March 3, 2024 18:58 — forked from leevigraham/Generate ssl certificates with Subject Alt Names on OSX.md
Generate ssl certificates with Subject Alt Names

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:

@Rodrigo54
Rodrigo54 / php-html-css-js-minifier.php
Last active March 11, 2024 12:27 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
@nrollr
nrollr / ApacheHTTPSConfig.md
Last active March 11, 2024 13:32
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 Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys: