Skip to content

Instantly share code, notes, and snippets.

@thalesmg
thalesmg / teste.rkt
Created April 14, 2021 13:15
teste - delete me
#!/usr/bin/env racket
#lang scripty
#:dependencies '("base" "gregor-lib")
------------------------------------------
#lang typed/racket
(require/typed gregor
[#:opaque Date date?]
[date (-> Integer Integer Integer Date)])
@thalesmg
thalesmg / teste.hs
Created April 14, 2021 22:21
delete-me
{-# LANGUAGE OverloadedStrings #-}
module Main (blah) where
import qualified Data.Map as M
-- comentário
-- | haddock
data Bah m = MkBah { bah :: m Text
@thalesmg
thalesmg / tweag.io.user.css
Last active September 11, 2021 14:24
tweag.io dark theme
/* ==UserStyle==
@name www.tweag.io - 4/21/2021, 1:55:30 PM
@namespace github.com/thalesmg
@version 1.0.2
@description tweag.io dark, easier to read
@author thalesmg
@homepageURL https://gist.github.com/thalesmg/5f437d1f2d5df45b314cdedf146a4eb6#file-tweag-io-user-css
@updateURL https://gist.github.com/thalesmg/5f437d1f2d5df45b314cdedf146a4eb6/raw/tweag.io.user.css
==/UserStyle== */
@-moz-document domain("www.tweag.io") {
@thalesmg
thalesmg / shell.nix
Created July 21, 2021 20:18
elixir 1.12 e erlang 24 phoenix derivation
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
elixir_1_12 = { mkDerivation }:
mkDerivation rec {
version = "1.12.0";
sha256 = "00dc3szjn2k552jp7n1c98kjab6wac9d49v2gr43pf3yzcyv8mk1";
minimumOTPVersion = "24";
@thalesmg
thalesmg / river_crossing.v
Created September 8, 2021 14:35
Wolf, goat and cabbage puzzle in Coq
From Coq Require Import Lists.List. Import ListNotations.
Inductive Object :=
| Wolf
| Goat
| Cabbage.
Inductive Direction :=
| Right
| Left.
@thalesmg
thalesmg / river_crossing_auto.v
Created September 8, 2021 16:56
Wolf/goat/cabbage, or fox/chicken/grain, or river crossing puzzle in Coq, with automation
From Coq Require Import Lists.List. Import ListNotations.
Inductive Object :=
| Wolf
| Goat
| Cabbage.
Inductive Direction :=
| Right
| Left.
@thalesmg
thalesmg / loop.hs
Last active October 9, 2021 17:24
Using ContT to abort an "infinite" loop (based on "Adventures in Looping")
{-
An alternative to the (almost) never ending looping problem
using the @ContT@ monad transformer.
Based on the post by Drew Olson:
https://blog.drewolson.org/adventures-in-looping
-}
module Main where
@thalesmg
thalesmg / ssh_jump.py
Created December 2, 2021 18:21 — forked from tintoy/ssh_jump.py
SSH via jump-hosts using Paramiko
#!/usr/bin/env python3
import os
import paramiko
ssh_key_filename = os.getenv('HOME') + '/.ssh/id_rsa'
jumpbox_public_addr = '168.128.52.199'
jumpbox_private_addr = '10.0.5.10'
target_addr = '10.0.5.20'
@thalesmg
thalesmg / print.hrl
Created December 17, 2021 19:42 — forked from uldza/print.hrl
Erlang pretty printing with ANSI console colors
%%%-------------------------------------------------------------------
%%% @author Ahmad Baitalmal
%%% @copyright (C) 2017, Ahmad Baitalmal
%%% Permission is hereby granted, free of charge, to any person obtaining
%%% a copy of this software and associated documentation files
%%% (the “Software”), to deal in the Software without restriction,
%%% including without limitation the rights to use, copy, modify, merge,
%%% publish, distribute, sublicense, and/or sell copies of the Software,
%%% and to permit persons to whom the Software is furnished to do so,
%%% subject to the following conditions:
@thalesmg
thalesmg / PKGBUILD
Created February 24, 2022 21:12
alloy 6 aur patch for pkgbuild
# Alloy is developed by the Software Design Group at MIT.
# See https://sdg.csail.mit.edu/ or http://alloytools.org
# Maintainer: Markus Legner <[email protected]>
# Contributor: Ivan Kuraj <kaptoxic _at_ yahoo _dot_ com >
# Contributor: Rodney Price <[email protected]>
pkgname="alloy"
pkgver=6.0.0
pkgrel=1
pkgdesc="A lightweight modelling language for software design."