Skip to content

Instantly share code, notes, and snippets.

🏹
Governed by Oxóssi

Leonardo Rifeli leonardorifeli

🏹
Governed by Oxóssi
Block or report user

Report or block leonardorifeli

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@leonardorifeli
leonardorifeli / golang_kinesis.go
Created Jun 14, 2018 — forked from coboshm/golang_kinesis.go
Golang + Kinesis firehose
View golang_kinesis.go
package main
import (
"log"
"encoding/json"
"fmt"
"os"
"math/rand"
View sendString.js
// the wizare functions
var sendString = (function(rfb, force, sendDelay) {
sendDelay = sendDelay || 25;
var _q = [];
var _qStart = function() {
var chr = _q.shift();
if (chr) {
rfb.sendKey(chr);
setTimeout(_qStart, sendDelay);
}
@leonardorifeli
leonardorifeli / AWS_S3_File_Upload.js
Created Jan 4, 2018 — forked from homam/AWS_S3_File_Upload.js
How to upload files to AWS S3 with NodeJS SDK
View AWS_S3_File_Upload.js
var AWS = require('aws-sdk'),
fs = require('fs');
// For dev purposes only
AWS.config.update({ accessKeyId: '...', secretAccessKey: '...' });
// Read in the file, convert it to base64, store to S3
fs.readFile('del.txt', function (err, data) {
if (err) { throw err; }
@leonardorifeli
leonardorifeli / restart_bluetooth.sh
Created Sep 4, 2017 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
View restart_bluetooth.sh
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@leonardorifeli
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);
console.log(send);
}
@leonardorifeli
leonardorifeli / GenerateReport.java
Last active Mar 20, 2017
SOLID - SRP - PopulationStandardDeviation
View GenerateReport.java
package com.leonardorifeli.article;
public class GenerateReport {
public ArrayList<String> find() { }
public ArrayList<String> proccess() { }
public void print() { }
}
View 1.How to easily implement a REST API with oAuth2 presentation.md

It's still a work in progress...

Intro

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
leonardorifeli / .travis.yml
Created Nov 11, 2016
Post about structure of blog
View .travis.yml
language: ruby
rvm:
- 2.2.2
before_script:
- chmod +x build.sh
script: ./build.sh
branches:
@leonardorifeli
leonardorifeli / Automobile.java
Last active Aug 20, 2016
Inheritance or composition article
View Automobile.java
package com.leonardorifeli.article.inheritance.model;
public class Automobile {
private String color;
private Integer quantityPort;
public String getColor() {
return color;
}
@leonardorifeli
leonardorifeli / ConnectionInformationService.php
Last active Aug 19, 2016
Implemented the Ratchet socket using PHP
View ConnectionInformationService.php
<?php
namespace Hermes\Business\Service;
use Ratchet\ConnectionInterface;
abstract class ConnectionInformationService
{
static public function checkInformations(ConnectionInterface $connection)
You can’t perform that action at this time.