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
Last active September 21, 2024 03:06
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@cryzed
cryzed / fix-infinality.md
Last active August 31, 2024 13:05
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 September 25, 2024 12:06
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 September 22, 2024 15:14
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) ->