Skip to content

Instantly share code, notes, and snippets.

View kahwee's full-sized avatar
🎯
Focusing

KahWee Teng kahwee

🎯
Focusing
  • Uber Technologies
  • San Francisco, CA
View GitHub Profile
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@ankurk91
ankurk91 / install-node-js.sh
Last active April 10, 2024 13:53
Install node-js, npm and yarn on Ubuntu/Mac using nvm
#!/bin/sh
# Install node and npm via nvm - https://github.com/nvm-sh/nvm
# Run this script like - bash script-name.sh
# Define versions
INSTALL_NODE_VER=20
INSTALL_NVM_VER=0.39.7
@sebmarkbage
sebmarkbage / react-terminology.md
Last active January 9, 2023 22:47
React (Virtual) DOM Terminology
unless ARGV.size == 2
puts "USAGE: ruby draw_something.rb ACKRCKOOLCWZ 5"
exit 1
end
letters = ARGV[0].downcase.split(//).sort
length = ARGV[1].to_i
require 'open-uri'
uri = 'http://static.iminlikewithyou.com/drawsomething/wordlist.csv'
@xjamundx
xjamundx / uploadapp.js
Created January 18, 2012 04:45
file uploads with express and node.js
// middleware
app.use(express.bodyParser({ keepExtensions: true, uploadDir: __dirname + "/public/uploads" }))
// later
app.get('/photos', uploadFile, addPhoto)
// file is automatically saved to /public/uploads, let's just set
function uploadFile(req, res, next) {
if (req.files) {
req.body.url = "http://myawesomesite.com/" + req.files.file.path.split("/").slice(-2).join("/")
@omega
omega / server.js
Created July 7, 2011 11:59 — forked from mixonic/server.js
Node.js + Socket.io + Bash. A collaborative terminal for your browser - updated for socket.io 0.7
//
// This server will start a bash shell and expose it
// over socket.io to a browser. See ./term.html for the
// client side.
//
// You should probably:
//
// npm install socket.io
// curl -O https://github.com/LearnBoost/Socket.IO/raw/master/socket.io.min.js
//