Skip to content

Instantly share code, notes, and snippets.

@D3f0
Created May 21, 2015 12:16
Show Gist options
  • Save D3f0/028acca8fab8a64b56f2 to your computer and use it in GitHub Desktop.
Save D3f0/028acca8fab8a64b56f2 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"<Response [200]>"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import requests\n",
"from server.control import start_webserver\n",
"start_webserver()\n",
"requests.get('http://localhost:6543/static/d3.js')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"application/javascript": [
"\n",
"requirejs.config({\n",
" paths: {\n",
" 'd3': 'http://localhost:6543/static/d3'\n",
" }\n",
"});\n",
"requirejs(['d3'],\n",
" function (d3) {\n",
" console.log(d3.select('a'));\n",
" }\n",
");"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%javascript\n",
"\n",
"requirejs.config({\n",
" paths: {\n",
" 'd3': 'http://localhost:6543/static/d3'\n",
" }\n",
"});\n",
"requirejs(['d3'],\n",
" function (d3) {\n",
" console.log(d3.select('a'));\n",
" }\n",
");"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment