Skip to content

Instantly share code, notes, and snippets.

@bryanwillis
bryanwillis / bs-loaded.php
Last active November 5, 2021 19:23
Bootstrap check if loaded
<!-- BOOTSTRAP JS WITH LOCAL FALLBACK-->
<script type="text/javascript" src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
<script> if(typeof($.fn.modal) === 'undefined') {document.write('<script src="//www.mysite.com/js/v/bootstrap-2.1.1.js"><\/script>')}</script>
<!-- BOOTSTRAP CDN FALLBACK CSS-->
<script>$(document).ready(function() {
var bodyColor = $('body').css("color"); if(bodyColor != 'rgb(51, 51, 51)') {$("head").prepend("<link rel='stylesheet' href='//www.mysite.com/css/fw/bootstrap-combined-2.1.1.css' type='text/css' media='screen'>");}
});</script>
@bryanwillis
bryanwillis / licence activation.php
Last active October 18, 2021 23:52 — forked from mattradford/licence activation.php
ACF5 Pro ( Advanced Custom Fields ) licence activation. Could be adapted for any other plugin that requires a licence key, but doesn't yet support defining it in wp-config. Fires on theme activation.
// Place this in wp-config
define('ACF_5_KEY','yourkeyhere');
// Set ACF 5 license key on theme activation. Stick in your functions.php or equivalent.
function auto_set_license_keys() {
if ( !get_option('acf_pro_license') && defined('ACF_5_KEY') ) {
$save = array(
'key' => ACF_5_KEY,
http://blog.petrockblock.com/wp-content/uploads/2015/02/Setup-RPI.txt
dtparam=sd_overclock=100
https://github.com/RetroPie/RetroPie-Manager
http://xpadder.com/?lang=english&country=US
http://www.multibootpi.com/
http://forums.launchbox-app.com/topic/30078-exiting-emulators-with-xbox-360-controller/
https://en.wikipedia.org/wiki/List_of_video_game_emulators#Nintendo_64
<?php
/* remove css for header background image */
remove_action('wp_head', 'genesis_custom_header_style');
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
# Hide Wordpress Specific Schema
@bryanwillis
bryanwillis / bootstrap-genesis-structural-wraps.php
Last active October 5, 2020 18:16
Adding genesis-structural-wrap-support to Bootstrap Genesis
<?php
/**
* Module: Bootstrap Genesis Plugin - Structural Wraps
* Author: Bryan Willis
*/
/**
* Add theme support for structural wraps
*/
function gb3_add_theme_support_structural_wraps() {
@bryanwillis
bryanwillis / delete-missing-images.php
Last active September 6, 2020 11:39
delete image references to the wordpress database when they have been deleted from from the uploads folder and not from the admin interface
<?php
// Only run the code if we are in the admin
if ( is_admin() ) :
class WordPressdeleteMissingImages {
// Action/Filter Hooks
function __construct() {
add_action( 'admin_menu', array( &$this, 'add_page' ) );
.mt-0 {
margin-top: 0px !important;
}
.mt-5 {
margin-top: 5px !important;
}
.mt-10 {
margin-top: 10px !important;
}
.mt-15 {
@bryanwillis
bryanwillis / actual-filtering-function.php
Last active February 13, 2020 04:05
Easily Modify genesis theme framework classes on the fly using genesis_attr();
<?php
/**
* Adds Filters Automatically from Array Keys
*/
add_action('genesis_meta', 'bw_add_array_filters_genesis_attr');
function bw_add_array_filters_genesis_attr()
{
$filters = bw_merge_genesis_attr_classes();
foreach(array_keys($filters) as $context) {
$Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path\$Installer
@bryanwillis
bryanwillis / custom_progress_bar.php
Created October 23, 2019 21:54 — forked from jwahlin/custom_progress_bar.php
Combine Formidable stats with SKT Skillset shortcode
add_shortcode( 'custom_progress_bar', 'add_custom_progress_bar' );
function add_custom_progress_bar( $atts ) {
if (
! isset( $atts['user'] ) || ! isset( $atts['goal'] ) || ! isset( $atts['year_month'] )
|| ! isset( $atts['title'] ) || ! isset( $atts['goal_id'] )
) {
return '';
}
// Get total amount completed for the current month