<form id="form">
<input type="name" name="full_name" />
<input type="file" name="image" />
<button type="submit">Submit</button>
</form>
// Fetch
<?php | |
/** | |
* Plugin Name: Netlify build hook | |
* Plugin URI: https://dimitr.im | |
* Description: Call webhook when WordPress post is published | |
* Version: 1.0 | |
* Author: g00glen00b | |
* Author URI: https://dimitr.im | |
*/ | |
add_action('publish_future_post', 'nb_webhook_future_post', 10); |
html { | |
scroll-behavior: smooth; | |
} | |
@media (prefers-reduced-motion: reduce) { | |
html { | |
scroll-behavior: auto; | |
} | |
} |
// requires raf.js (polyfil) | |
(function(){ | |
var ids = {}; | |
function requestId(){ | |
var id; | |
do { | |
id = Math.floor(Math.random() * 1E9); | |
} while (id in ids); |
/* | |
Author: ZetCoby | |
http://stackoverflow.com/a/30376660/3708754 | |
*/ | |
var tools = { | |
/** | |
* | |
* Used to get the length of a rect | |
* |
<form id="form">
<input type="name" name="full_name" />
<input type="file" name="image" />
<button type="submit">Submit</button>
</form>
// Fetch
<?php // You need to add server side validation and better error handling here | |
$data = array(); | |
if(isset($_GET['files'])) | |
{ | |
$error = false; | |
$files = array(); | |
$uploaddir = './uploads/'; |
Barba.Dispatcher.on('newPageReady', function(currentStatus, oldStatus, container, newPageRawHTML) { | |
// html head parser borrowed from jquery pjax | |
var $newPageHead = $( '<head />' ).html( | |
$.parseHTML( | |
newPageRawHTML.match(/<head[^>]*>([\s\S.]*)<\/head>/i)[0] | |
, document | |
, true | |
) | |
); | |
var headTags = [ |
// set svg d path used as fallback (star) | |
$svg-d-path: 'm25,1l6,17l18,0l-14,11l5,17l-15,-10l-15,10l5,-17l-14,-11l18,0l6,-17z' !default; | |
// functions to urlencode the svg string | |
@function str-replace($string, $search, $replace: '') { | |
$index: str-index($string, $search); | |
@if $index { | |
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace); | |
} | |
@return $string; |
// If the user has been on the page for over 12 hours, the next link | |
// click will do a full page transition to get new code | |
import React from "react"; | |
import { BrowserRouter, useLocation } from "react-router-dom"; | |
let hour = 3600000; | |
export default function StaleAppRouter(props) { | |
let [isStale, setIsStale] = useState(false); |
{% set imgBase %}/img/post-directory/{% endset %}
![Alt text]({{ imgBase }}img-name.png)