Skip to content

Instantly share code, notes, and snippets.

View dhust's full-sized avatar

Dave Hust dhust

View GitHub Profile
Privacy Policy – New Window Pinned Tabs
Last updated: 11/22/2025
New Window Pinned Tabs is a Chrome extension that synchronizes pinned tabs across all Chrome windows. This policy explains what information the extension handles and how it is used.
1. Information collection
The extension does not collect or transmit any personally identifiable information (such as your name, email address, or account information) to the developer or to any third party.
@dhust
dhust / comments.py
Created July 24, 2018 15:56
Commenting
# This is a comment
<script id="jsbin-javascript">
var number = 5;
var text = '5';
console.log(number);
console.log(text);
console.log(number == text);
console.log(number === text);
@dhust
dhust / NotEncapsulation.java
Last active January 20, 2017 13:24
Encapsulation non-example. There's no setter for the age & the age is public, so anyone can change it to anything they want, even invalid values.
public class EncapsulationNonExample {
// variables
public int age;
// default constructor
public EncapsulationNonExample() {
}
@dhust
dhust / Encapsulation.java
Last active January 20, 2017 13:23
Encapsulation example. Need to make the age variable private so no one can directly change it, and the setAge() method is checking for a valid age.
public class EncapsulationExample {
// variables
private int age;
// default constructor
public EncapsulationExample() {
}
@dhust
dhust / Test.java
Last active January 19, 2017 20:35
This class is testing the Person super class and the Employee subclass.
public class Testing {
public static void main(String[] args) {
Person steve = new Person();
steve.info();
Person jessica = new Person("Jessica", 23, true);
jessica.info();
@dhust
dhust / Person.java
Created January 19, 2017 17:17
This is a Parent super class. It will be extended by an Employee class.
public class Person {
// Fields or Instance variables
private String name;
private int age;
private boolean isFemale;
// Default contructor
public Person () {
name = "Steve";
@dhust
dhust / Employee.java
Last active January 19, 2017 17:18
This is the Employee subclass. It will "extends" the Person super class.
public class Employee extends Person {
// default constructor
public Employee() {
}
// constructor with arguments
public Employee(String name, int age, boolean isFemale) {
super(name, age, isFemale);
public static void main(String[] args) {
// Variables
Scanner in = new Scanner(System.in);
int shapeLength;
String shape;
// Get length and shape from the user
System.out.print("Enter the length of the shape: ");
shapeLength = in.nextInt();
@dhust
dhust / Slider.java
Created March 3, 2016 14:39
Slider - event handling. One way to do it.
public class FXMLDocumentController implements Initializable {
// Needs to have @FXML otherwise you'll get errors and your program will not run
@FXML private Slider mySlider;
@Override
public void initialize(URL url, ResourceBundle rb) {
// You have three different variables available
// I used newValue which is the sliders value after it is moved