Skip to content

Instantly share code, notes, and snippets.

View janich's full-sized avatar

Janich Rasmussen janich

View GitHub Profile
@janich
janich / route.php
Created February 19, 2013 08:42
Ugly, but helpfull!
function q($query) {
echo "<pre>";
$q = str_replace("#__", JFactory::getConfig()->get('dbprefix'), (string) $query);
var_dump($q);
echo "</pre>";
}
@janich
janich / clipcard.php
Created March 7, 2013 13:11
Temporary fix to have BS carousel working with Joomla <= 3.0.2
/**
* Remove mootools-more to have Bootstrap carousel working.
* @return void
*/
public static function removeMTMore()
{
$headers = JFactory::getDocument()->getHeadData();
foreach($headers['scripts'] as $url => $type)
{
@janich
janich / inttest.php
Created March 15, 2013 08:16
#FridayFun Can you figure this out? :)
<?php
/*
* #FridayFun
* Can you figure this out :)
*/
header("Content-type: text/plain; Charset=UTF-8");
@janich
janich / exportMysqlUsers.php
Created July 31, 2013 13:02
Export MySQL users and permissions
<?php
/**
* Export MySQL users and permissions
*
* This script exports raw CREATE USER and GRANT queries of a given database
* to help migrate MySQL users and permissions to a new server.
* Users will keep their passwords across the migration.
*
* Warning: The import queries expects exactly the same database structure!
*
@janich
janich / integrationtest.php
Created October 3, 2013 12:42
Include version specific integration
<?php
$jversion = new JVersion();
$version = $jversion->RELEASE;
do {
$file = 'integration-j'. str_replace('.', '', $version);
if (file_exists($file)) {
require_once $file;
@janich
janich / gchart_colors.txt
Created November 20, 2013 20:31
Google Charts Colorlist 2013
Google Charts Colorlist (2013):
#3366cc
#dc3912
#ff9900
#109618
#990099
#0099c6
#dd4477
#66aa00