Skip to content

Instantly share code, notes, and snippets.


Jonathan Sick jonathansick

View GitHub Profile
jonathansick /
Created Aug 15, 2019
Using the MockRegistryApi
# In unit tests =====================================
from kafkit.registry.sansio import MockRegistryApi
# The Avro schema that you'll be testing with
schema = {}
# The MockRegistryApi works just like the RegistryApi, but doesn't
# do any network requests.
registryclient = MockRegistryApi()
jonathansick /
Last active Aug 15, 2019
Creating Kafka topics
from confluent_kafka.admin import AdminClient, NewTopic
default_num_partitions = 1
default_replication_factor = 3
client = AdminClient({
'bootstrap.servers': 'url...'
# First list existing topics
jonathansick / query.graphql
Last active Aug 5, 2021
GitHub GraphQL repo commit history query
View query.graphql
repository(name: "sickvim", owner: "jonathansick") {
ref(qualifiedName: "master") {
target {
... on Commit {
history(first: 5) {
pageInfo {
jonathansick / Cubehelix Demo.ipynb
Created Apr 27, 2015
Palettable Cubehelix Demo
View Cubehelix Demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
jonathansick /
Last active Aug 29, 2015
A proposed workflow for the Archive of Informal Astronomy Communications
  • There is an "Archive of Informal Astronomy Communications" (name TBD);
    • The Archive has an editor and board that is backed by astro libraries and the AAS or similar organizations,
    • The Archive is fundamentally a Zenodo curated community,
    • ADS agrees to index the resources of this Zenodo community,
    • Astronomy blogs apply for affiliation with the Archive as authors (or use an arXiv-like endorsement model).
  • The blogger posts an article as usual.
  • Only if the blogger deems the post to be relevant to scholarly astronomy discourse do they intentionally submit their article to the Zenodo community (i.e., submission is not automatic so that a grad student who normally blogs astronomy research doesn't get that one blog post about a Taylor Swift concert indexed by ADS). This also implies that articles can be retroactively submitted.
    • The submission consists of the post's content. There is no prescribed format, but it should be easily and openly readable, e.g., plaintext/markdown and images or an ipy
jonathansick / multipix_daft.ipynb
Last active Aug 29, 2015
Probabilistic Graphical Model of Multi-Pixel SEDs drawn in Daft
View multipix_daft.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am jonathansick on github.
  • I am jsick ( on keybase.
  • I have a public key whose fingerprint is 2175 1D47 7F2A 78C3 D6AF A6E9 F210 C97A 0D74 0AA6

To claim this, I am signing this object:

jonathansick /
Created Jun 3, 2014
Flexible pixel scale
if 'CDELT' in header:
pix_scale header['CDELT'] * 3600.
pix_scale = np.sqrt(header['CD1_1'] ** 2. + header['CD1_2'] ** 2.) * 3600.
jonathansick /
Last active Aug 29, 2015
A checklist for uploading to PyPI, because I always forget.

First time:

python register

Uploading a new version:

python check
jonathansick / jsick_postgresql.conf
Created May 15, 2014
postgresql.conf Postgres Config File Customizations
View jsick_postgresql.conf
# It's convenient to put all postgresql.conf customizations in a included file.
# From bottom postgresql.conf, include as
# include = 'path/to/jsick_postgresql.conf'
# NOTE: you may need to customize some of these columns.
# Note: Increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction).
max_connections = 100 # (change requires restart)
# Logging