Skip to content

Instantly share code, notes, and snippets.

View SGudbrandsson's full-sized avatar

Sigurður Guðbrandsson SGudbrandsson

View GitHub Profile
@SGudbrandsson
SGudbrandsson / .bash_aliases
Last active December 21, 2018 09:44
Bash quick function for lighthouse audits (skipping network load)
#
# Run a lighthouse audit and open it in a new tab in Chrome
# This uses Docker for consistency
# Only the performance test is run
#
# USAGE:
# lighthouse production mobile https://google.com
# lighthouse mobile https://google.com
# lighthouse desktop https://google.com
#
@SGudbrandsson
SGudbrandsson / ORM.php
Last active February 11, 2016 13:11
Kohana 3.3 ORM extension for safe database transactions
<?php defined('SYSPATH') OR die('No direct script access.');
class ORM extends Kohana_ORM {
/**
* Set to true if you are creating a new transaction
* Set to false once you commit or rollback.
*
* @author Sigurdur
*/
@SGudbrandsson
SGudbrandsson / 404checker.js
Last active August 29, 2015 14:27 — forked from n1k0/404checker.js
A CasperJS script to check for 404 & 500 internal links on a given website
/**
* This casper scipt checks for 404 internal links for a given root url.
*
* Usage:
*
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
*/
/*global URI*/
@SGudbrandsson
SGudbrandsson / index.php
Last active June 10, 2023 01:11
Create a WordPress staging area from your live wordpress setup with a Click-of-a-button [TM] ..
<?php
/**
*
* This script will copy your wordpress from public_html (or wherever)
* and place it in a staging folder.
* It will then clone the database, reconfigure the config file
* and replace URL's from the original URL to your staging URL.
* It will then make sure to NOT allow search engines to index the page.
*
* Use this script to clone your main wp in order to test maintenance work
<?php
/**
* Template Name: Discourse SSO
* Author: Adam Capriola
* Version: 1.1
* Author URI: https://meta.discourse.org/users/AdamCapriola/activity
* Adapted From: https://github.com/ArmedGuy/discourse_sso_php
* Uses: https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045
*
*/