Skip to content

Instantly share code, notes, and snippets.

View justinhartman's full-sized avatar
🏠
Working from home

Justin Hartman justinhartman

🏠
Working from home
View GitHub Profile
@justinhartman
justinhartman / grav.log
Created February 23, 2018 02:06
Grav Email plugin v2.7.1 error log
[2018-02-23 04:01:38] grav.CRITICAL: An exception has been thrown during the rendering of a template ("Array to string conversion").
Trace:
#0 /Volumes/Storage/Personal/Code/Bitbucket/grav-cms/cache/twig/aa/aaab75792f569c46fa615c07b11a280129befc59c135accab1661b56ee376e04.php(230): Twig_Template->displayBlock('input', Array, Array)
#1 /Volumes/Storage/Personal/Code/Bitbucket/grav-cms/vendor/twig/twig/lib/Twig/Template.php(215): __TwigTemplate_c951f6fc011e16a161e8d3f5f5bc93c82cdb43b0cf185804d0f5f77b7dbe185e->block_group(Array, Array)
#2 /Volumes/Storage/Personal/Code/Bitbucket/grav-cms/cache/twig/aa/aaab75792f569c46fa615c07b11a280129befc59c135accab1661b56ee376e04.php(158): Twig_Template->displayBlock('group', Array, Array)
#3 /Volumes/Storage/Personal/Code/Bitbucket/grav-cms/vendor/twig/twig/lib/Twig/Template.php(215): __TwigTemplate_c951f6fc011e16a161e8d3f5f5bc93c82cdb43b0cf185804d0f5f77b7dbe185e->block_contents(Array, Array)
#4 /Volumes/Storage/Personal/Code/Bitbucket/grav-cms/cache/twig/aa/aaab75792f569
@justinhartman
justinhartman / 01_self-signed-ssl-howto.md
Last active September 21, 2025 01:43
How to create self-signed SSL certificates for localhost that actually works

How to create self-signed SSL certificates for localhost

Option 1

Create a directory in your user root directory where we will store the necessary generated files.

$ cd ~/
$ mkdir .localhost
$ cd .localhost

Now run this single command and you will have both a certificate and private key which was used to sign the certificate.

@justinhartman
justinhartman / screenshots.md
Last active March 2, 2018 17:18
Change the Default Save Location of Screenshots in Mac OS X

Change the Default Save Location of Screenshots in Mac OS X

This is how you change the default save location of screenshots to anywhere you want in Mac OS X.

Create a New Folder

Choose a location, like the Downloads folder and create a folder called Screenshots (or whatever you'd like) where your screenshots will now be saved. In this example I created a folder called Screenshots in my Downloads folder. You will need the path to this folder in the next step so remember what it is. My path to the folder is ~/Downloads/Screenshots; you don't need the full path and the tilda (~) represents the symbolic link to my home folder - i.e. /Users/macbookpro/ or /Users/your_name/.

Setting the New Location

Open up your Terminal application found in /Applications/Utilities/Terminal.app and enter the following command.

$ defaults write com.apple.screencapture location ~/Downloads/Screenshots
@justinhartman
justinhartman / raven-ssl-commands.md
Last active March 5, 2018 17:16
RavenDB SSL Certificate Generator

RavenDB SSL Certificate Generator

A quick note on the command for generating a valid SSL certificate for [RavenDB][raven] using openssl. You will need to have followed [this tutorial][howto] to be able to simply run this one command below. If you don't have a valid localhost SSL certificate with a valid Certificate Authority keychain file then this won't work. The [tutorial][howto] covers this all so don't fret.

Generate SSL Certificate

$ cd ~/.localhost/ca/intermediate
$ openssl pkcs12 -export -out ravendb/certificate.pfx -inkey private/localhost.key.pem \
      -in certs/localhost.cert.pem -certfile certs/ca-chain.cert.pem
@justinhartman
justinhartman / sublimerge.md
Last active March 7, 2018 14:26
Sublimerge 3

Package Control Messages

Sublimerge 3

Sublimerge 3 (beta) has just been installed. Thanks for trying it out!

It is highly recommended to restart Sublime Text before first use.

@justinhartman
justinhartman / php-301-redirect.php
Created March 7, 2018 15:31
301 Permanent Redirect in PHP
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://22digital.agency");
exit();
@justinhartman
justinhartman / curl-retry-resume.md
Created March 14, 2018 14:12
cURL retries and file-resume command

cURL retries and file-resume command

Because I need to be able to download files with the option to resume with our shitty South African Internet connectivity.

$ curl -O -C - --retry 4 --progress-bar "FILE_URL"
@justinhartman
justinhartman / xscheme-example-file.xml
Last active May 5, 2018 19:48
The LicensesViewController.xcscheme file containing key configuration options.
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
@justinhartman
justinhartman / xcode-gitignore-response.md
Created May 5, 2018 19:39
Xcode .gitignore template response to PR in @github/gitignore

Apologies for taking so long to respond to your question. It's been a long time since I made these changes so I'll try my best to explain it all 😄.

1. *.xcodeproj/

There is a good [thread over here][1] that gets into some more specifics but the issue with excluding the .xcodeproj/ in its entirety is that you are excluding files that shouldn't be excluded and may need to be shared across development team members. The additional rules I added address this problem of simply excluding the entire folder.

.xcodeproj/ structure

In order to address the additional rules I added in [patch-1][patch] I have included the follow tree output of an Xcode project; in particular, the .xcodeproj/ folder. I will use this to reference rules #2, #3 and #4 below.

@justinhartman
justinhartman / shortcut-commands.md
Created May 17, 2018 00:55
Common Development Terminal Commands

Git

Shortcut Command
gsb git status -s
gaa 'git add --all'
gcmsg 'git commit -m'
gcam 'git commit -a -m'
gp ’git push'
gcl 'git clone --recursive'
ggpull 'git pull origin $(git_current_branch)'