Skip to content

Instantly share code, notes, and snippets.

View philippbosch's full-sized avatar

Philipp Bosch philippbosch

View GitHub Profile
@philippbosch
philippbosch / Dockerfile
Last active July 21, 2019 20:14
Django 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
#!/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

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 November 30, 2016 14:24 — forked from wolever/git-blast
git-blast: show git branches sorted by last commit date
#!/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
: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 July 19, 2016 10:10
Chalice MP3 duration app
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 July 19, 2016 08:54
Chalice Hello World
from chalice import Chalice
app = Chalice(app_name='mp3duration')
@app.route('/')
def index():
return {'hello': 'world'}
@philippbosch
philippbosch / .htaccess
Last active August 29, 2015 14:20 — forked from thoop/.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 December 16, 2014 11:40
Create random string in Python
import random
import string
length=10
code = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(length))

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: