Skip to content

Instantly share code, notes, and snippets.

My Github sponsor page is alive 🎉

Abdul Malik Ikhsan samsonasik

My Github sponsor page is alive 🎉
View GitHub Profile
samsonasik / barcode.php
Last active Aug 11, 2022
barcode save download
View barcode.php
// ...
public function barcodeAction()
$barcodeOptions = array('text' => 'ZEND-FRAMEWORK');
$barcode = \Zend\Barcode\Barcode::factory('code39', 'Image', $barcodeOptions);
//temporary save file into data folder
imagegif($barcode->draw(), './data/barcode.gif');
samsonasik /
Created Aug 30, 2021
cara penggunan codeigniter coding standard
samsonasik /
Last active Apr 5, 2021
symfony tips 1 - switch dev - prod or prod - dev again
samsonasik / CreateDb.php
Last active Mar 12, 2020
create db command with ci 4
View CreateDb.php
<?php namespace App\Commands;
use CodeIgniter\CLI\BaseCommand;
use CodeIgniter\CLI\CLI;
class CreateDb extends BaseCommand
protected $group = 'app';
protected $name = 'app:createdb';
protected $description = 'Create database';
View multiple closure in routes in ci4 for filter except
$routes->group('user', [
'filter' => 'permission:manage-user',
'namespace' => 'agungsugiarto\boilerplate\Controllers\Users',
$routes->get('show', 'UserController::show', ['as' => 'user-show']);
function ($routes)
samsonasik / gist:3988701
Created Oct 31, 2012
Send HTML Mail Using ZF2
View gist:3988701
use Zend\Mail\Message;
use Zend\Mail\Transport\Smtp as SmtpTransport;
use Zend\Mime\Message as MimeMessage;
use Zend\Mime\Part as MimePart;
use Zend\Mail\Transport\SmtpOptions;
$message = new Message();
View DsnReader.php
class DsnReader
private $dsn;
public function __construct($dsn)
$this->dsn = $dsn;
samsonasik / gist:4171219
Created Nov 29, 2012
set #zf2 in shared hosting ( .htaccess )
View gist:4171219
RewriteCond %{HTTP_HOST} ^$ [NC,OR]
RewriteCond %{REQUEST_URI} !yourapp/public
RewriteRule (.*) /yourapp/public/$1 [L]
place it at your public_html (shared hosting 'root' directory ).
if you call so you will point out to public_html/yourapp/public/index.php


  • table: album
  • columns: id, data

include 'vendor/autoload.php';
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