Skip to content

Instantly share code, notes, and snippets.

View ValterAndrei's full-sized avatar
🏠
Working from home

Valter Andrei ValterAndrei

🏠
Working from home
  • Poços de Caldas - MG, Brasil
View GitHub Profile
@saboyutaka
saboyutaka / Dockerfile
Created July 28, 2018 06:20
Docker Compose for Rails
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 \
@lucaspiller
lucaspiller / .gitlab-ci.yml
Last active April 14, 2022 09:07
Rails 5.2 + Docker + Gitlab Continuous Deployment
image: ruby:2.6
services:
- postgres:11-alpine
variables:
POSTGRES_DB: myorg_test
CONTAINER_IMAGE: registry.gitlab.com/myorg/myapp
stages:
@erdostom
erdostom / Dockerfile
Last active November 25, 2022 14:53
Good starter Dockerfile + docker-compose.yml for Rails 6.
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
@ilyazub
ilyazub / excel_xml_spreadsheet_example.md
Last active January 4, 2023 03:47
Excel 2003 XML Spreadsheet example

Excel 2003 XML Spreadsheet example

Example

image

spreadsheet.xml

Solved errors

Problem During Load because of wrong ss:ExpandedRowCount.

# 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

Realtime Notifications with ActionCable

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.

Getting started

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

@rahsheen
rahsheen / rspec_mock_net_http.rb
Created November 30, 2017 19:33
Easily Mock Net::HTTP with Rspec
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 }
@danopia
danopia / database.yml
Created April 25, 2011 04:19
Default SQLite database.yml
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
@falvarez
falvarez / docker-shell.sh
Created January 24, 2018 08:10
Run docker container, mount current working directory and get interactive shell
docker run -ti -v $(pwd):/tmp DOCKER_IMAGE /bin/bash
@mateusg
mateusg / devise.pt-BR.yml
Last active December 23, 2023 15:15 — forked from alexandreaquiles/devise.pt-BR.yml
pt-BR translations for Devise
# encoding: UTF-8
# pt-BR translations for Devise
pt-BR:
devise:
confirmations:
confirmed: "Sua conta foi confirmada com sucesso. Você está logado."
send_instructions: "Dentro de minutos, você receberá um e-mail com instruções para a confirmação da sua conta."
send_paranoid_instructions: "Se o seu endereço de e-mail estiver cadastrado, você receberá uma mensagem com instruções para confirmação da sua conta."
failure:
already_authenticated: "Você já está logado."