Skip to content

Instantly share code, notes, and snippets.

Data & Mathematics lover.

Leonardo Rifeli leonardorifeli

Data & Mathematics lover.
View GitHub Profile
leonardorifeli / Users.class.php
Created Jun 21, 2014
88bit - Classe de usuários
View Users.class.php
class Users extends DataBase {
public $id;
public $email;
public $birthDate;
public $fullName;
public $city;
public $state;
git config --global alias.cowsay '!git commit -m "`fortune | cowsay -f tux`"'
leonardorifeli / generator.php
Created Oct 15, 2015 — forked from tawfekov/generator.php
Doctrine2 Generate Entities form Existing Database
View generator.php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
// config
$config = new \Doctrine\ORM\Configuration();
leonardorifeli /
Created Jan 17, 2016 — forked from karmi/
Simple tag cloud with ElasticSearch `terms` facet
# (Re)create the index
curl -X DELETE "http://localhost:9200/tagcloud"
curl -X PUT "http://localhost:9200/tagcloud"-d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
leonardorifeli / ConnectionInformationService.php
Last active Aug 19, 2016
Implemented the Ratchet socket using PHP
View ConnectionInformationService.php
namespace Hermes\Business\Service;
use Ratchet\ConnectionInterface;
abstract class ConnectionInformationService
static public function checkInformations(ConnectionInterface $connection)
leonardorifeli /
Last active Aug 20, 2016
Inheritance or composition article
package com.leonardorifeli.article.inheritance.model;
public class Automobile {
private String color;
private Integer quantityPort;
public String getColor() {
return color;
leonardorifeli / .travis.yml
Created Nov 11, 2016
Post about structure of blog
View .travis.yml
language: ruby
- 2.2.2
- chmod +x
script: ./
View 1.How to easily implement a REST API with oAuth2

It's still a work in progress...


As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :

leonardorifeli /
Last active Mar 20, 2017
SOLID - SRP - PopulationStandardDeviation
package com.leonardorifeli.article;
public class GenerateReport {
public ArrayList<String> find() { }
public ArrayList<String> proccess() { }
public void print() { }
leonardorifeli / asyncAwait.js
Last active Jul 11, 2017
Apresentação Node.js
View asyncAwait.js
async function sendAsync(userId) {
let user = await getUser(userId);
let profile = await getProfile(user);
let account = await getAccount(profile);
let report = await getReport(account);
let send = sendStatistic(report);
You can’t perform that action at this time.