Skip to content

Instantly share code, notes, and snippets.

Avatar

Philipp Bosch philippbosch

View GitHub Profile
@philippbosch
philippbosch / Dockerfile
Last active Jul 21, 2019
Django Dockerfile
View Dockerfile
FROM python:3.7
ENV PYTHONUNBUFFERED 1
ENV WERKZEUG_DEBUG_PIN off
ENV DJANGO_SETTINGS_MODULE myproject.settings.dev
RUN apt-get update && \
apt-get install -y gettext postgresql-client libpq-dev \
--no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN mkdir /code
COPY requirements.txt requirements-dev.txt /code/
RUN pip install -r /code/requirements-dev.txt
View pr_review_requests.1m.sh
#!/bin/bash
export PATH=$PATH:/usr/local/bin
COUNT=$(curl -s -H 'Authorization: bearer <TOKEN>' -X POST -d '{"query": "{search(query: \"is:pr is:open archived:false sort:updated-desc review-requested:philippbosch\", type: ISSUE, first: 10){issueCount}}"}' https://api.github.com/graphql | jq .data.search.issueCount)
if [ "$COUNT" -ne "0" ] ; then
echo "$COUNT ⎇|color=#ff9900 size=12 href=https://github.com/pulls?q=is%3Apr+is%3Aopen+archived%3Afalse+sort%3Aupdated-desc+review-requested%3Aphilippbosch"
fi
View keybase.md

Keybase proof

I hereby claim:

  • I am philippbosch on github.
  • I am philippbosch (https://keybase.io/philippbosch) on keybase.
  • I have a public key whose fingerprint is 9BCE E011 6753 E7FD 928D F104 30C4 4A80 A8D2 4676

To claim this, I am signing this object:

@philippbosch
philippbosch / git-blast
Created Nov 30, 2016 — forked from wolever/git-blast
git-blast: show git branches sorted by last commit date
View git-blast
#!/usr/bin/env python
"""
Shows git branches sorted by last commit date, noting when branch has been
merged:
$ git blast
* master 33 minutes ago
david 4 days ago [M]
unholy-david-payments 4 days ago
handsontable-2 5 days ago
View lektor-admin-style-overrides.css
:root {
--ultra-light-gray: #eee;
--light-gray: #ccc;
--dark-gray: #444;
--gray: #999;
--black: #000;
--accent-1: #0098f8;
--accent-2: #00b4a6;
}
@philippbosch
philippbosch / app.py
Last active Jul 19, 2016
Chalice MP3 duration app
View app.py
from io import BytesIO
from urllib2 import urlopen
from chalice import Chalice, BadRequestError
from mutagen.mp3 import MP3
app = Chalice(app_name='mp3info')
@app.route('/')
@philippbosch
philippbosch / app.py
Last active Jul 19, 2016
Chalice Hello World
View app.py
from chalice import Chalice
app = Chalice(app_name='mp3duration')
@app.route('/')
def index():
return {'hello': 'world'}
View .htaccess
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change http://example.com (at the end of the last RewriteRule) to your website url
<IfModule mod_headers.c>
#RequestHeader set X-Prerender-Token "YOUR_TOKEN"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
@philippbosch
philippbosch / randomstring.py
Created Dec 16, 2014
Create random string in Python
View randomstring.py
import random
import string
length=10
code = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(length))
View keybase.md

Keybase proof

I hereby claim:

  • I am philippbosch on github.
  • I am philippbosch (https://keybase.io/philippbosch) on keybase.
  • I have a public key whose fingerprint is 0767 102D 8645 0F7D EA0B D4FA C8DB A35E 90B0 0103

To claim this, I am signing this object: