Skip to content

Instantly share code, notes, and snippets.

View mullikine's full-sized avatar
🍓

Shane Mulligan mullikine

🍓
  • Dunedin, NZ
View GitHub Profile
@mullikine
mullikine / format.hs
Created May 5, 2019 06:37 — forked from Mozk0/format.hs
統合TVのネタバレスーパーを生成する。
import System.Environment (getArgs)
import Control.Monad (mapM_)
import Data.Functor ((<$>))
import Data.String.Utils (replace) -- missingH
import System.IO.UTF8 (putStrLn, readFile) -- utf8-string
import Prelude hiding (putStrLn, readFile)
main :: IO ()
main = main' =<< getArgs
@mullikine
mullikine / rbtree.lisp
Created May 5, 2019 06:33 — forked from Mozk0/rbtree.lisp
Red Black Tree for Common Lisp.
;; The following implementation of rb-tree is based on http://www.cs.kent.ac.uk/people/staff/smk/redblack/.
(defun change-to-black (tree)
(pattern-match tree
((:pattern (_ . rest) :variable rest :ignore _) `(:B . ,rest))
(:otherwise nil)))
(defun rb-insert (tree obj cmp)
(change-to-black (rb-insert% tree obj cmp)))
@mullikine
mullikine / binary_tree_1.scm
Created April 27, 2019 01:36 — forked from zallarak/binary_tree_1.scm
Binary trees in Scheme
; sets as unordered lists:
; a set for now is defined as as being able
; to undergo the following operations
; 1) element-of-set? checks if x is in set
(define (element-of-set? x set)
(cond ((null? set) false)
((equal? x (car set)) true)
(else (element-of-set? x (cdr set)))))
@mullikine
mullikine / el7check.hs
Created April 25, 2019 11:50 — forked from juhp/el7check.hs
haskell turtle shell script to check NVRs of epel7 packages
{-# LANGUAGE OverloadedStrings #-}
import Turtle
import Data.Text (words)
rpmspecSrc qf spec = do
(_res, out) <- procStrict "rpmspec" ["-q", "--srpm", "--undefine=dist", "--qf", qf, spec] empty
return out
nvr = "%{name}-%{version}-%{release}"