This file contains hidden or 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
| // http://css-tricks.com/transitions-only-after-page-load/ | |
| .preload * | |
| -webkit-transition: none !important | |
| -moz-transition: none !important | |
| -ms-transition: none !important | |
| -o-transition: none !important |
This file contains hidden or 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
| //http://jsfiddle.net/vYb72/1/ | |
| /* | |
| * @param String frame_id The id of the div containing the frame | |
| * @param String func Desired function to call, eg. "playVideo" | |
| * @param Array args (optional) List of arguments to pass to function func*/ | |
| function callPlayer(frame_id, func, args){ | |
| /*func: playVideo, pauseVideo, stopVideo, ... Full list at: | |
| * http://code.google.com/apis/youtube/js_api_reference.html#Overview */ | |
| if(!document.getElementById(frame_id)) return; | |
| args = args || []; |
This file contains hidden or 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: Email Obfuscation Shortcode | |
| Plugin URI: https://gist.github.com/1424515 | |
| Description: Shortcode for including emails into content and keeping spambots clueless. [obf email="email@example.com" noscript="what's shown to bots/people without javascript"] | |
| Version: 0.1 | |
| Author: Ismo Vuorinen | |
| Author URI: http://github.com/ivuorinen | |
| */ |
This file contains hidden or 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
| $server_url = $_SERVER['HTTP_HOST']; | |
| $site_url = 'http://'; | |
| $env; | |
| switch ( $server_url ) { | |
| // Prod | |
| case 'example.com': | |
| $env = 'prod'; |
This file contains hidden or 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 | |
| // Expects a YouTube URL. Returns the video ID | |
| function ob_parse_youtube_url($url) { | |
| parse_str(parse_url($url, PHP_URL_QUERY), $url_array); | |
| return $url_array['v']; | |
| } |
This file contains hidden or 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 | |
| // https://github.com/welaika/wordless/blob/master/wordless/helpers/log_helper.php | |
| /** | |
| * Prints the specified variable inside <pre> tags. | |
| * | |
| * @param string $var | |
| * The variable to be printed | |
| * | |
| * @ingroup helperfunc |
This file contains hidden or 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
| // Sets gets the initial height of the question and sets it to the alt tag | |
| $('#frequently-asked-questions .question .content') | |
| .each(function(i){ | |
| $(this) | |
| .attr('alt', $(this).height() ); | |
| }); | |
| // Sets all the questions height to 0 | |
| $('#frequently-asked-questions .question .content') | |
| .css({ |
This file contains hidden or 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
| // Stores a reference to all input with a placeholder attribute | |
| var $inputs = $('input[placeholder]'); | |
| if (!Modernizr.input.placeholder) { | |
| $inputs.each(function(i, el) { | |
| var $el = $(el), | |
| placeholder = $el.attr('placeholder'); | |
| // Sets the input value to be the same as the placeholder | |
| $el.attr('value', placeholder); |
This file contains hidden or 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
| // Need to abstract this into a plugin | |
| for(var i = 0; i < document.styleSheets[0].rules.length; i++) { | |
| var selectorText = document.styleSheets[0].rules[i].selectorText; | |
| if( selectorText === 'h1') { | |
| console.log(document.styleSheets[0].rules[i].style.marginBottom); | |
| } | |
| } |