Skip to content

Instantly share code, notes, and snippets.

cons = fn (a, b) -> fn x -> x.(a, b) end end
car = fn (p) -> p.(fn (q, _) -> q end) end
cdr = fn (p) -> p.(fn (_, q) -> q end) end
each = fn (list, func) ->
iter = fn (list, func, next) ->
(fn (a, nil) -> func.(a)
(a, b) -> func.(a); next.(b, func, next)
end).(car.(list), cdr.(list))
end
iter.(list, func, iter)
-- The meta-circular interpreter from section 5 of Reynolds's Definitional
-- Interpreters for Higher Order Programming Languages
-- (http://www.cs.uml.edu/~giam/91.531/Textbooks/definterp.pdf)
data EXP
= CONST Const
| VAR Var
| APPL Appl
| LAMBDA Lambda
| COND Cond
  1. General Background and Overview
// Eric Wolfe: Added support for checking if mobile radios are enabled on the device
// Original source: http://www.enigmaticape.com/blog/determine-wifi-enabled-ios-one-weird-trick
#import <Foundation/Foundation.h>
#import <ifaddrs.h>
#import <net/if.h>
#import <SystemConfiguration/CaptiveNetwork.h>
@interface ERWNetworkStatus : NSObject
@paf31
paf31 / node-haskell.md
Last active April 14, 2021 18:42
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

@hsribei
hsribei / can-nat-traversal-be-tor-s-killer-feature.md
Last active July 12, 2018 19:15
Can NAT traversal be Tor's killer feature?

Can NAT traversal be Tor's killer feature?

tl;dr: how about a virtual global flat LAN that maps static IPs to onion addresses?

[We all know the story][1]. Random feature gets unintentionally picked up as the main reason for buying/using a certain product, despite the creator's intention being different or more general. (PC: spreadsheets; Internet: porn; smartphones: messaging.)

Pedro's Amazing Guide To Rooftop Bars

Drinking with a perspective

Very few people respect the art of rooftop drinking these days.

Notably, rooftop bar customers often believe that wearing a suit or a fancy dress conveys respect.

Niclekback wears suits

@trentonstrong
trentonstrong / hosts.py
Last active December 18, 2015 05:29
hosts.py A script for retrieving AWS EC2 instance information in a format usable for your /etc/hosts file. Poor man's DNS, anyone? Requires installation of the package 'boto' (pip install boto) and the creation of a ~/.boto configuration file explained here: http://docs.pythonboto.org/en/latest/boto_config_tut.html
#!/usr/bin/env python
"""
Usage: hosts.py [options]
Options:
-h, --help show this help message and exit
-r REGION, --region=REGION
Region (default us-east-1)
"""
@adamwiggins
adamwiggins / end-of-a-chapter.md
Last active November 24, 2022 11:40
End of a chapter: my Heroku departure message

It's with a heavy heart that I announce that Friday, May 31 2013 will be my last day at Heroku.

How can I possibly put into words what Heroku has meant to me these last six years? I can say it was a tremendous experience; or the opportunity of a lifetime; or the greatest thing I have ever been a part of. I can say that Heroku has been my life's work, as I did recently in a public blog post. All of those things are true, but none seem to capture the enormity of what's transpired these past six years.

I tend to focus on mechanical elements of a company: product, code, design, process. But what has surprised me the most at Heroku is that none of these things is the best part. The best part is the team.

I've never had the chance to work with a more singular group of people. Talented, passionate, skilled, dedicated. Most of all, sharing a set of values: elegance, craft, maniacal focus on simplicity; and an uncompromising belief that the future will be made of software, and how that software gets made will shape