This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>My first or second website</title> | |
<style> | |
h1 { | |
background-color: blue; | |
color: white; | |
} | |
p { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $1 ] | |
then | |
echo "****8 \n Creating project directory\n*****" | |
mkdir $1 | |
cd $1 | |
else | |
echo "***** \n No directory specified, adding project files to CWD\n*****" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="chart.css"> | |
<script src="https://d3js.org/d3.v3.min.js"></script> | |
<title>Coronavirus Data</title> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Selects our parent element in our html and appens a new <svg> element | |
const svg = d3.select("#china-map").append("svg") | |
.attr("width", width) | |
.attr("height", height) | |
.append("g") | |
.attr("transform", "translate(0,0)"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template, request | |
from util import data_parse | |
import json | |
import requests | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
r = requests.get('https://spreadsheets.google.com/feeds/list/1AZDWMcMYXOdjigQ9YyKbzu23UlPtTAjzU2SA--b4_Kw/od6/public/values?alt=json') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* Executes a large number of requests using asynchronous operations | |
* @param {Array} reqArray - Contains request objects formatted as per the specifications of whatever request function you are using | |
* @param {Function} httpPromise - A function that makes a 1 http request such as npm@request-promise: https://www.npmjs.com/package/request-promise#get-something-from-a-json-rest-api | |
*/ | |
module.exports = (reqArray, httpPromise) => { | |
const promiseArray = reqArray.map(req => new Promise(async (resolve, reject) => { | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { Link } from 'react-router-dom' | |
import gql from 'graphql-tag' | |
import { Query } from 'react-apollo' | |
import { Container, Loader, Label, Image } from 'semantic-ui-react' | |
import './_article.css' | |
const GET_ARTICLE_BY_SLUG = gql` | |
query Article($read_key: String!, $slug: String!) { | |
object(bucket_slug: "apollo-blog", read_key: $read_key, slug: $slug ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import gql from 'graphql-tag' | |
import { graphql } from 'react-apollo' | |
import { Link } from 'react-router-dom' | |
// Component from Semantic UI | |
import { Container, Image, Card, Label, Loader } from 'semantic-ui-react' | |
const GET_ARTICLES = gql` | |
query Articles($read_key: String!) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COSMIC_BUCKET=your-bucket-slug | |
COSMIC_READ_KEY=your-read-key | |
COSMIC_WRITE_KEY=your-write-key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REACT_APP_COSMIC_JS_READ_KEY=your_cosmic_js_read_key |
NewerOlder