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) { | |
'use strict'; | |
var pluginName = 'FunnelViz' | |
, defaults = { | |
}; | |
function init () { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Title with action buttons</title> | |
<style id="jsbin-css"> | |
.bar { | |
position: relative; | |
} |
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
it('Property', inject(function($parse){ | |
function Property(context, fieldName) { | |
this.$getter = $parse(fieldName); | |
this.$setter = this.$getter.assign; | |
this.$context = context; | |
} | |
Property.prototype.get = function() { | |
return this.$getter(this.$context); | |
}; | |
Property.prototype.set = function(value) { |
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 memoize(fn) { | |
fn.memoize || (fn.memoize = {}); | |
return function(arg) { | |
if (fn.memoize.hasOwnProperty(arg)) { | |
console.log('memoized //-> %s', arg); | |
return fn.memoize[arg]; | |
} | |
else { | |
console.log('computed //-> %s', arg); | |
fn.memoize[arg] = fn(arg); |
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
angular | |
.module('myProject', []) | |
.filter('abbreviate', function () { | |
// Hello World | abbreviate:6:2 //-> 'Hello...Wo' | |
// Hello World | abbreviate:5 //-> 'Hello...' | |
return function(str, num, prefix) { | |
if (str == null) { str = ''; } | |
if (num == null) { num = str.length; } | |
if (prefix == null) { prefix = 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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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 Tiny Pub/Sub - v0.7 - 10/27/2011 | |
* http://benalman.com/ | |
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
(function(a){var b=a({});a.subscribe=function(){b.on.apply(b,arguments)},a.unsubscribe=function(){b.off.apply(b,arguments)},a.publish=function(){b.trigger.apply(b,arguments)}})(jQuery) |
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 w = Components.classes["@mozilla.org/appshell/window-mediator;1"] | |
.getService(Components.interfaces.nsIWindowMediator); | |
var win = w.getMostRecentWindow("navigator:browser"); | |
for (var i = win.gBrowser.tabs.length - 1; i >= 0; i--) { | |
var browser = win.gBrowser.tabs[i].linkedBrowser; | |
var cd = browser.contentDocument; | |
var cw = browser.contentWindow; |
OlderNewer