Skip to content

Instantly share code, notes, and snippets.

View JBKahn's full-sized avatar

Joseph Kahn JBKahn

View GitHub Profile
@JBKahn
JBKahn / pyproject.toml
Created January 9, 2020 13:42
Poetry flower issue
[tool.poetry]
name = "demo"
version = "0.1.0"
description = ""
authors = ["Joseph Kahn <email@email.com>"]
[tool.poetry.dependencies]
flower = "==0.9.3"
[build-system]
@JBKahn
JBKahn / pyproject.toml
Created November 11, 2019 18:23
Poetry bug
[tool.poetry]
name = "testing-poetry"
version = "0.1.0"
description = ""
authors = ["Nick Presta <nick@waveapps.com>"]
[[tool.poetry.source]]
name = "private_pypi"
url = "our_custom_url"
@JBKahn
JBKahn / denmark.py
Last active September 11, 2017 00:27
Piprot for use with another index url
import argparse
import pip
from piptools.repositories.pypi import PyPIRepository
from piptools.resolver import Resolver
from piptools.scripts.compile import get_pip_command
def print_rotten_packages(file_path, extra_index_url):
pip_command = get_pip_command()
@JBKahn
JBKahn / update_returning.py
Created September 11, 2016 03:04 — forked from markgajdosik/update_returning.py
Update-returning support for Django 1.8. Based on: https://github.com/kanu/django-update-returning
"""
Implements manager with "UPDATE .. RETURNING" clause support. Columns following
the "RETURNING" clause may be provided using `values_list()` method. If not
specified, the update statement will yield full records.
Queries executed with use of `UpdateReturningManager` or
`UpdateReturningDefaultManager` return a generator allowing easy iterating over
the returned entries.
Based on https://github.com/kanu/django-update-returning, with modifications to
@JBKahn
JBKahn / keybase.md
Created October 9, 2014 20:05
keybase.md

Keybase proof

I hereby claim:

  • I am jbkahn on github.
  • I am jbkahn (https://keybase.io/jbkahn) on keybase.
  • I have a public key whose fingerprint is EF77 BC2B FF39 F57E 29B6 DF01 0785 C747 C46E A77C

To claim this, I am signing this object:

@JBKahn
JBKahn / gconf
Created August 5, 2014 05:18
sample of module
#!/usr/bin/python
import json
import re
import subprocess
from subprocess import call
from ansible.module_utils.basic import *
def _escape_single_quotes(string):
@JBKahn
JBKahn / install_vagrant_sudoers.sh
Created July 28, 2014 13:52
Add Vagrant NFS mount to sudoers file
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# slightly modified version of https://gist.github.com/GUI/2864683
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
@JBKahn
JBKahn / Output.txt
Created July 28, 2014 04:22
Ansible Output
joseph@Batcave-Ubuntu:~/dev/provisioning-local$ sudo rm -fr ../../setup/base16-gnome/
[sudo] password for joseph:
joseph@Batcave-Ubuntu:~/dev/provisioning-local$ ansible-playbook setup.yml -i HOSTS --ask-sudo-pass
sudo password:
PLAY [a playbook to setup my local machine with my basic customizations] ******
GATHERING FACTS ***************************************************************
ok: [127.0.0.1]
@JBKahn
JBKahn / File Structure
Last active August 29, 2015 14:04
Ansible Post
setup.yml # master playbook
HOSTS # HOSTS file which defines where the script will run. This points to localhost.
requirements.txt # the requierments for running this playbook, including ansible
run.sh # one command script for install requirements, cloning the repo and provisioning.
roles/
common/ # this hierarchy represents a "role"
tasks/ #
*.yml # <-- tasks files i'll talk about later
files/ #
@JBKahn
JBKahn / movie_recs.md
Last active August 29, 2015 14:03
Movie Reccomendations
Seen Not yet seen
A Bronx Tale 30 for 30: The Two Escobars
Adaptation All Joel Coen movies
Apocolypto Barbarian at the Gate
Batman The Animated Series Blankman
Being John Malkovich Boys in the Hood?
Conspiracy Theory BUSHWHACKED?!??!
Dazed and Confused Clerks II
Demolition Man Cocaine Cowboys