Skip to content

Instantly share code, notes, and snippets.

@mazz
mazz / ipython_server_log.txt
Created November 20, 2016 21:07
ipython_server_log
(sauna1_env)➜ pic2pic ipython --version
3.2.3
(sauna1_env)➜ michaelkhanna@gmail.com cat notebook.stderr.log
Starting notebook, daemon True
Starting with context {'websocket_url': 'ws://localhost:40000', 'greeting': '\n\nAvailable variables and functions:\n\n* **app** - The [WSGI application](http://docs.pylonsproject.org/docs/pyramid/en/latest/api/paster.html?highlight=wsgi%20application#pyramid.paster.get_app) object generated by bootstrapping.\n* **request** - A [pyramid.request.Request](http://docs.pylonsproject.org/projects/pyramid/en/latest/api/request.html#pyramid.request.Request) object implying the current request state for your script.\n* **root** - The resource [root](http://docs.pylonsproject.org/docs/pyramid/en/latest/glossary.html#term-root) of your Pyramid application. This is an object generated by the [root factory](http://docs.pylonsproject.org/docs/pyramid/en/latest/glossary.html#term-root-factory) configured in your application.\n* **registry** - The application [registry](http://docs.py
@mazz
mazz / gist:ba897d5adcb93aaa8090a83cd6132caf
Created November 20, 2016 21:10
ipython server log 2
(sauna1_env)➜ pic2pic cat /tmp/pyramid_notebook/michaelkhanna@gmail.com/notebook.stderr.log
Starting notebook, daemon True
Starting with context {'greeting': '\n\nAvailable variables and functions:\n\n* **app** - The [WSGI application](http://docs.pylonsproject.org/docs/pyramid/en/latest/api/paster.html?highlight=wsgi%20application#pyramid.paster.get_app) object generated by bootstrapping.\n* **request** - A [pyramid.request.Request](http://docs.pylonsproject.org/projects/pyramid/en/latest/api/request.html#pyramid.request.Request) object implying the current request state for your script.\n* **root** - The resource [root](http://docs.pylonsproject.org/docs/pyramid/en/latest/glossary.html#term-root) of your Pyramid application. This is an object generated by the [root factory](http://docs.pylonsproject.org/docs/pyramid/en/latest/glossary.html#term-root-factory) configured in your application.\n* **registry** - The application [registry](http://docs.pylonsproject.org/docs/pyramid/en/latest/glossary.html#term-a
@mazz
mazz / gist:4259594
Created December 11, 2012 15:56
uses CGImageCreateWithImageInRect to perform a crop
// this chunk of code loads a jpeg image into a cgimage
// creates a second crop of the original image with CGImageCreateWithImageInRect
// writes the new cropped image to the desktop
// ensure that the xy origin of the CGRectMake call is smaller than the width or height of the original image
NSURL *originalImage = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"lockwood" ofType:@"jpg"]];
CGImageRef imageRef = NULL;
CGImageSourceRef loadRef = CGImageSourceCreateWithURL((CFURLRef)originalImage, NULL);
if (loadRef != NULL)
@mazz
mazz / gist:b31fb5a89605548868a91abb91f8faf8
Created December 11, 2016 05:17
websauna mac stacktrace
(saunaenv)➜ xact ws-alembic -c conf/development.ini -x packages=all revision --auto -m "Initial migration"
Traceback (most recent call last):
File "/Users/maz/tmp/.sidha/files.noindex/websaunaproj/saunaenv/bin/ws-alembic", line 9, in <module>
load_entry_point('websauna==1.0a3', 'console_scripts', 'ws-alembic')()
File "/Users/maz/tmp/.sidha/files.noindex/websaunaproj/saunaenv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Users/maz/tmp/.sidha/files.noindex/websaunaproj/saunaenv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
return ep.load()
File "/Users/maz/tmp/.sidha/files.noindex/websaunaproj/saunaenv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2355, in load
return self.resolve()
@mazz
mazz / gist:7271625e3d312bc93e80e0f29fabfa71
Created December 14, 2016 04:01
websauna: KeyError: 'full_name'
[22:57:07] [pyramid_debugtoolbar toolbar_tween] Exception at http://localhost:6543/admin/models/user/listing
traceback url: http://localhost:6543/_debug_toolbar/exception?tb=4433257752&token=6227245c7864365c7863355c7865365c7839355c7839345c786362634e5c78313427
Traceback (most recent call last):
File "/Users/maz/webapp/websauna_env/lib/python3.5/site-packages/sqlalchemy/ext/indexable.py", line 313, in fget
value = column_value[self.index]
KeyError: 'full_name'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
@mazz
mazz / gist:cff857a8ad3cba902e3f6c9c4b43530d
Created December 17, 2016 04:39
notebook.stderr.log
maz@maz-alpha:/tmp/pyramid_notebook/foo@bar.com$ cat notebook.stderr.log
Starting notebook, daemon True
Starting with context {'extra_template_paths': ['/home/maz/webapp/websauna/lib/python3.5/site-packages/pyramid_notebook/server/templates'], 'jinja_environment_options': {}, 'allow_origin': 'http://localhost:6543', 'context_hash': 1484605921, 'http_port': 40008, 'websocket_url': 'ws://localhost:40008', 'greeting': '\n\nAvailable variables and functions:\n\n* **app** - The [WSGI application](http://docs.pylonsproject.org/docs/pyramid/en/latest/api/paster.html?highlight=wsgi%20application#pyramid.paster.get_app) object generated by bootstrapping.\n* **request** - A [pyramid.request.Request](http://docs.pylonsproject.org/projects/pyramid/en/latest/api/request.html#pyramid.request.Request) object implying the current request state for your script.\n* **root** - The resource [root](http://docs.pylonsproject.org/docs/pyramid/en/latest/glossary.html#term-root) of your Pyramid application. This is an object generat
@mazz
mazz / gist:62db05300db5e5e6da0e0e5382e2484b
Created December 16, 2016 04:17
notebook has password by default
http://localhost:6543/notebook/login?next=%2Fnotebook%2Fnotebooks%2Fdefault-1589979049.ipynb
@mazz
mazz / gist:22f92bd25c1f6f0314eca85d72e0ef7e
Created December 18, 2016 01:05
A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration.
A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration.
Request URL:ws://localhost:40006/notebook/api/kernels/edca6a48-f31c-4317-bf36-d28dca6daf8b/channels?session_id=FFED1D8CD3B14AE68F92FFDD174C419B
Request Method:GET
Status Code:403 Forbidden
Response Headers
view source
Content-Length:4617
Content-Type:text/html
Date:Mon, 19 Dec 2016 01:38:17 GMT
Server:TornadoServer/4.4.2