Skip to content

Instantly share code, notes, and snippets.

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

Jorge Tomas jotolo

🏠
Working from home
  • Amsterdam, The Netherlands
View GitHub Profile
@JunichiIto
JunichiIto / how-to-fix-rails-7-0-warning.md
Created December 29, 2021 09:10
Rails 7.0 - How to fix "DEPRECATION WARNING: image/jpg is not a valid content type"

Rails 7.0 - How to fix "DEPRECATION WARNING: image/jpg is not a valid content type"

Problem

I got the following message when I updated my app to Rails 7.0.

DEPRECATION WARNING: image/jpg is not a valid content type, it should not be used when creating a blob, and support for it will be removed in Rails 7.1. If you want to keep supporting this content type past Rails 7.1, add it to `config.active_storage.variable_content_types`. Dismiss this warning by setting `config.active_storage.silence_invalid_content_types_warning = true`. (called from public_send at /Users/jnito/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/factory_bot-6.2.0/lib/factory_bot/attribute_assigner.rb:16)
@statico
statico / index.js
Last active October 18, 2023 20:48
Simple AWS ECS status update notifications to Slack webhook
/*
Want to know when ECS events happen in Slack? Try this.
(1) Create a new Slack app with an incoming webhook, save the webhook URL
(2) Create an SNS topic called something like ECSEvents
(3) Create a CloudWatch Rule that publishes all ECS events to the topic
(4) Create a Node.js Lambda that is triggered by the SNS topic
(5) Add a WEBHOOK_URL environment variable to the Lambda with the webhook URL
(6) Paste this code into index.js
(7) Paste the contents of https://unpkg.com/node-fetch/lib/index.js into fetch.js
(8) Deploy and enjoy
@syafiqfaiz
syafiqfaiz / how-to-copy-aws-rds-to-local.md
Last active February 21, 2024 06:00
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@JunichiIto
JunichiIto / alias_matchers.md
Last active April 16, 2024 16:18
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value