Skip to content

Instantly share code, notes, and snippets.

View rmariano's full-sized avatar
😀
Technically fearless; Exemplary practitioner.

Mariano Anaya rmariano

😀
Technically fearless; Exemplary practitioner.
View GitHub Profile
@rmariano
rmariano / main.go
Created March 22, 2017 08:42 — forked from divan/main.go
Golang database/sql+http example (postgres)
// Run PostgreSQL server:
// docker run -e POSTGRES_PASSWORD="" -p 5432:5432 postgres
// Monitor running processes:
// watch -n 1 'echo "select pid,query_start,state,query from pg_stat_activity;" | psql -h localhost -U postgres
//
// For all handlers, call to db takes 5 seconds,
//
// Three endpoints:
// - "/" - take 5 seconds
// - "/ctx" - take 1 seconds, due to 1 second cancellation policy
@rmariano
rmariano / declarative programming repo problem.cs
Last active December 29, 2016 00:08 — forked from lifebeyondfife/declarative programming repo problem.cs
Declarative Programming Repo Problem. Problem available in C#, JavaScript and Python.
/*
Code below can be run directly into LINQPad - https://www.linqpad.net/
Return the owner and repo name of the most starred project with more than 100 contributors, for each language
The declarative implementation can be solved using the Select, Where, Aggregate and GroupBy LINQ extension methods
*/
void Main()
{
var repos = new List<Repo> {