Skip to content

Instantly share code, notes, and snippets.

View OwenMelbz's full-sized avatar

Owen Melbourne OwenMelbz

View GitHub Profile
@OwenMelbz
OwenMelbz / aliases.sh
Created July 16, 2018 11:27
SSH Aliases
alias code='cd ~/Sites'
alias nah='git reset --hard;git clean -df;'
gogo() {
git add .
git commit -m "$(echo $@)"
git pull
git push
}
@OwenMelbz
OwenMelbz / datatables_logic.blade.php
Last active November 1, 2018 07:38
Backpack CRUD - Persistent Filters/Pages/Searches
<!-- DATA TABLES SCRIPT -->
<script src="{{ asset('vendor/datatables/js/jquery.dataTables.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('vendor/datatables/js/dataTables.bootstrap.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('vendor/datatables/js/responsive/dataTables.responsive.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('vendor/datatables/js/responsive/responsive.bootstrap.min.js') }}" type="text/javascript"></script>
<script>
var crud = {
enablePersistance: true,
route: 'DataTables_{{ trim($crud->getRoute(), '/') }}',
@OwenMelbz
OwenMelbz / new nano.sh
Last active June 29, 2018 11:07
Pimp my Nano
curl https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh | sh
@OwenMelbz
OwenMelbz / form.scss
Created May 1, 2018 16:39
Simple Form with Floating Labels
.input {
max-width: 100%;
padding: 5px 10px;
transition: border-color .2s ease;
border-radius: 0;
border-color: $black-1;
outline: none;
font-size: 16px;
-webkit-appearance: none;
@OwenMelbz
OwenMelbz / genesis_public_key
Created March 4, 2018 11:04
genesis_public_key
0480b54701ee78db62e2dd5d0657eb3b12c0cd1e1781025aadd9fa64856cb5f25cf799c3187e0189a84f199d67366ada4a352345a723fbb00565d334010cd0b598
@OwenMelbz
OwenMelbz / ContactServiceAPI.php
Last active November 6, 2017 16:22
HubSpot Contact Form
<?php
namespace Statamic\Addons\ContactService;
use Statamic\API\Email;
use Statamic\Extend\API;
class ContactServiceAPI extends API
{
@OwenMelbz
OwenMelbz / DumpFullQueryMacro.php
Last active September 14, 2017 10:30
Dump Full Query Macro
<?php
/*
* Why
*
* If you're trying to debug queries sometimes its a pain to figure out if the actual
* query is correct as things like ->toSql dont provide the real values
* then ->getBindings returns objects like carbon etc which makes it hard.
*
* This tries to help by giving you a more realistic query output
@OwenMelbz
OwenMelbz / 1.install.md
Last active November 28, 2017 15:45
Critical CSS Scripts

Introduction

This is a very experimental script setup, feel free to modify, do what you wish, you'll need to take these instructions with a pinch of salt. Its designed to allow you to annotate css/scss/less etc files and then using postcss will generate *.critical.css files which can then be inlined using server side includes.

Installation

  1. Skim through the code, updating all the paths/folder structures etc to your requirements.
  2. Add the extra dependencies to your node setup
  3. run node split-critical.js - or add a script alias in your package.json for npm run criticalcss for example.
  4. This will generate a minified globals.critical.css for you to use via SSIs and any other tagged files
@OwenMelbz
OwenMelbz / 1. Installation.md
Last active September 1, 2017 09:47
rmate alias setup for ssh

Installation

SSH into the server

Run the installer

source <(curl -fsSL https://gist.githubusercontent.com/OwenMelbz/b188d3fc7a68e54e542793f9395013f3/raw/85e060e99e407b34049fe72ca9719591bec0ec2a/setup.sh)
@OwenMelbz
OwenMelbz / .bashrc
Created August 16, 2017 16:33
Handy bash aliases
alias code='cd ~/Sites'
alias nah='git reset --hard;git clean -df;'
gogo() {
git add .
git commit -m "$(echo $@)"
git pull
git push
}