Skip to content

Instantly share code, notes, and snippets.

View laere's full-sized avatar
🎯
Focusing

Zack laere

🎯
Focusing
  • Grand Rapids, MI
View GitHub Profile
// Bitters 1.1.0
// http://bitters.bourbon.io
// Copyright 2013-2015 thoughtbot, inc.
// MIT License
@import "variables";
// Neat Settings -- uncomment if using Neat -- must be imported before Neat
// @import "grid-settings";
@laere
laere / reset-rems
Created January 28, 2016 16:37 — forked from mrwweb/reset-rems
"Sanity-ize" REMs by setting them to 10px-baseline aka "Tiny Happy Pixels Dancing."
/* this is the "root" in "root em." */
html {
font-size: 62.5%; /* Now 10px = 1rem! */
}
body {
font-size: 16px; /* px fallback */
font-size: 1.6rem; /* default font-size for document */
line-height: 1.5; /* a nice line-height */
}
var fetch = require('whatwg-fetch');
var baseURL = 'http://swapi.co/api/';
var service = {
get: function(url) {
return fetch(baseURL + url)
//returning a promise
//function callback that will promise us something
.then(function(response) {
@font-face {
font-family: 'Star Jedi';
src: url('Starjedi.eot');
src: url('Starjedi.eot?#iefix') format('embedded-opentype'),
url('Starjedi.woff') format('woff'),
url('Starjedi.ttf') format('truetype'),
url('Starjedi.svg#Starjedi') format('svg');
font-weight: normal;
font-style: normal;
}
var Fetch = require('whatwg-fetch');
var baseURL = 'http://swapi.co/api';
var service = {
get: function(url) {
return fetch(baseURL + url)
//returning a promise
//function callback that will promise us something
.then(function(response) {
var baseURL = 'http://swapi.co/api';
var service = {
get: function(url) {
return fetch(baseURL + url)
//returning a promise
//function callback that will promise us something
.then(function(response) {
return response.json();
// THIS WILL RETURN API JSON DATA BEFORE FIRST RENDER
componentDidMount: function() {
fetch('http://swapi.co/api/people').then(function(response) {
return response.json()
}.bind(this));
console.log(this.state.people);
},
// THIS WILL RETURN API JSON DATA BEFORE FIRST RENDER
componentDidMount: function() {
fetch('http://swapi.co/api/people')
.then(function(response) {
return response.json
})
.then(function(json) {
this.setState({ data: json });
})
.catch(function(err) {
var React = require('react');
var Search = require('./Search.jsx')
var Img = require('./Img.jsx');
var Info = require('./Info.jsx');
var UI = React.createClass({
getInitialState: function() {
return {
people: []
componentDidMount: function() {
fetch('http://swapi.co/api/people')
.then(function(response) {
return response.json
})
.then(function(json) {
this.setState({ people: json });
}.bind(this))
.catch(function(err) {