Today we use computers to mask messages every day. When you connect to a website that uses "https" in the address, it is running a special encoding on your transmissions that makes it very difficult for anyone to listen in between you and the server.
# for more info: https://gist.github.com/1120938 |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title> | |
Sending Client-To-Client Realtime Messages With Pusher App And ColdFusion | |
</title> | |
<link rel="stylesheet" type="text/css" href="./styles.css"></link> |
# http://rubular.com/r/4DIAmT5J7U | |
# http://en.wikipedia.org/wiki/ZIP_code#ZIP.2B4 | |
# multi-line string | |
# /^(\d{4,5}$)|(\d{5}-?\d{4}$)/ | |
# single-line string | |
# /\A(\d{4,5}\z)|(\d{5}-?\d{4}\z)/ | |
#ZIP CODE REGEXP by SoAwesomeMan |
puts "STDIN: #{STDIN.tty?}, $stdin: #{$stdin.tty?}" | |
puts "STDOUT: #{STDOUT.tty?}, $stdout: #{$stdout.tty?}" |
class RouteRecognizer | |
attr_reader :paths | |
# To use this inside your app, call: | |
# `RouteRecognizer.new.initial_path_segments` | |
# This returns an array, e.g.: ['assets','blog','team','faq','users'] | |
INITIAL_SEGMENT_REGEX = %r{^\/([^\/\(:]+)} | |
def initialize |
This gist assumes:
- you have an online remote repository (github / bitbucket etc.)
- you have a local git repo
- and a cloud server (Rackspace cloud / Amazon EC2 etc)
- your (PHP) scripts are served from /var/www/html/
- your webpages are executed by Apache
- the Apache user is named
www-data
(may beapache
on other systems)
My biggest problem with monads is that my brain can't grasp them, obviously! One of the issues I've got is that people teach them as part of a somewhat bigger context: they start showing how Option[T] works and then suddenly declare ''Option[T] is a monad''! Or worse, they talk about something completely unrelated in an attempt to give you some real world perspective onto them. It's not working for me and it might not be working for you; what I'll write here is to help me understand monads, and it probably won't work for you, but it might.
I'm going to start with an extremely simple case class
and build it up from there:
final case class Holder[+T](value: T)
It's really simple in that it holds a value of a type T
. One thing to realise is that case class
in Scala automatically gives you a companion object for Holder[T]
called Holder
which gives you an apply
method for creating instances. I'm going to make a similar object, which I'll abitrarily call HolderMonad
, that will have
def verify | |
if params[:bt_challenge] | |
render :text => Braintree::WebhookNotification.verify(params[:bt_challenge]) | |
else | |
head :unprocessable_entity | |
end | |
end |
thumbnail: http://pds.exblog.jp/pds/1/201101/16/02/d0055302_13383029.jpg | |
video: http://www.youtube.com/watch?v=UE27t_LJpx0 |