Skip to content

Instantly share code, notes, and snippets.

☕️

Abdul Malik Ikhsan samsonasik

☕️
Block or report user

Report or block samsonasik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View table-prefix-in-columns-zend-db.md

Assumption:

  • table: album
  • columns: id, data
<?php

include 'vendor/autoload.php';
View DsnReader.php
<?php
class DsnReader
{
private $dsn;
public function __construct($dsn)
{
$this->dsn = $dsn;
}
View fdjfaslfjaslfa.md
namespace Foo\Middleware;

use Interop\Http\ServerMiddleware\DelegateInterface;
use Interop\Http\ServerMiddleware\MiddlewareInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\JsonResponse;

class JsonWrappingMiddleware implements MiddlewareInterface
{
View gist:1fdb69ee5fa3504d0fcad0f077adaf1d

install zf3 skeleton

composer create-project -sdev zendframework/skeleton-application zf3

install zendframework/zend-mvc-i18n

composer require zendframework/zend-mvc-i18n
@samsonasik
samsonasik / I18nDelegatorFactory.php
Last active Sep 14, 2016
setup i18n in expressive
View I18nDelegatorFactory.php
<?php
// src/App/Helper/I18nDelegatorFactory.php
namespace App\Helper;
use Zend\I18n\View\HelperConfig;
use Zend\ServiceManager\Factory\DelegatorFactoryInterface;
use Interop\Container\ContainerInterface;
class I18nDelegatorFactory implements DelegatorFactoryInterface
{
@samsonasik
samsonasik / download-file-in-expressive.php
Created Sep 9, 2016 — forked from settermjd/download-file-in-expressive.php
Quick example of how to download/stream a file using Zend Expressive.
View download-file-in-expressive.php
<?php
/**
* This is a quick example of how to stream a file to a client, likely a browser,
* using Zend Expressive. There are a lot of factors which it doesn't take in to
* account. But for the purposes of a quick intro, this should suffice.
*/
class ViewDocumentPageAction
{
protected function downloadFile()
{
@samsonasik
samsonasik / config
Created Sep 8, 2016 — forked from donnfelker/config
Watch or Unwatch a file in git
View config
# Goes in your .git/config file
[alias]
# Temporarily stop tracking a file in git.
# usage: git unwatch path/to/file
unwatch = update-index --assume-unchanged
# Resume tracking a file in git.
# usage: git watch path/to/file
watch = update-index --no-assume-unchanged
View doctrine-migration-handle.md
namespace Application\Migration;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
class Version20160704163301 extends AbstractMigration
@samsonasik
samsonasik / composer.json
Created Jun 10, 2016 — forked from harikt/composer.json
Get all the contributors from the repos of an organization
View composer.json
{
"require": {
"guzzlehttp/guzzle": "4.*"
}
}
View gist:291f67bc762fbbd3bc5b424b001dc517
IF (NOT EXISTS(SELECT * FROM QSYS2.SYSTABLES WHERE TABLE_SCHEMA = 'BACKUP' AND TABLE_NAME='MYTABLE')) THEN
CREATE TABLE BACKUP.MYTABLE
AS (SELECT * FROM MYLIB.MYTABLE)
WITH DATA;
ELSE
INSERT INTO BACKUP.MYTABLE
SELECT * FROM MYLIB.MYTABLE;
END IF;
You can’t perform that action at this time.