- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
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
| // Detecting data URLs | |
| // data URI - MDN https://developer.mozilla.org/en-US/docs/data_URIs | |
| // The "data" URL scheme: http://tools.ietf.org/html/rfc2397 | |
| // Valid URL Characters: http://tools.ietf.org/html/rfc2396#section2 | |
| function isDataURL(s) { | |
| return !!s.match(isDataURL.regex); | |
| } | |
| isDataURL.regex = /^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i; |
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
| // | |
| // Responsive Margin & Padding Shortcuts for Twitter Bootstrap 3.0 | |
| // --------------------------------------------------------------- | |
| // This is an addition to Twitter Bootstrap that allows additional margin and padding shortcuts | |
| // for enhanced layout control purposes. It should be included after the bootstrap.less | |
| // import statement or precompiled as you see fit. It differs from bootstrap standards in | |
| // that for any given screen size it predetermines the margin/padding size. All you have to | |
| // do is specify the size you want xs,sm,md,lg, or xl. The exception is for items that you | |
| // want to be centered using auto left/right margins. This can be device responsive by | |
| // specifying mc-xs, mc-sm, mc-md, or mc-lg depending on when you want that behavior. |
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 $touchArea = $('#touchArea'), | |
| touchStarted = false, // detect if a touch event is sarted | |
| currX = 0, | |
| currY = 0, | |
| cachedX = 0, | |
| cachedY = 0; | |
| //setting the events listeners | |
| $touchArea.on('touchstart mousedown',function (e){ | |
| e.preventDefault(); |
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
| !function(root, _, undefined) { | |
| var Disposable = root.Disposable = function() { | |
| this.disposed = false; | |
| }; | |
| Disposable.prototype = { | |
| _dispose: function() { | |
| if (!this.disposed) { | |
| this.dispose(); | |
| this.disposed = true; |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
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
| /* | |
| Include this after bootstrap.css. Add class of | |
| vert-offset-top-value or vert-offset-bottom-value | |
| to your Bootstrap 3 default rows to prevent row content | |
| from touching the row content above or below. | |
| */ | |
| /* Vertical Offset Bottom */ | |
| .vert-offset-top-12{ | |
| margin-top: 12em; |
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
| exports.config = { | |
| // The address of a running selenium server. | |
| seleniumAddress: 'http://localhost:4444/wd/hub', | |
| // Capabilities to be passed to the webdriver instance. | |
| capabilities: { | |
| // 'browserName': 'internet explorer', - special installation needed | |
| // 'version':'10', | |
| 'browserName': 'chrome', | |
| //'browserName': 'firefox' |