Skip to content

Instantly share code, notes, and snippets.

@guifromrio
guifromrio / teamcity-agent-ubuntu.md
Last active October 21, 2022 12:35
Instructions to Setup Teamcity Agent on EC2 Ubuntu 12.04.2 Linux with NodeJS and PhantomJS
@traviskaufman
traviskaufman / jasmine-this-vars.md
Last active September 19, 2022 14:35
Better Jasmine Tests With `this`

Better Jasmine Tests With this

On the Refinery29 Mobile Web Team, codenamed "Bicycle", all of our unit tests are written using Jasmine, an awesome BDD library written by Pivotal Labs. We recently switched how we set up data for tests from declaring and assigning to closures, to assigning properties to each test case's this object, and we've seen some awesome benefits from doing such.

The old way

Up until recently, a typical unit test for us looked something like this:

describe('views.Card', function() {
@wonderbeyond
wonderbeyond / objectview.py
Created July 24, 2017 04:59
python dict to object view
class objectview(object):
"""Convert dict(or parameters of dict) to object view
See also:
- https://goodcode.io/articles/python-dict-object/
- https://stackoverflow.com/questions/1305532/convert-python-dict-to-object
>>> o = objectview({'a': 1, 'b': 2})
>>> o.a, o.b
(1, 2)