Skip to content

Instantly share code, notes, and snippets.

View fbanados's full-sized avatar

Felipe Bañados fbanados

View GitHub Profile
@fbanados
fbanados / GIF-Screencast-OSX.md
Created September 1, 2022 20:49 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

Require Import Coq.NArith.NArith.
Theorem add_1_r : forall p, (p + 1)%positive = Pos.succ p.
Proof.
induction p; simpl; eauto.
Qed.
Theorem add_carry_spec : forall p q, Pos.add_carry p q = Pos.succ (p + q).
Proof.
induction p; induction q; simpl; eauto.
@fbanados
fbanados / AOC_Squeak.md
Last active December 4, 2020 23:50
Advent Of Code 2020

The --- separator is not squeak syntax, but is presented to distinguish IDE("Browser") code from REPL content ("Workspace").

#lang slideshow
(require slideshow/play)
(provide timer-slide)
(module stopwatch racket
(provide (all-defined-out))
(define time? number?)
(define (seconds n) n)
@fbanados
fbanados / gist:d6e0134ff226abe71984a2221bbc7234
Created May 23, 2017 01:18
F#'s pipe operator for racket.
(define pipe
; Inspired on F#'s Forward pipe operator (|>)
(lambda args
(let ((v (car args))
(functions (cdr args)))
(foldl (λ (f v) (f v)) v functions))))
(test (pipe 1
add1
@fbanados
fbanados / gist:9921888
Created April 1, 2014 20:00
Installing ncurses on mac os x
brew install ncurses
gem install ncursesw -- --with-opt-dir=/usr/local/opt/ncurses
@fbanados
fbanados / gist:2657106
Created May 11, 2012 02:24
Auxiliar 7
#lang racket
;P1 No. Al evaluar, el nombre 'fibs en la llamada recursiva no se encontrará en el ambiente.
;P3:
;pow no es recursiva por la cola
(define (pow base exp)
(if (= exp 0)
1
@fbanados
fbanados / gist:2429315
Created April 20, 2012 14:58
Laziness en #lang plazy
#lang plazy
(define (my-if p t f)
(if p t f))
(define (infiniteloop x)
(infiniteloop x))
;al contrario de #lang racket, aquí esta función sí funciona correctamente.
(my-if #f (infiniteloop 0) 123)
@fbanados
fbanados / gist:2429272
Created April 20, 2012 14:53
Laziness en #lang racket
#lang racket
(define (my-if pred true false)
(if
(pred)
(true)
(false)))
;(define (infiniteloop x)
; (infiniteloop x))
@fbanados
fbanados / gist:2205744
Created March 26, 2012 15:09
Clase Substitución CC4101
#lang plai
#|
<WAE> ::= <num>
| {+ <WAE> <WAE>}
| {- <WAE> <WAE>}
| {with {<id> <WAE>} <WAE>}
| <id>
|#
(define-type WAE