Skip to content

Instantly share code, notes, and snippets.

View loxal's full-sized avatar
🧉
The "what" and "why" matter whereas "how" is just their side effect.

Alexander Orlov loxal

🧉
The "what" and "why" matter whereas "how" is just their side effect.
View GitHub Profile
@loxal
loxal / smoke-test-ui.main.kts
Created May 5, 2021 14:29
Testing web UI via HTML DOM
#!/usr/bin/env kotlin
/*
* Copyright 2021 Alexander Orlov <alexander.orlov@loxal.net>. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
https://loxal.net/gists-solution-toolbox.html
@loxal
loxal / InterviewQuestion.java
Last active July 21, 2016 11:36
Interview: Generics and Type Reification
import java.sql.SQLException;
public class Mocker<T extends Exception> {
private void pleaseThrow(final Exception e) throws T {
throw (T) e;
}
public static void main(String[] args) {
try {
new Mocker<RuntimeException>().pleaseThrow(new SQLException());