Skip to content

Instantly share code, notes, and snippets.

View rvillablanca's full-sized avatar
😁

Rodrigo Villablanca rvillablanca

😁
  • Santiago, Chile
  • 01:54 (UTC -03:00)
View GitHub Profile
@rvillablanca
rvillablanca / postgres_queries_and_commands.sql
Created October 22, 2021 14:57 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), 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(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@rvillablanca
rvillablanca / The Technical Interview Cheat Sheet.md
Created July 28, 2020 00:27 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@Entity
public class Employee {
@Id long empId;
String empName;
...
}
public class DependentId {
String name; // matches name of @Id attribute
long emp; // matches name of @Id attribute and type of Employee PK