Skip to content

Instantly share code, notes, and snippets.

View dabernathy89's full-sized avatar

Daniel Abernathy dabernathy89

View GitHub Profile
{"scrollwheel":false,"styles":[{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":-100},{"lightness":30},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":-25},{"saturation":-100}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]}]}
@dabernathy89
dabernathy89 / wp_custom_posts_navigation
Created March 17, 2015 16:39
WordPress custom posts navigation function
<?php
// Adapted from Underscores' posts navigation function
// Uses Bootstrap classes
// In a default query:
// custom_posts_navigation();
// In a custom query:
// custom_posts_navigation($my_custom_query);
@dabernathy89
dabernathy89 / gf_button_addclass.php
Last active December 23, 2015 07:19
Add class(es) to Gravity Forms buttons
add_filter("gform_submit_button", "alter_form_submit_button", 10, 2);
function alter_form_submit_button($button, $form){
if ($form["button"]["type"] == "text") {
// (class=) followed by (single or double quote) followed by (anything that is not a single or double quote)
$pattern = '/(class=)(\'|")([^\'"]+)/';
$replacement = '${1}${2}${3} btn';
$newbutton = preg_replace($pattern, $replacement, $button);
if ( !is_null($newbutton) ) {
return $newbutton;
}
class SimpleEndpoint {
public function hooks() {
add_action( 'init', array( $this, 'add_endpoint' ) );
add_action( 'template_redirect', array( $this, 'handle_request' ) );
}
public function add_endpoint() {
add_rewrite_tag( '%foobar%', '([^&]+)' );
add_rewrite_rule( '^(foobar)/?$', 'index.php?$matches[1]=1', 'top' );
}

Keybase proof

I hereby claim:

  • I am dabernathy89 on github.
  • I am dabernathy89 (https://keybase.io/dabernathy89) on keybase.
  • I have a public key ASBoFatFFwKWw1_xz99UcyHPVG_3rJSp-yyWJdlvab_kjQo

To claim this, I am signing this object:

@dabernathy89
dabernathy89 / gravity-forms-field-groups.php
Created March 13, 2013 19:55
Insert this script into functions.php in your WordPress theme (be cognizant of the opening and closing php tags) to allow field groups in Gravity Forms. The script will create two new field types - Open Group and Close Group. Add classes to your Open Group fields to style your groups. Note that there is a stray (but empty) <li> element created. …
<?php
/*
Insert this script into functions.php in your WordPress theme (be cognizant of the opening and closing php tags) to allow field groups in Gravity Forms. The script will create two new field types - Open Group and Close Group. Add classes to your Open Group fields to style your groups.
Note that there is a stray (but empty) <li> element created. It is given the class "fieldgroup_extra_li" so that you can hide it in your CSS if needed.
*/
add_filter("gform_add_field_buttons", "add_fieldgroup_fields");
function add_fieldgroup_fields($field_groups){
foreach($field_groups as &$group){
@dabernathy89
dabernathy89 / conference-slack-reasons.md
Created January 30, 2018 20:19
Why would a conference Slack be useful?

In addition to normal conference discussion that happens on Twitter, I think that having a dedicated place for conference discussion (Slack, Discord, or something else) would be useful.

There are a few limitations with Twitter:

  • conversations are not centralized around topics
  • not everyone wants to use their Twitter to discuss conference stuff (some people are more selective about how they tweet)
  • 280 character limit, no formatting
  • hashtag gets flooded with well-meaning but possibly over-eager live-tweeters

Here are the benefits of using a messaging app in addition to Twitter:

@dabernathy89
dabernathy89 / component.vue
Last active June 21, 2018 14:57
How to wrap a component that uses slots?
<v-server-table
:columns="columns"
:options="mergedOptions"
:name="tableName"
:ref="tableName">
<template slot="beforeFilter">
<slot name="beforeFilter"></slot>
</template>
<template slot="afterFilter">
FFFCCCGGMMMHHHHHHHHBNNNNJJIISSSSLLLLLLLLJBBBBRRRRCCCZZZZZEEEJJJJJMMMMMMRRFFFFQQQNIIMMMMMZZZZEEAAIIIADDSSSSSYYYQQKKKKKKKKKNNNNCCCCCXSSSSSSSSSSSSSSCCCVVAAAAAABZZZZDDDDDDDDDDDDDDHHHBBBBBUUUUAAACCCCTTVVVVUUGGCCCCCCCCCCIIOOOOEEERRRRRRRRRRRRRSNNWWWGGGKKKKHHHVVVBBFFFFCCCIIIIFFFFFFFZZZRZZZCCCCCCCCCCCCCCCCCCNNNNCCCCCVFFFFFFNNNNNNNNNNNNTTTTXXXXFFFFFFFAASSSSSSSSSNNNNNNNYYRRHHHKKKKKKATTTTXXBBBBBBBFFFMMMMMMMMUUUUUZZZGRRXEEEAJJUUUUUUWAAGVVVVVVVVVVVVVVUUUUUUUUKWRGGGGGGGDAAAAAAAAAAAAEEEEEEEQQQQQQQQQQQBBBBBFFFSAAAAAAAXXXXXXXPPPPPPPWWWWWWWNNPWWGGVVVVTYYYYYYYYYYYYRRRRRRFFFFHTDRRRDDDDHBBBBBBBBSXXXXXXXXXXXXXXFFFFFIIJLLLLLLLLLQQQQVVVVGCCCCCCCCCCCCCCPPPPPPJJNNNNCCCCCRRLLMMUFSSSPPPPPSSSSSSSSSSSSSSFFFFWEEEEEEEEEEEEEEEEZZNNNMNNNNNNNNNMMMBBBBBLLLLSSMMMMMMMMMMMMMMUUUUUUUUUUUUWWWWWWWWWWWIIIOOOBCCRPPPPPZOZWPPPPPPPPIVVVDZZZZZZZIIIIDDDDDDDDDDDDDDDDDDDDDDLLLLLJNNNUUUUAAAFHHHHIIIIGGGVPPPPPPPLLAAYYYYYYYYYYYYYYYYYEEEEEEZZZGGGGRRRRRRRRRRNNNNNNNNNPYYEEXXXXXXXLHHHHBCCMRRRRRRRRRTTTTTTTPPPYYYDDDLLLNVVVVVVVVVVEHHHHHHHHHHHHHHHZWPIQQQQQQQQQJJJJJJJJJJJJ
Hey y'all! Let's do a Southeast PHP Wurstcon! It's happening on Friday, after the after-party (exact time TBD).
The restaurant, Bavarian Bierhaus, is located in the mall next to the Grand Ole Opry:
https://goo.gl/maps/qnrPjuBZHXF2
Let me know if you'd like to attend or if you have thoughts on the schedule below!