Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE OverloadedStrings #-}
module Main where
import GHC.Unit.Database
import GHC.Plugins
import GHC
import Data.Version
import GHC.Unit.Env
import GHC.Driver.Monad
import qualified Data.Map as M
@Gabriella439
Gabriella439 / dhall-checklist.md
Created November 18, 2020 03:08
Dhall programming language checklist

Programming Language Checklist by Colin McMillen, Jason Reed, and Elly Fong-Jones, 2011-10-10.

You appear to be advocating a new:

  • functional
  • imperative
  • object-oriented
  • procedural
  • stack-based
@friedbrice
friedbrice / haskell-time.hs
Last active April 4, 2024 16:09
Haskell Time Crib Sheet
-- ghcid -c'stack repl --resolver nightly --package time' haskell-time.hs --allow-eval
----
-- # Haskell Time Crib Sheet
----
-- Excellent sources for this small guide include:
--
-- * https://two-wrongs.com/haskell-time-library-tutorial.html
-- * https://williamyaoh.com/posts/2019-09-16-time-cheatsheet.html
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution.md
Last active May 9, 2025 21:43
Fix DNS resolution in WSL2

Permanent WSL DNS Fix (WSL 2.2.1+)

If you're encountering ping github.com failing inside WSL with a Temporary failure in name resolution, you're not alone — this has been a long-standing issue, especially when using VPNs or corporate networks.

This issue is now fixed robustly with DNS tunneling, which preserves dynamic DNS behavior and avoids limitations like WSL’s former hard cap of 3 DNS servers in /etc/resolv.conf.

DNS tunneling is enabled by default in WSL version 2.2.1 and later, meaning that if you're still seeing DNS resolution issues, the first and most effective fix is simply to upgrade WSL. Upgrading WSL updates the WSL platform itself, but does not affect your installed Linux distributions, apps, or files.

To upgrade WSL, follow these steps,

@cryzed
cryzed / fix-infinality.md
Last active March 20, 2025 13:16
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@wojteklu
wojteklu / clean_code.md
Last active May 12, 2025 06:58
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@CMCDragonkai
CMCDragonkai / memory_layout.md
Last active April 7, 2025 13:55
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore
@milessabin
milessabin / gist:6da04d3ef340171ca2ca
Created June 9, 2014 21:26
Type safe record selection syntax for shapeless records.
scala> import shapeless._, record._, syntax.singleton._
import shapeless._
import record._
import syntax.singleton._
scala> val mary = ('name ->> "Mary" :: 'age ->> 23 :: HNil).record
mary: shapeless.syntax.DynamicRecordOps[shapeless.::[String with shapeless.record.KeyTag[Symbol with shapeless.tag.Tagged[String("name")],String],shapeless.::[Int with shapeless.record.KeyTag[Symbol with shapeless.tag.Tagged[String("age")],Int],shapeless.HNil]]] = DynamicRecordOps(Mary :: 23 :: HNil)
scala> mary.name
res2: String = Mary
@edwinb
edwinb / nestedrec.idr
Last active August 29, 2015 14:00
Nested record update syntax
record Person : Nat -> Type where
MkPerson : (name : String) ->
(age : Nat) ->
Person age
record Event : Type where
MkEvent : (name : String) -> (organiser : Person a) -> Event
record Meeting : Int -> Type where
MkMeeting : (event : Event) ->