Skip to content

Instantly share code, notes, and snippets.

@peterbean410
peterbean410 / SensitiveData.java
Created June 5, 2022 06:20 — forked from RogerRiggs/SensitiveData.java
Example Using java.lang.ref.Cleaner as a Replacement for Finalize and Testing of the cleanup.
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@peterbean410
peterbean410 / async.js
Last active October 4, 2022 10:41
How does async work in NodeJS
async function callme(message, level) {
console.log(message, "entering", level)
level--;
// let req = new XMLHttpRequest();
// req.open('GET', "https://thumbs.dreamstime.com/b/brown-dog-corso-corso-stands-field-green-grass-brown-dog-corso-cors-120197441.jpg");
// req.onload = function () {
// if (req.status == 200) {
// console.log(req.status, "Download ok");
// } else {