-
update your /etc/nixos/configuration.nix
nix.trustedBinaryCaches = [ "https://hydra.nixos.org/" ];
-
nixos-rebuild (updates /etc/nix/nix.conf)
nixos-rebuild switch
-
install ghc/ghcjs/cabal-install
This file contains hidden or 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
| ;; 1. place this in ~/.emacs.d/private/intero/packages.el | |
| ;; 2. add intero, syntax-checking and auto-completion to your | |
| ;; ~/.spacemacs layer configuration & remove the haskell layer | |
| ;; if you were using that before | |
| ;; 3. make sure you have stack installed http://haskellstack.org | |
| ;; 4. fire up emacs & open up a stack project's source files |
This file contains hidden or 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
| import qualified Data.Char as C | |
| import qualified Data.Set as S | |
| main :: IO () | |
| main = do | |
| let alpha = ['A' .. 'Z'] | |
| leetRegionNum = "IEAO" | |
| oneByOnes = | |
| [[a, n, b] | a <- "KNW" | |
| , n <- leetRegionNum |
This file contains hidden or 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
| function stack-docset | |
| { | |
| # NOTE: This function assumes you already ran `stack build --haddock` | |
| HC_PKG=ghc-pkg | |
| if [ -z $(stack path|grep ghc-package-path|grep -v ghcjs) ]; then HC_PKG=ghcjs-pkg; fi | |
| DOCSET=$(basename $PWD).docset | |
| rm -rf $DOCSET || true | |
| stack build --haddock | |
| stack exec -- haddocset --hc-pkg=$HC_PKG -t $DOCSET create | |
| stack exec -- haddocset --hc-pkg=$HC_PKG -t $DOCSET add $(stack path --local-pkg-db)/*.conf |
This file contains hidden or 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
| -- .... regular ghcjs & ghcjs-jquery imports | |
| foreign import javascript unsafe | |
| "$.jqplot($1, [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]])" | |
| js_jqplot :: JSString -> IO () | |
| -- .... then in the code to render the page | |
| JQ.ready (js_jqplot "mychart") |
This file contains hidden or 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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # install: | |
| # `vagrant plugin install vagrant-aws` | |
| # `vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box` | |
| # config: | |
| # `export AWS_ACCESS_KEY_ID='...'` | |
| # `export AWS_SECRET_ACCESS_KEY='...'` | |
| # `export AWS_REGION='us-west-2'` |
This file contains hidden or 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
| data Person = Person { _name :: String } | |
| data Status a b = New b | Old a b | |
| deriving (Functor,Foldable,Traversable) | |
| type PersonWithStatus = Status Int Person | |
| sumNewFolks :: [PersonWithStatus] -> Int | |
| sumNewFolks = foldr go 0 | |
| where go (New _) b = b + 1 |
This file contains hidden or 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
| tim@kaku:~/src/ps/purescript-aws% rm -rf output | |
| tim@kaku:~/src/ps/purescript-aws% pulp test | |
| * Building project in /home/tim/src/ps/purescript-aws | |
| * Build successful. Running tests... | |
| (+) should add two numbers and give their sum | |
| 100/100 test(s) passed. | |
| * Tests OK. | |
| tim@kaku:~/src/ps/purescript-aws% pulp build | |
| * Building project in /home/tim/src/ps/purescript-aws | |
| Reading ./output/Prelude/externs.purs |
This file contains hidden or 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
| --- | |
| - connection: local | |
| hosts: 127.0.0.1 | |
| tasks: | |
| - local_action: | |
| description: Kubernetes Security Group | |
| module: ec2_group | |
| name: kubernetes | |
| region: '{{ aws.region }}' | |
| rules: |
This file contains hidden or 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
| { | |
| "AWSTemplateFormatVersion": "2010-09-09", | |
| "Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/", | |
| "Mappings": { | |
| "RegionMap": { | |
| "ap-northeast-1": { | |
| "AMI": "ami-f9b08ff8" | |
| }, | |
| "ap-southeast-1": { | |
| "AMI": "ami-c24f6c90" |