Skip to content

Instantly share code, notes, and snippets.

View aisk's full-sized avatar
🍺
Drunk

AN Long aisk

🍺
Drunk
View GitHub Profile
@alanb1501
alanb1501 / starwars.sh
Last active April 9, 2016 13:34
Reads a random starwars quote in each voice available via the `say` command. (OS X only)
#!/usr/bin/env bash
for voice in $(say -v ? | perl -pe 's/^(.*?)\s.*$/$1/'); do quote=$(curl -s http://www.iheartquotes.com/api/v1/random?source=starwars | perl -pe 's/\[starwars.*?$//g'); echo $voice; say -v $voice $quote; done
@paf31
paf31 / node-haskell.md
Last active May 14, 2024 03:51
Reimplementing a NodeJS Service in Haskell

Introduction

At DICOM Grid, we recently made the decision to use Haskell for some of our newer projects, mostly small, independent web services. This isn't the first time I've had the opportunity to use Haskell at work - I had previously used Haskell to write tools to automate some processes like generation of documentation for TypeScript code - but this is the first time we will be deploying Haskell code into production.

Over the past few months, I have been working on two Haskell services:

  • A reimplementation of an existing socket.io service, previously written for NodeJS using TypeScript.
  • A new service, which would interact with third-party components using standard data formats from the medical industry.

I will write here mostly about the first project, since it is a self-contained project which provides a good example of the power of Haskell. Moreover, the proces

anonymous
anonymous / config.json
Created August 18, 2014 15:37
Bootstrap Customizer Config
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 46.7%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#c70850",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
@nightscape
nightscape / sexp.peg
Created August 16, 2012 18:27
S-Expression grammar for PEG.js
/*
* Grammar to generate an S-Expressions parser for Javascript using http://pegjs.majda.cz/
*/
start
= expression*
integer "integer"
= digits:[0-9]+ { return parseInt(digits.join(""), 10); }
@briancavalier
briancavalier / promise-monad-proof.js
Created August 8, 2012 15:57
A proof that Promises/A is a Monad
//-------------------------------------------------------------
//
// Hypothesis:
//
// Promises/A is a Monad
//
// To be a Monad, it must provide at least:
// - A unit (aka return or mreturn) operation that creates a corresponding
// monadic value from a non-monadic value.
// - A bind operation that applies a function to a monadic value