Yeoman is awesome, . RequireJS is super cool. Both don't glue together, atleast not officially.There is no official support for RequireJS from yeoman team.
Here is guide on what i did to work around with things to get it working .
- get the dependency
| pwd | |
| hostname | |
| mkdir | |
| cd | |
| cp | |
| mv | |
| less | |
| cat | |
| xargs | |
| find |
| Rule 1: use var . (avoid globals) | |
| Rule 2: Use THIS_IS_A_CONSTANT | |
| Rule 3: Use Semicolons and the end of variable and function expressions ( and not function declarations) | |
| Rule 4 : function declarations within blocks | |
| //DONT if(x){ | |
| function foo() | |
| } |
| function init(){ | |
| localConnection = new RTCPeerConnection(SERVER); | |
| localConnection.onicecandidate = function(event){ | |
| event.candidate && remoteConnection.addIceCandidate(event.candidate); | |
| }; | |
| dataChannel = localConnection.createDataChannel("sendDataChannel"); | |
| dataChannel.onerror = handleError; | |
| //dataChannel.onmessage = function(event){console.log("message recieved" + event.data);} | |
| dataChannel.onopen = function(){console.log("Hello world dataChannel is now open");} |
| { | |
| // JSHint Default Configuration File (as on JSHint website) | |
| // See http://jshint.com/docs/ for more details | |
| "maxerr" : 50, // {int} Maximum error before stopping | |
| // Enforcing | |
| "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) | |
| "camelcase" : true, // true: Identifiers must be in camelCase | |
| "curly" : true, // true: Require {} for every new block or scope |
| describe("getTweets", function () { | |
| var fakeData = [ | |
| { | |
| created_at: "Fri Apr 05 19:39:30 +0000 2013", | |
| text: "tweet 1", | |
| retweeted: false, | |
| favorited: false, | |
| user: { name: "name 1" } | |
| }, | |
| /* ... */ |
| :grinning:" : 0x1f600, | |
| ":grin:" : 0x1f601, | |
| ":joy:" : 0x1f602, | |
| ":smiley:" : 0x1f603, | |
| ":smile:": 0x1f604, | |
| ":sweat_smile:" : 0x1f605, | |
| ":laughing:": 0x1f606, | |
| ":innocent:": 0x1f607, | |
| ":smiling_imp:": 0x1f608, | |
| ":wink:": 0x1f609, |
| happy: [":)", ":-)", ":->"] | |
| ,sad: [":(", ":-(", ":-<"] | |
| ,grin: [":D", ":-D"] | |
| ,wink: [";)", ";-)"] | |
| ,surprise: [":O", ":-O", ":-o", ":o"] | |
| ,tongue: [":P", ":-P", ":p", ":-p"] | |
| ,shades: ["B)", "B-)"] | |
| ,angry: ["X(", "X-(", ":@", ":-@", "x(", "x-("] | |
| ,crying: [":'(", ":,("] | |
| ,indifferent: [":|", ":-|"] |
| http://blog.benoitvallon.com/tips/flattening-arrays-in-javascript/ | |
| http://rainsoft.io/how-three-dots-changed-javascript/ | |
| http://reactivex.io/learnrx/ |