Skip to content

Instantly share code, notes, and snippets.

View pedrominicz's full-sized avatar

Pedro Minicz pedrominicz

View GitHub Profile
@b-mehta
b-mehta / pedro.lean
Last active October 12, 2020 00:20
pedro.lean
import control.bifunctor
import data.multiset.basic
import tactic
example {α} {x : α} {xs : multiset α} : {x} ≤ x :: xs :=
begin
rw multiset.singleton_eq_singleton,
apply multiset.cons_le_cons,
apply zero_le,
end
@johnchandlerburnham
johnchandlerburnham / ATaxonomyOfSelfTypes.md
Last active May 2, 2024 16:33
A Taxonomy of Self Types

A Taxonomy of Self-Types

Part I: Introduction to Self-Types

Datatypes in the Formality programming language are built out of an unusual structure: the self-type. Roughly speaking, a self-type is a type that can depend or be a proposition on it's own value. For instance, the consider the 2 constructor datatype Bool:

@Nikolaj-K
Nikolaj-K / category_theory_literature.md
Last active June 11, 2024 20:49
Recomended reading for the undergrad category theorist
@pedrominicz
pedrominicz / Everything.md
Last active May 28, 2024 21:56
Every Gist I've written.

The originality of these Gists varies drastically. Most are inspired by the work of others, in that case, all merit goes to the original authors. I have linked everything used as reference material on the Gists themselves.

Haskell

#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include "x.h"
#include "datatypes.h"
@pedrominicz
pedrominicz / furigana.py
Last active November 14, 2020 02:42
Furigana!
#!/usr/bin/env python3
from fugashi import Tagger
import re
import sys
# Japanese card creation process
# - Word list on Google Keep
# - Find phrase and add to a temporary file
# - Create cards and add it to `Stage 0` deck
@pedrominicz
pedrominicz / .bashrc
Last active May 15, 2023 20:05
Minimal Bash config with infinite command history and better autocomplete settings.
#
# ~/.bashrc
#
# If not running interactively, don't do anything.
[[ $- != *i* ]] && return
shopt -s histappend
HISTSIZE=''
HISTFILESIZE=''
@pedrominicz
pedrominicz / init.vim
Last active December 21, 2022 00:42
Minimal Neovim config.
set mouse=
set nomodeline
set tabstop=2 shiftwidth=2 expandtab
" Show tabs.
set list listchars=tab:>\
set linebreak
set ignorecase wildignorecase
set undofile
set splitright
@yelouafi
yelouafi / algebraic-effects-series-1.md
Last active June 29, 2024 20:05
Operational Introduction to Algebraic Effects and Continuations

Algebraic Effects in JavaScript part 1 - continuations and control transfer

This is the first post of a series about Algebraic Effects and Handlers.

There are 2 ways to approach this topic:

  • Denotational: explain Algebraic Effects in terms of their meaning in mathematics/Category theory
  • Operational: explain the mechanic of Algebraic Effects by showing how they operate under a chosen runtime environment

Both approaches are valuables and give different insights on the topic. However, not everyone (including me), has the prerequisites to grasp the concepts of Category theory and Abstract Algebra. On the other hand, the operational approach is accessible to a much wider audience of programmers even if it doesn't provide the full picture.

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream