Skip to content

Instantly share code, notes, and snippets.

View WebCloud's full-sized avatar

Vinicius Dallacqua WebCloud

View GitHub Profile
@WebCloud
WebCloud / lighhouse-utils.js
Last active October 19, 2018 14:32
Lighthouse CLI utils to help out on report and digest generation
const { error } = require('./utils');
const baseDir = __dirname;
const getReportFolder = hash => `${baseDir}reports/automated-lighthouse-${hash}`.replace('\n', '');
const getReportPath = (dirName, format, fileName = 'report') => `${dirName}/${fileName}.${format}`;
/**
* Function that will generate the report based on the results for the lighthouse run
@WebCloud
WebCloud / gist:b78e413784c56a664b7f
Last active August 29, 2015 14:15 — forked from getify/gist:5226305
Object reference tree
// `Object.make(..)` is a helper/wrapper for `Object.create(..)`. Both create a new
// object, and optionally link that new object's `[[Prototype]]` chain to another object.
//
// But `Object.make(..)` makes sure the new object always has a `__proto__` property
// (even a null one) and delegation to a `isPrototypeOf(..)` method, both of which are
// missing from the bare object (aka "Dictionary") created by `Object.create(null)`.
//
// `isPrototypeOf()` is put on a extra object that your created object can delegate to,
// if any only if you create an empty object (by not passing a `linkTo`) that otherwise
// wouldn't have access to `isPrototypeOf()`.
App.ApplicationAdapter.reopen
pathForType: (type)->
decamelized = Ember.String.decamelize(type)
"#{Ember.String.pluralize(decamelized)}.json"
// http://emberjs.com/api/classes/Ember._MetamorphView.html#event_didInsertElement workaround for the
/*
didInsertElement: function(){
console.log('only called on the first load of the view');
}
*/
// either Ember.View.reopen (beware, will execute on EVERY view) or App.MyView = Ember.View.create
init:function(){
# add "deb http://ftp.us.debian.org/debian wheezy-backports main" to /etc/apt/sources.list
sudo apt-get update
sudo apt-get install nodejs-legacy
curl --insecure https://www.npmjs.org/install.sh | sudo bash
@WebCloud
WebCloud / links-workflow-fortes2013
Last active December 16, 2015 15:19
Links da palestra de Workflow para front end
/* ----------------------------------------------------------------------- */
/* */
/* Improved upon a mixin from 37signals and combined */
/* with these numbers from marc. */
/* */
/* 37signals-version: */
/* http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss */
/* */
/* @kimroen */
/* */
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);
@WebCloud
WebCloud / links-performance-fortes2013
Last active December 16, 2015 11:29
Links da palestra de Web Performance do Fortes 2013