Skip to content

Instantly share code, notes, and snippets.

View Baccata's full-sized avatar

Olivier Mélois Baccata

View GitHub Profile
@Baccata
Baccata / Convert .mov or .MP4 to .gif.md
Created September 20, 2020 09:18 — forked from SheldonWangRJT/Convert .mov or .MP4 to .gif.md
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@Baccata
Baccata / JavaFuture.scala
Created July 5, 2018 15:24 — forked from Daenyth/JavaFuture.scala
Convert Java futures to cats-effect IO
package teikametrics
import cats.effect.{Sync, Timer}
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.blocking
import cats.syntax.all._
object JavaFuture {
// Alias for more friendly imports

Explaining Miles's Magic

Miles Sabin recently opened a pull request fixing the infamous SI-2712. First off, this is remarkable and, if merged, will make everyone's life enormously easier. This is a bug that a lot of people hit often without even realizing it, and they just assume that either they did something wrong or the compiler is broken in some weird way. It is especially common for users of scalaz or cats.

But that's not what I wanted to write about. What I want to write about is the exact semantics of Miles's fix, because it does impose some very specific assumptions about the way that type constructors work, and understanding those assumptions is the key to getting the most of it his fix.

For starters, here is the sort of thing that SI-2712 affects:

def foo[F[_], A](fa: F[A]): String = fa.toString
@Baccata
Baccata / meeting.md
Created June 26, 2017 12:04 — forked from qingwei91/meeting.md
about meeting

Fantastic meetings and where to find them

Anecdotally most people in software industry hates meetings, because meeting is a soul-sucking dementor. Jokes aside, I think it's fair to say that people feel meeting is taking too much time, and the process is often painful.

In this post, I'll try to provide a few rules of thumb that I believe can make meeting less painful and more efficient.

Rule 1: Always reiterate your goal before start

How many times you attend a meeting without a goal in mind?

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x