Install node-repl-promised:
npm install -g repl-promised
Use the repl to list all users
$ node-promised
> var app = require('./app');
undefined
> var Bookshelf = app.get('bookshelf');
undefined
| module.exports = function (grunt) { | |
| // show elapsed time at the end | |
| require('time-grunt')(grunt); | |
| // load all grunt tasks | |
| require('load-grunt-tasks')(grunt); | |
| //MODIFIED: add require for connect-modewrite | |
| var modRewrite = require('connect-modrewrite'); | |
| grunt.initConfig({ |
| <html> | |
| <head> | |
| <title>Post form in a new window without losing handle to the window</title> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
| <script> | |
| $(function() { | |
| $('form').on('submit', function(ev) { | |
| var form = $(this); | |
| form.attr('target', 'new-window'); |
| (ns server.routes | |
| (:use compojure.core | |
| server.views | |
| [ring.middleware.json :only (wrap-json-response)] | |
| ring.middleware.session | |
| [ring.util.response :only (response)] | |
| [hiccup.middleware :only (wrap-base-url)]) | |
| (:require [compojure.route :as route] | |
| [compojure.handler :as handler] | |
| [compojure.response :as response])) |
| var JSZip = require('jszip'), | |
| Q = require('q'); | |
| var downloadFile = function(url) { | |
| var defer = Q.defer(); | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('GET', url, true); | |
| xhr.responseType = 'arraybuffer'; | |
| xhr.onreadystatechange = function() { | |
| if (xhr.readyState === 4) { |
Install node-repl-promised:
npm install -g repl-promised
Use the repl to list all users
$ node-promised
> var app = require('./app');
undefined
> var Bookshelf = app.get('bookshelf');
undefined
| import React, { useEffect } from "react"; | |
| import { withRouter } from 'react-router-dom' | |
| import { useProductSelectors, useProductActions } from "../redux/actions/products" | |
| import Qs from 'querystring' | |
| const Products = withRouter(({ location: { search }, history}) => { | |
| const actions = useProductActions() | |
| const [products] = useProductSelectors(selectors => [selectors.getProducts()]) |
| import Raven from 'raven-js'; | |
| if (process.env.NODE_ENV === 'production') { | |
| Raven.config('https://<foo>@app.getsentry.com/<bar>').install(); | |
| window.onunhandledrejection = function(data) { | |
| Raven.captureException(data.reason); | |
| }; | |
| } |
| const TeamForm = ({ handleSubmit, i18n, array }) => ( | |
| <form onSubmit={handleSubmit}> | |
| { /* Other form inputs */ } | |
| <Field name="persons" component={renderRows(i18n)} array={array} /> | |
| { /* Other form inputs */ } | |
| </form> | |
| ); | |
| 'use strict'; | |
| var validator = require('shared/schemas/validator'), | |
| _ = require('underscore'); | |
| module.exports = { | |
| onPropertyChanged: function(property, newValue) { | |
| var newObject = _.extend({}, this.props[this.objectPropertyPath], this.state[this.objectPropertyPath], _.isObject(property) ? property : _.object([[property, newValue]])); | |
| newObject = this.transformObject(newObject); | |
| var prms = {validationErrors: {}}; | |
| prms[this.objectPropertyPath] = newObject; |
| //omitted a lot | |
| translations.fi().then(i18n => { | |
| let initialState = { | |
| locales: { | |
| currentLocale: 'fi', | |
| i18n | |
| } | |
| }; | |
| const store = am(createStore)(reducer, initialState); |