TIL is an open-source project by the team at Hashrocket that catalogues the sharing & accumulation of knowledge as it happens day-to-day. Posts have a 200-word limit, and posting is open to any Rocketeer as well as select friends of the team. We hope you enjoy learning along with us.
This site was open-sourced as a window into our development process, as well as to allow people to experiment with the site on their own and contribute to the project.
If you are creating your own version of the site, fork the repository.
Then, follow these setup steps:
$ git clone https://github.com/hashrocket/hr-til
$ cd hr-til
$ gem install bundler
$ bundle install
$ cp config/application.yml{.example,}
$ rake db:create db:migrate db:seed
$ rails sIn development, db:seed will load sample data for channels, developers, and
posts. Omit this command to opt-out of this step, or create your own sample
data in db/seeds/development.rb.
Authentication is managed by Omniauth and Google. To allow users from a domain, multiple domains, or a specific email to log in, set those configurations in your environmental variables:
# config/application.yml
permitted_domains: 'hashrocket.com|hshrckt.com'
permitted_emails: 'friend@whitelist.com'1. Navigate to https://console.developers.google.com/
2. Click "Dashboard" tab -> click Enable API ... ensure "Google+" and "Contacts" API's are enabled.
3. Click "Credentials" tab -> click "Create credentials -> OAuth ClientID -> Select web application
4. Add to Authorized Redirect URL's: http://localhost:3000/auth/google_oauth2/callback
5. click create -> copy Client ID and Client Secret into config/application.yml
Once set, visit '/admin' and log in with a permitted email address or domain.
Run all tests with:
$ rake
Or, run all the test in parallel with flatware:
$ flatware fan rake db:test:prepare
$ flatware rspec && flatware cucumber
- The gem
selenium-webdriverdepends on the Firefox browser. - The gems
flatware-rspecandflatware-cucumberrequire ZeroMQ. Learn more here.
Staging and production for Hashrocket's TIL is located here:
basic_auth_credentials both toggles and defines basic authentication:
# config/application.yml
basic_auth_credentials: username:passwordslack_post_endpoint allows the app to post to Slack:
# config/application.yml
slack_post_endpoint: /services/some/hashes- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
Bug reports and pull requests are welcome on GitHub at https://github.com/hashrocket/hr-til. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
We love seeing forks of Today I Learned in production! Please consult our usage guide for guidelines on appropriate styling and attribution.
TIL is released under the MIT License.
TIL is supported by the team at Hashrocket, a multidisciplinary design and development consultancy. If you'd like to work with us or join our team, don't hesitate to get in touch.
