Skip to content

Instantly share code, notes, and snippets.

View calebgrove's full-sized avatar

Caleb Grove calebgrove

View GitHub Profile
@calebgrove
calebgrove / stateToAbbr.js
Last active April 24, 2024 22:18
Convert state name to abbreviation in JavaScript. There's some better solutions in the comments, so scroll down!
// There's some better solutions in the comments, so scroll down and see how other folks have improved this!
// USAGE:
// abbrState('ny', 'name');
// --> 'New York'
// abbrState('New York', 'abbr');
// --> 'NY'
function abbrState(input, to){
@calebgrove
calebgrove / helloworld.html
Last active July 11, 2023 02:44
"Hello World" HTML/CSS. The first file is the uncommented version to let you "see" the construction better. In the second version, I've placed a lot of instructive comments. Download it, mess around with them in your favorite text editor (TextWranger is free!), and preview them in your browser.
<!DOCTYPE html>
<head>
<title>HTML and CSS "Hello World"</title>
<style>
body {
background-color: #2D2D2D;
}
h1 {
color: #C26356;
@calebgrove
calebgrove / Kirby 3 Docs Dark Mode.user.css
Last active October 18, 2021 18:35
Kirby 3 Docs Dark Mode
/* ==UserStyle==
@name Kirby 3 Docs Dark Mode
@author Caleb Grove
@version 1.0.0
@namespace cascadea-cg
@preprocessor default
==/UserStyle== */
@-moz-document url-prefix("https://getkirby.com/docs/")
{
@calebgrove
calebgrove / Kirby Reference Dark Mode.user.css
Last active January 24, 2019 19:25
Kirby 3 Reference Dark Mode CSS
/* ==UserStyle==
@name Kirby Reference Dark Mode
@author Caleb Grove
@description Make the Kirby 3 reference guide nice and dark.
@version 1.1
@namespace cascadea-calebgrove
==/UserStyle== */
@-moz-document url-prefix("https://getkirby.com/docs/reference")
{
@calebgrove
calebgrove / CustomLandingPage.html
Last active February 17, 2018 03:53
Caleb's Dropshare Template
<!--
Dropshare Landing Page
By Caleb Grove @ Grove Design
https://grovedesign.co
-->
<!DOCTYPE html>
<html lang='en'>
<?php
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = "from@example.com";
$to = "to@example.com";
$subject = "PHP Mail Test script";
$message = "This is a test to check the PHP Mail functionality";
$headers = "From:" . $from;
mail($to,$subject,$message, $headers);
echo "Test email sent";
@calebgrove
calebgrove / SassMeister-input-HTML.html
Created December 16, 2013 18:15
Generated by SassMeister.com.
<p>This text should be 20px</p>
<div>This is unstyled text. If we set the body size to 62.5%, this would be 10px instead of 16px, which is fairly unusable.</div>
@calebgrove
calebgrove / .htaccess
Last active December 22, 2015 04:28
Cache Expiration
# BEGIN EXPIRATION
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
@calebgrove
calebgrove / dabblet.css
Created November 20, 2012 00:54
Untitled
[id^='button'] {
width: 250px !important;
height: 50px !important;
margin: 10px !important;
border-radius: 8px !important;
background-color: #3F3F3F !important;