Skip to content

Instantly share code, notes, and snippets.

View damusix's full-sized avatar

Danilo Alonso damusix

  • Miami, FL
View GitHub Profile
@damusix
damusix / aws_iam_secret_to_smtp_password.md
Last active October 24, 2024 06:12
Convert AWS IAM credentials to AWS SMTP credentials

Convert AWS IAM credentials to AWS SMTP credentials

If you do, or want to, use AWS to deploy your apps, you will end up using AWS SES via SMTP when you're launching an app that sends out emails of any kind (user registrations, email notifications, etc). For example, I have used this configuration on various Ruby on Rails apps, however, it is just basic SMTP configurations and crosses over to any framework that supports SMTP sendmail.

There are two ways to go about this:

Luckily, you found this MD file and the NOT SO EASY WAY is suddenly copy-pasta... sudo yum....

@damusix
damusix / app.js
Last active December 6, 2018 14:27
RiotJS Global Store
// Originally, I was using Redux to contain the state, but switched to RiotControl
// because of its simplicity, and how it makes use of Riot's observable API.
// An issue I found with RiotControl was that, when you register multiple
// stores, it will call 1 event 1 time per store. So if you have 6 stores,
// `RiotControl.trigger('my-event')` will run 6 times. This is incredibly
// inefficient, especially if your app is doing a lot at once.
// After careful consideration, I failed to see the benefit of using
// RiotControl and instead opted for using the native Riot observable API.
@damusix
damusix / keybase.md
Last active May 3, 2019 08:29
Contact me on keybase!

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@damusix
damusix / cd.zsh
Last active February 20, 2021 23:57
Zsh based dotenv + add local paths as bash programs
# Set the project's local path to PATH
setlocalpath() {
if [ -f .pathrc ];
then;
localpaths=$(cat .pathrc | xargs)
echo "Setting local path in '.pathrc' ..."
# If pathrc is empty, use cwd
# Otherwise, convert the contents of pathrc
@damusix
damusix / browser-stream-meiosis.js
Last active May 2, 2019 20:33
Very inefficient and redundant implementation of meiosis pattern using browser's `ReadableStream` http://meiosis.js.org
const noop = () => {};
const store = {
// Initial state
state: {
working: true,
items: [],
},
actions: (update) => ({
@damusix
damusix / no-stream-meiosis.js
Last active May 2, 2019 20:39
No-stream implementation of meiosis pattern http://meiosis.js.org
const store = {
// Initial state
state: {
working: true,
items: [],
},
actions: (update) => ({
getThings: () => {
@damusix
damusix / index.html
Last active May 3, 2019 06:32
Riot 4 webpack config. Babel polyfill for axios support.
<html>
<head>
<meta charset="UTF-8">
<title>Riot 4!!!</title>
</head>
<body>
<noscript>
<h1>This site is a simple single page app that requires javascript.</h1>
</noscript>
@damusix
damusix / setup.sh
Created July 3, 2019 00:12
Setup new macbook
#!/bin/bash
# xcode
xcode-select --install
# brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
exec bash
@damusix
damusix / setup.sh
Last active March 27, 2021 03:12
Setup a linux laptop
cd /tmp
sudo apt update -y
sudo apt upgrade -y
sudo apt install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release \