Skip to content

Instantly share code, notes, and snippets.

View smatting's full-sized avatar

Stefan Matting smatting

View GitHub Profile
import httpx
FOO_URL = "https://google.com"
BAR_URL = "https://google.com"
def variant_shared_connection():
"""Reuse a single HTTP/2 connection for both host‑names."""
with httpx.Client(http2=True, timeout=10.0) as client:
resp_foo = client.get(FOO_URL)
import requests
SMALLSTEP_URL = "https://google.com"
KEYCLOAK_URL = "https://google.com"
def variant_shared_connection():
"""
Uses a single HTTP connection (session) for both requests.
"""
with requests.Session() as session:
Testing: /home/stefan/repos/neogit/tests/specs/neogit/popups/remote_spec.lua
Fail || remote popup can add remote
...enary.nvim/start/plenary.nvim/lua/plenary/async/util.lua:37: Blocking on future timed out or was interrupted.
./tests/util/git_harness.lua:69: ...n/repos/neogit/tests/specs/neogit/popups/remote_spec.lua:38: Expected objects to be the same.
Passed in:
(table: 0x7f5d7833f410) {
[1] = 'foo'
[2] = 'origin' }
Expected:
(table: 0x7f5d78339958) {
;; ((haskell-mode
;; (haskell-completion-backend . lsp)))
((haskell-mode . ((haskell-completion-backend . lsp)
(lsp-haskell-server-wrapper-function . (lambda (argv)
(append
(append (list "nix-shell" "-I" "." "--command" )
(list (mapconcat 'identity argv " "))
)
(list (concat (lsp-haskell--get-root) "/shell.nix"))
@smatting
smatting / dd-questions.md
Last active December 10, 2020 07:53
My questions for bolt12's Article on Denotational Semantics

Questions on https://github.com/bolt12/advent-of-haskell-dd

In the the section "Calculating an implementations":

  1. I'm not sure if I undertand the paragraph under the 'IsStack' class definition. If I try to use my own words I understood it as:

    You can get Functor implementation for s for free by using using two facts

    • the Homomorhism Property for mu: mu (fmap f s) = fmap f (mu s)
  • mu and mu' are inverse
{-# LANGUAGE DeriveGeneric #-}
-- {-# LANGUAGE FlexibleInstances #-}
-- {-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeOperators #-}
-- {-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE DefaultSignatures #-}
module Foo.Gen
where
newtype Choice l = Choice [(Float, l)]
newtype Deterministic a = Deterministic a
newtype ChoicePlus l = ChoicePlus [l]
class Laralable l a where
larala :: l -> Larala a
instance Laralable (Deterministic a) a
where
larala (Deterministic y) = return y
http://giphy.com/gifs/eye-26tPjoOKLVZVulIyY/fullscreen
http://giphy.com/gifs/woahdude-pupil-dilation-fthifQTEunRhC/fullscreen
http://giphy.com/gifs/xT77Y62zPz0SbpoRWM/fullscreen
http://giphy.com/gifs/3oxRmERnzko8Vo1duM/fullscreen
@smatting
smatting / dabblet.css
Created November 5, 2013 14:21
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@smatting
smatting / dabblet.css
Created November 5, 2013 11:34
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;