Skip to content

Instantly share code, notes, and snippets.

Avatar
🕶️
snorting lines of code in Miami

Danilo Alonso damusix

🕶️
snorting lines of code in Miami
View GitHub Profile
@damusix
damusix / setup.sh
Last active Mar 27, 2021
Setup a linux laptop
View setup.sh
cd /tmp
sudo apt update -y
sudo apt upgrade -y
sudo apt install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release \
@damusix
damusix / setup.sh
Created Jul 3, 2019
Setup new macbook
View setup.sh
#!/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 / index.html
Last active May 3, 2019
Riot 4 webpack config. Babel polyfill for axios support.
View index.html
<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 / no-stream-meiosis.js
Last active May 2, 2019
No-stream implementation of meiosis pattern http://meiosis.js.org
View no-stream-meiosis.js
const store = {
// Initial state
state: {
working: true,
items: [],
},
actions: (update) => ({
getThings: () => {
@damusix
damusix / browser-stream-meiosis.js
Last active May 2, 2019
Very inefficient and redundant implementation of meiosis pattern using browser's `ReadableStream` http://meiosis.js.org
View browser-stream-meiosis.js
const noop = () => {};
const store = {
// Initial state
state: {
working: true,
items: [],
},
actions: (update) => ({
@damusix
damusix / cd.zsh
Last active Feb 20, 2021
Zsh based dotenv + add local paths as bash programs
View cd.zsh
# 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 / keybase.md
Last active May 3, 2019
Contact me on keybase!
View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@damusix
damusix / app.js
Last active Dec 6, 2018
RiotJS Global Store
View app.js
// 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 / aws_iam_secret_to_smtp_password.md
Last active May 9, 2021
Convert AWS IAM credentials to AWS SMTP credentials
View aws_iam_secret_to_smtp_password.md

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....