Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
is perturbed

Gary Barclay Bodge-IT

💭
is perturbed
View GitHub Profile
View File open options
<a href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/9487/LV_MOTOR_DOCUMENT_OF_INSURANCE.pdf" target="_blank">HTML a href target _blank</a>
<a href="#0" onclick="window.open('https://s3-us-west-2.amazonaws.com/s.cdpn.io/9487/LV_MOTOR_DOCUMENT_OF_INSURANCE.pdf');">JS window.open()</a>
<a href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/9487/LV_MOTOR_DOCUMENT_OF_INSURANCE.pdf" download="Nice Name of Document.pdf">HTML5 download attribute</a>
@Bodge-IT
Bodge-IT / config.php
Created Nov 23, 2018 — forked from dongilbert/config.php
Override Core Joomla! Classes
View config.php
<?php
/**
* @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
Bodge-IT / gist:7dd9c834c861483411f3f438904ec06a
Last active Mar 29, 2019
Articles filter & grid layout
View gist:7dd9c834c861483411f3f438904ec06a
<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>
</div>
<h2 class="my-4">Subtitle</h2>
<div class="row">
<p>{articles category="category" tag="tag" ordering="title"}</p>
@Bodge-IT
Bodge-IT / gist:f6a52adaa392e45c25a6efe55c6e0a23
Created Apr 9, 2018
Fix chosen dropdown from disappearing off the page at bottom
View gist:f6a52adaa392e45c25a6efe55c6e0a23
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 = $( event.target ).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 ) {
View gist:c8c0939f44044f2145517bfc020c02b6
Using for loop
for host in docker1 docker2 docker3 docker4; do ssh pi@$host curl -sSL https://get.docker.com | sh; done
View gist:48871de55789f5b2e871805ad1a844af
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
Bodge-IT / edit.php
Created Jan 11, 2018 — forked from sanderpotjer/edit.php
Template override for improved Joomla article submission form
View edit.php
<?php
/**
* @package Article Form override for Joomla 3
* @copyright Copyright (c) 2014 Sander Potjer - www.perfectwebteam.nl
* @license GNU General Public License version 3 or later
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');