Skip to content

Instantly share code, notes, and snippets.

View jeremyblaze's full-sized avatar

Jeremy Blaze jeremyblaze

View GitHub Profile
@jeremyblaze
jeremyblaze / .htaccess
Created January 15, 2020 23:05
Fixes page links on exported Webflow sites
Options -Multiviews -Indexes +FollowSymLinks
DirectorySlash Off
RewriteEngine On
RewriteBase /
# Remove .html at the end of the request
RewriteCond %{THE_REQUEST} "^(GET|POST|HEAD) /(.*).html(\?.*)? HTTP/[0-9.]+$"
RewriteRule ^(.*)\.html $1 [R=301,L]
@jeremyblaze
jeremyblaze / middleman.php
Last active November 28, 2018 01:19
Alerter middleman
<?php
if ( isset($_POST['message']) ) {
$url = 'https://api.pushover.net/1/messages.json';
$data = array();
$data['token'] = "YOUR PUSHOVER TOKEN";
$data['user'] = "YOUR PUSHOVER USER ID";
$data['message'] = $_POST['message'];
if ( isset($_POST['title']) ) {
@jeremyblaze
jeremyblaze / function.php
Created November 26, 2017 03:59
Alerter function
<?php
function alertMe($message, $sound = "pushover") {
$data['message'] = $message;
$data['title'] = "THE TITLE OF YOUR APP";
$data['sound'] = $sound;
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
<?php
function alertMe($message, $sound = "pushover") {
$data['message'] = $message;
$data['title'] = "THE TITLE OF YOUR APP";
$data['sound'] = $sound;
$options = array(
'http' => array(
@jeremyblaze
jeremyblaze / Greetings
Last active August 29, 2015 14:24
Greet website visitors with a happy message!
<div id="greeting"></div>
<script type="text/javascript" src="greetings.js">
now = new Date();
hrs = now.getHours();
msg = "";
if (hrs > 0) msg = "Morning, earlybird.";
if (hrs > 6) msg = "Morning.";
if (hrs > 12) msg = "Afternoon.";