Skip to content

Instantly share code, notes, and snippets.

View folsen's full-sized avatar

Fredrik Harrysson folsen

View GitHub Profile
# deploy.sh
#! /bin/bash
SHA1=$1
# Push image to ECR
$(aws ecr get-login --region <region>)
docker push <account-id>.dkr.ecr.<region>.amazonaws.com/<repo>:$SHA1
# Create new Elastic Beanstalk version
machine:
services:
- docker
dependencies:
cache_directories:
- "~/docker"
- "~/.cabal"
- "~/.local"
- "~/.stack"
CIUSER=ci
ACCOUNTID=<account-id>
# Create ECR repo
aws ecr create-repository <repo> --region <region>
# Create the CI user with appropricate permissions
aws iam create-user --user-name $CIUSER
aws iam attach-user-policy --user-name $CIUSER --policy-arn arn:aws:iam::aws:policy/AWSElasticBeanstalkFullAccess
aws iam attach-user-policy --user-name $CIUSER --policy-arn arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryFullAccess

Keybase proof

I hereby claim:

  • I am folsen on github.
  • I am folsen (https://keybase.io/folsen) on keybase.
  • I have a public key whose fingerprint is DC62 FEB0 EBA7 425C C5D3 7385 4846 3E0D F0B0 94AE

To claim this, I am signing this object:

Notes from DHH RailsConf Keynote 2015

monolith vs integrated system - i really hope integrated system doesn't catch on, sooo buzzwordy :P if you like monoliths you should just be proud of that and be able to defend it and say monolith

monoliths vs bad software - I totally agree that there's nothing inherently wrong in monoliths and the term of derision usually just means "this is bad software"

while talking about monoliths I'm really sad he didn't actually address the fact that 99% of Rails apps become unmanageable and unmaintainable after a year of development, yeah it's bad software, but why does almost all Rails software become bad and what can we do about it?

it's not going to become better by making 10 bad applications - the reality is that in most cases it does become better because now you have years worth of more knowledge of your domain and rewriting the software from scratch you bake all that knowledge in, you could've rewritten your mono

// This works:
let comma = satisfy(|c| c == ',');
let mut args = sep_by(word, satisfy(|c| c == ',')).skip(comma);
// But this doesn't
let comma = satisfy(|c| c == ',');
let mut args = sep_by(word, comma).skip(comma);
#![feature(phase)]
#[phase(plugin)]
extern crate regex_macros;
extern crate regex;
use std::io::Command;
use std::fmt;
struct Process {
pid : String,
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
import qualified Data.HashMap.Strict as HashMap
import Data.Data
import Data.HashMap.Strict (HashMap)
import qualified Data.Vector as Vector
import Data.Vector (Vector)
import Data.Generics.Uniplate.Data
import GHC.Generics
data TypeOne = TypeOne T.Text TypeTwo TypeThree
deriving (Show)
data TypeTwo = TypeTwo Double
deriving (Show)
data TypeThree = TypeThree Double
deriving (Show)
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.ByteString.Lazy.Char8 (pack)
import Web.Scotty as S
import Network.Wai.Middleware.RequestLogger
import Data.Aeson
import Data.Aeson.Types
import Control.Lens hiding ((.=), (??))