A guide to setup your WSL with Hyper and zsh
- Follow the very thorough instructions here
- Download Hyper.js here - I went with the 'hyperblue' theme.
<html> | |
<!-- ... --> | |
<!-- Embed analytics.js as local file --> | |
<script src="/analytics.js"></script> | |
</html> |
<?php | |
if (!empty($_POST)) { | |
header("access-control-allow-credentials:true"); | |
header("access-control-allow-headers:Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token"); | |
header("access-control-allow-methods:POST, GET, OPTIONS"); | |
header("access-control-allow-origin:".$_SERVER['HTTP_ORIGIN']); | |
header("access-control-expose-headers:AMP-Access-Control-Allow-Source-Origin"); | |
// I changed the protocol to HTTP since I was testing the site locally using BrowserSync, http://localhost:3000 | |
<form method="post" action-xhr="/assets/scripts/form-xhr.php" target="_top" class="form__rsrv form__sidebar"> | |
<h2 class="form__rsrv--hd">Book Now</h2> | |
<div class="grid"> | |
<div class="form__rsrv--motor"> | |
<!-- Date In --> | |
<div class="form__mod"> | |
<label for="book__date--in-top" class="form__label--required book--label">Arrival Date</label> | |
<input type="date" value="2017-01-01" class="form--input book--text" id="book__date--in-top" | |
aria-required="true" required> |
// amp-accordion doesn't seem to play well with table elements. Table inside of accordion maxes out to only about 50-60% width. | |
// Creating a dummy <tr> with <td> equal to amount of rows in table seemed to fix it. The dummy <tr> needs to have "display:table" | |
// to be able to override ".i-amphtml-content" 's default value of "display: block!important". | |
// Of course, table will be adjusted to preferred percentage. | |
// To mask text values in <td>'s, color was set to <body> background-color to hide text and make it look empty | |
<!DOCTYPE html> |
criticalOpts: { | |
base: paths.dest, | |
css: [paths.dest + 'css/styles.css'], // multiple stylesheets concatenated | |
minify: true, | |
} | |
// htmldir.in = '_site/**/*.html'; | |
// gulp-concat combines all files from multiple pages into one | |
// nano purges redundant code and minifies. |
// METHOD #1 - More performant/preferred | |
/** | |
* Apollo Terminating link | |
* The split will skip Batching if an | |
* operation's context contains hasUpload: true | |
*/ | |
const httpLink = ApolloLink.split( | |
operation => operation.getContext().hasUpload, | |
createUploadLink(OPTS), |
import React, { useState, useEffect } from 'react' | |
import PropTypes from 'prop-types' | |
import { checkIsAuthenticated, authSignUp, authLogin, authLogout } from '../../services/auth' | |
export const AuthContext = React.createContext({}) | |
export default function Auth({ children }) { | |
const [isAuthenticated, setIsAuthenticated] = useState(false) | |
const [isLoading, setIsLoading] = useState(true) |
Upon completion you will have a sane, productive Haskell environment adhering to best practices.
sudo apt-get install libtinfo-dev libghc-zlib-dev libghc-zlib-bindings-dev
// String utils | |
// | |
// resources: | |
// -- mout, https://github.com/mout/mout/tree/master/src/string | |
/** | |
* "Safer" String.toLowerCase() | |
*/ | |
function lowerCase(str) { | |
return str.toLowerCase(); |