Skip to content

Instantly share code, notes, and snippets.

Avatar

Richard Styles RichardStyles

View GitHub Profile
@RichardStyles
RichardStyles / unifi-import-cert.sh
Created Jan 23, 2019
Mirror for certbot script for ubiquity unifi controller
View unifi-import-cert.sh
#!/bin/bash
# Author: Frank Gabriel, 01.01.2019
# Credits Kalle Lilja, @SprockTech and others
# Script location: /etc/letsencrypt/renewal-hooks/post/unifi-import-cert.sh (important for auto renewal)
# Tested with Debian 9 and UniFi 5.8.28, 5.9.22 and 5.9.32 - should work with any recent Unifi and Ubuntu/Debian releases
#************************************************
#******************Instructions******************
#************************************************
@RichardStyles
RichardStyles / unifi-import-cert.sh
Created Jan 23, 2019
Mirror for certbot script for ubiquity unifi controller
View unifi-import-cert.sh
#!/bin/bash
# Author: Frank Gabriel, 01.01.2019
# Credits Kalle Lilja, @SprockTech and others
# Script location: /etc/letsencrypt/renewal-hooks/post/unifi-import-cert.sh (important for auto renewal)
# Tested with Debian 9 and UniFi 5.8.28, 5.9.22 and 5.9.32 - should work with any recent Unifi and Ubuntu/Debian releases
#************************************************
#******************Instructions******************
#************************************************
@RichardStyles
RichardStyles / UserObserver.php
Last active Feb 11, 2018
Laravel Observer template
View UserObserver.php
<?php
namespace App\Observers;
use App\User;
class UserObserver
{
/**
@RichardStyles
RichardStyles / _myapp-buttons.scss
Created Jun 16, 2016 — forked from homeyer/_myapp-buttons.scss
ExtJS green button component UI definition
View _myapp-buttons.scss
@include extjs-button-ui(
/* UI + Scale */
'green-small',
$border-radius: $button-small-border-radius,
$border-width: $button-small-border-width,
$border-color: green,
$border-color-over: green,
$border-color-focus: green,
View keybase.md

Keybase proof

I hereby claim:

  • I am richardstyles on github.
  • I am styles (https://keybase.io/styles) on keybase.
  • I have a public key ASAGE_lIU_glgK27tOjJULyRVPj-9Hf8FRT8ifC8s3nnswo

To claim this, I am signing this object:

View gist:15150abffae886b74f1c
#
# REQUIRES:
# - server (the forge server instance)
# - site_name (the name of the site folder)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - event_id (the provisioning event name)
# - callback (the callback URL)
#
@RichardStyles
RichardStyles / vagrant-VagrantFile
Created Sep 22, 2015
VagrantFile - base for Centos/7
View vagrant-VagrantFile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
View vagrant-bootstrap.sh
#!/usr/bin/env bash
echo "Starting Bootstrap"
echo "Running update..."
yum update
echo "Installing requirements.."
yum -y install httpd php
echo "setup HTML dir"
rm -rf /var/www/html
@RichardStyles
RichardStyles / CKeditor.js
Last active Apr 19, 2018
ExtJS 5 component to hold CKEditor (web text editor) from http://ckeditor.com/
View CKeditor.js
Ext.define('Ext.ux.CKeditor', {
extend: 'Ext.form.field.TextArea',
alias: 'widget.ckeditor',
defaultListenerScope: true,
listeners: {
instanceReady: 'instanceReady',
resize: 'resize',
boxready : 'onBoxReady'
@RichardStyles
RichardStyles / JsonResponse.php
Last active May 26, 2016
Middleware for PHP Slim framework 3.x to output JSON responses with the correct header. Probably a better way to do this then just simply interrogating the response body, but for a initial test sufficient for my needs.
View JsonResponse.php
<?php
/**
* Middleware to set correct header for JSON output.
* Very basic initial version, simply checks the body of the response to see if it is valid JSON.
* If response is not JSON then continues with default settings.
* If response is JSON then header is updated.
*
* @author Richard Styles
*/
namespace App\Middleware;