Let's say you want to host domains first.com
and second.com
.
Create folders for their files:
#!/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=22 | |
INSTALL_NVM_VER=0.40.1 |
In React's terminology, there are five core types that are important to distinguish:
React Elements
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' |
// 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("/") |
// | |
// 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 | |
// |