Skip to content

Instantly share code, notes, and snippets.

View theendcomplete's full-sized avatar
🎯
Focusing

Nikkie Grom theendcomplete

🎯
Focusing
View GitHub Profile
@theendcomplete
theendcomplete / pagination.rb
Created December 8, 2023 13:01 — forked from goromlagche/pagination.rb
Cursor pagination
# 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,
@theendcomplete
theendcomplete / README.md
Created December 8, 2023 12:52 — forked from MarkMurphy/README.md
Cursor based pagination for Rails models.

Example Usage

Users

id name
1 Jane
2 Max
3 John
4 Scott
@theendcomplete
theendcomplete / gist:3e27534cbc27ce610068239aef7a67a0
Created August 23, 2023 19:16 — forked from crundberg/gist:a77b22de856e92a7e14c81f40e7a74bd
Setup deCONZ on unprivileged Proxmox container

Setup deCONZ on unprivileged Proxmox container

Preparation on host

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
@theendcomplete
theendcomplete / gs65stealth_linux_setup.md
Created December 29, 2022 16:32 — forked from gryan11/gs65stealth_linux_setup.md
Notes on setting up MSI GS65 Stealth as dual boot Linux Laptop

Linux Setup on MSI GS65 Laptop

Preliminary Setup

Make the following usb sticks and drives on windows:

  1. Ubuntu install usb stick
  2. System recovery usb stick
  3. System backup image on usb hard drive

windows setup

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@theendcomplete
theendcomplete / heroku-remote.md
Created April 18, 2022 12:42 — forked from randallreedjr/heroku-remote.md
Add a Heroku remote to an existing git repo

Working with git remotes on Heroku

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.

Adding a new remote

Add a remote for your Staging app and deploy

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
@theendcomplete
theendcomplete / heroku_pg_db_reset.md
Created October 11, 2021 18:24 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku (for Rails app)?

It's important to note that running this reset will drop any existing data you have in the application

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

Adding Google Sign In With Rails and React

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.

@theendcomplete
theendcomplete / rails http status codes
Created September 22, 2021 12:49 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
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