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
// ABOUT | |
A simple LESS (http://lesscss.org) snippet based on http://snook.ca/archives/html_and_css/font-size-with-rem | |
It doesn't do much but saves you typing things twice, allowing you to use rem as a unit for font-sizes | |
and giving a px fallback for IE | |
// MIXIN | |
.font-size(@font-size: 16){ | |
@rem: (@font-size / 10); | |
font-size: @font-size * 1px; | |
font-size: ~"@{rem}rem"; |
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 | |
define('WYSIWYG_META_BOX_ID', 'my-editor'); | |
define('WYSIWYG_EDITOR_ID', 'myeditor'); //Important for CSS that this is different | |
define('WYSIWYG_META_KEY', 'extra-content'); | |
add_action('admin_init', 'wysiwyg_register_meta_box'); | |
function wysiwyg_register_meta_box(){ | |
add_meta_box(WYSIWYG_META_BOX_ID, __('WYSIWYG Meta Box', 'wysiwyg'), 'wysiwyg_render_meta_box', 'post'); | |
} |
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 | |
/* | |
Plugin Name: Mobile First Responsive Images | |
Description: Serve up smaller images to smaller screens. | |
Version: 0.1.1 | |
Author: Matt Wiebe | |
Author URI: http://somadesign.ca/ | |
*/ | |
/** |
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 | |
add_filter( 'template_include', 'ja_template_include' ); | |
/** | |
* Apply a template to all subcategories of a certain parent category. | |
* | |
* @author Jared Atchison | |
* @link http://www.jaredatchison.com/2011/10/02/taking-advantage-of-the-template_include-filter/ | |
* | |
* @param string $template Existing path to template file | |
* @return string Potentially amended path to template file |
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
# custom login link | |
RewriteRule ^login$ http://localhost/whitelabel/wp-login.php [NC,L] |
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 bash | |
echo "@@@ @@@ @@@@@@@@ @@@ @@@ @@@@@@@ @@@@@@@@ @@@ @@@ " | |
echo "@@@ @@@ @@@@@@@@ @@@@ @@@ @@@@@@@ @@@@@@@@ @@@ @@@ " | |
echo "@@! !@@ @@! @@!@!@@@ @@! @@! @@! !@@ " | |
echo "!@! @!! !@! !@!!@!@! !@! !@! !@! @!! " | |
echo " !@@!@! @!!!:! @!@ !!@! @!! @!!!:! @!@@!@! " | |
echo " @!!! !!!!!: !@! !!! !!! !!!!!: !!@!!! " | |
echo " !: :!! !!: !!: !!! !!: !!: !!: :!! " | |
echo ":!: !:! :!: :!: !:! :!: :!: :!: !:! " |
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 | |
bt_add_image_size( 'product-screenshot', 300, 300, array( 'left', 'top' ) ); | |
bt_add_image_size( 'product-feature', 460, 345, array( 'center', 'top' ) ); | |
add_filter( 'intermediate_image_sizes_advanced', 'bt_intermediate_image_sizes_advanced' ); | |
add_filter( 'wp_generate_attachment_metadata', 'bt_generate_attachment_metadata', 10, 2 ); | |
/** | |
* Registers a new image size with cropping positions | |
* |
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/ruby | |
# ruby script to make an unordered list from indented data. | |
data = %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip | |
result = "<ul>\n" | |
last_leading_space = "" | |
g_tab_width = 4 |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
.box-wrapper { | |
padding: 100px; } | |
.info { | |
width: 600px; } | |
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
var userAgent = navigator.userAgent.toLowerCase(); | |
jQuery.browser = { | |
version: (userAgent.match( /.+(?:rv|it|ra|ie|me|on)[\/: ]([\d.]+)/ ) || [])[1], | |
chrome: /chrome/.test( userAgent ), | |
safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ), | |
webkit: /webkit/.test( userAgent ), | |
opera: /opera/.test( userAgent ), | |
msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), | |
mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) |
OlderNewer