One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
var fs = require("fs") | |
var ssl_options = { | |
key: fs.readFileSync('privatekey.pem'), | |
cert: fs.readFileSync('certificate.pem') | |
}; | |
var port = process.env.PORT || 3000; | |
var express = require('express'); | |
var ejs = require('ejs'); | |
var passport = require('passport') |
Python syntax here : 2.7 - online REPL
Javascript ES6 via Babel transpilation - online REPL
import math
var morgan = require('morgan'); | |
morgan(function (tokens, req, res) { | |
return [ | |
'COBE custom format function', | |
tokens.method(req, res), | |
tokens.url(req, res), | |
tokens.status(req, res), | |
tokens.res(req, res, 'content-length'), '-', | |
tokens['response-time'](req, res), 'ms' |
Express makes it easy to nest routes in your routers. But I always had trouble accessing the request object's .params
when you had a long URI with multiple parameters and nested routes.
Let's say you're building routes for a website www.music.com
. Music is organized into albums with multiple tracks. Users can click to see a track list. Then they can select a single track and see a sub-page about that specific track.
At our application level, we could first have a Router to handle any requests to our albums.
const express = require('express');
win-bash
I have one computer and two different github accounts. One is for work, the other is for my personal stuff. I can't use the same ssh key twice, so I have to use different ssh key for each of my accounts. How do I do that? How do I switch between these ssh keys?
// Discord all events! | |
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!) | |
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client | |
// Learn from this, do not just copy it mofo! | |
// | |
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584 | |
// Last Updated -> Halloween 2022 | |
/* |
import React from 'react'; | |
const TestComponent = () => { | |
const [count, setCount] = React.useState(0); | |
return ( | |
<h3>{count}</h3> | |
<span> | |
<button id="count-up" type="button" onClick={() => setCount(count + 1)}>Count Up</button> | |
<button id="count-down" type="button" onClick={() => setCount(count - 1)}>Count Down</button> |