See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
{ | |
"editor.fontLigatures": true, | |
"editor.semanticHighlighting.enabled": true, | |
"editor.linkedEditing": true, | |
"editor.renderLineHighlight": "gutter", | |
"editor.parameterHints.enabled": false, | |
"editor.renderWhitespace": "none", | |
"editor.minimap.enabled": false, | |
"editor.formatOnSave": true, | |
"editor.defaultFormatter": "esbenp.prettier-vscode", |
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "attach", | |
"name": "Launch Program", | |
"skipFiles": [ | |
"<node_internals>/**" | |
], |
rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T
-d postgresql
sets up the project to use PostgreSQL--skip-turbolinks
& --skip-spring
creates a project that does not use turbolinks or spring-T
skips the creation of the test directory and use of Test::Unit
rails new <project_name> -d postgresql -T
-T
, [--skip-test], [--no-skip-test] # Skip test files-d
, [--database=DATABASE] # Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
FROM node:14.19-alpine | |
WORKDIR /app | |
# Install Ember | |
RUN yarn global add ember-cli | |
# Copy the minimum files for yarn install to work | |
COPY package.json ./ | |
COPY yarn.lock ./ |
# Great book! Here are my quiz notes: | |
# What is the diff bt raise and fail? | |
#=> no diff | |
# Are raise//fail ruby keywords or methods? | |
#=> Kernel#raise (are methods) | |
# Global exception variable | |
# => $! or $ERROR_INFO.inspect |
const debounce = () => { | |
let timeoutId; | |
return () => { | |
clearTimeout(timeoutId); | |
timeoutId = setTimeout(() => { | |
console.log('Run Function'); | |
}, 2000); | |
}; | |
}; |
conditions = {} | |
conditions.merge!(published: params[:published]) if params[:published] | |
conditions.merge!(author: params[:author]) if params[:author] | |
conditions.merge!(author: params[:author]) if params[:author] | |
conditions.merge!(created_at: params[:created_at]) if params[:created_at] # If the params[:created_at] is a DateTime | |
# Use spat operator as below | |
@posts = Post.where(**conditions) |