Skip to content

Instantly share code, notes, and snippets.

View throughnothing's full-sized avatar

William Wolf throughnothing

View GitHub Profile
@throughnothing
throughnothing / gmaps-gpx.html
Created July 9, 2012 06:43
Google Maps KML File Iframe Embed example
<html>
<head>
</head>
<body>
<iframe width="700" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=https:%2F%2Fraw.github.com%2Fthroughnothing%2Fgpx%2Fmaster%2F2012%2F20120629.kml&amp;t=h&amp;ie=UTF8&amp;output=embed"></iframe><br />
</body>
</html>
@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 / Aurora-Profiles
Created March 16, 2012 16:11
Applescript to run multiple firefox instances with the profilemanager
do shell script "open -n -a aurora --args -profilemanager"
@throughnothing
throughnothing / recommended-routine.md
Created June 7, 2020 02:08 — forked from sgup/recommended-routine.md
Recommended Routine (Updated Dec 2019)
@throughnothing
throughnothing / purescript-gadt.purs
Created December 6, 2018 20:28
Purescript GADT example
module GADT.Main where
import Prelude (class Category, class Semigroupoid, (<<<), flip, identity, ($), (+), (==))
import Unsafe.Coerce (unsafeCoerce)
newtype Leibniz a b = Leibniz (forall f. f a -> f b)
infix 4 type Leibniz as ~
instance semigroupoidLeibniz :: Semigroupoid Leibniz where
@throughnothing
throughnothing / MontyHall.purs
Last active June 10, 2020 17:55
Monty Hall
module MontyHall.Main where
import Prelude
import Data.Foldable (foldr)
import Data.List.Lazy (range)
import Data.Tuple (Tuple(..))
import Debug.Trace (class DebugWarning, spy)
import Effect (Effect)
import Effect.Random (randomInt)
@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 / 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