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 express = require('express'); | |
| var app = express(); | |
| // ... | |
| module.exports = app; |
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 = db.model('User', { | |
| name: String | |
| , dob: { type: Date} | |
| , age: Number | |
| , email_id: 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
| #!/bin/sh | |
| JAR=/opt/astah_community/astah-community.jar | |
| JAVA_OPTS="-Xms16m -Xmx384m" | |
| ${JAVA_HOME}/bin/java $JAVA_OPTS -jar $JAR $1 $2 $3 |
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
| [Desktop Entry] | |
| Encoding=UTF-8 | |
| Name=Genymotion | |
| Comment=Alternative Android Emulator based on VirtualBox | |
| Exec=/opt/genymotion/genymotion | |
| Icon=/opt/genymotion/icons/icon.png | |
| NoDisplay=false | |
| Terminal=false | |
| Type=Application | |
| Categories=Application;Development; |
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
Show hidden characters
| { | |
| "color_scheme": "Packages/Theme - Spacegray/base16-eighties.dark.tmTheme", | |
| "font_face": "Source Code Pro", | |
| "font_size": 12, | |
| "ignored_packages": | |
| [ | |
| "Vintage" | |
| ], | |
| "overlay_scroll_bars": "enabled", | |
| "preview_on_click": 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
| // This is the simplest possible approach - use a custom module to wrap a single, pre-configured | |
| // mail transport instance and then use sinon.js to stub out that modules sendmail() | |
| // This approach has its limitations, but it is still better than having 'if(NODE_ENV === 'test')' | |
| // all over the code base. | |
| // -- app/sendmail.js -- | |
| var nodemailer = require('nodemailer'); | |
| var config = require('config').email; |
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
| <?php | |
| // Replace '#' with whatever substitute desired, use '' to strip | |
| echo preg_replace('@^/|/$@', '#', '/foo/'); // #foo# |
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
| <?php | |
| function mkUri($base, $path) { | |
| $base = preg_replace("/\/$/", "", $base); | |
| $path = preg_replace("/^\//", "", $path); | |
| return "$base/$path"; | |
| } | |
| echo mkUri("http://localhost/", "/foo") . "\n"; | |
| echo mkUri("http://localhost/", "foo") . "\n"; |
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
| <?php | |
| echo preg_replace('@^/|/$@', '', '/foo/'); // 'foo' |
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 EventEmitter = require('events').EventEmitter; | |
| var emitter = new EventEmitter(); | |
| var obj = Object.create(EventEmitter.prototype); | |
| obj.say = function say() { | |
| obj.emit('hello'); | |
| } |
OlderNewer