Skip to content

Instantly share code, notes, and snippets.

View mxdi9i7's full-sized avatar
:octocat:
Author of Vant-React and A.C.C.B. VSCE

Peter Zheng mxdi9i7

:octocat:
Author of Vant-React and A.C.C.B. VSCE
  • thirtymadison
  • New York
View GitHub Profile
@mxdi9i7
mxdi9i7 / index.html
Created August 16, 2017 18:29
JS practice
<!Doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<input type="number" id="input1">
<button id="btn">Calculate</button>
<h1 id="demo"></h1>
</body>
@mxdi9i7
mxdi9i7 / hw2.cpp
Created October 20, 2017 21:36
idk
#include <iostream>
#include <string>
using namespace std;
// Write definition for getAverage Function
double getAverage(string className) {
double classAvg;
cout << "Please enter your average for subject " << className << "." << endl;
cin >> classAvg;
@mxdi9i7
mxdi9i7 / forms.html
Last active December 7, 2017 19:36
HTML Form Elements
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="index.css">
</head>
<body>
@mxdi9i7
mxdi9i7 / index.css
Created December 7, 2017 19:35
Intro to CSS
label {
background-color: yellow;
}
body {
background-image: url(https://goo.gl/4yCwzn);
background-size: cover;
}
.title {
display: block;
@mxdi9i7
mxdi9i7 / Flexbox.html
Created December 7, 2017 19:48
Flex Box HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="index.css">
</head>
<body>
.papa {
display: flex;
justify-content: space-between;
padding: 0 10%;
align-items: flex-end;
height: 100vh;
}
@mxdi9i7
mxdi9i7 / locations.js
Last active November 7, 2018 03:48
example location file
export const locations = [
{
address: '123 main street',
city: 'New York City',
email: 'peter@bctc.io',
phone: '1820228281'
},
{
...
}
@mxdi9i7
mxdi9i7 / App.js
Last active November 28, 2018 16:55
Router example
import React, { Component } from 'react';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import LandingPage from './pages/Landing';
import AboutPage from './pages/About';
import LocationsPage from './pages/Locations';
export const routes = [
{
path: '/',
component: LandingPage,
@mxdi9i7
mxdi9i7 / Locations.js
Created November 7, 2018 03:49
Location component
import React, { Component } from 'react'
import { locations } from '../../utils/data'
export default class LocationPage extends Component {
render() {
return (
<div>
{
locations.map(location => (
<div>