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
/** | |
* Create an observer pattern for jQuery | |
* allows you to alias trigger with publish, | |
* on with subscribe, | |
* and off with unsubcsribe | |
* Useful for custom events | |
* | |
*USAGE: | |
* $(el).subscribe('customEvent', function() { | |
* do something when customEvent is published |
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
/** | |
* author kkemple@pixafy.com | |
*/ | |
(function( $ ) { | |
$('body').on('click', '.check-style', function() { | |
var self = $( this ); | |
var checkbox = self.children( 'input[type="checkbox"]' ); | |
if( $( checkbox ).prop('checked') ) { | |
$( checkbox ).prop( 'checked', false ); |
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 echo $this->getLayout()->createBlock('cms/block')->setBlockId('identifier')->toHtml() ?> |
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
;(function( $, window, document, undefined ) { | |
var keys = [], | |
konami = '38,38,40,40,37,39,37,39,66,65', | |
timer = 0; | |
$( document ).keydown(function( e ) { | |
keys.push( e.keyCode ); | |
if ( keys.toString().indexOf( konami ) >= 0 ){ | |
// do something when the konami code is executed |
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
function dd( $anything ) | |
{ | |
echo '<pre>'; | |
var_dump( $anything ); | |
echo '</pre>'; | |
die(0); | |
} |
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
<script> | |
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']]; | |
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; | |
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; | |
s.parentNode.insertBefore(g,s)}(document,'script')); | |
</script> |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
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
data:text/html, <style type="text/css">#js-editor{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="js-editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var jsEditor=ace.edit("js-editor");jsEditor.setTheme("ace/theme/monokai");jsEditor.getSession().setMode("ace/mode/javascript");</script> |
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 request from 'superagent' | |
import Promise from 'bluebird' | |
Promise.config({ cancellation: true }) | |
export function get(url, { | |
headers: headers = {}, | |
query: query = {}, | |
progress: progress = () => {}, | |
} = {}) { |
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
// Avoid `console` errors in browsers that lack a console. | |
(function() { | |
var method; | |
var noop = function () {}; | |
var methods = [ | |
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', | |
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', | |
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', | |
'timeStamp', 'trace', 'warn' | |
]; |