Skip to content

Instantly share code, notes, and snippets.

View nfourtythree's full-sized avatar

Nathaniel Hammond nfourtythree

View GitHub Profile

Keybase proof

I hereby claim:

  • I am nfourtythree on github.
  • I am nfourtythree (https://keybase.io/nfourtythree) on keybase.
  • I have a public key ASAfA_JXe8rgAyut9301GxHvL7NSUDZGX2qNLKGdwHXC1Qo

To claim this, I am signing this object:

@nfourtythree
nfourtythree / Password Protect Serverpilot App.md
Last active December 10, 2020 17:20
Password Protect Serverpilot App

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
nfourtythree / How To Disable Strict SQL Mode in MySQL 5.7.MD
Last active April 29, 2021 09:45
Serverpilot - Disable Strict SQL Mode in MySQL 5.7

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 https://gist.githubusercontent.com/nfourtythree/90fb8ef5eeafdf478f522720314c60bd/raw/disable-strict-mode.sh
  3. Make is executable chmod +x disable-strict-mode.sh
  4. Run the script ./disable-strict-mode.sh
@nfourtythree
nfourtythree / CraftValetDriver.php
Last active August 4, 2016 07:07
Laravel Valet driver for Craft CMS simple with document root (no locales)
<?php
class CraftLocaleValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
@nfourtythree
nfourtythree / index.js
Created June 29, 2016 22:09
generator-craftinstall
/* --------------------------------------------------------------------------------
GENERATOR-NYSTUDIO107
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
nfourtythree / enable_dnsmasq_on_osx.sh
Last active May 10, 2016 11:52 — forked from r10r/enable_dnsmasq_on_osx.sh
Installs and configures dnsmasq on osx (for local resolution of development machines e.g virtualbox). Cudos to Alan Ivey http://www.echoditto.com/blog/never-touch-your-local-etchosts-file-os-x-again
# ----------------------
# 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 127.0.0.1" > /etc/resolver/dev'
@nfourtythree
nfourtythree / db.php
Last active May 11, 2016 16:09
Craft Environments Setup
<?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
nfourtythree / custom.js
Created March 1, 2016 10:20
Everhour / Trello - Tracked Time and Estimate Time List totals
function throttle(fn, threshhold, scope) {
threshhold || (threshhold = 250);
var last,
deferTimer;
return function () {
var context = scope || this;
var now = +new Date,
args = arguments;
if (last && now < last + threshhold) {
@nfourtythree
nfourtythree / craft date ids bug.twig
Last active August 29, 2015 14:11
Bug in Craft CMS when using dateUpdated or dateCreated and .ids()
{# Setup Data #}
{% set stuff = craft.entries({
section: "mySection",
order: "dateUpdated ASC",
}) %}
{# Retrieve Ids #}
{% set ids = stuff.ids() %}
{#
// Base service in plugin
namespace Craft;
class Plugin_baseService extends BaseApplicationComponent
{
...
// Extended service in plugin
namespace Craft;