- ipython / django-extensions
- model_mommy
- Learn a single text-editor well
- learning a few extra commands in Sublime-text has made a huge difference
| def charge(self, account): | |
| """ | |
| Charge account for the monthly amount. This is triggered by | |
| a monthly cron job. | |
| """ | |
| self.check_balance(account) | |
| amount = settings.MONTHLY_CHARGE | |
| return self.create(account=account, amount=amount) |
| ### previous SLS | |
| install-python-2.7.10-from-tarball: | |
| cmd.run: | |
| - names: | |
| - cd /usr/src | |
| - wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz | |
| - tar xzf Python-2.7.10.tgz | |
| - cd Python-2.7.10 | |
| - ./configure | |
| - make altinstall |
| run-postgresql: | |
| service.running: | |
| - enable: true | |
| - name: postgresql-93 | |
| - require: | |
| - pkg: postgresql93 | |
| # I keep getting this error -> |
| ### shorten my bash settings ### | |
| # If id command returns zero, you’ve root access. | |
| if [ $(id -u) -eq 0 ]; | |
| then # you are root, set red colour prompt | |
| PS1="\\[$(tput setaf 1)\\]\\u@\\h:\\w #\\[$(tput sgr0)\\]" | |
| else # normal | |
| PS1="[\\w]$ " | |
| fi | |
| ### Dir Colors ### |
| ''' String Methods ''' | |
| s = 'Jack the Crazy Giant' | |
| # methods | |
| s.upper() | |
| s.lower() | |
| # will return false because Python is case sensitive | |
| s.startswith('j') | |
| # indexing | |
| s[0] | |
| s[2:] |
| ''' | |
| Silver Sevens Casino scraper | |
| lxml docs: | |
| http://lxml.de/api/lxml.etree._Element-class.html | |
| ''' | |
| import re | |
| import requests |
| # coding: utf-8 | |
| ''' | |
| Scrape promotions page of Orleans Casino test | |
| ''' | |
| import re | |
| import requests | |
| from lxml import html | |
| class nFile(file): |
| define([ | |
| './module' | |
| ], function(module) { | |
| 'use strict'; | |
| module.controller('NewsletterCtrl', ['$scope', function($scope) { | |
| $scope.dj_test = "`test`: angular is loaded"; | |
| }]); | |
| module.controller('PricingCtrl', ['$scope', 'Pricing', function($scope, Pricing) { |
| {% extends "biz/base.html" %} | |
| {% load staticfiles %} | |
| {% block content %} | |
| <!-- start: MAIN CONTAINER --> | |
| <div class="main-container"> | |
| <section class="page-top"> | |
| <div class="container"> | |
| <div class="col-md-4 col-sm-4"> |