Skip to content

Instantly share code, notes, and snippets.

View alegomes's full-sized avatar

Alexandre Gomes alegomes

View GitHub Profile
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:admin="http://webns.net/mvcb/">
<foaf:PersonalProfileDocument rdf:about="">
<foaf:maker rdf:resource="#me"/>
<foaf:primaryTopic rdf:resource="#me"/>
<admin:generatorAgent rdf:resource="http://www.ldodds.com/foaf/foaf-a-matic"/>
<admin:errorReportsTo rdf:resource="mailto:leigh@ldodds.com"/>
MacBook Pro 17-inch (MA611LL/A):
Display: 17-inch (diagonal), 1680 x 1050 resolution, TFT widescreen
Processor: 2.33GHz Intel Core 2 Duo
L2 Chache: 4MB
Memory: 3 GB 667 MHz DDR2 SDRAM
PCI Express graphics: ATI Mobility Radeon X1600 with 256MB of GDDR3 SDRAM and
dual-link DVI
Hard Disk Drive: 160GB Serial ATA; 5400 rpm
Slot-loading optical drive: 8x SuperDrive (DVD+R DL/DVD±RW/CD-RW)
@alegomes
alegomes / dotproject_task_log_audit.sql
Created July 18, 2011 23:33
Auditing dotProject (2.1-rc2) task_log records
-- MySQL 5.0
alter table task_log add column task_log_created datetime default '1900-01-01 00:00:00';
delimiter //
CREATE TRIGGER task_log_created_trigger BEFORE INSERT ON task_log
FOR EACH ROW
BEGIN
IF NEW.task_log_created = "1900-01-01 00:00:00" THEN
@alegomes
alegomes / mapping
Created May 17, 2012 19:19
World Cup 2014 Data Search
$ curl http://thedatahub.org/api/data/4e256209-7e2d-4481-9627-da73e191baf2/_mapping?pretty=true
{
"4e256209-7e2d-4481-9627-da73e191baf2" : {
"properties" : {
"Previsao-de-Inicio" : {
"type" : "string"
},
"Identificador" : {
"type" : "string"
},
#upgrade.processes=\
# com.liferay.portal.upgrade.UpgradeProcess_5_2_8_to_6_0_5,\
# com/liferay/portal/upgrade/UpgradeProcess_6_0_6,\
# com/liferay/portal/upgrade/UpgradeProcess_6_0_11,\
# com.liferay.portal.upgrade.UpgradeProcess_6_0_12
@alegomes
alegomes / avenidas
Created May 22, 2012 18:46
Mapa de Brasília
W4
W3
W2
W1
S3 S2 S1 N1 N2 N3
L1
L2
L3
L4
@alegomes
alegomes / iconv
Created May 27, 2012 00:28
Converting unknown charset file to UTF-8
I had a dataset but it was not UTF-8. So, I had to find out which charset was being used. 'file' command didn't helped me out.
$ file file_name.csv
file_name.csv: Non-ISO extended-ASCII C++ program text, with very long lines, with CRLF line terminators
So, I made this bash script to figure out its encoding:
First, I converted the file to every single format available by 'iconv':
$ for f in $(iconv -l); do echo "Convertendo $f ..."; iconv -f $f -t UTF-8 < file_name.csv > fil_name.$f.csv; done
@alegomes
alegomes / tdc2012sp-opendata
Created June 21, 2012 22:06
Evento sobre Dados Abertos, São Paulo, 06 e 07/07
Caríssimos,
O grupo Transparência Hacker DF, o Ministério do Planejamento e o W3C gostaria de convidar você e toda sua
equipe a participar da trilha de Dados Abertos, parte da The Developers Conference - TDC, em São Paulo,
nos dias 06 e 07 de julho.
http://www.thedevelopersconference.com.br/tdc/2012/saopaulo/trilha-dados-abertos#programacao
O TDC é um evento de eventos. Começou há alguns anos, em São Paulo, com uma temática muito específica e,
com o passar do tempo, espalhou-se para outras cidades e abraçou mais de 30 outros assuntos diferentes
#####################################################################################################
# Quais os textos mais retweetados?
#
mysql> select text,count(text) from retweets group by text order by count(text) desc limit 10;
+---------------------------------------------------------------------------------------------------------------------------------------------------+-------------+
| text | count(text) |
+---------------------------------------------------------------------------------------------------------------------------------------------------+-------------+
| RT @camila_vallejo: Hoy a las 21 horas cacerolazo en todo Chile en repudio a la represión contra los estudiantes...DIFUNDIR! | 1844 |
| RT @camila_vallejo: No sólo ganó Chávez, ganó el proyecto bolivariano x una América Latina Libre y Soberana. Viva Venezuela!! su pu
Verifying that "alegomes.id" is my Blockstack ID. https://onename.com/alegomes