Skip to content

Instantly share code, notes, and snippets.

@spuklo
spuklo / build.gradle
Created May 10, 2019 05:07
Getting started build.gradle for Kotlin project
buildscript {
ext {
kotlin_version = "1.3.31"
}
repositories {
mavenCentral()
}
dependencies {
@spuklo
spuklo / duplicates.py
Last active November 18, 2019 08:56
Script that walks through directories and looks for duplicated files.
from os.path import getsize, exists, isdir, join
from os import walk, remove
from sys import exit
from hashlib import md5
from argparse import ArgumentParser
DEFAULT_EXTENSIONS = "jpg,jpeg,nef,raf,cr2,raw,dng,tif,tiff"
def md5sum_with_size(file_path):
@spuklo
spuklo / CaseInsensitiveSubstringMatcher.java
Created November 30, 2015 11:47
Case insensitive substring hamcrest matcher. I've found myself needing such matcher at least 3 times recently, so maybe someone else will also find it useful.
import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
public class CaseInsensitiveSubstringMatcher extends TypeSafeMatcher<String> {
private final String subString;
private CaseInsensitiveSubstringMatcher(final String subString) {

Keybase proof

I hereby claim:

  • I am spuklo on github.
  • I am spuklo (https://keybase.io/spuklo) on keybase.
  • I have a public key whose fingerprint is 66BA 9CE6 EE38 218C 9099 D566 1971 5BA8 D5D2 953D

To claim this, I am signing this object: