Skip to content

Instantly share code, notes, and snippets.

View smutek's full-sized avatar

Jimmy Smutek smutek

View GitHub Profile

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@smutek
smutek / gist:1fc1f492b1aebbddda8d
Created August 28, 2014 15:32
WP Theme Customizer SVG Blues
/* Trying to get the theme customizer to accept SVG, no luck.... */
// add svg support for media uploader
function cc_mime_types( $mimes ){
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter( 'upload_mimes', 'cc_mime_types' );
@smutek
smutek / controller.php
Last active January 13, 2017 21:30
Bootstrap 4 navigation accounting for Blade in Sage 9
<?php
namespace App;
// Add to functions, or to a dedicated controllers file
// Needs a global body class to hook into
/**
* Navigation arguments
*
<?php
/**
* oEmbed Attributes
*
* Add parameters to oEmbed query string. Useful for
* turning off related videos and such.
*
* Basic field use: $video = videoLink('your_field_name');
* Add second param if in a repeater: $video - videoLink('your_subfield_name', true);
*
@smutek
smutek / sublime.setup.sh
Created January 22, 2017 19:54
Setup Sublime Text 3 on Fedora 25 - Assumes Sublime has been downloaded and moved to /opt/
SHORTCUT="[Desktop Entry]
Name=Sublime Text 3
Comment=Edit text files
Exec=/opt/sublime-text-3/sublime_text
Icon=/opt/sublime-text-3/Icon/128x128/sublime-text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"

Fix for Sublime not opening files via CLI command when ran from TMUX.

Install via brew: brew install reattach-to-user-namespace

Add to zshrc: set-option -g default-command "reattach-to-user-namespace -l zsh"

Restart Tmux server tmux kill-server

@smutek
smutek / brand.php
Last active January 20, 2018 11:43
Filter WordPress Custom Logo
<?php
/**
* Site Brand
*
* Output site branding
*
* Use native WordPress site logo with custom (bootstrap friendly) markup
* Falls back to text title if logo is not set.
*
* @param $html
@smutek
smutek / acf-slick-synced-slider.php
Created January 11, 2017 17:06
Synced Sliders. See the synced sliders demo at http://kenwheeler.github.io/slick/ This assumes Advanced Custom Fields repeater is being used, but the concept should work with any data source. Be sure to change out the field names and class names as needed.
<?php
/*
* Synced sliders,
*
* See the synced sliders example at http://kenwheeler.github.io/slick/
*/
// Make sure there's stuff to display
if ( have_rows( 'add_testimonials' ) ) :
<?php
/**
* Gravity Forms : Check if file is attached
*
* Send a different notification email depending on whether a file is attached or not.
*
* For some reason the file upload field is not available to use with conditional logic
* when processing a gravity forms submission. So you cannot by default do something
* like perform one action if a file is attached and perform another if it is not.
*
@smutek
smutek / addSimplenote.sh
Created January 22, 2017 21:35
Setup Simplenote on Fedora 25. Assumes Simplenote has been added to /opt/
SHORTCUT="[Desktop Entry]
Name=SimpleNote
Comment=Edit text files
Exec=/opt/Simplenote-linux-x64/Simplenote
Icon=/opt/Simplenote-linux-x64/Simplenote.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"