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
| const LOOP_COUNT = 1000 * 1000; | |
| var startTime = 0; | |
| function benchStart() { | |
| startTime = new Date().getTime(); | |
| } | |
| function printTime() { | |
| console.log((new Date().getTime())- startTime); |
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
| const LOOP_COUNT = 1000 * 1000; | |
| var startTime = 0; | |
| function benchStart() { | |
| startTime = new Date().getTime(); | |
| } | |
| function printTime() { | |
| console.log((new Date().getTime())- startTime); |
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 http = require('http'); | |
| var server = http.createServer(function (req, res) { | |
| res.writeHead(200, {'Content-Type': 'text/plain'}); | |
| res.end('Hello World\n'); | |
| }); | |
| server.listen(process.env.C9_PORT, "0.0.0.0"); | |
| console.log('Server running!'); |
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 http = require('http'); | |
| var server = http.createServer(function (req, res) { | |
| res.writeHead(200, {'Content-Type': 'text/plain'}); | |
| res.write('Hello\n'); | |
| setTimeout(function() { | |
| res.end('World\n'); | |
| }, 1000); | |
| }); |
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 isEven(a) { | |
| a = a.toString().replace(/[^0-9.]/g, ""); | |
| var stack = []; | |
| var rev = a.split('').reverse(); | |
| for (var ix = 0; ix < rev.length; ix++) { | |
| if (rev[ix] == ".") stack.push("dot") | |
| else if (rev[ix] == "1" || rev[ix] == "3" || rev[ix] =="5" || rev[ix] == "7" || rev[ix] == "9") | |
| stack.push("oneven") | |
| else | |
| stack.push('even') |
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
| parent(a, b) -> | |
| string(a), | |
| string(b). | |
| ancestor(a, b) -> | |
| string(a), | |
| string(b). | |
| ancestor(a, c) <- | |
| parent(a, b). |
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
| # ps aux | |
| USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND | |
| root 1 0.0 0.1 30600 1732 ? Ss May22 0:02 systemd --log-target=journal | |
| root 2 0.0 0.0 0 0 ? S May22 0:00 [kthreadd] | |
| root 3 0.0 0.0 0 0 ? S May22 0:01 [ksoftirqd/0] | |
| root 5 0.0 0.0 0 0 ? S May22 0:00 [kworker/u:0] | |
| root 6 0.0 0.0 0 0 ? S May22 0:02 [migration/0] | |
| root 7 0.0 0.0 0 0 ? S May22 0:02 [migration/1] | |
| root 9 0.0 0.0 0 0 ? S May22 0:00 [ksoftirqd/1] | |
| root 11 0.0 0.0 0 0 ? S< May22 0:00 [cpuset] |
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
| { config, pkgs, ... }: | |
| { | |
| # Bare basics | |
| boot.loader.grub.enable = true; | |
| boot.loader.grub.version = 1; | |
| boot.loader.grub.extraPerEntryConfig = "root (hd0)"; | |
| boot.loader.grub.device = "nodev"; | |
| boot.initrd.kernelModules = [ "xen_blkfront" ]; | |
| fileSystems."/boot".fsType = "ext2"; | |
| fileSystems."/boot".device = "/dev/xvda"; |
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 | |
| set -e | |
| # Install the binary tarball... | |
| cd / | |
| wget -O - http://hydra.nixos.org/job/nix/trunk/binaryTarball.x86_64-linux/latest/download | tar xvj | |
| /usr/bin/nix-finish-install | |
| rm /usr/bin/nix-finish-install |
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 | |
| sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -" | |
| # Add the Docker repository to your apt sources list. | |
| sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ | |
| > /etc/apt/sources.list.d/docker.list" | |
| # update | |
| sudo apt-get update |
OlderNewer