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
<script> | |
// Load browser shims | |
Modernizr.load([ | |
{ | |
test: window.JSON, | |
nope: 'libs/shims/json3.js' | |
}, | |
{ | |
test: Object.getOwnPropertyNames, | |
nope: "libs/shims/es5-shim.js", |
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
2012-10-05 02:40:24.209:INFO:oejs.Server:jetty-8.1.5.v20120716 | |
2012-10-05 02:40:27.457:INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one. | |
2012-10-05 02:41:41.180:WARN:oejx.XmlConfiguration:Config error at <Set name="sessionPath">/</Set> java.lang.NoSuchMethodException: class org.eclipse.jetty.server.session.HashSessionManager.setSessionPath(class java.lang.String) | |
2012-10-05 02:41:41.180:WARN:oejx.XmlConfiguration:Config error at <Get name="sessionManager"><Set name="sessionCookie">MYJETTYSESSION</Set><Set name="sessionPath">/</Set><Set name="secureCookies">true</Set><Set name="httpOnly">true</Set></Get> java.lang.NoSuchMethodException: class org.eclipse.jetty.server.session.HashSessionManager.setSessionPath(class java.lang.String) | |
2012-10-05 02:41:41.180:WARN:oejx.XmlConfiguration:Config error at <Get name="sessionHandler"><Get name="sessionManager"><Set name="sessionCookie">MYJETTYSESSION</Set><Set name="sessionPath">/</Set><Set |
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
/* | |
* @description Extracts data attributes from script tag that contains data-main attribute | |
* and returns an object containing all of the data values. | |
* @author Tauren Mills (github.com/tauren) | |
*/ | |
define(function() { | |
// Get all of the script tags | |
var scripts = document.getElementsByTagName('script'); | |
var data = {}; |
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
module.exports = { | |
// Name of the application (used as default <title>) | |
appName: "Sails Application", | |
// Port this Sails application will live on | |
port: 1337, | |
// The environment the app is deployed in |
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
// Sipmle AOP after function | |
var after = function(base, after) { | |
if (!base) { | |
return after; | |
} | |
return function composedAfter() { | |
var res = base.apply(this, arguments); | |
after.apply(this, arguments); | |
return res; |
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 _ = require('lodash'); | |
/** | |
* Make sure to always return an array. If an array is passed, then | |
* return the array. If passed a string, return an array containing | |
* that string. If passed undefined or null, return an empty array. | |
* | |
* @param [String|Array] values A string or an array | |
* @return [Array] | |
*/ |
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
module.exports = function(req, res, next) { | |
// Make sure request is for a single entity, not for a collection of entities | |
if (!req.params.id) { | |
return res.forbidden('error.noPermission'); | |
} | |
return next(); | |
}; |
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
STEP 1 | |
npm install sails@beta -g | |
git clone [email protected]:coinprofit/sails-model-question.git | |
cd sails-model-question | |
npm init | |
sails lift | |
STEP 2 |
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
module.exports = { | |
attributes: { | |
// The participation that submitted this entry | |
participation: { | |
model: 'participation', | |
required: true | |
}, |
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
let candidatesToSend = [] | |
let candidatesReceived = [] | |
let socketSubject = Observable.webSocket({ | |
url: 'wss://...', | |
openObserver: { | |
next: e => { | |
e.currentTarget.binaryType = 'arraybuffer' | |
candidatesToSend.forEach(candidate => { | |
console.log('sending candidate', candidate) |