Skip to content

Instantly share code, notes, and snippets.

patrick brisbin pbrisbin

Block or report user

Report or block pbrisbin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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 Jan 22, 2019 — 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
View fnumerator.rb
#!/usr/bin/env ruby
class Yielder
attr_reader :element
def initialize
# #yield will block until some other thread calls #next
@blocked = true
# #next will block until some other thread calls #yield
@yielded = false
View 0-README.md

Attempting to port the examples in http://www.aosabook.org/en/500L/dagoba-an-in-memory-graph-database.html to Haskell

NOTE: This has been moved to a repo proper.

Notes

  1. If I were better at Lens, it would probably make this much shorter. Alas.

  2. The "Graph", once I was done implementing all the way to Example, only needed to be a map of { Id: Vertex a } (where a is whatever data you care about). So I ripped out the Arrays and simplified the pointers from the JavaScript version. A lack of mutability actually forced me to this (IMO better) direction, FWIW.

View handler.sh
#!/bin/sh
amixer_() {
# Workaround
amixer -c 0 sset Headphone unmute
amixer -c 0 sset Speaker unmute
amixer "$@"
}
notify() {
You can’t perform that action at this time.