Skip to content

Instantly share code, notes, and snippets.

View dassiorleando's full-sized avatar

Orleando Dassi dassiorleando

View GitHub Profile
@dassiorleando
dassiorleando / gist:254b6f10200c83e57c50cc872be4a723
Created March 7, 2018 05:12
Illustrate the use of $timeout and setTimeout with AngularJs
/**
* Simple script to show how to solve the scrope update
* When using the native js TimeOut call
*
* @author dassiorleando
*/
(function (angular) {
'use strict';
angular
@dassiorleando
dassiorleando / app.js
Created December 11, 2017 18:33 — forked from JuanJo4/app.js
Twitter OAuth with node-oauth for node.js + express 4
/*
Node.js, express, oauth example using Twitters API
Install Dependencies:
npm install express
npm install oauth
Create App File:
Save this file to app.js
@dvlden
dvlden / ffmpeg.md
Last active April 17, 2024 19:53
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
@dassiorleando
dassiorleando / Heroku-RoR.md
Created March 12, 2017 08:09
Simple instructions to deploy a ruby on rails app to heroku

Push Your RoR app To Heroku

Simple Config To Push Your RoR app To Heroku using Pg:

  • Let sqlite just in development & test environment
group :development, :test do
 gem 'sqlite3', '1.3.12'
end
@JuanJo4
JuanJo4 / app.js
Last active September 26, 2020 21:53
Twitter OAuth with node-oauth for node.js + express 4
/*
Node.js, express, oauth example using Twitters API
Install Dependencies:
npm install express
npm install oauth
Create App File:
Save this file to app.js
@dassiorleando
dassiorleando / DateTimeUtil.java
Last active January 20, 2020 07:25
A JodaTime and java.util.Date Util Class with a lot of usefull functions.
package cm.flashbusiness.core.util;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.joda.time.DateTime;
/**
* @author dassi
@lologhi
lologhi / 1.How to easily implement a REST API with oAuth2 presentation.md
Last active April 4, 2024 22:13
Symfony2 : How to easily implement a REST API with oAuth2 (for normal guys)

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. :

@liorkesos
liorkesos / Overview
Last active May 23, 2016 09:21
Up the MEAN stack - Package flow...
In MEAN data is collected and communicated in the package and it goes through the different layers of angular, express and mongo.
The data "moves" "up the stack" from the angular view to the controller and then the service and from then to an express route a controller and model schema which is used to save the object in the db.
We'll use the create.html from the articles core package to demonstrate this.
<?php
namespace NoxLogic\DemoBundle\Form\Type;
use Doctrine\ORM\EntityManager;
use NoxLogic\DemoBundle\Entity\Province;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
@danvbe
danvbe / 1-Explanations.md
Last active April 21, 2023 15:39
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.