(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| -- 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%' |
| /* | |
| * 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%; | |
| } |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE DeriveDataTypeable #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| module Main where |
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:
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.
| # 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/ |
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| let | |
| nixpkgs = builtins.fetchTarball { | |
| url = "https://github.com/NixOS/nixpkgs/archive/c473cc8714710179df205b153f4e9fa007107ff9.tar.gz"; | |
| sha256 = "0q7rnlp1djxc9ikj89c0ifzihl4wfvri3q1bvi75d2wrz844b4lq"; | |
| }; | |
| config = { | |
| allowUnfree = true; | |
| }; |