Skip to content

Instantly share code, notes, and snippets.

@pbrisbin
pbrisbin / 1-output.txt
Last active January 23, 2018 18:48
LTS resolvers by GHC version
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
#!/usr/bin/env stack
{-
stack
--resolver lts-8.11
--install-ghc
runghc
--package aeson
--package filepath
--package http-client-tls
-- -Wall
#!/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
@pbrisbin
pbrisbin / 0-README.md
Last active March 26, 2017 22:01
Dagoba

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.

#!/bin/sh
amixer_() {
# Workaround
amixer -c 0 sset Headphone unmute
amixer -c 0 sset Speaker unmute
amixer "$@"
}
notify() {
@pbrisbin
pbrisbin / setup.md
Last active March 19, 2019 15:39
Arch installation notes
dependencies:
cache_directories:
- "~/.stack"
pre:
- wget https://github.com/commercialhaskell/stack/releases/download/v0.1.6.0/stack-0.1.6.0-linux-x86_64.tar.gz -O /tmp/stack.tar.gz
- tar xvzOf /tmp/stack.tar.gz stack-0.1.6.0-linux-x86_64/stack > /tmp/stack
- chmod +x /tmp/stack && sudo mv /tmp/stack /usr/bin/stack
override:
- stack setup
- stack build --dependencies-only --test

Containerized setup for downloading and sharing media.

Accounts

File System

Everything is root-owned and all services run as root. Anything other than

@pbrisbin
pbrisbin / details.md
Created March 11, 2015 17:35
Changing Markup/Styles in Carnival

Start with config/routes:

/sites SitesR GET POST

This means that the URL "/sites" is served via the SitesR route and it supports the GET and POST HTTP verbs.

This means the app must implement the Handler functions getSitesR and postSitesR somewhere.

@pbrisbin
pbrisbin / steps.md
Last active August 29, 2015 14:13
Testing halcyon-based local development

Go through the following from within the project root.

Project prep

This will:

  • Move ~/.ghc to avoid a known bug
  • Create a user-writable /app for building
  • Clone the halcyon build tool into /app
  • Remove any current build artifacts