Skip to content

Instantly share code, notes, and snippets.

View qpfiffer's full-sized avatar
🔚

Quinlan Pfiffer qpfiffer

🔚
View GitHub Profile
@qpfiffer
qpfiffer / KeychainItemWrapper.h
Created November 11, 2015 22:08 — forked from yvbeek/KeychainItemWrapper.h
KeychainItemWrapper ARCified
/*
File: KeychainItemWrapper.h
Abstract:
Objective-C wrapper for accessing a single keychain item.
Version: 1.2 - ARCified
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
#!/bin/bash
if [ -z $1 ]
then
echo "Getting all nginx configs"
RESPONSE=$(grep server_name /etc/nginx/sites-enabled/* | sed -e 's/.*server_name //' -e 's/localhost *//' -e 's/ /\n/g' -e 's/;$//' | sed -re 's_^(.*)$_<li><a href="http://\1">\1</a></li>_')
else
echo $1
RESPONSE=$(grep server_name /etc/nginx/sites-enabled/$1 | sed -e 's/.*server_name //' -e 's/localhost *//' -e 's/ /\n/g' -e 's/;$//' | sed -re 's_^(.*)$_<li><a href="http://\1">\1</a></li>_')
fi
@qpfiffer
qpfiffer / models.py
Last active December 20, 2015 10:39 — forked from shofetim/models.py
def react_to_purchasing_status(self):
if self.purchasing_status >= PURCHASE_STATUS_SUBMITTED and self.submitted_at is None:
self.submitted_at = datetime.now()
for line in self.purchaseline_set.filter(unit_cost=None):
line.unit_cost = line.promotional_cost_at_submit_time
line.save()
else:
self.submitted_at = None
# Then the rest