Skip to content

Instantly share code, notes, and snippets.

@ericdoi
ericdoi / add_innext_mapping.sh
Last active October 5, 2018 09:28
Adds SDL controller mapping for the iNNext USB SNES controller to PICO-8
# Adds an SDL controller mapping for the iNNext USB SNES controller to PICO-8.
# Amazon Link: http://a.co/138eRWB
# E.g. can be used on PocketCHIP: wget -O add_innext_mapping.sh https://goo.gl/YosH3I; source add_innext_mapping.sh
echo "03000000790000001100000010010000,USB Gamepad,platform:Linux,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1," >> ~/.lexaloffle/pico-8/sdl_controllers.txt && echo "Added controller mapping!"
@ericdoi
ericdoi / slick_date_comparison.md
Last active October 13, 2016 10:09
Human Error with Slick Date Comparison

I was having trouble comparing dates in Scala Slick. It turned out to be human error.

There are a lot of posts on Stack Overflow about the difficulty of comparing date types (such as Joda.date.DateTime) in Scala Slick. However, I was using Java.sql.Date, which should be supported directly by Slick, so these discussions turned out to be red herrings.

The upshot is that there is a big difference between these two lines:

      query1.filter(test => test.startDate <= dt && test.endDate >= dt) // OK
 query1.filter(test =&gt; dt &gt;= test.startDate &amp;&amp; dt &lt;= test.endDate) // NOPE