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 / inspect.php
Created June 15, 2015 15:17
lists handles for all enqueued styles and scripts
/*
* Lists out the handles for all enqueued styles and scripts.
* Credit: http://wordpress.stackexchange.com/questions/54064/how-do-i-get-the-handle-for-all-enqueued-scripts
*/
function wp_inspect_scripts() {
global $wp_scripts;
echo '<pre><h1>Script Handles</h1><ul>';
foreach( $wp_scripts->queue as $handle ) :
echo '<li>' . $handle . '</li>';
@smutek
smutek / post_format_icon.php
Created March 9, 2016 03:22
Function for Post Format icons
<?php
/**
* Output Post Format icons
*
* Outputs an icon for each post format. Set up to use Fontawesome,
* but can be used with anything, or you can just use CSS.
*
* @return string
*/
function post_format_icon() {
<?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 / 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 / content-page.blade.php
Last active February 16, 2022 16:11
Simple Sage 9 Slider with Slick
@php(the_content())
@if($images)
@include('partials/slider')
@endif
@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;"
@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;"