Operating System Ubuntu 14.04 via Koding.com
Install node.js
sudo apt-get update
sudo apt-get install nodejs
Check node.js version
| var express = require('express'); | |
| var app = express(); | |
| var allowCORS = function(req, res, next) { | |
| res.header('Access-Control-Allow-Origin', '*'); | |
| res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); | |
| res.header('Access-Control-Allow-Headers', 'Content-Type'); | |
| next(); | |
| } |
| var hear=new Headers({ | |
| "Content-Type":"image/png", | |
| "Accept":"*/*", | |
| "Connection":"keep-alive" | |
| }) | |
| var myinit2={ | |
| method:"GET", | |
| header:hear | |
| } | |
| fetch("/img/icons/logo.png",myinit2).then(response=>{if(response.ok){return response.blob();}}).then(data=>console.log(URL.createObjectURL(data))); |
| fetch('./api/some.json') | |
| .then( | |
| function(response) { | |
| if (response.status !== 200) { | |
| console.log('Looks like there was a problem. Status Code: ' + | |
| response.status); | |
| return; | |
| } | |
| // Examine the text in the response |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>My Web</title> | |
| <!-- <script src="https://unpkg.com/mithril" charset="utf-8"></script> --> | |
| <!-- <script src="https://unpkg.com/mithril@1.1.1/mithril.min.js" charset="utf-8"></script> --> | |
| </head> | |
| <body> | |
| <!-- data-info="id,user_id,kampanya_id,reklam_id" --> |
| <?php | |
| function base64url_encode($data) { | |
| return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); | |
| } | |
| function base64url_decode($data) { | |
| return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT)); | |
| } | |
| ?> |
| #!/bin/sh | |
| ab -n 100 -c 10 http://127.0.0.1:8300/test.cfm > test1.txt & | |
| ab -n 100 -c 10 http://127.0.0.1:8300/scribble.cfm > test2.txt & | |
| ab -n 100 -c 10 http://www.yahoo.com/ |
| {url:'stun:stun01.sipphone.com'}, | |
| {url:'stun:stun.ekiga.net'}, | |
| {url:'stun:stun.fwdnet.net'}, | |
| {url:'stun:stun.ideasip.com'}, | |
| {url:'stun:stun.iptel.org'}, | |
| {url:'stun:stun.rixtelecom.se'}, | |
| {url:'stun:stun.schlund.de'}, | |
| {url:'stun:stun.l.google.com:19302'}, | |
| {url:'stun:stun1.l.google.com:19302'}, | |
| {url:'stun:stun2.l.google.com:19302'}, |
| module.exports = load | |
| function load (src, cb) { | |
| var head = document.head || document.getElementsByTagName('head')[0] | |
| var script = document.createElement('script') | |
| script.type = 'text/javascript' | |
| script.async = true | |
| script.src = src |
| var express = require('express'); | |
| var http = require('http'); | |
| var app = express(); | |
| app.use(express.static('.')); | |
| // Create an HTTP service. | |
| http.createServer(app).listen(8000); | |
| console.log('serving on http://localhost:8000'); |