A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.
posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord
# frozen_string_literal: true | |
module Aws | |
# Client for AWS Cognito Identity Provider using Secure Remote Password (SRP). | |
# | |
# This code is a direct translation of the Python version found here: | |
# https://github.com/capless/warrant/blob/ff2e4793d8479e770f2461ef7cbc0c15ee784395/warrant/aws_srp.py | |
class CognitoSrp | |
def initialize(username:, password:, pool_id:, client_id:, aws_client:) | |
@username = username |
FROM ruby:2.6.5-alpine | |
RUN apk add --update --no-cache bash build-base nodejs sqlite-dev tzdata postgresql-dev yarn | |
RUN gem install bundler:2.1.4 | |
WORKDIR /usr/src/app | |
COPY package.json yarn.lock ./ | |
RUN yarn install --check-files |
image: ruby:2.6 | |
services: | |
- postgres:11-alpine | |
variables: | |
POSTGRES_DB: myorg_test | |
CONTAINER_IMAGE: registry.gitlab.com/myorg/myapp | |
stages: |
FROM ruby:2.5.1 | |
ENV LANG C.UTF-8 | |
RUN apt-get update -qq && \ | |
apt-get install -y --no-install-recommends \ | |
build-essential \ | |
libpq-dev \ | |
libfontconfig1 \ | |
less \ |
docker run -ti -v $(pwd):/tmp DOCKER_IMAGE /bin/bash |
require 'rails_helper' | |
RSpec.describe MyWorker, type: :job do | |
include ActiveJob::TestHelper | |
let(:sqs_msg) { double AWS::SQS::ReceivedMessage, | |
id: 'fc754df7-9cc2-4c41-96ca-5996a44b771e', | |
body: 'test', | |
delete: nil } | |
<div className='delete-button' onClick={() => { if (window.confirm('Are you sure you wish to delete this item?')) this.onCancel(item) } } /> |
require 'sidekiq/api' | |
# 1. Clear retry set | |
Sidekiq::RetrySet.new.clear | |
# 2. Clear scheduled jobs | |
Sidekiq::ScheduledSet.new.clear |
In this episode we're going to be adding realtime notifications into your app using ActionCable. We've talked about notifications a few times in the past and we used AJAX polling for that. 95% of the time, polling is the solution that would be recommended for it.
But if you're looking for a good introduction into ActionCable then this is a decent one because we're only really using it for one way from the server side to the client side.
So to get started we're starting with an app that has Bootstrap installed and then we created a Main controller with an index view which is where we will list our Notifications as for this example.
Before we generate our channels let's install a few things