Skip to content

Instantly share code, notes, and snippets.

View smutek's full-sized avatar

Jimmy Smutek smutek

View GitHub Profile
@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' ) ) :
@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

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 / 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;"
<?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 / 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
*
@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' );

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