Skip to content

Instantly share code, notes, and snippets.

View relrod's full-sized avatar

Rick Elrod relrod

View GitHub Profile
-- This is really Idris code, but it will highlight reasonably as Haskell
module vectorTripleStuff
data Triple = VectorTriple Nat Nat Nat
instance Semigroup Triple where
(VectorTriple a b c) <+> (VectorTriple d e f) = VectorTriple (a + d) (b + e) (c + f)
instance VerifiedSemigroup Triple where
@relrod
relrod / .gitignore
Last active August 29, 2015 14:01
Haskell audio using Data.Binary.Put
dist
cabal-dev
*.o
*.hi
*.chi
*.chs.h
.virtualenv
.hsenv
.cabal-sandbox/
cabal.sandbox.config
@relrod
relrod / gist:64011ab63d47e1c5ad0e
Created May 25, 2014 06:19
How I installed Debian on a T2000
Installing OSes on Sunfire T2000
================================
This can boot from HTTP or TFTP.
- Console into LOM
sc> bootmode bootscript="setenv auto-boot? false"
sc> poweron
sc> console

xmonad (haskell)

ricky@monadic /tmp/xmonad-0.11$ cloc .
      23 text files.
      21 unique files.                              
       9 files ignored.

http://cloc.sourceforge.net v 1.62  T=0.05 s (288.2 files/s, 87083.7 lines/s)
-------------------------------------------------------------------------------
ricky@monadic /tmp$ diff -u ./usr/include/hamlib/rig.h /usr/include/hamlib/rig.h | colordiff
--- ./usr/include/hamlib/rig.h 2014-08-12 13:00:57.554398449 -0400
+++ /usr/include/hamlib/rig.h 2014-08-12 12:55:35.683637690 -0400
@@ -536,13 +536,13 @@
const char *tooltip; /*!< Hint on the parameter */
const char *dflt; /*!< Default value */
enum rig_conf_e type; /*!< Type of the parameter */
- union { /*!< */
- struct { /*!< */
+ union u { /*!< */
ricky@monadic /tmp/openssl (master)$ cloc .
2479 text files.
2333 unique files.
871 files ignored.
http://cloc.sourceforge.net v 1.62 T=6.24 s (257.4 files/s, 99546.8 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 974 36487 73400 266902
// ==UserScript==
// @name Disable Ctrl+s and Ctrl+t interceptions
// @description Stop websites from highjacking keyboard shortcuts
//
// @run-at document-start
// @include *
// @grant none
// ==/UserScript==
// This was taken from here: http://superuser.com/a/670040/307969 and modified slightly.
@relrod
relrod / gist:208b58ce10ff30ba6164
Created October 4, 2014 19:16
Scala is hilarious
ricky@t520 ~$ scala
Welcome to Scala version 2.11.2 (OpenJDK 64-Bit Server VM, Java 1.8.0_20).
Type in expressions to have them evaluated.
Type :help for more information.
scala> Array("foo","bar")(2)
<console>:8: error: type mismatch;
found : Int(2)
required: scala.reflect.ClassTag[String]
Array("foo","bar")(2)
@relrod
relrod / AlaCarte.hs
Last active August 29, 2015 14:07 — forked from puffnfresh/AlaCarte.hs
module AlaCarte where
-- Control.Monad.Free
data Free f a = Free (f (Free f a)) | Pure a
instance Functor f => Monad (Free f) where
Pure a >>= f = f a
Free r >>= f = Free (fmap (>>= f) r)
return = Pure
@relrod
relrod / keybase.md
Created October 15, 2014 03:15
keybase.md

Keybase proof

I hereby claim:

  • I am CodeBlock on github.
  • I am relrod (https://keybase.io/relrod) on keybase.
  • I have a public key whose fingerprint is 9739 5A0F BDC8 1D20 A137 CDCC 0027 10B0 DAD3 DF0E

To claim this, I am signing this object: