Skip to content

Instantly share code, notes, and snippets.

@egonSchiele
egonSchiele / create-vpc.tf
Created January 18, 2025 21:20
create a VPC in terraform
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
@egonSchiele
egonSchiele / app-runner-service.tf
Last active December 27, 2024 22:04
app-runner-service.tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
@egonSchiele
egonSchiele / alb.tf
Created December 27, 2024 22:03
alb boilerplate
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
@egonSchiele
egonSchiele / ec2_public_ip.tf
Last active December 3, 2024 15:01
Example code that will create an EC2 instance in AWS that you can connect to from your machine
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
@egonSchiele
egonSchiele / canny.cpp
Created December 28, 2010 02:42
Adding automatic thresholding to cvCanny in OpenCV
// new
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
@egonSchiele
egonSchiele / rons.rb
Last active October 30, 2022 06:16
The dining philosophers problem in Ruby, solved using the resource hierarchy solution
require 'thread'
class Ron
def initialize(name, left_fork, right_fork)
@name = name
@left_fork = left_fork
@right_fork = right_fork
while true
think
dine
@egonSchiele
egonSchiele / diners.hs
Last active April 23, 2022 17:29
Dining philosophers solution in Haskell using STM. Taken from http://rosettacode.org/wiki/Dining_philosophers#Haskell with some minor modifications.
import Control.Monad
import Control.Concurrent
import Control.Concurrent.STM
import System.Random
import Text.Printf
-- Forks
type Fork = TMVar Int
newFork :: Int -> IO Fork
@egonSchiele
egonSchiele / reader.hs
Created June 10, 2013 20:51
Reader monad example
import Control.Monad.Reader
hello :: Reader String String
hello = do
name <- ask
return ("hello, " ++ name ++ "!")
bye :: Reader String String
bye = do
name <- ask
@egonSchiele
egonSchiele / Main.hs
Created April 17, 2013 00:03
Read and write from a database using persistent and Scotty
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}