Skip to content

Instantly share code, notes, and snippets.

View jducoeur's full-sized avatar

Justin du Coeur, AKA Mark Waks jducoeur

View GitHub Profile

Recommendations for getting started on Category Theory, from emilypi, in NE Scala Slack (#category-theory), 3/14/20:

Right, so let's just go through the branches and name the suggestions:

Pure Theory

  • Categories in Context by Riehl (Mid-Advanced): this book is concise, formal, and modern. It has a slight bias towards categorical homotopy theory, but has the most correct and relatively complete approach to understanding universal properties that I've seen in any book. This approach is the key to understanding most of the theory. The exercises in this book are 👍
  • Category Theory by Awodey (Beginner-Mid): This one was mentioned. It is a straightforward, classical approach to category theory with a bias towards categorical logic. Exercises are 👋
  • Categories for the Working Mathematician by MacLane (Mid-Advanced): the standard. Read this to complete your understanding. I would recommend this book for understanding Limits + Colimits and CCC's before Riehl if its your first r

Rebase to Master: the formula appears to be:

Make sure that we’ve on the PR branch:

git branch -av

If not already done, make sure the branch is compiling and testing cleanly, and that everything is checked in.

Check whether we have an upstream set:

@jducoeur
jducoeur / EventController.scala
Last active August 20, 2017 19:52
Working Event Controller
package controllers
import scala.concurrent.Future
import javax.inject._
import play.api.libs.json._
import play.api.mvc._
import scala.concurrent.{ExecutionContext, Future}
@jducoeur
jducoeur / Filter.js
Created July 17, 2017 17:37
Filter code for IFTTT script to translate Dreamwidth RSS to Facebook
var initialHtml = Feed.newFeedItem.EntryContent;
var crlf = "<br>&nbsp;<br>";
var crlf2 = "<br>&nbsp;<br>&nbsp;<br>";
// These are the RegExp+replacement transformations we are going to do on the HTML:
var transforms = [
// A DW userhead:
["<span style='white-space: nowrap;'><a href='(?:.*?)'><img src='(?:.*?)' alt='(?:.*?)' width='17' height='17' style='(?:.*?)' /></a><a href='https://(?:.*?).dreamwidth.org/'><b>(.*?)</b></a></span>", "@$1"],
["<p>(.*?)</p>", '$1' + crlf],
['<a href="(.*?)">(.*?)</a>', "$2 ($1)"],
@jducoeur
jducoeur / slick-shutdown-error
Created June 30, 2017 20:36
An error I am getting when trying to do db.run()
I'm getting the following error when trying to do db.run() on a `+=` insert in Slick.
This is happening under play-slick.
It is the first database action, so something could be wrong with the connection, *but* play-slick-evolutions is working just fine. So I have reason to believe the credentials are right.
```
----> About to do Vector(insert into "email" ("logtime","reqtype","successful","dtlenderid","dtdealerid","dtappid","lenderdealerid","request","transrequest","response","transresponse","errors") values (?,?,?,?,?,?,?,?,?,?,?,?))
----> db.run got error java.lang.IllegalStateException: Cannot initialize ExecutionContext; AsyncExecutor already shut down
play.api.libs.Files$DefaultTemporaryFileCreator - deletePath: deleting = /tmp/playtemp8413301446117630367
@jducoeur
jducoeur / dw-to-fb.js
Last active April 14, 2017 19:45
Zapier JavaScript code for parsing Dreamwidth RSS into Facebook-friendly form
var initialHtml = inputData.postHtml;
// These are the RegExp+replacement transformations we are going to do on the HTML:
var transforms = [
// A DW userhead:
["<span style='white-space: nowrap;'><a href='(?:.*?)'><img src='(?:.*?)' alt='(?:.*?)' width='17' height='17' style='(?:.*?)' /></a><a href='https://(?:.*?).dreamwidth.org/'><b>(.*?)</b></a></span>", "@$1"],
["<p>(.*?)</p>", "$1"],
['<a href="(.*?)">(.*?)</a>', "$2 ($1)"],
['<em>(.*?)</em>', "*$1*"],
['<strong>(.*?)</strong>', "**$1**"],
sealed trait MyTrait
case class Impl1() extends MyTrait
case class Impl2() extends MyTrait
def recover1:PartialFunction[Any, Unit] = {
case s:String => println("It was a String")
case i:Int => println("It was an Int")
}
def recoverMyTrait:PartialFunction[MyTrait, Unit] = {
[info] Compiling 40 Scala sources to /home/jducoeur/GitHub/Querki/querki/scala/jvm/target/scala-2.11/classes...
[error] /home/jducoeur/GitHub/Querki/querki/scala/shared/src/main/scala/models/Wikitext.scala:5: object MainDecorator is not a member of package querki.qtext
[error] import querki.qtext.{MainDecorator, Transformer}
[error] ^
[error] /home/jducoeur/GitHub/Querki/querki/scala/shared/src/main/scala/models/Wikitext.scala:6: object html is not a member of package querki
[error] import querki.html.Html
[error] ^
[error] /home/jducoeur/GitHub/Querki/querki/scala/shared/src/main/scala/models/Wikitext.scala:10: object fleem is not a member of package querki
[error] import querki.fleem
[error] ^
jducoeur@querki-dev2:~/GitHub/Querki/querki/scala$ ls -R js
js:
src target
js/src:
main
js/src/main:
scala
jducoeur@querki-dev2:~/GitHub/Querki/querki/scala$ ls -R jvm
jvm:
src target
jvm/src:
main
jvm/src/main:
scala