Skip to content

Instantly share code, notes, and snippets.

View nielsnuebel's full-sized avatar

Niels Nübel nielsnuebel

View GitHub Profile
@nielsnuebel
nielsnuebel / update.sql
Created January 20, 2025 13:32
Kick Consent Manager Fix
ALTER TABLE `#__kickconsentmanager_categories`
CHANGE `checked_out` `checked_out` int(10) unsigned NULL DEFAULT NULL,
CHANGE `checked_out_time` `checked_out_time` datetime NULL DEFAULT NULL;
ALTER TABLE `#__kickconsentmanager_cookies`
CHANGE `checked_out` `checked_out` int(10) unsigned NULL DEFAULT NULL,
CHANGE `checked_out_time` `checked_out_time` datetime NULL DEFAULT NULL;
ALTER TABLE `#__kickconsentmanager_scripts`
CHANGE `checked_out` `checked_out` int(10) unsigned NULL DEFAULT NULL,
@nielsnuebel
nielsnuebel / languages.js
Created December 2, 2022 15:45
S-Thetic OTV Texte
"de-DE": {
location: {
headline: "Bitte wählen Sie ihr gewünschtes Behandlungszentrum aus:",
select: "Bitte einen Behandlungsort wählen.",
},
customer: {
headline: "Besuchen Sie uns zum ersten Mal?",
new: "Ich bin bin Neukunde bei S-Thetic",
old: "Ich bin bereits Kunde bei S-Thetic",
},
@nielsnuebel
nielsnuebel / .htaccess
Last active April 14, 2021 08:03
Joomla // Lighthouse htaccess
##
# @package Joomla
# @copyright Copyright (C) 2005 - 2020 Open Source Matters. All rights reserved.
# @license GNU General Public License version 2 or later; see LICENSE.txt
##
##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line 'Options +FollowSymLinks' may cause problems with some server configurations.
/**
* Copyright 2018 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
public function geocode($address = null)
{
if (is_null($address))
return false;
// url encode the address
$address = urlencode($address);
// google map geocode api url
$url = "https://maps.googleapis.com/maps/api/geocode/json?sensor=false&components=country:de&address={$address}&key={$this->compoParams->get('maps_api', 0)}";
@nielsnuebel
nielsnuebel / reinstall.sh
Created December 20, 2019 11:29
reinstall.sh
#!/bin/bash
BACKUP="/var/www/vhosts/PATH/scripts/kicktemp/kicktemp.sql"
BACKUPCONFIG="/var/www/vhosts/PATH/scripts/kicktemp/configuration.php"
BACKUPZIP="/var/www/vhosts/PATH/scripts/kicktemp/backup.zip"
DELETDIR="/var/www/vhosts/PATH/demo.kicktemp.com/"
CONFIG="/var/www/vhosts/PATH/demo.kicktemp.com/configuration.php"
REMOVEADMINDIR=("com_installer/" "com_media/");
REMOVESITEDIR=("com_users/");
OWNER="USER"
@nielsnuebel
nielsnuebel / backup.sh
Last active December 20, 2019 11:34
backup.sh
#!/bin/bash
BACKUP="/var/www/vhosts/PATH/scripts/kicktemp/kicktemp.sql"
BACKUPZIP="/var/www/vhosts/PATH/scripts/kicktemp/backup.zip"
BACKUPPATH="/var/www/vhosts/PATH/dev.kicktemp.com/"
SCRIPTPATH="/var/www/vhosts/PATH/scripts/kicktemp/"
MUSER="DBUSER"
MPASS="DBPASS"
MDB="DATABASE"
apt-get update && apt-get install -y git zip
curl -L https://phar.phpunit.de/phpunit.phar -o /usr/local/bin/phpunit
curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -o /usr/local/bin/phpcs
curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar -o /usr/local/bin/phpcbf
chmod +x /usr/local/bin/phpunit
chmod +x /usr/local/bin/phpcs
chmod +x /usr/local/bin/phpcbf
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
composer global require joomla/coding-standards "~2.0@alpha"
phpcs --config-set installed_paths /root/.composer/vendor/joomla/coding-standards/
@nielsnuebel
nielsnuebel / post-checkout
Last active September 9, 2019 10:36
Git Hook: create a MySQL Backup from an Joomla Database before commit.
#!/bin/bash -e
# TOWER APP
PATH="$PATH:/usr/local/bin"
# PATH
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
GITREPO=$SCRIPTPATH/../../
JCONF=$GITREPO/configuration.php
MYSQL=$(which mysql)
DIR=$(pwd)
@nielsnuebel
nielsnuebel / items.md
Last active March 15, 2019 11:45
Joomla Umkreissuche Query
$lat      = $this->getState('filter.lat');
$lng      = $this->getState('filter.lng');
$distance = $this->getState('filter.distance');

if (!empty($lat) && !empty($lng))
{
	//$query->select('( 6371 * acos( cos( radians(' . $lat . ') ) * cos( radians( a.lat ) ) * cos( radians( a.lng ) - radians(' . $lng . ') ) + sin( radians(' . $lat . ') ) * sin( radians( a.lat ) ) ) ) AS distance')
	//->having('distance <= ' . $distance);
	$query->select('( 6371 * acos( cos( radians(' . $lat . ') ) * cos( radians( a.lat ) ) * cos( radians( a.lng ) - radians(' . $lng . ') ) + sin( radians(' . $lat . ') ) * sin( radians( a.lat ) ) ) ) AS distance');