Skip to content

Instantly share code, notes, and snippets.


Nathaniel Hammond nfourtythree

View GitHub Profile

Keybase proof

I hereby claim:

  • I am nfourtythree on github.
  • I am nfourtythree ( on keybase.
  • I have a public key ASAfA_JXe8rgAyut9301GxHvL7NSUDZGX2qNLKGdwHXC1Qo

To claim this, I am signing this object:

nfourtythree / Password Protect Serverpilot
Last active Dec 10, 2020
Password Protect Serverpilot App
View Password Protect Serverpilot

How to password protect your Serverpilot app

This is a quick (rough) guide on how to protect a Serverpilot pilot app with auth basic

1. SSH into your Serverpilot Server

ssh SERVERPILOTUSERNAME@your.server.ip.address

2. Create a htpasswd file in your app

nfourtythree / How To Disable Strict SQL Mode in MySQL 5.7.MD
Last active Apr 29, 2021
Serverpilot - Disable Strict SQL Mode in MySQL 5.7
View How To Disable Strict SQL Mode in MySQL 5.7.MD

How To Disable Strict SQL Mode in MySQL 5.7

I wrote a quick script for those that provision servers often enough.

To get this to work take the following steps

  1. Log into your server as root
  2. Get script wget
  3. Make is executable chmod +x
  4. Run the script ./
nfourtythree / CraftValetDriver.php
Last active Aug 4, 2016
Laravel Valet driver for Craft CMS simple with document root (no locales)
View CraftValetDriver.php
class CraftLocaleValetDriver extends ValetDriver
* Determine if the driver serves the request.
* @param string $sitePath
nfourtythree / index.js
Created Jun 29, 2016
View index.js
/* --------------------------------------------------------------------------------
generator-nystudio107 is a Yeoman generator for Craft CMS installs
Type just `yo nystudio107` and a new Craft CMS project install tailored to
your liking will be created.
-------------------------------------------------------------------------------- */
'use strict';
nfourtythree /
Last active May 10, 2016 — forked from r10r/
Installs and configures dnsmasq on osx (for local resolution of development machines e.g virtualbox). Cudos to Alan Ivey
# ----------------------
# installing dnsmasq and enable daemon
# ----------------------
brew install dnsmasq
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
# ----------------------
# adding resolver for dev domain
# ----------------------
[ -d /etc/resolver ] || sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver" > /etc/resolver/dev'
nfourtythree / db.php
Last active May 11, 2016
Craft Environments Setup
View db.php
* Database Configuration
* All of your system's database configuration settings go in here.
* You can see a list of the default settings in craft/app/etc/config/defaults/db.php
return array(
nfourtythree / custom.js
Created Mar 1, 2016
Everhour / Trello - Tracked Time and Estimate Time List totals
View custom.js
function throttle(fn, threshhold, scope) {
threshhold || (threshhold = 250);
var last,
return function () {
var context = scope || this;
var now = +new Date,
args = arguments;
if (last && now < last + threshhold) {
nfourtythree / craft date ids bug.twig
Last active Aug 29, 2015
Bug in Craft CMS when using dateUpdated or dateCreated and .ids()
View craft date ids bug.twig
{# Setup Data #}
{% set stuff = craft.entries({
section: "mySection",
order: "dateUpdated ASC",
}) %}
{# Retrieve Ids #}
{% set ids = stuff.ids() %}
View craft service extend
// Base service in plugin
namespace Craft;
class Plugin_baseService extends BaseApplicationComponent
// Extended service in plugin
namespace Craft;