Skip to content

Instantly share code, notes, and snippets.

@mmattozzi
mmattozzi / commit-count-sample.txt
Last active July 7, 2018 01:48
commit-count-sample
date,value
2018-07-06,0
2018-07-05,0
2018-07-04,0
2018-07-03,2
2018-07-02,4
2018-07-01,1
2018-06-30,0
2018-06-29,0
2018-06-28,3
Country Name Region 2016
Aruba Latin America & Caribbean
Afghanistan South Asia 19469022207.64
Angola Sub-Saharan Africa 95335111741.20
Albania Europe & Central Asia 11863865978.09
Andorra Europe & Central Asia 2858517699.12
United Arab Emirates Middle East & North Africa 348743265704.56
Argentina Latin America & Caribbean 545476103427.25
Armenia Europe & Central Asia 10572298341.56
American Samoa East Asia & Pacific 658000000.00
@mmattozzi
mmattozzi / .block
Created May 15, 2018 03:19 — forked from d3noob/.block
Dual axes in v4
license: gpl-3.0
@mmattozzi
mmattozzi / package.json
Created May 9, 2017 00:28
HTTP echo server using node.js and express
{
"name": "mock-http-server",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
@mmattozzi
mmattozzi / delete_all.sql
Created April 14, 2015 00:09
Delete all objects in an Oracle Schema
BEGIN
FOR cur_rec IN (SELECT object_name, object_type
FROM all_objects
WHERE object_type IN ('TABLE', 'VIEW', 'PACKAGE', 'PROCEDURE', 'FUNCTION', 'SEQUENCE') AND
owner = '<schema_name>')
LOOP
BEGIN
IF cur_rec.object_type = 'TABLE' THEN
EXECUTE IMMEDIATE 'DROP ' || cur_rec.object_type || ' "' || cur_rec.object_name || '" CASCADE CONSTRAINTS';
ELSE
@mmattozzi
mmattozzi / gist:9127537
Created February 21, 2014 02:14
Find longest java class name
Search one project:
find . | grep -v Test | perl -nl -e 'if ($_ =~ /\/((\w+)\.java)/) { print length($2) . " $1"; }' | sort -nr | head -20
Search many projects and include project name in list:
find . -name '*.java' | grep -v Test | perl -nl -e 'if ($_ =~ /^\.\/(\w+)\/.*\/((\w+)\.java)$/) { print length($3) . " $2 - $1"; }' | sort -nr | grep -v mice | head -20
@mmattozzi
mmattozzi / README.md
Last active May 8, 2016 23:55 — forked from mbostock/.block
Bubble Chart

Bubble charts encode data in the area of circles. Although less perceptually-accurate than bar charts, they can pack hundreds of values into a small space. Implementation based on work by Jeff Heer. Data shows the Flare class hierarchy, also courtesy Jeff Heer.

SELECT
sum(heap_blks_read) as heap_read,
sum(heap_blks_hit) as heap_hit,
sum(heap_blks_hit) / (sum(heap_blks_hit) + sum(heap_blks_read)) as ratio
FROM
pg_statio_user_tables;
@mmattozzi
mmattozzi / List postgres indexes and sizes
Last active December 15, 2015 12:09 — forked from next2you/Postgres Index Usage.sql
Displaying indexes in a postgres db
SELECT idx.relname as table,
idx.indexrelname as index,
pg_relation_size( idx.indexrelname::text ) as bytes,
cls.relpages as pages,
cls.reltuples as tuples,
idx.idx_scan as scanned,
idx.idx_tup_read as read,
idx.idx_tup_fetch as fetched
FROM pg_stat_user_indexes idx,
pg_class cls ,
(function() {
if (document.URL.match(/beermenus\.com\/places/)) {
var trs = document.getElementsByTagName("tr");
var minPpoz = null;
for (var i = 0; i < trs.length; i++) {
var tds = trs[i].children;
var name = null;
var serving = null;
var abv = null;
var price = null;