Skip to content

Instantly share code, notes, and snippets.

Avatar

René Penner renepenner

View GitHub Profile
View Datev
<?php
class Wambo_DatevExport_Model_Export_DatevCSV extends Wambo_DatevExport_Model_Export_Abstract
{
const FOLDERNAME = 'datev';
const FILENAME_POSTFIX = '.csv';
const KONTO_DE = '8400';
const KONTO_EU_PRIVATE = '8331';
const KONTO_EU_COMPANY = '8336';
@renepenner
renepenner / check-xml.php
Created Jan 10, 2018
check all magento xml
View check-xml.php
<?php
require_once('./app/Mage.php');
umask(0);
Mage::app();
// enable user error handling
libxml_use_internal_errors(true);
$root = './app';
$iterator = new RecursiveIteratorIterator(
View google feed
<?php
ini_set('memory_limit', '1024M');
#header('Content-Type: application/xml; charset=utf-8');
set_time_limit(0);
require '/var/www/html/htdocs/app/Mage.php';
umask(0);
$store_id = 1;
Mage::app($store_id)->getStore();
$_imgSize = 350;
$ean = 9134357654527; //random :)
@renepenner
renepenner / motion-sensor.php
Last active Aug 23, 2021
HUE Motion Sensor Script
View motion-sensor.php
<?php
$hue_bridge = "http://192.168.178.100";
$hue_secret = "?????????????";
$loxone_address = 'miniserver-ip:34435';
$config = [
'ZLLTemperature' => [
'key' => 'temperature'
],
View docker_memory_usage_all_container
memory_usage=0; for line in `docker ps | awk '{print $1}' | grep -v CONTAINER`; do docker ps | grep $line | awk '{printf $NF" "}' && echo $(( `cat /sys/fs/cgroup/memory/docker/$line*/memory.usage_in_bytes` / 1024 / 1024 ))MB ; done
View git-alias
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
@renepenner
renepenner / mySmartHomeController
Created Mar 9, 2014
Arduino Sketch for my Smart Home Controller
View mySmartHomeController
#include <Wire.h> // modify speed to 400kHz
#include <OneWire.h>
#include <SerialCommand.h>
#define ONEWIRECOUNT 4
OneWire oneWirePorts[ONEWIRECOUNT] = {8,9,10,11};
// Pattern for & bit Operation to get a 6 Bit Time info
const long TIM_PATTERN = 0x0000000000000000000000000000003F;
View spinner2.php
<?php
class SpinningItem{
public function __construct($content){$this->content = $content;}
}
class TextItem extends SpinningItem{}
class OptionsItem extends SpinningItem{}
function parse_spinning_string($string){
if(preg_match_all('/\{((?>[^{}]+)|(?R))*\}/', $string, $matches)){
foreach($matches[0] as $key => $match){