Skip to content

Instantly share code, notes, and snippets.

Harry Garrood hdgarrood

Block or report user

Report or block hdgarrood

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hdgarrood
hdgarrood / solarized_light.xml
Created Apr 4, 2012
Notepad++ colorscheme -- solarized light
View solarized_light.xml
<!--//
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 Feb 9, 2018
Scotty cookies example
View cookies.hs
{-# 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 Jan 2, 2016
Phone requirements
View reqs.md

Essentials

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

Nice-to-haves

@hdgarrood
hdgarrood / Derivative.hs
Created Aug 7, 2014
finding a derivative in haskell, first attempt
View Derivative.hs
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 Aug 29, 2015
packet filtering + vagrant
View vagrant-packet-filtering.md

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.

View Coercible.purs
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
View harry-garrood-gsoc-proposal.markdown

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

View recipes-i-used.md
@hdgarrood
hdgarrood / purescript-maybe.txt
Last active Aug 29, 2015
Potential Hoogle input format for PureScript
View purescript-maybe.txt
@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
View gist:9c4e63e6611656bf9c2d

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.
You can’t perform that action at this time.