Skip to content

Instantly share code, notes, and snippets.

View taesup's full-sized avatar

Edward Kim taesup

View GitHub Profile
@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);
@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 / css-perf-links
Created October 2, 2015 01:36
Links to the CSS-Performance talk by me
@taesup
taesup / index.js
Last active March 4, 2016 07:28
DevLeague-Day2-Prep-Notes-Answers
// ++ NOTES
/**
* console.log() --> PRINT TO SCREEN
* function () {} --> Declare a function (but don't run it)
* {functionName}(arg1, arg2) --> Actually using the function by name
*/
// GLOBAL VARIABLES
var foo = 2;
@taesup
taesup / keybase.md
Created July 28, 2017 01:43
Keybase verification

Keybase proof

I hereby claim:

  • I am taesup on github.
  • I am taesup (https://keybase.io/taesup) on keybase.
  • I have a public key ASDvjCk9RNXqrZKqWPzySTvLzXteLqXoNAfMnUKbvz_wego

To claim this, I am signing this object:

@taesup
taesup / mongo.js
Created August 4, 2017 21:25
Mongo Notes
var MongoClient = require('mongodb').MongoClient;
// Connection URL
var url = 'mongodb://localhost:27017/mongo_demo';
module.exports = function createConnection() {
}
// Use connect method to connect to the server
@taesup
taesup / gist:14bea609d30f9864dc8341158e1c60de
Created August 9, 2017 00:57
New syntax for foreign key constraints for sequelize
module.exports = function(sequelize, DataTypes) {
var Task = sequelize.define("Task", {
title: DataTypes.STRING
});
Task.associate = function(models) {
Task.belongsTo(models.User);
}
return Task;
@taesup
taesup / books.md
Last active March 27, 2018 02:27
Recommended programming books
@taesup
taesup / links.md
Last active May 23, 2018 23:04
Blogs and other people worth following
@taesup
taesup / whiteboarding.js
Created September 12, 2017 19:05
Whiteboarding exercises for hoisting
```javascript
function example1 () {
y = 20;
var y = 0;
jump();
var jump = function () {
y += 15;
}
jump();
function jump() {