Skip to content

Instantly share code, notes, and snippets.

View Blaisorblade's full-sized avatar

Paolo G. Giarrusso Blaisorblade

View GitHub Profile
import cats._
// A pure functional, contravariant monoidal string builder
sealed trait SB[A] {
final def render(a: A): String = {
val sb = new StringBuilder
renderInternal(sb, a)
sb.toString
}
@Blaisorblade
Blaisorblade / oddity.txt
Created August 27, 2020 06:23 — forked from paulp/oddity.txt
Whitespace Oddity
WHITESPACE ODDITY
by Paul Phillips, in eternal admiration of David Bowie, RIP
Bound Ctrl to Major mode
Bound Ctrl to Major mode
Read inputrc and set extdebug on
Bound Ctrl to Major mode (Ten, Nine, Eight, Seven, Six)
Connecting readline, options on (Five, Four, Three)
Check the syntax, may terminfo be with you (Two, One, Exec)
@Blaisorblade
Blaisorblade / The Signs of Soundness
Created August 27, 2020 06:23 — forked from paulp/The Signs of Soundness
The Signs of Soundness
Hello scala, my old friend
I've come to take you home again
Because a feature slowly creeping
left me plagued with doubts and weeping
and the version that was tagged in the repo
just has to go
it lacks the signs of soundness
On sleepless nights I hacked alone
applying ant and other tools of stone
@Blaisorblade
Blaisorblade / crouton.init
Last active July 17, 2020 17:42 — forked from DennisLfromGA/crouton.init
An external control file for adjusting four parameters in 'crouton.conf' to invoke a crouton chroot.
##########################################################################
##* crouton.conf defaults are: ##
# DELAY=10 # delay desired number of seconds before starting ##
# CHROOT=xenial # enter desired chroot to start ##
# START_DE=startxfce4 # enter desired Desktop Envirnoment to use ##
# CHROOT_APP=none # enter desired chroot application to run ##
# XMETHOD=default # enter the desired XMETHOD (xorg,xephyr,xiwi) ##
# RUN_STATE=y # change to 'n' to disable running $CHROOT ##
##########################################################################
@Blaisorblade
Blaisorblade / crouton.conf
Last active July 17, 2020 17:42 — forked from DennisLfromGA/crouton.conf
A ChromeOS upstart script to kick-off a crouton chroot desktop environment.
# Copyright (c) 2016 The crouton Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
## Filename: /etc/init/crouton.conf
## NOTE: 'rootfs' verification needs to be removed.
## crouton chroot - Start session
##
## This will start a (crouton) chroot Desktop Environment session
@Blaisorblade
Blaisorblade / rw-rootfs
Last active July 17, 2020 17:13 — forked from DennisLfromGA/rw-rootfs
A script that asks to make the root filesystem read-writable for subsequent changes and additions by the user.
#!/bin/sh -e
##!! PLEASE USE THIS SCRIPT WITH CAUTION - AND AT YOUR OWN RISK !!##
##!! IT HAS BEEN KNOWN TO CAUSE RESETS AND WIPE DATA ON SOME CHROMEBOXES !!##
APPLICATION="${0##*/}"
ANSWER=''
SUDO=''
USAGE="
$APPLICATION [no options]
@Blaisorblade
Blaisorblade / ring3.v
Last active April 1, 2020 21:46 — forked from vlj/ring3.v
rom mathcomp Require Import ssreflect ssrnat eqtype ssrbool ssrnum ssralg.
Require Import Ring.
Import GRing.Theory.
Open Scope ring_scope.
Section foo.
Variable R: numFieldType.
Definition T:= R.
@Blaisorblade
Blaisorblade / ring2.v
Created April 1, 2020 21:45 — forked from vlj/ring2.v
From mathcomp Require Import ssreflect ssrnat eqtype ssrbool ssrnum ssralg.
Require Import Ring.
Open Scope ring_scope.
Import GRing.Theory.
Variable R: numFieldType.
Definition rt :
@Blaisorblade
Blaisorblade / ct.scala
Last active February 24, 2020 17:23 — forked from klauso/ct.scala
(Ported to Dotty 0.21.0-RC1)
//package test
import scala.language.higherKinds
object CT {
trait Category[Obj[_],C[_,_]] { // Obj is the value representation of objects, C the type representation of morphisms
def id[A:Obj]: C[A,A]
def compose[X:Obj,Y:Obj,Z:Obj](f: C[Y,Z], g: C[X,Y]): C[X,Z]
}
@Blaisorblade
Blaisorblade / Lib.hs
Last active April 13, 2019 11:27 — forked from mukeshtiwari/Lib.hs
{-# LANGUAGE CPP, MagicHash #-}
module Lib where
import qualified Prelude
#ifdef __GLASGOW_HASKELL__
import qualified GHC.Base
unsafeCoerce = GHC.Base.unsafeCoerce#