A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.
posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord| # Sidekiq interaction and startup script | |
| commands: | |
| create_post_dir: | |
| command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post" | |
| ignoreErrors: true | |
| files: | |
| "/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh": | |
| mode: "000755" | |
| owner: root | |
| group: root |
| Array values in the parameter to `Gem.paths=` are deprecated. | |
| Please use a String or nil. | |
| An Array (...) was passed in from bin/rails:3:in `load' | |
| Solution | |
| ======== | |
| https://github.com/rubygems/rubygems/issues/1551 | |
| If you came to this issue by googling the error specified in the description of this issue, you should know that it has already been fixed in spring-1.6.4 and all you need to do is to update to latest spring and regenerate binstubs, like this: |
It's important to note that running this reset will drop any existing data you have in the application
heroku restartheroku pg:reset DATABASE (no need to change the DATABASE)heroku run rake db:migrateheroku run rake db:seed (if you have seed)One liner
| ;you have to re-map the f keys so they work. | |
| ;Otherwise AHK will just 'wait' for the number key after - if there is non then nothing happens | |
| f1::f1 | |
| f2::f2 | |
| f3::f3 | |
| f4::f4 | |
| f5::f5 | |
| f6::f6 | |
| f7::f7 | |
| f8::f8 |
#Simple Authentication with Bcrypt
This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.
The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).
You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault
##Steps
| # Define a setter to pass in a custom log formatter | |
| class ActiveSupport::BufferedLogger | |
| def formatter=(formatter) | |
| @log.formatter = formatter | |
| end | |
| end | |
| # Defines a custom log format (time, severity, message, PID, backtrace)... all with color! | |
| class Formatter | |
| SEVERITY_TO_TAG = {'DEBUG'=>'meh', 'INFO'=>'fyi', 'WARN'=>'hmm', 'ERROR'=>'wtf', 'FATAL'=>'omg', 'UNKNOWN'=>'???'} |
| sudo apt-get install unzip; | |
| wget -O /tmp/chromedriver.zip http://chromedriver.googlecode.com/files/chromedriver_linux64_19.0.1068.0.zip && sudo unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/; |