Skip to content

Instantly share code, notes, and snippets.

View alsoicode's full-sized avatar

Brandon Taylor alsoicode

  • Labcorp
  • Jacksonville, Florida
View GitHub Profile
@alsoicode
alsoicode / gist:a55cc0e835401846486c
Created February 16, 2015 23:17
RuntimeError: populate() isn't reentrant
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/btaylor/python-virtualenvs/cassie_cropping/lib/python3.4/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/home/btaylor/python-virtualenvs/cassie_cropping/lib/python3.4/site-packages/django/core/management/__init__.py", line 354, in execute
django.setup()
File "/home/btaylor/python-virtualenvs/cassie_cropping/lib/python3.4/site-packages/django/__init__.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/btaylor/python-virtualenvs/cassie_cropping/lib/python3.4/site-packages/django/apps/registry.py", line 78, in populate
@alsoicode
alsoicode / gist:1dc25196f61bf90ba06e
Created February 12, 2015 15:05
passing param to Django form
class Foo(object):
def __init__(self, *args, **kwargs):
self.pick_id = kwargs.pop('pick_id')
super(Foo, self).__init__(*args, **kwargs)
foo = Foo(pick_id=2)
print foo.pick_id
@alsoicode
alsoicode / gist:0263d251e3744227ba46
Created January 27, 2015 15:37
Celery task exception
Environment:
Request Method: POST
Request URL: http://localhost:8000/poll/35f3cce8c344410b9ef6f2612e6c9cab/close/
Django Version: 1.7.1
Python Version: 3.4.0
Installed Applications:
('django.contrib.admin',
@alsoicode
alsoicode / gist:6885415
Created October 8, 2013 14:17
TastyPie POST error
{"error_message": "The format indicated 'application/x-www-form-urlencoded' had no available deserialization method. Please check your ``formats`` and ``content_types`` on your Serializer.", "traceback": "Traceback (most recent call last):\n\n File \"/home/btaylor/python_virtualenvs/b2c/local/lib/python2.7/site-packages/tastypie/resources.py\", line 195, in wrapper\n response = callback(request, *args, **kwargs)\n\n File \"/home/btaylor/python_virtualenvs/b2c/local/lib/python2.7/site-packages/tastypie/resources.py\", line 426, in dispatch_list\n return self.dispatch('list', request, **kwargs)\n\n File \"/home/btaylor/python_virtualenvs/b2c/local/lib/python2.7/site-packages/tastypie/resources.py\", line 458, in dispatch\n response = method(request, **kwargs)\n\n File \"/home/btaylor/python_virtualenvs/b2c/local/lib/python2.7/site-packages/tastypie/resources.py\", line 1317, in post_list\n deserialized = self.deserialize(request, request.body, format=request.META.get('CONTENT_TYPE', 'application/json'))\n\n Fil
@alsoicode
alsoicode / gist:5381417
Last active December 16, 2015 04:59
On-Demand Ajax DataSource for FuelUX DataGrid
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['underscore'], factory);
} else {
root.AjaxOnDemandDataSource = factory();
}
}(this, function () {
var AjaxOnDemandDataSource = function(options) {
this._formatter = options.formatter;
@alsoicode
alsoicode / .less file correctly compiled
Created December 22, 2011 16:30
.less file correctly compiled with WinLess
body {
background: url("../images/bg-page.jpg") no-repeat scroll 50% 0 #050404;
}
img {
display: block;
}
footer {
border-top: none;
margin-top: 0;
padding-top: 0;
@alsoicode
alsoicode / compiled less with concatenated rule failure
Created December 22, 2011 16:24
compiled .less with concatenated rule failure
body { background: URL("../images/bg-page.jpg") no-repeat scroll 50% 0 #050404; }
img { display: block; }
footer {
border-top: none;
margin-top: 0;
padding-top: 0;
}
footer p {
font-size: 10px;
color: white;
@alsoicode
alsoicode / concat_rule_failure
Created December 22, 2011 16:22
Example of .less with concatenated rule
body
{
background: url("../images/bg-page.jpg") no-repeat scroll 50% 0 #050404;
}
img
{
display: block;
}