Skip to content

Instantly share code, notes, and snippets.

View jakul's full-sized avatar
🏳️‍🌈
LGBT and proud

Craig Blaszczyk jakul

🏳️‍🌈
LGBT and proud
View GitHub Profile
if settings.EMAIL_TO_ADDRESS_OVERRIDE is not None:
import pdb
pdb.set_trace()
to_addresses = list(settings.EMAIL_TO_ADDRESS_OVERRIDE)
@jakul
jakul / gist:6540426
Created September 12, 2013 16:34
error
(networklocum)root@netwoai2:/srv/networklocum/releases/current/networklocum/networklocum# tail -f /var/log/h-managepy.log
[INFO ] 2013-09-12 17:31:46,921 - Finished processing referral_received Trello handler
ListNotFoundException: "List LH_refer_a_friend doesn't exist!"
(networklocum)administrator@vagrant-craig:/src/networklocum/networklocum$ redis-cli -n 2 lpush NL:notifications "{\"announce_type\": \"updated\", \"type\": \"jobapplication\", \"id\": 1276, \"source\": \"site\"}"
(integer) 1
@jakul
jakul / gist:6621593
Last active December 23, 2015 10:29
applicant_ids = [
int(application_name_abababababababa.applicant.id)
for application_name_abababababababa in applications
]
@python_2_unicode_compatible
class RequestSite(object):
"""
A class that shares the primary interface of Site (i.e., it has
``domain`` and ``name`` attributes) but gets its data from a Django
HttpRequest object rather than from a database.
The save() and delete() methods raise NotImplementedError.
"""
def __init__(self, request):
[10.0.0.100] out: notice: /Stage[main]/Papertrail/Package[rsyslog-gnutls]/ensure: ensure changed 'purged' to 'present'
[10.0.0.100] out: info: /Stage[main]/Papertrail/Package[rsyslog-gnutls]: Scheduling refresh of Service[rsyslog]
[10.0.0.100] out: notice: /Stage[main]/Papertrail/File[remote_syslog upstart script]/ensure: defined content as '{md5}b3ccafd05ca64bd046bbce0ca7f01590'
[10.0.0.100] out: notice: /Stage[main]/Papertrail/File[remote_syslog config]/ensure: defined content as '{md5}24c0b0f2d2a3b3f3db91ba54576fd0ce'
[10.0.0.100] out: info: /Stage[main]/Papertrail/File[remote_syslog config]: Scheduling refresh of Service[remote_syslog]
[10.0.0.100] out: notice: /Stage[main]/Papertrail/File[papertrail certificate]/ensure: defined content as '{md5}cee9b8d2d503188ccecbb22b49cd3bec'
@jakul
jakul / gist:6761959
Last active December 24, 2015 07:09
PEP8 indentation
# taken from http://www.python.org/dev/peps/pep-0008/#indentation
.....
or it may be lined up under the first character of the line that starts the multi-line construct, as in:
my_list = [
1, 2, 3,
4, 5, 6,
]
update_mongodb(cur_week_key, metric,
month_value_jobs_cur_filled,
month_value_jobs_prev_filled)
update_mongodb(
cur_week_key, metric, month_value_jobs_cur_filled,
month_value_jobs_prev_filled
)
// update KISSmetrics
if (typeof(_kmq) != "undefined") {
_kmq.push(function() {
KM.record('locum_createinvoice_complete', {
'locum_id': $modal.data('userid'),
'job_id': $modal.data('jobid')
});
} );
}
[www.networklocum.com] Executing task 'manage_command'
[www.networklocum.com] sudo: cd /srv/networklocum/;source bin/activate; cd releases/16fbb0e2e140f2ea72b2ea36d39205bfdcce246a/networklocum/networklocum ; /srv/networklocum/bin/python manage.py report_on_locum_funnel
[www.networklocum.com] out: Traceback (most recent call last):
[www.networklocum.com] out: File "manage.py", line 14, in <module>
[www.networklocum.com] out: execute_manager(settings)
[www.networklocum.com] out: File "/srv/networklocum/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
[www.networklocum.com] out: utility.execute()
[www.networklocum.com] out: File "/srv/networklocum/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
[www.networklocum.com] out: self.fetch_command(subcommand).run_from_argv(self.argv)
[www.networklocum.com] out: File "/srv/networklocum/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_a