Skip to content

Instantly share code, notes, and snippets.

View killshot13's full-sized avatar
Working remotely

Michael R. killshot13

Working remotely
View GitHub Profile
@killshot13
killshot13 / dummy-web-server.py
Last active February 6, 2022 12:31 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@killshot13
killshot13 / mongoObjIdGen.js
Last active January 12, 2022 06:35 — forked from solenoid/gist:1372386
MongoDB ObjectId generator script
const mongoObjectId = () => {
const timestamp = ((new Date().getTime() / 1000) | 0).toString(16)
return (
timestamp +
'xxxxxxxxxxxxxxxx'
.replace(/[x]/g, () => ((Math.random() * 16) | 0).toString(16))
.toLowerCase()
)
}