This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* Module dependencies. | |
*/ | |
var init = require('./config/init')(), | |
config = require('./config/config'), | |
mongoose = require('mongoose'); | |
/** | |
* Main application entry file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>{{title}}</title> | |
<!-- General META --> | |
<meta charset="utf-8"> | |
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* Module dependencies. | |
*/ | |
var mongoose = require('mongoose'), | |
Schema = mongoose.Schema, | |
_ = require('lodash'), | |
async = require('async'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ThemeDoc.collection.find({_id: mongoose.Types.ObjectId(themeId)}, {}, {'limit': 1}).toArray(function (err, themes) { | |
//console.log(themes); | |
if (themes.length == 1) { | |
QuestionDoc.collection.find({'theme': mongoose.Types.ObjectId(themeId)}, {}, {'limit': 3}).toArray(function(err, questions) { | |
//console.log(questions); | |
if(questions.length == 3) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { actionTypes } from 'redux-router5'; | |
import { Record } from 'immutable'; | |
// eslint-disable-next-line new-cap | |
const State = Record({ | |
route: null, | |
previousRoute: null, | |
transitionRoute: null, | |
transitionError: null, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return function (createStore) { | |
return function (reducer, initialState, enhancer) { | |
var enhancedReducer = function enhancedReducer(state, action) { | |
//immutable | |
var vanillaState = state.delete('router'); | |
var newState = reducer(vanillaState, action); | |
// Support redux-loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
class EmbedIframe extends React.Component { | |
resizeIframe = () => { | |
const height = Math.max(this.props.minHeight, this.iframe.contentWindow.document.body.offsetHeight); | |
this.iframe.height = `${height}px`; | |
} | |
componentDidMount = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Editor, { createEditorStateWithText, PluginProvider } from 'draft-js-plugins-editor'; // eslint-disable-line import/no-unresolved | |
import createInlineToolbarPlugin from 'draft-js-inline-toolbar-plugin'; // eslint-disable-line import/no-unresolved | |
import editorStyles from './editorStyles.css'; | |
const inlineToolbarPlugin = createInlineToolbarPlugin(); | |
const { InlineToolbar } = inlineToolbarPlugin; | |
const plugins = [inlineToolbarPlugin]; | |
const text = 'In this editor a toolbar shows up once you select part of the text …'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
util.py[DEBUG]: Failed running /var/lib/cloud/instance/scripts/part-001 [1]#012Traceback (most recent call last):#012 File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 711, in runparts#012 subp(prefix + [exe_path], capture=False)#012 File " /usr/lib/python3/dist-packages/cloudinit/util.py", line 1684, in subp#012 cmd=args)#012cloudinit.util.ProcessExecutionError: Unexpected error while running command.#012Command: ['/var/lib/cloud/instance/scripts/part-001']#012Exit code: 1#012Reason: -#012Stdout: ''#012Stderr: '' | |
2155 Feb 7 11:59:27 ip-172-23-128-217 [CLOUDINIT] cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts) | |
2156 Feb 7 11:59:27 ip-172-23-128-217 [CLOUDINIT] handlers.py[DEBUG]: finish: modules-final/config-scripts-user: FAIL: running config-scripts-user with frequency once-per-instance | |
2157 Feb 7 11:59:27 ip-172-23-128-217 [CLOUDINIT] util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { call, put, takeEvery } from 'redux-saga/effects' | |
// every time a FETCH_USER_INFO action is dipatched, the function fechtUserInfo will be called | |
function* watchFetchUserInfo() { | |
yield takeEvery(FETCH_USER_INFO, fetchUserInfo); | |
} | |
function* fetchUserInfo (action) { | |
try { | |
// tell redux-saga => call this functions and once done put them in pictureResponse, infoResponse |
OlderNewer