Skip to content

Instantly share code, notes, and snippets.

import scala.annotation.tailrec
object Solution {
def validUtf8(data: Array[Int]): Boolean = validUtf8(data.toList)
@tailrec
def validUtf8(data: List[Int]): Boolean = data match {
case Nil => true
case n1 :: ns if ASCII_SEQ(n1) => validUtf8(ns)
case n1 :: n2 :: ns if TWO_BYTE(n1, n2) => validUtf8(ns)
@er2
er2 / setup.md
Last active April 25, 2024 05:07
Linux setup

grub-btrfs + snapper or timeshift

  • fonts-noto unifont # fonts with lots of international and obscure unicode characters
  • ttf-inconsolata
  • fish
  • fish-pure-prompt
  • guake
    • gnome settings shortcut
  • bitwarden
  • yay
@teknikqa
teknikqa / lastfm_delete_loved.js
Created May 7, 2017 06:38
Bulk delete Last.FM scrobbles & loved tracks
// On the Last.FM website go to the page which lists the tracks that you have loved.
// Open Chrome DevTools (or Firefox or any modern browser that has a built in Javacript Console)
// and run the following command.
// This basically clicks on all the delete buttons on the page and reloads the page.
jQuery('.love-button--loved').each(function(_, b) {
b.click();
});
location.reload();