I hereby claim:
- I am futtetennista on github.
- I am futtetennista (https://keybase.io/futtetennista) on keybase.
- I have a public key ASB-391E1CLq7CqRsAvsqmW3Tnlm8PmcSh6_w4MaOZueego
To claim this, I am signing this object:
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # Handy script to make it easier to import books in different formats into Calibre using Add books > Add from folders and sub-folders. | |
| function main { | |
| local -r folder="${1?Missing directory}" | |
| if [ ! -d "$folder" ]; then |
| trait Semigroup[T]: | |
| def mappend(x: T, y: T): T | |
| trait Monoid[T] extends Semigroup[T]: | |
| def empty: T | |
| object Semigroup: | |
| given sumIntSemigroup: Semigroup[Int] with | |
| override def mappend(x: Int, y: Int): Int = x + y |
| #!/usr/bin/env bash | |
| set -euox pipefail | |
| # Go to https://read.amazon.com/notebook and export your highlights as JSON using https://readwise.io/bookcision | |
| # | |
| # Install http://ankiweb.net/ and the https://foosoft.net/projects/anki-connect/index.html extension. Create a simple front-only card in anki, e.g. | |
| # Card template: {{Front}} | |
| # Styling: | |
| # .card { |
| #!/usr/bin/env stack | |
| -- stack script --resolver lts-9.14 --package free | |
| {-# LANGUAGE GADTs, DeriveFunctor #-} | |
| type CartItem = | |
| String | |
| type CreditCard = | |
| String |
I hereby claim:
To claim this, I am signing this object:
In ghci:
| /* | |
| * Copyright (C) 2013 Google, 2014 Stefano Dacchille | |
| * | |
| * 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 | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| public class CustomUncaughtExceptionHandlerProxy implements Thread.UncaughtExceptionHandler { | |
| private static CustomUncaughtExceptionHandlerProxy proxy; | |
| private final boolean enabled; | |
| private Thread.UncaughtExceptionHandler customUncaughtExceptionHandler; | |
| private CustomUncaughtExceptionHandlerProxy(CustomApplication application) { | |
| enabled = !application.inDevMode(); |
| @Override | |
| public boolean onIgnitedLocationChanged(Location location) { | |
| return locationManager.onNewLocation(this, location, lastSearchedLocation); | |
| } |
| private class EndlessOnPageChangeListener implements OnPageChangeListener { | |
| private static final int NO_PAGE = -1; | |
| int loadingPage = NO_PAGE; | |
| @Override | |
| public void onPageSelected(int currentPage) { | |
| // we're not on the loading element | |
| if (loadingPage != currentPage) { | |
| loadingPage = NO_PAGE; | |
| currentAdapter.setLoadingData(false); |