Skip to content

Instantly share code, notes, and snippets.

@mmmelo
mmmelo / node_nginx_ssl.md
Created April 4, 2020 02:37 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@mmmelo
mmmelo / Install the 'll' command
Last active November 29, 2018 17:01
Install the 'll' command
~/.bash_profile
alias ll='ls -lG'
@mmmelo
mmmelo / gist:601d9ab38d30cb238fb2bbbed928c131
Created October 25, 2017 14:50
Tournament Brackets CSS
https://codepen.io/aronduby/pen/qliuj?editors=1010
@mmmelo
mmmelo / iOS_ privacy-sensitive_ authorization
Created March 13, 2017 18:28
iOS privacy-sensitive Authorization
<!-- 🖼 Photo Library -->
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) photo use</string>
<!-- 📷 Camera -->
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) camera use</string>
<!-- 🎤 Microphone -->
<key>NSMicrophoneUsageDescription</key>
@mmmelo
mmmelo / convert_timestamp_field.sql
Last active February 9, 2017 21:47
Convert timestamp field
Select FROM_UNIXTIME(date)
@mmmelo
mmmelo / Volley-CircularNetworkImageView
Created February 6, 2017 18:51
Volley - CircularNetworkImageView - Android
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable;
@mmmelo
mmmelo / Empty Tables on mysql
Created December 29, 2016 16:46
Empty Tables on mysql
SELECT table_type,
table_name
FROM information_schema.tables
WHERE table_rows = 0;
$ SHOW VARIABLES LIKE '%max_allowed_packet%'
$ SET GLOBAL max_allowed_packet=1073741824
$ SET GLOBAL wait_timeout = 600
@mmmelo
mmmelo / reverse.js
Last active September 12, 2016 20:01
Angular filter reverse
app.filter('reverse', function() {
return function(items) {
if(!angular.isUndefined(items)){
return items.slice().reverse();
}else{
return items;
}
};
@mmmelo
mmmelo / gist:6ec0091cc25be26b2da5
Created March 1, 2016 17:30
Ionic - hardware back button on Android devices
$ionicPlatform.registerBackButtonAction(function () {
navigator.app.backHistory();
}, 100);