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 python | |
""" | |
<description> | |
This file is part of ZTC and distributed under the same license. | |
http://bitbucket.org/rvs/ztc/ | |
Copyright (c) 2011 Vladimir Rusinov <vladimir@greenmice.info> | |
""" |
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
/* jQuery throttle https://github.com/cowboy/jquery-throttle-debounce */ | |
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this); | |
;(function($){ | |
/** | |
* Scenario - jQuery keyframe animation | |
* Author: Alex Batalov, radist2s@gmail.com | |
* | |
* Usage: | |
* |
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
<canvas id="show" width="300" height="300"></canvas> |
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
Object.size = function(obj) { | |
if (obj.hasOwnProperty){ | |
var size = 0, key; | |
for (key in obj) { | |
if (obj.hasOwnProperty(key)) size++; | |
} | |
return size; | |
} | |
else { | |
return Object.keys(obj).length |
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
//supportsSelector | |
;(function( global ) { | |
var doc = global.document, | |
hasQuerySelect = !!doc.querySelector; | |
function supportsSelector( selector ) { | |
var body = doc.body, | |
ret, div, style; |
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 | |
new WP_VK_Templater(); | |
/** | |
* Class WP_VK_Templater | |
* | |
* Add 'vk/' prefix to al links, and load for such links templates | |
* with '-vk' suffix: index-vk.php, page-vk.php, taxonomy-{name}-vk.php, etc. | |
*/ |
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 | |
/** | |
* Theme Native Code | |
**/ | |
add_action('wp_ajax_vk_comment_mail', 'vk_comment_mail'); | |
add_action('wp_ajax_nopriv_vk_comment_mail', 'vk_comment_mail'); | |
function vk_comment_mail() | |
{ | |
if (!isset($_POST['last_comment'])){ |
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('oembed_result', 'youtube_autoplay_filter', 10); | |
function youtube_autoplay_filter($iframe_html){ | |
$matches = array(); | |
if (!preg_match('~src="([^"]+?)"~iu', $iframe_html, $matches)) | |
{ | |
return $iframe_html; | |
} |
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
add_filter('tiny_mce_before_init', 'tinymce_before_init_extend'); | |
add_filter('teeny_mce_before_init', 'tinymce_before_init_extend'); | |
function tinymce_before_init_extend($atts) | |
{ | |
$custom_options = array( | |
'content_css' => get_bloginfo('template_url') . '/css/editor.css' | |
); | |
return array_merge($atts, $custom_options); | |
} |
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
jQuery.eventSuffix = function(event, suffix){ | |
if (!suffix){ | |
return event | |
} | |
return jQuery.map(event.split(' '), function(i){ | |
return i ? i + '.' + suffix : null | |
}).join(' ') | |
} |
OlderNewer