Skip to content

Instantly share code, notes, and snippets.

View ericorruption's full-sized avatar
🎵

Eric Quanz ericorruption

🎵
View GitHub Profile
test('What component aspect are you testing?', assert => {
const message = 'What should the feature do?'
const actual = 'What is the actual output?'
const expected = 'What is the expected output?'
assert.equal(actual, expected, message)
})
// examples
@ericorruption
ericorruption / index.js
Created August 28, 2018 13:39
aws lambda: separate handler logic from function code
function MyLambdaFunction (foo, bar) {
// MyLambdaFunction logic here
}
exports.myHandler = function(event, context, callback) {
var foo = event.foo;
var bar = event.bar;
var result = MyLambdaFunction (foo, bar);
callback(null, result);
@media (prefers-reduced-motion: reduce) {
* {
animation: none !important;
transition: none !important;
}
}
/* good line length */
p {
max-width: 38em;
$inuit-global-spacing-unit: 8px;
.o-flag {
display: table;
width: 100%;
border-spacing: 0;
}
.o-flag__img,
.o-flag__body {
@ericorruption
ericorruption / app.js
Last active January 22, 2018 13:14
Observables > Events
import { Observable } from 'rx'
const { fromEvent } = Observable
fromEvent(document.querySelector('button'), 'click').subscribe(e => console.log(e));
busy signal
gitcontrol
linter
@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'
]
@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 / 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 / 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