Skip to content

Instantly share code, notes, and snippets.

View CodeWritingCow's full-sized avatar

Gary Pang CodeWritingCow

View GitHub Profile
@CodeWritingCow
CodeWritingCow / gist:24b872ad798fea796e52b6a95cbc4166
Last active February 23, 2019 21:58
Motunui Final Google PageSpeed results
Screenshots of Google PageSpeed for desktop and mobile
Below are screenshots of my team's components combined on the proxy server page.
@CodeWritingCow
CodeWritingCow / gist:da906fbf1a85c03ebb3b087fa44f860b
Last active February 19, 2019 02:19
Motunui component screenshots
Below are two screenshots.
First image is of several <Category> components. Each <Category> contains four <Event> components.
Second image is of an individual <Event> component.
@CodeWritingCow
CodeWritingCow / gist:7b8d654c756afd20b1ec90655ae488d0
Created February 7, 2019 22:25
Sample GET /api/events/:id route and response
The following endpoint:
http://localhost:3016/api/events/35
Responds with:
[{"reviews_count":31224,"price":101,"rating":2.4,"name":"Norfolk Island","image_url":"./public/images/04.jpg","category":1}]
const express = require('express');
const app = express();
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<button>Click!</button>
// ES6 Javascript: The Complete Developer's Guide
// Stephen Grider, Engineering Architect
url = "https://jsonplaceholder.typicode.com/posts123456/";
fetch(url)
.then(response => console.log(response))
.catch(error => console.log('BAD', error));
@CodeWritingCow
CodeWritingCow / cities.json
Created November 29, 2017 05:43 — forked from Miserlou/cities.json
1000 Largest US Cities By Population With Geographic Coordinates, in JSON
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
@CodeWritingCow
CodeWritingCow / index.html
Last active October 14, 2017 07:50
Number of days Trump has been in office
<div><span id="presidentDays"></span> days in office</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js" type="text/javascript"></script>
<script src="trumpDays.js" type="text/javascript"></script>
@CodeWritingCow
CodeWritingCow / gist:60b796dd56a2ef495ef808145675770a
Last active December 9, 2016 07:58
D3.js map of Pennsylvania voter registration by county in 2016
var margin = {top: 10, left: 10, bottom: 10, right: 10},
width = parseInt(d3.select('#viz').style('width')),
width = width - margin.left - margin.right,
mapRatio = .5,
height = width * mapRatio,
mapRatioAdjuster = 7;
pennsylvania_center = [-77.5, 40.8];
// add commas to big numbers
formatComma = d3.format(",");