Skip to content

Instantly share code, notes, and snippets.

View mrBliss's full-sized avatar

Thomas Winant mrBliss

View GitHub Profile
@mrBliss
mrBliss / stack.yaml
Created January 23, 2020 16:28
Updating the dependency on ouroboros-network in cardano-byron-proxy
resolver: https://raw.githubusercontent.com/input-output-hk/cardano-prelude/00487726c4bc21b4744e59d913334ebfeac7d68e/snapshot.yaml
packages:
- .
extra-deps:
- git: https://github.com/input-output-hk/iohk-monitoring-framework
commit: 15e7df23462d4840d4ad04e8c33d6a65041c4857
subdirs:
While building this branch:
https://github.com/input-output-hk/cardano-node/pull/299
(-O nor -j don't seem to matter)
$ stack build --ghc-options="-O0"
ouroboros-network > configure
ouroboros-network > Configuring ouroboros-network-0.1.0.0...
ouroboros-network > build
ouroboros-network > Preprocessing library for ouroboros-network-0.1.0.0..
@mrBliss
mrBliss / SNat.hs
Created September 24, 2019 10:05
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
-- | Type-level index
data N = Z | S N
-- | Value-level type indexed by type-level index
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DictionaryApplications #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
(defun snapshot-timemachine--osx-timemachine-parse-date (date)
"Parse a DATE like \"2016-05-27-140240\" as a time object."
(let* ((two "\\([0-9][0-9]\\)")
(time-re
(format "\\([0-9]\\{4\\}\\)-%s-%s-%s%s%s" two two two two two)))
(cl-macrolet ((m (n) `(string-to-number (match-string ,n date))))
(string-match time-re date)
(encode-time (m 6) (m 5) (m 4) (m 3) (m 2) (m 1)))))
(defun snapshot-timemachine--osx-timemachine-parse-date (date)
"Parse a DATE like \"2016-05-27-140240\" as a time object."
(let* ((two "\\([0-9][0-9]\\)")
(time-re
(format "\\([0-9]\\{4\\}\\)-%s-%s-%s%s%s" two two two two two)))
(cl-macrolet ((m (n) `(string-to-number (match-string ,n date))))
(string-match time-re date)
(encode-time (m 6) (m 5) (m 4) (m 3) (m 2) (m 1)))))
;;; flatui-theme.el --- A color theme for Emacs based on flatuicolors.com
;; Copyright (C) 2014 John Louis Del Rosario
;; Author: John Louis Del Rosario <john2x@gmail.com>
;; URL: https://github.com/john2x/flatui-theme.el
;; Version: 0.2
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; # Try 1 - No refreshing
(run* [q]
(fresh [f f* f** α T1 T2]
;; Say we have a polymorphic function f of type ∀α.α → α
;; (in Haskell, this would be a -> a).
(== f [α :-> α])
;; Apply it on T1, an Int.
error: java.lang.VerifyError: class org.codehaus.jackson.smile.SmileParser overrides final method getBinaryValue.(Lorg/codehaus/jackson/Base64Variant;)[B (factory.clj:1)
;; Put one of the two in your .emacs file assuming you have SLIME
;; installed.
;; Lazy loading:
(eval-after-load "slime"
'(define-key slime-mode-map (kbd "C-j") 'slime-eval-print-last-expression))
;; Non-lazy loading:
(require 'slime)
(define-key slime-mode-map (kbd "C-j") 'slime-eval-print-last-expression)