Skip to content

Instantly share code, notes, and snippets.

@tomjadams
tomjadams / ExampleServer.scala
Created June 4, 2016 09:38 — forked from vastdevblog/ExampleServer.scala
Example of a Finagle server
package com.vast.example
import java.net.InetSocketAddress
import java.util.UUID
import java.util.concurrent.{Executors, TimeUnit}
import com.google.common.base.Splitter
import com.twitter.finagle.http.Http
import com.twitter.finagle.builder.{Server, ServerBuilder}
import com.twitter.finagle.service.TimeoutFilter
import com.twitter.finagle.{Service, SimpleFilter, GlobalRequestTimeoutException}
@tomjadams
tomjadams / how-to-set-up-stress-free-ssl-on-os-x.md
Created October 29, 2015 22:44 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

This is my recommended path for learning Haskell.

Something to keep in mind: don't sweat the stuff you don't understand immediately. Just keep moving.

Primary course

Installing Haskell

Ubuntu PPA

This is my recommended path for learning Haskell.

Something to keep in mind: don't sweat the stuff you don't understand immediately. Just keep moving.

Primary course

Installing Haskell

Ubuntu PPA

@tomjadams
tomjadams / pr.md
Created March 23, 2014 23:26 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@tomjadams
tomjadams / notes.md
Created July 25, 2011 11:36 — forked from nkpart/notes.md
My Lion Install Notes

Interesting FP Reading

Papers

  • [Why Functional Programming Matters][whyfp]
  • [Applicative Programming with Effects][app]
  • [The Essence of the Iterator Pattern][iter]
  • [Generalising Monads to Arrows][arrows]
@tomjadams
tomjadams / gist:70639
Created February 26, 2009 03:44 — forked from DylanFM/gist:70625
Without the destructive update
# sans destructive update
def f(rss, n)
rss.inject(0) {|acc, rs| rs.include?(n) ? acc + 1 : acc}
end
CmdUtils.CreateCommand({
name: "showmore",
takes: {"url to shorten": noun_arb_text},
preview: "Replaces the selected URL with ashowmore.info shortened URL.",
description: "Replaces the selected URL with a bit.ly-shortened URL.",
icon: "http://bit.ly/favicon.png",
execute: function( urlToShorten ) {
var baseUrl = "http://showmore.info/links/";
var params = {link_url: urlToShorten.text};
jQuery.get(baseUrl, params, function(shortenedUrl) {
package com.googlecode.furnace.analyse.blast;
import static com.googlecode.instinct.expect.Expect.expect;
import com.googlecode.instinct.integrate.junit4.InstinctRunner;
import com.googlecode.instinct.internal.util.instance.ObjectFactory;
import com.googlecode.instinct.marker.annotate.BeforeSpecification;
import com.googlecode.instinct.marker.annotate.Dummy;
import com.googlecode.instinct.marker.annotate.Mock;
import com.googlecode.instinct.marker.annotate.Specification;
import com.googlecode.instinct.marker.annotate.Subject;