This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script will create transpile ES6 (with JSX) support in babel | |
# to ES5 that evaluatable in regular node.js | |
# Script will create a filename.out file, evaluates it, then remove the file. | |
# | |
# First off, you'll need Node.js. | |
# | |
# Steps: | |
# 1) Install babel globally npm install -g babel-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
''' | |
A response to: http://stackoverflow.com/questions/19831757/how-to-create-macro-in-sublime-text-3-with-saveas-and-close-file-command | |
Save the current file with encoding UTF8, then close. | |
To trigger the command with 'Command Option Shift 8', | |
add the following to your Sublime Text > Preferences > Keybindings - User |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function post_type_custom_fields_general_featured() { | |
global $post; | |
$custom = get_post_custom($post->ID); | |
$is_featured = is_custom_boolean($custom, 'custom_is_featured'); | |
echo '<p class="checkbox" style="padding-top: 5px;">'; | |
echo '<input type="hidden" name="custom_is_featured" value="false" />'; | |
echo '<input style="margin-right: 5px;" id="custom_is_featured" value="true" type="checkbox" name="custom_is_featured"' . (($is_featured) ? ' checked="checked"' : '') . ' />'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iframe { | |
max-width: 100%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -wKU | |
# Adapted from Brett Terpstra’s original “Markdown to Evernote” service (http://brettterpstra.com/a-better-os-x-system-service-for-evernote-notes-with-multimarkdown/) | |
# Martin Kopischke 2011 – License: Creative Commons Attribution Share-Alike (CC BY-SA) 3.0 Unported (http://creativecommons.org/licenses/by-sa/3.0/) | |
# Changes: – create only one Evernote note per (Multi)Markdown input passed (instead of one per line) | |
# – do not choke on shell escape characters (use Tempfile instead of shell pipe for osascript) | |
# – default to MultiMarkdown 3 executable (instead of MMD 2 Perl script) | |
# – make smart typography processing optional (set SMARTY to 'false' to bypass processing; | |
# note smart typography cannot be disabled in MMD 3.0 and 3.0.1 | |
# – handle both smart typography processing scripts (ie. SmartyPants.pl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Inspired by a snippet by Justin Tadlock (http://justintadlock.com/) posted here: http://elliotjaystocks.com/blog/tutorial-multiple-singlephp-templates-in-wordpress/#comment-2383 | |
add_filter( 'category_template', 'my_category_template' ); | |
// I believe *_template hooks exist for just about every type of template so it's easy to apply to other templates as well | |
function my_category_template( $template ) { | |
if( is_category( 1 ) ) // We can search for categories by ID | |
$template = locate_template( array( 'template_id_A.php', 'category.php' ) ); |