Skip to content

Instantly share code, notes, and snippets.

View rcook's full-sized avatar

Richard Cook rcook

View GitHub Profile
@rcook
rcook / LICENSE
Last active March 30, 2020 05:48
Mystery program
The MIT License (MIT)
Copyright (c) 2019 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rcook
rcook / LICENSE
Last active March 30, 2020 05:48
View patterns bug
The MIT License (MIT)
Copyright (c) 2019 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rcook
rcook / LICENSE
Last active March 30, 2020 05:48
Demonstrate of insertion-order-preserving set
The MIT License (MIT)
Copyright (c) 2019 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rcook
rcook / LICENSE
Last active March 30, 2020 05:48
SMT with Z3 from Scratch examples
The MIT License (MIT)
Copyright (c) 2019 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rcook
rcook / LICENSE
Last active March 30, 2020 05:48
Papilio DUO (part 2) code samples
The MIT License (MIT)
Copyright (c) 2019 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rcook
rcook / EasyRenderDict.hs
Last active March 30, 2020 05:47
Examples of Ginger's "easy" API
-- | Render a template using a heterogeneous dictionary context
renderDict :: IO ()
renderDict = do
let ctx :: GVal (Run SourcePos (Writer Text) Text)
ctx = dict
[ (("word" :: Text) ~> ("bird" :: Text))
]
Text.putStrLn $ easyRender ctx template
@rcook
rcook / GuavaFluentFutures.java
Last active March 30, 2020 05:47
Retry in Java futures (part 2)
package org.rcook.guava;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import org.rcook.App;
import org.rcook.Session;
import java.util.concurrent.CancellationException;
@rcook
rcook / LICENSE
Last active March 30, 2020 05:47
Retry in Java futures
The MIT License (MIT)
Copyright (c) 2019 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rcook
rcook / LICENSE
Last active March 30, 2020 05:47
Xiaolin Wu's fast antialiased line drawing algorithm in Haskell
The MIT License (MIT)
Copyright (c) 2018 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rcook
rcook / JuicyDrawMain.hs
Last active March 30, 2020 05:47
Example code from juicy-draw package
module Main (main) where
import Codec.Picture
import Codec.Picture.Drawing
main :: IO ()
main = do
let w = 480
h = 360