Skip to content

Instantly share code, notes, and snippets.

View linyatis's full-sized avatar

José Filipe Lyra linyatis

  • São Paulo, SP, Brasil
View GitHub Profile
@linyatis
linyatis / NavigationMenu.js
Created August 27, 2014 17:27
NavigationMenu
/**
* @docauthor Jose Filipe Lyra
*
* Cria um menu de navegacao com suporte ao novo sistema de rotas do ExtJS.
*
* ## Itens do tipo 'button'
* Itens do tipo 'button' sao tratados como as opcoes do menu. Utilize a propriedade `href`
* iniciando com um hashtag (#) para utilizar o fragment identifier (a rota em si).
* Exemplo de uso:
* @example
@linyatis
linyatis / Farm
Last active August 29, 2015 14:07
Problema com converter
public class Farm {
private Long id;
private String name;
private Polygon perimeter;
public Farm() {
}
public Long getId() {
@linyatis
linyatis / CORSController
Created November 6, 2014 00:44
VRaptor 4 CORS
@Controller
public class CORSController {
@Inject private Result result;
@Inject private Router router;
@Options("/*")
public void options(@Observes VRaptorRequestStarted requestInfo) {
Set<HttpMethod> allowed = router.allowedMethodsFor(requestInfo.getRequest().getRequestedUri());
String allowMethods = allowed.toString().replaceAll("\\[|\\]", "");
@linyatis
linyatis / ProductController.java
Created April 5, 2015 20:41
Classes Projeto VRaptor + Angular (cookbook vraptor)
package br.com.caelum.vraptor.controller;
import java.util.List;
import javax.inject.Inject;
import br.com.caelum.vraptor.Consumes;
import br.com.caelum.vraptor.Controller;
import br.com.caelum.vraptor.Delete;
import br.com.caelum.vraptor.Get;
@linyatis
linyatis / ApiGatewayInvokeLambda
Created May 30, 2016 20:07
Hacking AWS API Gateway e AWS Lambda
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Resource": [
"*"
],
"Action": [
"lambda:InvokeFunction"
#!/usr/bin/env bash
#
# Simple script that downloads the specified version from proto-resources repo.
#
# Usage:
#
# ./sync-proto-resources.sh [version] [destination]
# - version (default latest): the version which you want to download.
# - destination (default PWD/proto): the destination directory where to put the downloaded files.
#