Skip to content

Instantly share code, notes, and snippets.

View andrefs's full-sized avatar

André Santos andrefs

View GitHub Profile
### Keybase proof
I hereby claim:
* I am andrefs on github.
* I am andrefs (https://keybase.io/andrefs) on keybase.
* I have a public key whose fingerprint is 9855 D11E 4674 3E1E 1F1A F85F 1E53 063F 6F27 1B13
To claim this, I am signing this object:
@andrefs
andrefs / pulitzr_columns_example.json
Created July 24, 2015 17:06
pulitzr_columns_example
[{"title":"Economico","sortTitle":"Data","query":"filter=Source.Name eq
\"Economico\"&sort=_InternalRefs.RegisterDate&limit=20","destination":"main
","id":1430395633631,"idx":0,"domElement":{"0":{"jQuery11100528639918193221
1":226,"sizzle-1434637889294":{"parentNode":[2289,18,false]}},"length":1,"p
revObject":{"0":{},"context":{},"length":1},"context":{}}},{"title":"Expres
so","sortTitle":"Data","query":"filter=Source.Name eq
\"Expresso\"&sort=_InternalRefs.RegisterDate&limit=20","destination":"main"
,"id":1430401119919,"idx":1,"domElement":{"0":{"jQuery111005593397612683475
":225,"sizzle-1433410869016":{"parentNode":[3230,18,false]}},"length":1,"pr
evObject":{"0":{},"context":{},"length":1},"context":{}}},{"title":"Renasce
@andrefs
andrefs / upload_cover.sh
Last active August 29, 2015 14:26
upload_cover.sh
#!/bin/bash
DIR=$(dirname $0)
pubID="$1"
if [ -z "$pubID" ]; then
pubID='4090'
fi
FILE="$2"
if [ -z "$FILE" ]; then
FILE='4.png'
@andrefs
andrefs / newsletter.json
Created September 14, 2015 13:28
Estrutura newsletter
{
_id: ObjectId("55a53ba2325fdeb559ae14aa"),
Date: "2015-09-14 15:45:26",
Highlights: [
{
Title: "William Carvalho lesionado, Sporting acusa federação",
Description: "O jogador do Sporting William Carvalho tem uma fratura de stress na Tíbia e vai parar de 10 a 12 semanas. O médio, que esteve ao serviço da seleção nacional no Europeu de Sub-21, vai assim falhar a Supertaça, o play-off da Liga dos Campeões e o arranque de campeonato. O Sporting está indignado com o corpo clínico da Federação Portuguesa de Futebol.",
URL: "http://sicnoticias.sapo.pt/desporto/2015-07-14-William-Carvalho-lesionado-Sporting-acusa-federacao",
ProducerName: "SIC Notícias",
Categories: [
" Configuration file for Vim
" Place in: ~/.vimrc
" André Santos
" 2009.10.18
" Turn off vi compatibility mode
set nocompatible
" Turn off message 'Thanks for flying vim'
" set notitle
@andrefs
andrefs / em_mwe.pl
Created October 3, 2012 16:31
Elastic::Model 'extends' MWE
package MyApp;
use Elastic::Model;
has_namespace 'myapp' => {
user => 'MyApp::EMUser',
};
package MyApp::User;
use Moose;
@andrefs
andrefs / emtu_mwe.pl
Created December 3, 2012 15:58
Moose type unions in Elastic::Model
package MyApp;
use Elastic::Model;
has_namespace 'myapp' => {
user => 'MyApp::User',
};
package Class1;
use Moose;
package Class2;
@andrefs
andrefs / cmv.pl
Created March 20, 2013 16:41
CPAN module version
#!/usr/bin/env perl
# Prints version for each CPAN module taken as argument
for(@ARGV){
my $sentence = 'perl -M'.$_.' -e \'print '.'"$'.$_.'::VERSION\n"'.'\'';
print "$_\t";
print qx{$sentence};
}
@andrefs
andrefs / gist:5323149
Created April 5, 2013 22:21
Screenshots directly to dropbox with public link in clipboard
#!/bin/bash
# Creates a screenshot from a region of the display,
# uploads it to Dropbox public folder and copies
# the link to the clipboard.
#
# Dependencies:
# xfce4-screenshooter
# dropbox
# x-clip
@andrefs
andrefs / .gitconfig
Created May 10, 2013 13:56
Examples of useful stuff to have in your global git config file
[user]
name = User Name # to be used in commits
email = user@email # to be used in commits
[difftool]
prompt = false
[diff]
tool = meld # use meld as 'git difftool' application
[color]
ui = true
diff = auto