Skip to content

Instantly share code, notes, and snippets.

View ericorruption's full-sized avatar
🎵

Eric Quanz ericorruption

🎵
View GitHub Profile
busy signal
gitcontrol
linter
@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));
$inuit-global-spacing-unit: 8px;
.o-flag {
display: table;
width: 100%;
border-spacing: 0;
}
.o-flag__img,
.o-flag__body {
@media (prefers-reduced-motion: reduce) {
* {
animation: none !important;
transition: none !important;
}
}
/* good line length */
p {
max-width: 38em;
@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);
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
<meta name="disabled-adaptations" content="watch">
@ericorruption
ericorruption / google-task-1-solution.py
Created December 21, 2018 17:03
Google task 1 solution
braille = {
' ': '000000',
'a': '100000',
'b': '110000',
'c': '100100',
'd': '100110',
'e': '100010',
'f': '110100',
'g': '110110',
'h': '110010',
const nested = [[0, 1],[2, 3], 4]
const flat = = nested.reduce((acc, it) => [...acc, ...it], []);
@ericorruption
ericorruption / docker-compose.yml
Created February 14, 2019 16:52
Simplest possible node.js dev environment?
# https://medium.com/@francoisromain/getting-started-with-docker-for-local-node-js-development-192ceca18781
version: "3"
services:
app:
image: node:8
volumes:
- ./:/home/node/app
working_dir: "/home/node/app"
user: "node" # don't use the root user for security reasons