View Gems.md
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
View feriados.rb
require 'date'
feriados = [
Date.new(2016,1,1),
Date.new(2016,2,8),
Date.new(2016,2,9),
Date.new(2016,3,24),
Date.new(2016,3,25),
Date.new(2016,4,2),
Date.new(2016,5,1),
View tbd.source
## TBD - Too Busy Disorder
Charla preparada para el encuentro de #CulturaFreelance, a presentar en laOfi el 5 de Octubre de 2015.
Evento especial para la #SemanaDelCoworking
## Créditos fotográficos
Lloyd Morgan. Despair.
http://www.flickr.com/photos/lloydm/2305701220
View EjercicioOIA.java
package edu.unlam.pa;
import java.io.File;
public abstract class EjercicioOIA {
protected File entrada;
protected File salida;
public EjercicioOIA(File entrada, File salida) {
View decrypt_visa.sh
#!/bin/bash
INPUT=`ls -lt | grep pdf | head -n 1 | awk '{print $9}'`
OUTPUT=VISA-`date +"%Y%m%d"`.pdf
echo $INPUT
echo $OUTPUT
qpdf --password=$1 --decrypt `pwd`/$INPUT $OUTPUT
mv $OUTPUT $HOME/Dropbox
rm $INPUT
View AETests.java
import org.junit.Assert;
import org.junit.Test;
public class AETests {
@Test
public void queCalcula() {
MuestraDePersonas m = new MuestraDePersonas(2);
m.agregarPersona(new Persona(100, 123));
m.agregarPersona(new Persona(110, 125));
View Luchador.java
public class Luchador {
private int peso;
private int altura;
public Luchador(int peso, int altura) {
this.peso = peso;
this.altura = altura;
}
View ArreglosTests.java
import org.junit.Assert;
import org.junit.Test;
public class ArreglosTests {
@Test
public void quePuedoCrearloExplicitamente(){
int[] edades = {22, 29, 27, 25, 21, 23, 25, 27};