Skip to content

Instantly share code, notes, and snippets.

View brendanmckenzie's full-sized avatar

Brendan McKenzie brendanmckenzie

View GitHub Profile
interface IValidatable
{
bool Validate();
IEnumerable<ValidationError> ModelErrors { get; }
}
namespace App.Model
{
public class Client : IValidatable
{
* app/
* scripts/
* app.js
* controllers/
* HomeCtrl.js
* styles/
* site.less (@imports vendor CSS/LESS files)
* views/
* home.html
* vendor/
from sqlalchemy import create_engine, Table
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
DB_DSN = 'postgresql+psycopg2://@/db'
__engine__ = create_engine(DB_DSN)
__base__ = declarative_base()
__base__.metadata.bind = __engine__
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')({lazy:false}),
less = require('gulp-less'),
path = require('path'),
historyApiFallback = require('connect-history-api-fallback'),
inject = require('gulp-inject')
mainBowerFiles = require('main-bower-files')
jshint = require('gulp-jshint');
gulp.task('scripts-dist', ['copy-index-dist'], function() {
vagrant@vagrant:~$ sudo apt-get install php5-fpm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
php-pear
The following NEW packages will be installed:
php5-fpm
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
Need to get 2,192 kB of archives.
from config import WEB_ROOT
def init_cors(app):
@app.after_request
def add_cors_headers(response):
response.headers.add('Access-Control-Allow-Origin', WEB_ROOT)
response.headers.add('Access-Control-Allow-Credentials', 'true')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type')
return response
def init_errors(app):
messages = {
400: 'Bad request.',
401: 'Unauthorised.',
403: 'Forbidden.',
404: 'Not found.',
405: 'Method not allowed.',
406: 'Not acceptable.',
500: 'Server error.'
}
This file has been truncated, but you can view the full file.
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'install' ]
2 info using npm@1.3.10
3 info using node@v0.10.25
4 verbose readDependencies using package.json deps
5 verbose install where, deps [ '/home/vagrant/projects/takeoffgo-web',
5 verbose install [ 'connect-history-api-fallback',
5 verbose install 'gulp',
5 verbose install 'gulp-angular-templatecache',
5 verbose install 'gulp-concat',
from tempfile import mkdtemp
from datetime import datetime
from envelopes import Envelope, SMTP
from task_queue.app import app
import requests
from utils import process_template
from config import SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, SMTP_TLS
from model import Session, EmailMessage
from os import unlink
from uuid import uuid3, NAMESPACE_DNS
from task_queue.app import app
from utils import upload, pdf, html
from model import Session, AgencyPdf
def upload_pdf(pdf_file):
file_name = str(uuid3(NAMESPACE_DNS, 'takeoffgo.com')) + '.pdf'
path = 'pdf/' + file_name