Skip to content

Instantly share code, notes, and snippets.

View saevarom's full-sized avatar

Sævar Öfjörð Magnússon saevarom

View GitHub Profile
@saevarom
saevarom / LICENSE
Created August 29, 2013 19:12 — forked from dfm/LICENSE
Copyright (c) 2012–2013 Daniel Foreman-Mackey
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
-- Index hit rate
WITH idx_hit_rate as (
SELECT
relname as table_name,
n_live_tup,
round(100.0 * idx_scan / (seq_scan + idx_scan),2) as idx_hit_rate
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC
),
@saevarom
saevarom / Constructor.js
Last active October 7, 2015 14:13 — forked from Integralist/Constructor.js
Private and Privileged methods using the Constructor pattern in JavaScript
function Constructor(){
this.foo = 'foo';
// Needed for Private methods
var self = this;
// Private methods need to be placed inside the Constructor.
// Doesn't perform as well as prototype methods (as not shared across instances)
function private(){
console.log('I am private');
@saevarom
saevarom / .block
Last active May 2, 2019 10:52 — forked from mbostock/.block
Exercise calendar
license: gpl-3.0
height: 435
border: no