Skip to content

Instantly share code, notes, and snippets.

View neektza's full-sized avatar

Nikica Jokic neektza

View GitHub Profile
@danihodovic
danihodovic / main.tf
Created January 8, 2017 20:48
Terraform - static site using S3, Cloudfront and Route53
variable "aws_region" {
default = "eu-west-1"
}
variable "domain" {
default = "my_domain"
}
provider "aws" {
region = "${var.aws_region}"
@nagelflorian
nagelflorian / buckets.tf
Last active February 12, 2024 07:44
Terraform config for static website hosting on AWS
# AWS S3 bucket for static hosting
resource "aws_s3_bucket" "website" {
bucket = "${var.website_bucket_name}"
acl = "public-read"
tags {
Name = "Website"
Environment = "production"
}
@puffnfresh
puffnfresh / Monads.hs
Last active December 17, 2015 17:39
Monad exercises
module Monads where
{- runhaskell Monads.hs -}
import Prelude hiding (Monad, (>>=), return)
{-
Laws:
* Associativity: `m >>= f >>= g` is equivalent to `m >>= \x -> f x >>= g`
@aotimme
aotimme / pushstate.nginxconf
Last active June 3, 2022 19:37
Nginx config file to support pushState.
# 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;
@nicholasjhenry
nicholasjhenry / gist:3024550
Created June 30, 2012 16:34
Hexagonal Rails Example
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)
@nikolaplejic
nikolaplejic / core.clj
Created September 2, 2010 17:54
File upload example in Compojure
(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]))