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
| <?php | |
| /** | |
| * | |
| * This is a quick way to turn a simple text file | |
| * with a list of urls in a text file (sitemap-urls.txt) | |
| * into a valid XML Sitemap: | |
| * http://en.wikipedia.org/wiki/Sitemaps | |
| * Put this file sitemap.xml.php and sitemap-urls.txt at | |
| * the webroot http://example.com/sitemap.xml.php |
| var fs = require("fs") | |
| var ssl_options = { | |
| key: fs.readFileSync('privatekey.pem'), | |
| cert: fs.readFileSync('certificate.pem') | |
| }; | |
| var port = process.env.PORT || 3000; | |
| var express = require('express'); | |
| var ejs = require('ejs'); | |
| var passport = require('passport') |
| var application_root = __dirname, | |
| express = require("express"), | |
| path = require("path"), | |
| mongoose = require('mongoose'); | |
| var app = express.createServer(); | |
| // database | |
| mongoose.connect('mongodb://localhost/ecomm_database'); |
| <?xml version="1.0"?> | |
| <root> | |
| <appdef> | |
| <appname>Terminal</appname> | |
| <equal>com.apple.Terminal</equal> | |
| </appdef> | |
| <item> | |
| <name>TMUX Key Remappings</name> | |
| <item> | |
| <name>TMUX: Right Control to Ctrl+B</name> |
| #! /usr/bin/env python | |
| # | |
| # coding: utf-8 | |
| """ | |
| Version-bump script for Maven projects. | |
| Reads pom.xml, parses the version, increments it and writes an updated pom to stdout. | |
| Usage: | |
| pom-vbump.py [-i] [-v <new version number>] [path to pom.xml] |
| /** | |
| * VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units | |
| * | |
| * To overcome this, create media queries that target the width, height, and orientation of iOS devices. | |
| * It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing | |
| * the height of element `.foo` —which is a full width and height cover image. | |
| * | |
| * iOS Resolution Quick Reference: http://www.iosres.com/ | |
| */ | |
| node1: | |
| image: hauptmedia/mariadb:10.1 | |
| hostname: node1 | |
| ports: | |
| - 13306:3306 | |
| environment: | |
| - MYSQL_ROOT_PASSWORD=test | |
| - REPLICATION_PASSWORD=test | |
| - MYSQL_DATABASE=maria | |
| - MYSQL_USER=maria |
Hopefully this will answer "How do I setup or start a Django project?" I was trying to set up my own website, and there was a lot to read, learn and digest! Therefore, I put this together which is a collection of all the guides/blog posts/articles that I found the most useful. At the end of this, you will have your barebones Django app configured and ready to start building :)
NOTE: This guide was built using Django 1.9.5, NodeJS 4+ with NPM 3+
| # Remove foreman | |
| yum remove remove foreman foreman-installer foreman-proxy | |
| rm -rf /var/lib/foreman /usr/share/foreman /usr/share/foreman-proxy/logs | |
| rm /etc/httpd/conf.d/foreman.conf | |
| # Remove puppet | |
| yum remove puppet puppetmaster puppet-common puppetmaster-common puppetlabs-release | |
| rm -rf /usr/lib/ruby/vendor_ruby/puppet /usr/share/puppet /var/lib/puppet /etc/puppet | |
| rm /etc/apache2/conf.d/puppet.conf |