Skip to content

Instantly share code, notes, and snippets.

@mkscrg
mkscrg / .gitignore
Last active August 7, 2018 17:31
gcloud app deploy fails with google.golang.org dependencies
.sdk/

Slack logs to Postgres

Export the Slack team's public logs. You'll get a directory with a users.json file and a directory for each channel e.g. wheelhouse/.

Use jq to pull the JSON objects out of the root array:

cat users.json | jq -c '.[]'
{
"brightray": {
"devtools": {
"preferences": {
"hideNetworkMessages": "true"
}
}
}
}
wspq-repro.cabal
.stack-work/
import ClassyPrelude
import Data.Proxy (Proxy (..))
import GHC.Exts (Any, Constraint)
import GHC.TypeLits
import Unsafe.Coerce (unsafeCoerce)
newtype TMap (map :: TMap_) = TMap (HashMap Text Any) -- daaanger zone
@mkscrg
mkscrg / Main.hs
Last active March 11, 2016 03:49
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Control.Concurrent
import Control.Monad
{-
ghc --make Main.hs
./Main
-}
.stack-work/
@mkscrg
mkscrg / Main.hs
Last active October 30, 2015 19:41
module Main where
import Conduit
import Control.Monad.Primitive
import Data.Sequence ((|>))
import qualified Data.Sequence as Seq
import qualified Data.Vector.Mutable as V
import Criterion.Main
@mkscrg
mkscrg / README.md
Last active August 29, 2015 14:24
PhantomJS + es5-shim + Immutable.js
$ npm install
$ npm start
@mkscrg
mkscrg / Deep.hs
Last active August 29, 2015 14:23
Aeson + REPL
{-# LANGUAGE OverloadedStrings #-}
module Deep where
import Control.Monad
import Data.Aeson
import Data.Aeson.Types
import Data.ByteString.Lazy
import Data.Text