I hereby claim:
- I am aaronlevin on github.
- I am aaronlevin (https://keybase.io/aaronlevin) on keybase.
- I have a public key whose fingerprint is 5589 E5EA F9E3 5955 A53D 0714 3ADD FECC C5D5 CD5E
To claim this, I am signing this object:
| object cps { | |
| /** | |
| * | |
| * The code below translates this blog post | |
| * http://blog.infinitenegativeutility.com/2016/8/resources--laziness--and-continuation-passing-style) | |
| * into scala, and uses laziness where appropriate to highlight the issue. | |
| * | |
| * I also include a type for IO. This is mainly illustrative, but also ensures | |
| * we "sequence" actions appropriately. Haskell's IO monad works in tandem with the |
| /** | |
| * Let's write a typeclass for a coproduct. The idea is we're given the name of a string, and we need to: | |
| * | |
| * 1. check that the string matches a value | |
| * 2. if the string matches a value, convert that string into some type and return it | |
| * 3. If the string doesn't match that value, try another alternative. | |
| * 4. If no alternatives match the value, return an error. | |
| * | |
| * The usecase is based on something I encountered in real life: we have to parse different kind of events in | |
| * my work's data pipeline, and the type of event (and subsequent parsing) depends on an "event type" string. I |
| /** | |
| * Working with shapeless' records is great. However, you are limited to using only String, Integer, Boolean, and | |
| * (package) Objects as singleton keys as the singleton machinery requires a stable point (I don't really fully | |
| * understand this part but I have an intuition). I had asked if there was a way to use a tuple or case-class | |
| * as a key in the shapeless gitter channel and no one really knew. | |
| * | |
| * I was reading the shapeless source for the Witness type and an idea came to mind: since we can use a package Object | |
| * as a key, what if that key extends a trait (an abstract class can work as well)? Can we use those objects as | |
| * singleton keys and access the values specified in the trait? | |
| * |
| # I wanted to use ensime with vim, which requires vim + python + some python packages (websocket_client + sexpdata) | |
| # unfortunately, nix would build vim with a python that didn't have access to my system libraries (for referential transperancy) | |
| # so I needed to provide to `vim_configurable.nix` the right python to use *and* enable python, lua, etc. support. | |
| # I also wanted to keep my `.vimrc` separate because some of the vim packages I use weren't available. | |
| # | |
| # install via: `nix-env -f '<nixpkgs>' -iA myCoolVim` or `nix-env -I nixpkgs=/path/to/your/nixpkgs -f '<nixpkgs>' -iA myCoolVim` | |
| # | |
| # out put of `vim --version` below. | |
| { |
| # Edit this configuration file to define what should be installed on | |
| # your system. Help is available in the configuration.nix(5) man page | |
| # and in the NixOS manual (accessible by running ‘nixos-help’). | |
| { config, pkgs, ... }: | |
| { | |
| imports = | |
| [ # Include the results of the hardware scan. | |
| ./hardware-configuration.nix |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| module HList where |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE PolyKinds #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE TypeOperators #-} |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE FunctionalDependencies #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE PolyKinds #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} |
| #!/usr/bin/env bash | |
| # modified from: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
| readonly db_host="xxxx" | |
| readonly db_user="xxxx" | |
| readonly db_pass='xxxx' | |
| readonly db_db="xxx" | |
| readonly aws_key="xxxx" | |
| readonly aws_secret="xxxxx" |
I hereby claim:
To claim this, I am signing this object: