Skip to content

Instantly share code, notes, and snippets.

View toanalien's full-sized avatar
🎯
Focusing

Thiên Toán toanalien

🎯
Focusing
View GitHub Profile
@ungoldman
ungoldman / dokku_setup.md
Last active November 28, 2023 12:35
Deploy your own PaaS: Setting up Dokku with DigitalOcean and Namecheap

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.


This write-up is several years out of date! You probably shouldn't use it.

@guifromrio
guifromrio / nodejs-ubuntu-bind-port-80.md
Last active January 10, 2024 22:47
Allow Node.js to bind to privileged ports without root access on Ubuntu

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command:

@facultymatt
facultymatt / roles_invesitgation.md
Last active April 16, 2024 09:31
Roles and permissions system for Nodejs
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh