Skip to content

Instantly share code, notes, and snippets.

View lalitkapoor's full-sized avatar

Lalit Kapoor lalitkapoor

View GitHub Profile
@lalitkapoor
lalitkapoor / recreate.sql
Last active February 18, 2023 03:23
TimescaleDB hierarchical continuous aggregate performance drop by ~20x for large datasets
DROP MATERIALIZED VIEW IF EXISTS hca_daily;
DROP MATERIALIZED VIEW IF EXISTS hca_hourly;
DROP MATERIALIZED VIEW IF EXISTS hca_minutely;
DROP TABLE IF EXISTS hca_test_events;
CREATE TABLE hca_test_events (
customer_id TEXT NOT NULL,
ts timestamptz NOT NULL,
measures JSONB
);
@lalitkapoor
lalitkapoor / doggy.sql
Created May 23, 2019 19:57
dog gif SQL
This file has been truncated, but you can view the full file.
SELECT decode(
"AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAs7bW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAQ1IAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAACmV0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAQ1IAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAqwAAANWAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAENSAAAAAAABAAAAAAndbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAA8AAAECgBVxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAAJiG1pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAACUhzdGJsAAAAlHN0c2QAAAAAAAAAAQAAAIRhdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAqwDVgBIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALmF2Y0MBQsAf/+EAF2dCwB/bArBt7mhAAAADAEAAAA8Dxgy4AQAEaMqD8gAAABhzdHRzAAAAAAAAAAEAAAIFAAACAAAAABxzdHNzAAAAAAAAAAMAAAABAAAAqgAAAaQAAAA0c3RzYwAAAAAAAAADAAAAAQAAALUAAAABAAAAAgAAATsAAAABAAAAAwAAABUAAAABAAAIKHN0c3oAAAAAAAAAAAAAAgUAAHH/AAAW5gAAG9cAAAKEAAAnEQAAAxUAAB/4AAAkwAAAAzYAABDfAA
# global settings
[global]
newrelic_license_key=YOUR_LICENSE_KEY_HERE
poll_interval=60
# logging settings
[loggers]
keys=root
@lalitkapoor
lalitkapoor / CHANGELOG.md
Created April 18, 2016 13:35
request changelog.md

Change Log

v2.72.0 (2016/04/17)

  • #2176 Do not try to pipe Gzip responses with no body (@simov)
  • #2175 Add 'delete' alias for the 'del' API method (@simov, @MuhanZou)
  • #2172 Add support for deflate content encoding (@czardoz)
  • #2169 Add callback option (@simov)
  • #2165 Check for self.req existence inside the write method (@simov)
  • #2167 Fix TravisCI badge reference master branch (@a0viedo)
@lalitkapoor
lalitkapoor / angular-xeditable.js
Created February 29, 2016 05:52
angular-xeditable without using form tags
/*!
angular-xeditable - 0.1.9
Edit-in-place for angular.js
Build date: 2015-03-26
*/
/**
* Angular-xeditable module
*
*/
angular.module('xeditable', [])
@lalitkapoor
lalitkapoor / gist:9225721
Created February 26, 2014 08:23
git log graph
* 8995d17 - Merge branch 'f'
|\
| * 4c849d8 - (f) Merge branch 'd' into f
| |\
| | * cd74de4 - (d) d3
| | * ecf6caf - d2
| | * b48beec - d1
* | | dce8c66 - h1
* | | dbd467a - g1
|/ /
@lalitkapoor
lalitkapoor / getPublicSuffix.js
Created January 31, 2014 21:49
getPublicSuffix
function getPublicSuffix(domain) {
/*
* Copyright GoInstant, Inc. and other contributors. All rights reserved.
* 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:
*
cat: meow
dog: bark
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin