Skip to content

Instantly share code, notes, and snippets.

View HashandSalt's full-sized avatar

Hash&Salt HashandSalt

View GitHub Profile
@HashandSalt
HashandSalt / .htaccess
Created April 4, 2023 12:52
.htaccess
# Kirby .htaccess
# rewrite rules
<IfModule mod_rewrite.c>
# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on
RewriteCond %{HTTP_HOST} !=localhost
@HashandSalt
HashandSalt / deploy.sh
Created March 2, 2023 11:01
Deploynment script
#!/bin/bash
ERRORSTRING="Whoops! That didn't work. Please check the command you ran."
if [ $# -eq 0 ]
then
echo "$ERRORSTRING";
elif [[ "$1" == "sync" ]]
then
if [[ -z $2 ]]
@HashandSalt
HashandSalt / esbuild.js
Created February 9, 2023 17:40
Esbuild config
import * as dotenv from "dotenv";
dotenv.config();
import * as esbuild from "esbuild";
import postcss from "postcss";
import autoprefixer from "autoprefixer";
import purgecss from "@fullhuman/postcss-purgecss";
import { sassPlugin } from "esbuild-sass-plugin";
import browserSync from "browser-sync";
import copyStaticFiles from "esbuild-copy-static-files";
gestureZone.addEventListener('touchstart', function(event) {
touchstartX = event.changedTouches[0].screenX;
}, false);
gestureZone.addEventListener('touchend', function(event) {
touchendX = event.changedTouches[0].screenX;
handleGesture();
}, false);
function handleGesture() {
if (touchendX < touchstartX && Math.abs(touchendX - touchstartX) > 150) {
window.location.replace(prev.href)
// Simple Times Font Stack
$times: Times, 'Times New Roman', serif;
// Simple Arial Font Stack
$arial: Arial, sans-serif;
// Simple Georgia Font Stack
$georgia: Georgia, serif;
// Simple Garamond Font Stack
$garamond: 'Apple Garamond', 'ITC Garamond Narrow', 'Garamond', serif;
// Simple Helvetica Font Stack
$helvetica: 'Helvetica Neue', Helvetica, sans-serif;
@HashandSalt
HashandSalt / webpack.mix.js
Created August 4, 2019 11:28
Mix for Kirby
// ======================================================================
// slateengine.dev <http://slateengine.com | <hello@hashandsalt.com>
// ======================================================================
let mix = require('laravel-mix');
let CleanWebpackPlugin = require('clean-webpack-plugin');
let SpritesmithPlugin = require('webpack-spritesmith');
let FaviconsWebpackPlugin = require('favicons-webpack-plugin');
let purgeCss = require('laravel-mix-purgecss');
@HashandSalt
HashandSalt / card.js
Created June 3, 2019 10:40
Player card
window.onload = playerCard();
// Generate the card
function playerCard() {
var request = new XMLHttpRequest();
request.open('GET', '/assets/data/player-stats.json', true);
request.onload = function() {
if (request.status >= 200 && request.status < 400) {
// Success!
@HashandSalt
HashandSalt / KirbyValetDriver.php
Created January 15, 2019 23:14
Kirby3 Valet Driver
<?php
class KirbyValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@HashandSalt
HashandSalt / deploy.sh
Last active June 12, 2017 11:37
Bash script for deploying website with Rsync
#!/bin/bash
ERRORSTRING="Whoops! That didn't work. Please check the command you ran."
if [ $# -eq 0 ]
then
echo "$ERRORSTRING";
elif [[ "$1" == "live" ]]
then
if [[ -z $2 ]]