Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
demining authored Jun 19, 2022
1 parent 442c828 commit 543fc6a
Showing 1 changed file with 145 additions and 0 deletions.
145 changes: 145 additions & 0 deletions Terminal_CryptoDeepTech.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Terminal_CryptoDeepTech.ipynb",
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "code",
"source": [
"from google.colab import drive\n",
"drive.mount('/content/drive/')\n"
],
"metadata": {
"id": "uJsx5Qdzetn0"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"cd drive/MyDrive/"
],
"metadata": {
"id": "J3zgAAFdevhI"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "JkHBZhTNN9K_"
},
"source": [
"#@title JS Shell\n",
"%%html\n",
"<div id=term_demo></div>\n",
"<script src=\"https://code.jquery.com/jquery-latest.js\"></script>\n",
"<script src=\"https://cdn.jsdelivr.net/npm/jquery.terminal/js/jquery.terminal.min.js\"></script>\n",
"<link href=\"https://cdn.jsdelivr.net/npm/jquery.terminal/css/jquery.terminal.min.css\" rel=\"stylesheet\"/>\n",
"<script>\n",
" $('#term_demo').terminal(function(command) {\n",
" if (command !== '') {\n",
" try {\n",
" var result = window.eval(command);\n",
" if (result !== undefined) {\n",
" this.echo(new String(result));\n",
" }\n",
" } catch(e) {\n",
" this.error(new String(e));\n",
" }\n",
" } else {\n",
" this.echo('');\n",
" }\n",
" }, {\n",
" greetings: 'Welcome to JavaScript Shell',\n",
" name: 'js_demo',\n",
" height: 200,\n",
" prompt: 'js> '\n",
" });"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "ePOgDV3PR7P5"
},
"source": [
"#@title IPython.display\n",
"from IPython.display import JSON\n",
"from google.colab import output\n",
"from subprocess import getoutput\n",
"import os\n",
"\n",
"def shell(command):\n",
" if command.startswith('cd'):\n",
" path = command.strip().split(maxsplit=1)[1]\n",
" os.chdir(path)\n",
" return JSON([''])\n",
" return JSON([getoutput(command)])\n",
"output.register_callback('shell', shell)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "Kn9S2H8HODQD"
},
"source": [
"#@title Terminal CryptoDeepTech\n",
"%%html\n",
"<div id=term_demo></div>\n",
"<script src=\"https://code.jquery.com/jquery-latest.js\"></script>\n",
"<script src=\"https://cdn.jsdelivr.net/npm/jquery.terminal/js/jquery.terminal.min.js\"></script>\n",
"<link href=\"https://cdn.jsdelivr.net/npm/jquery.terminal/css/jquery.terminal.min.css\" rel=\"stylesheet\"/>\n",
"<script>\n",
" $('#term_demo').terminal(async function(command) {\n",
" if (command !== '') {\n",
" try {\n",
" let res = await google.colab.kernel.invokeFunction('shell', [command])\n",
" let out = res.data['application/json'][0]\n",
" this.echo(new String(out))\n",
" } catch(e) {\n",
" this.error(new String(e));\n",
" }\n",
" } else {\n",
" this.echo('');\n",
" }\n",
" }, {\n",
" greetings: 'Terminal CryptoDeepTech',\n",
" name: 'colab_demo',\n",
" height: 320,\n",
" prompt: 'crypto > '\n",
" });"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
""
],
"metadata": {
"id": "HGohEqF7tcep"
},
"execution_count": null,
"outputs": []
}
]
}

0 comments on commit 543fc6a

Please sign in to comment.