Method | Path | Purpose |
---|---|---|
GET | / | Home page |
GET | /places | Places index page |
POST | /places | Create new place |
GET | /places/new | Form page for creating a new place |
GET | /places/:id | Details about a particular place |
PUT | /places/:id | Update a particular place |
GET | /places/:id/edit | Form page for editing an existing place |
DELETE | /places/:id | Delete a particular place |
View README.md
View login_register.js
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
/** | |
* Add this JavaScript early in the DOM so it will execute when the page loads. | |
* You can use something like the "Simple Custom CSS and JS" plugin: | |
* https://wordpress.org/plugins/custom-css-js/# | |
* | |
* If you want to test it, execute the code inside the "DOMContentLoaded" | |
* function in the developer console on the login|register page. | |
*/ | |
document.addEventListener("DOMContentLoaded", function (event) { |
View uploader.py
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
# Inspired by https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python | |
import os | |
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient, __version__ | |
# Make sure you update this per server | |
CONTAINER_NAME = 'mcbackups1' | |
try: | |
print("Azure Blob storage v" + __version__ + " - Python quickstart sample") |
View webpack.config.js
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
const path = require('path') | |
const ExtractTextWebpackPlugin = require('extract-text-webpack-plugin') | |
const { postLogin, postArticle } = require('./js/api') | |
const express = require('express') | |
module.exports = { | |
mode: 'development', | |
entry: { | |
'app': './js/index.js', | |
'styles': './sass/styles.sass' |
View htmlToAST.js
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
const { jsx } = require('slate-hyperscript') | |
const { JSDOM } = require('jsdom') | |
const DOMParser = new JSDOM().window.DOMParser | |
/** | |
* Parses and returns a Rich Text AST object for use in GraphCMS. | |
* | |
* @param {HTML} html string, e.g. `<p>hi there</p>` | |
*/ | |
const htmlToAST = html => { |
View HashFunction.ts
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 * as crypto from 'crypto'; | |
import * as fs from 'fs'; | |
import * as path from 'path'; | |
/** | |
* Interface for Webpack's hashFunction | |
*/ | |
export interface IHashFunction { | |
update: (data: string | Buffer, encoding: string) => IHashFunction; | |
digest: (encoding: string) => string | Buffer; |
View index.html
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 JavaScript Test</title> | |
</head> | |
<body> | |
<h1 id="page-header"> | |
Loading... | |
</h1> | |
View main.scss
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 "bourbon/bourbon"; | |
@import "colors"; | |
@import url('https://fonts.googleapis.com/css?family=Inconsolata'); | |
@import "grid"; | |
@import "utils"; | |
$parent_menu_items: 3; | |
$submenu_menu_items: 4; | |
html, body { |
View main.js
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
$(document).ready(function() { | |
let menu = $('nav > ul'), | |
menuLink = $('#mobile-menu a'); | |
menuLink.on('click', function() { | |
if (menu.hasClass('closed')) { | |
menu.removeClass('closed'); | |
menu.addClass('open'); | |
} else { |
View index.html
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
<body> | |
<nav> | |
<ul class="closed"> | |
<li id="mobile-menu" class="mobile-only"> | |
<a href="#"> | |
<div id="hamburger"></div> | |
MENU | |
</a> | |
</li> | |
<li> |
NewerOlder