Skip to content

Instantly share code, notes, and snippets.

Avatar
📉
ᕕ( ᐛ )ᕗ I am davloper

Quinlan Pfiffer qpfiffer

📉
ᕕ( ᐛ )ᕗ I am davloper
View GitHub Profile
View 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
@qpfiffer
qpfiffer / KeychainItemWrapper.h
Created Nov 11, 2015 — forked from yvbeek/KeychainItemWrapper.h
KeychainItemWrapper ARCified
View KeychainItemWrapper.h
/*
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
View meta.sh
#!/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
You can’t perform that action at this time.