Skip to content

Instantly share code, notes, and snippets.

@OElesin
OElesin / TikaParquetParser.scala
Created May 9, 2018 19:39
Apache Tika Parquet Parser in Scala. You can add this to your project to read parquet files with Apache Tika
import java.io.{File, FileOutputStream, IOException, InputStream}
import java.util
import scala.collection.JavaConverters._
import org.xml.sax.{ContentHandler, SAXException}
import org.apache.tika.metadata.Metadata
import org.apache.tika.metadata.HttpHeaders.CONTENT_TYPE
import org.apache.tika.mime.MediaType
import org.apache.tika.parser.{AbstractParser, ParseContext}
import org.apache.commons.io.IOUtils
@vik-y
vik-y / NOTES.md
Created December 5, 2017 23:46
Docker-compose cheat sheet
@mjackson
mjackson / color-conversion-algorithms.js
Last active November 6, 2024 18:45
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@NoobsArePeople2
NoobsArePeople2 / gist:5121597
Last active September 5, 2024 04:27
Configure media keys on a non-Apple keyboard to control Spotify via AppleScript and USB Overdrive on OSX.

Requirements

  1. USB Overdrive
  2. A non-Apple keyboard with media keys (or keys you want to make "media" keys). For reference, I'm using a Microsoft Sidewinder X4

Set Up

  1. Plug in your keyboard and install USB Overdrive.
  2. Open USB Overdrive. Click into the Settings tab.
  3. Click the dropdown and select "Any Keyboard, Any Application"