Skip to content

Instantly share code, notes, and snippets.

Express Drills

The goal of this recurring exercise is to quickly scaffold a JavaScript server from memory without the aid of documentation or notes.

Exercise instructions

Regularly practice creating the following three types of express apps:

  • An express app that provides a basic web server using middleware to serve static content.
  • An express app that uses routing to return a response from a requested resource.
@belfortk
belfortk / quick_install_memcached_mac.sh
Created October 3, 2018 19:25 — forked from anthonywu/quick_install_memcached_mac.sh
Quick install memcached on Mac OS X
# install via Homebrew
brew install memcached
# optional: make memcached start along with the system
ln -sfv /usr/local/opt/memcached/*.plist ~/Library/LaunchAgents
# load memcached now for immediate use
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist
# check the process that just launched
@belfortk
belfortk / iterm2-solarized.md
Created May 29, 2019 15:48 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@belfortk
belfortk / index.js
Created April 8, 2020 21:10
Socket.io Portion of Babylon WebSocket demo
// socket.io listener
io.on('connection', (socket) => {
const id = clientCount;
addClient(currentConnectedClients, id)
// if there is already a model being shared, new connected clients will get it
if(currentFile){
socket.emit('file uploaded', currentFile);
}
@belfortk
belfortk / index.html
Created April 8, 2020 21:36
Client code for Babylon WebSocket Demo
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8"/>
<title>Babylon - Websocket Demo</title>
<!--- Link to the last version of BabylonJS --->
<script src="https://cdn.babylonjs.com/babylon.js"></script>
<!--- Link to the last version of BabylonJS loaders --->
<script src="https://cdn.babylonjs.com/loaders/babylonjs.loaders.min.js"></script>
<!--- Import Socket.IO --->