id | name |
---|---|
1 | Jane |
2 | Max |
3 | John |
4 | Scott |
# frozen_string_literal: true | |
# drop this file in app/lib/pagination.rb | |
module Pagination | |
DEFAULT_PAGE_LIMIT = 10 | |
def pages(records:, url:) | |
paginate = Paginate.new(records: records, | |
url: url, | |
limit: limit, |
First find your Conbee with lsusb
and note the ID. The vendor is 1cf1 and the product is 0030.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 1cf1:0030 Dresden Elektronik ZigBee gateway [ConBee II]
Bus 001 Device 003: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
As configured in my dotfiles.
start new:
tmux
start new with session name:
Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create
. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.
Note that on Heroku, you must always use master
as the destination branch on the remote. If you want to deploy a different branch, you can use the syntax local_branch:destination_branch
seen below (in this example, we push the local staging
branch to the master
branch on heroku.
$ git remote add staging https://git.heroku.com/staging-app.git
It's important to note that running this reset will drop any existing data you have in the application
- Step 1:
heroku restart
- Step 2:
heroku pg:reset DATABASE
(no need to change theDATABASE
) - Step 3:
heroku run rake db:migrate
- Step 4:
heroku run rake db:seed
(if you have seed)
One liner
For this blog post we will be using ruby version 2.4.0 and rails version 5.1.4 as backend and React/Redux as frontend. Adding Google Sign in functionality in your application can be done in two popular ways.
-
Adding google sign in functionality in the frontend with google api client
gapi
. -
Adding google sign in functionality logic in the backend server.
If your application has separate backendend with APIs feeding data to the frontend React application, I suggest you to follow the step 2. If you want yo enhance your application security, then you implement both.
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 |