Skip to content

Instantly share code, notes, and snippets.

View elkevincorrea's full-sized avatar
🇨🇴

Kevin Joan elkevincorrea

🇨🇴
View GitHub Profile
@balazs-endresz
balazs-endresz / gist:f9b27514046506a7db75
Created December 2, 2014 09:34
Drop all tables and sequences in postgres
# tables for owned by 'tableowner'
select 'drop table if exists "' || tablename || '" cascade;' from pg_tables where tableowner='tableowner';
# all sequences
select 'drop sequence if exists "' || relname || '" cascade;' from pg_class where relkind = 'S';
@mjpitz
mjpitz / GetterSetterVerifier.java
Last active March 7, 2023 17:32
A class that uses reflection to automate the testing of getters and setters.
import com.google.common.base.Defaults;
import com.google.common.collect.Sets;
import javax.annotation.Nonnull;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Set;