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
| # lib/tasks/db.rake | |
| namespace :db do | |
| desc 'Maintains database by running command as ANALYZE, VACUUM and REINDEX' | |
| task maintain: :environment do | |
| verbose = ENV['VERBOSE'].present? | |
| connection = ActiveRecord::Base.connection | |
| puts "Maintaining database #{connection.current_database} ..." | |
| connection.execute("VACUUM FULL #{'VERBOSE' if verbose}") | |
| connection.execute("ANALYZE #{'VERBOSE' if verbose}") |
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
| /** | |
| * Simple localStorage with Cookie Fallback | |
| * v.1.0.0 | |
| * | |
| * USAGE: | |
| * ---------------------------------------- | |
| * Set New / Modify: | |
| * store('my_key', 'some_value'); | |
| * | |
| * Retrieve: |
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
| #!/bin/sh | |
| # Set up the Heroku scheduler to run this command every hour. See example setup at https://goo.gl/nMCSH3 | |
| # | |
| # Requires env vars to be set in Heroku with `heroku config:set`: | |
| # - HEROKU_APP_NAME: this is just the app name in Heroku, i.e. `heroku apps` will list all apps you have access to | |
| # - HEROKU_CLI_USER: Once Heroku CLI is authenticated (https://goo.gl/Qypr4x), check `cat .netrc` (or `_netrc` on Windows), | |
| # look for `login` under `machine api.heroku.com` | |
| # - HEROKU_CLI_TOKEN: As above, but use the `password` field | |
| # |
OlderNewer