Skip to content

Instantly share code, notes, and snippets.

View jvnlwn's full-sized avatar

Joe Van Leeuwen jvnlwn

View GitHub Profile
Applying path.0004_remove_pathchangepublish_published_to_paths...Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 351, in execute_from_command_line
utility.execute()
File "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 343, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
django.request -- ERROR -- 2015-11-17 14:31:09,127: Internal Server Error: /api/private/discussion/
Traceback (most recent call last):
File "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/cbweb/coursebook/pathwright/apps/web_api/private/resources/discussion/views.py", line 47, in list_create_discussion_router
return view(request, *args, **kwargs)
File "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
return view_func(*args, **kwargs)
File "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
return self.dispatch(request, *args, **kwargs)
@jvnlwn
jvnlwn / gist:9510168
Created March 12, 2014 16:11
Fooling around with closures. Defined a function that accepts an argument and returns a function that manipulates said argument. I believe my gist is just an example of object referencing.
function what(obj) {
return function(str) {
if (str) {
console.log('name WAS: ', obj.name)
obj.name = str;
}
console.log('name is: ', obj.name)
}
<!-- SOME NOTES VIA ARI PICKER -->
<!doctype html>
<html>
<head>
<title>JSONP</title>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
</head>
<body>
@jvnlwn
jvnlwn / listener event confusion
Created October 27, 2013 02:34
Working on chess.js and ran into an issue when working with Backbone.js listener events inside of views. For my app, every time a chess piece is captured, it is destroyed, added to another collection for captured pieces, and a listener in the view will remove itself when its model is destroyed. When a pawn is promoted, I decided I would destroy …
PieceView = Backbone.View.extend({
initialize: function(options) {
this.options = options;
$('.chess-board').append(this.$el);
var that = this;
this.listenTo(this.model, 'destroy', function() {
function arraySum(i) {
// i will be an array, containing integers, strings and/or arrays like itself.
// Sum all the integers you find, anywhere in the nest of arrays.
var total = 0;
blah(i)
function blah(newArray) {
array = newArray.slice()
newArray = [];