For more comprehensive notes: https://github.com/pebreo/django-notes
# show migrations
./manage.py migrate --list
//Based on gulpfile.js from Google Web Starter Kit. | |
//https://github.com/google/web-starter-kit | |
'use strict'; | |
// Include Gulp & Tools We'll Use | |
var gulp = require('gulp'); | |
var $ = require('gulp-load-plugins')(); | |
var del = require('del'); | |
var runSequence = require('run-sequence'); | |
var browserSync = require('browser-sync'); |
For more comprehensive notes: https://github.com/pebreo/django-notes
# show migrations
./manage.py migrate --list
--- | |
# ^^^ YAML documents must begin with the document separator "---" | |
# | |
#### Example docblock, I like to put a descriptive comment at the top of my | |
#### playbooks. | |
# | |
# Overview: Playbook to bootstrap a new host for configuration management. | |
# Applies to: production | |
# Description: | |
# Ensures that a host is configured for management with Ansible. |
""" | |
http://datatables.net/forums/discussion/13679/working-code-for-server-side-paging-filtering-sorting-for-python-flask-mongodb | |
I wrote a python script for implementing server-side DataTables using python, flask, and mongodb. It works very well for me, so I thought I'd share the code for anyone that needs it. Below is the script generalized as a template for you guys. | |
by luv_tables | |
January 2013 | |
""" | |
from collections import namedtuple | |
from pymongo import MongoClient |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | |
<title>Document</title> | |
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css"> | |
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap-theme.min.css"> |
# http://stackoverflow.com/questions/14249115/serializing-output-to-json-valueerror-circular-reference-detected | |
from sqlalchemy import * | |
from sqlalchemy.orm import sessionmaker, scoped_session | |
from sqlalchemy.sql import text | |
def f(): | |
print 'hello' | |
engine = create_engine('mysql://readonly:[email protected]:3306/efn') | |
Session = scoped_session(sessionmaker(bind=engine)) |
username: vagrant | |
password: vagrant | |
sudo apt-get update | |
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev | |
sudo aptitude install mysql-server mysql-client | |
sudo nano /etc/mysql/my.cnf | |
change: |
""" | |
Requirements: | |
XlsxWriter==0.5.2 | |
beautifulsoup4==4.3.2 | |
requests==2.2.1 | |
""" | |
from xlsxwriter.workbook import Workbook | |
from bs4 import BeautifulSoup |