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 / Promise.js
Last active June 9, 2020 18:17
Promise.all implementations ... for fun
// Reduce Implementation
function promiseAllReduction(promises) {
return promises.reduce(function(acc, i) {
return acc.then(rs => i.then(r => [...rs, r]))
}, Promise.resolve([]));
}
// Recursive Implementation
function promiseAllRecursive(promises) {
if(promises.length === 0) {
@throughnothing
throughnothing / recommended-routine.md
Created June 7, 2020 02:08 — forked from sgup/recommended-routine.md
Recommended Routine (Updated Dec 2019)
@throughnothing
throughnothing / gdrive-pdf.js
Created June 2, 2020 20:58
Google Drive PDF'er
(function() {
let jspdf = document.createElement("script");
jspdf.onload = function () {
let pdf = new jsPDF();
let elements = document.getElementsByTagName("img");
for (let i in elements) {
let img = elements[i];
console.log("add img ", img);
@throughnothing
throughnothing / Either.ts
Created May 17, 2020 04:45
very simple Either in Typescript
export interface Either<E, A> {
map<B>(f: (a: A) => B): Either<E, B>;
mapLeft<F>(f: (e: E) => F): Either<F, A>;
flatMap<B>(f: (a: A) => Either<E, B>): Either<E, B>;
flatMapLeft<F>(f: (e: E) => Either<F, A>): Either<F, A>;
ap<B>(f: Either<E, (a: A) => B>): Either<E, B>;
match<R>(result: (success: A) => R, error: (err: E) => R): R;
}
@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
@throughnothing
throughnothing / ServantGADT.hs
Created May 30, 2019 08:08
Servant with GADT types experiment
{-#LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module Lib where
import Servant
import Servant.API ()
data Query t where
@throughnothing
throughnothing / DBTypes.purs
Created May 25, 2019 06:23
Is this a "clever" way to handle DB models? It keeps it POJO, and reduces redundancy for non-id'ed (and non-createdAt'ed) objects.
type WithId r = ( id :: Int | r )
type WithCreatedAt r = ( createdAt :: String | r )
type DB r = { | (WithId (WithCreatedAt r)) }
type DBUser = DB UserRows
type User = { | UserRows }
type UserRows =
( googleId :: String
, name :: String
, email :: String

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