Skip to content

Instantly share code, notes, and snippets.

View taesup's full-sized avatar

Edward Kim taesup

View GitHub Profile
@taesup
taesup / angular-count-watchers
Created August 20, 2015 03:56
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);
@taesup
taesup / perfschool-pagespeed
Created July 29, 2015 06:12
answer to perfschool problem 1
'use strict';
var fs = require('fs');
var path = require('path');
var express = require('express');
var psi = require('psi');
var app = express();
var port = process.env.PORT || 7777;
app.get('/', home);