Skip to content

Instantly share code, notes, and snippets.

@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active April 16, 2025 07:02
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

@johnotu
johnotu / navbar-collapse-with-dynamic-class.jsx
Last active October 19, 2020 19:11
Bootstrap Navbar-collapse with dynamic collapse class
<div class={`${isNavCollapsed ? 'collapse' : ''} navbar-collapse`} id="navbarsExample09">
<a className="nav-link text-info" href="/contact">Support</a>
<a className="nav-link text-info" href="/login">Login</a>
<a href="/request-demo" className="btn btn-sm btn-info nav-link text-white" >Request demo</a>
</div>
@johnotu
johnotu / TopNav.jsx
Created April 4, 2020 08:23
TopNav component
import React, { useState } from 'react';
import Logo from '../images/logo_512x512.png';
const TopNav = props => {
const [isNavCollapsed, setIsNavCollapsed] = useState(true);
const handleNavCollapse = () => setIsNavCollapsed(!isNavCollapsed);
return (
<nav class="navbar navbar-expand-lg navbar-light bg-light rounded">
@PhilippHomann
PhilippHomann / app.py
Last active August 7, 2024 07:36
FastAPI file upload with streaming_form_data to parse multipart/form-data
from fastapi import FastAPI, UploadFile, HTTPException
from starlette.requests import Request
from streaming_form_data import StreamingFormDataParser
from streaming_form_data.targets import FileTarget
from tempfile import NamedTemporaryFile
import os
import shutil
<?
# MIT license, do whatever you want with it
#
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
#
require_once(__DIR__.'/../vendor/autoload.php');
@DUOLabs333
DUOLabs333 / build.md
Last active July 14, 2023 09:53
Building `filestash` for ARM64

Building libresize and libtranscode: This must be done on a Debian stretch system or chroot. First, clone https://github.com/mickael-kerjean/filestash. cd filestash/server/plugin/plg_image_light/deps/ Copy ./create_libresize.sh from this gist over and run it Copy ./create_libtranscode.sh from this gist over and run it cd back into the root of filestash and run

mkdir -p ./dist/data/state/config
cp config/config.json ./dist/data/state/config/
@nimone
nimone / Carousel.jsx
Last active March 24, 2025 03:56
Build a carousel component like instagram purely in ReactJS and TailwindCSS