Skip to content

Instantly share code, notes, and snippets.

View throughnothing's full-sized avatar

William Wolf throughnothing

View GitHub Profile
@throughnothing
throughnothing / intelligent-tiering.md
Created August 25, 2023 18:41 — forked from jflasher/intelligent-tiering.md
Instructions for setting up a lifecycle policy for S3 Intelligent-Tiering

Amazon S3 now supports a new storage class called Intelligent Tiering. This will be a very attractive option for many customers who have datasets that are accessed in unpredictable patterns. You can set this storage class when uploading any new data. However, the below instructions will allow you to set up a lifecycle policy that will change the storage class of data that already exists in your bucket.

To set up a lifecycle policy to change the storage class of the data currently stored in your Amazon S3 bucket, follow the below steps.

  1. Visit the S3 console and go to your bucket of interest.

  2. Click on the Management tab at the top and select + Add lifecycle rule.

  3. Enter a rule name of your choice (e.g., Convert to Intelligent Tiering storage class). Unless you want to filter which data is converted to the new storage class, you can leave the prefix/tag filter field

@throughnothing
throughnothing / recommended-routine.md
Created June 7, 2020 02:08 — forked from sgup/recommended-routine.md
Recommended Routine (Updated Dec 2019)
@throughnothing
throughnothing / TinyServant.hs
Created June 5, 2019 20:31 — forked from kosmikus/TinyServant.hs
Implementation of a small Servant-like DSL
{-# LANGUAGE DataKinds, PolyKinds, TypeOperators #-}
{-# LANGUAGE TypeFamilies, FlexibleInstances, ScopedTypeVariables #-}
{-# LANGUAGE InstanceSigs #-}
module TinyServant where
import Control.Applicative
import GHC.TypeLits
import Text.Read
import Data.Time

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@throughnothing
throughnothing / spacemacs-cheshe.md
Created January 4, 2019 20:33 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
@throughnothing
throughnothing / Algebra.purs
Created December 4, 2018 19:33 — forked from LukaJCB/Algebra.purs
Alternative Tagless Final encoding in PureScript
module Algebra where
import Prelude
import Control.Monad.Eff (Eff)
import Data.Maybe (Maybe(..))
newtype ConsoleAlg f = ConsoleAlg
{ printLn :: String -> f Unit
, readLn :: f String

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@throughnothing
throughnothing / Free.swift
Created February 2, 2016 00:17 — forked from CodaFi/Free.swift
Free Monads in Swift
//
// Free.swift
// Swift_Extras
//
// Created by Robert Widmann on 9/19/14.
// Copyright (c) 2014 Robert Widmann. All rights reserved.
//
import Foundation
@throughnothing
throughnothing / AlaCarte.hs
Created January 6, 2016 06:36 — forked from puffnfresh/AlaCarte.hs
Coproduct to combine algebras for a free monad interpreter.
module AlaCarte where
-- Control.Monad.Free
data Free f a = Free (f (Free f a)) | Pure a
instance Functor f => Monad (Free f) where
Pure a >>= f = f a
Free r >>= f = Free (fmap (>>= f) r)
return = Pure
trait Tree
data object Empty : Tree
data class Leaf(val value: Int) : Tree
data class Node(val left: Tree, val right: Tree) : Tree
fun max(x:Int, y:Int):Int = if (x > y) x else y
fun depth(t: Tree): Int = when (t) {
is Empty -> 0
is Leaf -> 1