Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Matt Thomas betweenbrain

I may be slow to respond.
View GitHub Profile
AmyStephen / Messages.xml
Created May 19, 2012 13:32
Molajo Data Sources
View Messages.xml
<?xml version="1.0" encoding="utf-8"?>
phproberto /
Last active December 10, 2015 21:58
Joomla! overridable media cheatsheet
View Request.php
* Mimetype for your file - requires PHP 5.3, not enabled on default by Windows
$php_mime = finfo_open(FILEINFO_MIME);
$this->mime_type = strtolower(finfo_file($php_mime, $this->your_file_path_and_name));
// Thanks for great discussion from Ben Ramsey, Anthony Ferrara, Dave Reid, Jarvis Badgley
drmmr763 / process
Created June 28, 2013 20:44
Using plugins and mods for CCK in Joomla 3
View process
I'm trying to use the Joomla core as much as possible. Now to say that I'm using ONLY core would be untrue, since technically I'm creating and installing some plugins to accomplish this, but they certainly aren't 'heavy duty' components like K2, seblod, or some of the other Joomla CCKs out there.
Site I just built using this concept
## write some plugins
This sofimap plugin loads an XML file into the backend of ```com content``` that lets me store extra field data in my own table. So the process here is to use all the plugin events for ```com content``` to load the form, load form data, save form data, delete form data, and even display saved data in the front end.
AmyStephen / ProcessInput.php
Created July 11, 2013 00:23
System Plugin - onBeforeCompileHead - you can walk through any assets for the head. Where the head is rendered
View ProcessInput.php
public function onBeforeCompileHead()
$head = JFactory::getDocument()->getHeadData();
$styleSheets = $head['styleSheets'];
$newStyleSheets = array();
foreach ($styleSheets as $key => $value)
jlleblanc / gist:2926803
Created June 13, 2012 22:09
Using JImage to create square profile pictures in two sizes, regardless of the original's orientation
View gist:2926803
$image = new JImage('/path/to/original.jpg');
$height = $image->getHeight();
$width = $image->getWidth();
if ($height > $width) {
$crop_square = $width;
$crop_top = ($height - $width) / 2;
jhafner /
Created May 16, 2013 15:55
Open the current repo on Github. Script by Brian Edgerton.
remote=`git config --get remote.origin.url`
if [ $host = $git_host ]
mudge / .htaccess
Created November 7, 2008 14:48
Remove file extensions in URLs with mod_rewrite but preserve 404 errors.
View .htaccess
# The following will allow you to use URLs such as the following:
# Which will actually serve files such as the following:
CrowderSoup / find_replace.js
Created February 19, 2014 16:40
Replace all instances of a substring without Regex in JavaScript
View find_replace.js
var str = 'This is a test string.';
// Let's replace all spaces with ','
str = str.split(' ').join(',');
scotthorn / viewport-shots.js
Last active June 29, 2020 08:49
Nightwatch.js script for taking screenshots of a given URL at various browser widths.
View viewport-shots.js
* Takes provided URL passed as argument and make full height screenshots of this page
* with several viewport widths using Nightwatch.js with Selenium.
* These viewport widths are taken from common android and iOS devices. Modify as needed.
* Takes an optional second argument for the path where screenshots are saved.
* Usage:
* $ nightwatch -t viewport-shots.js