Skip to content

Instantly share code, notes, and snippets.

View 1000heads-luke's full-sized avatar

Luke Stevenson 1000heads-luke

View GitHub Profile
@1000heads-luke
1000heads-luke / htaccess
Last active May 6, 2024 23:53 — forked from cristiroma/htaccess
.htaccess file for production
FileETag MTime Size
<IfModule mod_expires.c>
ExpiresActive on
# Default Cache of 1 month
ExpiresDefault "access 1 month"
# HTML - 1 month
ExpiresByType text/html "access 1 month" # .html
javascript: (function() {
function callback() {
function l() {
$("strong.headings_detector").remove();
if( !$('style#headings_detector') ){
$('head').append(
'<style id="headings_detector">'+
'.headings_detector {'+
'color:#FFF;font-weight:bold;font-size:small;background:yellow;'+
'}'+
@1000heads-luke
1000heads-luke / localise_time.js
Last active December 19, 2022 06:20
jQuery function which identifies all HTML "<time>" elements with a DATETIME attribute. It then replaces the contents of those elements with the Localised DateTime (based on the viewer's language and clock settings) and moves the original content to the TITLE attribute.
jQuery(function($){
$('time[datetime]').each(function(k,v){
const $t = $(this);
const dt = $t.attr('datetime');
const d = new Date(Date.parse(dt));
if( !d )
return;
const s = d.toLocaleString(
window.navigator.language ,
/*
.font-face()
Adds Webfont File (WOFF & WOFF2)
*/
.font-face(@font-family, @font-name, @font-root: '/', @font-weight: normal, @font-style: normal ){
@font-face {
font-family: @font-family;
src: url('@{font-root}@{font-name}.woff2') format('woff2'),
url('@{font-root}@{font-name}.woff') format('woff');
@1000heads-luke
1000heads-luke / bootstrap.html
Last active May 15, 2020 04:54 — forked from MrChuffmanSnippets/index.html
HTML5: Blank Template
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">