Skip to content

Instantly share code, notes, and snippets.

@cfxd
cfxd / class-membership.php
Created February 15, 2019 12:46 — forked from wturnerharris/class-membership.php
Class to make things members-only in WordPress.--This class depends on a custom capability called 'is_approved_member' for user member access and the custom post meta key '_members_only' as a post-level custom field.
<?php
/**
* Custom class for WP_Membership routines.
*
*
* @package WP_Membership
* @since WP_Membership 0.1
*/
if(realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"]))
@cfxd
cfxd / gulp_module_installation
Last active January 29, 2019 20:04
Gulpfile and module installation for UnCSS + Gulp + Sage 8.3.0
$ npm install gulp-uncss gulp-exec --save-dev
@cfxd
cfxd / _quickview.scss.liquid
Created August 12, 2018 14:55 — forked from kellyvaughn/_quickview.scss.liquid
Shopify Quick View
#quick-view {
display: flex;
height: 100%;
justify-content: flex-end;
flex-wrap: wrap;
position: relative;
-ms-overflow-style: -ms-autohiding-scrollbar;
.qv-product-images {
width: 60%;
height: auto;
@cfxd
cfxd / sync
Last active July 15, 2018 02:07
Database sync Ansible playbook run with ansible-playbook sync.yml -i hosts/sync -e "src=development dest=staging site=cfx"
[development]
127.0.0.1 ansible_ssh_port=2222 ansible_ssh_private_key_file=/Users/cfx/Sites/trellis/.vagrant/machines/default/virtualbox/private_key
[staging]
my-staging.com
@cfxd
cfxd / sticky_footer.html
Created September 19, 2014 00:03 — forked from aalaap/gist:3066704
Sticky footer for Bootstrap
// Update PHP version when using AMP setup from https://alanthing.com/blog/2014/12/22/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew/
$ brew install php72 --with-fpm --without-apache --with-homebrew-curl --with-homebrew-openssl --without-snmp
@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
.your-row-class > *:nth-child(3n+4) {
clear: left;
}
}
@cfxd
cfxd / remove_wp_selfies.php
Last active December 13, 2017 18:15
Remove Existing Self Linking Images ("WP Selfies") in WordPress. See http://cfxdesign.com/remove-existing-self-linking-images-in-wordpress
<?php
function remove_self_linking_images() {
$all_ids = new WP_Query(array(
'post_type' => array('post', 'page'), // feel free to add custom post types here if necessary
'posts_per_page' => -1,
'post_status' => 'any',
'fields' => 'ids'
));
@cfxd
cfxd / keybindings.json
Last active November 21, 2017 21:12
Visual Studio Code settings
// Place your key bindings in this file to overwrite the defaults
[
{ "key": "ctrl+1", "command": "" },
{ "key": "ctrl+2", "command": "" },
{ "key": "ctrl+3", "command": "" },
{ "key": "ctrl+4", "command": "" },
{ "key": "ctrl+5", "command": "" },
{ "key": "ctrl+6", "command": "" },
{ "key": "ctrl+7", "command": "" },
{ "key": "ctrl+8", "command": "" },
@cfxd
cfxd / no-thanks-godaddy.txt
Last active June 28, 2017 05:19
GoDaddy® Clause I use in all of my client agreements
<MY BIZ NAME> chooses not to do business with and will not perform site deployments to, site maintenance on, or site migrations to GoDaddy® or its affiliates (including MediaTemple®) due to its unwieldy hosting platform, its past CEO's inhumane treatment of animals, its deceptive and sexist advertising practices, and its past support for SOPA (the proposed invasive intellectual property rights bill which prompted Reddit, Wikipedia, and others to shut down their sites in protest).
For more details, please see http://karveldigital.com/why-i-dont-use-godaddy-you-shouldnt-either/ and http://godaddyhostingsucks.com/.
Clients already hosted with GoDaddy may secure more reliable, user-friendly, and ethical hosting through <YOUR PREFERRED REFERRAL HOSTS>.