Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am goodmike on github.
  • I am goodmike (https://keybase.io/goodmike) on keybase.
  • I have a public key ASD8ciX63E697KStMi9T7L0CpoeYwDPaa_y_pMvV4aHfswo

To claim this, I am signing this object:

@goodmike
goodmike / gist:c520c019256c094f2adf
Last active August 29, 2015 14:01
My Comment on FCC Proceeding 14-28 ("Net Neutrality")

I urge the committee to revise its rules for "Protecting and Promoting the Open Internet" to eliminate the ability of broadband providers to sell access to "fast lanes" of content delivery over their networks.

I am deeply concerned, as a citizen who uses the Internet at work and at leisure, that giving the small number of last-mile providers the right to sell access to content delivery will change the Internet profoundly, transforming it from a market in which millions of content producers, some very small, are able to compete on a fairly level playing field for the attention of consumers into one resembling today's cable television market, in which a few companies -- in many places only two, or one company -- pick content and set prices. The Internet is an actual free market, but it takes oversight and regulation to keep a market free.

Sacrificing this market to help giant companies become more profitable would not only be depressing, but it would cost the United States its leadership position in the new e

@goodmike
goodmike / aleph-with-moustache.clj
Created October 25, 2010 22:40
Using wrappers to mix ring and aleph handlers in moustache routes
(ns dining-service
(:use aleph.core)
(:use aleph.http)
(:use net.cgrand.moustache)
)
(defn report-handler [response-channel request]
(enqueue response-channel
{:status 200
:headers {"content-type" "text/plain"}
@goodmike
goodmike / Arel Multi-join example.rb
Created July 23, 2010 17:26
Implementing multiple joins with Arel
# The problem: In your Rails 3 project, you have a model Request that models a
# user's request for content related to a specific problem or topic. The user
# can tag her request with any number of words. These are modeled by a Tag class
# backed by a tags DB table. Since you want unique records per tag, you have a
# Tagging class backed by a taggings table. Taggings is a a many-to-many table
# with some additional information. Also, other models in the application
# besides requests can be tagged: The Tagging class defines a polymorphic
# relationship "taggable" with those models.
#
# So pretty soon you want to look up all the requests that are tagged with
require 'action_view'
require 'active_support'
require 'mustache'
class Mustache
# Remember to use {{{yield}}} (3 mustaches) to skip escaping HTML
# Using {{{tag}}} will skip escaping HTML so if your mustache methods return
# HTML, be sure to interpolate them using 3 mustaches.
(defconstrainedfn sqr
"Calculates the square of a number."
([n]
:requires
"argument must be a number"
(number? n)
"argument cannot be zero"
(not (zero? n))
:ensures
(defn monkeyed [str]
"Perfectly visible cavemen!")
(monkeyed "madness")
; => "Perfectly visible cavemen!"
"madness".extend(Monkeyedwith).monkeyed
Invisible Cavemen!
=> nil
module Monkeyedwith
def monkeyed
puts "Invisible Cavemen!"
end
end
class MonkeyString < String
include Monkeyedwith
end
(def x (promise))
(def y (promise))
(def z (promise))
(def task-z (future (deliver z (+ @x @y))))
(def task-x (future (deliver x 10)))
(def task-y (future (deliver y 5)))
(send-off (agent nil) (print @z))
(send-off (agent nil) #(@task-z))