This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IValidatable | |
{ | |
bool Validate(); | |
IEnumerable<ValidationError> ModelErrors { get; } | |
} | |
namespace App.Model | |
{ | |
public class Client : IValidatable | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* app/ | |
* scripts/ | |
* app.js | |
* controllers/ | |
* HomeCtrl.js | |
* styles/ | |
* site.less (@imports vendor CSS/LESS files) | |
* views/ | |
* home.html | |
* vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |