Skip to content

Instantly share code, notes, and snippets.

View therabidbanana's full-sized avatar
🌴
On vacation

David Haslem therabidbanana

🌴
On vacation
  • Pathstream
  • San Francisco
View GitHub Profile
@steveklabnik
steveklabnik / reading.md
Last active April 11, 2016 11:26
intro to continental philosophy reading list (french post-structuralism, etc)
{
"_links": {
"self": { "href": "/foo" },
},
"_controls": {
"attack": {
"target": "/attacks",
"method": "POST",
"headers": {
"Content-Type": "application/json"
@paulmillr
paulmillr / brunch-heroku-deploy.md
Last active March 29, 2019 23:12
Build & deploy brunch applications on Heroku.
  1. Add to .gitignore:

    node_modules
    public
    
  2. Add to your app dependencies of package.json:

@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@jamiew
jamiew / Procfile
Last active October 4, 2015 12:28
Using unicorn on Heroku
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@addyosmani
addyosmani / jasmine.md
Created January 3, 2012 01:14
Rough-work for Jasmine section of Backbone Fundamentals

##Introduction

One definition of unit testing is the process of taking the smallest piece of testable code in an application, isolating it from the remainder of your codebase and determining if it behaves exactly as expected. In this section, we'll be taking a look at how to unit test Backbone applications using a popular JavaScript testing framework called Jasmine from Pivotal Labs.

For an application to be considered 'well'-tested, distinct functionality should ideally have its own separate unit tests where it's tested against the different conditions you expect it to work under. All tests must pass before functionality is considered 'complete'. This allows developers to both modify a unit of code and it's dependencies with a level of confidence about whether these changes have caused any breakage.

As a basic example of unit testing is where a developer may wish to assert whether passing specific values through to a sum function results in the correct output being re

@madrobby
madrobby / i18n.coffee
Created November 14, 2011 15:45
Backbone i18n with CoffeeScript
# before this file is loaded, a locale should be set:
#
# In a browser environment, you can use:
# ```<script>__locale='en';</script>```
#
# In a server environment (specifically node.js):
# ```global.__locale = 'en';```
# normalize in-app locale string to "en" or "de-AT"
parts = @__locale.split('-')
@TwP
TwP / gist:981176
Created May 19, 2011 16:29
A simple rack middleware that allows you to post JSON body data. We are using the YAJL json library for ruby. Feel free to substitute your own.
require 'yajl'
module Rack
# A Rack middleware for parsing POST/PUT body data when Content-Type is
# <tt>application/json</tt>.
#
class JsonPostBody
@therabidbanana
therabidbanana / Gemfile
Created August 20, 2010 04:22
A simple sparkles app with blog
# Gemfile
source "http://rubygems.org"
gem "openid_dm_store", :git => "git://github.com/therabidbanana/openid_dm_store.git"
gem "orange-more", :git => "git://github.com/therabidbanana/orange-more.git"
gem "orange-core", :git => "git://github.com/therabidbanana/orange-core.git"
gem "orange-sparkles", :git => "git://github.com/orange-project/orange-sparkles.git"
gem "dm-postgres-adapter"