Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan Sick jonathansick

View GitHub Profile
@jonathansick
jonathansick / mockregistry.py
Created Aug 15, 2019
Using the MockRegistryApi
View mockregistry.py
# 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
jonathansick / newtopics.py
Last active Aug 15, 2019
Creating Kafka topics
View newtopics.py
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
jonathansick / query.graphql
Last active Sep 22, 2020
GitHub GraphQL repo commit history query
View query.graphql
{
repository(name: "sickvim", owner: "jonathansick") {
ref(qualifiedName: "master") {
target {
... on Commit {
id
history(first: 5) {
pageInfo {
hasNextPage
}
@jonathansick
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
jonathansick / archive_of_astro_comm.md
Last active Aug 29, 2015
A proposed workflow for the Archive of Informal Astronomy Communications
View archive_of_astro_comm.md
  • 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
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.
View keybase.md

Keybase proof

I hereby claim:

  • I am jonathansick on github.
  • I am jsick (https://keybase.io/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
jonathansick / pix_scale.py
Created Jun 3, 2014
Flexible pixel scale
View pix_scale.py
if 'CDELT' in header:
pix_scale header['CDELT'] * 3600.
else:
pix_scale = np.sqrt(header['CD1_1'] ** 2. + header['CD1_2'] ** 2.) * 3600.
@jonathansick
jonathansick / pypi_checklist.md
Last active Aug 29, 2015
A checklist for uploading to PyPI, because I always forget.
View pypi_checklist.md

First time:

python setup.py register

Uploading a new version:

python setup.py check
@jonathansick
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
You can’t perform that action at this time.