Skip to content

Instantly share code, notes, and snippets.

View luizstacio's full-sized avatar

Luiz Estácio | stacio.eth luizstacio

View GitHub Profile
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 27, 2024 16:50
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%'
@vitorbritto
vitorbritto / bash_functions
Created February 11, 2014 00:07
dotfiles - bash functions
#!/bin/bash
#
# General
# ---------------------------------------------------
# Create a data URI from a file
datauri() {
local mimeType=""
@vitorbritto
vitorbritto / bash_alias
Last active August 30, 2023 09:03
dotfiles - bash alias
#!/bin/bash
# ------------------------------------------------------------------------------
# | System |
# ------------------------------------------------------------------------------
# Navigation
# -------------------
@icchan
icchan / geospatial-querying-with-go-and-mongodb.go
Created October 18, 2014 07:37
Geospatial Querying with GoLang and MongoDB
package main
import (
"encoding/json"
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"log"
)
@mpneuried
mpneuried / Makefile
Last active July 7, 2024 14:30
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)