Skip to content

Instantly share code, notes, and snippets.

View renepardon's full-sized avatar

Christoph, René Pardon renepardon

View GitHub Profile
<?php
throw new \PebkacException('You are not able to use this system');
<?php
namespace Mail;
use Zend\ServiceManager\ServiceLocatorInterface;
return array(
'initializers' => array(
function ($instance, ServiceLocatorInterface $serviceLocator) {
if ($instance instanceof Service\MailAwareInterface) {
$mailService = $serviceLocator->get('Mail\Mail');
/**
* Expected to return \Zend\ServiceManager\Config object or array to
* seed such an object.
*
* @return array|\Zend\ServiceManager\Config
*/
public function getServiceConfig()
{
return __DIR__ . '/config/service.config.php';
}
@renepardon
renepardon / gist:4146796
Created November 26, 2012 06:06
Cordova Plugin response handling
var json = (typeof(response) === 'object') ? response : JSON.parse(response);
#include <stdio.h>
int main(int argc, const char *argv[])
{
signed char c = 1;
c = --c - c--;
printf("c: %d\n", c);
}
// Inheritance
var ListController = function () {
this.parent = new GlobalController();
this.init();
};
// Multiple inheritance
var ListController = function () {
this.parent = new GlobalController();
this.super = new MasterController();
@renepardon
renepardon / gist:2779404
Created May 24, 2012 04:23
do-not-backup attribute on iOS submission of your Cordova app
You have problems to get your Cordova app in the iOS AppStore? The do-not-backup attribute is expected but you have no clue why? Cordoa makes a backup of the data in the Documents folder. Data within this folder are automatically pushed to IOS cloud. This is due to an update of the iOS version. Because the data not come from the user, Apple will reject the app. The workaround is to put that to do-not-backup attribute to the entire Documents folder.
@renepardon
renepardon / review-result.txt
Created May 16, 2012 18:00
Approval Process - Rejected app due iCloud space problem
Your app does not follow the iOS Data Storage Guidelines, as required by the App Store Review Guidelines.
Your app backs up 3.6 MB of data to each user's iCloud space on launch. Please be sure to set the "Do not back up" attribute for all data which is not generated or modified by the user. To check how much data your app is storing:
- Install and launch your app
- Go to Settings > iCloud > Storage and Backup > Manage Storage
- If necessary, select "Show all apps"
- Check your app's storage
The iOS Data Storage Guidelines indicate that only content that the user creates using your app, (documents, new files, edits, etc.) may be stored in the /Documents directory - and backed up to iCloud.
@renepardon
renepardon / gist:2571835
Created May 1, 2012 22:08
Where is the difference between anonymous function and private function?
function Konstruktor()
{
var privat = 'blubb';
function privateMethode()
{
alert (privat);
}
var anonymeMethode = function()
{
@renepardon
renepardon / jquery.queue.js
Created April 30, 2012 16:43
For those who need a queue for different reasons ;)
// Initializations.
var theQueue = $({});
var elements = [1, 2, 3, 4, 5, 6];
// Loop through all elements and add a function to the stack for every element.
$.each(elements, function(index, item)
{
theQueue.queue('stack', function(next)
{
// Do some processing here..