Skip to content

Instantly share code, notes, and snippets.

View joshcummingsdesign's full-sized avatar

Josh Cummings joshcummingsdesign

View GitHub Profile
@joshcummingsdesign
joshcummingsdesign / .htaccess
Last active June 13, 2018 03:49
Force Redirect to Secure Protocol from .htaccess (Apache)
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301,NC]
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
@joshcummingsdesign
joshcummingsdesign / Makefile
Created June 6, 2018 18:50
Makefile Example
THIS_FILE := $(lastword $(MAKEFILE_LIST))
all: help
coffee:
@echo "☕ Making some coffee! ☕"
@$(MAKE) -f $(THIS_FILE) boil-water
@$(MAKE) -f $(THIS_FILE) grind-beans
@$(MAKE) -f $(THIS_FILE) pour-water
@echo "☕ Coffee is ready! ☕"
@joshcummingsdesign
joshcummingsdesign / .editorconfig
Created June 6, 2018 18:37
EditorConfig Example
# editorconfig.org
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
// Using em units allows you to
// change the size using font-size
// on the parent.
// Using fill and stroke currentColor
// allows you to set the color using color
// on the element.
.a-icon {
display: inline-block;
@joshcummingsdesign
joshcummingsdesign / conf
Last active November 26, 2023 10:44
NGINX config for a Jekyll site using SSL
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name example.com www.example.com;
@joshcummingsdesign
joshcummingsdesign / post-receive
Last active June 11, 2018 18:22
Git post-receive hook
#!/bin/bash
git --work-tree=<site-directory> --git-dir=<git-repo> checkout -f