Skip to content

Instantly share code, notes, and snippets.

Throw: (e) =>
throw e
class PlacesController
constructor: ->
@places: undefined
$('#place-search-form').submit @onsubmit #bind(@onsubmit, this)
onsubmit: (e) =>
PATH
remote: vendor/gems/revo-cache_fu-1.2.0
specs:
revo-cache_fu (1.2.0)
GEM
remote: http://rubygems.org/
remote: http://gems.github.com/
specs:
actionmailer (2.3.5)
diff --git a/app/controllers/api/goals/base_controller.rb b/app/controllers/api/goals/base_controller.rb
index 9b7f43e..8c4dae5 100644
--- a/app/controllers/api/goals/base_controller.rb
+++ b/app/controllers/api/goals/base_controller.rb
@@ -13,9 +13,11 @@ class Api::Goals::BaseController < BaseApplicationController
# This is unnecessary in Rails 3, thanks to responds_to
def respond_to_json(*args)
# Rails 2 doesn't seem to provide a convenient way to follow Accept order, so "first" will do
- return unless self.request.accepts.any? {|mime_type| mime_type.to_sym == :json}
+ supported_mime_type = self.request.accepts.detect {|mime_type| mime_type.to_sym == :json}
From 339d3fbef0359be6e5a664087cd3791472edd187 Mon Sep 17 00:00:00 2001
From: Rob Hunter <rhunter@iplayup.com>
Date: Wed, 6 Apr 2011 10:12:45 +1000
Subject: [PATCH] Goals API: Preserve content type in implicitly JSON requests
---
app/controllers/api/goals/base_controller.rb | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/app/controllers/api/goals/base_controller.rb b/app/controllers/api/goals/base_controller.rb
@rhunter
rhunter / ExampleStorySteps.java
Created June 28, 2011 03:40
JBehave example
import com.myob.liveaccounts.test.jbehave.StepBase;
import org.jbehave.core.model.ExamplesTable;
import org.jbehave.core.annotations.Given;
import org.jbehave.core.annotations.Then;
import org.jbehave.core.annotations.When;
import org.jbehave.core.annotations.Alias;
public class InvoiceSteps extends StepBase {
@Given("a JBehave story file called '$filename'")
@rhunter
rhunter / coloursplit.html
Created July 1, 2011 04:34
Split colour (could be gradients) that works on IE8 with minimal extra markup
<!DOCTYPE html>
<html><head>
<style type="text/css">
.section {
position: relative;
z-index: -50;
}
h1:before {
display: block;
content: "";
@rhunter
rhunter / unicode_arrow.py
Created August 3, 2011 14:43
A bunch of working Python examples with a unicode arrow for @harukizaemon
#!/usr/bin/env python
# encoding: UTF-8
import os
print "➜"
print u"➜"
print os.path.expandvars(u"➜")
print os.path.expandvars(u"➜").encode('UTF-8')
print os.path.expandvars(unicode("➜", 'UTF-8'))
print os.path.expandvars(unicode("➜", 'UTF-8').encode('UTF-8'))
Now that's got your attention...
/$$ /$$ /$$ /$$ /$$ /$$ /$$$$$$ /$$$$$$
| $$ /$ | $$| $$ | $$| $$ /$$/ |_ $$_/ /$$__ $$
| $$ /$$$| $$| $$ | $$ \ $$ /$$/ | $$ | $$ \__/
| $$/$$ $$ $$| $$$$$$$$ \ $$$$/ | $$ | $$$$$$
| $$$$_ $$$$| $$__ $$ \ $$/ | $$ \____ $$
| $$$/ \ $$$| $$ | $$ | $$ | $$ /$$ \ $$
| $$/ \ $$| $$ | $$ | $$ /$$$$$$| $$$$$$/
@rhunter
rhunter / threshold.sh
Created December 19, 2011 02:29 — forked from xaviershay/threshold.sh
bash golf problem
#!/bin/bash
# Input:
# output this 6
# do not output this 5
#
# Output (and a non-zero exit code):
# output this 6
THRESHOLD=5
@rhunter
rhunter / gist:2050613
Created March 16, 2012 15:42
Re: Always run tests in the same instance of browser
Date: Fri, 16 Mar 2012 02:59:13 -0700 (PDT)
In-Reply-To: <CAB-gw9Tw7Ga2uvgkuvVu3=GQj1EU4ZUN4aSk6KM7MGW04UBMgQ@mail.gmail.com>
References: <906ff796-a740-4f9b-b3a0-ef65db038a79@y17g2000yqg.googlegroups.com>
<CAB-gw9Tw7Ga2uvgkuvVu3=GQj1EU4ZUN4aSk6KM7MGW04UBMgQ@mail.gmail.com>
Message-ID: <cfdeb8ac-7eeb-4789-a2ee-e48cdd8b9d2d@v2g2000vbx.googlegroups.com>
Subject: Re: Always run tests in the same instance of browser
From: stanislaw <s.pankevich@gmail.com>
To: Rob Hunter <robertjhunter@gmail.com>