sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo ip link add link eno1 name eno1.10 type vlan id 10
sudo ip addr add 10.10.10.15/24 dev eno1.10
sudo ip link set dev eno1.10 up
FROM openjdk:8-jre | |
# Install stuff and prep the container | |
RUN apt-get update && apt install apt-utils --yes | |
RUN apt-get upgrade --yes --allow-remove-essential | |
RUN apt-get clean | |
RUN rm -rf /var/lib/apt/lists/* | |
# The server will be installed here | |
RUN mkdir -p /usrc/src/server/world |
// TODO study this thing | |
// https://stackoverflow.com/questions/54954091/how-to-use-callback-with-usestate-hook-in-react | |
function useSearchFilterCallback(initialState) { | |
const [state, setState] = useState(initialState); | |
const cbRef = useRef(null); // mutable ref to store current callback | |
const setStateCallback = (state, cb) => { | |
cbRef.current = cb; // store passed callback to ref | |
setState(state); | |
}; |
<% Object.entries(record).forEach(([key, val]) => { %> | |
<li class="<%= key %>" id="<%= val %>"><strong><%= key %></strong>: <%= val %></li> | |
<% }); %> |
const a = 9999 | |
const b = 100 | |
const arr = [9999,100] | |
// sort function | |
const res = (a, b) => {return a-b} | |
// "sort" 2 numbers on their own returns the result from the subtraction | |
console.log(res(a,b)) |
app.use((req, res, next) => { | |
debug("running cors"); | |
res.header( | |
"Access-Control-Allow-Headers", | |
"Origin, X-Requested-With, COntent-Type, Accept, Authorization" | |
); | |
// Or drop a tactical nuke with | |
// res.header("Access-Control-Allow-Headers", "*"); | |
if (req.method === "Options") { | |
res.header( |
const fs = require("fs"); | |
const fetch = require("node-fetch"); | |
const debug = require("debug")("staticFolio:fetch-content"); | |
const chalk = require("chalk"); | |
const mkdirp = require("mkdirp"); | |
const path = require("path"); | |
const dotenv = require("dotenv").config(); | |
const downloadMarkdown = async (url) => { | |
url = decodeURI(url); |
// __ __ __ __ ___ ____ ____ | |
// \ \/ /___ __ __/ /___ __/ /_ ___ / | / __ \/ _/ | |
// \ / __ \/ / / / __/ / / / __ \/ _ \ / /| | / /_/ // / | |
// / / /_/ / /_/ / /_/ /_/ / /_/ / __/ / ___ |/ ____// / | |
// /_/\____/\__,_/\__/\__,_/_.___/\___/ /_/ |_/_/ /___/ | |
// Extract {title, channelId, publishedAt} from an array of youtube links | |
// Make sure to use an API key below | |
// | |
// A good way i found of getting lists of youtube urls is to use Link Gopher. | |
// Though the results do require some minimal filtering to get only youtube watch URLs |
<style> | |
body { | |
background: #121212 !important; | |
color: #dedede !important; | |
font-size: 1.25em; | |
} | |
a, a:visited { | |
color: #dedede; | |
} | |
</style> |