Skip to content

Instantly share code, notes, and snippets.

View jasongrout's full-sized avatar

Jason Grout jasongrout

View GitHub Profile
@jasongrout
jasongrout / gist:1675277
Created January 25, 2012 07:54
Make python mode and rst mode have tab/shift-tab indent/dedent selected lines
;; Enable tab and shift-tab to continuously indent/dedent rst blocks
(add-hook 'rst-mode-hook
(function (lambda ()
(setq indent-region-function (lambda (&rest n)
(rst-shift-region-right nil)
(setq deactivate-mark nil)))
(local-set-key [S-tab] (lambda (&rest n)
(interactive)
(if (use-region-p)
(progn (rst-shift-region-left nil)
@jasongrout
jasongrout / gist:2221289
Created March 27, 2012 23:03
Webwork problem
## DESCRIPTION
## Linear Algebra
## ENDDESCRIPTION
## KEYWORDS('matrix' 'null space' 'vector')
## Tagged by tda2d
## DBsubject('Linear Algebra')
## DBchapter('Matrices')
## DBsection('Image and Kernel')
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - Sage Cell Parser
@copyright: 2010 by Chris Martino <chris@console.org>, Jason Grout <jason-sage@creativetrax.com>
@license: GNU GPL.
"""
from MoinMoin.parser._ParserBase import ParserBase
from uuid import uuid4
{
"content": [
{
"parent_header": {
"username": "",
"msg_id": "4f5e129c-da63-4db2-9bf6-d2ad89b898fa",
"session": "c9ec7d91-6a89-4aa4-bdf5-f1d55bbd387c"
},
"msg_type": "extension",
"sequence": 0,
2012-05-18 16:01:50-0700 [-] WSGI application error
Traceback (most recent call last):
File "/sagenb/sage_install/sage-5.0-boxen-x86_64-Linux/local/lib/python2.7/site-packages/Twisted-12.0.0-py2.7-linux-x86_64.egg/twisted/python/threadpool.py", line 230, in _worker
o = self.q.get()
File "/sagenb/sage_install/sage-5.0-boxen-x86_64-Linux/local/lib/python2.7/site-packages/Twisted-12.0.0-py2.7-linux-x86_64.egg/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/sagenb/sage_install/sage-5.0-boxen-x86_64-Linux/local/lib/python2.7/site-packages/Twisted-12.0.0-py2.7-linux-x86_64.egg/twisted/python/context.py", line 83, in callWithContext
self.contexts.pop()
File "/sagenb/sage_install/sage-5.0-boxen-x86_64-Linux/local/lib/python2.7/site-packages/Twisted-12.0.0-py2.7-linux-x86_64.egg/twisted/web/wsgi.py", line 340, in run
self.started = True
"""
A test forking server
To start a single kernel by forking, do::
python -i testfork.py
The kernel object will be in the ``a`` variable. When you close the
python session, the forked kernel will be killed.
"""
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width">
<title>Sage Cell Server</title>
<script type="text/javascript" src="http://localhost:8080/static/jquery.min.js"></script>
<script type="text/javascript" src="http://localhost:8080/embedded_sagecell.js"></script>
</head>
<body>
Test gist 2
diff --git a/flask_version/worksheet_listing.py b/flask_version/worksheet_listing.py
index 83af90c..5e2680b 100644
--- a/flask_version/worksheet_listing.py
+++ b/flask_version/worksheet_listing.py
@@ -142,11 +142,13 @@ def empty_trash():
@worksheet_listing.route('/pub/')
@guest_or_login_required
def pub():
- return render_worksheet_list(request.args, pub=True, username=g.username)
+ return current_app.message("Public worksheets are currently disabled.")
(sage-sh) grout@tiny:~/projects/sagenb/sagecell/contrib/ipython-testing$ nosetests -v tests
trusted_kernel_manager_tests.TestTrustedMultiKernelManager.test_add_computer_success ... FAIL
trusted_kernel_manager_tests.TestTrustedMultiKernelManager.test_create_connected_stream ... ok
trusted_kernel_manager_tests.TestTrustedMultiKernelManager.test_create_hb_stream ... ok
trusted_kernel_manager_tests.TestTrustedMultiKernelManager.test_create_iopub_stream ... ok
trusted_kernel_manager_tests.TestTrustedMultiKernelManager.test_create_shell_stream ... ok
trusted_kernel_manager_tests.TestTrustedMultiKernelManager.test_end_session_success ... Too many open files (signaler.cpp:330)
zsh: abort nosetests -v tests
(sage-sh) grout@tiny:~/projects/sagenb/sagecell/contrib/ipython-testing$ nosetests -vvvv tests