Skip to content

Instantly share code, notes, and snippets.

View paulodiovani's full-sized avatar

Paulo Diovani Gonçalves paulodiovani

View GitHub Profile
@paulodiovani
paulodiovani / table_blank_line.css
Created February 14, 2014 18:46
Adicionando linhas em branco à tabelas
table tr.blank td,
table tr.blank td:hover {
height: 13px;
background: none !important;
border-left: none;
border-bottom: 1px solid #ddd;
outline: 1px solid white;
}
@paulodiovani
paulodiovani / shuffle.js
Created February 26, 2014 12:01
Returns a slightly reandomized version os an array.
(function() {
'use strict';
function shuffle(array) {
array.sort(function() {
return Math.floor( Math.random() * 3) -1;
});
return array;
}
import re
from base_linter import BaseLinter, INPUT_METHOD_FILE
CONFIG = {
'language': 'XML',
'executable': 'xmllintschema',
'lint_args': ['-noout', '{filename}'],
'input_method': INPUT_METHOD_FILE
}
@paulodiovani
paulodiovani / picard_files.txt
Created June 7, 2014 01:07
Regras para renomear/mover arquivos no Musicbrainz Picard
$if2(%albumartistsort%,%artistsort%)/$if(%date%,$left(%date%,4) - )%album%/$if($gt(%totaldiscs%,1),%discnumber%-,)$num(%tracknumber%,2)$if(%compilation%, %artist% -,) %title%
@paulodiovani
paulodiovani / viewport.coffee
Last active August 29, 2015 14:02 — forked from manfromanotherland/viewport-size.js
Script para exibir tamanho do viewport. Fontes em CoffeeScript, Javascript gerado e Javascript minificado (para usar num botão de atalho)
id = "viewport-size-by-edmundojr-paulodiovani"
# Cria o elemento do viewport, se ainda não existir
create = ->
div = document.getElementById(id) || document.createElement "div"
div.id = id
div.style.cssText = """
position:fixed; \
top:0; \
right:0; \
@paulodiovani
paulodiovani / TelaExemplo.java
Created June 25, 2014 04:30
Uma tela padrão para posicionamento relativo de campos, apenas para teste de exibição de componentes.
package exemplo;
import javax.swing.*;
import java.awt.*;
/**
* Created by diovani on 25/06/14.
*/
public class TelaExemplo extends JFrame {
// padrões, para controlar posição dos campos
http = require 'http'
through = require 'through'
XmlStream = require 'xml-stream'
http.get 'http://example.com/file.xml', (res) ->
res.setEncoding 'utf-8'
res.on 'error', console.error
# create a stream to clean non-ascii characters, because
# XmlStream fails to parse XMLs with some chars (pasted from MS Word, mostly)
@paulodiovani
paulodiovani / bdd_spec_test.php
Created November 19, 2014 12:26
Proposal for a new PHP Spec Test framework
<?php
/**
* This is a proposal for a new PHP test framework,
* based on the Mocha (http://mochajs.org/) dsl
*
* ## Features
*
* * Simple, easy to read
* * Non object oriented tests
* * Extensible
@paulodiovani
paulodiovani / singleton.coffee
Last active August 29, 2015 14:13
Singleton example using Require.js + BackBone.js + CoffeeScript
define 'components/singleton', [], ->
###
Singleton class
###
class Singleton extends Backbone.View
# @static
@getInstance = ->
@_instance ?= new @
@paulodiovani
paulodiovani / meme-create.sh
Created July 16, 2015 19:00
Create an internet meme from an image
#!/bin/bash
convert image-original.jpg -weight 900 -pointsize 400 -strokewidth 8 \
-draw "gravity north stroke black fill white text 0,200 'DO NOT' " \
-draw "gravity south stroke black fill white text 0,200 'PANIC' " \
image-meme.jpg