This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Format 'git status' output for use in my prompt | |
set -eu | |
untracked="" | |
modified="" | |
for line in $(command git status --porcelain=v1 2> /dev/null | command cut -c-2); do | |
if [[ $line == ?? ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[run] | |
source = test_foo | |
branch = True | |
[report] | |
show_missing = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# Foo documentation build configuration file, created by | |
# sphinx-quickstart on Wed Jul 12 21:34:14 2017. | |
# | |
# This file is execfile()d with the current directory set to its | |
# containing dir. | |
# | |
# Note that not all possible configuration values are present in this | |
# autogenerated file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.pex | |
.tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pytest | |
from selenium import webdriver | |
browsers = { | |
'firefox': webdriver.Firefox, | |
'chrome': webdriver.Chrome, | |
} | |
@pytest.fixture(scope='session', params=browsers.keys()) |
-
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}; |
NewerOlder