This file contains hidden or 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
| /Users/tanepiper/work/pebblecode/ad-platform/node_modules/primus/transformer.js:115 | |
| res.setHeader('Content-Type', 'text/javascript; charset=utf-8'); | |
| ^ | |
| TypeError: Object #<Object> has no method 'setHeader' | |
| at serve (/Users/tanepiper/work/pebblecode/ad-platform/node_modules/primus/transformer.js:115:9) | |
| at EventEmitter.emit (events.js:98:17) | |
| at request (/Users/tanepiper/work/pebblecode/ad-platform/node_modules/primus/transformer.js:136:55) | |
| at EventEmitter.emit (events.js:106:17) | |
| at internals.Request.log (/Users/tanepiper/work/pebblecode/ad-platform/node_modules/hapi/lib/request.js:218:17) | |
| at new module.exports.internals.Request (/Users/tanepiper/work/pebblecode/ad-platform/node_modules/hapi/lib/request.js:151:10) |
This file contains hidden or 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
| Listener.prototype.getPeakFrequency = function() { | |
| // Find where to start. | |
| var start = this.freqToIndex(this.options.codec.options.minFreq); | |
| // TODO: use first derivative to find the peaks, and then find the largest peak. | |
| // Just do a max over the set. However this doesn't seem to be reliable | |
| var max = _.max(this.frequencies); | |
| if (max > this.options.peakThreshold) { | |
| return this.indexToFreq(_.indexOf(this.frequencies, max)); | |
| } |
This file contains hidden or 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
| Instance.db.User = Instance.db.sequelize.define('user', { | |
| email: { | |
| type: Sequelize.STRING, | |
| allowNull: false, | |
| validate: { | |
| isEmail: true | |
| } | |
| }, | |
| password: { | |
| type: Sequelize.STRING, |
This file contains hidden or 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 LocalStrategy = require('passport-local').Strategy; | |
| var Bcrypt = require('bcrypt'); | |
| module.exports = function(Instance) { | |
| var plugins = { | |
| yar: { | |
| cookieOptions: { | |
| password: 'adon-platform', // cookie secret | |
| isSecure: false // required for non-https applications |
This file contains hidden or 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
| Executing (default): CREATE TABLE IF NOT EXISTS "clients" ("id" SERIAL , "name" VARCHAR(255) NOT NULL, "slug" VARCHAR(20) DEFAULT '', "description" TEXT DEFAULT '', "isActive" BOOLEAN NOT NULL DEFAULT true, "userId" INTEGER REFERENCES "users" ("id") ON DELETE CASCADE, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id")); | |
| Executing (default): CREATE TABLE IF NOT EXISTS "projects" ("id" SERIAL , "name" VARCHAR(255) NOT NULL, "clientId" INTEGER REFERENCES "clients" ("id") ON DELETE CASCADE, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id")); | |
| Executing (default): CREATE TABLE IF NOT EXISTS "campaigns" ("id" SERIAL , "name" VARCHAR(255) NOT NULL, "shortcode" VARCHAR(255), "url" VARCHAR(255), "projectId" INTEGER REFERENCES "projects" ("id") ON DELETE CASCADE, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "clientId" INTEGER, PRIMARY KEY ("id |
This file contains hidden or 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 Sequelize = require('sequelize'); | |
| var HashID = require('hashids'); | |
| module.exports = function(Instance) { | |
| Instance.db.Campaign = Instance.db.sequelize.define('campaign', { | |
| name: { | |
| type: Sequelize.STRING, | |
| allowNull: false | |
| }, |
This file contains hidden or 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
| > adon-platform@0.0.1 sync /Users/tanepiper/work/pebblecode/adon-platform | |
| > node scripts/sync.js | |
| done | |
| done | |
| done | |
| done | |
| done | |
| done | |
| done |
This file contains hidden or 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
| Instance.db.User.sync(function() { | |
| Instance.db.Client.sync(function() { | |
| Instance.db.Project.sync(function() { | |
| Instance.db.Campaign.sync(); | |
| }) | |
| }) | |
| }); |
This file contains hidden or 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
| Instance.db.Client.find({where: {id: request.params.cid}}) | |
| .success(function(client) { | |
| client.updateAttributes(request.payload) | |
| .success(function(client) { | |
| reply(client); | |
| }) | |
| .error(function(error) { | |
| reply(error); | |
| }); | |
| }) |
This file contains hidden or 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
| <html> | |
| <head> | |
| <title><%= title %></title> | |
| </head> | |
| <body> | |
| <div class="blog"> | |
| <h1><%= title%></h1> | |
| <% blogItems.forEach(function(item) { %> |
OlderNewer