Skip to content

Instantly share code, notes, and snippets.

View ocharles's full-sized avatar
🥳

Ollie Charles ocharles

🥳
View GitHub Profile
@joepie91
joepie91 / no-your-cryptocurrency-cannot-work.md
Last active May 18, 2024 15:00
No, your cryptocurrency cannot work

No, your cryptocurrency cannot work

Whenever the topic of Bitcoin's energy usage comes up, there's always a flood of hastily-constructed comments by people claiming that their favourite cryptocurrency isn't like Bitcoin, that their favourite cryptocurrency is energy-efficient and scalable and whatnot.

They're wrong, and are quite possibly trying to scam you. Let's look at why.

What is a cryptocurrency anyway?

There are plenty of intricate and complex articles trying to convince you that cryptocurrencies are the future. They usually heavily use jargon and vague terms, make vague promises, and generally give you a sense that there must be something there, but you always come away from them more confused than you were before.

@adamgundry
adamgundry / GenericDiscrimination.hs
Created March 4, 2020 22:13
Being a horrible abuse of INCOHERENT to determine whether Generic instances exist
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
@artizirk
artizirk / debug.md
Last active April 19, 2024 18:05
Debug WireGuard Linux kernel module
@gelisam
gelisam / EIO.hs
Last active February 10, 2022 05:21
Keeping track of which exceptions have and haven't been handled
-- a continuation of https://gist.github.com/gelisam/137effb33d2777328d366dcb563d8d13
{-# LANGUAGE FlexibleContexts, FlexibleInstances, GeneralizedNewtypeDeriving, LambdaCase, MultiParamTypeClasses #-}
module EIO where
import Control.Monad
import Data.Void
import Test.DocTest
import qualified Control.Exception as E
@int-index
int-index / M.hs
Last active May 27, 2016 12:52
Monoid is a one object Category
{-# LANGUAGE NoImplicitPrelude, GADTs, DataKinds, PolyKinds, FlexibleInstances #-}
import Data.Monoid
import Control.Category
-- A monoid gives a rise to a single-object category.
newtype M m (a :: ()) (b :: ()) = M m
instance Monoid m => Category (M m) where
id = M mempty
@nkpart
nkpart / gist:cc852b43d948a33a04c8
Last active June 18, 2019 14:01
Using ghcid inside of emacs
Pieces you need:
* emacs
* ghcid
ghcid needs to know the height of the terminal, we'll set it explicitly
height = (window-height) - (scroll-margin) - 1
set this height as your term-buffer-maximum-size
@NathanHowell
NathanHowell / curry.hs
Created May 31, 2013 23:36
A proof-of-concept demonstrating the use of Z3 to solve Cabal version constraints for Haskell packages
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
@threedaymonk
threedaymonk / references.md
Last active December 15, 2015 13:09
Links for the references in Tim Williams's talk on Recursion Schemes by Example http://www.timphilipwilliams.com/slides.html
@mckamey
mckamey / bezier.js
Created September 25, 2012 16:35
JavaScript port of Webkit CSS cubic-bezier(p1x.p1y,p2x,p2y) and various approximations
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the