Skip to content

Instantly share code, notes, and snippets.

@taranagaSan
taranagaSan / node_nginx_ssl.md
Created January 23, 2021 20:10 — 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

@taranagaSan
taranagaSan / index.html
Created April 26, 2020 11:50 — forked from shiawuen/index.html
Sample to upload file by chunk
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>test upload by chunk</title>
</head>
<body>
<input type="file" id="f" />
<script src="script.js"></script>
@taranagaSan
taranagaSan / download-file.js
Created April 19, 2020 20:38 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
$('.tabs-list li').click(function() {
var tabName = $(this).attr('show-tab');
$(this).addClass('active').siblings().removeClass('active');
$('.tabs-content .' + tabName).addClass('active').siblings().removeClass('active');
});
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Чекбокс совместимый</title>
<style>
body {
margin: 0;
padding: 25px;
font-family: sans-serif;