Skip to content

Instantly share code, notes, and snippets.

View neojoda's full-sized avatar

Juan Bautista Giménez Sendiu neojoda

  • Freelance
  • Barcelona, Spain
View GitHub Profile
@neojoda
neojoda / subsets.php
Created July 8, 2022 13:25
[PHP] Calculate all the possible subsets given an array of elements
<?php
/**
* This is a function run recursevly to calculate all the possible subsets given an array
**/
function getAllSubsets($nums, &$result){
for ($i = 0; $i<count($nums); $i++)
{
$val = $nums[$i];
@neojoda
neojoda / self-signed-certificate-with-custom-ca.md
Created March 15, 2018 15:27 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@neojoda
neojoda / group_concat_cake3x.php
Created April 13, 2017 21:28
GROUP_CONCAT in CakePHP 3.X
$query = $this->Blports->find('all');
$query->select(['field1',
'field2' => 'group_concat(field2)',
'field3'])
->group('field2');