Skip to content

Instantly share code, notes, and snippets.

View hellobrian's full-sized avatar
🏠
Working from home

Brian Han hellobrian

🏠
Working from home
View GitHub Profile
@hellobrian
hellobrian / index.js
Created January 3, 2018 04:53
async-await.js
const axios = require('axios');
const breakfastItems = {
coffee: '☕',
eggs: '🍳',
bacon: '🥓'
};
const makeCoffee = (cb) => {
return new Promise(resolve => {
@hellobrian
hellobrian / _carousel.scss
Created September 5, 2017 19:25
carousel and lightbox
@import 'colors';
@import 'vars';
@import 'mixins';
@import 'typography';
@import 'import-once';
@mixin css-body {
body {
@include reset;
// prop callback
class Compoennt {
render() {
return (
<div>
<Thing onChange={(val) => {
this.setState({ val1: val })
}}/>
<Thing onChange={(val) => {
this.setState({ val2: val })
// prop callback
class Compoennt {
render() {
return (
<div>
<Thing onChange={(val) => {
this.setState({ val1: val })
}}/>
<Thing onChange={(val) => {
this.setState({ val2: val })
// prop callback
class Compoennt {
render() {
return (
<div>
<Thing onChange={(val) => {
this.setState({ val1: val })
}}/>
<Thing onChange={(val) => {
this.setState({ val2: val })
@hellobrian
hellobrian / renderProps.js
Created April 7, 2017 15:27
React Training: Render Props
////////////////////////////////////////////////////////////////////////////////
// Exercise:
//
// - Refactor App by creating a new component named `<GeoPosition>`
// - <GeoPosition> should use a child render callback that passes
// to <App> the latitude and longitude state
// - When you're done, <App> should no longer have anything but
// a render method
//
// Got extra time?
{
"name": "npm-lifecycle-events",
"version": "1.0.0",
"main": "example.js",
"scripts": {
"build": "node example.js",
"dev": "node example.js",
"start": "node example.js"
},
"author": "Brian Han",