Skip to content

Instantly share code, notes, and snippets.

@fisherds
fisherds / index.html
Last active March 31, 2021 13:59
Given code for the Water Park Planner HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons">
<link rel="stylesheet" href="styles/bootstrap-material-design.min.css">
<link rel="stylesheet" href="styles/main.css">
<title>Water Park</title>
@fisherds
fisherds / test_drive_system.py
Last active April 22, 2025 15:46
Starting code for the SSH Python Tank test file
"""
Authors: Dave Fisher and PUT_YOUR_NAME_HERE.
"""
# TODO: 1. Put your name in the above.
import time
def main():
""" Calls the desired TEST functions. """
@fisherds
fisherds / manualImageViewLoad.swift
Last active April 22, 2022 15:10
Swift code to manual load an image view with a URL (spoiler alert we'll replace this with the Kingfisher pod)
func load(imageView: UIImageView, from url: String) {
if let imgUrl = URL(string: url) {
DispatchQueue.global().async { // Download in the background
do {
let data = try Data(contentsOf: imgUrl)
DispatchQueue.main.async { // Then update on main thread
imageView.image = UIImage(data: data)
}
} catch {
print("Error downloading image: \(error)")
@fisherds
fisherds / partOfMain.js
Created December 17, 2020 17:08
YahtzeeRound class
rhit.YahtzeeRound = class {
static NUM_DICE = 5;
static DieState = {
LOCKED: "L",
KEEP: "K",
REROLL: "R",
}
static RoundState = {
@fisherds
fisherds / LCD and Analog.ino
Created May 4, 2020 13:42
Dr. Fisher solution to the LCD and Analog lab
#include <LiquidCrystal.h>
/*** LCD ***/
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
#define LINE_1 0
#define LINE_2 1
#define PIN_PUSHBUTTON_GREEN 2
#define PIN_PUSHBUTTON_YELLOW 3
#define PIN_PUSHBUTTON_BLUE 4
@fisherds
fisherds / main.css
Created October 14, 2019 13:28
CSS for the Photo Bucket list page
#columns {
column-count: 3;
column-gap: 5px;
}
@media (min-width: 992px) {
#columns {
column-count: 4;
column-gap: 10px;
}
@fisherds
fisherds / index.html
Last active April 29, 2021 13:04
Example html for PhotoBucket
<div id="listPage" class="container page-container">
<div id="columns">
<div class="pin" id="7FjmtcF1qX4xRMWD2um3"><img
src="https://www.thelostogle.com/wp-content/uploads/2017/10/pumpkin-charlie-brown.jpg"
alt="Classic - Lorem ipsum dolor sit amet consectetur adipisicing elit. Nam culpa dolor iure? Officiis iste magnam voluptatum ut dolor voluptatibus provident explicabo odio deleniti, cumque nesciunt rerum necessitatibus, earum officia iure.">
<p class="caption">Classic - Lorem ipsum dolor sit amet consectetur adipisicing elit. Nam culpa dolor iure?
Officiis iste magnam voluptatum ut dolor voluptatibus provident explicabo odio deleniti, cumque nesciunt rerum
necessitatibus, earum officia iure.</p>
</div>
<div class="pin" id="kn7bhlA7w9NZuGxkx5sl"><img
@fisherds
fisherds / strings.xml
Created November 7, 2018 12:47
Strings used for the LoginActivity
<string name="prompt_email">Email</string>
<string name="prompt_password">Password</string>
<string name="action_sign_in">Sign in</string>
<string name="action_sign_up">Register New User</string>
<string name="invalid_email">This email address is invalid</string>
<string name="invalid_password">Password is too short</string>
@fisherds
fisherds / activity_login.xml
Last active November 7, 2018 12:46
Login Activity layout xml Android
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:orientation="vertical"
android:padding="30dp"
tools:context=".LoginActivity">
@fisherds
fisherds / NameAdapter_getRandomName.java
Created October 3, 2018 11:58
helper method to get a random name
private String getRandomName() {
String[] names = new String[] {
"David Beck", "David Berry", "Ian Berry", "Niall Broderick", "Conor Clancy", "Mary Cronin",
"Matthew Daniels", "Paul Delaney", "Debra Donovan", "Mark Egan", "Anna Hudakova",
"Brian Hyland", "Emer Kennedy Ozdemir", "Senan O'Callaghan", "Thomas O'Connor",
"Cahir O'Leary", "Deirdre O'Loughlin", "Adrian O'Sullivan", "Istvan Orosz", "Mark Quigley",
"Deirdre Shanahan", "Kevin St John", "Sergejs Sushinskis"
};
return names[mRandom.nextInt(names.length)];
}