Skip to content

Instantly share code, notes, and snippets.

View jlandure's full-sized avatar
💭
👋

Julien Landuré jlandure

💭
👋
View GitHub Profile
function getWatchers(root) {
root = angular.element(root || document.documentElement);
var watcherCount = 0;
function getElemWatchers(element) {
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope);
var scopeWatchers = getWatchersFromScope(element.data().$scope);
var watchers = scopeWatchers.concat(isolateWatchers);
angular.forEach(element.children(), function (childElement) {
watchers = watchers.concat(getElemWatchers(angular.element(childElement)));
package mustoauth
import (
"appengine"
"appengine/datastore"
"appengine/memcache"
"appengine/urlfetch"
"appengine/user"
"encoding/json"
"fmt"
@jlandure
jlandure / angular-count-watchers
Created September 22, 2015 15:02 — forked from taesup/angular-count-watchers
A simple script to count the number of watcher on your angular app. Credits: http://stackoverflow.com/questions/18499909/how-to-count-total-number-of-watches-on-a-page
(function () {
var root = angular.element(document.getElementsByTagName('html'));
var watchers = [];
var f = function (element) {
angular.forEach(['$scope', '$isolateScope'], function (scopeProperty) {
if (element.data() && element.data().hasOwnProperty(scopeProperty)) {
angular.forEach(element.data()[scopeProperty].$$watchers, function (watcher) {
watchers.push(watcher);
@jlandure
jlandure / dispatch.yaml
Created March 7, 2016 15:31 — forked from brianmhunt/dispatch.yaml
ACME + AppEngine
application: some-dummy-app-name # overridden by -A
dispatch:
# Let's Encrypt ACME challenge service
- url: "*/.well-known/acme-challenge/*"
module: acme