A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| #!/bin/sh | |
| sudo apt-get install -y build-essential git automake ocamlbuild | |
| mkdir -p "$HOME/liquidsoap-build" | |
| cd "$HOME/liquidsoap-build" | |
| wget https://github.com/savonet/liquidsoap/releases/download/1.3.7/liquidsoap-1.3.7-full.tar.gz | |
| tar xvzf liquidsoap-1.3.7-full.tar.gz |
| dependencies: | |
| pre: | |
| - sudo apt-get install libxss1 libappindicator1 libindicator7 | |
| - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
| - sudo dpkg -i ./google-chrome*.deb | |
| - sudo apt-get install -f |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>WebSocket Client</title> | |
| <style> | |
| #output { | |
| border: solid 1px #000; | |
| } | |
| </style> | |
| </head> |
| #!/bin/bash | |
| # Following the guide found at this page | |
| # http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html | |
| echo "\r\nUpdating system ...\r\n" | |
| sudo apt-get update | |
| # Create folder to place selenium in |
| from django.views.generic.base import View, TemplateResponseMixin | |
| from django.views.generic.edit import FormMixin, ProcessFormView | |
| class MultipleFormsMixin(FormMixin): | |
| """ | |
| A mixin that provides a way to show and handle several forms in a | |
| request. | |
| """ | |
| form_classes = {} # set the form classes as a mapping |
| import asyncio | |
| import aiohttp | |
| import bs4 | |
| import tqdm | |
| @asyncio.coroutine | |
| def get(*args, **kwargs): | |
| response = yield from aiohttp.request('GET', *args, **kwargs) | |
| return (yield from response.read_and_close(decode=True)) |
| from __future__ import with_statement | |
| from fabric.api import local, settings, abort, run, cd, env, sudo | |
| from fabric.colors import green as _green | |
| from fabric.colors import yellow as _yellow | |
| from fabric.colors import red as _red | |
| from fabric.contrib.console import confirm | |
| from fabric.contrib.project import rsync_project | |
| from fabric.contrib.files import upload_template, exists | |
| from fabric.operations import require | |
| from fabric.context_managers import prefix |
Following the AngularJS PARIS meetup (25/2 à 19h à Paris with @sampaccoud @dzen @_kemar @tchack13 @vinz et @revolunet)
Here's our best AngularJS ressources : twitter, github, articles & blogs. Please comment and add your good stuff !
| from django.db.models.fields.related import ReverseSingleRelatedObjectDescriptor | |
| def override_model_field(model, name, column, field): | |
| """Force override a field in a Django Model. | |
| Usage: override_model_field( | |
| MyModel, models.ForeignKey(OtherModel), 'other', 'other_id') | |
| :type model: django.db.models.base.ModelBase | |
| :type name: basestring | |
| :type column: basestring | |
| :type field: django.db.models.fields.Field |