Skip to content

Instantly share code, notes, and snippets.

import React, { Component } from 'react'
import { Row, Col } from 'reactstrap';
import TotalCount from './widgets/TotalCounts';
import PivotWidget from './PivotWidget';
import BarGraph from './BarGraph';
import CustomTable from './CustomTable';
import DemoTable from './DemoTable';
// # assuming you filtered all your stuff into object format already
req.params = {
firstname: "foo",
lastname: "bar",
user_id: 123,
something: null
}
let query = knex().select()
const nexpect = require('nexpect')
nexpect.spawn('sudo openfortivpn -c /openfortivpn.conf')
.wait("Two-factor authentication token:", () => {
console.log('enter your 2factor auth code:')
})
.wait("INFO: Tunnel is up and running.", () => {
console.log('tunnel is up and running')
})
@nomoney4me
nomoney4me / .js
Last active October 24, 2018 01:18
export default (props) => {
console.log(props.data)
return (
<PivotTable
data={ props.data }
cols={ ['Incoming'] }
rows={ ['Status'] }
tableOptions={ {
ERROR in ./src/client.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
ReferenceError: Using removed Babel 5 option: .modules - Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules
at throwUnknownError (E:\proj\sfcs\node_modules\@babel\core\lib\config\validation\options.js:120:11)
at Object.keys.forEach.key (E:\proj\sfcs\node_modules\@babel\core\lib\config\validation\options.js:107:5)
at Array.forEach (<anonymous>)
at validateNested (E:\proj\sfcs\node_modules\@babel\core\lib\config\validation\options.js:83:21)
at validate (E:\proj\sfcs\node_modules\@babel\core\lib\config\validation\options.js:74:10)
at file (E:\proj\sfcs\node_modules\@babel\core\lib\config\config-chain.js:169:34)
at cachedFunction (E:\proj\sfcs\node_modules\@babel\core\lib\config\caching.js:33:19)
{
"execResult": {
"reportView": {
"chart": {
"styles": {
"global": {
"datalabels": {
"fontsize": "auto",
"displayValues": 1,
"percent": 0,
// assuming you're using axios
const axios = require('axios')
axios('localhost:3000/').then(response => {
console.log(response)
})
server {
listen 81 default_server;
listen [::]:81 default_server;
server_name demo.soon.it;
location /fb {
proxy_pass http://127.0.0.1:3001;
}
# everything else is left default
const express = require('express')
, app = express();
app.get('/', (req, res) => {
res.send('hello world')
})
app.listen(3000, console.log('listening on 3000'))
let middleware = (req, res, next) => {
req.user = {
username: 'foo'
}
next()
}
app.get('/', middleware, (req, res) => {
// # req.user is available here
console.log(req.user)