Skip to content

Instantly share code, notes, and snippets.

View holisticnetworking's full-sized avatar
😎
Makin' teh codz.

Thomas Belknap holisticnetworking

😎
Makin' teh codz.
View GitHub Profile
@holisticnetworking
holisticnetworking / Makefile
Created February 13, 2020 17:11 — forked from pwenzel/Makefile
Wordpress Makefile Workflow
.PHONY: install
install: clean wordpress phpunit wp-cli
git submodule init;
@echo "\n\nNOTICE: You may need to configure a MySQL database for your Wordpress installation. Just run:"
@echo " mysql -u root -p;"
@echo " CREATE DATABASE example_site; \n"
wordpress: latest.tar.gz
tar -zxvf latest.tar.gz;
@holisticnetworking
holisticnetworking / gist:0827c2dc67d6bcaf987ce8ee9cccda0a
Created September 24, 2019 15:06
Error from force-build process.
[opensalt@devlosiapp01 2os]$ make force-build
touch -c composer.lock
touch -c yarn.lock
bin/composer install --no-interaction
Cannot create cache directory /composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /composer/cache/files/, or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 235 installs, 0 updates, 0 removals
- Installing ocramius/package-versions (1.5.1): Downloading (100%)
@holisticnetworking
holisticnetworking / index.html
Created March 25, 2019 17:34
Slick Carousel Opens Synced Bootstrap Modal
<div class="slider-nav">
<div data-toggle="modal" data-target="#myModal"><img src="http://placehold.it/390x245&text=1" alt=""></div>
<div data-toggle="modal" data-target="#myModal"><img src="http://placehold.it/390x245&text=2" alt=""></div>
<div data-toggle="modal" data-target="#myModal"><img src="http://placehold.it/390x245&text=3" alt=""></div>
<div data-toggle="modal" data-target="#myModal"><img src="http://placehold.it/390x245&text=4" alt=""></div>
<div data-toggle="modal" data-target="#myModal"><img src="http://placehold.it/390x245&text=5" alt=""></div>
<div data-toggle="modal" data-target="#myModal"><img src="http://placehold.it/390x245&text=6" alt=""></div>
<div data-toggle="modal" data-target="#myModal"><img src="http://placehold.it/390x245&text=7" alt=""></div>
</div>
<?php
if ( username identified in system ) {
// Do things for an identified user
} else {
echo "Looks like you aren't logged in!";
}
<?php
if( $person is in group Van and in group Musical ) {
echo "Well, hello, Eddie!";
} else {
// This block of code could address Vans who aren't Musical,
// Musical people who aren't Vans, and all Europeans.
//
// That's a very big, not very specific list!
echo "Hello, stranger!";
}
<?php
// Assuming the equation: 2 + 2 = $x
if( $x == 4 ) {
echo "Hurray! You win a thing!";
} else {
error_log( "Boo, dude. You screwed that up." );
}
@holisticnetworking
holisticnetworking / acf-local-json-after.php
Last active March 8, 2019 14:32
A successful addition to my theme to allow parent/theme failover of local JSON
<?php
// Integrating Advanced Custom Fields:
remove_filter( 'acf/settings/save_json', 'settings_save_json' );
add_filter( 'acf/settings/save_json', function() {
return get_stylesheet_directory() . '/Library/Acf-Json';
} );
remove_filter( 'acf/settings/load_json', 'settings_load_json' );
add_filter( 'acf/settings/load_json', function( $paths ) {
array_push(
$paths,
@holisticnetworking
holisticnetworking / acf-local-json-before.php
Last active March 8, 2019 14:32
A first attempt at applying new directories with parent failovers to ACF local JSON
<?php
// Integrating Advanced Custom Fields:
add_filter( 'acf/settings/save_json', function() {
return get_stylesheet_directory() . '/Library/Acf-Json';
} );
add_filter( 'acf/settings/load_json', function( $paths ) {
unset( $paths[0] );
$paths[] = get_template_directory() . '/Library/Acf-Json';
$paths[] = get_stylesheet_directory() . '/Library/Acf-Json';
return $paths;
SYR-TBELKNAP-MAC18:source tbelknap$ npm install
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
> node-sass@3.13.1 install /Applications/MAMP/htdocs/InFocusTheme/source/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/darwin-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/darwin-x64-57_binding.node":
HTTP error 404 Not Found
@holisticnetworking
holisticnetworking / set_default.php
Last active June 28, 2018 16:53
When working with the WordPress Customizer, you may want to be sure a theme mod gets set on save. Unless a setting gets changed in the Customizer, it's values do not go into the final theme_mods data. This object snippet will do just that for you. The Gist includes both the function to use and the hook to attach it to for checking on save.
/**
* On Customizer save, checks for and sets a few
* default settings.
* @param \WP_Customize_Manager $wpcustomizer
*/
public function set_defaults( \WP_Customize_Manager $wpcustomizer ) {
$mod = get_theme_mod( 'my_theme_mod_name' );
if( empty( $mod ) ) {
set_theme_mod( 'my_theme_mod_name', 'x' );
}