Skip to content

Instantly share code, notes, and snippets.

View prem-prakash's full-sized avatar

Camilo Hollanda prem-prakash

View GitHub Profile
@prem-prakash
prem-prakash / S3-Static-Sites.md
Created April 9, 2021 12:13 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

sudo dnf install \
  https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm

sudo dnf install \
  https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
dnf shell 
@prem-prakash
prem-prakash / exercise.ex
Created February 10, 2020 12:45
Exercise
defmodule Exercise do
def sort_groups(employee_ids) do
groups = employee_ids
|> Enum.shuffle()
|> Enum.chunk_every(3, 3, [])
size = Enum.count(employee_ids)
if rem(size, 3) == 0 do
groups
else
AllCops:
TargetRubyVersion: 2.6
Exclude:
- bin/**/*
- db/data/**/*
- db/seeds.rb
- db/migrate/**/*
- db/schema.rb
- tmp/**/*
- vendor/**/*
@prem-prakash
prem-prakash / .overcommit.yml
Last active January 16, 2018 02:06
Pre commit webhook to check if Ecto structure.sql is updated
PreCommit:
StructureUpToDate:
enabled: true
description: 'Checking for schema changes'
include: 'priv/repo/**/*'
@prem-prakash
prem-prakash / mix.exs
Last active January 16, 2018 00:48
Changed mix.exs
defp aliases do
[
"ecto.migrate": ["ecto.migrate", "ecto.dump"],
"ecto.setup": ["ecto.create", "ecto.load", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.load", "ecto.migrate", "test"]
]
end
@prem-prakash
prem-prakash / mix.exs
Last active January 16, 2018 00:44
original mix.exs
defp aliases do
[
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
"test": ["ecto.create --quiet", "ecto.migrate", "test"]
]
end