Skip to content

Instantly share code, notes, and snippets.

View runeksvendsen's full-sized avatar

Rune K. Svendsen runeksvendsen

View GitHub Profile
@Gabriella439
Gabriella439 / default.nix
Created January 7, 2022 16:14
Nix build of vscode with haskell-language-server
let
nixpkgs = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/c473cc8714710179df205b153f4e9fa007107ff9.tar.gz";
sha256 = "0q7rnlp1djxc9ikj89c0ifzihl4wfvri3q1bvi75d2wrz844b4lq";
};
config = {
allowUnfree = true;
};
@x1unix
x1unix / lenovo-legion-5-backlight-fix.md
Last active March 31, 2024 16:53
Lenovo Legion 5 Backlight Fix

Brief explanation

Linux exposes a special interface to control screen brightness via sysfs in /sys/class/backlight (source). The problem is that in Lenovo Legion 5 there are two modules registered to control screen brightness - AMDGPU and ideapad modules:

$ ls /sys/class/backlight
amdgpu_bl0
ideapad
@tfausak
tfausak / stack.yaml
Created December 31, 2020 18:56
GHC 9.0.1 RC1
# The GHC team announced the first release candidate for the 9.0.1 release of
# GHC: https://discourse.haskell.org/t/glasgow-haskell-compiler-9-0-1-rc1-now-available/1706
#
# This is an example `stack.yaml` file that you can use to try out the release
# candidate. Save this file in your current directory and run `stack setup`.
# After that you should be able to use Stack as normal, including
# `stack exec ghci` and `stack build`.
#
# If for whatever reason you don't want to use Stack, you can download the
# official release tarballs at: https://downloads.haskell.org/ghc/9.0.1-rc1/

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@chrisdone
chrisdone / hoogle.md
Last active September 6, 2022 20:33
stack hoogle

Introducing the stack hoogle feature!

With the release of hoogle5, we can now hoogle all local packages.

This let us implement stack hoogle, which is on the master branch of stack, but is not yet on a stack release. We'd like you to try it out before we do!

To upgrade to the latest stack from git, use:

{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes #-}
module Main where
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 22, 2024 23:19
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'