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
//Do this only one time ! | |
makeChainable(console, 'assert clear count debug dir dirxml error exception group groupCollapsed groupEnd info log profile profileEnd time timeEnd warn'.split(' ')); | |
//Usage: | |
console | |
.profile() | |
.time('testTime') | |
.group('GroupTest') | |
.debug('test', 1, 2, 3) | |
.warn('warniiing!') |
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
function dream(lvl){ | |
return lvl == -4 ? 'Inception done' : dream(--lvl); | |
} | |
dream(0); |
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
function toBeProfiled(){ | |
console.log(new Error('Show me the stack!')); | |
//Do something here | |
} | |
function launchApp(){ | |
function doThing(){ | |
console.debug(toBeProfiled); | |
toBeProfiled(); |
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
var isjQuery = function($){ | |
return 'fn' in $ && !!$.fn.jquery; | |
}($); | |
//My original code: http://twitter.com/FGRibreau/status/19641898644 | |
//piouPioum 2 cents: http://twitter.com/piouPiouM/status/19642960179 |
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
if(!function_exists('apc_exists')){ | |
function apc_exists($keys){ | |
$r; | |
apc_fetch($keys,$r); | |
return $r; | |
} | |
} |
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
$('#el').AttributeObserver(attr, callback, [delay]); |
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
//Find the iframe in the current document | |
var doc = $('#myIframe').contents()[0]; | |
//Get the iframe's window context | |
var iFrameWindow = 'defaultView' in doc? doc.defaultView : doc.parentWindow; | |
//Now we can get jQuery by doing iFrameWindow.$ or iFrameWindow.jQuery | |
iFrameWindow.$('selector').data('key') |
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
$('#myIframe').contents().find('body #myElement').data('test', 'hello world'); | |
//Will return {} | |
$('#myIframe').contents().find('body #myElement').data(); |
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
Strophe.addConnectionPlugin("xdomainrequest", { | |
init: function() { | |
if (window.XDomainRequest) { | |
Strophe.debug("using XdomainRequest for IE"); | |
// override thee send method to fire readystate 2 | |
XDomainRequest.prototype.send = (function(oldSend) { | |
return function() { | |
oldsend.apply(this, arguments); | |
this.readyState = 2; |
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
cd /Applications/ | |
sudo ln -s /Applications/PeerGuardian.app/Contents/Resources/pploader.app PeerGuardian_loader.app | |
sudo ln -s /Applications/PeerGuardian.app/Contents/Resources/pplogger.app PeerGuardian_logger.app | |
open PeerGuardian_loader.app | |
open PeerGuardian_logger.app |
OlderNewer