Skip to content

Instantly share code, notes, and snippets.

View jasonmp85's full-sized avatar
📚
Learning

Jason Petersen jasonmp85

📚
Learning
View GitHub Profile
CREATE TABLE dist (id integer);
CREATE TABLE ref (id integer);
SELECT create_distributed_table('dist', 'id');
SELECT create_reference_table('ref');
CREATE FUNCTION dist_func()
RETURNS void LANGUAGE plpgsql AS $$
BEGIN
EXECUTE 'SELECT id, $1 FROM dist' USING 1;
@jasonmp85
jasonmp85 / demo.cpp
Last active September 20, 2017 22:56
include-what-you-use 0.8 Repro Case
#include "demo.hpp"
int main(void)
{ printf("hello world"); }
@jasonmp85
jasonmp85 / release-checklist.md
Last active March 22, 2024 14:53
Release Checklist

These instructions assume you have $VERSION, $PROJECT, and $REPO environment variables set in your shell (e.g. 6.1.1, citus, and citus). With those set, code from most steps can be copy-pasted.

After this checklist, you're still not done: open a release checklist in Enterprise and release there, too!

Prepare Project

  • Ensure all needed changes are in the relevant release-x.y branch. git log --cherry-pick --no-merges release-x.y...master can be helpful. Be sure to cherry-pick changes in the same order they were merged to the main branch (but do not cherry-pick merge commits themselves)
  • Add a CHANGELOG entry in the master branch summarizing meaningful changes
  • Use git cherry-pick to add the new CHANGELOG entry to the release-x.y branch
  • Use git tag -a -s v$VERSION to create an annotated, signed tag for the release. Summarize the release in the one-line tag annotation (beneath 52 characters). Push the tag with git push origin v$VERSION
@jasonmp85
jasonmp85 / update-docker-docs
Last active December 14, 2022 11:43 — forked from ninrod/man-docker.sh
Install Docker man pages for your Docker version
#!/bin/bash
# make bash behave
set -euo pipefail
IFS=$'\n\t'
# adapted from: http://stackoverflow.com/a/32239112
# create tmpdir and register cleanup callback
tmpdir=$(mktemp -d ~/.docker-man.XXXXXXXX)
@jasonmp85
jasonmp85 / call_sorter.rb
Last active August 29, 2015 14:14
Organizing C
#!/usr/bin/env ruby
require 'tsort'
require 'awesome_print'
# Quick-and-dirty wrapper around cflow to sort functions in a file
func_refs = {}
func_lvls = {}
cflow_cmd = %w[cflow -i_ -l --format=posix
--level-indent=1
@jasonmp85
jasonmp85 / chpg.rb
Last active March 15, 2019 23:17
chruby for PostgreSQL
require "formula"
class Chpg < Formula
desc "PostgreSQL environment tool"
homepage "https://gist.github.com/jasonmp85/218f3bba809ec086343a"
url "https://gist.githubusercontent.com/jasonmp85/218f3bba809ec086343a/raw/db7e002ba593512b3a9ae27eb52762d104dae416/chpg.sh"
sha256 "4a3d5165364e3f8289613dfe37d8e2a7615116b8a09c6a940c3207fe30e30d76"
version "0.1.1"
depends_on "petere/postgresql/postgresql-common"
@jasonmp85
jasonmp85 / keybase.md
Created August 21, 2014 00:36
keybase.md

Keybase proof

I hereby claim:

  • I am jasonmp85 on github.
  • I am jasonmp85 (https://keybase.io/jasonmp85) on keybase.
  • I have a public key whose fingerprint is 1577 6413 8A99 5721 48D7 7316 9286 A83A 9387 E546

To claim this, I am signing this object:

@jasonmp85
jasonmp85 / citus_travis_test.sh
Last active December 24, 2015 17:56
PostgreSQL Travis Tools
#!/bin/bash
set -eux
status=0
# Create Ubuntu's PostgreSQL socket dir and relax permissions.
sudo mkdir -p /var/run/postgresql
sudo chown -R `whoami` /var/run/postgresql
#!/bin/sh
# script to add apt.postgresql.org to sources.list
# from command like
CODENAME="$1"
# lsb_release is the best interface, but not always available
if [ -z "$CODENAME" ]; then
CODENAME=$(lsb_release -cs 2>/dev/null)
fi
#!/bin/bash
set -eux
sudo apt-get update
packages="postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-common"
# bug: http://www.postgresql.org/message-id/20130508192711.GA9243@msgid.df7cb.de
sudo update-alternatives --remove-all postmaster.1.gz