Skip to content

Instantly share code, notes, and snippets.

View nmngt's full-sized avatar
🌎
there's no place like home

nmngt nmngt

🌎
there's no place like home
View GitHub Profile
@nmngt
nmngt / hetzner_install_composer.sh
Created April 27, 2023 11:27
add php composer to hetzner webhosting
mkdir ~/bin
mkdir ~/bin/composer
cd ~/bin/composer
wget https://getcomposer.org/composer.phar
echo "# php version" >> ~/.bashrc
echo "export PHPVERSION=8.0 " >> ~/.bashrc
echo "" >> ~/.bashrc
echo "# composer alias" >> ~/.bashrc
echo "alias composer='php -d allow_url_fopen=on ~/bin/composer/composer.phar'" >> ~/.bashrc
source ~/.bashrc
@nmngt
nmngt / GetContaoFilePathInWordPress.php
Last active December 18, 2022 08:17
GetContaoFilePathInWordPress
function get_imagepath_from_contao()
{
$wpdb_contao = new \wpdb('USER', 'PASSWORD', 'DBNAME', 'localhost');
$result = $wpdb_contao->get_col("
SELECT DISTINCT `product_imageSrc`
FROM `tl_zenner_products_language`
WHERE `id` = '1'
");
<?php
/**
* prueft, ob der Zugriff von einem Page Analyzer, wie Google PageSPeed Insights,
* aus erfolgt.
*
* Da wir keinen Einfluss auf den Brwoser-Cache der Google Analytics JS haben,
* spielen wir kein Google Analytics aus, wenn ein Page Analyzer auf die Seite
* zugreift. Das verschönert unsere Werte ;-)
*
* @param string $ua User-Agent
CREATE TABLE `bestellungen` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`kunden_id` int(11) NOT NULL,
`bestellnummer` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
KEY `kunden_id` (`kunden_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------