Skip to content

Instantly share code, notes, and snippets.

View davekuhar's full-sized avatar
🧑‍🚀

Dave Kuhar davekuhar

🧑‍🚀
  • 19:03 (UTC -04:00)
View GitHub Profile
@davekuhar
davekuhar / git-version-control.markdown
Created October 2, 2021 19:49 — forked from albatrocity/git-version-control.markdown
Some basic Git instructions for Github for Mac and the command line

Using Git version control for code projects

Creating a new code repo from a local working copy

  1. From the repositories view in the app, drag the project folder to the bottom of the left sidebar.
  2. Hit "Yes" when it asks if you want to create a local git repository
  3. Go to "Changes" view (⌘2)
  4. Select the files that you want to commit their current state to the repository. You can view the changes of the file by clicking on the double up arrow on the file name bar.
@davekuhar
davekuhar / bb-search.php
Created November 10, 2019 20:38 — forked from TwisterMc/bb-search.php
Beaver Builder - Add Search to Mobile
<?php
/**
* Add Search Box to Mobile
* Adds a search box to mobile, below the header.
* To move it above the header, change fl_after_header to fl_before_header
*/
function bbMenuPolish_addMobileSearch(){
if ( wp_is_mobile() ) {
get_search_form();
}
@davekuhar
davekuhar / string-utils.js
Created June 28, 2019 16:17 — forked from jonlabelle/string-utils.js
Useful collection of JavaScript string utilities.
// String utils
//
// resources:
// -- mout, https://github.com/mout/mout/tree/master/src/string
/**
* "Safer" String.toLowerCase()
*/
function lowerCase(str){
return str.toLowerCase();
@davekuhar
davekuhar / image_optimize-wordpress.php
Created April 24, 2019 20:56 — forked from wycks/image_optimize-wordpress.php
Remove WordPress full size images from being inserted into a post + option to and add max size to to prevent users from inserting massive images.
<?php
/**
*
* This removes the ability to add the FULL image size into a post, it does not alter or delete the image
* Add whataever extra image sizes to the insert dropdown in WordPress you create via add_image_size
*
* For now we have to do it this way to make the labels translatable, see trac ref below.
*
* If your theme has $content_width GLOBAL make sure and remove it
@davekuhar
davekuhar / enqueue-font-awesome-5.php
Last active February 22, 2019 19:53 — forked from Pross/functions.php
Font Awesome 5
add_action( 'wp_enqueue_scripts', function() {
wp_enqueue_style( 'font-awesome-5' );
} );
@davekuhar
davekuhar / gettext-filter.php
Created February 7, 2019 06:46 — forked from BFTrick/gettext-filter.php
Use the gettext WordPress filter to change any translatable string.
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Related Products' :
$translated_text = __( 'Check out these related products', 'woocommerce' );
@davekuhar
davekuhar / gettext-filter-multiple.php
Created February 7, 2019 06:40 — forked from BFTrick/gettext-filter-multiple.php
Use the gettext WordPress filter to change any translatable string.
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Sale!' :
$translated_text = __( 'Clearance!', 'woocommerce' );
//Add adsense to top of post
function my_post_top_meta_close() {
echo '<div> &nbsp; </div>';
echo '<div> Add adsense script here</div>';
}
add_action( 'fl_post_top_meta_close', 'my_post_top_meta_close' );
@davekuhar
davekuhar / anchorlinks.js
Created May 18, 2018 18:37 — forked from neilgee/anchorlinks.js
Anchor offset links from one page to another offsetting a fixed header
@davekuhar
davekuhar / Contract Killer 3.md
Created March 14, 2017 16:03 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post