Skip to content

Instantly share code, notes, and snippets.

View freddie-freeloader's full-sized avatar

Jonas Benn freddie-freeloader

View GitHub Profile
@freddie-freeloader
freddie-freeloader / index.html
Last active April 9, 2024 17:08 — forked from leowebguy/index.html
Responsive iframe full screen. Display page without and hide original url address.
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<style>
html body {width: 100%;height: 100%;padding: 0px;margin: 0px;overflow: hidden;font-family: arial;font-size: 10px;color: #6e6e6e;background-color: #000;} #preview-frame {width: 100%;background-color: #fff;}</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
//function to fix height of iframe!
@freddie-freeloader
freddie-freeloader / starman_boring.hs
Last active November 14, 2018 21:51 — forked from jtomchak/starman.hs
Starman, version of hangman, in Haskell on the command line
main :: IO ()
main = do
starman "covfefe" 10
putStrLn "Program now shuts down"
--starman super game
starman :: String -> Int -> IO ()
starman word n = turn word ['-' | x <- word] n
@freddie-freeloader
freddie-freeloader / gist:cae528b35f31ef076251bc86f5f16ced
Created July 4, 2018 13:06 — forked from sebfisch/gist:2235780
Laymans explanation of delimited continuations with examples of using them for exception handling and nondeterministic programming.

Delimited Continuations

Delimited continuations manipulate the control flow of programs. Similar to control structures like conditionals or loops they allow to deviate from a sequential flow of control.

We use exception handling as another example for control flow manipulation and later show how to implement it using delimited continuations. Finally, we show that nondeterminism can also be expressed using delimited continuations.

Exception Handling

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x