Skip to content

Instantly share code, notes, and snippets.

@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)
@traviskaufman
traviskaufman / jasmine-this-vars.md
Last active January 4, 2025 16:49
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() {
@drawveloper
drawveloper / teamcity-agent-ubuntu.md
Last active August 31, 2024 11:37
Instructions to Setup Teamcity Agent on EC2 Ubuntu 12.04.2 Linux with NodeJS and PhantomJS