Skip to content

Instantly share code, notes, and snippets.

View EvanHerman's full-sized avatar
🐈
Cats, Code, WordPress

Evan Herman EvanHerman

🐈
Cats, Code, WordPress
View GitHub Profile
@EvanHerman
EvanHerman / config.yml
Last active December 3, 2021 02:56
WordPress Plugin CircleCI 2.0 Config - PHPCS, PHPUnit and rsync Deployment
workflows:
version: 2
main:
jobs:
- php56-build
- php70-build
- php71-build
- php72-build
- deploy:
requires:
@EvanHerman
EvanHerman / rw-elephant-inventory-gallery-filters.php
Last active October 15, 2018 00:09
RW Elephant Inventory Gallery - Product Data Filters
@EvanHerman
EvanHerman / bootstrap-alert.css
Created March 17, 2018 13:09
Bootstrap Alert CSS
.alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
}
.alert h4 {
margin-top: 0;
color: inherit;
@EvanHerman
EvanHerman / apache-ci.conf
Last active August 25, 2017 21:10 — forked from petersuhm/apache-ci.conf
Circle CI Apache configuration file
<VirtualHost *:80>
LoadModule php7_module /opt/circleci/php/7.1.3/usr/lib/apache2/modules/libphp7.so
DocumentRoot "/home/ubuntu/wordpress"
ServerName wordpress.dev
ServerAlias *.dev
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
@EvanHerman
EvanHerman / circle.yml
Last active August 25, 2017 23:24 — forked from petersuhm/circle.yml
Example CircleCi configuration for WP Pusher
machine:
timezone:
Europe/Copenhagen
php:
version: 5.3.3
# This will be added to the `/etc/hosts` file
hosts:
wordpress.dev: 127.0.0.1
@EvanHerman
EvanHerman / circle.yml
Created August 24, 2017 17:49 — forked from Arjeno/circle.yml
Always use the latest version of Chrome on CircleCI
# This makes sure Chrome is always up to date in your test suite
# On average this adds about 10 seconds to your build suite
# Be sure to use Ubuntu 14.04 (Trusty) in the CircleCI's OS setting (Settings > Build Environment)
dependencies:
pre:
- curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome.deb
- sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
- rm google-chrome.deb
@EvanHerman
EvanHerman / dynamic-post-tags.php
Last active May 3, 2017 12:43
Populate the WordPress post tags with the values from the WordPress post categories on the save_post action hook.
<?php
/**
* Dynamically set the post tags to mirror the post categories.
*
* @action save_post
*
* @param integer $post_id The post ID.
*/
function dynamic_post_tags( $post_id ) {
@EvanHerman
EvanHerman / update-user-by-email.php
Created January 31, 2017 13:59
Update WordPress user password by email address
<?php
/**
* Update an existing user by email address
*
* @author Code Parrots <support@codeparrots.com>
*/
function update_user_password_by_email() {
$user = get_user_by( 'email', 'email@example.com' );
@EvanHerman
EvanHerman / gist:dfd2a8c4f2f129b65a54344a97ffd80e
Created December 17, 2016 19:08 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@EvanHerman
EvanHerman / custom-read-more-text.php
Last active September 20, 2019 02:30
Timeline Express Custom Read More Text
<?php // Do not include this line - this is here for syntax highlighting only
/**
* Alter the read more text on the timeline
*
* @param string $text The read more link text.
* @param integer $post_id The post ID.
*
* @return string The final read more link text.
*/