Skip to content

Instantly share code, notes, and snippets.

View alikon's full-sized avatar
🔬
researching

Nicola Galgano alikon

🔬
researching
View GitHub Profile
DROP PROCEDURE IF EXISTS tree_recover;
DELIMITER //
CREATE PROCEDURE tree_recover ()
MODIFIES SQL DATA
BEGIN
DECLARE currentId, currentParentId INT;
DECLARE currentLeft INT;
@alikon
alikon / OrdineStateContract.kt
Created April 3, 2019 14:41
draft ordine di pagamento state e contract
// TO DO da cambiare
package com.r3.businessnetworks.ordine.states
// TO DO da cambiare
import com.r3.businessnetworks.ordine.states.OrdineStatus.*
import net.corda.core.contracts.*
import net.corda.core.contracts.Requirements.using
import net.corda.core.identity.Party
import net.corda.core.schemas.MappedSchema
import net.corda.core.schemas.PersistentState
@alikon
alikon / signmanifest.php
Last active April 3, 2018 16:55
Generate the signed update manifest
<?php
/**
* @package Joomla.Cli
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* This is a CLI script to generate the signed update manifest which should be called from the command-line, not the
<?php
/**
* @package Joomla.Cli
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* This is a CLI script to check my digital certifyed public key which should be called from the command-line, not the
<?php
/**
* @package Joomla.Cli
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* This is a CLI script to generate keypairs which should be called from the command-line, not the
@alikon
alikon / cajoomla.php
Last active March 31, 2018 10:41
CLI script to generate an extension developer public key certificate
<?php
/**
* @package Joomla.Cli
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* This is a CLI script which should be called from the command-line, not the
@alikon
alikon / docker-setup.sh
Created January 7, 2018 12:03 — forked from fredlahde/docker-setup.sh
Docker & Docker Compose Ubuntu 17.10
#!/bin/bash
# docker
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu zesty stable"
@alikon
alikon / postgresql.php
Last active July 4, 2017 06:41
getTableForeginKeys
public function getTableForeignKeys($table)
{
$this->connect();
$query = "SELECT c.conname AS constraint_name,
CASE c.contype
WHEN 'c' THEN 'CHECK'
WHEN 'f' THEN 'FOREIGN KEY'
WHEN 'p' THEN 'PRIMARY KEY'
WHEN 'u' THEN 'UNIQUE'
END AS constraint_type,
@alikon
alikon / mysqli.php
Created July 3, 2017 06:21
getTableForeignKeys($table)
public function getTableForeignKeys($table)
{
$this->connect();
// Get the details foreign keys information.
$query = $this->getQuery(true)
->select('tb1.CONSTRAINT_NAME, tb1.TABLE_NAME, tb1.COLUMN_NAME, ' .
'tb1.REFERENCED_TABLE_NAME, tb1.REFERENCED_COLUMN_NAME, tb2.MATCH_OPTION, ' .
'tb2.UPDATE_RULE, tb2.DELETE_RULE')
->from('information_schema.KEY_COLUMN_USAGE AS tb1')