Skip to content

Instantly share code, notes, and snippets.

@Chimrod
Chimrod / wordle.ml
Created January 13, 2022 20:31
Wordle solver
type filter =
| Lenght of int
| Contain of char * int option
| NotContain of char * int option
(** Represent a decision rule *)
let format_filter : Format.formatter -> filter -> unit =
fun formatter f ->
match f with
| Lenght l -> Format.fprintf formatter "Doit etre de longueur %d" l
@Chimrod
Chimrod / firefoxhistory.sh
Created February 19, 2017 09:09
Rofi scripts
#!/bin/sh
if [ -z $1 ]; then
sqlite3 ~/.mozilla/firefox/${profile}/places.sqlite 'SELECT url from moz_places order by frecency desc' | grep -vE "google.com/search|google.com/url|duckduckgo"
else
i3-msg "exec firejail firefox --new-tab \"$*\"" > /dev/null
fi
@Chimrod
Chimrod / Pipe requests
Created February 26, 2016 12:00
This code will create a request, and allow to reuse the same connexion for sending more data.
let pipe_request
?socket
?headers ?(https=false) ?port ~content ?content_length
~http_method ~host ~inet_addr ~uri () =
let port = match port with
| None -> if https then 443 else 80
| Some p -> p
in
let sockaddr = Unix.ADDR_INET (inet_addr, port) in