Skip to content

Instantly share code, notes, and snippets.

View willshepp28's full-sized avatar

Will Sheppard willshepp28

View GitHub Profile
@willshepp28
willshepp28 / characters.html
Created May 23, 2017 18:17
Star - Writing 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>
<style>
if [ -d "project" ]; then
rm -rf project
fi
mkdir project
cd project
touch index.html style.css README.md
echo '<link rel="stylesheet" href="styles.css"><h1>Hello World</h1>' > index.html
echo "h1{color:red; font-family: sans-serif; text-decoration: underline;}" > styles.css
echo "Hello World!" > README.md
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Puppies!</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
@willshepp28
willshepp28 / index.html
Created May 25, 2017 22:25
Swamp Rabbit Cycling
<!DOCTYPE html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<title></title>
<meta content="" name="description">
<meta content="width=device-width, initial-scale=1" name="viewport">
<link charset="utf-8" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" media=
"screen" rel="stylesheet" title="no title">
<!DOCTYPE html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<title></title>
<meta content="" name="description">
<meta content="width=device-width, initial-scale=1" name="viewport">
<link charset="utf-8" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" media=
"screen" rel="stylesheet" title="no title">
@willshepp28
willshepp28 / config.json
Last active November 29, 2020 22:39
How seqeulize knows how to connect to our database
{
"development": {
"username": "YOUR-USERNAME",
"password": "YOUR-PASSWORD",
"database": "League-Spx",
"host": "127.0.0.1",
"dialect": "postgres"
},
"test": {
"username": "YOUR-USERNAME",
@willshepp28
willshepp28 / package.json
Created November 29, 2020 21:39
Set of scripts we can run in our package.json
"scripts": {
"test": "cross-env NODE_ENV=test jest --testTimeout=10000",
"test:watch": "jest --watch",
"start": "nodemon app.js",
"db:reset": "npx sequelize-cli db:drop && npx sequelize-cli db:create && npx sequelize-cli db:migrate && npx sequelize-cli db:seed:all",
"deploy": "git push heroku main",
"readme": "git add . && git commit -m 'updated readme' && git push",
"createdb": " sequelize db:create",
"dropdb": "sequelize db:drop",
@willshepp28
willshepp28 / league.js
Last active November 29, 2020 22:25
Our league model
'use strict';
const {
Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
class League extends Model {
static associate(models) {}
};
League.init({
name: DataTypes.STRING,
@willshepp28
willshepp28 / league.seed.data.js
Created November 29, 2020 22:29
File to seed the db with leagues
function getLeagues(Sequelize){
return [
// Santa Monica, Venice, Ect
{
name: "South Bay Youth Sports",
email: "southbay@gmail.com",
location: Sequelize.fn('ST_GeomFromText', 'POINT(-118.48882047444324 34.02549682312539)', 4326),
price: 1000,
createdAt: new Date(),
const config = require(__dirname + '/../config/config.json')[env]; // modify here