Skip to content

Instantly share code, notes, and snippets.

View hdgarrood's full-sized avatar
💭
All of my personal repos are unmaintained

Harry Garrood hdgarrood

💭
All of my personal repos are unmaintained
View GitHub Profile
@hdgarrood
hdgarrood / solarized_light.xml
Created April 4, 2012 09:23
Notepad++ colorscheme -- solarized light
<!--//
Solarized (light)
Copyright (c) 2008 Fabio Zendhi Nagao <http://zend.lojcomm.com.br/>
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
@hdgarrood
hdgarrood / cookies.hs
Last active February 9, 2018 16:07
Scotty cookies example
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad (forM_)
import Data.Text.Lazy (Text)
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.Encoding as T
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BSL
import qualified Blaze.ByteString.Builder as B
@hdgarrood
hdgarrood / reqs.md
Last active January 2, 2016 04:29
Phone requirements

Essentials

  • Calls
  • Texts
  • T9 (unless qwerty)
  • Alarm clock
  • No touchscreen!

Nice-to-haves

@hdgarrood
hdgarrood / Derivative.hs
Created August 7, 2014 01:52
finding a derivative in haskell, first attempt
module Derivative where
data Expr = X -- variable
| S Integer -- scalar
| Expr :+: Expr -- sum
| Expr :*: Expr -- product
| Expr :^: Integer -- exponent
deriving (Show, Eq)
@hdgarrood
hdgarrood / vagrant-packet-filtering.md
Last active August 29, 2015 14:05
packet filtering + vagrant

I wanted to rewrite ports on incoming tcp packets (on OSX) on my host machine, so that a web server on a guest vm appears to be running on the host.

Incoming packets on port 80 should get rewritten to 8080, and incoming packets on port 443 should get rewritten to port 8443.

I asked about this on hipchat a few days ago and nobody seemed to know the answer - I recently found it, and so decided to share in case this is useful to anybody.

module Coercible where
foreign import unsafeCoerce
"function unsafeCoerce(x) { return x }" :: forall a b. a -> b
class Coercible a b
coerce :: forall a b. (Coercible a b) => a -> b
coerce = unsafeCoerce
@hdgarrood
hdgarrood / harry-garrood-gsoc-proposal.markdown
Last active August 29, 2015 14:17
PureScript GSOC proposal

Harry Garrood

GSOC proposal: Pursuit enhancements

PureScript is a language similar to (and written in) Haskell, which compiles to JavaScript. Due to PureScript's expressive type system, functions and data can provide lots of information and even guarantees about their structure and behaviour, through just their type signatures. For example, types can capture

@hdgarrood
hdgarrood / recipes-i-used.md
Last active August 29, 2015 14:17
Recipes
@hdgarrood
hdgarrood / purescript-maybe.txt
Last active August 29, 2015 14:18
Potential Hoogle input format for PureScript
@name purescript-maybe
@version 0.2.2
module Data.Maybe where
-- | <p>The <code>Maybe</code> type is used to represent optional values and can be seen as
-- | something like a type-safe <code>null</code>, where <code>Nothing</code> is <code>null</code> and <code>Just x</code>
-- | is the non-null value <code>x</code>.</p>
data Maybe a
@hdgarrood
hdgarrood / gist:9c4e63e6611656bf9c2d
Last active August 29, 2015 14:19
Pursuit thoughts

upload process

  • user runs pulp publish, or something
  • JSON dump is generated by psc-package-upload
  • Uploaded to pursuit.purescript.org
  • Verification URL sent back in response, and printed to stdout
  • User visits verification URL in browser and is authenticated via GitHub OAuth
  • After authentication, HTML is generated etc and the package appears on pursuit.