This file contains 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
#!/usr/bin/env node | |
'use strict'; | |
/** | |
* bin/node-simple-http-daemon | |
*/ | |
// Everything above this line will be executed twice | |
require('daemon')(); |
This file contains 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 request = require('supertest'); | |
var assert = require('assert'); | |
// ... | |
var testUser = { | |
username: 'thisisatestuser', | |
email: '[email protected]', | |
password: 'test' | |
}; |
This file contains 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
'use strict'; | |
/** | |
* Module dependencies. | |
*/ | |
var log = require('winston-wrapper')(module); | |
var config = require('nconf'); | |
var express = require('express'); |
This file contains 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
The initial build for the application failed: Shell command '/sbin/runuser -s /bin/sh 52bab4925004467099000001 -c "exec /usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c4,c804' /bin/sh -c \"gear postreceive --init >> /tmp/initial-build.log 2>&1\""' returned an error. rc=255 .Last 10 kB of build output: Stopping NodeJS cartridge Repairing links for 1 deployments Building git ref 'master', commit bfb8307 Building NodeJS cartridge npm info it worked if it ends with ok npm info using [email protected] npm info using [email protected] npm info preinstall [email protected] npm info trying registry request attempt 1 at 05:34:37 npm http GET https://registry.npmjs.org/bootable npm info trying registry request attempt 1 at 05:34:38 npm http GET https://registry.npmjs.org/require-tree npm info trying registry request attempt 1 at 05:34:38 npm http GET https://registry.npmjs.org/stylus npm info trying registry request attempt 1 at 05:34:38 npm http GET https://registry.npmjs.org/connect-stylus npm info trying registry re |
This file contains 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
$ ab -n 1000 -c 100 -k -q http://0.0.0.0:8000/ | |
This is ApacheBench, Version 2.3 <$Revision: 1430300 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 0.0.0.0 (be patient).....done | |
Server Software: |
This file contains 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
// Synchronous | |
var a = function (x) { | |
while(new Date().getTime() < now + 1000) { | |
// do nothing | |
} | |
console.log(x) | |
}; | |
a(1); // waits 1 sec and prints 1 | |
a(2); // waits for finish `a(1)` then wait another 1 sec and prints 1 |
This file contains 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
git submodule add git://github.com/chneukirchen/rack.git rack | |
# Initialized empty Git repository in /opt/subtest/rack/.git/ | |
# remote: Counting objects: 3181, done. | |
#remote: Compressing objects: 100% (1534/1534), done. | |
# remote: Total 3181 (delta 1951), reused 2623 (delta 1603) | |
# Receiving objects: 100% (3181/3181), 675.42 KiB | 422 KiB/s, done. | |
# Resolving deltas: 100% (1951/1951), done. | |
$ git submodule init | |
# Submodule 'rack' (git://github.com/chneukirchen/rack.git) registered for path 'rack' |
This file contains 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
/** | |
* margins | |
*/ | |
body { | |
background: #aeb; | |
} | |
.first, .second { | |
width: 200px; |
This file contains 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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
.font { | |
width: 200px; | |
height: 100px; | |
font-size:20px; | |
} |
This file contains 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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
.a { | |
width: 600px; | |
height: 400px; | |
background: grey; | |
position: relative; | |
} |