Skip to content

Instantly share code, notes, and snippets.

🕶
snorting lines of code in Miami

Danilo Alonso damusix

View GitHub Profile
@damusix
damusix / npm-bump-version
Created Sep 24, 2018
Bumps minor version of a package.json in current directory
View npm-bump-version
#!/usr/bin/env node
const fs = require('fs');
const pkgPath = process.cwd() + '/package.json';
const pkg = require(pkgPath);
let version = pkg.version
const split = version.split('.');
View profile.zsh
# Shorthand python env
alias pyenv='. venv/bin/activate'
# Manually set env
setenv() {
[[ -f .env ]] \
&& echo "Exporting variables in '.env'..." \
&& export $(cat .env | grep -v '^\#' | xargs);
}
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 Mar 26, 2019
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....

View easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
You can’t perform that action at this time.