Skip to content

Instantly share code, notes, and snippets.

@pyetras
pyetras / ng_if.js
Created January 10, 2014 18:47
ng-if for older (1.0.X) angularjs versions
angular.module('future', []).directive('ngIf', [function() {
return {
transclude: 'element',
priority: 600,
terminal: true,
restrict: 'A',
$$tlb: true,
compile: function ($element, $attr, $transclude) {
return function link($scope, $element, $attr, ctrl){
var block, childScope;
@suprememoocow
suprememoocow / intercept.js
Created May 29, 2012 09:53
AJAX timing interceptor: this class intercepts all AJAX calls and records the time taken for the HTTP request to complete. These timings are posted back to the server in batches, if there are any to send, about every two seconds. Tested in Firefox, Chrome
(function(XHR) {
"use strict";
var stats = [];
var timeoutId = null;
var open = XHR.prototype.open;
var send = XHR.prototype.send;