Skip to content

Instantly share code, notes, and snippets.

View dwolke's full-sized avatar
👻
Hurz

Daniel Wolkenhauer dwolke

👻
Hurz
View GitHub Profile
<?php
/**
* Description: Export data from mysql table in .csv file
* @author: Prem Tiwari
*/
// database variables
$hostname = "localhost";
$user = "XXXXXXXXX";
$password = "XXXXXXXXX";
@dwolke
dwolke / circle.yml
Created November 6, 2016 19:28 — forked from kechol/circle.yml
Example configuration of Circle CI
machine:
timezone:
Asia/Tokyo
hosts:
ci.example.com: 127.0.0.1
php:
version: 5.6.2
node:
version: 0.10.28
python:
@dwolke
dwolke / simple_response.php
Created June 8, 2017 17:44 — forked from webdevilopers/simple_response.php
ZF2 How to return XML response
<?php
$rawXml = '<foo><bar>Baz</bar></foo>';
$response = new \Zend\Http\Response();
// Instead of header("Content-type: text/xml; charset=utf-8") use:
$response->getHeaders()->addHeaderLine('Content-Type', 'text/xml; charset=utf-8');
$response->setContent($rawXml);
return $response;
@dwolke
dwolke / create-mojave-iso.sh
Created June 10, 2019 09:36
Create a bootable ISO for macOS Mojave
#!/usr/bin/env bash
hdiutil attach /Applications/Install\ macOS\ Mojave\.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/mojave
hdiutil create -o ./MojaveBase.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach ./MojaveBase.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ Mojave\.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
rm -rf /Volumes/macOS\ Base\ System/System/Installation/Packages
mkdir -p /Volumes/macOS\ Base\ System/System/Installation/Packages
cp -R /Volumes/mojave/Packages/* /Volumes/macOS\ Base\ System/System/Installation/Packages/
hdiutil detach /Volumes/macOS\ Base\ System/
hdiutil detach /Volumes/mojave/
@dwolke
dwolke / IndexController.php
Created July 6, 2019 13:06
Ausgabe als JSON in Zend Framework 2
// Return a JsonModel from the controller action
// To send JSON to the client when the Accept header isn’t application/json,
// we use a JsonModel in a controller action like this:
namespace Application\Controller;
use Zend\Mvc\Controller\ActionController;
use Zend\View\Model\ViewModel;
use Zend\View\Model\JsonModel;
@dwolke
dwolke / Abstrakte Klassen Testen.php
Created August 17, 2019 10:18
Abstrakte Klasse mit PHPunit testen.
<?php
/**
* @see https://medium.com/@DarkGhostHunter/phpunit-testing-abstract-classes-with-an-anonymous-class-de77b0beb696
*/
namespace Tests;
use PHPUnit\Framework\TestCase;
use MyVendor\MyPackage\AbstractClass;
class AbstractTest extends TestCase
@dwolke
dwolke / testFactoryWithDependencies.php
Last active August 17, 2019 10:26
Factories mit PHPunit Testen
/**
* @see https://stackoverflow.com/questions/32714011/using-phpunit-and-zf2-factory
*/
class MailerFactoryTest extends TestCase
{
/**
* @covers ZfMailer\Service\MailerFactory::createService
*/
@dwolke
dwolke / multipartMailsWithAttachment.php
Created August 17, 2019 10:55
Senden von mehreren Anhängen mit Zend\Mails
<?php
/**
* @see https://akrabat.com/sending-attachments-in-multipart-emails-with-zendmail/
*/
use Zend\Mail\Message;
use Zend\Mime\Message as MimeMessage;
use Zend\Mime\Part as MimePart;
use Zend\Mime\Mime;
use Zend\Mail\Transport\Sendmail;
@dwolke
dwolke / gradients.css
Created September 11, 2019 18:40
CSS Gradients
/*
*
* GRADIENTS.CSS
* v.1.0.0
* @mrmrs
*
* Each color has a class for setting a gradient on
* text & background
*
* - Aqua