Skip to content

Instantly share code, notes, and snippets.

@joshden
joshden / .gitignore
Last active March 31, 2020 22:17
Nightwatch broken globals
/geckodriver.log
/node_modules/
/tests_output/
@joshden
joshden / PersonTest.java
Last active November 17, 2018 06:56
Simple example of unit test class for JUnit 4
package com.example;
import org.junit.Test;
import static org.junit.Assert.*;
public class PersonTest {
@Test
public void testGetDisplayName() {
Person person = new Person("Josh", "Hayden");
@joshden
joshden / Person.java
Last active January 15, 2017 03:53
Example demonstrating JUnit 5 and Java 8 date & Supplier with an immutable, testable class
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.function.Supplier;
class Person {
private final String givenName;
private final String surname;
private final LocalDate dateOfBirth;
private final Supplier<LocalDate> currentDateSupplier;
@joshden
joshden / pdf_to_png.txt
Created January 12, 2017 23:29
Convert 4:3 PDF to 16:9 PNG
convert -density 540 leader.pdf -gravity center -background black -extent 7680x4320 -resize 25% -quality 9 leader.png
#!/bin/bash
#Recover from an Audacity crash by reassembling the saved data files
if [ $# != 2 ]; then
echo "ERROR: Not enough arguments"
echo "$0 [SOURCE PATH] [DESTINATION]"
exit 1
fi