This is a clone of Github Gist that runs on rails, and utilizes the ACE javascript library for syntax highlighting.
-
Install Docker :
On mac go to: 'https://docs.docker.com/docker-for-mac/install/'
-
Clone the below repo:
git clone https://github.com/ac7552/github_gist_clone.git
-
In the cloned directory create your own .env with a password like so:
MYAPP_DATABASE_PASSWORD="example"
-
At the command prompt, while in the newly cloned directory, setup the docker containers with the following command:
$ docker-compose build $ docker-compose up
-
Next, if need be, migrate the rails db with the following commands
$ docker-compose run website rake db:migrate
- For debugging run: docker-compose run --service-ports website
- For checking routes: docker-compose run website rake routes
- For running migrations: docker-compose run website rails g migration etc
Docker
##Code Snippet:
- In the gist.js file there is a language-map you can add to, so that you can deliminate additional languages.
Just add the extension of the language you wish to add.
const languageMap = {
js: 'javascript',
py: 'python',
rb: 'ruby',
html: 'html',
css: 'css'
}
- Ace - The javascript library used
- Rails - The Web Framework used
- Docker - Containers for an easy setup
- Aaron Campbell