Skip to content

Instantly share code, notes, and snippets.

@pascalpp
pascalpp / mocha-custom.css
Last active August 29, 2015 14:10
Prettier Mocha Stats
/* load after mocha.css */
body {
margin: 0;
padding: 0;
}
#mocha {
margin: 75px 15px;
}
ul#mocha-stats {
@patrickhammond
patrickhammond / android_instructions.md
Last active June 6, 2024 05:19
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@adstage-david
adstage-david / 0_README.markdown
Last active February 7, 2018 16:20
Building an RFC compliant JSON-Patch with Rails 3 and Backbone

I recently got PATCH mostly working with Backbone and Rails 3, here's what I needed to do.

Sticking Points:

  1. [Rails] JSON Patch gem needs updated.
  2. [Rails] Routing verb for patch missing - I believe this is fixed in Rails 4, haven't investigated.
  3. [Rails] Need to parse the 'application/json-patch+json' content type in sort of a crazy way
  4. [Rails] Building a patch and applying it to an activerecord model is kind of a pain, ideally we'd have a ActiveModel#apply_patch(json_patch)
  5. [Backbone] Building a patch from a set of attributes is tricky - I've done the bare minimum using a loop over a hash to build add operations, which should probably cover a good chunk of cases for backbone. (I imagine most people aren't going to need the json-patch support for moving, copying or deleting keys generally.)