(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| (r'^articles/(?P<year>\d{4}/?$, 'main.views.year'), | |
| # When a use case comes up that a month needs to be involved as | |
| # well, you add an argument in your regex: | |
| (r'^articles/(?P<year>\d{4}/(?P<month>\d{2})/?$, 'main.views.year_month'), | |
| # That works fine, unless of course you want to show something | |
| # different for just the year, in which case the following case can be | |
| # used, making separate views based on the arguments as djangoproject |
| import io | |
| class StringIteratorIO(io.TextIOBase): | |
| def __init__(self, iter): | |
| self._iter = iter | |
| self._left = '' | |
| def readable(self): | |
| return True |
| 'use strict'; | |
| var gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var del = require('del'); | |
| var uglify = require('gulp-uglify'); | |
| var gulpif = require('gulp-if'); | |
| var exec = require('child_process').exec; | |
| var notify = require('gulp-notify'); |
| ############################################################################## | |
| # | |
| # Simple Python program to benchmark several Python Excel writing modules. | |
| # | |
| # python bench_excel_writers.py [num_rows] [num_cols] | |
| # | |
| # | |
| import sys | |
| from time import clock |
| angular.module('app.resources', ['ngResource']) | |
| .factory('api', function ($resource) { | |
| var api = { | |
| defaultConfig : {id: '@id'}, | |
| extraMethods: { | |
| 'update' : { | |
| method: 'PUT' | |
| } |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| sudo apt-get update | |
| sudo apt-get install python-virtualenv | |
| sudo apt-get install python-dev | |
| sudo apt-get install postgresql | |
| sudo apt-get install postgresql-server-dev-9.3 | |
| sudo apt-get install redis-server | |
| sudo -u postgres createuser -s sentry | |
| sudo -u postgres psql -c "alter user sentry with password 'sentry';" |
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import datetime | |
| from mock import patch | |
| from django.test import TestCase | |
| from django.utils import timezone | |
| class DatesTestCase(TestCase): |
| diff --git a/django/db/backends/postgresql_psycopg2/schema.py b/django/db/backends/postgresql_psycopg2/schema.py | |
| index 8340059..692866e 100644 | |
| --- a/django/db/backends/postgresql_psycopg2/schema.py | |
| +++ b/django/db/backends/postgresql_psycopg2/schema.py | |
| @@ -1,6 +1,21 @@ | |
| import psycopg2 | |
| from django.db.backends.base.schema import BaseDatabaseSchemaEditor | |
| +from django.db.models.expressions import Func | |
| +from django.db.models.sql.compiler import SQLCompiler |
The quotes on this page come from this deleted question on Stackoverflow: