Skip to content

Instantly share code, notes, and snippets.

View options.hs
-- Form 1
-----------------------------------------------------------------------------------------
data Job arg = Job
{ jobJid :: JobId
, jobJobtype :: String
, jobArgs :: NonEmpty arg
, jobRetry :: Maybe Int
, jobQueue :: Maybe Queue
, jobAt :: Maybe UTCTime
@pbrisbin
pbrisbin / broken-index.js
Created Apr 7, 2020
logdna-cloudwatch repro
View broken-index.js
// External Libraries
const agent = require("agentkeepalive");
const asyncRetry = require("async").retry;
const request = require("request");
const zlib = require("zlib");
// Constants
const MAX_LINE_LENGTH = parseInt(process.env.LOGDNA_MAX_LINE_LENGTH) || 32000;
const MAX_REQUEST_TIMEOUT_MS =
parseInt(process.env.LOGDNA_MAX_REQUEST_TIMEOUT) || 30000;
@pbrisbin
pbrisbin / gpg-extend-expiration.md
Created Mar 17, 2020
Extending the expiration of my Signing subkey(s)
View gpg-extend-expiration.md

Extending subkey expiration

  1. Mount master keys flashdrive

    truecrypt
    
  2. Extend expiry of all keys

View handler.sh
#!/bin/sh
amixer_() {
# Workaround
amixer -c 0 sset Headphone unmute
amixer -c 0 sset Speaker unmute
amixer "$@"
}
notify() {
View handler.sh
#!/bin/sh
amixer_() {
# Workaround
amixer -c 0 sset Headphone unmute
amixer -c 0 sset Speaker unmute
amixer "$@"
}
notify() {
@pbrisbin
pbrisbin / example.md
Last active Apr 23, 2020 — forked from ericclemmons/example.md
HTML5 <details> in GitHub
View example.md

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 <summary>Summary Goes Here</summary>
@pbrisbin
pbrisbin / a-persistent.hs
Last active Jul 3, 2018
Persistent problems in LTS-11.15+
View a-persistent.hs
#!/usr/bin/env stack
-- stack script --resolver lts-10.8
-- vim: ft=haskell
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
@pbrisbin
pbrisbin / semver-pvp.md
Created Feb 16, 2018
Versioning Haskell: Semver <> PVP
View semver-pvp.md

I personally prefer [Semver][]. I think it's reasonable, simple, and makes sense. But as a good Haskell citizen, I'd like to be [PVP][]-compliant as well. Here is a bit of a graphic showing how the two systems are almost the same:

PVP:            A . B     . C     . ...
Semver:             Major . Minor . Patch
                    ^       ^       ^
                    |       |       |
                    |       |       ` increment for other changes
                    |       |
                    |       ` increment on non-breaking change
@pbrisbin
pbrisbin / 1-output.txt
Last active Jan 23, 2018
LTS resolvers by GHC version
View 1-output.txt
GHC 7.8.3 (base-4.7.0.1): lts-0.0 -> lts-0.7
GHC 7.8.4 (base-4.7.0.2): lts-1.0 -> lts-2.22
GHC 7.10.2 (base-4.8.1.0): lts-3.0 -> lts-3.22
GHC 7.10.3 (base-4.8.2.0): lts-4.0 -> lts-6.35
GHC 8.0.1 (base-4.9.0.0): lts-7.0 -> lts-7.24
GHC 8.0.2 (base-4.9.1.0): lts-8.0 -> lts-9.21
GHC 8.2.2 (base-4.10.1.0): lts-10.0 -> lts-10.3
View rename-movies.hs
#!/usr/bin/env stack
{-
stack
--resolver lts-8.11
--install-ghc
runghc
--package aeson
--package filepath
--package http-client-tls
-- -Wall