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
variable "aws_region" { | |
default = "eu-west-1" | |
} | |
variable "domain" { | |
default = "my_domain" | |
} | |
provider "aws" { | |
region = "${var.aws_region}" |
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
# AWS S3 bucket for static hosting | |
resource "aws_s3_bucket" "website" { | |
bucket = "${var.website_bucket_name}" | |
acl = "public-read" | |
tags { | |
Name = "Website" | |
Environment = "production" | |
} |
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
module Monads where | |
{- runhaskell Monads.hs -} | |
import Prelude hiding (Monad, (>>=), return) | |
{- | |
Laws: | |
* Associativity: `m >>= f >>= g` is equivalent to `m >>= \x -> f x >>= g` |
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
# pushState friendly! | |
# The setup: | |
# * website name is `site.com` | |
# * the API for your running on localhost:3000 | |
# * the root for API calls is at `/api`, and you have authentication routes with root `/auth` (both go to localhost:3000) | |
# * javascript app is located at `/path/to/javascript/app` | |
# Assuming you have your server for API calls at localhost port 3000 | |
upstream api_sitecom { | |
server localhost:3000; |
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
class AddComment | |
attr_reader :observer, :store, :success, :fail | |
def initializer(observer, store) | |
@observer, @store = observer, store | |
yield self if block_given? | |
return self | |
end | |
def call(post_id, comment_attrs) |
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
(ns fileupload.core | |
(:use [net.cgrand.enlive-html | |
:only [deftemplate defsnippet content clone-for | |
nth-of-type first-child do-> set-attr sniptest at emit*]] | |
[compojure.core] | |
[ring.adapter.jetty]) | |
(:require (compojure [route :as route]) | |
(ring.util [response :as response]) | |
(ring.middleware [multipart-params :as mp]) | |
(clojure.contrib [duck-streams :as ds])) |