strace -e trace=file -fp PID (file) or strace -e trace=desc -fp PID (file descriptors)
Common calls:
accessclose– close file handlefchmod– change file permissionsfchown– change file ownership
| var $el = $("#very-specific-design"); | |
| var elHeight = $el.outerHeight(); | |
| var elWidth = $el.outerWidth(); | |
| var $wrapper = $("#scaleable-wrapper"); | |
| $wrapper.resizable({ | |
| resize: doResize | |
| }); |
| /* | |
| * Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
| */ | |
| var http = require('http'), | |
| fs = require('fs'), | |
| util = require('util'); | |
| http.createServer(function (req, res) { | |
| var path = 'video.mp4'; |
| // Usage | |
| <Router> | |
| <Provider store={store}> | |
| <ListeningRouter> | |
| <Main /> | |
| </ListeningRouter> | |
| </Provider> | |
| </Router> |
| var React = { | |
| createElement: function (tag, attrs, children) { | |
| var e = document.createElement(tag); | |
| // Add attributes | |
| for (var name in attrs) { | |
| if (name && attrs.hasOwnProperty(name)) { | |
| var v = attrs[name]; | |
| if (v === true) { | |
| e.setAttribute(name, name); |
| openssl genrsa -out privkey.pem 768 | |
| openssl pkcs8 -topk8 -nocrypt -in privkey.pem -out privkey2.pem |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"/> | |
| <title>Object.keys vs for..in #jsbench #jsperf</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
| <script src="./suite.js"></script> | |
| </head> | |
| <body> | |
| <h1>Open the console to view the results</h1> |
| First, install nginx for mac with "brew install nginx". | |
| Then follow homebrew's instructions to know where the config file is. | |
| 1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self | |
| 2. Copy it somewhere (use full path in the example below for server.* files) | |
| 3. sudo nginx -s reload | |
| 4. Access https://localhost/ | |
| Edit /usr/local/etc/nginx/nginx.conf: |
| define(function(require) { | |
| var React = require('react'); | |
| var paramRegex = /__(\d)+/; | |
| var parser = new DOMParser(); | |
| var errorDoc = parser.parseFromString('INVALID', 'text/xml'); | |
| var errorNs = errorDoc.getElementsByTagName("parsererror")[0].namespaceURI; | |
| // turns the array of string parts into a DOM | |
| // throws if the result is an invalid XML document. |