Skip to content

Instantly share code, notes, and snippets.

@abevoelker
abevoelker / TypeFamily.hs
Created January 8, 2016 15:30 — forked from deech/TypeFamily.hs
Searching a type level list using typeclasses vs. closed type families.
{-
This code shows how to check if a type-level list contains a given type.
It first shows the approach required for older versions of GHC (< 7.6.x)
and then a version using closed type families supported in GHC 7.8.1 and greater.
-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
import java.security._
import java.net.URL
import javax.net.ssl.{KeyManagerFactory, TrustManagerFactory}
import org.apache.http.conn.ssl.SSLSocketFactory
import org.apache.http.conn.scheme.Scheme
import dispatch._
// Gist trait for doing SSL with mutual certificate exchange using dispatch.
// This works without having to set up global JDK-wide keystore and truststore files.
//
@abevoelker
abevoelker / haproxy.cfg
Last active August 29, 2015 14:11 — forked from GABeech/haproxy.cfg
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password
@abevoelker
abevoelker / README.md
Last active December 30, 2015 13:09 — forked from mbostock/.block
Prose (myforms) render times on 2013/12/06 (up until ~3:30pm)

Graph of prose (myforms) response times on 2013/12/06 gathered by the parsing the production.log file using this Ruby script.

D3 code was forked from this repo.

@abevoelker
abevoelker / inlinenestedmodel.js
Created October 15, 2012 21:21 — forked from philfreo/inlinenestedmodel.js
Backbone-Forms InlineNestedModel
;(function() {
var Form = Backbone.Form,
editors = Form.editors;
// we don't want our nested form to have a (nested) <form> tag
// (currently bbf includes form tags: https://github.com/powmedia/backbone-forms/issues/8)
// aside from being strange html to have nested form tags, it causes submission-upon-enter
Form.setTemplates({
nestedForm: '<div class="bbf-nested-form">{{fieldsets}}</div>'