Skip to content

Instantly share code, notes, and snippets.

View renepenner's full-sized avatar

René Penner renepenner

View GitHub Profile
<?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){
@renepenner
renepenner / mySmartHomeController
Created March 9, 2014 20:23
Arduino Sketch for my Smart Home Controller
#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;
[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"
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
@renepenner
renepenner / motion-sensor.php
Last active August 23, 2021 10:50
HUE Motion Sensor Script
<?php
$hue_bridge = "http://192.168.178.100";
$hue_secret = "?????????????";
$loxone_address = 'miniserver-ip:34435';
$config = [
'ZLLTemperature' => [
'key' => 'temperature'
],
<?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 / check-xml.php
Created January 10, 2018 10:02
check all magento xml
<?php
require_once('./app/Mage.php');
umask(0);
Mage::app();
// enable user error handling
libxml_use_internal_errors(true);
$root = './app';
$iterator = new RecursiveIteratorIterator(
<?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 / payment-response-capabilities.json
Last active March 16, 2023 08:31
payment-response-capabilities
{
"localizationIdentifier": "CONNECTOR_WAMBO_PAY_VIII",
"merchantAccountParametersDefinitions": [
{
"name": "description",
"type": "string",
"possibleValues": [],
"readOnly": false,
"required": true,
"secret": false,