Skip to content

Instantly share code, notes, and snippets.


dicioccio lucas lucasdicioccio

View GitHub Profile
lucasdicioccio /
Last active Sep 9, 2021
nautilus scripts for Ubuntu

convert a screencast

If you record screen with (ctrl+shift+alt+R) in Ubuntu, you'll get a webm file, GitHub wants mp4. So you need to convert from webm to mp4.

The ffmpeg command allows such a conversion. Ubuntu's file navigator allows to have some right-click scripts shortcuts.

To be dropped and chmod +x in something like ~/.local/share/nautilus/scripts/ffmpeg convert to mp4

lucasdicioccio /
Created Jun 5, 2021
a Haskell script to detect garbled files on a shitty SD

Compile then run

$ ghc --make -O2 suspicious.hs
$ find . -name "IMG_*" -exec './suspicious' '{}' \; > suspicious-list

Excerpt of the output in suspicious-list:

lucasdicioccio /
Created Feb 26, 2021
postgrest-table bookmarklet

Postgrest-Table bookmarklet turns you PostgREST endpoint in some default view to discover and browse tables.

The bookmarklet to save is:

lucasdicioccio / mzn.vim
Last active May 3, 2020
a VIM syntax highlight for MiniZinc
View mzn.vim
" Vim syntax file
" Language: MiniZinc
" Maintainer: Lucas DiCioccio
" Latest Revision: 02 May 2020
if exists("b:current_syntax")
" keywords
View workaround-warp
user@vm051:~/wai$ git diff
diff --git a/warp/Network/Wai/Handler/Warp/HTTP2/Receiver.hs b/warp/Network/Wai/Handler/Warp/HTTP2/Receiver.hs
index 3000baa..7bd8604 100644
--- a/warp/Network/Wai/Handler/Warp/HTTP2/Receiver.hs
+++ b/warp/Network/Wai/Handler/Warp/HTTP2/Receiver.hs
@@ -165,26 +165,29 @@ frameReceiver ctx mkreq recvN = loop 0 `E.catch` sendGoaway
| isResponse streamId -> return Nothing
| otherwise -> do
- when (ftyp `notElem` [FrameHeaders,FramePriority]) $
lucasdicioccio / freet.hs
Last active Apr 12, 2016
subtle free monads
View freet.hs
{-# LANGUAGE DeriveFunctor #-}
module Main where
import Control.Monad.IO.Class
import Control.Monad.State
import Control.Monad.Trans.Free
data MyFunctor next = PrimitiveA next | PrimitiveB next deriving Functor
type MyFreeT m = FreeT MyFunctor m
type Program = MyFreeT (StateT Int IO)
lucasdicioccio / GildedTulip.hs
Last active Mar 19, 2019
What an immutable GildedRose would look like
View GildedTulip.hs
-- An alternative GildedRose using an immutable approach.
-- Context on the GildedRose:
-- *
-- * my comment in the linked blog post
-- One could take this GildedTulip approach and encapsulate a similar "immutable API"
-- to re-create the "mutable API" of the GildedRose.
-- This example is written in Haskell. This example uses three notable features (available in other languages):
-- - pattern matching: a way to hide a lot of "if"