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
@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
@dassiorleando
dassiorleando / README.md
Created October 30, 2016 09:36 — forked from tjamps/README.md
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

<?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;
@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