$ git fetch origin <sha>Make sure the staging area is how you want the commit to be
$ git write-tree| alias Counter r0 | |
| alias CurrentValue r1 | |
| alias KnownHighest r2 | |
| alias KnownHighestValue r3 | |
| alias Housing db | |
| s Housing Setting -1 | |
| reset: | |
| move Counter 0 |
| const http = require('http') | |
| const crypto = require('crypto') | |
| const server = http.createServer((req, res) => { | |
| console.log('got request', req.url) | |
| res.writeHead(200, { 'Content-Type': 'text/plain' }) | |
| res.end('okay') | |
| }) | |
| server.on('upgrade', function (req, socket) { |
| type URLSearchParamsInit = ConstructorParameters<typeof URLSearchParams>[0]; | |
| type ApiFormatMap = { | |
| arrayBuffer: ArrayBuffer; | |
| text: string; | |
| json: object; | |
| formData: FormData; | |
| blob: Blob; | |
| stream: ReadableStream<Uint8Array>; | |
| response: Response; | |
| }; |
| type Optional<T, K extends keyof T = keyof T> = Omit<T, K> & Partial<Pick<T, K>>; | |
| type AllOrNothing<T> = T | Partial<Record<keyof T, never>>; | |
| type OnlyOne<T> = { | |
| [K in keyof T]: ( | |
| Required<Pick<T, K>> & Partial<Record<Exclude<keyof T, K>, never>> | |
| ) | |
| }[keyof T]; | |
| type Test = { |
| const express = require("express"); | |
| const multer = require("multer"); | |
| const upload = multer({"dest": "./mult"}); | |
| const app = express(); | |
| app.get("/", indexHandler); | |
| app.post("/save", upload.single("fileField"), saveHandler); |
| var _db; | |
| module.exports = { | |
| connect: function ({host = "localhost", port = 27017, dbname = "exampleDb"} = {}) { | |
| return require("mongodb").MongoClient.connect(`mongodb://${host}:${port}/${dbname}`) | |
| .then(db => _db = db); | |
| }, | |
| collection: function (col_name) { | |
| if ( !_db ) { | |
| return null; |
| // imports | |
| const Express = require("express"); | |
| const bodyParser = require("body-parser"); | |
| // Some datastore to play with. | |
| const bookDb = initDb(); | |
| // Set up express app. | |
| const app = new Express(); |
| const Express = require("express"); | |
| const methodOverride = require("method-override"); | |
| const app = new Express(); | |
| const router = new Express.Router(); | |
| //app.use(methodOverride("_method", {"methods": ["POST", "GET"]})); // Works too. | |
| router.use(methodOverride("_method", {"methods": ["POST", "GET"]})); // on route so only the following use the method override. | |
| router.get("/:id", all("get")); |
| const Router = require("express").Router; | |
| ///........ | |
| const ensuredLoggedIn = require('connect-ensure-login').ensureLoggedIn(); | |
| var app = new Router(); | |
| app.get("/", ensuredLoggedIn, (req, res) => { | |
| // ............. | |
| }); |