Skip to content

Instantly share code, notes, and snippets.

View couto's full-sized avatar
👽
Did you raid area 51?

Luís Couto couto

👽
Did you raid area 51?
View GitHub Profile
/**
* π_ - Piline (Pilinha in portuguese)
*
* @returns {String}
*/
π_ = function () { return '.!.'; }
@couto
couto / quantize.js
Last active December 15, 2015 12:59 — forked from nrabinowitz/quantize.js
define(function () {
'use strict';
/*!
* quantize.js Copyright 2008 Nick Rabinowitz.
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
// fill out a couple protovis dependencies
/*!
@couto
couto / proxy.js
Last active December 15, 2015 22:49 — forked from grantmichaels/proxy.js
make it a little friendlier for the terminal
var net = require("net"),
args = {};
process.argv.forEach(function (val, index) {
var dest, listen;
if (val === '--destination') {
dest = process.argv[index + 1].split(':');
args.destination = dest[0];
// Uses CommonJS, AMD or browser globals to create a module.
// If you just want to support Node, or other CommonJS-like environments that
// support module.exports, and you are not creating a module that has a
// circular dependency, then see returnExports.js instead. It will allow
// you to export a function as the module value.
// Defines a module "commonJsStrict" that depends another module called "b".
// Note that the name of the module is implied by the file name. It is best
// if the file name and the exported global have matching names.
// Dynamic (lol) load grunt tasks
Object
.keys(JSON.parse(fs.readFileSync(__dirname + path.sep + 'package.json')).devDependencies)
.forEach(function (key) { return (/^grunt-/).test(key) && grunt.loadNpmTasks(key); });
@couto
couto / findSyncRequests.js
Last active December 17, 2015 22:58
Warn about any AJAX request made synchronously, while navigating within the application
(function () {
var open = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function () {
var args = [].slice.call(arguments, 0);
if (!args[2]) {
console.error("Synchronous Request found!");
console.trace();
}
@couto
couto / globalVariables.js
Last active June 6, 2016 15:47
Small snippet to detect global variables.
(function (global) {
'use strict';
var globals = [];
var iframe = document.createElement('iframe');
var cleanWindow;
iframe.src = 'about:blank';
iframe.style.display = 'none';
document.body.appendChild(iframe);
/**
* klass
*
* @module klass
* @example
*
* var Animal = klass({
* initialize: function () {},
* dealloc: function () {}
* }),
var Module = klass({
get: function () {},
set: function () {},
trigger: function () {}
});
var DiscographyModule = Module.module(function () {
var private = function () {};
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm http GET https://registry.npmjs.org/bower
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.