Skip to content

Instantly share code, notes, and snippets.

View ericorruption's full-sized avatar
🎵

Eric Quanz ericorruption

🎵
View GitHub Profile
@ericorruption
ericorruption / README.md
Created August 23, 2016 17:40
README template

Project name

A short project description.

Dependencies

List all dependencies for mac / windows with all the quirks associated with each one. These are the ones that are not locally installed through package managers (npm, composer, gems...)

Installing

  • How should the developer download this project (most probably cloning)?
  • Things to consider explaining: setting up and seeding the database, what web server to use, anything that needs to be set up before working on this project...
@ericorruption
ericorruption / Vagrantfile
Created September 5, 2016 18:07
minimal vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "private_network", ip: "192.168.33.10"
@ericorruption
ericorruption / command.sh
Created September 18, 2016 15:20
import mysql dump file
mysql -u <username> -p <databasename> < <filename.sql>
/* global ga */
function throttle(callback, limit) {
let wait = false;
return function() {
if (!wait) {
callback.call();
wait = true;
setTimeout(function() {
@ericorruption
ericorruption / gist:ff240cdaf0348edf16b4a081cd87c9b7
Created October 26, 2016 00:20
calculate gzipped size of file
gzip -c filename.min.js | wc -c
@ericorruption
ericorruption / _embed.scss
Created November 10, 2016 17:22
responsive embed object
.o-embed {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
max-width: 100%;
iframe,
object,
embed {
@ericorruption
ericorruption / readme.md
Created November 29, 2016 01:21
Mobile Brazil Conference Annotations

Mobile Brazil Conference

Design for all five senses

Visão:

  • Objetos reais são mais interessantes que botões

  • Qualidade de imagens (Performance?)

  • Escalonar imagens antes de alocá-las na memória

@ericorruption
ericorruption / Observable.js
Created October 26, 2017 14:59
Observable pattern in js
// define a class
class Observable {
// each instance of the Observer class
// starts with an empty array of things (observers)
// that react to a state change
constructor() {
this.observers = [];
}
// add the ability to subscribe to a new object / DOM element
@ericorruption
ericorruption / utils.md
Last active October 30, 2017 12:00
utils
  • Opionated error color: #A33131
  • Centered title with lines on each side (no background-color): http://codepen.io/SachaG/pen/AEacz
  • On email newsletters, Gmail ignores #000, #000000, and “black” values.
@ericorruption
ericorruption / app.js
Created November 1, 2017 08:08
Redux: Avoiding mutation on state change
const toggleObjectBoolean = object => {
...object,
bool: !object.bool
}
const addToList = list => [
...list,
'new item'
]