Created
February 10, 2014 10:58
-
-
Save JohnGriffiths/8913905 to your computer and use it in GitHub Desktop.
Using Gister notebook (again)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"css": [ | |
"" | |
], | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"cell_type": "heading", | |
"level": 1, | |
"metadata": {}, | |
"source": [ | |
"Using Gister " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Gister (https://github.com/weakish/gister) is a command lien program that allows you to quickly publish files to github gist. It will automatically add any added file to a pre-defined 'gister' folder, and index the contents so that's its searchable from the command line. \n", | |
"\n", | |
"This all sounds very nice and useful to me so I'm giving gister a go." | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"It didn't work out of the box for me however, but after a fair bit of faffing I seem to have got it to work. \n", | |
"\n", | |
"I was having the problem that it wasn't saving the '.csearchindex' in the folder properly. \n", | |
"\n", | |
"Here's the solution I came up with:" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"1. Need to create a blank '.csearchindex' file in the gister folder\n", | |
"2. Need to create a bash environment variable 'CSEARCHINDEX' that points to that file. " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
" gister init" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"(...give it location of the gister folder )" | |
], | |
"language": "python", | |
"metadata": { | |
"run_control": { | |
"breakpoint": false | |
} | |
}, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"!CSEARCHINDEX='/media/sf_WINDOWS_D_DRIVE/Neurodebian/code/git_repos/gists/gister_gists/.csearchindex'" | |
], | |
"language": "python", | |
"metadata": { | |
"run_control": { | |
"breakpoint": false | |
} | |
}, | |
"outputs": [], | |
"prompt_number": 2 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"!export CSEARCHINDEX" | |
], | |
"language": "python", | |
"metadata": { | |
"run_control": { | |
"breakpoint": false | |
} | |
}, | |
"outputs": [], | |
"prompt_number": 3 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"import os\n", | |
"os.system('echo $CSEARCHINDEX')" | |
], | |
"language": "python", | |
"metadata": { | |
"run_control": { | |
"breakpoint": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"metadata": {}, | |
"output_type": "pyout", | |
"prompt_number": 5, | |
"text": [ | |
"0" | |
] | |
} | |
], | |
"prompt_number": 5 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"cd /media/sf_WINDOWS_D_DRIVE/Neurodebian/code/git_repos/gists/gister_gists/" | |
], | |
"language": "python", | |
"metadata": { | |
"run_control": { | |
"breakpoint": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"/media/sf_WINDOWS_D_DRIVE/Neurodebian/code/git_repos/gists/gister_gists\n" | |
] | |
} | |
], | |
"prompt_number": 6 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [], | |
"language": "python", | |
"metadata": { | |
"run_control": { | |
"breakpoint": false | |
} | |
}, | |
"outputs": [] | |
} | |
], | |
"metadata": {} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment