We need alpha 7 version from Babel.
npm install --save-dev [email protected]
npm install --save-dev babel-plugin-transform-optional-chaining@^7.0.0-alpha.13.1
Create a .babelrc file in the project root:
// The keyword Switch is extremely important. Without it, the NotFoundPage | |
// becomes visible on all other pages. | |
class App extends Component { | |
render () { | |
return ( | |
<div id='app' className='phs-app'> | |
<Header id="toolbar"/> | |
<NavigationBar /> | |
<div id='content'> |
/* | |
This a header file that includes every standard library. | |
You can use it to save time. | |
NOTE: This header file may not be recognized by compilers | |
other than gcc. | |
*/ | |
#include <bits/stdc++.h> | |
/* | |
//Use this if the above header file doesn't work. |
// Uses [request](https://github.com/mikeal/request) | |
// /?url=http://nodejs.org/logo.png | |
// /?uri=http://nodejs.org/logo.png | |
// /?url=http://nodejs.org/logo.png&cb=cbName | |
// /?url=http://nodejs.org/logo.png&callback=cbName | |
var fs = require('fs'); | |
var url = require('url'); | |
var http = require('http'); | |
var request = require('request'); |
/** Async version of Array.prototype.reduce() | |
* await reduce(['/foo', '/bar', '/baz'], async (acc, v) => { | |
* acc[v] = await (await fetch(v)).json(); | |
* return acc; | |
* }, {}); | |
*/ | |
export async function reduce(arr, fn, val, pure) { | |
for (let i=0; i<arr.length; i++) { | |
let v = await fn(val, arr[i], i, arr); | |
if (pure!==false) val = v; |
process.stdin.resume();//so the program will not close instantly | |
function exitHandler(options, err) { | |
if (options.cleanup) console.log('clean'); | |
if (err) console.log(err.stack); | |
if (options.exit) process.exit(); | |
} | |
//do something when app is closing | |
process.on('exit', exitHandler.bind(null,{cleanup:true})); |
if (!('path' in Event.prototype)) { | |
Object.defineProperty(Event.prototype, 'path', { | |
get: function () { | |
const path = []; | |
let currentElem = this.target; | |
while (currentElem) { | |
path.push(currentElem); | |
currentElem = currentElem.parentElement; | |
} | |
if (path.indexOf(window) === -1 && path.indexOf(document) === -1) |
// paste this before your require child_process at the beginning of your main index file. | |
(function() { | |
var childProcess = require("child_process"); | |
var oldSpawn = childProcess.spawn; | |
function mySpawn() { | |
console.log('spawn called'); | |
console.log(arguments); | |
var result = oldSpawn.apply(this, arguments); | |
return result; |
We need alpha 7 version from Babel.
npm install --save-dev [email protected]
npm install --save-dev babel-plugin-transform-optional-chaining@^7.0.0-alpha.13.1
Create a .babelrc file in the project root:
rabbitmqctl add_user test test | |
rabbitmqctl set_user_tags test administrator | |
rabbitmqctl set_permissions -p / test ".*" ".*" ".*" |
Free O'Reilly books and convenient script to just download them.
Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post
How to use:
download.sh
file and put it into a directory where you want the files to be saved.cd
into the directory and make sure that it has executable permissions (chmod +x download.sh
should do it)./download.sh
and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.