Skip to content

Instantly share code, notes, and snippets.

View samsonasik's full-sized avatar
🔥
I am doing very fast fix 🚀, sponsor me 💖 https://github.com/sponsors/samsonasik

Abdul Malik Ikhsan samsonasik

🔥
I am doing very fast fix 🚀, sponsor me 💖 https://github.com/sponsors/samsonasik
View GitHub Profile
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 June 10, 2016 12:49 — forked from harikt/composer.json
Get all the contributors from the repos of an organization
{
"require": {
"guzzlehttp/guzzle": "4.*"
}
}
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;
Verifying that +samsonasik is my blockchain ID. https://onename.com/samsonasik

-- 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 June 26, 2015 09:28
try catch test internal method
class Foo
{
    private function bar($languageId)
    {
        // like http call...
        
        // some heavy task
    }
 
@samsonasik
samsonasik / phpunit.xml
Last active August 29, 2015 14:21
phpunit issue
<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>
config
  autoload
data
  cache
module
    Application
public_html
     js
 css
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)
<?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;