Skip to content

Instantly share code, notes, and snippets.

View styledev's full-sized avatar

Dewey Bushaw styledev

  • Speak4
  • Arlington, VA
View GitHub Profile
@amboutwe
amboutwe / yoast_seo_disable_single_post.php
Last active May 25, 2021 22:39
Remove Yoast from front end for a single post or page
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast from front end for a single post or page
* Credit: Dodinas https://stackoverflow.com/questions/37845968/disable-wordpress-yoast-seo-on-single-page
* Last Tested: Nov 08 2019 using Yoast SEO 12.4 on WordPress 5.2.4
* Note: For version 14+, please use the code here: https://developer.yoast.com/customization/yoast-seo/disabling-yoast-seo
*********
* DIFFERENT POST TYPES
* Post: Change 123456 to the post ID
* Page: Change is_single to is_page and 123456 to the page ID
@rskelley9
rskelley9 / how_to.md
Last active October 31, 2023 10:28
Workaround: Connect your Chromecast to a Hotel Wireless Network

About

I recently relocated for new employment. I've been staying in an extended stay hotel for about 3 weeks now. The hotel I'm staying in gives its guests free Wifi access. However, it requires users to accept terms and conditions on a splash page via browser interface before they can use the network. This makes it difficult to use my Chromecast with the network, as it doesn't have a means of accessing that splash page. While I could call the IT help line, I decided to explore a work-around.

Like many networks, my hotel's network attempts to improve security by using MAC address filtering. Luckily, Mac OS X (10.4 - 10.10) makes it very easy to spoof your network card's MAC address.

Here's how to add a devices like Chromecast, AppleTV, Roku to a wireless network that requires a browser to authenticate and accept terms and conditions.

Before You Start

@mannieschumpert
mannieschumpert / gist:e5cec8723247f9490016
Created October 9, 2014 21:01
Remove Gravity Forms' "Add Form" button from all WYSIWYG editors
<?php
add_filter( 'gform_display_add_form_button', function(){return false;} );
@tbrianjones
tbrianjones / Inflect.php
Last active February 21, 2024 21:28
A PHP Class for converting English words between Singular and Plural.
<?php
// original source: http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/
/*
The MIT License (MIT)
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy
@styledev
styledev / gfcptaddonbase.diff
Created April 17, 2012 01:57
Gravity Forms + Custom Post Types Plugin - Dropdown Selected Feature
2012-04-18 12:13:43.378 osascript[26429:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.
--- /Users/bushaw/Desktop/gravity-forms-custom-post-types/gfcptaddonbase.php
+++ gfcptaddonbase.php
@@ -246,21 +246,24 @@
*/
function setup_post_type_field( &$field, $post_type ) {
$first_choice = $field['choices'][0]['text'];
- $field['choices'] = $this->load_post_type_choices( $post_type, $first_choice );
@semmons99
semmons99 / gist:1053857
Created June 29, 2011 13:42
bankers rounding
def round(n)
cents = n * BigDecimal("100")
remainder = cents % BigDecimal("1")
if remainder == BigDecimal("0")
n
elsif remainder < BigDecimal("0.5")
n.round(2, BigDecimal::ROUND_DOWN)
elsif remainder > BigDecimal("0.5")
n.round(2, BigDecimal::ROUND_UP)