Skip to content

Instantly share code, notes, and snippets.

Avatar
🤩
My Github sponsor page is alive 🎉 https://github.com/sponsors/samsonasik/

Abdul Malik Ikhsan samsonasik

🤩
My Github sponsor page is alive 🎉 https://github.com/sponsors/samsonasik/
View GitHub Profile
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;
View verify-+samsonasik+blockchain
Verifying that +samsonasik is my blockchain ID. https://onename.com/samsonasik
View upsert-sample-postgresql.md

-- CREATE EXTENSION "uuid-ossp";

--insert into album(id, artist, title) --values((select uuid_generate_v4()), 'Foo', 'Foox');

-- for example: on this case, uuid generate return: f316f033-87a8-450e-a4df-94ac6e32f87d

insert into album(id, artist, title) values('f316f033-87a8-450e-a4df-94ac6e32f87d', 'Foo', 'Foo2') ON CONFLICT(id) DO UPDATE SET title=excluded.title;

@samsonasik
samsonasik / test-internal.md
Created Jun 26, 2015
try catch test internal method
View test-internal.md
class Foo
{
    private function bar($languageId)
    {
        // like http call...
        
        // some heavy task
    }
 
@samsonasik
samsonasik / phpunit.xml
Last active Aug 29, 2015
phpunit issue
View phpunit.xml
<phpunit bootstrap="Bootstrap.php" colors="true">
<testsuite name="MyTest" >
<directory>./MyModuleTest</directory>
</testsuite>
<filter>
<whitelist>
<directory>./../../../../module/MyModule/src</directory>
<file>./../../../../module/MyModule/Module.php</file>
</whitelist>
<blacklist>
View hosting-zf2-up.md
config
  autoload
data
  cache
module
    Application
public_html
     js
 css
View json_manipulator.sql
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json)
RETURNS json
IMMUTABLE
LANGUAGE sql
AS $$
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json
FROM (
SELECT * FROM json_each(data)
UNION ALL
SELECT * FROM json_each(insert_data)
View Bootstrap.php
<?php
/**
* @author Marco Pivetta <ocramius@gmail.com>
*/
use Zend\ServiceManager\ServiceManager;
use Zend\Mvc\Service\ServiceManagerConfig;
use DoctrineORMModuleTest\Framework\TestCase;
use ContentTest\Util\ServiceManagerFactory;
use Zend\Loader\StandardAutoloader;