Skip to content

Instantly share code, notes, and snippets.

View Bodge-IT's full-sized avatar
is perturbed

Gary Barclay Bodge-IT

is perturbed
View GitHub Profile
<a href="" target="_blank">HTML a href target _blank</a>
<a href="#0" onclick="'');">JS</a>
<a href="" download="Nice Name of Document.pdf">HTML5 download attribute</a>
Bodge-IT / config.php
Created November 23, 2018 10:00 — forked from dongilbert/config.php
Override Core Joomla! Classes
* @package Joomla.Plugin
* @subpackage System.Overrides
* @copyright Copyright (C) 2012 Don Gilbert. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
define('OVERRIDES', dirname(__FILE__).'/overrides');
Bodge-IT / gist:7dd9c834c861483411f3f438904ec06a
Last active March 29, 2019 08:55
Articles filter & grid layout
<div class="container">
<div class="row">
<div class="col-3"></div>
<div class="col-6 my-3">
<div class="text-center">
<h1>Main Title</h1>
<h2 class="my-4">Subtitle</h2>
<div class="row">
<p>{articles category="category" tag="tag" ordering="title"}</p>
Bodge-IT / gist:f6a52adaa392e45c25a6efe55c6e0a23
Created April 9, 2018 15:08
Fix chosen dropdown from disappearing off the page at bottom
The code is a bit verbose -- deliberately so, so that you can see what's going on.
$('#my-select').on('chosen:showing_dropdown', function(event, params) {
var chosen_container = $( ).next( '.chosen-container' );
var dropdown = chosen_container.find( '.chosen-drop' );
var dropdown_top = dropdown.offset().top - $(window).scrollTop();
var dropdown_height = dropdown.height();
var viewport_height = $(window).height();
if ( dropdown_top + dropdown_height > viewport_height ) {
Using for loop
for host in docker1 docker2 docker3 docker4; do ssh pi@$host curl -sSL | sh; done
Bodge-IT / gist:48871de55789f5b2e871805ad1a844af
Created March 21, 2018 21:31
Copy SSH keys to each node
This step is optional, but it allow us to easily SSH into each node without using a password.
I'll use the ssh-copy-id command to copy my public key to the remote server.
If you don't have a key generated already, you can do so with:
ssh-keygen -t rsa
Hit enter twice and leave the passphrase empty (unless you really want to use a passphrase).
Bodge-IT / edit.php
Created January 11, 2018 22:04 — forked from sanderpotjer/edit.php
Template override for improved Joomla article submission form
* @package Article Form override for Joomla 3
* @copyright Copyright (c) 2014 Sander Potjer -
* @license GNU General Public License version 3 or later
defined('_JEXEC') or die;