Skip to content

Instantly share code, notes, and snippets.

@randPharoah
randPharoah / webworldwind-example.html
Created August 11, 2025 01:17 — forked from emxsys/webworldwind-example.html
A complete 3D virtual globe example - HTML, JavaScript and CSS - using ESA-NASA Web WorldWind, Bootstrap and KnockoutJS featuring a 3D globe view, 2D map projections, markers and place name finder. Simply download and open this HTML file in your browser to run the app, or see http://worldwind.earth/sample-app.html for a preview and write-up.
<!DOCTYPE html>
<html lang="en">
<!--
A sample framework for the ESA-NASA WebWorldWind web applications.
Author: Bruce Schubert
License: MIT
See: https://worldwind.arc.nasa.gov/web/
-->
<head>
<meta charset="utf-8">
@randPharoah
randPharoah / JavaScript-Countdonw.html
Created November 6, 2024 12:55 — forked from geekboots-team/JavaScript-Countdonw.html
Countdown using JavaScript setInterval
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JavaScript Countdown</title>
<style>
body {
background-color: #383838;
@randPharoah
randPharoah / HelloServlet.java
Created December 11, 2023 01:18 — forked from viralpatel/HelloServlet.java
HTML5 Server-Sent Events + Java Servlet example
package net.viralpatel.servlets;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
// Get references to page elements
const passwordModal = document.querySelector('.modal');
const passwordInput = document.querySelector('.modal input');
const unlockBtn = document.querySelector('.modal button');
const notesSection = document.querySelector('.notes');
// Open password modal
function openPasswordModal() {
passwordModal.style.display = 'flex';
}
@randPharoah
randPharoah / README.md
Created July 14, 2023 20:27 — forked from chasingmaxwell/README.md
The Knight's tour problem in JavaScript.

Knight's Tour

This is an implementation of The Knight's Tour problem/solution in JavaScript.

To run:

node tour.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Screen recorder</title>
</head>
<body>
<button id="recording-toggle">Start recording</button>
<script defer>
@randPharoah
randPharoah / layout.htm
Created November 30, 2021 00:06 — forked from AdamAlinauskas/layout.htm
Web page layout using divs with a header, footer, right sidebar, left sidebar and an area for main content.
<html>
<head>
<style>
#header{
background-color: lightblue;
width:100%;
height:50px;
text-align: center;
}
@randPharoah
randPharoah / TrafficLights.java
Created August 1, 2021 23:14 — forked from simonprickett/TrafficLights.java
Raspberry Pi Traffic Lights example code for Java
import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.GpioPinDigitalOutput;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;
public class TrafficLights {
private static GpioController gpio = null;
private static GpioPinDigitalOutput red = null;
private static GpioPinDigitalOutput yellow = null;
@randPharoah
randPharoah / main.js
Created April 12, 2021 20:57 — forked from ayoisaiah/main.js
Pomodoro tutorial - Checkpoint 8
const timer = {
pomodoro: 25,
shortBreak: 5,
longBreak: 15,
longBreakInterval: 4,
sessions: 0,
};
let interval;
@randPharoah
randPharoah / DrawSineWave.html
Created March 26, 2021 18:49 — forked from gkhays/DrawSineWave.html
Oscillating sine wave, including the steps to figuring out how to plot a sine wave
<!DOCTYPE html>
<html>
<head>
<title>Sine Wave</title>
<script type="text/javascript">
function showAxes(ctx,axes) {
var width = ctx.canvas.width;
var height = ctx.canvas.height;
var xMin = 0;