Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am mna on github.
  • I am puerkitobio (https://keybase.io/puerkitobio) on keybase.
  • I have a public key ASBQI8bPLBlTqqWPMzLKY9Kqdb7wK_f0r2J4NJiLWYn27wo

To claim this, I am signing this object:

@mna
mna / Makefile
Created Aug 22, 2017
Code coverage for Swift Package Manager-based projects
View Makefile
# Using https://github.com/nakiostudio/xcov
.PHONY: test-cov
test-cov:
@swift package generate-xcodeproj
@xcodebuild -scheme MYSCHEME -derivedDataPath .build/xcode -enableCodeCoverage YES test
@xcov --scheme MYSCHEME --configuration Debug --derived_data_path .build/xcode --skip_slack --markdown_report
@rm -rf .build/xcode
@open xcov_report/index.html
@mna
mna / Backbone.ComputedPropertiesModel.js
Created Apr 12, 2012
This gist shows one way to implement read- and write-enabled computed properties on a Backbone Model, without polluting the attributes hash of the Backbone Model. It works with Backbone.ModelBinding, so computed properties may be bound to form elements.
View Backbone.ComputedPropertiesModel.js
/*global _, Backbone*/
// By Martin Angers (PuerkitoBio)
// This should be inside a module pattern. Defines a base Model class, could/should be merged with your
// own base Model.
// Dependencies: underscore (_) and Backbone.
var ComputedProperties = function(model) {
this.model = model;
this.properties = {};
You can’t perform that action at this time.