GitHub Gist will now be the hub of my coding archive. The intention is to have a central point of reference for all of the code that I'm proud of but doesn't exactly belong anywhere.
I wanted my code to be in the cloud, to be searchable and to have nice syntax highlighting. Gist ticks all these boxes.
My workflow was inspired by gister which allows me to post gists from the command line and receive the url.
To install gister with ruby run:
$ gem install gist
Then to send a file to Gist use gist <filename>
. The url for the Gist is returned which is handy for sharing these snippets.
One other handy command includes gist -l
which lists all my Gists.
There is a bit of a problem with Gists and searching. But it's not completely terrible.
If I navigate to the Gist search page I'm able to use prefixes to access my code. For instance, user:harrisonmalone
returns all of my Gists. You can then search by language or for content within your Gists. For example, if I want to search for ruby Gists with classes in them I would use:
It might be a good idea to have all coding related docs and notes in gists. I could put the daily reports in one markdown file.
If I need to do screenshots for markdown Gists I can store the image assets on my website img
folder. One other nice benefit is that I can work from my iPad comfortably.
So my workflow is now as follows. Challenge code that is currently under construction needs to be stored locally in the apps folder (divided by language). Code that is done and just needs to be archived needs to be stored as a Gist.
This could also be a better way for students to share answers and store their own code. I feel as if people's code documentation is a bit everywhere right now. It might improve as we move more into Rails.
So now if I navigate to code
I have apps
, dotfiles
and my projects. dotfiles
has my git config in it so don't screw around with that. Within apps
I have code that I'm currently working on. This will be snippets of code that I'm testing for the daily challenges. It will also be divided by langauge. Try not to have directories here.
Big directories of files will live at the root of code
. This will be where all my full stack projects will reside. I can also push these to github from there.