Skip to content

Instantly share code, notes, and snippets.

Avatar
:atom:
Data & Mathematics lover.

Leonardo Rifeli leonardorifeli

:atom:
Data & Mathematics lover.
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
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 / tagcloud.sh
Created Jan 17, 2016 — forked from karmi/tagcloud.sh
Simple tag cloud with ElasticSearch `terms` facet
View tagcloud.sh
# (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
leonardorifeli / generator.php
Created Oct 15, 2015 — forked from tawfekov/generator.php
Doctrine2 Generate Entities form Existing Database
View generator.php
<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();
View gitcowsay.sh
git config --global alias.cowsay '!git commit -m "`fortune | cowsay -f tux`"'
You can’t perform that action at this time.