Navigation Menu

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 / 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 / nodeconf_2011.md
Created May 15, 2011 12:23 — forked from cmilfont/nodeconf_2011.md
a list of slides from nodeconf 2011
@marceloemanoel
marceloemanoel / LaTeX
Created June 11, 2011 02:20
Links interessantes sobre LateX
Como incluir código fonte no seu texto lateX?
resumidos:
http://texblog.wordpress.com/2008/04/02/include-source-code-in-latex-with-listings/
http://www.tjansson.dk/?p=419
completo:
ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf
Pseudo código em LateX?
http://en.wikibooks.org/wiki/LaTeX/Algorithms_and_Pseudocode
@marceloemanoel
marceloemanoel / gist:1155073
Created August 18, 2011 20:17
Problema de validação do Vraptor
@Get
@Path("/")
public void consultar(final Requisicao requisicao) {
validator.checking(new Validations() {{
that(requisicao, Matchers.notNullValue(), "requisicao", "parametro.obrigatorio", "requisicao");
}});
if(validator.hasErrors()){
System.out.println("encontrou um erro");
}
@marceloemanoel
marceloemanoel / db_examples_on_activerecord.rb
Created March 1, 2012 13:20 — forked from rponte/db_examples_on_activerecord.rb
disabling referential integrity examples
## ORACLE
def disable_referential_integrity(&block) #:nodoc:
sql_constraints = <<-SQL
SELECT constraint_name, owner, table_name
FROM user_constraints
WHERE constraint_type = 'R'
AND status = 'ENABLED'
SQL
old_constraints = select_all(sql_constraints)
begin
@marceloemanoel
marceloemanoel / djr.js
Created April 8, 2012 19:55 — forked from cmilfont/djr.js
Turma 3 - Exercício 4 - DJR
Array.prototype.add = function(el) {
this[this.length] = el;
return this;
};
if(typeof Array.prototype.each == "undefined") {
Array.prototype.each = function(fn) {
for(var index = 0; index < this.length; index++) {
fn(this[index], index);
}
@marceloemanoel
marceloemanoel / montarjson.js
Created April 8, 2012 19:55 — forked from cmilfont/montarjson.js
Turma 3 - Exercicio 3 - Montar JSON
var json = {}
var name = "empresa.id";
var valor = "01/01/2011";
var gerarJSON = (function gerarJSON(json, hierarquia, value) {
var hierarquia = hierarquia.split(".");
var last = hierarquia.pop();
var temp = {};
@marceloemanoel
marceloemanoel / engine.js
Created April 8, 2012 19:55 — forked from cmilfont/engine.js
Turma 3 - Exercicio 2 - Engine de Template
var objeto = {
nome: "Christiano Milfont", telefone: "23423423", idade: 18,
paginacao: function(name) { return name; }
};
var template = "<div> #{paginacao(nome)} #{nome} \
- #{telefone} - #{ (idade >= 18)? \"permitido\": \"proibido\" }</div>";
function Engine(tmpl) {
var _pattern = /\#\{([^}]+)\}/g;
public enum Direction {
NORTH {
public Direction turnLeft(){
return WEST;
}
public Direction turnRight(){
return EAST;
}
@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"
}
}