Skip to content

Instantly share code, notes, and snippets.

<?php
class Venue
{
protected $name;
/* @var $likes Integer */
protected $likes;
public function getLikes()
{
[
{
"content_type": "users_box",
"records": [
{
"user": "name"
},
{
"user": "name"
{
"comments": [
{
"type": "speciality_contribution_comment",
"id": 2,
"comment": "Que patat tan sabrosa",
"user": {
"type": "user",
"name": "joan",
...
[
{ "type": "user",
"name": "joan"
},
{ "type": "user" ,
"name": "PDO"
},
{ "type": "separator",
@joanteixi
joanteixi / Read CSV file
Created August 21, 2015 10:36
Read a csv file
$resource = __DIR__. 'myfile.csv';
$file = new \SplFileObject($resource);
$file->setFlags(\SplFileObject::READ_CSV |
\SplFileObject::SKIP_EMPTY |
\SplFileObject::DROP_NEW_LINE
);
$file->setCsvControl(';', '"');
foreach ($file as $item) {
@joanteixi
joanteixi / gist:c6593e3952d5810a8d693b61fb20e339
Created May 25, 2016 20:05
Go Instalation, Sublime and others...
* Install go
https://golang.org/dl/
export GOPATH=$HOME/goProjects
add to path /usr/local/go/bin (or similar)
* Workspace
src contains Go source files,
pkg contains package objects, and
bin contains executable commands.

Accounts manage

azure account list

Set default account

azure account set {ID}

VM

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365
#remove password
openssl rsa -in key.pem -out newkey.pem && mv newkey.pem key.pem
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo usermod -aG docker ${USER}
su - ${USER}
@joanteixi
joanteixi / implications.json
Created August 22, 2017 09:51
implications example
[
{
"id": 1,
"fromtag": "isquemia",
"totag": "ictus",
"field": "zmalaltact",
"managed": 1
},
{
"id": 2,