Skip to content

Instantly share code, notes, and snippets.

View marceloemanoel's full-sized avatar

Marcelo Emanoel Bezerra Diniz marceloemanoel

View GitHub Profile
@marceloemanoel
marceloemanoel / keybase.md
Created February 28, 2019 13:51
keybase.md

Keybase proof

I hereby claim:

  • I am marceloemanoel on github.
  • I am marceloemanoel (https://keybase.io/marceloemanoel) on keybase.
  • I have a public key ASCuFrwGipdYWYeFwFgtfkNtbTKxj4QaKeKQrsa30A_jkQo

To claim this, I am signing this object:

@marceloemanoel
marceloemanoel / NotaFiscal.java
Created May 2, 2017 19:01
"CPF na Nota" (Exemplo de uso do Optional)
public class NotaFiscal {
public NotaFiscal(Pessoa cliente, List<Produto> produtos) {
this.cliente = cliente;
this.produtos = produtos;
}
public String toString() {
String pulaLinha = System.getProperty("line.separator");
StringBuilder nota = new StringBuilder("Nota Fiscal" + pulaLinha);
nota.append("=================================" + pulaLinha);
@marceloemanoel
marceloemanoel / SomeAction.ts
Last active May 1, 2017 17:56
Redux Action Class
import {Action} from "redux";
export default class SomeAction implements Action {
static type: string = "SOME_ACTION";
get type(): string {
return SomeAction.type;
}
}
@marceloemanoel
marceloemanoel / layout.js
Created November 17, 2014 14:15
RequireJs module to handle layout using Gridster
define(["jquery",
"jquery.gridster"], function($) {
var gridster = $(".gridster").gridster({
widget_margins: [5, 5],
widget_base_dimensions: [200, 200],
widget_selector:"section.widget",
draggable: {
handle: '.ui-sortable-handle, .ui-sortable-handle > h5',
stop: function() {
@marceloemanoel
marceloemanoel / bash
Created January 14, 2014 14:03 — forked from panchicore/bash
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
@marceloemanoel
marceloemanoel / Closables.scala
Last active January 1, 2016 20:29
Use Structural Typing to safely close any resource while using it in a transparent manner.
object ImAClosable {
def work() = {
println("working...")
}
def close() {
prinlnt("closing...")
}
}
package br.com.smartcoders.easyclinic.components;
import org.springframework.http.HttpStatus;
import br.com.caelum.vraptor.Intercepts;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.InterceptionException;
import br.com.caelum.vraptor.core.InterceptorStack;
import br.com.caelum.vraptor.interceptor.Interceptor;
import br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor;
@marceloemanoel
marceloemanoel / gist:5929983
Created July 4, 2013 20:12
Jetty deploy with zero downtime
http://rafaelsteil.com/2012/09/15/zero-downtime-deploy-script-for-jetty/
@marceloemanoel
marceloemanoel / gist:4261636
Created December 11, 2012 20:02 — forked from alissonsales/gist:776153
Filmes e documentários para abrir sua mente
Lista de documentários e filmes que considero como "obrigatórios", ou seja, todos deveriam assistir.
O critério usado para colocar um item na lista é: O documentário/filme mudou sua visão do mundo.
Documentários:
The Corporation - http://www.imdb.com/title/tt0379225/
The Story of Stuff - http://www.storyofstuff.com/
The Genius of Charles Darwin - http://en.wikipedia.org/wiki/The_Genius_of_Charles_Darwin
BBC - Horizon: How Many People Can Live on Planet Earth? - http://www.bbc.co.uk/programmes/b00pdjmk
@marceloemanoel
marceloemanoel / gist:4017444
Created November 5, 2012 14:26
How to apply gradle environments plugin
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath: "com.github.marceloemanoel:gradle-environments-plugin:0.1"
}
}