- Programming using a series of transformations and aggregations, something I've been doing for years, is known as programming in the map/reduce style.
- The more abstract the type is, the greater its cardinality, and the smaller the set of operations it supports. So make use of universal quantifiers, particularly by implementing fully parametric functions. They guide you on how to implement their term-level definitions by narrowing down the number of possible implementations. In other words, the type system of Scala (or Haskell, for that matter) is not only great for capturing compile-time errors, but is also capable of leading you to the correct solution.
- You can encode union types by combining different Scala features such as type constructors, subtyping and implicits, and by taking advantage of the Curry-Howard Isomorphism and De Morgan's Laws for neg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{pkgs ? import <nixpkgs> { | |
inherit system; | |
}, system ? builtins.currentSystem}: | |
let | |
nodePackages = import ./default.nix { | |
inherit pkgs system; | |
}; | |
in | |
nodePackages // { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- a component | |
data FileSystem m = FileSystem { | |
exists :: Path -> m (Either Text Bool) | |
, readFile :: Path -> m (Either Text Text) | |
} | |
-- a constructor for a mock file system | |
newFileSystemWith :: (FileSystemValues -> FileSystemValues) -> FileSystem | |
newFileSystemWith f = FileSystem { | |
exists = \_ -> pure (_exists $ f fileSystemValues) |
The latest beta (3.5) includes separate color settings for light & dark mode. Toggling dark mode automatically switches colors.
Vist iTerm2 homepage or use brew install iterm2-beta
to download the beta. Thanks @stefanwascoding.
- Add
switch_automatic.py
to~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch
with:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Open profile dir - find in about:support or about:profiles | |
* Copy this file into your profile directory. | |
* Add changes to this file. Save file. | |
* Restart Firefox. Below overrides will be loaded. | |
* Close Firefox and open prefs.js to confirm changes merged there. | |
* NOTE: only non-default values will be saved to prefs.js | |
* | |
*/ |
aws s3api create-bucket --bucket website-bucket-name --region us-west-2 --acl public-read --create-bucket-configuration LocationConstraint=us-west- 2
aws s3 website s3://website-bucket-name/ --index-document index.html --error-document error.html
aws s3 sync projectfolder s3://website-bucket-name --acl public-read
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
{- stack | |
--resolver lts-6.27 | |
--install-ghc | |
runghc | |
--package containers | |
-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE DataKinds #-} |
- 13" Macbook Pro 3.3 GHz i7 (late 2016)
- Microsoft Surface Book (2016)
- Dell up3216q 32" monitor
NewerOlder