Skip to content

Instantly share code, notes, and snippets.

@nniesen
nniesen / build.gradle
Last active April 25, 2024 16:14
Gradle copy libraries from configuration dependencies
// Example of extracting a dependency (e.g., jar, dll, so, etc...) from a configurations dependencies.
// Useful for running things locally (cli, db driver, etc) and need easy way to extract resolved version used by project.
repositories {
mavenCentral()
}
configurations {
nativeLibraries { transitive = false }
}
@nniesen
nniesen / AssertEqualsHashCode.java
Last active February 25, 2022 19:08
Assertion method for validating equals/HashCode implementations
package org.test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
public class AssertEqualsHashCode {
/**
* Assert that the equals method is reflexive, symmetric, transitive, consistent, and should return a false if the reference
* argument is null and asserts that the hashCode method is consistent with equals (i.e., if objects are equal their hash
@nniesen
nniesen / notes.md
Last active June 8, 2020 14:28
Random Notes
javascript:(function(){
  //Statements returning a non-undefined type, e.g. assignments
  return null;
})();

Streams

@nniesen
nniesen / boxstarter.ps1
Last active February 21, 2019 03:02 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box. See also https://blog.jessfraz.com/post/windows-for-linux-nerds/
# Description: Boxstarter Script
# Author: Jess Frazelle <[email protected]>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt: