Skip to content

Instantly share code, notes, and snippets.

View Rokt33r's full-sized avatar
🧨
BOOM!

Junyoung Choi Rokt33r

🧨
BOOM!
View GitHub Profile
@anaisbetts
anaisbetts / analytics.js
Created January 7, 2015 20:47
Google Analytics in Atom Shell
// Pretend that cookies work
(function (document) {
var cookies = {};
document.__defineGetter__('cookie', function () {
var output = [];
for (var cookieName in cookies) {
output.push(cookieName + "=" + cookies[cookieName]);
}
return output.join(";");
});
@Leko
Leko / 0_profilify.js
Last active August 21, 2017 02:45
Any function profiling
function profilify(fn, label) {
var displayName = label || fn.name,
called = 0,
profilified = function() {
var args = [].slice.call(arguments),
startedAt = new Date(),
defaults = { total: 0, times: 0, average: 0 },
ret;
profilify._stats[displayName] = profilify._stats[displayName] || defaults