Skip to content

Instantly share code, notes, and snippets.

View gamache's full-sized avatar
🤙

pete gamache gamache

🤙
View GitHub Profile
@Dynom
Dynom / curie-example.hal.json
Last active December 14, 2015 22:39
Dealing with root-level curies in the HAL specification. This example is a modified version of the one mentioned on: http://stateless.co/hal_specification.html This example introduces a root-level _links definition with CURIE definitions. These definitions must be available in nested attributes, with the option to override a CURIE definition, wi…
{
"_links": {
"api-root:self": { "href": "orders" },
"api-root:next": { "href": "orders?page=2" },
"api-root:find": { "href": "orders{?id}", "templated": true },
"api-root:admin": [
{ "href": "admins/2", "title": "Fred" },
{ "href": "admins/5", "title": "Kate" }
],
"_curies" : [
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 23, 2024 19:14
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%'