Just some random circles.
Click to make them disappear! Or add more!
Just some random circles.
Click to make them disappear! Or add more!
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
| <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.js"></script> | |
| <script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.2.2/bootstrap.min.js"></script> | |
| <style type="text/css"> | |
| .row-fluid > .sidebar { | |
| width: 280px; | |
| position: absolute !important; |
| from django import template | |
| register = template.Library() | |
| @register.filter | |
| def startswith(value, arg): | |
| """Usage, {% if value|starts_with:"arg" %}""" | |
| return value.startswith(arg) |
Install Python
brew install python --framework
Link /usr/local/lib/python2.7/config
ln -s /usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/Current/lib/python2.7/config /usr/local/lib/python2.7/config
| import json | |
| from rest_framework import serializers | |
| class JSONField(serializers.WritableField): | |
| def to_native(self, obj): | |
| return json.dumps(obj) | |
| def from_native(self, value): | |
| return json.loads(value) |
| from ast import literal_eval | |
| class DictField(serializers.WritableField): | |
| type_name = 'DictField' | |
| def from_native(self, value): | |
| if isinstance(value, basestring): | |
| try: | |
| value = literal_eval(value) | |
| except SyntaxError: |
| class LatestVersionManager(models.Manager): | |
| """ | |
| Return only the latest version of each model in its default query set. | |
| Subclasses must define `version` and `id`. | |
| """ | |
| version = 'version' | |
| id = '_id' | |
| def get_query_set(self): |
| angular.module('plunker', ['ui.bootstrap']); | |
| var PaginationDemoCtrl = function ($scope, $location) { | |
| $scope.numPages = 7; | |
| console.log('page should be', $location.search().page); | |
| $scope.currentPage = $location.search().page; | |
| }; |
First, you're going to create a new branch to track the new feature. First, sync up to make sure your local copy has the latest production version of the website:
$ cd ~/git/project $ git fetch origin $ git checkout staging $ git reset --hard origin/staging
Then create the new feature branch:
| import os | |
| import pytest | |
| from selenium import webdriver | |
| browsers = { | |
| 'firefox': webdriver.Firefox, | |
| 'chrome': webdriver.Chrome, | |
| } | |
| @pytest.fixture(scope='session', params=browsers.keys()) |