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 foo='test', barObj; | |
function bar(){ | |
return {baz:'bop',bazReg:/^bop$/} | |
}; | |
bar.prototype.someArray=[1,2,3,null,undefined,false,true,!!1,void 0,'#foo',bar]; | |
barObj=new Bar(); |
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 Fisheye Grid version 0.01 | |
* Copyright 2011, Adam Laughlin | |
* http://a-laughlin.com | |
* Licensed under MIT & GPL version 2 | |
* http://static.a-laughlin.com/mit_license.txt | |
* http://static.a-laughlin.com/gpl_license.txt | |
*/ | |
/* |
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 multi-dependency pubsub v0.01 | |
* Copyright 2011, Adam Laughlin | |
* http://a-laughlin.com | |
* Licensed under MIT & GPL version 2 | |
* http://static.a-laughlin.com/mit_license.txt | |
* http://static.a-laughlin.com/gpl_license.txt | |
* | |
* inspired by Addy Osmani's example at: | |
* http://addyosmani.com/blog/jquery-1-7s-callbacks-feature-demystified/ |
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(win,doc){ | |
function _getSelectedText (){ | |
_getSelectedText = win.getSelection ? // redefine itself when first run | |
win.getSelection : | |
doc.getSelection ? | |
doc.getSelection: | |
doc.selection ? | |
function(){return doc.selection.createRange().text;} : | |
function(){return '';}; |
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
// how services, factories, and values work | |
var foo = { | |
providers:{}, | |
instances:{}, | |
provider:function(name,fn){ | |
var pName = name + 'Provider'; | |
foo.providers[pName] = foo.providers[pName] || new fn(); | |
foo.instances[name] = foo.instances[name] || foo.providers[pName].$get(); | |
return foo.providers[pName]; |
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
// Instructions. Save as a bookmark. Click when on a repo or github.io (gh-pages branch) site. | |
javascript:(function(h,p){ | |
location = /io$/.test(h) ? | |
'https://github.com/' + h.split('.')[0] + p: | |
'http://'+ p.split('/')[1]+'.github.io'+ '/' + p.split('/').slice(2).join('/') | |
})(location.host,location.pathname); |
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
// Instructions - create a bookmark. Save this code as the url. | |
// Click the bookmarklet to see watch count output in the console. | |
// Currently counts watches by nodeName. It would be more useful by class. TBD. | |
javascript: (function () { | |
var totalWatches = 0; | |
var watchesByElem = {}; | |
angular.forEach(angular.element('.ng-scope'), function (elem) { | |
var s = angular.element(elem).scope(); | |
var w = s.$$watchers; | |
if (s.$$watchers) { |
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
javascript:(function(){ | |
window.angular.debug = { | |
searchScope : function(varName,options) { | |
var registeredScopes = {}; | |
var opts = angular.extend({ | |
includeFns:false, | |
includeHidden:false, | |
recurseDepth:20 | |
}, options); | |
var testFn = function(test,testStr){ |
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
// simple bookmarklet to hide events and re-hide them when re-activated | |
javascript:(function($){ | |
var itemsStr = localStorage.getItem('hiddenItems') || '[]'; | |
var itemsArr = JSON.parse(itemsStr); | |
var $a = $('li.event h3 a'); | |
$(document).off('click'); | |
$('.hider').remove(); | |
$(document).on('click','.hider',hiderClicked); | |
itemsArr.forEach(hideItem); |
OlderNewer