Skip to content

Instantly share code, notes, and snippets.

View speedygfw's full-sized avatar

Frank Wallenborn speedygfw

View GitHub Profile
//erzeugen ein mockup
var mockFile = { name: "Filename", size: 12345 };
// aufruf des default addedfile event handlers
myDropzone.emit("addedfile", mockFile);
// zeige das thumbnail an
myDropzone.emit("thumbnail", mockFile, "/image/url");
@speedygfw
speedygfw / gist:3917d4b5fbab2fbaebe4
Created June 25, 2015 07:42
OXID - Kanonische URLs in Kategorien auf die Hauptseite zeigen lassen
public function getCanonicalUrl()
{
if (($oCategory = $this->getActiveCategory())) {
$oUtils = oxRegistry::get("oxUtilsUrl");
if (oxRegistry::getUtils()->seoIsActive()) {
$sUrl = $oUtils->prepareCanonicalUrl(
$oCategory->getBaseSeoLink($oCategory->getLanguage(), '')
);
} else {
$sUrl = $oUtils->prepareCanonicalUrl(
Im /azure/tpl/widget/promoslider.tpl
[{if $sBannerLink }]
<a href="[{ $sBannerLink }]">
[{/if}]
durch
[{if $sBannerLink }]
@speedygfw
speedygfw / gist:3564d88aab719a962dd5
Created June 26, 2014 06:31
ZF2 -basic auth client
<?php
$client = new \Zend\Http\Client();
$client->setUri('http://example.com/');
$client->setAuth($user, $password);
$request = $client->request(Zend\Http\Client::POST);
@speedygfw
speedygfw / gist:2cd5bdf932a70d5307db
Created June 26, 2014 06:21
ZF1 - http client with basic auth
<?php
$client = new Zend_Http_Client();
$client->setUri('http://example.com/');
$client->setAuth($user, $password);
$request = $client->request(Zend_Http_Client::POST);
@speedygfw
speedygfw / myproxy
Last active August 29, 2015 13:57
My simple NodeJS proxy
var httpProxy = require('http-proxy')
var proxy = httpProxy.createProxy();
var options = {
'pad.fwallenborn.de': 'http://localhost:9001',
'spielfeld24.de': 'http://localhost::8000'
}
@speedygfw
speedygfw / gist:7430327
Created November 12, 2013 12:54
SQL-Date(m/d/Y) to Euro-Date (d.m.Y)
SELECT DATE_FORMAT(my_date_field, GET_FORMAT(DATE,'EUR'));
@speedygfw
speedygfw / gist:7153700
Created October 25, 2013 12:12
Wetterdaten mit PHP und XPATH parsen
<?php
$xml = simplexml_load_file("http://weather.yahooapis.com/forecastrss?w=20067098&u=c");
$data = $xml->channel->item->xpath('yweather:condition');
$weatherToday = $data[0]->attributes();
var_dump($weatherToday);
@speedygfw
speedygfw / gist:7153586
Created October 25, 2013 12:01
Unterschiede zwischen isset und array_key_exists
<?php
$a = array('key1' => 'gesetzt', 'key2' => null);
isset($a['key1']); // true
array_key_exists('key1', $a); // true
isset($a['key2']); // false
array_key_exists('key2', $a); // true
@speedygfw
speedygfw / gist:3500595
Last active October 9, 2015 11:48
example of ZfcUser ControllerPlugin
<?php
//module.php
public function getControllerPluginConfig()
{
return array(
'invokables' => array(
'zfcUserAuthentication' => 'ZfcUser\Controller\Plugin\ZfcUserAuthentication'
)