This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>My First Page</title> | |
<style> | |
body { min-height: 300vh;} | |
</style> | |
</head> | |
<body> | |
<header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rock, Paper, Scissors: Refactored with Functions | |
const initGame = () => { | |
const startGame = confirm("Shall we play rock, paper, or scissors?"); | |
startGame ? playGame() : alert("Ok, maybe next time."); | |
}; | |
// Game flow function | |
const playGame = () => { | |
while (true) { | |
let playerChoice = getPlayerChoice(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rock, Paper, Scissors: Refactored with While Loop and an Array | |
let playGame = confirm("Shall we play rock, paper, or scissors?"); | |
if (playGame) { | |
//play | |
while (playGame) { | |
const playerChoice = prompt("Please enter rock, paper, or scissors."); | |
if (playerChoice || playerChoice === "") { | |
const playerOne = playerChoice.trim().toLowerCase(); | |
if ( | |
playerOne === "rock" || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Your First Interactive Game | |
let playGame = confirm("Shall we play rock, paper, or scissors?"); | |
if (playGame) { | |
//play | |
let playerChoice = prompt("Please enter rock, paper, or scissors."); | |
if (playerChoice) { | |
let playerOne = playerChoice.trim().toLowerCase(); | |
if ( | |
playerOne === "rock" || | |
playerOne === "paper" || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const checkOnlineStatus = async () => { | |
try { | |
const online = await fetch("/1pixel.png"); | |
return online.status >= 200 && online.status < 300; // either true or false | |
} catch (err) { | |
return false; // definintely offline | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ********** Online / Offline Detection ********** */ | |
// Request a small image at an interval to determine status | |
// ** Get a 1x1 pixel image here: http://www.1x1px.me/ | |
// ** Use this code with an HTML element with id="status" | |
const checkOnlineStatus = async () => { | |
try { | |
const online = await fetch("/1pixel.png"); | |
return online.status >= 200 && online.status < 300; // either true or false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from bs4 import BeautifulSoup | |
import re | |
import pandas as pd | |
from tabulate import tabulate | |
import os | |
#launch url | |
url = "http://kanview.ks.gov/PayRates/PayRates_Agency.aspx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get current working directory | |
path = os.getcwd() | |
#open, write, and close the file | |
f = open(path + "\\fhsu_payroll_data.json","w") #FHSU | |
f.write(json_records) | |
f.close() |