text
stringlengths
7
3.69M
import Vue from 'vue' import Verificador from './views/Verificador' import Vacinacao from './views/Vacinacao' import Router from 'vue-router' Vue.use(Router) const router = new Router ({ mode: 'history', routes: [ { path: '/', name: 'verificador', component: Verificador }, { path: '/vacinacao', name: 'vacinacao', component: Vacinacao } ] }) export default router
const db = require('../../server/db'); const Order = db.model('order'); const chai = require('chai'); const expect = chai.expect; const supertest = require('supertest-as-promised'); const sinon = require('sinon'); describe('Sequelize Tests', () => { // clearing the database beforeEach('Synchronize and clear database', () => db.sync({force: true})); // creating unsaved instances to test let orderOne; beforeEach(function () { orderOne = Order.build({ status: 'cancelled' }); }); after('Synchronize and clear database', () => db.sync({force:true})); describe('Order Model', () => { it('has the expected schema definition', () => { expect(Order.attributes.purchase_date).to.be.an('object'); expect(Order.attributes.status).to.be.an('object'); }); }); describe('Validations', () => { it('returns a default value of "created" if no status is given', () => { const fakeOrder = Order.build() expect(fakeOrder.status).to.be.equal('created'); }); it('returns the status of a given order', () => { expect(orderOne.status).to.be.equal('cancelled'); }); // cannot "get" the purchase date as the method used in sequelize getter for purchase date produces an error it('sets the purchase date to the current date when the order is created', (done) => { const fakeOrder = Order.create(); const todayDateArr = Date(Date.now()).split(" ") const todayDayYear = todayDateArr[2] + " " + todayDateArr[3] done(); expect(fakeOrder.getDataValue("purchase_date")).to.be.equal("June " + todayDayYear); }); }); });
const express = require('express'); const router = express.Router(); const mongoose = require('mongoose'); const jwt = require('jsonwebtoken'); const Alenotifications = require('../models/Ale-notifications'); const Aleusers = require('../models/Ale-users'); router.get('/', (req, res, next) => { let user_token = req.headers.authorization; let decode_token = jwt.verify(user_token, process.env.JWT_KEY); if (decode_token.length === 0) { return res.status(404).json({ message: 'User token not sent' }) } Aleusers.find({_id: decode_token.userId}) .exec() .then(result_found_user => { if(result_found_user.length === 0) { return res.status(404).json({ message: 'User not found' }) } Alenotifications.find({user_id: decode_token.userId}) .exec() .then(result_found => { return res.status(200).json(result_found) }) .catch(err => { return res.status(500).json({ message: 'Server error on receiving notifications' }) }) }) .catch(err => { return res.status(500).json({ message: 'Server error when searching for a user by token' }) }) }); router.delete('/list', (req, res, next) => { let user_token = req.headers.authorization; let decode_token = jwt.verify(user_token, process.env.JWT_KEY); if (decode_token.length === 0) { return res.status(404).json({ message: 'User token not sent' }) } if(req.body.list === undefined || req.body.list.length === 0) { return res.status(200).json({ message: 'Notifications list is empty!' }) } Alenotifications.find({_id: {$in: req.body.list}}) .exec() .then(result => { if(result.length === 0) { return res.status(200).json({ message: 'Notifications list is empty!' }) } if(result.length === result.length) { Alenotifications.remove({_id: {$in: req.body.list}}) .exec() .then(result_delete => { return res.status(200).json({ message: 'Notifications successfully deleted' }) }) .catch(err => { return res.status(500).json({ message: 'Server error when deleted notifications' }) }) } else { return res.status(200).json({ message: 'One or more notifications are not owned by the user!' }) } }) .catch(err => { return res.status(500).json({ message: 'Server error when searching notifications' }) }) }); module.exports = router;
/* eslint-env node */ 'use strict'; const testGenerators = { 'ember-qunit': require('./ember-qunit-generator'), 'ember-mocha': require('./ember-mocha-generator'), }; const generators = {}; Object.keys(testGenerators).forEach((name) => { const testGenerator = testGenerators[name]; generators[name] = function (relativePath, asserts) { if (!asserts.length) { return ''; } const header = `Markdown Codefences | ${relativePath}`; return ( testGenerator.suiteHeader(header) + asserts .map((assert) => testGenerator.test('fenced code should work', assert)) .join('') + testGenerator.suiteFooter() ); }; }); module.exports = generators;
import React from 'react'; import PropTypes from 'prop-types'; import FormControl from '@material-ui/core/FormControl'; import FormLabel from '@material-ui/core/FormLabel'; import RadioGroup from '@material-ui/core/RadioGroup'; import FormControlLabel from '@material-ui/core/FormControlLabel'; import Radio from '@material-ui/core/Radio'; import { makeStyles, useTheme } from '@material-ui/styles'; const renderRadioForProp = props => props.map(prop => ( <FormControlLabel labelPlacement="top" key={prop} value={prop.toString()} control={<Radio />} label={prop} /> )); const useStyles = makeStyles(theme => ({ formControl: { margin: theme.spacing(3), }, formLabel: { lineHeight: 3, }, radioGroup: { display: 'flex', [theme.breakpoints.up('sm')]: { justifyContent: 'space-around', flexDirection: 'row', }, }, })); const Radios = ({ title, property, value, onChange }) => { const classes = useStyles(useTheme()); return ( <> <FormControl className={classes.formControl} component="fieldset"> <FormLabel className={classes.formLabel} component="legend"> {title.toUpperCase()} </FormLabel> <RadioGroup className={classes.radioGroup} aria-label={title} name={title} value={value || property[0]} onChange={onChange} > {renderRadioForProp(property)} </RadioGroup> </FormControl> </> ); }; Radios.defaultProps = { value: null, }; Radios.propTypes = { onChange: PropTypes.func.isRequired, value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]), property: PropTypes.shape({}).isRequired, title: PropTypes.string.isRequired, }; export default Radios;
'use strict'; var greet = { hello:function() { console.log('hello world'); } }; module.exports = greet;
import { Link } from 'react-router-dom'; import { darken } from 'polished'; import styled from 'styled-components'; export const Bar = styled.div` grid-area: sidebar; background: #fc8e4c; `; export const Container = styled.div` /* height: calc(100vh - 5vh); */ padding-top: calc(100% - 80%); display: flex; flex-direction: column; align-items: center; @media screen and (max-width: 1280px) { padding-top: 2rem; } `; export const Menu = styled.div` padding: calc(100% - 90%) 0; width: 100%; @media screen and (max-width: 1280px) { padding: 20px 0; } `; export const Item = styled(Link)` text-decoration: none; color: #fff; margin: 10px 0; height: calc(100vh - 88vh); background: ${props => (props.active ? darken(0.1, '#fc8e4c') : '#fc8e4c')}; transition: background 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center; &:hover { background: ${darken(0.1, '#fc8e4c')}; } @media screen and (max-width: 1280px) { /* height: 80px; */ height: calc(100vh - 90vh); } `;
var files________b____8js__8js_8js = [ [ "files____b__8js_8js", "files________b____8js__8js_8js.html#af60aff6c935bfdfba05a0b2c09b98ac6", null ] ];
//carousel var slideIndex = 1; showSlides(slideIndex); function plusSlides(n) { showSlides(slideIndex += n); } function currentSlide(n) { showSlides(slideIndex = n); } function showSlides(n) { var i; var slides = document.getElementsByClassName("mySlides"); var dots = document.getElementsByClassName("dot"); if (n > slides.length) { slideIndex = 1 } if (n < 1) { slideIndex = slides.length } for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" active", ""); } slides[slideIndex - 1].style.display = "block"; dots[slideIndex - 1].className += " active"; } var slideIndex2 = 1; showSlides2(slideIndex2); function plusSlides2(n) { showSlides2(slideIndex += n); } function currentSlide2(n) { showSlides2(slideIndex = n); } function showSlides2(n) { var i; var slides = document.getElementsByClassName("mySlides2"); var dots = document.getElementsByClassName("dot2"); if (n > slides.length) { slideIndex = 1 } if (n < 1) { slideIndex = slides.length } for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" active", ""); } slides[slideIndex - 1].style.display = "block"; dots[slideIndex - 1].className += " active"; } var slideIndex3 = 1; showSlides3(slideIndex3); function plusSlides3(n) { showSlides3(slideIndex += n); } function currentSlide3(n) { showSlides3(slideIndex = n); } function showSlides3(n) { var i; var slides = document.getElementsByClassName("mySlides3"); var dots = document.getElementsByClassName("dot3"); if (n > slides.length) { slideIndex = 1 } if (n < 1) { slideIndex = slides.length } for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" active", ""); } slides[slideIndex - 1].style.display = "block"; dots[slideIndex - 1].className += " active"; } //escolha cor artigo let black = document.getElementById("black"); black.addEventListener("click", function () { document.getElementById("blue").classList.remove("selectedBlue"); document.getElementById("black").classList.add("selectedBlack"); document.getElementById("red").classList.remove("selectedRed"); }) //add to cart let escolha = document.getElementById("add"); let conteudoEscolha = ` <span>Valor: $299</span> `; escolha.addEventListener("click", function () { document.getElementById("conteudo").innerHTML = conteudoEscolha }) function displayCart() { var showCart = document.querySelector('.bagContent'); showCart.style.display = 'block'; } function hiddeCart() { var hiddeCart = document.querySelector('.bagContent'); hiddeCart.style.display = 'none'; } function displaySearch() { var displaySearch = document.querySelector('.displaySearch'); displaySearch.style.display = 'block'; } function hiddeSearch() { var displaySearch = document.querySelector('.displaySearch'); displaySearch.style.display = 'none'; } let red = document.getElementById("red"); if (typeof (red) != 'undefined' && red != null) { red.addEventListener("click", function () { document.getElementById("black").classList.remove("selectedBlack"); document.getElementById("blue").classList.remove("selectedBlue"); document.getElementById("red").classList.add("selectedRed"); }); } let blue = document.getElementById("blue"); if (typeof (blue) != 'undefined' && blue != null) { blue.addEventListener("click", function () { document.getElementById("black").classList.remove("selectedBlack"); document.getElementById("blue").classList.add("selectedBlue"); document.getElementById("red").classList.remove("selectedRed"); }); } let add = document.getElementById("add"); add.addEventListener("click", function () { document.getElementById("add").classList.add("selected"); document.getElementById("home").classList.remove("selected"); alert("Saved to cart") }); let home = document.getElementById("home"); home.addEventListener("click", function () { document.getElementById("home").classList.add("selected"); document.getElementById("add").classList.remove("selected"); }); //opinion function showComents() { var coments = document.querySelector('.opinion'); coments.style.display = 'block'; } function hiddeComents() { var hiddeComents = document.querySelector('.opinion'); hiddeComents.style.display = 'none'; } //botao play let play = document.getElementById("play"); play.addEventListener("click", function () { document.location.href = 'https://www.youtube.com/watch?v=5vsWmZ2Fr5Q', target = "_blank"; }); //infos function displayPopup1() { var popup = document.querySelector('.texto1'); popup.style.display = 'block'; } function displayPopup2() { var popup = document.querySelector('.texto2'); popup.style.display = 'block'; } function displayPopup3() { var popup = document.querySelector('.texto3'); popup.style.display = 'block'; } function displayPopup4() { var popup = document.querySelector('.texto4'); popup.style.display = 'block'; } function hiddePopup1() { var del = document.querySelector('.texto1'); del.style.display = 'none'; } function hiddePopup2() { var del = document.querySelector('.texto2'); del.style.display = 'none'; } function hiddePopup3() { var del = document.querySelector('.texto3'); del.style.display = 'none'; } function hiddePopup4() { var del = document.querySelector('.texto4'); del.style.display = 'none'; } function selectBlue() { var btBlue = document.querySelector('.carrosel2'); btBlue.style.display = 'block'; var btBlack = document.querySelector('.carrosel1'); btBlack.style.display = 'none'; var btRed = document.querySelector('.carrosel3'); btRed.style.display = 'none'; } function selectBlack() { var btBlue = document.querySelector('.carrosel2'); btBlue.style.display = 'none'; var btBlack = document.querySelector('.carrosel1'); btBlack.style.display = 'block'; var btRed = document.querySelector('.carrosel3'); btRed.style.display = 'none'; } function selectRed() { var btBlue = document.querySelector('.carrosel2'); btBlue.style.display = 'none'; var btBlack = document.querySelector('.carrosel1'); btBlack.style.display = 'none'; var btRed = document.querySelector('.carrosel3'); btRed.style.display = 'block'; } let pesquisaForm = document.getElementById("pesquisa-form"); let pesquisaButton = document.getElementById("pesquisa-form-submit"); pesquisaButton.addEventListener("click", (e) => { e.preventDefault(); const models= ["THE LEVEL", "THE EMPIRE","THE OASIS"]; const marcaPesquisada = pesquisaForm.model.value; const trimPesquisa=marcaPesquisada.trim(); const upper=trimPesquisa.toUpperCase(); if (models.includes(upper)){ let conteudo=`<p>The model <b> " ${upper}</b> " is available! </P> <p>Buy now and get dellivered at your home with no extra charge!</p> ` document.getElementById("encontrado").innerHTML= conteudo; } else{ let conteudo=`<p>Sorry! We don't have that model</p>` document.getElementById("encontrado").innerHTML= conteudo; } })
import React, { useContext } from 'react' import UserStates from './useStates' function SideBar() { return ( <div className='sidebar'> <UserStates/> </div> ) } export default SideBar
import React, { useState, useEffect } from 'react' import axios from 'axios' import Pink from '../components/letter_templates/pink' import './letter.css' import { className } from 'postcss-selector-parser'; function Letter(props) { const [letterData, setLetterData] = useState(''); const fetchData = async() => { axios({ method: 'get', url: 'letters/' + props.query.pk, }).then((response) => { const [year, month, day] = response.data.date.split("-") setLetterData({ ...response.data, year, month, day }) }) } useEffect(() => { fetchData() }, []); return ( <div className="letter"> <Pink {...letterData}/> </div> ) } Letter.getInitialProps = ({ query }) => { return {query} } export default Letter
import currentUser from './currentUser' import batches from './batches' import students from './students' import currentBatch from './currentBatch' import subscriptions from './subscriptions' import currentStudent from './currentStudent' import evaluations from './evaluations' import currentEvaluation from './currentEvaluation' export default { batches, currentUser, students, currentBatch, subscriptions, currentStudent, evaluations, currentEvaluation, }
const EventEmitter= require('events') class Emitter extends EventEmitter{} emitter = new Emitter() //emitter.once(eventName, eventHandler) will execute observer code just once, //no matter how many time this particular event was triggered. emitter.once('knock', function(){ console.log('Who\'s there?') }) emitter.emit('knock') emitter.emit('knock')
const Discord = require("discord.js"); // imports the discord library const client = new Discord.Client(); // creates a discord client client.once("ready", () => { // prints "Ready!" to the console once the bot is online console.log("Ready!"); }); function random(message) { const number = Math.random(); // generates a random number message.channel.send(number.toString()); // sends a message to the channel with the number } function greet(message) { const greeting= "hello to you too :)"; message.channel.send(greeting); } let commands = new Map(); commands.set("random", random); commands.set("hi" || "hello", greet); client.on("message", message => { if (message.content[0] === '?') { const command = message.content.split(" ")[0].substr(1); // gets the command name if (commands.has(command)) { // checks if the map contains the command commands.get(command)(message) // runs the command } } }); client.login(process.env.DISCORD_BOT_TOKEN); // starts the bot up
import React, {useEffect, useState} from 'react'; import {Provider} from 'react-redux'; import 'firebase/auth'; import {store} from './src/store'; import Todos from './src/containers/TodosScreen'; import {Header} from './src/components/Header'; import {SplashScreen} from './src/containers/SplashScreen'; const App = () => { const [loading, setLoading] = useState(true); useEffect(() => { setTimeout(() => { setLoading(false); }, 1000); }, []); return ( <Provider store={store}> {loading ? ( <SplashScreen /> ) : ( <> <Header /> <Todos /> </> )} </Provider> ); }; export default App;
import React, { Component } from 'react'; class Cart extends Component { constructor(props) { super(props); this.state = { formData: [] } } retrieveData = () => { console.log(this.props.useFormInfo); this.props.useFormInfo.forEach(e => console.log(e)); } render() { // this.retrieveData(); return( <div id="cart-main"> This is the <span class="current-page">cart</span> page. <br></br> <br></br> <br></br> <br></br> STUFF {/* <div>{this.props.useFormInfo.forEach(e => console.log(e))}</div> */} </div> ); } }; export default Cart;
import GenerateArrayWindow from "../ui/generateArrayWindow"; import MouseTool from "./mouseTool"; import * as Registry from "../../core/registry"; import SimpleQueue from "../../utils/simpleQueue"; export default class GenerateArrayTool extends MouseTool { constructor() { super(); this.__generateArrayWindow = new GenerateArrayWindow(this); // this.dragging = false; // this.dragStart = null; // this.lastPoint = null; // this.currentSelectBox = null; // this.currentSelection = []; let ref = this; // this.updateQueue = new SimpleQueue(function () { // ref.dragHandler(); // }, 20); this.down = function(event) { // Registry.viewManager.killParamsWindow(); ref.mouseDownHandler(event); // ref.dragging = true; // ref.showTarget(); }; this.move = function(event) { // if (ref.dragging) { // ref.lastPoint = MouseTool.getEventPosition(event); // ref.updateQueue.run(); // } // ref.showTarget(); }; this.up = function(event) { // ref.dragging = false; ref.mouseUpHandler(MouseTool.getEventPosition(event)); // ref.showTarget(); }; } activate(component) { console.log("Activating the tool for a new component", component); //Store the component position here this.__currentComponent = component; this.__generateArrayWindow.showWindow(); } unactivate() { Registry.viewManager.resetToDefaultTool(); } generateArray(xdim, ydim, xspacing, yspacing) { console.log("Generate array:", xdim, ydim, xspacing, yspacing); let xposref = this.__currentComponent.getPosition()[0]; let yposref = this.__currentComponent.getPosition()[1]; let name = this.__currentComponent.getName(); this.__currentComponent.setName(name + "_1_1"); let replicas = []; //Loop to create the components at the new positions for (let y = 0; y < ydim; y++) { for (let x = 0; x < xdim; x++) { //Skip the x=0, y=0 because thats the initial one if (x === 0 && y === 0) { continue; } let xpos = xposref + x * xspacing; let ypos = yposref + y * yspacing; replicas.push(this.__currentComponent.replicate(xpos, ypos, name + "_" + String(x + 1) + "_" + String(y + 1))); } } //Add the replicas to the device console.log(replicas); replicas.forEach(function(replica) { Registry.currentDevice.addComponent(replica); }); Registry.viewManager.saveDeviceState(); } revertToOriginalPosition() { this.__currentComponent.updateComponentPosition(this.__originalPosition); } dragHandler() { // if (this.dragStart) { // if (this.currentSelectBox) { // this.currentSelectBox.remove(); // } // this.currentSelectBox = this.rectSelect(this.dragStart, this.lastPoint); // } } // showTarget() { // Registry.viewManager.removeTarget(); // } mouseUpHandler(event) { // if (this.currentSelectBox) { // this.currentSelection = Registry.viewManager.hitFeaturesWithViewElement(this.currentSelectBox); // this.selectFeatures(); // } // this.killSelectBox(); console.log("Up event", event); } mouseDownHandler(event) { // let point = MouseTool.getEventPosition(event); // let target = this.hitFeature(point); // if (target) { // if (target.selected) { // let feat = Registry.currentDevice.getFeatureByID(target.featureID); // Registry.viewManager.updateDefaultsFromFeature(feat); // let rightclickmenu = new RightClickMenu(feat); // rightclickmenu.show(event); // Registry.viewManager.rightClickMenu = rightclickmenu; // this.rightClickMenu = rightclickmenu; // // let func = PageSetup.getParamsWindowCallbackFunction(feat.getType(), feat.getSet()); // //func(event); // } else { // this.deselectFeatures(); // this.selectFeature(target); // } // // // } else { // this.deselectFeatures(); // this.dragStart = point; // } console.log("Down event", event); } // killSelectBox() { // if (this.currentSelectBox) { // this.currentSelectBox.remove(); // this.currentSelectBox = null; // } // this.dragStart = null; // } // // hitFeature(point) { // let target = Registry.viewManager.hitFeature(point); // return target; // } /** * Function that is fired when we click to select a single object on the paperjs canvas * @param paperElement */ // selectFeature(paperElement) { // this.currentSelection.push(paperElement); // // //Find the component that owns this feature and then select all of the friends // let component = this.__getComponentWithFeatureID(paperElement.featureID); // if (component == null) { // //Does not belong to a component, hence this returns // paperElement.selected = true; // // } else { // //Belongs to the component so we basically select all features with this id // let featureIDs = component.getFeatureIDs(); // for (let i in featureIDs) { // let featureid = featureIDs[i]; // let actualfeature = Registry.viewManager.view.paperFeatures[featureid]; // actualfeature.selected = true; // } // // Registry.viewManager.view.selectedComponents.push(component); // } // } // /** // * Finds and return the corresponding Component Object in the Registry's current device associated with // * the featureid. Returns null if no component is found. // * // * @param featureid // * @return {Component} // * @private // */ // __getComponentWithFeatureID(featureid) { // // Get component with the features // // let device_components = Registry.currentDevice.getComponents(); // // //Check against every component // for (let i in device_components) { // let component = device_components[i]; // //Check against features in the in the component // let componentfeatures = component.getFeatureIDs(); // let index = componentfeatures.indexOf(featureid); // // if (index != -1) { // //Found it !! // console.log("Found Feature: " + featureid + " in component: " + component.getID()); // return component; // } // } // // return null; // } /** * Function that is fired when we drag and select an area on the paperjs canvas */ // selectFeatures() { // if (this.currentSelection) { // for (let i = 0; i < this.currentSelection.length; i++) { // let paperFeature = this.currentSelection[i]; // // //Find the component that owns this feature and then select all of the friends // let component = this.__getComponentWithFeatureID(paperFeature.featureID); // // if (component == null) { // //Does not belong to a component hence do the normal stuff // paperFeature.selected = true; // // } else { // //Belongs to the component so we basically select all features with this id // let featureIDs = component.getFeatureIDs(); // for (let i in featureIDs) { // let featureid = featureIDs[i]; // let actualfeature = Registry.viewManager.view.paperFeatures[featureid]; // actualfeature.selected = true; // } // // Registry.viewManager.view.selectedComponents.push(component); // } // // } // } // } // deselectFeatures() { // if(this.rightClickMenu){ // this.rightClickMenu.close(); // this.rightClickMenu = null; // } // paper.project.deselectAll(); // this.currentSelection = []; // } // abort() { // this.deselectFeatures(); // this.killSelectBox(); // } // rectSelect(point1, point2) { // let rect = new paper.Path.Rectangle(point1, point2); // rect.fillColor = new paper.Color(0, .3, 1, .4); // rect.strokeColor = new paper.Color(0, 0, 0); // rect.strokeWidth = 2; // rect.selected = true; // return rect; // } }
//asignacion de variables var busquedaHorizontal=0; var busquedaVertical=0; var buscarNuevosDulces=0; var lencolum=["","","","","","",""]; var lenrest=["","","","","","",""]; var maximo=0; var matriz=0; var intervalo=0; var eliminar=0; var nuevosDulces=0; var tiempo=0; var i=0; var contadorTotal=0; var espera=0; var score=0; var mov=0; var min=2; var seg=0; //se realiza una selección por clase al boton reinicio y se asigna un evento de click con una funcion que contiene la variable i, score y mov. se hace una seleccion por clase al panel score y se modifica su atributo css tamaño 25%. Igualmente se selecciona el panel tablero y mediante show se muestra su contenido, al igual que la clase time. En la seleccion por etiqueta de score se utiliza html para mostrar el valor de 0 al igual que en el la etiqueta seleccionada mediante movimientos-text. //El método clearInterval () borra un temporizador configurado con el método setInterval () . $(".btn-reinicio").click(function(){ i=0; score=0; mov=0; $(".panel-score").css("width","25%"); $(".panel-tablero").show(); $(".time").show(); $("#score-text").html("0"); $("#movimientos-text").html("0"); $(this).html("Reiniciar") clearInterval(intervalo); clearInterval(eliminar); clearInterval(nuevosDulces); clearInterval(tiempo); min=2; seg=0; borrartotal(); intervalo=setInterval(function(){ desplazamiento() },600); tiempo=setInterval(function(){ timer() },1000); });
var should = require('should'); var auth = require('../controllers/auth'); var sinon = require('sinon'); var passport = require('passport'); var config = require('../config/'); var mongoose = require('mongoose'); var model = require('../models/')(mongoose); var GitHubStrategy = require('passport-github').Strategy; var UserManager = require('../managers/user'); describe('Auth',function() { it('should use passport',function() { var spy = sinon.spy(); sinon.stub(passport,"use",spy); auth.init(); //console.log(spy); //assertions spy.calledOnce.should.be.equal(true); //IMPORTANT passport.use.restore(); }); it('should use github strategy',function() { // config.passport.github.clientId='abc'; var spy = sinon.spy(); sinon.stub(passport,"use",spy); //sinon.stub(config,'passport',spy2); auth.init(); //console.log(spy); var s = spy.args[0][0]; //console.log("xxx %j",s); should.exist(s); s.should.be.an.instanceOf(GitHubStrategy); should(s._oauth2._clientId).equal(config.passport.github.clientId); should(s._oauth2._clientSecret).equal(config.passport.github.secret); should(s._callbackURL).equal(config.passport.github.callbackUrl); passport.use.restore(); }); it('should audit user login',function() { var spy = sinon.spy(); var stub1 = sinon.stub(model,"UserLoginAudit",function() { return { save: spy }; }); var mockUserObject = { username: 'test' }; UserManager.auditUserLogin(mockUserObject,null); spy.calledOnce.should.be.true; var userLoginAuditObj = spy.getCall(0).thisValue; userLoginAuditObj.should.have.property('githubId','test'); userLoginAuditObj.should.have.property('lastLoginTimeStamp'); //TODO: Check if lastLoginTimeStamp is not null stub1.restore(); }); it('finds a user by id',function(){ var spy1 = sinon.spy(); var stub1 = sinon.stub(model.UserLogin,"findById",spy1); var id = mongoose.Types.ObjectId; UserManager.findUserById(id,null); spy1.calledOnce.should.be.true; var user =spy1.getCall(0).args[0]; (user === id).should.be.equal(true); stub1.restore(); }); it('finds user by login',function(){ var spy1 = sinon.spy(); var stub1 = sinon.stub(model.UserLogin,"findOne",spy1); UserManager.findUser('abcd',null); spy1.calledOnce.should.be.true; var user = spy1.getCall(0).args[0]; (user.githubId === 'abcd').should.be.equal(true); stub1.restore(); }); });
// Write a function which takes a ROT13 encoded string as input and returns a decoded string. function rot13(str) { let answer = '' const cipher = { A: { deciphered: 'N' }, B: { deciphered: 'O' }, C: { deciphered: 'P' }, D: { deciphered: 'Q' }, E: { deciphered: 'R' }, F: { deciphered: 'S' }, G: { deciphered: 'T' }, H: { deciphered: 'U' }, I: { deciphered: 'V' }, J: { deciphered: 'W' }, K: { deciphered: 'X' }, L: { deciphered: 'Y' }, M: { deciphered: 'Z' }, N: { deciphered: 'A' }, O: { deciphered: 'B' }, P: { deciphered: 'C' }, Q: { deciphered: 'D' }, R: { deciphered: 'E' }, S: { deciphered: 'F' }, T: { deciphered: 'G' }, U: { deciphered: 'H' }, V: { deciphered: 'I' }, W: { deciphered: 'J' }, X: { deciphered: 'K' }, Y: { deciphered: 'L' }, Z: { deciphered: 'M' }, ' ': { deciphered: ' ' }, } for (let letter in str) { const cipheredLetter = str[letter] answer += cipher[cipheredLetter].deciphered } return answer } rot13('SERR PBQR PNZC')
var pdfLib = require('./src/pdf-reader'); module.exports = pdfLib;
'use strict'; module.exports = function (grunt, data) { if (grunt.cli.options.debug) { console.log('Loading `sass.js`'); } console.warn('running sass'); return { options: { sourceMap: true }, dist: { files: { '<%= rootPath %>/.tmp/styles/main.css': data.appPath + '/styles/main.scss' } } }; };
import React, { Component } from 'react' import PureComponent from './PureComponent' import MemoComponent from './MemoComponent'; class ParentComponent extends Component { state = { concept: 'Pure Component' } componentDidMount() { setInterval(() => { this.setState({ concept: 'Pure Component' }) }, 2000) } render() { console.log('Parent Render') return ( <div> <PureComponent concept={this.state.concept} /> <MemoComponent concept={this.state.concept} /> </div> ) } } export default ParentComponent
import styled from 'styled-components'; const StyledFooter = styled.div` display: none !important; padding: 1rem 2rem; font-size: 2.5rem; display: flex; justify-content: space-between; align-items: center; z-index: 100; width: 100vw; bottom: 0; background-color: #fff; @media screen and (max-width: 700px) { .contact { position: fixed; } } `; const Footer = () => { return ( <StyledFooter> <div className="contact__info"> <h2> N: <span className="highlite">+48 515 817 829</span> </h2> <h2> E: <span className="highlite"> <a href="mailto:hello@aidenec.com">hello@aidenec.com</a> </span> </h2> </div> <div className="contact__links"> <a className="" href="https://linkedin.com/in/aidenec" target="_blank"> <i className="fab fa-linkedin-in" /> </a> <a className="" href="https://github.com/Aiden007700" target="_blank"> <i className="fab fa-github" /> </a> </div> </StyledFooter> ); }; export default Footer
import {useTransitions, withTransition} from 'react-router-transitions' import ReactCSSTransitionGroup from 'react-addons-css-transition-group' import {applyRouterMiddleware, Router, hashHistory, browserHistory} from 'react-router' import Layout from '../pages/Layout' import activityRoute from './activity' import employerRoute from './employer' import mobileRoute from './mobile' import React from 'react' import { Provider } from 'react-redux' import store from '../store' export const routerTransition = applyRouterMiddleware( useTransitions({ TransitionGroup: ReactCSSTransitionGroup, onShow (prevState, nextState, replaceTransition) { // console.log('onShow',nextState.children.props.route.transition) replaceTransition({ transitionName: `transition-group-show-${nextState.children.props.route.transition}`, transitionEnterTimeout: 800, transitionLeaveTimeout: 200 }) }, onDismiss (prevState, nextState, replaceTransition) { // console.log('onDismiss', nextState.children.props.route.transition) replaceTransition({ transitionName: `transition-group-show-${nextState.children.props.route.transition}`, transitionEnterTimeout: 800, transitionLeaveTimeout: 200 }) }, defaultTransition: { transitionName: 'transition-group-show-from-right', transitionEnterTimeout: 800, transitionLeaveTimeout: 200 }})) export const rootRoute = [mobileRoute, { path: '/', component: withTransition(Layout), // indexRoute: {onEnter: (nextState, replace) => replace('/mobile/loan')}, childRoutes: [ { path: 'security', transition: 'from-left', indexRoute: [{ transition: 'from-left', getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('../pages/security/SecurityList')) }) } }], childRoutes: [{ path: 'certification', transition: 'from-up', getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('../pages/security/SecurityCertification')) }) } }] }, { path: 'fund', transition: 'from-left', indexRoute: [{ transition: 'from-left', getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('../pages/fund/FundList')) }) } }], childRoutes: [{ path: 'certification', transition: 'from-right', getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('../pages/fund/FundCertification')) }) } }] }, activityRoute, employerRoute, { path: 'signin', // 金币签到 indexRoute: [{ getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('pages/signin/index')) }) } }], childRoutes: [{ path: 'detailed', getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('pages/signin/detailed')) }) } }] }, { path: 'misc', childRoutes: [{ path: 'flow', // 流量引入 transaction: 'from-left', getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('pages/misc/flow')) }) } }, { path: 'business', // 官网招募合作 transaction: 'from-left', getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('pages/misc/business')) }) } }] }, { path: 'cash-bonus', // 现金红包 indexRoute: [{ getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('pages/cash-bonus/index')) }) } }], childRoutes: [{ path: 'withdrawal', // 提现 transaction: 'from-left', getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('pages/cash-bonus/withdrawal')) }) } }] }, { path: 'integral-mall', // 积分商城 indexRoute: [{ transaction: 'from-left', getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('pages/integral-mall/index')) }) } }], childRoutes: [{ path: 'details', // 查看详情 transaction: 'from-left', getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('pages/integral-mall/details')) }) } }] } ] }] if (process.env.NODE_ENV !== `production`) { rootRoute[1].childRoutes.push({ path: 'test', transition: 'from-up', indexRoute: [ { transition: 'from-up', getComponent (location, callback) { require.ensure([], function (require) { callback(null, require('../pages/Test')) }) } } ] }) } export default class App extends React.Component { render () { return ( <Provider store={store}> <Router routes={rootRoute} history={process.env.NODE_ENV === `debug` ? hashHistory : browserHistory} render={routerTransition}/> </Provider> ) } }
import React, {Component} from 'react'; import { Tabs, Table, message, Breadcrumb } from 'antd'; import Disposal_cont from "./Disposal_cont"; import Rectification_cont from "./Rectification_cont"; const TabPane = Tabs.TabPane; class SupplierDisposal extends Component{ constructor(props){ super(props); this.state = { key:1, defaultActiveKey:'1' } } componentWillMount(){ let query = this.props.location.search; if(query){ this.setState({key:'2',defaultActiveKey:'2'}); } } //切换页签 changeTab=(key)=>{ this.setState({key:key}); } render(){ return ( <div> <Breadcrumb> <Breadcrumb.Item>供应商管理</Breadcrumb.Item> <Breadcrumb.Item>供应商资质管理</Breadcrumb.Item> <Breadcrumb.Item>供应商处置</Breadcrumb.Item> </Breadcrumb> <Tabs onChange={this.changeTab} type="card" defaultActiveKey={this.state.defaultActiveKey}> <TabPane tab=" 供货资质处置 " key="1">{this.state.key==1?<Disposal_cont />:null}</TabPane> <TabPane tab=" 供货资质整改 " key="2">{this.state.key==2?<Rectification_cont />:null}</TabPane> </Tabs> </div> ) } } export default SupplierDisposal;
const SET_FILES = 'SET_FILES'; const SET_FILTERS = 'SET_FILTERS'; const ADD_FILES = 'ADD_FILES'; const initialState = { data: [], total: 0, loading: true, filters: { page: 1, rowsPerPage: 5 } } const filesReducer = (state = initialState, action) => { switch (action.type) { case SET_FILES: return { ...state, ...action.payload, loading: false }; case ADD_FILES: return { ...state, data: [ ...action.payload, ...state.data ], total: state.total + action.payload.length, loading: false }; case SET_FILTERS: return { ...state, filters: {...state.filters, ...action.payload} } default: return state } } export default filesReducer;
import React from 'react'; export default class NavBarTop extends React.Component { constructor(props) { super(props); this.handleNavButtonClick = this.handleNavButtonClick.bind(this) } handleNavButtonClick(e) { e.preventDefault() var newView = e.target.getAttribute("name") this.props.onTopNavClick(newView); } render() { return ( <nav className="pt-navbar pt-fixed-top"> <div className="pt-navbar-group pt-align-left"> <button name="home" style={this.props.topNavStyles.home} onClick={this.handleNavButtonClick} className="pt-navbar-heading pt-button pt-minimal"> Ben Goldstein </button> </div> <div className="pt-navbar-group pt-align-right"> <button name="contact" style={this.props.topNavStyles.contact} onClick={this.handleNavButtonClick} className="pt-button pt-minimal"> Contact </button> <button name="projects" style={this.props.topNavStyles.projects} onClick={this.handleNavButtonClick} className="pt-button pt-minimal"> Projects </button> <button name="music" style={this.props.topNavStyles.music} onClick={this.handleNavButtonClick} className="pt-button pt-minimal"> Music </button> <button name="settings" onClick={this.handleNavButtonClick} className="pt-button pt-minimal pt-icon-cog"> </button> </div> </nav> ); } }
var cuaw = 0; var cuucw; function calculateUAW() { var asimple = 0; var amedio = 0; var acomplejo = 0; var asimple = document.getElementById('Asim').value; var amedio = document.getElementById('Amed').value; var acomplejo = document.getElementById('Acom').value; //var uaw = parseFloat(asimple) + parseFloat(amedio) + parseFloat(acomplejo); var uaw = (parseInt(asimple)) + (parseInt(amedio)*2) + (parseInt(acomplejo)*3); //alert(uaw); var cuaw = parseFloat(uaw); if(!isNaN(uaw)) { document.getElementById("resUAW").innerHTML = "Su factor sin ajustar correspondiente a los actores es: " + uaw; } } function calculateUUCW() { var cusimple = 0.0; var cumedio = 0.0; var cucomplejo = 0.0; var cusimple = document.getElementById('CUsim').value; var cumedio = document.getElementById('CUmed').value; var cucomplejo = document.getElementById('CUcom').value; var uucw = (parseFloat(cusimple)*5) + (parseFloat(cumedio)*10) + (parseFloat(cucomplejo)*15); var cuucw = parseFloat(uucw); if(!isNaN(uucw)) { document.getElementById("resUUCW").innerHTML = "Su factor sin ajustar correspondiente a los casos de usos es: " + uucw; } } function calculateTCF(){ var t1 = 0.0; var t2 = 0.0; var t3 = 0.0; var t4 = 0.0; var t5 = 0.0; var t6 = 0.0; var t7 = 0.0; var t8 = 0.0; var t9 = 0.0; var t10 = 0.0; var t11 = 0.0; var t12 = 0.0; var t13 = 0.0; var t1 = document.getElementById('TCF1').value; var t2 = document.getElementById('TCF2').value; var t3 = document.getElementById('TCF3').value; var t4 = document.getElementById('TCF4').value; var t5 = document.getElementById('TCF5').value; var t6 = document.getElementById('TCF6').value; var t7 = document.getElementById('TCF7').value; var t8 = document.getElementById('TCF8').value; var t9 = document.getElementById('TCF9').value; var t10 = document.getElementById('TCF10').value; var t11 = document.getElementById('TCF11').value; var t12 = document.getElementById('TCF12').value; var t13 = document.getElementById('TCF13').value; var tfactor = (parseFloat(t1)*2) + (parseFloat(t2)*1) + (parseFloat(t3)*1) + (parseFloat(t4)*1) + (parseFloat(t5)*1) + (parseFloat(t6)*0.5) + (parseFloat(t7)*0.5) + (parseFloat(t8)*2) + (parseFloat(t9)*1 + (parseFloat(t10)*1) + (parseFloat(t11)*1) + (parseFloat(t12)*1) + (parseFloat(t13)*1)); var tcf = ((0.6) + (parseFloat(tfactor)*0.01)) if(!isNaN(tcf)) { document.getElementById("resTCF").innerHTML = "Su cálculo de los factores de complejidad técnica es: " + tcf; } } function calculateEF (){ var e1 = 0.0; var e2 = 0.0; var e3 = 0.0; var e4 = 0.0; var e5 = 0.0; var e6 = 0.0; var e7 = 0.0; var e8 = 0.0; var e1 = document.getElementById('EF1').value; var e2 = document.getElementById('EF2').value; var e3 = document.getElementById('EF3').value; var e4 = document.getElementById('EF4').value; var e5 = document.getElementById('EF5').value; var e6 = document.getElementById('EF6').value; var e7 = document.getElementById('EF7').value; var e8 = document.getElementById('EF8').value; var efactor = (parseFloat(e1)*1.5) + (parseFloat(e2)*0.5) + (parseFloat(e3)*1) + (parseFloat(e4)*0.5) + (parseFloat(e5)*1) + (parseFloat(e6)*2) - (parseFloat(e7)*1) - (parseFloat(e8)*1); var ef = 1.4 +((-0.03)*parseFloat(efactor)); if(!isNaN(ef)) { document.getElementById("resEF").innerHTML = "Su cálculo de los factores de entorno es: " + ef; } } function calculateHoras (){ var h0 = 0; var h1 = 0; var h2 = 0; var h3 = 0; var h4 = 0; var h0 = document.getElementById('H0').value; var h1 = document.getElementById('H1').value; var h2 = document.getElementById('H2').value; var h3 = document.getElementById('H3').value; var h4 = document.getElementById('H4').value; var h0 = parseFloat(h0); var horas = 0; var uucp = parseFloat(h1) + parseFloat(h2); var ucp = parseFloat(uucp) * parseFloat(h3) * parseFloat(h4); if (h0 <= 2 ){ var horas = parseFloat(ucp)*20; }else if (h0 <=4){ var horas = parseFloat(ucp)*28; }else{ var horas = parseFloat(ucp)*36; } var analisis = 0; var diseno = 0; var progra = 0; var pruebas = 0; var sobrecarga = 0; var horasTotales = 0; var horasTotales = (100*parseFloat(horas))/40; var analisis = parseFloat(horasTotales) * 0.10; var diseno = parseFloat(horasTotales) * 0.20; var progra = parseFloat(horasTotales) * 0.40; var pruebas = parseFloat(horasTotales) * 0.15; var sobrecarga = parseFloat(horasTotales) * 0.15; if(!isNaN(horas)) { document.getElementById("resHoras").innerHTML = "Horas Totales: " + horasTotales; document.getElementById("r1").innerHTML = "Horas para analisis: " + analisis; document.getElementById("r2").innerHTML = "Horas para diseño: " + diseno; document.getElementById("r3").innerHTML = "Horas para programación: " + progra; document.getElementById("r4").innerHTML = "Horas para pruebas: " + pruebas; document.getElementById("r5").innerHTML = "Horas para sobrecarga: " + sobrecarga; } /** var analisis = 0; var diseno = 0; var progra = 0; var pruebas = 0; var sobrecarga = 0; var analisis = parseFloat(horas) * 0.10; if(!isNaN(horas)) { document.getElementById("tanalisis").innerHTML = "Horas para analisis: " + analisis; } var diseno = parseFloat(horas) * 0.20; if(!isNaN(horas)) { document.getElementById("tdiseño").innerHTML = "Horas para diseño: " + diseno; } var progra = parseFloat(horas) * 0.40; if(!isNaN(horas)) { document.getElementById("tprogra").innerHTML = "Horas para programación: " + progra; } var pruebas = parseFloat(horas) * 0.15; if(!isNaN(horas)) { document.getElementById("tpruebas").innerHTML = "Horas para pruebas: " + pruebas; } var sobrecarga = parseFloat(horas) * 0.15; if(!isNaN(horas)) { document.getElementById("tsobrecarga").innerHTML = "Horas para sobrecarga: " + sobrecarga; } <h4 id = tanalisi><br></h1> <h4 id = tdiseno><br></h1> <h4 id = tprogra><br></h1> <h4 id = tpruebas><br></h1> <h4 id = tsobrecarga><br></h1> */ }
import React from 'react' // local libs import ig from 'src/App/helpers/immutable/provedGet' export default pageText => [ <title>{ig(pageText, 'title')}</title>, <meta name="keywords" content={ig(pageText, 'keywords') || ''}/>, <meta name="description" content={ig(pageText, 'description') || ''}/>, ]
import React, { Component } from 'react'; class Hero extends Component { constructor(props) { super(props); } render() { return ( <section id="hero" className={'hero'} ref="hero"> <div className="hero-block"> <div className="hero-limit limit-grid"> <h2 className="title"> Bem vindo, Cauê </h2> <p className="text"> Crie, gerencia e aplique cupons de descontos em sua loja. </p> </div> </div> </section> ); } } export default Hero;
const server = require('./core/express'), paths = require('./core/initConfig'), db = require('./core/config/sequalize'); server.initExpress();
const bcrypt = require('bcryptjs'); const saltRounds = 10; const myPlaintextPassword = 'user1password'; const someOtherPlaintextPassword = 'not_bacon'; const salt = bcrypt.genSaltSync(saltRounds); const hash = bcrypt.hashSync(myPlaintextPassword, salt); const result1 = bcrypt.compareSync(myPlaintextPassword, hash); // true const result2 = bcrypt.compareSync(myPlaintextPassword, "$2a$10$EPnthcumX7nuadzr9saCt.lGr1HuyOrn3KoEuue5ZYPQ87HEcrQD."); // true console.log(myPlaintextPassword, hash); console.log(result1,result2);
// //put this into app.js to create ~10,000 test data // // for (var i = 0; i < 33; i++) { // // testdata.client(); // // } // // // var express = require('express'); // var router = express.Router(); // var pg = require('pg'); // var faker = require('faker'); // var config = require('../config/config.js'); // // var pool = new pg.Pool(config); // // var connectionString = 'postgres://localhost:5432/americandraperysystems'; // var count; // // function updateSurvey(i) { // pool.connect() // .then(function(client) { // client.query("UPDATE survey SET address_street=$1, address_city=$2, address_state=$3, address_zip=$4 " + // "WHERE client_id=$5", // [randInt(1001, 90000) + ' ' + faker.address.streetName() + ' ' + faker.address.streetSuffix(), faker.address.city(), faker.address.state(), faker.address.zipCode(), i]) // .then(function(result) { // client.release(); // console.log('survey updatesuccess'); // // }) // .catch(function(err) { // client.release(); // // console.log('select query error: ', err); // res.sendStatus(500); // }); // }); // } // // function testUser() { // pg.connect(connectionString, function(err, client, done) { // if(err) { // console.log('connection error: ', err); // } // client.query("INSERT INTO users (first_name, last_name, email, can_add_user, authorized) " + // "VALUES ($1,$2,$3,$4,$5)", // [faker.name.firstName(), faker.name.lastName(), faker.internet.email(), true, true], // function(err, result) { // done(); // close the connection. // if(err) { // console.log('select query error: ', err); // } // }); // }); // } // // function testClient() { // pg.connect(connectionString, function(err, client, done) { // if(err) { // console.log('connection error: ', err); // } // client.query("INSERT INTO client (client_name, primary_contact_name, primary_contact_phone_number, primary_contact_email, alt_contact_name, alt_phone_number, alt_contact_email, billing_address_street, billing_address_city, billing_address_state, billing_address_zip, survey_address_street, survey_address_city, survey_address_state, survey_address_zip) " + // "VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15) " + // "RETURNING id", // [faker.company.companyName(), faker.name.findName(), faker.phone.phoneNumber(), faker.internet.email(), faker.name.findName(), faker.phone.phoneNumber(), faker.internet.email(), faker.address.streetName(), faker.address.city(), faker.address.state(), faker.address.zipCode(), faker.address.streetName(), faker.address.city(), faker.address.state(), faker.address.zipCode()], // function(err, result) { // done(); //close the connection // console.log('client result', result.rows[0].id); // var num = randInt(1,6); // for (var i = 0; i < num; i++) { // // testSurvey(result.rows[0].id, faker.name.findName()) // } // if(err) { // console.log('select query error: ', err); // } // //Get the id of the most recently added client // }); // }); // } // // function testSurvey(client_id, installed_by) { // pg.connect(connectionString, function(err, survey, done) { // if(err) { // console.log('connection error: ', err); // } // survey.query("INSERT INTO survey (job_number, completion_date, survey_date, installed_by, status, last_modified, client_id) " + // "VALUES ($1,$2,$3,$4,$5,$6,$7) " + // "RETURNING id", // [randInt(10001, 40000), faker.date.future(), faker.date.past(), installed_by, status(), faker.date.recent(), client_id], // function(err, result) { // done(); // var num = randInt(1,20); // for (var i = 0; i < num; i++) { // // testArea(result.rows[0].id); // } //close the connection // // if(err) { // console.log('select query error: ', err); // } // //Get the id of the most recently added client // }); // }); // } // // function testArea(survey_id) { // pg.connect(connectionString, function(err, survey, done) { // if(err) { // console.log('connection error: ', err); // } // survey.query("INSERT INTO areas (notes, area_name, survey_id) " + // "VALUES ($1,$2,$3) " + // "RETURNING id", // [randNote(), faker.name.jobArea(), survey_id], // function(err, result) { // done(); //close the connection // var num = randInt(1,15); // for (var i = 0; i < num; i++) { // // testMeasurement(result.rows[0].id, randInt(1,50)); // } // if(err) { // console.log('select query error: ', err); // } // //Get the id of the most recently added client // }); // }); // } // // function testMeasurement(area_id, floor) { // pg.connect(connectionString, function(err, client, done) { // if(err) { // console.log('connection error: ', err); // } // client.query("INSERT INTO measurements (floor, room, quantity, width, length, ib_ob, fascia_size, controls, mount, fabric, area_id) " + // "VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)", // [floor, randInt(1,9000), randInt(1,8), rand(1,200), rand(1,200), inOut(), randInt(1,200), rightLeft(), faker.lorem.word() + ' Fascia', faker.lorem.word() + faker.lorem.word(), area_id], // function(err, result) { // done(); // close the connection. // if(err) { // ret(); // console.log('select query error: ', err); // } // }); // }); // } // // // function rand(min, max) { // return Math.random() * (max - min) + min; // } // // function randNote() { // if (Math.random() > 0.2) { // return faker.lorem.sentence() + 'ladder' + faker.lorem.sentence(); // } else { // return ''; // } // } // // function status() { // switch (randInt(1,5)) { // case 1: // return "Declined"; // break; // case 2: // return "In Progress"; // break; // case 3: // return "Completed"; // break; // case 4: // return "Pending"; // break; // } // } // // function rightLeft() { // if(randBool) { // return 'Right'; // } else { // return 'Left'; // } // } // // function inOut() { // if(randBool) { // return 'Inside'; // } else { // return 'Outside'; // } // } // function randBool() { // var randomBool = Math.random() > 0.5; // return randomBool; // } // function randInt(min, max) { // min = Math.ceil(min); // max = Math.floor(max); // return Math.floor(Math.random() * (max - min)) + min; // } // module.exports.user = testUser; // module.exports.survey = testSurvey; // module.exports.measurement = testMeasurement; // module.exports.client = testClient; // module.exports.randInt = randInt; // module.exports.updateSurvey = updateSurvey;
var struct_local_variable = [ [ "value", "struct_local_variable.html#a2f14c1ab2c4449bdb44c2a134ad70787", null ] ];
import Vue from 'vue' import App from './App.vue' import axios from 'axios' import VueRouter from 'vue-router' import FindCom from './components/FindCom.vue' import MyCom from './components/MyCom.vue' import PartCom from './components/PartCom.vue' Vue.config.productionTip = false Vue.prototype.$http = axios // 下载vue-router模块 @3.6.5 // 1. 在main.js中引入 // 2. 添加到Vue.use()身上 // 3. 创建VueRouter实例对象 // 4. 将路由对象注入 到new Vue 实例中 Vue.use(VueRouter) const router = new VueRouter({ routes:[ {path:'/find', component: FindCom }, {path:'/my', component: MyCom }, {path:'/part', component: PartCom }, ] }) new Vue({ render: h => h(App), router, }).$mount('#app')
import React, { Component } from "react"; import PropTypes from 'prop-types'; import { NavLink } from "react-router-dom"; import SearchBox from "../SearchBox/SearchBox"; import { Dropdown, DropdownMenu, DropdownToggle } from 'reactstrap'; class NavBar extends Component { constructor(props) { super(props); this.toggle = this.toggle.bind(this); this.state = { dropdownOpen: false }; } toggle() { this.setState({ dropdownOpen: !this.state.dropdownOpen }); } render() { const { user, admin } = this.props; return ( <div className="container" style={{ marginTop: '-60px' }}> <nav className="navbar navbar-expand-lg navbar-light bg-light" data-test='NavBarComponent'> <a className="navbar-brand" href="/"> Movies Catalog </a> {/* <button className="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation" > <span className="navbar-toggler-icon" /> </button> */} <Dropdown isOpen={this.state.dropdownOpen} toggle={this.toggle}> <DropdownToggle className="navbar-toggler" type="button" data-target="#navbarNav" aria-controls="navbarNav" aria-label="Toggle navigation" tag="span" onClick={this.toggle} data-toggle="dropdown" aria-expanded={this.state.dropdownOpen} > <span className="navbar-toggler-icon" /> </DropdownToggle> <DropdownMenu> {admin && user && ( <div onClick={this.toggle}> <NavLink exact to="/customers" className="nav-link"> Customers </NavLink> </div> )} {user && ( <div onClick={this.toggle}> <NavLink exact to="/rentals" className="nav-link"> Rentals </NavLink> </div>)} {!user && ( <React.Fragment> <div onClick={this.toggle}> <NavLink to="/login" className="nav-link"> Login </NavLink> </div> <div onClick={this.toggle}> <NavLink to="/register" className="nav-link"> Register </NavLink> </div> </React.Fragment> )} {user && ( <React.Fragment> <div className="nav-item"> <NavLink to="/profile" className="nav-link"> {user.name} </NavLink> </div> <div className="nav-item" data-test='LogoutComponent'> <NavLink to="/logout" className="nav-link"> Logout </NavLink> </div> </React.Fragment> )} {/* <div onClick={this.toggle}>Custom dropdown item</div> <div onClick={this.toggle}>Custom dropdown item</div> */} </DropdownMenu> </Dropdown> <div className="collapse navbar-collapse" id="navbarNav"> <ul className="navbar-nav mr-auto mt-2 mt-lg-0"> <li className="nav-item" data-test='HomeComponent'> <NavLink exact to="/" className="nav-link"> Home </NavLink> </li> {admin && user && ( <React.Fragment> <li className="nav-item" data-test='CustomersComponent'> <NavLink exact to="/customers" className="nav-link"> Customers </NavLink> </li> </React.Fragment> )} {user && ( <React.Fragment> <li className="nav-item" data-test='RentalsComponent'> <NavLink exact to="/rentals" className="nav-link"> Rentals </NavLink> </li> </React.Fragment> )} {!user && ( <React.Fragment> <li className="nav-item" data-test='LoginComponent'> <NavLink to="/login" className="nav-link"> Login </NavLink> </li> <li className="nav-item" data-test='RegisterComponent'> <NavLink to="/register" className="nav-link"> Register </NavLink> </li> </React.Fragment> )} {user && ( <React.Fragment> <li className="nav-item"> <NavLink to="/profile" className="nav-link"> {user.name} </NavLink> </li> <li className="nav-item" data-test='LogoutComponent'> <NavLink to="/logout" className="nav-link"> Logout </NavLink> </li> </React.Fragment> )} </ul> <form className="form-inline my-2 my-lg-0" data-test='SearchBoxComponent'> <SearchBox /> </form> </div> </nav> </div > ); } }; NavBar.propTypes = { user: PropTypes.object, admin: PropTypes.bool } export default NavBar;
/*(function() { 'use strict'; // Add app, add constant, set properties on rootscope in run angular.module('myApp', ['myApp.core']) .run(['VERSION', '$rootScope', function(VERSION, $rootScope) { $rootScope.version = VERSION; $rootScope.name = 'hello there'; $rootScope.klass = 'red'; } ]); angular.module('myApp.core', []) .constant('VERSION', '1.0'); })();*/
/* ############################################################ ######Dados de Javascript do sistema Projectcad ######Autor: Bruno Costa ######Data: 30/12/2017 ############################################################ */ function scanData() { inputDataInicio = document.getElementById("dinicio").value; inputDataFim = document.getElementById("dfim").value; if (inputDataInicio != '' && inputDataFim != ''){ dataHoraInicio = new Date(inputDataInicio.split('-').join('/')); dataHoraFim = new Date(inputDataFim.split('-').join('/')); var diferenca = Math.abs(dataHoraInicio - dataHoraFim); //diferença em milésimos e positivo var dia = 1000*60*60*24; // milésimos de segundo correspondente a um dia var total = Math.round(diferenca/dia); //valor total de dias arredondado var emHoras = Math.round(total*24); // valor total em Horas if (inputDataInicio > inputDataFim) { document.getElementById('duracao').value = '-' + emHoras; }else{document.getElementById('duracao').value = emHoras;} } }
const promise = require('bluebird'); const initOptions = { promiseLib: promise }; const cn = { database: 'ar_photoshot_db', host : '192.168.1.241', port : '5432', user : 'miracle', password: '594a40eccf008' } const pgp = require('pg-promise')(initOptions); const db = pgp(cn); module.exports = db;
import React, { Component } from 'react' import { TabBar } from 'antd-mobile' import home from '@a/images/iconku/ihome.png' import homeActive from '@a/images/iconku/ihomeac.png' import fresh from '@a/images/iconku/ifresh.png' import freshActive from '@a/images/iconku/ifreshac.png' import vegetable from '@a/images/iconku/iveget.png' import vegetableActive from '@a/images/iconku/ivegetac.png' import order from '@a/images/iconku/iordr.png' import ordrActive from '@a/images/iconku/iordrac.png' import my from '@a/images/iconku/imy.png' import myActive from '@a/images/iconku/imyac.png' import Order from './order/container/Order' import {ComList } from './comlist' import { Vegetables } from './vegetables' import GrabFresh from './grabfresh/container/GrabFresh' import { withRouter } from "react-router-dom"; import My from '@v/profile/My.jsx' import Login from '@v/Login/Login.jsx' const TabsArr = [ { title: "首页", icon: home, key: "home", selectedIcon: homeActive, selectedTab: "/home", componName: <ComList></ComList> }, { title: "抢鲜", icon: fresh, key: "grabFresh", selectedIcon: freshActive, selectedTab: "/grabFresh", componName: <GrabFresh ></GrabFresh> }, { title: "菜圈", icon: vegetable, key: "vegetables", selectedIcon: vegetableActive, selectedTab: "/vegetable", componName: <Vegetables ></Vegetables> }, { title: "订单", icon: order, key: "order", selectedIcon: ordrActive, selectedTab: "/order", componName: <Order></Order> }, { title: "我的", icon: my, key: "my", selectedIcon: myActive, selectedTab: "/my", componName: <My ></My> }, ] @withRouter class Home extends Component{ constructor(props) { super(props) this.state = { selectedTab: localStorage.getItem("selectedTab") || "/home", hidden: false, fullScreen: true, userSta:false } } componentDidMount() { localStorage.setItem("selectedTab", this.state.selectedTab) if (localStorage.getItem("userState") !== "null" &&localStorage.getItem("userState") ) { console.log("登陆"); this.setState({ userSta:true }) } } onPressclk = (value) => { return () => { console.log(this.state.userSta); if (value.key === "order" && !this.state.userSta) { console.log(1); console.log(this.props.history.push("/login", { from: "/home" })); localStorage.setItem("selectedTab", "/home") } else { this.setState({ selectedTab: value.selectedTab, }); localStorage.setItem("selectedTab",value.selectedTab) } } } render(){ return( <div style={this.state.fullScreen ? { position: 'fixed', height: '100%', width: '100%', top: 0 } : { height: 400 }}> <TabBar unselectedTintColor="#949494" tintColor="rgb(0,204,153)" barTintColor="white" prerenderingSiblingsNumber={0} hidden={this.state.hidden} > { TabsArr.map(value => { return ( <TabBar.Item title={value.title} key={value.key} icon={<div style={{ width: '22px', height: '22px', background: `url(${value.icon}) center center / 21px 21px no-repeat` }} /> } selectedIcon={<div style={{ width: '22px', height: '22px', background: `url(${value.selectedIcon}) center center / 21px 21px no-repeat` }} /> } selected={this.state.selectedTab === value.selectedTab} onPress={this.onPressclk(value)} > {/* this.props.history.push("/submitOrder", {from: '/details', value}) */} {/* {value.key === "order" ? (this.state.userSta?value.componName:(localStorage.setItem("selectedTab","/my"))):value.componName} */} {/* {value.key === "order" ? (this.state.userSta?value.componName:<My/>):value.componName} */} {value.key === "order" ? (this.state.userSta ? value.componName :""):value.componName} </TabBar.Item> ) }) } </TabBar> </div> ) } } export default Home
(function($) { var options = $('[data-choice]'); option = Array.from(options); var tl = new TimelineMax(); tl.from(option[0], 1, {autoAlpha: 0, y:50, onStart: nameChange, onComplete: nameChange }) .from(option[1], 1, {opacity: 0, y:50 }, "-=.2") .from(option[2], 1, {autoAlpha: 0, y:60, ease:Power4.easeOut }, "-=.5") .from(option[3], 1, {opacity: 0, y:70, ease:Elastic.easeOut, onComplete: nameChange }, "-=.6") .staggerFrom(options, 1, {cycle: { x:[20, -20] } } ) function nameChange() { // console.log('simple test purposes. eventually, using closures would be cool'); // console.log(this.target.innerText); } // .fromTo(img, 2, {width: 800}, {width: 400, rotation: 360}) // .from(h2, 1, {opacity: 0, scale: 3}, "+=1") })(jQuery)
exports.init = function(SARAH, SARAH2){ setTimeout(function(){ SARAH.speak("Initialisation terminée"); }, 1000); } exports.action = function(data, callback, config, SARAH) { var exec = require('child_process').exec; switch(data.val) { case "playsalon": var process = '%CD%/plugins/multi/lieux/salon/playsalon.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salon"; Txt[1] = "musique en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salon"; Txt[3] = "strim up dans le salon"; Txt[4] = "diffusion en cour dans le salon"; break; case "play10salon": var process = '%CD%/plugins/multi/lieux/salon/play10salon.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salon a di pour sans"; Txt[1] = "musique a di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salon a di pour sans"; Txt[3] = "strim up dans le salon a di pour sans"; Txt[4] = "diffusion en cour dans le salon a di pour sans"; break; case "play20salon": var process = '%CD%/plugins/multi/lieux/salon/play20salon.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salon a vin pour sans"; Txt[1] = "musique a vin pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salon a vin pour sans"; Txt[3] = "strim up dans le salon a vin pour sans"; Txt[4] = "diffusion en cour dans le salon a vin pour sans"; break; case "play30salon": var process = '%CD%/plugins/multi/lieux/salon/play30salon.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salon a trente pour sans"; Txt[1] = "musique a trente pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salon a trente pour sans"; Txt[3] = "strim up dans le salon a trente pour sans"; Txt[4] = "diffusion en cour dans le salon a trente pour sans"; break; case "play40salon": var process = '%CD%/plugins/multi/lieux/salon/play40salon.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salon a quarante pour sans"; Txt[1] = "musique a quarante pour sansen cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salon a quarante pour sans"; Txt[3] = "strim up dans le salon a quarante pour sans"; Txt[4] = "diffusion en cour dans le salon a quarante pour sans"; break; case "play50salon": var process = '%CD%/plugins/multi/lieux/salon/play50salon.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salon a cinquante pour sans"; Txt[1] = "musique a cinquante pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salon a cinquante pour sans"; Txt[3] = "strim up dans le salon a cinquante pour sans"; Txt[4] = "diffusion en cour dans le salon a cinquante pour sans"; break; case "play60salon": var process = '%CD%/plugins/multi/lieux/salon/play60salon.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salon a soissante pour sans"; Txt[1] = "musique a soissante pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salon a soissante pour sans"; Txt[3] = "strim up dans le salon a soissante pour sans"; Txt[4] = "diffusion en cour dans le salon a soissante pour sans"; break; case "play70salon": var process = '%CD%/plugins/multi/lieux/salon/play70salon.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salon a soissante di pour sans"; Txt[1] = "musique a soissante di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salon a soissante di pour sans"; Txt[3] = "strim up dans le salon a soissante di pour sans"; Txt[4] = "diffusion en cour dans le salon a soissante di pour sans"; break; case "play80salon": var process = '%CD%/plugins/multi/lieux/salon/play80salon.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salon a quatrevin pour sans"; Txt[1] = "musique a quatrevin pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salon a quatrevin pour sans"; Txt[3] = "strim up dans le salon a quatrevin pour sans"; Txt[4] = "diffusion en cour dans le salon a quatrevin pour sans"; break; case "play90salon": var process = '%CD%/plugins/multi/lieux/salon/play90salon.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salon a quatrevin di pour sans"; Txt[1] = "musique a quatrevin di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salon a quatrevin di pour sans"; Txt[3] = "strim up dans le salon a quatrevin di pour sans"; Txt[4] = "diffusion en cour dans le salon a quatrevin di pour sans"; break; case "play100salon": var process = '%CD%/plugins/multi/lieux/salon/play100salon.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salon a sans pour sans"; Txt[1] = "musique a sans pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salon a sans pour sans"; Txt[3] = "strim up dans le salon a sans pour sans"; Txt[4] = "diffusion en cour dans le salon a sans pour sans"; break; case "playsalledebain": var process = '%CD%/plugins/multi/lieux/salledebain/playsalledebain.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salle de bain"; Txt[1] = "musique en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salle de bain"; Txt[3] = "strim up dans le salle de bain"; Txt[4] = "diffusion en cour dans le salle de bain"; Txt[5] = "je diffuse le son dans la salle de bain"; break; case "play10salledebain": var process = '%CD%/plugins/multi/lieux/salledebain/play10salledebain.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salle de bain a di pour sans"; Txt[1] = "musique a di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salle de bain a di pour sans"; Txt[3] = "strim up dans le salle de bain a di pour sans"; Txt[4] = "diffusion en cour dans le salle de bain a di pour sans"; Txt[5] = "je diffuse le son dans la salle de bain a di pour sans"; break; case "play20salledebain": var process = '%CD%/plugins/multi/lieux/salledebain/play20salledebain.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salle de bain a vin pour sans"; Txt[1] = "musique a vin pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salle de bain a vin pour sans"; Txt[3] = "strim up dans le salle de bain a vin pour sans"; Txt[4] = "diffusion en cour dans le salle de bain a vin pour sans"; Txt[5] = "je diffuse le son dans la salle de bain a vin pour sans"; break; case "play30salledebain": var process = '%CD%/plugins/multi/lieux/salledebain/play30salledebain.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salle de bain a trente pour sans"; Txt[1] = "musique a trente pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salle de bain a trente pour sans"; Txt[3] = "strim up dans le salle de bain a trente pour sans"; Txt[4] = "diffusion en cour dans le salle de bain a trente pour sans"; Txt[5] = "je diffuse le son dans la salle de bain a trente pour sans"; break; case "play40salledebain": var process = '%CD%/plugins/multi/lieux/salledebain/play40salledebain.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salle de bain a quarante pour sans"; Txt[1] = "musique a quarante pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salle de bain a quarante pour sans"; Txt[3] = "strim up dans le salle de bain a quarante pour sans"; Txt[4] = "diffusion en cour dans le salle de bain a quarante pour sans"; Txt[5] = "je diffuse le son dans la salle de bain a quarante pour sans"; break; case "play50salledebain": var process = '%CD%/plugins/multi/lieux/salledebain/play50salledebain.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salle de bain a cinquante pour sans"; Txt[1] = "musique a cinquante pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salle de bain a cinquante pour sans"; Txt[3] = "strim up dans le salle de bain a cinquante pour sans"; Txt[4] = "diffusion en cour dans le salle de bain a cinquante pour sans"; Txt[5] = "je diffuse le son dans la salle de bain a cinquante pour sans"; break; case "play60salledebain": var process = '%CD%/plugins/multi/lieux/salledebain/play60salledebain.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salle de bain a soissante pour sans"; Txt[1] = "musique a soissante pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salle de bain a soissante pour sans"; Txt[3] = "strim up dans le salle de bain a soissante pour sans"; Txt[4] = "diffusion en cour dans le salle de bain a soissante pour sans"; Txt[5] = "je diffuse le son dans la salle de bain a soissante pour sans"; break; case "play70salledebain": var process = '%CD%/plugins/multi/lieux/salledebain/play70salledebain.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salle de bain a soissante di pour sans"; Txt[1] = "musique a soissante di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salle de bain a soissante di pour sans"; Txt[3] = "strim up dans le salle de bain a soissante di pour sans"; Txt[4] = "diffusion en cour dans le salle de bain a soissante di pour sans"; Txt[5] = "je diffuse le son dans la salle de bain a soissante di pour sans"; break; case "play80salledebain": var process = '%CD%/plugins/multi/lieux/salledebain/play80salledebain.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salle de bain a quatrevin pour sans"; Txt[1] = "musique a quatrevin pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salle de bain a quatrevin pour sans"; Txt[3] = "strim up dans le salle de bain a quatrevin pour sans"; Txt[4] = "diffusion en cour dans le salle de bain a quatrevin pour sans"; Txt[5] = "je diffuse le son dans la salle de bain a quatrevin pour sans"; break; case "play90salledebain": var process = '%CD%/plugins/multi/lieux/salledebain/play90salledebain.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salle de bain a quatrevin di pour sans"; Txt[1] = "musique a quatrevin di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salle de bain a quatrevin di pour sans"; Txt[3] = "strim up dans le salle de bain a quatrevin di pour sans"; Txt[4] = "diffusion en cour dans le salle de bain a quatrevin di pour sans"; Txt[5] = "je diffuse le son dans la salle de bain a quatrevin di pour sans"; break; case "play100salledebain": var process = '%CD%/plugins/multi/lieux/salledebain/play100salledebain.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans le salle de bain a sans pour sans"; Txt[1] = "musique a sans pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans le salle de bain a sans pour sans"; Txt[3] = "strim up dans le salle de bain a sans pour sans"; Txt[4] = "diffusion en cour dans le salle de bain a sans pour sans"; Txt[5] = "je diffuse le son dans la salle de bain a sans pour sans"; break; case "playcuisine": var process = '%CD%/plugins/multi/lieux/cuisine/playcuisine.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la cuisine"; Txt[1] = "musique en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la cuisine"; Txt[3] = "strim up dans la cuisine"; Txt[4] = "diffusion en cour dans la cuisine"; break; case "play10cuisine": var process = '%CD%/plugins/multi/lieux/cuisine/play10cuisine.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la cuisine a di pour sans"; Txt[1] = "musique a di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la cuisine a di pour sans"; Txt[3] = "strim up dans la cuisine a di pour sans"; Txt[4] = "diffusion en cour dans la cuisine a di pour sans"; break; case "play20cuisine": var process = '%CD%/plugins/multi/lieux/cuisine/play20cuisine.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la cuisine a vin pour sans"; Txt[1] = "musique a vin pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la cuisine a vin pour sans"; Txt[3] = "strim up dans la cuisine a vin pour sans"; Txt[4] = "diffusion en cour dans la cuisine a vin pour sans"; break; case "play30cuisine": var process = '%CD%/plugins/multi/lieux/cuisine/play30cuisine.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la cuisinea trente pour sans "; Txt[1] = "musique a trente pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la cuisine a trente pour sans"; Txt[3] = "strim up dans la cuisine a trente pour sans"; Txt[4] = "diffusion en cour dans la cuisine a trente pour sans"; break; case "play40cuisine": var process = '%CD%/plugins/multi/lieux/cuisine/play40cuisine.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la cuisine a quarante pour sans"; Txt[1] = "musique a quarante pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la cuisine a quarante pour sans"; Txt[3] = "strim up dans la cuisine a quarante pour sans"; Txt[4] = "diffusion en cour dans la cuisine a quarante pour sans"; break; case "play50cuisine": var process = '%CD%/plugins/multi/lieux/cuisine/play50cuisine.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la cuisine a cinquante pour sans"; Txt[1] = "musique a cinquante pour sansen cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la cuisine a cinquante pour sans"; Txt[3] = "strim up dans la cuisine a cinquante pour sans"; Txt[4] = "diffusion en cour dans la cuisinea cinquante pour sans "; break; case "play60cuisine": var process = '%CD%/plugins/multi/lieux/cuisine/play60cuisine.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la cuisine a soissante pour sans"; Txt[1] = "musique a soissante pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la cuisine a soissante pour sans"; Txt[3] = "strim up dans la cuisine a soissante pour sans"; Txt[4] = "diffusion en cour dans la cuisine a soissante pour sans"; break; case "play70cuisine": var process = '%CD%/plugins/multi/lieux/cuisine/play70cuisine.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la cuisine a soissante di pour sans"; Txt[1] = "musique a soissante di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la cuisine a soissante di pour sans"; Txt[3] = "strim up dans la cuisine a soissante di pour sans"; Txt[4] = "diffusion en cour dans la cuisine a soissante di pour sans"; break; case "play80cuisine": var process = '%CD%/plugins/multi/lieux/cuisine/play80cuisine.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la cuisine a quatrevin pour sans"; Txt[1] = "musique a quatrevin pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la cuisine a quatrevin pour sans"; Txt[3] = "strim up dans la cuisine a quatrevin pour sans"; Txt[4] = "diffusion en cour dans la cuisine a quatrevin pour sans"; break; case "play90cuisine": var process = '%CD%/plugins/multi/lieux/cuisine/play90cuisine.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la cuisine a quatrevin di pour sans"; Txt[1] = "musique a quatrevin di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la cuisine a quatrevin di pour sans"; Txt[3] = "strim up dans la cuisine a quatrevin di pour sans"; Txt[4] = "diffusion en cour dans la cuisine a quatrevin di pour sans"; break; case "play100cuisine": var process = '%CD%/plugins/multi/lieux/cuisine/play100cuisine.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la cuisine a sans pour sans"; Txt[1] = "musique a sans pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la cuisine a sans pour sans"; Txt[3] = "strim up dans la cuisine a sans pour sans"; Txt[4] = "diffusion en cour dans la cuisine a sans pour sans"; break; case "playchambe": var process = '%CD%/plugins/multi/lieux/chambre/playchambre.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la chambre"; Txt[1] = "musique en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la chambre"; Txt[3] = "strim up dans la chambre"; Txt[4] = "diffusion en cour dans la chambre"; Txt[5] = "je diffuse le son dans la chambre"; break; case "play10chambe": var process = '%CD%/plugins/multi/lieux/chambre/play10chambre.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la chambre a di pour sans"; Txt[1] = "musique a di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la chambre a di pour sans"; Txt[3] = "strim up dans la chambre a di pour sans"; Txt[4] = "diffusion en cour dans la chambre a di pour sans"; Txt[5] = "je diffuse le son dans la chambre a di pour sans"; break; case "play20chambe": var process = '%CD%/plugins/multi/lieux/chambre/play20chambre.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la chambre a vin pour sans"; Txt[1] = "musique a vin pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la chambre a vin pour sans"; Txt[3] = "strim up dans la chambre a vin pour sans"; Txt[4] = "diffusion en cour dans la chambre a vin pour sans"; Txt[5] = "je diffuse le son dans la chambre a vin pour sans"; break; case "play30chambe": var process = '%CD%/plugins/multi/lieux/chambre/play30chambre.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la chambre a trente pour sans"; Txt[1] = "musique a trente pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la chambre a trente pour sans"; Txt[3] = "strim up dans la chambre a trente pour sans"; Txt[4] = "diffusion en cour dans la chambre a trente pour sans"; Txt[5] = "je diffuse le son dans la chambre a trente pour sans"; break; case "play40chambe": var process = '%CD%/plugins/multi/lieux/chambre/play40chambre.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la chambre a quarante pour sans"; Txt[1] = "musique a quarante pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la chambre a quarante pour sans"; Txt[3] = "strim up dans la chambre a quarante pour sans"; Txt[4] = "diffusion en cour dans la chambre a quarante pour sans"; Txt[5] = "je diffuse le son dans la chambre a quarante pour sans"; break; case "play50chambe": var process = '%CD%/plugins/multi/lieux/chambre/play50chambre.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la chambre a cinquante pour sans"; Txt[1] = "musique a cinquante pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la chambre a cinquante pour sans"; Txt[3] = "strim up dans la chambre a cinquante pour sans"; Txt[4] = "diffusion en cour dans la chambre a cinquante pour sans"; Txt[5] = "je diffuse le son dans la chambre a cinquante pour sans"; break; case "play60chambe": var process = '%CD%/plugins/multi/lieux/chambre/play60chambre.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la chambre a soissante pour sans"; Txt[1] = "musique a soissante pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la chambre a soissante pour sans"; Txt[3] = "strim up dans la chambre a soissante pour sans"; Txt[4] = "diffusion en cour dans la chambre a soissante pour sans"; Txt[5] = "je diffuse le son dans la chambre a soissante pour sans"; break; case "play70chambe": var process = '%CD%/plugins/multi/lieux/chambre/play70chambre.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la chambre a soissante di pour sans"; Txt[1] = "musique a soissante di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la chambre a soissante di pour sans"; Txt[3] = "strim up dans la chambre a soissante di pour sans"; Txt[4] = "diffusion en cour dans la chambre a soissante di pour sans"; Txt[5] = "je diffuse le son dans la chambre a soissante di pour sans"; break; case "play80chambe": var process = '%CD%/plugins/multi/lieux/chambre/play80chambre.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la chambre a quatrevin pour sans"; Txt[1] = "musique a quatrevin pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la chambre a quatrevin pour sans"; Txt[3] = "strim up dans la chambre a quatrevin pour sans"; Txt[4] = "diffusion en cour dans la chambre a quatrevin pour sans"; Txt[5] = "je diffuse le son dans la chambre a quatrevin pour sans"; break; case "play90chambe": var process = '%CD%/plugins/multi/lieux/chambre/play90chambre.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la chambre a quatrevin di pour sans"; Txt[1] = "musique a quatrevin di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la chambre a quatrevin di pour sans"; Txt[3] = "strim up dans la chambre a quatrevin di pour sans"; Txt[4] = "diffusion en cour dans la chambre a quatrevin di pour sans"; Txt[5] = "je diffuse le son dans la chambre a quatrevin di pour sans"; break; case "play100chambe": var process = '%CD%/plugins/multi/lieux/chambre/play100chambre.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la chambre a sans pour sans"; Txt[1] = "musique a sans pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la chambre a sans pour sans"; Txt[3] = "strim up dans la chambre a sans pour sans"; Txt[4] = "diffusion en cour dans la chambre a sans pour sans"; Txt[5] = "je diffuse le son dans la chambre a sans pour sans"; break; case "playbar": var process = '%CD%/plugins/multi/lieux/bar/playbar.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans la chambre"; Txt[1] = "musique en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute dans la chambre"; Txt[3] = "strim up dans la chambre"; Txt[4] = "diffusion en cour dans la chambre"; Txt[5] = "je diffuse le son dans la chambre"; break; case "play10bar": var process = '%CD%/plugins/multi/lieux/bar/play10bar.bat'; var Txt = new Array; Txt[0] = "je mai la musique dans au bar a di pour sans"; Txt[1] = "musique a di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute au bar a di pour sans"; Txt[3] = "strim up dans au bar a di pour sans"; Txt[4] = "diffusion en cour au bar a di pour sans"; Txt[5] = "je diffuse le son au bar a di pour sans"; break; case "play20bar": var process = '%CD%/plugins/multi/lieux/bar/play20bar.bat'; var Txt = new Array; Txt[0] = "je mai la musique au bar a vin pour sans"; Txt[1] = "musique a vin pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute au bar a vin pour sans"; Txt[3] = "strim up au bar a vin pour sans"; Txt[4] = "diffusion en cour au bar a vin pour sans"; Txt[5] = "je diffuse le son au bar a vin pour sans"; break; case "play30bar": var process = '%CD%/plugins/multi/lieux/bar/play30bar.bat'; var Txt = new Array; Txt[0] = "je mai la musique au bar a trente pour sans"; Txt[1] = "musique en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute au bar a trente pour sans"; Txt[3] = "strim up au bar a trente pour sans"; Txt[4] = "diffusion en cour au bar a trente pour sans"; Txt[5] = "je diffuse le son au bar a trente pour sans"; break; case "play40bar": var process = '%CD%/plugins/multi/lieux/bar/play40bar.bat'; var Txt = new Array; Txt[0] = "je mai la musique au bar a quarante pour sans"; Txt[1] = "musique a quarante pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute au bar a quarante pour sans"; Txt[3] = "strim up au bar a quarante pour sans"; Txt[4] = "diffusion en cour au bar a quarante pour sans"; Txt[5] = "je diffuse le son au bar a quarante pour sans"; break; case "play50bar": var process = '%CD%/plugins/multi/lieux/bar/play50bar.bat'; var Txt = new Array; Txt[0] = "je mai la musique au bar a cinquante pour sans"; Txt[1] = "musique a cinquante pour sansen cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute au bar a cinquante pour sans"; Txt[3] = "strim up au bar a cinquante pour sans"; Txt[4] = "diffusion en cour au bar a cinquante pour sans"; Txt[5] = "je diffuse le son au bar a cinquante pour sans"; break; case "play60bar": var process = '%CD%/plugins/multi/lieux/bar/play60bar.bat'; var Txt = new Array; Txt[0] = "je mai la musique au bar a soissante pour sans"; Txt[1] = "musique a soissante pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute au bar"; Txt[3] = "strim up au bar a soissante pour sans"; Txt[4] = "diffusion en cour au bar a soissante pour sans"; Txt[5] = "je diffuse le son au bar a soissante pour sans"; break; case "play70bar": var process = '%CD%/plugins/multi/lieux/bar/play70bar.bat'; var Txt = new Array; Txt[0] = "je mai la musique au bar a soissante di pour sans"; Txt[1] = "musique a soissante di pour sansen cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute au bar a soissante di pour sans"; Txt[3] = "strim up au bar a soissante di pour sans"; Txt[4] = "diffusion en cour au bar a soissante di pour sans"; Txt[5] = "je diffuse le son au bar a soissante di pour sans"; break; case "play80bar": var process = '%CD%/plugins/multi/lieux/bar/play80bar.bat'; var Txt = new Array; Txt[0] = "je mai la musique au bar a quatrevin pour sans"; Txt[1] = "musique a quatrevin pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute au bar a quatrevin pour sans"; Txt[3] = "strim up au bar a quatrevin pour sans"; Txt[4] = "diffusion en cour au bar a quatrevin pour sans"; Txt[5] = "je diffuse le son au bar a quatrevin pour sans"; break; case "play90bar": var process = '%CD%/plugins/multi/lieux/bar/play90bar.bat'; var Txt = new Array; Txt[0] = "je mai la musique au bar a quatrevin di pour sans"; Txt[1] = "musique a quatrevin di pour sans en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute au bar a quatrevin di pour sans"; Txt[3] = "strim up au bar a quatrevin di pour sans"; Txt[4] = "diffusion en cour au bar a quatrevin di pour sans"; Txt[5] = "je diffuse le son au bar a quatrevin di pour sans"; break; case "play100bar": var process = '%CD%/plugins/multi/lieux/bar/play100bar.bat'; var Txt = new Array; Txt[0] = "je mai la musique au bar a sans pour sans"; Txt[1] = "musique en cour de transfert veuillez patienter"; Txt[2] = "passage en ecoute au bar a sans pour sans"; Txt[3] = "strim up au bar a sans pour sans"; Txt[4] = "diffusion en cour au bar a sans pour sans"; Txt[5] = "je diffuse le son au bar a sans pour sans"; break; case "playall": var process = '%CD%/plugins/multi/lieux/tous/playall.bat'; var Txt = new Array; Txt[0] = "je diffuse la musique dans toute les piaices"; Txt[1] = "je diffuse l'audio partout"; Txt[2] = "ecoute dans toute les pieces en cour"; Txt[3] = "le son est partout"; break; case "pauseall": var process = '%CD%/plugins/multi/lieux/tous/pauseall.bat'; var Txt = new Array; Txt[0] = "J'arraite la musique dans toute les piaice"; Txt[1] = "Je coupe la musique partout"; Txt[2] = "diffusion stoppai dans toute les piaice"; Txt[2] = "Audio en cour d'arrai"; break; case "startmultiroom": var process = '%CD%/plugins/multi/lieux/tous/startmultiroom.bat'; var Txt = new Array; Txt[0] = "je lance l'application Tuneblade"; Txt[1] = "les systaimes audio se connaicte"; Txt[2] = "le multiroum daimarre"; Txt[3] = "systaime en cour de connection"; break; case "startmultiroommusic": var process = '%CD%/plugins/multi/lieux/tous/startmultiroommusic.bat'; var Txt = new Array; Txt[0] = "je lance l'application musicale"; Txt[1] = "les systaimes audio se connaicte"; Txt[2] = "le multiroum audio daimarre"; Txt[3] = "systaime musical en cour de connection"; break; case "la": var Txt = new Array; Txt[0] = "oui monsieur"; Txt[1] = "oui monsieur, que puije pour vous"; Txt[2] = "biensur"; Txt[3] = "comme toujours"; Txt[4] = "oui"; Txt[4] = "Pour vous monsieur, toujours"; break; case "stopcuisine": var process = '%CD%/plugins/multi/lieux/cuisine/stopcuisine.bat'; var Txt = new Array; Txt[0] = "J'arraite la musique dans la cuisine"; Txt[1] = "Je coupe la musique dans la cuisine"; Txt[2] = "diffusion stoppai dans la cuisine"; Txt[2] = "Audio en cour d'arrai dans la cuisine"; break; case "stopsalon": var process = '%CD%/plugins/multi/lieux/salon/stopsalon.bat'; var Txt = new Array; Txt[0] = "J'arraite la musique dans le salon"; Txt[1] = "Je coupe la musique dans le salon"; Txt[2] = "diffusion stoppai dans le salon"; Txt[2] = "Audio en cour d'arrai dans le salon"; break; case "stopchambre": var process = '%CD%/plugins/multi/lieux/chambre/stopchambre.bat'; var Txt = new Array; Txt[0] = "J'arraite la musique dans la chambre"; Txt[1] = "Je coupe la musique dans la chambre"; Txt[2] = "diffusion stoppai dans la chambre"; Txt[2] = "Audio en cour d'arrai dans la chambre"; break; case "stopbar": var process = '%CD%/plugins/multi/lieux/bar/stopbar.bat'; var Txt = new Array; Txt[0] = "J'arraite la musique au bar"; Txt[1] = "Je coupe la musique au bar"; Txt[2] = "diffusion stoppai au bar"; Txt[2] = "Audio en cour d'arrai au bar"; break; case "stopsalledebain": var process = '%CD%/plugins/multi/lieux/salledebain/stopsalledebain.bat'; var Txt = new Array; Txt[0] = "J'arraite la musique dans la salle de bain"; Txt[1] = "Je coupe la musique dans la salle de bain"; Txt[2] = "diffusion stoppai dans la salle de bain"; Txt[2] = "Audio en cour d'arrai dans la salle de bain"; break; case "stopmultiroom": var process = '%CD%/plugins/multi/lieux/tous/stopmultiroom.bat'; var Txt = new Array; Txt[0] = "Je fairme l'application tuneblaillde"; Txt[1] = "Je fairme le multiroum"; Txt[2] = "diffusion arraitai"; Txt[2] = "Audio coupai"; break; case "stopmultiroommusic": var process = '%CD%/plugins/multi/lieux/tous/stopmultiroommusic.bat'; var Txt = new Array; Txt[0] = "Je fairme l'application tuneblaillde et kodi"; Txt[1] = "Je fairme le multiroum musicale"; Txt[2] = "diffusion arretai"; Txt[2] = "Audio coupai"; break; } var child = exec(process, function (error, stdout, stderr) { console.log(process); }); Choix = Math.floor(Math.random() * Txt.length); callback({'tts': Txt[Choix]}); }
import {HttpRequest} from './HttpRequest'; export function RetryRequest (url, options) { const httpRequest = HttpRequest(url, options); const obj = {}; let timer; function retryPromise(method, data, beforeRetry) { const { retryTimeout = 1000, maxRetry = 0 } = options; return new Promise((resolve, reject) => { (function req(counter, privateData) { httpRequest.send(method, privateData) .then(resolve) .catch((error) => { if (counter <= maxRetry) { clearTimeout(timer); timer = setTimeout(function () { req(counter + 1, beforeRetry(privateData)); }, retryTimeout); } else { reject(error); } }); }(1, data)); }); } obj.send = function (method, data, beforeRetry) { const callback = beforeRetry || (d => d); return retryPromise(method, data, callback); }; obj.post = function (data) { return httpRequest.post(data); }; obj.get = function () { return httpRequest.get(); }; obj.abort = function () { clearTimeout(timer); httpRequest.abort(); }; return obj; }
import React from "react"; import { Checkbox } from "semantic-ui-react"; import PropTypes from "prop-types"; import styles from "./RenderedField.module.scss"; export const RenderedCheckboxField = ({ input: { value, onChange }, label }) => { const handleChecked = (e, { checked }) => onChange(checked); return ( <Checkbox className={styles.renderedFieldContainer} label={label} checked={value ? true : false} onChange={handleChecked} /> ); }; RenderedCheckboxField.propTypes = { input: PropTypes.object, value: PropTypes.string, onChange: PropTypes.func, label: PropTypes.string };
// Portfolio JavaScript Document $(function () { 'use strict'; var filterList = { init: function () { // MixItUp plugin // http://mixitup.io $('#portfoliolist').mixItUp({ selectors: { target: '.portfolio', filter: '.filter' }, load: { filter: '.app, .card, .icon, .logo, .web' } }); } }; // Run the show! filterList.init(); });
const obfuscate = password => { let obfuscated = ""; for (i = 0; i < password.length; i++) { current = password[i]; if (current === "a") { obfuscated += "4"; } else if (current === "e") { obfuscated += "3"; } else if (current === "o") { obfuscated += "0"; } else if (current === "l") { obfuscated += "1"; } else { obfuscated += current; } } return obfuscated; }; console.log(obfuscate(process.argv[2]));
import React, { useState, useEffect } from 'react' import axios from 'axios' import User from './User'; export default function GetAll() { const [users, setUsers] = useState([]); const getAllUsers = async () => { const response = await axios.get(`http://localhost:5000/api/bank/users`) console.log(response.data); setUsers(response.data); } useEffect(() => { getAllUsers() }, []) return ( <div className="get-all"> {users.map(u => { return ( <User key={u._id} id={u._id} name={u.name} balance={u.balance} credit={u.credit} email={u.email} /> ) })} </div> ) }
import axios from "axios"; import { useAppContext } from "../../../Providers"; const useStatistics = () => { const { createNotification, setIsLoading } = useAppContext(); const getData = async ({ employeeId, day }) => { try { console.log(day); setIsLoading(true); if (!day) { return createNotification("يجب اختيار اليوم", "warning"); } console.log(day); let response = await axios.post("/api/transactions/get", { employeeId, day, }); let data = await response.data; console.log(data); if (!data.status) { createNotification(data.message, "error"); return {}; } return data.data; } catch (e) { alert(e.message); return {}; } finally { setIsLoading(false); } }; return { getData }; }; export default useStatistics;
import React from "react"; import { Document as PdfDocument } from "@react-pdf/renderer"; const Document = ({ children, pdfMode = true }) => { console.log({ Document: pdfMode }); const docProperties = { title: "QBQUITY invoice", author: "pagaia", subject: "React Invoice", keywords: "QBQUITY react invoice javascript react-pdf", creator: "Pagaia", producer: "QBQUITY", }; return <PdfDocument {...docProperties}>{children}</PdfDocument>; }; export default Document;
$(function () { // Open modal button logic var orderBtnParent = $('#the-results'), // get main parent for close actions orderModalMainParent = $('#order-hotel-modal'), modalContainer = orderModalMainParent.find('.modal-content'); orderBtnParent.on('click', '.order-hotel-choice', function () { var hotelID = $(this).data('hotelId'), roomtypeID = $(this).data('roomtypeId'), fromDate = $(this).data('fromDate'), toDate = $(this).data('toDate'); getModalInfo(hotelID, roomtypeID, function (data) { data.FromDate = fromDate; data.ToDate = toDate; var from = moment(data.FromDate), to = moment(data.ToDate); data.Price = formatMoney(to.diff(from, 'days') * data.Price); modalContainer.find('.ajax-loader-container').hide(); fillResults(data, modalContainer, '#orderModalTmpl'); var orderBtn = modalContainer.find('#order-hotel-button'), userInput = modalContainer.find('.order-hotel-user-input input'), emailRegex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/, userInputDiv = modalContainer.find('.order-hotel-user-input'), userCloseDiv = modalContainer.find('.order-hotel-user-close'); orderBtn.attr('disabled', true); userInput.keyup(function (evt) { if (emailRegex.test( evt.target.value )) { orderBtn.attr('disabled', false); return; } orderBtn.attr('disabled', true); }); orderBtn.on('click', function () { var email = userInput.val(); $('#reference-number').find('ajax-loader-gif').show(); modalContainer.addClass('order'); userInputDiv.removeClass('show'); userInputDiv.addClass('hidden'); userCloseDiv.removeClass('hidden'); userCloseDiv.addClass('show'); orderRoom(hotelID, roomtypeID, email, fromDate, toDate, function (success) { modalContainer.find('#reference-number').text(success.Reference); $('#reference-number').find('ajax-loader-gif').show(); }, function (error) { console.log('error'); var errorText = $('<p></p>'); errorText.text(error.error); modalContainer.find('#order-hotel-modal-success').empty(); modalContainer.find('#order-hotel-modal-reference').empty().append(errorText); }); }); }, function (data) { fillResults(data, modalContainer, '#orderModalErrorTmpl'); }); }); modalContainer.on('click', '.close', function () { modalContainer.children().not('.ajax-loader-container').remove(); modalContainer.find('.ajax-loader-container').show(); if (modalContainer.hasClass('order')) { modalContainer.removeClass('order'); } orderModalMainParent.modal('hide'); return; }); });
(function(){ 'use strict'; angular.module('app') .controller('TestDetailsModalController', testDetailsModalController); testDetailsModalController.$inject = ['testDetailsService', '$stateParams', '$uibModalInstance', 'currentTestDetails', 'availableAmountOfTaskForCurrentTest','appConstants']; function testDetailsModalController(testDetailsService, $stateParams, $uibModalInstance, currentTestDetails, availableAmountOfTaskForCurrentTest,appConstants) { var self = this; //variables self.testDetails = {}; self.currentTestDetails = currentTestDetails; self.levelsOfTasks = []; self.amountOfTasksOfCurrentLevel = parseFloat(currentTestDetails.tasks); self.testDetails.test_id = $stateParams.currentTestId; self.availableAmountOfTaskForCurrentTest = availableAmountOfTaskForCurrentTest; self.duplicateTestLevelMessage = false; self.wasNotEditTestMessage = false; //methods self.addTestDetails = addTestDetails; self.updateTestDetails = updateTestDetails; self.cancelForm = cancelForm; activate(); function activate() { for(var i=1;i<=appConstants.numberOfTestsLevels;i++){ self.levelsOfTasks.push(i); } } function addTestDetails() { testDetailsService.addTestDetails(self.testDetails).then(addTestDetailsComplete) } function updateTestDetails() { testDetailsService.editTestDetails(currentTestDetails.id, self.currentTestDetails).then(editTestDetailsComplete) } function cancelForm () { $uibModalInstance.dismiss(); } function addTestDetailsComplete(response) { if(response.data.response === "ok") { self.testDetails = {}; $uibModalInstance.close(); } if(response.status === 400) { self.duplicateTestLevelMessage = true; } } function editTestDetailsComplete(response) { if(response.data.response === "ok") { self.currentTestDetails = {}; $uibModalInstance.close(); } if(response.status === 400 && response.data.response !== "Error when update") { self.duplicateTestLevelMessage = true; } if(response.status === 400 && response.data.response === "Error when update") { self.wasNotEditTestMessage = true; } } } }());
import React from "react"; export default function App() { setTimeout(() => { getChunk().then(module => { module.default(); }); }, 5000); return <div>Hello World! Testuje drugie</div>; } function getChunk() { // const module = await import(/* webpackChunkName: "chunk" */ "./chunk"); // console.log(module); return (module = import(/* webpackChunkName: "chunk" */ "./chunk")); }
var admin = require('firebase-admin'); var serviceAccount = require('../service-account-key.json'); var database; module.exports.initialize = function() { console.log('Initializing Firebase...'); admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: "https://feedme-aeq.firebaseio.com" }); database = admin.database(); } module.exports.setRestaurantData = function(data) { return database.ref('restaurants') .set(null) .then(() => { let businesses = data.businesses; let updates = {}; businesses.forEach(function(business) { let restaurant = { name: business.name, image_url: business.image_url, url: business.url, category: business.categories[0].title, rating: business.rating, review_count: business.review_count, price: business.price, phone: business.phone, distance: business.distance, latitude: business.coordinates.latitude, longitude: business.coordinates.longitude, location: business.location.address1, vote_count: 0 }; let restaurantId = database.ref().child('restaurants').push().key; updates['/restaurants/' + restaurantId] = restaurant; updates['/chosen_restaurant/id'] = ""; }); return database.ref().update(updates); }); } module.exports.setChosenRestaurant = function() { return new Promise((resolve, reject) => { database.ref('restaurants') .orderByChild('vote_count') .limitToFirst(1) .once('value', function(dataSnapshot) { var restaurantSnapshot; dataSnapshot.forEach(function(childSnapshot) { restaurantSnapshot = childSnapshot; }); database.ref('chosen_restaurant') .child('id') .set(restaurantSnapshot.key) .catch((err) => { reject(err); }); resolve(restaurantSnapshot.val()); }) .catch((err) => { reject(err); }); }); }
import React from "react"; import Draggable from "react-draggable"; const dausUrl = '<iframe src="http://a.teall.info/dice/" title="Plotly All Graph Types" ' + 'allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media" ' + 'style="width:250px; height:300px; border:0; border-radius: 4px; overflow:hidden;" ' + 'sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>'; class Daus extends React.Component { render() { return ( <Draggable> <div className="daus"> <div className="daus-header"></div> <div dangerouslySetInnerHTML={{ __html: dausUrl}}></div> </div> </Draggable> ) } } export default Daus;
export * from './column' export * from './field' export * from './schema' export * from './tableProps' export * from './viewProps'
let myBook = { title: "Hello", author: "George Orwell", pageCount: 326, } let otherBook = { title: "A people History", author: "Howard Zinn", pageCount: 723, } function getSummary(book) { return { summary: `${book.title} by ${book.author}`, pageCountSummary: `${book.title} is ${book.pageCount} pages long`, } } console.log(getSummary(myBook).summary) console.log(getSummary(otherBook).pageCountSummary) // Challenge area // Create function - take fahrenheit in - return object with all three parameters function convertMachine(temp) { return { fahrenheit: temp, celsius: (temp - 32) * 5 / 9, kelvin: (temp + 459.67) * 5 / 9, } } console.log(convertMachine(74))
import configureStore from './configureStore'; import App from './App.jsx'; import routes from './routes'; const appPath = '/$_appname';// 重要!!!!! const routesConfig = routes(appPath); //暴露给后端渲染用 module.exports = { configureStore, App, routesConfig }
Component({ properties: { list: { type: Array, value: [], }, keyWord: { type: String, value: '', }, }, });
import React, {useEffect, useState} from 'react'; import {View, Text, ScrollView, Platform, BackHandler} from 'react-native'; import {MainCard, CardItem, Spiner, Header} from '@aaua/components/common'; import {useSelector, useDispatch} from 'react-redux'; import {getMessage} from '@aaua/actions/MessagesActions'; import {Actions} from 'react-native-router-flux'; let listener = null; const MessageComponent = props => { const {messageId} = props; const dispatch = useDispatch(); const { auth: { user: {token}, messages: {message, loadingMessageInfo: loading, messageError}, }, } = useSelector(state => state); const timeConverter = UNIX_timestamp => { var a = new Date(UNIX_timestamp * 1000); var months = [ '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', ]; var year = a.getFullYear(); var month = months[a.getMonth()]; var date = a.getDate(); var hour = a.getHours(); var min = a.getMinutes(); var sec = a.getSeconds(); var time = date + '.' + month + '.' + year + ' ' + hour + ':' + min; return time; }; useEffect(() => { dispatch(getMessage(token, messageId)); if (Platform.OS == 'android' && listener == null) { listener = BackHandler.addEventListener('hardwareBackPress', () => { if (Actions.currentScene == 'message') { Actions.messagesList(); return true; } }); } }, [token, messageId]); useEffect(() => { if (Platform.OS == 'android' && listener == null) { listener = BackHandler.addEventListener('hardwareBackPress', () => { if (Actions.currentScene == 'message') { Actions.messagesList(); return true; } }); } return () => (listener = null); }, []); // componentWillMount() { // const {getMessage, token, messageId} = this.props; // getMessage(token, messageId); // } // componentDidMount() { // if (Platform.OS == 'android' && listener == null) { // listener = BackHandler.addEventListener('hardwareBackPress', () => { // if (Actions.currentScene == 'message') { // Actions.messagesList(); // return true; // } // }); // } // } // componentWillUnmount() { // listener = null; // } const renderContent = () => { const {titleContainer, textContainer, phoneText, textStyle, dateStyle} = styles; if (!loading) { return ( <View style={{ flex: 1, flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'flex-start', paddingLeft: 17, paddingRight: 7, }}> <View style={titleContainer}> <View> <Text style={phoneText}>Уведомление</Text> </View> <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', }}> <View> <Text style={dateStyle}> {timeConverter(message.created_at)} </Text> </View> </View> </View> <View style={textContainer}> <Text style={textStyle}>{message.text}</Text> </View> </View> ); } return <Spiner />; }; console.log('render message'); const {componentContainer} = styles; return ( <MainCard> <Header back onPressBack={Actions.messagesList}> уведомление </Header> <CardItem style={componentContainer}>{renderContent()}</CardItem> </MainCard> ); }; const styles = { componentContainer: { marginLeft: 13, marginRight: 13, flex: 1, justifyContent: 'flex-start', alignItems: 'flex-start', }, titleContainer: { alignSelf: 'stretch', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginTop: 16, height: 50, }, phoneText: { fontSize: 13, fontFamily: 'SFUIText-Bold', color: '#423486', }, notReaded: { fontSize: 10, fontFamily: 'SFUIText-Bold', color: '#1b1b1b', }, textContainer: { // marginTop: 16, marginBottom: 13, }, textStyle: { fontSize: 12, fontFamily: 'SFUIText-Regular', color: '#1b1b1b', }, dateStyle: { fontSize: 11, fontFamily: 'SFUIText-Bold', color: '#423486', }, readMore: { fontSize: 11, fontFamily: 'SFUIText-Medium', color: '#423486', }, footerContainer: { flex: 1, alignSelf: 'stretch', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', }, }; // const mapStateToProps = ({auth, messages}) => { // console.log(messages); // return { // token: auth.user.token, // message: messages.message, // loading: messages.loadingMessageInfo, // messageError: messages.messageError, // }; // }; // export default connect(mapStateToProps, {getMessage})(MessageComponent); export default MessageComponent;
var express = require('express'), router = express.Router(); router.get('/',function(req,res){ res.send('main controller'); }); router.use('/',require('./signup')); router.use('/',require('./login')); router.use('/',require('./auth')); router.use('/',require('./auth'),require('./userprofile')); router.use('/',require('./logout')); //router.use('/',require('./checklogin')); //router.use('/',require('./logout')); module.exports = router;
import React from "react"; import Card from './Card'; import './CardList.css' const CardList = ({ robots }) => { return ( <div className="cardList"> {robots.map((launch, index) => { return ( <Card launch={launch}/> ); })} </div> ); }; export default CardList;
const mongoose = require("mongoose"); const { Schema } = mongoose; const productSchemaAccessories = Schema(); const Productaccessories = mongoose.model( "Productaccessories", productSchemaAccessories, "productaccessories" ); module.exports = Productaccessories;
var fxApp = angular.module('pricing'); fxApp.controller('quantumCtrl', ['$scope', '$http', function($scope, $http) { $scope.quantumFXOrders = []; $scope.quantumACOrders = []; $scope.loadQuantumFXOrders = function() { var httpReq = $http.get('/orders/quantumFXorder'). success(function(data, status, headers, config) { $scope.quantumFXOrders = data; }). error(function(data, status, headers, config) { $scope.quantumFXOrders = { "error retrieving Quantum FX orders": status }; }); }; $scope.loadQuantumACOrders = function() { var httpReq = $http.get('/orders/quantumACorder'). success(function(data, status, headers, config) { $scope.quantumACOrders = data; }). error(function(data, status, headers, config) { $scope.quantumACOrders = { "error retrieving Quantum AC orders": status }; }); }; } ]);
const path = require("path"); import fs_i from './tasks/import_fs.js'; import markdown_yaml_p from './tasks/parse_yaml.js'; import markdown_parse from './tasks/parse_markdown.js'; import generate_react_pages from './tasks/generate_react_pages.js'; import generate_react_indexes from './tasks/generate_react_indexes.js'; import react_render from './tasks/react_render.js'; import output_fs from './tasks/output_fs.js'; var context = { "cwd" : path.join(__dirname, ".."), "in" : path.join(__dirname, "..", "input"), "out" : path.join(__dirname, "..", "output"), "posts_per_page": 5 } context = fs_i(context); context = markdown_yaml_p(context); context = markdown_parse(context); context = generate_react_pages(context); context = generate_react_indexes(context); context = react_render(context); context = output_fs(context);
// deconstruct the following objects... //1) const Car = { color: "Gray", vin: 1234, model: "toyota" } const {color, vin, model} = Car; console.log(color); console.log(vin); console.log(model); //2) let CPU = { ram: "16gbs", gpu_chip: true, clock_speed: 1.8 } const {ram, gpu_chip, clock_speed} = CPU; console.log(ram); console.log(gpu_chip); console.log(clock_speed); // //3) Nested Destructering let options = { size: { width: 100, height: 200 }, items: ["Blue", "Purple"], extra: true }; const {size: {width}, size: {height}, items, extra} = options; console.log(width); console.log(height); console.log(items); console.log(extra); // //Now lets practice spread notation ... function sum(x, y, z) { return x + y + z; } const numbers = [1, 2, 3]; // //before running the console.log below try and predict the output console.log(sum(...numbers)); // //4) clone/copy obj1 into another variable using spread notation const obj1 = { key: 'value', x: 42 }; const cloneObj = {...obj1}; console.log(cloneObj); // //5) use spread notation to merge these two objects into a single variable const user1 = { name: 'Steph', age: 55, }; const user2 = { name: "Tiff", location: "Alaska" }; const mergedUsers = {...user1, ...user2}; console.log(mergedUsers);
import $ from 'jquery'; export default function table() { const $window = $(window), $mainTable = $('.js-table'), mainTableWrapper = '.js-table-wrapper'; let $parent, clone = 'table__clone', padding = 40; function fixedTableLayout() { $('.'+clone).remove(); if($mainTable.length && $window.width() < 769 && ($window.width() - padding) < $mainTable.width()) { $mainTable.each(function(){ if(!$(this).hasClass(clone)) { $parent = $(this).parent(mainTableWrapper); $(this).clone(true).appendTo($parent).addClass(clone); } }); } } fixedTableLayout(); $window.resize(function(){ fixedTableLayout(); }); }
if(window.location.pathname == '/') { $(window).on('beforeunload', function() { $(window).scrollTop(0); }); var jumboHeight = $('.jumbotron').outerHeight(); function parallax() { var scrolled = $(window).scrollTop(); $('.bg').css('height', (jumboHeight-scrolled) + 'px'); } $(window).scroll(function(e) { parallax(); }); $( document ).ready(function() { $.ajax({ type: 'GET', url: "/saleitems/rand", data: { '_token': $('meta[name="csrf-token"]').attr('content') }, success: displayItems }); function displayItems (data) { var html = data.html; $('#random-img-container').html(html); } //CHECK IF THE ALERT MODAL IS REQUIRED (NEW PURCHASE OR SALE) if ($('#alertModal')) { $('#alertModal').modal('show'); } //ENABLE FANCY IMAGE EXPANSION ON PICTURE $("#fancy-img").fancybox({ openEffect : 'elastic', closeEffect : 'elastic', helpers: { title : { type : 'float' }, overlay: { locked: false } } }); /*Interactivity to determine when an animated element in in view. In view elements trigger our animation*/ //window and animation items var animation_elements = $.find('.animation-element'); var web_window = $(window); //check to see if any animation containers are currently in view function check_if_in_view() { //get current window information var window_height = web_window.height(); var window_top_position = web_window.scrollTop(); var window_bottom_position = (window_top_position + window_height); //iterate through elements to see if its in view $.each(animation_elements, function() { //get the element sinformation var element = $(this); var element_height = $(element).outerHeight(); var element_top_position = $(element).offset().top; var element_bottom_position = (element_top_position + element_height); //check to see if this current container is visible (its viewable if it exists between the viewable space of the viewport) if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) { element.addClass('in-view'); } else { element.removeClass('in-view'); } }); } //on or scroll, detect elements in view $(window).on('scroll resize', function() { check_if_in_view() }) //trigger our scroll event on initial load $(window).trigger('scroll'); }); }
//当窗口大小重置之后,重新执行 $(window).on('resize',function(){ reset() }) //当窗口加载完毕,执行瀑布流 $(window).on('load',function(){ reset() }) function onfilter() { reset() } function reset(){ var filterStr=document.getElementById("filterInput").value var imgWidth = $('img').outerWidth(true) //单张图片的宽度 var divWidth = $('div').width() //页宽 var colCount = parseInt(divWidth/imgWidth) //计算出列数 var leftMargin = parseInt((divWidth - imgWidth * colCount - colCount)/2) // 左边距,保持居中 var topMargin = 70 //预留过滤条件输入框高度 var colHeightArry= [] //定义列高度数组 for(var i = 0 ; i < colCount; i ++){ colHeightArry[i] = topMargin } var showCount = 0 //显示的项目数 var filterTagSet = new Set(filterStr.toLowerCase().replace(',',',').replace(' ','').split(',')) filterTagSet.delete("") //过滤条件转成无空不重复的集合 $('img').each(function(){ var showThis = true //没有过滤条件,则显示所有项 var imgTagStr = $(this).attr('tag') if (0 != filterTagSet.size) { if (imgTagStr) { // var imgTagSet = new Set(imgTagStr.split(',')) for (tag of filterTagSet) { // if (!imgTagSet.has(tag)) { if (!imgTagStr.includes(tag)) { // 支持过滤条件未输入完整时的部分匹配 showThis = false //只要有一个过滤的标签不属于项目标签,则不显示 } } } else { showThis = false // 项目无标签 } } var tipId = $(this).attr("src") var tipBtn = document.getElementById(tipId) tipBtn.style.opacity = 1 if (showThis){ var minValue = colHeightArry[0] var minIndex = 0 for(var i = 0 ; i < colCount; i ++){ if(colHeightArry[i] < minValue){ minValue = colHeightArry[i] minIndex = i } } $(this).css({ left: minIndex * imgWidth + leftMargin, top: minValue, opacity: 1 }) colHeightArry[minIndex] += $(this).outerHeight(true) showCount += 1 tipBtn.style.left = minIndex * imgWidth + leftMargin + 65 + "px" tipBtn.style.top = minValue + 5 + "px" //tipBtn.style.opacity = 1 } else { $(this).css({ left: -1000, top: -1000, opacity: 0 // 隐藏未包含标签项 }) tipBtn.style.left = "-1000px" tipBtn.style.top = "-1000px" //tipBtn.style.opacity = 0 } }) document.getElementById("count").innerHTML = showCount }
import {Entity, PrimaryGeneratedColumn, Column, OneToMany, ManyToMany} from "typeorm"; import {Content} from "./Content"; @Entity() export class Category { @PrimaryGeneratedColumn() id = Number(); @Column ("varchar") code; @ManyToMany(type => Content, content => content.categories) contents; }
export class Person { constructor() { this.name; this.surname; this.birthDate; this.pesel; } }
// ==UserScript== // @name Hack a Day comment fixer // @namespace hack-a-day-comment-fixer // @description Hide those annoying "This is not a hack" comments on hackaday.com // @include http://hackaday.com/* // @grant none // @author Phil // @license MIT License // @updateURL https://github.com/PhilboBaggins/grease-monkey-scripts/raw/master/hackaday-comments-fixer.user.js // @version 1 // ==/UserScript== function makeid(length) { // https://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript var text = ""; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for( var i=0; i < 10; i++ ) text += possible.charAt(Math.floor(Math.random() * possible.length)); return text; } function ReplaceCommentBox(commentBox) { var originalContent = commentBox.innerHTML; function restoreComment() { commentBox.innerHTML = originalContent; } var idForNewButton = 'restore-not-a-hack-comment-button-' + makeid(); commentBox.innerHTML = '<p>"not a hack" comment. <button id="' + idForNewButton + '">Click here</button> to restore it</p>'; var button = document.getElementById(idForNewButton); button.addEventListener('click', restoreComment, true); } var commentBoxes = document.getElementsByClassName('comment-content'); for (var i = 0; i < commentBoxes.length; i++) { if (commentBoxes[i].innerHTML.toLowerCase().indexOf('not a hack') !== -1) { ReplaceCommentBox(commentBoxes[i]); } }
import './style/uikit/css/uikit.min.css'; import './style/uikit/css/uikit-rtl.min.css'; import './style/uikit/js/uikit.min'; import './style/uikit/js/uikit-icons.min'; import './style/components/welcome.scss'; import './style/components/about.scss'; import './style/components/projects.scss'; import './style/components/contacts.scss'; import './style/components/form.scss'; import './style/components/common.scss';
var class_otter_1_1_sound = [ [ "Sound", "class_otter_1_1_sound.html#a9cb8a2df40b0653b993daeaa23c3a274", null ], [ "Sound", "class_otter_1_1_sound.html#a77f8577df25d1b641c1ff8dcffd1ec62", null ], [ "Pause", "class_otter_1_1_sound.html#a33b0179a0d1245738a0e564dab723d91", null ], [ "Play", "class_otter_1_1_sound.html#a48953894eda29f06e7389cac772f644c", null ], [ "Stop", "class_otter_1_1_sound.html#a6357d9e4691abc96a460cddd3b5eb596", null ], [ "Volume", "class_otter_1_1_sound.html#a1e41dd733ec079d22bf3162ad17b9a8d", null ], [ "Duration", "class_otter_1_1_sound.html#a03cab1e8e104491901acfb5b6b3669a0", null ], [ "Loop", "class_otter_1_1_sound.html#a54224bc47519ff59671460d6ae2a337a", null ], [ "Offset", "class_otter_1_1_sound.html#a7c0a8e9b786a19c241d3adeb9f524a03", null ], [ "Pitch", "class_otter_1_1_sound.html#a5d1e796a7eedb2cec65ecf41ca770edf", null ] ];
/** * Created by Josue on 25/11/2017. */ angular.module("acreditacion") .controller("CYE_Ajustados",function ($scope,Http_Request) { /*Start --------------------------------- Listas-----------------------------------------*/ $scope.lista_cye = []; $scope.lista_cye_ajustados = [ { ID : "CYE1", CYE : "C1", ID_CYA : "CYA1", CriterioAjustado : "CA1", Observaciones : "Observacion", Valoracion : "Valoracion 1", Responsable : "Responsable 1", Correo : "Correo 1", FLOC : new Date(), FLA : new Date(), IncorporadoIAE : "SI", NivelIAE : "Bien" } ]; $scope.lista_responsables = [ {ID: "1",Responsable : "Responsable 1",Correo: "Correo 1"}, {ID: "2",Responsable : "Responsable 2",Correo : "Correo 2"}, {ID: "3",Responsable : "Responsable 3", Correo: "Correo 3"}, {ID: "4",Responsable : "Responsable 4", Correo: "Correo 4"}, {ID: "5",Responsable : "Responsable 5", Correo: "Correo 5"}, {ID: "6",Responsable : "Responsable 6", Correo: "Correo 6"}, {ID: "7",Responsable : "Responsable 7", Correo: "Correo 7"}, {ID: "8",Responsable : "Responsable 8", Correo: "Correo 8"}, {ID: "9",Responsable : "Responsable 9", Correo: "Correo 9"}]; $scope.lista_responsables_seleccionados = []; $scope.lista_valoraciones = []; $scope.lista_nivel_IAE = []; /*---------------------------------------END Listas---------------------------------------------------------*/ /*Start -------------------------------- Variables--------------------------------------------------*/ let http_request = { method : "", endPoint : "" }; /*-----------INSERT-------------*/ $scope.new_item ={ ID_CYE : "", Criterio : "", CriterioAjustado : "", Observaciones : "", ID_Valoracion : "", Valoracion : "", ID_Responsable : "", Responsable : "", FLOC : "", FLA : "", ID_NivelIAE : "", NivelIAE : "", IncorporadoIAE : "" }; /*----------END INSERT----------------*/ /*-----------EDIT---------------*/ $scope.cye_selected_edit = { ID: "", ID_CYE : "", Criterio : "", CriterioAjustado : "", Observaciones : "", ID_Valoracion : "", Valoracion : "", ID_Responsable : "", Responsable : "", ID_NivelIAE : "", NivelIAE : "", FLOC : "", FLA : "", IncorporadoIAE : "" }; /*----------END EDIT----------------*/ /*--------------------------END Variables---------------------------------------------*/ /*Start -------------------------Methods---------------------------------*/ /*Start ---On Load --Description: Get the data from the server when the page loads---------*/ $scope.onLoad = function () { getData(); }; /*---------------------------END On Load---------------------------------*/ /*Start------INSERT-- Description: send a new item to the endPoint insertComponente-----*/ $scope.insertData = function (new_item) { http_request.method = "POST"; http_request.endPoint = "insertCYEA"; if(insert_validation(new_item)){ swal({ title: "Alerta", text: "Seguro que desea insertar el registro? ", type: "warning", showCancelButton: true, confirmButtonClass: "btn-primary", confirmButtonText: "Sí!", cancelButtonText: "No, Cancelar!", cancelButtonClass:"btn-danger", closeOnConfirm: false, closeOnCancel: true }, function() { Http_Request.Http_Request(http_request, {Criterio : new_item.Criterio, CriterioAjustado : new_item.CriterioAjustado, Observacion : new_item.Observacion, Valoracion : new_item.Valoracion, Responsable : new_item.Responsable, Correo: new_item.Correo, FLOC: new_item.FLOC, FLA : new_item.FLA, IncorporadoIAE : new_item.IncorporadoIAE}, function (response) { if(response.data.success) { getData(); swal("Alerta",response.data.message,"success"); } else swal("Alerta",response.data.message,"error"); }); } ); } }; //Check if inputs of the add modal are not empty function insert_validation(item) { } /*---------------------------END INSERT----------------------------------*/ /*Start---------EDIT-- Description: edits the information of an existing register---*/ //Opens the modal and loads the selected information $scope.openEditModal = function(item){ console.log(item); $scope.cye_selected_edit.ID = item.ID; $scope.cye_selected_edit.Criterio = item.CYE; $scope.cye_selected_edit.CriterioAjustado = item.CriterioAjustado; $scope.cye_selected_edit.Observaciones = item.Observaciones; $scope.cye_selected_edit.Valoracion = item.Valoracion; $scope.cye_selected_edit.Responsable = item.Responsable; $scope.cye_selected_edit.Correo = item.Correo; $scope.cye_selected_edit.FLOC = item.FLOC; $scope.cye_selected_edit.FLA = item.FLA; $scope.cye_selected_edit.NivelIAE = item.NivelIAE; $scope.cye_selected_edit.IncorporadoIAE = item.IncorporadoIAE; $("#modalEditCYEA").modal("show"); console.log("Nuevo : "+ JSON.stringify($scope.cye_selected_edit)); }; $scope.editData = function (new_item) { http_request.method = "POST"; http_request.endPoint = "editCYEA"; if(edit_validation(new_item)){ swal({ title: "Alerta", text: "Seguro que desea editar el registro? ", type: "warning", showCancelButton: true, confirmButtonClass: "btn-primary", confirmButtonText: "Sí!", cancelButtonText: "No, Cancelar!", cancelButtonClass:"btn-danger", closeOnConfirm: true, closeOnCancel: true }, function() { Http_Request.Http_Request(http_request, {ID : new_item.ID,Criterio : new_item.Criterio, CriterioAjustado : new_item.CriterioAjustado, Observacion : new_item.Observaciones,Valoracion : new_item.Valoracion, Responsable : new_item.Responsable, Correo : new_item.Correo, FLOC : new_item.FLOC}, function (response) { if(response.data.success) { getData(); //Refresh the information swal("Alerta",response.data.message,"success"); } else swal("Alerta",response.data.message,"error"); }); } ); } }; //Check if inputs of the edit modal are not empty function edit_validation(item) { } /*---------------------------END EDIT------------------------------------*/ /*Start--------DELETE-- Description: remove an existing register from the data base-----*/ $scope.deleteData = function (ID_CYA) { http_request.method = "POST"; http_request.endPoint = "deleteCYEA"; swal({ title: "Alerta", text: "Seguro que desea eliminar? ", type: "warning", showCancelButton: true, confirmButtonClass: "btn-primary", confirmButtonText: "Sí!", cancelButtonText: "No, Cancelar!", cancelButtonClass:"btn-danger", closeOnConfirm: false, closeOnCancel: true }, function() { Http_Request.Http_Request(http_request,{ID:ID_CYA},function (response) { if(response.data.success){ delete_auxiliar(ID_Componente); swal("Alerta",response.data.message,"success"); } else swal("Alerta",response.data.message,"error"); }); } ); }; /*Allows to remove the deleted item from the current list(Lista_cye_ajustados)*/ function delete_auxiliar(ID_CYA) { for(item in $scope.lista_cye_ajustados){ if($scope.lista_cye_ajustados[item].ID == ID_CYA){ $scope.lista_cye_ajustados.splice(item,1); } } } /*---------------------------END DELETE----------------------------------*/ /*Start--------------------------Aux Methods-----------------------------*/ //Obtains the information from the endPoint selectDimensiones and selectComponentes function getData() { http_request.method = "GET"; setTimeout(function () { $scope.$apply(function () { //Obtains the intel from DB about CYE_Ajustados http_request.endPoint = "selectCYEA"; Http_Request.Http_Request(http_request,{},function (response){ if(response.data.success)$scope.lista_cye_ajustados = response.data.data; else $.notify("Error!",response.data.message,"error"); }); //Gets the data from DB about CYE http_request.endPoint = "selectCYE"; Http_Request.Http_Request(http_request,{},function (response) { if(response.data.success)$scope.lista_cye = response.data.data; else $.notify("Error!",response.data.message,"error"); }); //Gets data from DB related with nivel IAE http_request.endPoint = "selectNivelIAE"; Http_Request.Http_Request(http_request,{},function (response) {console.log("NivelIAE: "+JSON.stringify(response.data.data)); if(response.data.success)$scope.lista_nivel_IAE = response.data.data; else $.notify("Error!",response.data.message,"error"); }); //Obtains the information of valoraciones from DB http_request.endPoint = "selectValoracion"; Http_Request.Http_Request(http_request,{},function (response) {console.log("VALORACIONES: "+JSON.stringify(response.data.data)); if(response.data.success)$scope.lista_valoraciones = response.data.data; else $.notify("Error!",response.data.message,"error"); }); }); }, 250); } //Update ID's on change select item $scope.updateIDCriterio = function (Criterio) { for(item in $scope.lista_cye){ if($scope.lista_cye[item].CYE == Criterio){ $scope.new_item.ID_CYE = $scope.lista_cye[item].ID_CYE; $scope.cye_selected_edit.ID_CYE = $scope.lista_cye[item].ID_CYE; return; } } }; $scope.updateIDvaloracion = function (Valoracion) { for(item in $scope.lista_valoraciones){ if($scope.lista_valoraciones[item].Valoracion == Valoracion){ $scope.new_item.ID_Valoracion == $scope.lista_valoraciones[item].ID; $scope.cye_selected_edit.ID = $scope.lista_valoraciones[item].ID; return; } } }; $scope.updateIDNivelIAE = function (NivelIAE) { for(item in $scope.lista_nivel_IAE){ if($scope.lista_nivel_IAE[item].Nivel == NivelIAE){ $scope.new_item.ID_NivelIAE = $scope.lista_nivel_IAE[item].ID; $scope.cye_selected_edit.ID_NivelIAE = $scope.lista_nivel_IAE[item].ID; return; } } }; //selected responsable $scope.addResponsable = function (new_responsable) {console.log(new_responsable); for(var item = 0; item < $scope.lista_responsables.length;item++){ if($scope.lista_responsables[item].Responsable == new_responsable && !existResponsable(new_responsable)){ $scope.lista_responsables_seleccionados.push($scope.lista_responsables[item]); console.log($scope.lista_responsables_seleccionados); return; } } }; //Verify if the responsable is not already selected function existResponsable(Responsable) { for(item in $scope.lista_responsables_seleccionados){ if($scope.lista_responsables_seleccionados[item].Responsable == Responsable)return true; } return false; } //Removed responsable $scope.removeResponsable = function (responsable) { for(item in $scope.lista_responsables_seleccionados){ if($scope.lista_responsables_seleccionados[item].Responsable == responsable) { $scope.lista_responsables_seleccionados.splice(item,1); return; } } }; /*---------------------------END Aux Methods-----------------------------*/ /*----------------------------END Methods -------------------------------*/ }) ;
const passport = require('passport'); const FacebookStrategy = require('passport-facebook').Strategy; const Account = require('../models/account'); passport.use( new FacebookStrategy( { clientID: '1998284846935725', clientSecret: 'c2d23f8ec0914cfda4039043482a7445', callbackURL: 'http://127.0.0.1:3000/auth/facebook/callback', }, function(accessToken, refreshToken, profile, done) { Account.findOrCreate( { name: profile.displayName }, { name: profile.displayName, userid: profile.id }, function(err, user) { if (err) { return done(err); } done(null, user); } ); } ) ); module.exports = passport;
var searchData= [ ['my_5fsorts_2eh_15',['my_sorts.h',['../my__sorts_8h.html',1,'']]] ];
const { crearArchivo, listarTabla } = require('./multiplicar/multiplicar'); const { argv } = require('./yargs'); const colors = require('colors'); let comando = argv._[0]; console.log(argv); switch(comando) { case 'listar': listarTabla(argv.base, argv.limite) .then(tabla => console.log(tabla)) .catch(e => console.log(e)); break; case 'crear': crearArchivo(argv.base, argv.limite) .then(arquivo => console.log(`El archivo tabla-${argv.base}.txt ha sido creado`.green)) .catch(e => console.log(e)); break; default: console.log('Comando no reconocido'); }
import React from "react" import Layout from "../components/layout" import { Link, graphql, useStaticQuery } from "gatsby" const About = () => { const data = useStaticQuery(graphql` query { site { siteMetadata { author title } } } `) return ( <Layout> <h1>{data.site.siteMetadata.title}</h1> <p>Here is {data.site.siteMetadata.author} A Mern Stack Developer!</p> <p> Need A Developer? <Link>Contact Info</Link> </p> </Layout> ) } export default About
import React from 'react'; import Navitem from "./Navitem" function Project(props) { return ( <div> <div className="left"> <Navitem /> </div> <div className="right"> <div style={{paddingTop: "5rem"}} className="education_right"> <h1>Live Project :-</h1> <div className="scroll"> <div className="graduation_div"> <b>Career Finder (Clone Of Internshala, Using MERN-STACK)</b><br /> <b>Role Based Authentication (e.g- for user and admin seperate)</b> <br /> <b>Live Link: </b> <a href="https://manishcareer-finder.herokuapp.com/" target="_blank" rel="noopener noreferrer"> <button> <strong>CAREER FINDER APP</strong> </button> </a><br /> <b>Github Link: </b> <a href="https://github.com/manish221298/Career-Finder" target="_blank" rel="noopener noreferrer"> <button> <strong>CAREER FINDER APP</strong> </button> </a><br /> <b>02 Sep 2020 - 24 Sep 2020 (Major Project)</b><br /> </div> <div className="graduation_div"> <b>Ticket Master (Using ReactJS-Redux and Rest-API)</b><br /> <b>Simple Authentication </b> <br /> <b>Github Link: </b> <a href="https://github.com/manish221298/ticket-master" target="_blank" rel="noopener noreferrer"> <button> <strong>TICKET MASTER</strong> </button> </a><br /> <b>May 2020 - May 2020 (Major Project)</b><br /> </div> <div className="graduation_div"> <b>Time Velocity Calculator (Using ReactJS-Redux)</b><br /> <b>Live Link: </b> <a href="https://manish-time-velocity-calculator.netlify.app/" target="_blank" rel="noopener noreferrer"> <button> <strong>TIME VELOCITY CALCULATOR</strong> </button> </a><br /> <b>Github Link: </b> <a href="https://github.com/manish221298/time_velocity_calculator" target="_blank" rel="noopener noreferrer"> <button> <strong>TIME VELOCITY CALCULATOR</strong> </button> </a><br /> <b>03 Jan 2021 - 03 Jan 2020 (Minor Project)</b><br /> </div> <div className="graduation_div"> <b>PRODUCT FILTER APP (Using ReactJS-Redux)</b><br /> <b>Live Link: </b> <a href="https://manish-productlistfilter-app.herokuapp.com/" target="_blank" rel="noopener noreferrer"> <button> <strong>PRODUCT FILTER APP</strong> </button> </a><br /> <b>Github Link: </b> <a href="https://github.com/manish221298/productlist_filter" target="_blank" rel="noopener noreferrer"> <button> <strong>PRODUCT FILTER APP</strong> </button> </a><br /> <b>05 Mar 2021 - 06 Mar 2020 (Minor Project)</b><br /> </div> <div className="graduation_div"> <b>DYNAMIC FORM (Using ReactJS)</b><br /> <b>Live Link: </b> <a href="https://manish-staticform.herokuapp.com/" target="_blank" rel="noopener noreferrer"> <button> <strong>DYNAMIC FORM</strong> </button> </a><br /> <b>Github Link: </b> <a href="https://github.com/manish221298/digiapt_assignment" target="_blank" rel="noopener noreferrer"> <button> <strong>DYNAMIC FORM</strong> </button> </a><br /> <b>17 Oct 2020 - 17 Oct 2020</b><br /> </div> <div className="graduation_div"> <b>PORTFOLIO PROJECT (Using ReactJS)</b><br /> <b>Live Link: </b> <a href="https://manish-portfolio-app.herokuapp.com/" target="_blank" rel="noopener noreferrer"> <button> <strong>PORTFOLIO PROJECT</strong> </button> </a><br /> <b>Github Link: </b> <a href="https://github.com/manish221298/portfolio" target="_blank" rel="noopener noreferrer"> <button> <strong>PORTFOLIO PROJECT</strong> </button> </a><br /> <b>21 Jun 2021 - 22 Jun 2021</b><br /> </div> </div> </div> </div> </div> ); } export default Project;
import {createLogger, stdSerializers} from 'bunyan' import {default as startServer} from './lib/server' const log = createLogger({ name: 'Le App', serializers: { err: stdSerializers.err } }) startServer(() => { log.info(`WE ARE RUN`) })
import React from "react"; import { expect } from "chai"; import { render, cleanIt, jsdom, act } from "reshow-unit"; import { pageStore } from "reshow"; import ClientRoute from "../ClientRoute"; import urlStore from "../../../stores/urlStore"; describe("Test ClientRoute", () => { beforeEach(() => { jsdom(null, { url: "http://localhost" }); urlStore.reset(); pageStore.reset(); }); afterEach(() => { cleanIt(); }); it("basic test", () => { const vDom = <ClientRoute themePath="foo" themes={{ foo: "div" }} />; const wrap = render(vDom); const actual = wrap.html(); expect(actual).to.have.string("div"); }); it("test should reset default theme to store", () => { const vDom = <ClientRoute defaultThemePath="bar" themes={{ foo: "div", bar: "span" }} />; const wrap = render(vDom); const actual = wrap.html(); act(); expect(actual).to.have.string("span"); }); });
import React from "react"; import styled from "styled-components"; const StyledFooter = styled.div` display: flex; flex-direction: row; justify-content: space-around; margin-bottom: 10px; margin-top: 10px; `; const buttonIcons = { delete: "#960000", edit: "#00965F" }; function getType(buttonIcon) { return buttonIcons[buttonIcon] || buttonIcon.button; } const StyledButton = styled.button` width: 50px; height: 50px; font-size: 50px; border: none; background-color: lightgrey; font-weight: bold; color: ${props => getType(props.buttonIcon)}; `; function CardOutputFooter({ onEditClick, onDeleteClick }) { return ( <StyledFooter> <StyledButton type="button" buttonIcon="edit" onClick={onEditClick}> <i className="far fa-edit" /> </StyledButton> <StyledButton type="button" buttonIcon="delete" onClick={onDeleteClick} > <i className="fas fa-trash-alt" /> </StyledButton> </StyledFooter> ); } export default CardOutputFooter;
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ var MultiPoints = function(ocupar, pos){ Element.apply(this, arguments); this.estado = "d"; this.img = "gfx/x2.png"; }; MultiPoints.prototype = Object.create(Loot.prototype); MultiPoints.prototype.constructor = MultiPoints;
/** * Created by nisabhar on 4/9/18. */ define(['jquery'],function($){ 'use strict'; function PCSLogger() { var self= this; self.enableLog = false; return { log: function(value) { if (self.enableLog) { console.log(value); } }, error : function (value) { if (self.enableLog) { console.error(value); } }, debug : function (value) { if (self.enableLog) { console.debug(value); } }, warn : function (value) { if (self.enableLog) { console.warn(value); } }, enableLog : function (){ self.enableLog = true; }, disableLog : function(){ self.enableLog = false; } } } var instance = new PCSLogger(); //console.log('####Intitating logger Util'); return instance; });
import React, {Component} from "react"; import {View, Text, TouchableHighlight, ScrollView, Image} from "react-native"; import styles from "./Styles.js"; import {getDataFromStorage} from "./functions/data.js"; class Analitics extends Component { static navigationOptions = ({navigation}) => ({ headerRight: ( <TouchableHighlight onPress={() => { navigation.state.params.handleSetting(); }}> <Image source={require("./ui/settings.png")} style={{flex: 0.8}} /> </TouchableHighlight> ), }); componentDidMount = async () => { let password = this.props.navigation.getParam("password", ""); this.setState({password: password}); let beeps = await getDataFromStorage("beeps", ""); beeps = JSON.parse(beeps); this.setState({beeps: beeps}); let tags = this.getVizualizationData(beeps, ""); this.setState({tags: tags}); this.props.navigation.setParams({ handleSetting: this.goToSettings.bind(this), }); }; goToSettings() { this.props.navigation.navigate("Settings", { password: this.state.password, }); } getVizualizationData = (beeps, filter) => { answers = []; for (idB in beeps) { let currentQuestions = beeps[idB].questions; let currentAnswers = []; for (idQ in currentQuestions) { if ( ["Tags", "TagsNoAdd", "MultipleChoiceQuestion"].includes( currentQuestions[idQ].type, ) ) { currentAnswers.push(currentQuestions[idQ].answer); } } currentAnswers = [].concat.apply([], currentAnswers); if (currentAnswers.includes(filter) || filter === "") { answers.push(currentAnswers); } } answers = [].concat.apply([], answers); data = this.getCountsOfElementsInArray(answers); valueArray = []; for (element in data) { valueArray.push(data[element].value); } max = Math.max(...valueArray); min = Math.min(...valueArray); finalResult = data.map(element => { let fontSize = 15 + (element.value - min) / ((max - min) / 15); return { fontSize: fontSize, value: element.value, label: element.label, }; }); return finalResult; }; getCountsOfElementsInArray = arrayOfElements => { let counts = arrayOfElements.reduce( (counts, curr) => ((counts[curr] = ++counts[curr] || 1), counts), {}, ); allElements = []; for (id in counts) { allElements.push({label: id, value: counts[id]}); } return allElements; }; state = { beeps: [], currentTag: "", tags: [], }; getFooter = () => { return ( <View style={{ flex: 0.1, backgroundColor: "#4e4d4d", flexDirection: "row", justifyContent: "space-between", alignItems: "center", }}> <TouchableHighlight onPress={async () => this.props.navigation.navigate("Analitics", { password: this.state.password, }) }> <Image source={require("./ui/tags.png")} style={{flex: 0.9, aspectRatio: 1}} /> </TouchableHighlight> <TouchableHighlight onPress={async () => this.props.navigation.navigate("Beeps", { password: this.state.password, }) }> <Image source={require("./ui/list.png")} style={{flex: 0.9, aspectRatio: 1}} /> </TouchableHighlight> <TouchableHighlight onPress={async () => {}}> <Image source={require("./ui/gallery.png")} style={{flex: 0.9, aspectRatio: 1}} /> </TouchableHighlight> </View> ); }; render() { return ( <View style={styles.background}> <ScrollView style={{ flex: 1, }}> <View style={{ alignItems: "center", justifyContent: "center", flexDirection: "row", flexWrap: "wrap", flex: 1, }}> {this.state.tags.map(element => { return ( <TouchableHighlight style={{ margin: 5, }} key={element.label} onPress={() => { this.setState({ currentTag: element.label, }); let tags = this.getVizualizationData( this.state.beeps, element.label, ); this.setState({tags: tags}); }}> <Text style={{ fontSize: element.fontSize, }}> {element.label} </Text> </TouchableHighlight> ); })} </View> </ScrollView> <View style={{ borderBottomColor: "black", borderBottomWidth: 5, }} /> <View style={{flex: 0.1}}> <TouchableHighlight onPress={() => { this.setState({currentTag: ""}); let tags = this.getVizualizationData( this.state.beeps, "", ); this.setState({tags: tags}); }}> <Text style={{ fontSize: 20, alignSelf: "center", justifyContent: "center", }}> {this.state.currentTag ? "#" + this.state.currentTag.toUpperCase() : null} </Text> </TouchableHighlight> </View> {this.getFooter()} </View> ); } } export default Analitics;
/* * 弹出框模块 * @date:2014-11-05 * @author:kotenei(kotenei@qq.com) */ define('km/popover', ['jquery', 'km/tooltips', 'km/util'], function ($, Tooltips, util) { /** * 弹出框模块 * @param {JQuery} $element - dom * @param {Object} options - 参数 */ var Popover = function ($element, options) { options = $.extend(true, { type:'popover', title: '标题', tpl: '<div class="k-popover">' + '<div class="k-popover-arrow"></div>' + '<div class="k-popover-title"></div>' + '<div class="k-popover-inner"></div>' + '</div>' }, options); Tooltips.call(this, $element, options); this.setTitle(); }; /** * 继承tooltips * @param {String} title - 标题 */ Popover.prototype = util.createProto(Tooltips.prototype); /** * 设置标题 * @param {String} title - 标题 */ Popover.prototype.setTitle = function (title) { title = $.trim(title || this.options.title); if (title.length === 0) { title = this.$element.attr('data-title') || ""; } var $tips = this.$tips; $tips.find('.k-popover-title').text(title); }; /** * 设置内容 * @param {String} content - 内容 */ Popover.prototype.setContent = function (content) { content = $.trim(content || this.options.content); if (content.length === 0) { content = this.$element.attr('data-content') || ""; } var $tips = this.$tips; $tips.find('.k-popover-inner').html(content); }; /** * 全局popover * @param {JQuery} $elements - dom */ Popover.Global = function ($elements) { var $elements = $elements || $('[data-module="popover"]'); $elements.each(function () { var $this = $(this); var popover = Popover.Get($this); if (!popover) { var options = $this.attr('data-options'); if (options && options.length > 0) { options = eval('(0,' + options + ')'); } else { options = { title: $this.attr('data-title'), content: $this.attr('data-content'), placement: $this.attr('data-placement'), tipClass: $this.attr('data-tipClass'), trigger: $this.attr('data-trigger') }; } popover = new Popover($this, options); Popover.Set($this, popover); } }); }; /** * 从缓存获取对象 * @param {JQuery} $element - dom */ Popover.Get = function ($element) { return $.data($element[0],'popover'); }; /** * 设置缓存 * @param {JQuery} $element - dom * @param {Object} popover - 缓存对象 */ Popover.Set = function ($element, popover) { $.data($element[0], 'popover', popover); }; return Popover; });
describe('Pagelet', function () { 'use strict'; var server = require('http').createServer() , BigPipe = require('bigpipe') , common = require('./common') , Temper = require('temper') , assume = require('assume') , Response = common.Response , Request = common.Request , Pagelet = require('../') , React = require('react') , pagelet, P; // // A lazy mans temper, we just want ignore all temper actions sometimes // because our pagelet is not exported using `.on(module)` // var temper = new Temper , bigpipe = new BigPipe(server); // // Stub for no operation callbacks. // function noop() {} beforeEach(function () { P = Pagelet.extend({ directory: __dirname, error: 'fixtures/error.html', view: 'fixtures/view.html', css: 'fixtures/style.css', js: '//cdnjs.cloudflare.com/ajax/libs/d3/3.4.8/d3.min.js', dependencies: [ 'http://code.jquery.com/jquery-2.0.0.js', 'fixtures/custom.js' ] }); pagelet = new P({ temper: temper }); }); afterEach(function each() { pagelet = null; }); it('rendering is asynchronous', function (done) { pagelet.get(pagelet.emits('called')); // Listening only till after the event is potentially emitted, will ensure // callbacks are called asynchronously by pagelet.render. pagelet.on('called', done); }); it('can have reference to temper', function () { pagelet = new P({ temper: temper }); var property = Object.getOwnPropertyDescriptor(pagelet, '_temper'); assume(pagelet._temper).to.be.an('object'); assume(property.writable).to.equal(true); assume(property.enumerable).to.equal(false); assume(property.configurable).to.equal(true); }); it('can have reference to bigpipe instance', function () { pagelet = new P({ bigpipe: bigpipe }); var property = Object.getOwnPropertyDescriptor(pagelet, '_bigpipe'); assume(pagelet._bigpipe).to.be.an('object'); assume(pagelet._bigpipe).to.be.instanceof(BigPipe); assume(property.writable).to.equal(true); assume(property.enumerable).to.equal(false); assume(property.configurable).to.equal(true); }); describe('#on', function () { it('is a function', function () { assume(Pagelet.on).is.a('function'); assume(Pagelet.on.length).to.equal(1); }); it('sets the directory property to dirname', function () { var pagelet = Pagelet.extend({}); assume(pagelet.prototype.directory).to.equal(''); pagelet.prototype.directory = 'foo'; assume(pagelet.prototype.directory).to.equal('foo'); pagelet.on(module); assume(pagelet.prototype.directory).to.be.a('string'); assume(pagelet.prototype.directory).to.equal(__dirname); }); it('resolves the view', function () { assume(P.prototype.view).to.equal('fixtures/view.html'); P.on(module); assume(P.prototype.view).to.equal(__dirname +'/fixtures/view.html'); }); it('resolves the `error` view', function () { assume(P.prototype.error).to.equal('fixtures/error.html'); P.on(module); assume(P.prototype.error).to.equal(__dirname +'/fixtures/error.html'); }); }); describe('#destroy', function () { it('is a function', function () { assume(pagelet.destroy).to.be.a('function'); assume(pagelet.destroy.length).to.equal(0); }); it('cleans object references from the Pagelet instance', function () { var local = new Pagelet({ temper: temper, bigpipe: bigpipe }); local.on('test', noop); local.destroy(); assume(local).to.have.property('_temper', null); assume(local).to.have.property('_bigpipe', null); assume(local).to.have.property('_children', null); assume(local).to.have.property('_events', null); }); }); describe('#discover', function () { it('emits discover and returns immediatly if the parent pagelet has no children', function (done) { pagelet.once('discover', done); pagelet.discover(); }); /* Disabled for now, might return before 1.0.0 it('initializes pagelets by allocating from the Pagelet.freelist', function (done) { var Hero = require(__dirname + '/fixtures/pagelets/hero').optimize(app.temper) , Faq = require(__dirname + '/fixtures/pages/faq').extend({ pagelets: [ Hero ] }) , pageletFreelist = sinon.spy(Hero.freelist, 'alloc') , faq = new Faq(app); faq.once('discover', function () { assume(pageletFreelist).to.be.calledOnce; done(); }); faq.discover(); });*/ }); describe('#length', function () { it('is a getter', function () { var props = Object.getOwnPropertyDescriptor(Pagelet.prototype, 'length'); assume(Pagelet.prototype).to.have.property('length'); assume(props).to.have.property('get'); assume(props.get).to.be.a('function'); assume(props).to.have.property('set', void 0); assume(props).to.have.property('enumerable', false); assume(props).to.have.property('configurable', false); }); it('returns the childrens length', function () { pagelet._children = [ 1, 2, 3 ]; assume(pagelet.length).to.equal(3); }); }); describe('#template', function () { it('is a function', function () { assume(Pagelet.prototype.template).to.be.a('function'); assume(P.prototype.template).to.be.a('function'); assume(Pagelet.prototype.template).to.equal(P.prototype.template); assume(pagelet.template).to.equal(P.prototype.template); }); it('returns compiled server template from Temper by path', function () { var result = pagelet.template(__dirname + '/fixtures/view.html', { test: 'data' }); assume(result).to.be.a('string'); assume(result).to.equal('<h1>Some data fixture</h1>'); }); it('returns compiled server React template for jsx templates', function () { var result = pagelet.template(__dirname + '/fixtures/view.jsx', { Component: React.createClass({ render: function () { return ( React.createElement('span', null, 'some text') ); } }), test: 'data' }); assume(result).to.be.a('object'); assume(React.isValidElement(result)).is.true(); }); it('defaults to the pagelets view if no path is provided', function() { var result = new (P.extend().on(module))({ temper: temper }).template({ test: 'data' }); assume(result).to.be.a('string'); assume(result).to.equal('<h1>Some data fixture</h1>'); }); it('provides empty object as fallback for data', function() { var result = new (P.extend().on(module))({ temper: temper }).template(); assume(result).to.be.a('string'); assume(result).to.equal('<h1>Some {test} fixture</h1>'); }); }); describe('#contentType', function () { it('is a getter', function () { var props = Object.getOwnPropertyDescriptor(Pagelet.prototype, 'contentType'); assume(Pagelet.prototype).to.have.property('contentType'); assume(props).to.have.property('get'); assume(props.get).to.be.a('function'); assume(props).to.have.property('enumerable', false); assume(props).to.have.property('configurable', false); }); it('is a setter', function () { var props = Object.getOwnPropertyDescriptor(Pagelet.prototype, 'contentType'); assume(Pagelet.prototype).to.have.property('contentType'); assume(props).to.have.property('set'); assume(props.get).to.be.a('function'); assume(props).to.have.property('enumerable', false); assume(props).to.have.property('configurable', false); }); it('sets the Content-Type', function () { pagelet.contentType = 'application/test'; assume(pagelet._contentType).to.equal('application/test'); }); it('returns the Content-Type of the pagelet appended with the charset', function () { assume(pagelet.contentType).to.equal('text/html;charset=UTF-8'); pagelet._contentType = 'application/test'; assume(pagelet.contentType).to.equal('application/test;charset=UTF-8'); pagelet._charset = 'UTF-7'; assume(pagelet.contentType).to.equal('application/test;charset=UTF-7'); }); }); describe('#bootstrap', function () { it('is a getter', function () { var props = Object.getOwnPropertyDescriptor(Pagelet.prototype, 'bootstrap'); assume(Pagelet.prototype).to.have.property('bootstrap'); assume(props).to.have.property('get'); assume(props.get).to.be.a('function'); assume(props).to.have.property('enumerable', false); assume(props).to.have.property('configurable', false); }); it('is a setter', function () { var props = Object.getOwnPropertyDescriptor(Pagelet.prototype, 'bootstrap'); assume(Pagelet.prototype).to.have.property('bootstrap'); assume(props).to.have.property('set'); assume(props.get).to.be.a('function'); assume(props).to.have.property('enumerable', false); assume(props).to.have.property('configurable', false); }); it('sets a reference to a bootstrap pagelet', function () { var bootstrap = new (Pagelet.extend({ name: 'bootstrap' })); pagelet.bootstrap = bootstrap; assume(pagelet._bootstrap).to.equal(bootstrap); }); it('only accepts objects that look like bootstrap pagelets', function () { pagelet.bootstrap = 'will not be set'; assume(pagelet._bootstrap).to.equal(void 0); pagelet.bootstrap = { name: 'bootstrap', test: 'will be set' }; assume(pagelet._bootstrap).to.have.property('test', 'will be set'); }); it('returns a reference to the bootstrap pagelet or empty object', function () { assume(Object.keys(pagelet.bootstrap).length).to.equal(0); assume(pagelet.bootstrap.name).to.equal(void 0); var bootstrap = new (Pagelet.extend({ name: 'bootstrap' })); pagelet.bootstrap = bootstrap; assume(pagelet.bootstrap).to.equal(bootstrap); }); it('returns a reference to self if it is a boostrap pagelet', function () { var bootstrap = new (Pagelet.extend({ name: 'bootstrap' })); assume(bootstrap.bootstrap).to.equal(bootstrap); }); }); describe('#active', function () { it('is a getter', function () { var props = Object.getOwnPropertyDescriptor(Pagelet.prototype, 'active'); assume(Pagelet.prototype).to.have.property('active'); assume(props).to.have.property('get'); assume(props.get).to.be.a('function'); assume(props).to.have.property('enumerable', false); assume(props).to.have.property('configurable', false); }); it('is a setter', function () { var props = Object.getOwnPropertyDescriptor(Pagelet.prototype, 'active'); assume(Pagelet.prototype).to.have.property('active'); assume(props).to.have.property('set'); assume(props.get).to.be.a('function'); assume(props).to.have.property('enumerable', false); assume(props).to.have.property('configurable', false); }); it('sets the provided value to _active as boolean', function () { pagelet.active = 'true'; assume(pagelet._active).to.equal(true); pagelet.active = false; assume(pagelet._active).to.equal(false); }); it('returns true if no conditional method is available', function () { assume(pagelet.active).to.equal(true); pagelet._active = false; assume(pagelet.active).to.equal(true); }); it('returns the boolean value of _active if a conditional method is available', function () { var Conditional = P.extend({ if: noop }) , conditional = new Conditional; conditional._active = true; assume(conditional.active).to.equal(true); conditional._active = null; assume(conditional.active).to.equal(false); conditional._active = false; assume(conditional.active).to.equal(false); }); }); describe('#conditional', function () { it('is a function', function () { assume(pagelet.conditional).to.be.a('function'); assume(pagelet.conditional.length).to.equal(3); }); it('has an optional list argument for alternate pagelets', function (done) { pagelet.conditional({}, function (authorized) { assume(authorized).to.equal(true); done(); }); }); it('will use cached boolean value of authenticate', function (done) { var Conditional = P.extend({ if: function stubAuth(req, enabled) { assume(enabled).to.be.a('function'); enabled(req.test === 'stubbed req'); } }), conditional; conditional = new Conditional; conditional._active = false; conditional.conditional({}, function (authorized) { assume(authorized).to.equal(false); conditional._active = 'invalid boolean'; conditional.conditional({}, function (authorized) { assume(authorized).to.equal(false); done(); }); }); }); it('will authorize if no authorization method is provided', function (done) { pagelet.conditional({}, [], function (authorized) { assume(authorized).to.equal(true); assume(pagelet._active).to.equal(true); done(); }); }); it('will call authorization method without conditional pagelets', function (done) { var Conditional = P.extend({ if: function stubAuth(req, enabled) { assume(enabled).to.be.a('function'); enabled(req.test === 'stubbed req'); } }); new Conditional().conditional({ test: 'stubbed req' }, function (auth) { assume(auth).to.equal(true); done(); }); }); it('will call authorization method with conditional pagelets', function (done) { var Conditional = P.extend({ if: function stubAuth(req, list, enabled) { assume(list).to.be.an('array'); assume(list.length).to.equal(1); assume(list[0]).to.be.instanceof(Pagelet); assume(enabled).to.be.a('function'); enabled(req.test !== 'stubbed req'); } }); new Conditional().conditional({ test: 'stubbed req' }, [pagelet], function (auth) { assume(auth).to.equal(false); done(); }); }); it('will default to not authorized if no value is provided to the callback', function (done) { var Conditional = P.extend({ if: function stubAuth(req, list, enabled) { assume(list).to.be.an('array'); assume(list.length).to.equal(0); assume(enabled).to.be.a('function'); enabled(); } }); new Conditional().conditional({ test: 'stubbed req' }, function (auth) { assume(auth).to.equal(false); done(); }); }); }); describe('#redirect', function () { it('is a function', function () { assume(pagelet.redirect).to.be.a('function'); assume(pagelet.redirect.length).to.equal(3); }); it('proxies calls to the bigpipe instance', function (done) { var CustomPipe = BigPipe.extend({ redirect: function redirect(ref, path, code, options) { assume(ref).to.be.instanceof(Pagelet); assume(ref).to.equal(pagelet); assume(path).to.equal('/test'); assume(code).to.equal(404); assume(options).to.have.property('cache', false); done(); } }); pagelet = new P({ bigpipe: new CustomPipe(server) }); pagelet.redirect('/test', 404, { cache: false }); }); it('returns a reference to the pagelet', function () { pagelet = new P({ bigpipe: bigpipe }); pagelet._res = new Response; assume(pagelet.redirect('/')).to.equal(pagelet); }) }); describe('#children', function () { it('is a function', function () { assume(Pagelet.children).to.be.a('function'); assume(P.children).to.be.a('function'); assume(Pagelet.children).to.equal(P.children); }); it('returns an array', function () { var one = P.children() , recur = P.extend({ pagelets: { child: P.extend({ name: 'child' }) } }).children('this one'); assume(one).to.be.an('array'); assume(one.length).to.equal(0); assume(recur).to.be.an('array'); assume(recur.length).to.equal(1); }); it('will only return children of the pagelet', function () { var single = P.children(); assume(single).to.be.an('array'); assume(single.length).to.equal(0); }); it('does recursive pagelet discovery', function () { var recur = P.extend({ pagelets: { child: P.extend({ name: 'child' , pagelets: { another: P.extend({ name: 'another' }) } }), } }).children('multiple'); assume(recur).is.an('array'); assume(recur.length).to.equal(2); assume(recur[0].prototype.name).to.equal('child'); assume(recur[1].prototype.name).to.equal('another'); }); it('sets the pagelets parent name on `_parent`', function () { var recur = P.extend({ pagelets: { child: P.extend({ name: 'child' }) } }).children('parental'); assume(recur[0].prototype._parent).to.equal('parental'); }); }); describe('#optimize', function () { it('should prepare an async call stack'); it('should provide optimizer with Pagelet reference if no transform:before event'); }); });
const {Agent} = require('./agent.js'); const {config} = require('./config.js'); class AgentRegistry { constructor(serverPort) { this.nextPort = serverPort + 1; this.agentMap = {}; } add(agentId) { this.agentMap[agentId] = new Agent(agentId, this.nextPort++); return this.agentMap[agentId]; } getFreeAgent() { return Object.values(this.agentMap).find((agent) => !agent.processingBuildId); } get(agentId) { return this.agentMap[agentId]; } } exports.agentRegistry = new AgentRegistry(config.serverPort);
/* * @Descripttion: * @Author: Fang Peijie * @Date: 2021-05-20 11:08:37 * @LastEditors: Fang Peijie * @LastEditTime: 2021-05-27 15:06:33 */ module.exports = { extends: "eslint:recommended", parser: "vue-eslint-parser", parserOptions: { parser: "babel-eslint", ecmaVersion: 6, sourceType: "module", //指定源代码存在的位置,script | module,默认为script }, globals: { document: true, window: true, }, rules: { semi: 0, // 关闭分号结尾 }, }; // 参考:https://segmentfault.com/a/1190000024509889
import React from "react"; import GenealogyTree from "./component/GenealogyTree"; import Daxcsa from "./Daxcsa.json"; const App = (props) => { return ( <div className="container"> <GenealogyTree {...Daxcsa}></GenealogyTree> </div> ); }; App.defaultProps = { title: "Daxcsa", }; export default App;
/* * Copyright (C) 2009-2017 SAP SE or an SAP affiliate company. All rights reserved. */ sap.ui.define([ "fin/re/conmgmts1/controller/BaseController" ], function(BaseController) { 'use strict'; return BaseController.extend('fin.re.conmgmts1.controller.reminderblocks.ReminderList', { onInit: function() { this._showCompletedReminders = false; }, onAfterRendering: function() { var viewId = this.getView().getId(); var reminderList = sap.ui.getCore().byId(viewId + "--" + "reminderList"); reminderList.attachBeforeRebindTable(this._onBeforeReminderRendering.bind(this)); var reminderToggle = sap.ui.getCore().byId(viewId + "--" + "reminderToggle"); reminderToggle.attachPress(this._onReminderTogglePress.bind(this)); if (sap.ui.Device.browser.name === "ff") { this._initTable4FF(); } }, _onBeforeReminderRendering: function(oEvent) { var mBindingParams = oEvent.getParameter("bindingParams"); if (!this._showCompletedReminders) { var rsdoneFilter = new sap.ui.model.Filter("Rsdone", sap.ui.model.FilterOperator.EQ, "false"); mBindingParams.filters = [rsdoneFilter]; } }, _onReminderTogglePress: function(oEvent) { this._showCompletedReminders = oEvent.getSource().getPressed(); var viewId = this.getView().getId(); var reminderList = sap.ui.getCore().byId(viewId + "--" + "reminderList"); reminderList.rebindTable(); }, /* see Contract.controller.js */ _initTable4FF: function() { var viewId = this.getView().getId(); var reminderList = sap.ui.getCore().byId(viewId + "--" + "reminderList"); reminderList.rebindTable(); } }); });
function testParam(){ var name = $("#name").val(); var height = $("#height").val(); var data={name:name,height:height}; var requestType = $("#request_type").val(); var requestUri = $("#request_uri").val(); $.ajax({ url: $.mpbGetHeaderPath() + "/param/"+requestUri, data:data, type: requestType, datType: "json", success: function(data) { $("#result").val(""); $("#result").val(data); } }); }
({ loadTrainingViewModel : function(cmp) { const action = cmp.get('c.getTrainings'); const volunteerId = cmp.get('v.volunteerId'); if (!volunteerId) { return; } action.setParams({'volunteerId' : volunteerId}); action.setCallback(this, function(response){ const state = response.getState(); cmp.set('v.showSpinner', false); if ('SUCCESS' === state) { cmp.set('v.trainingVM', response.getReturnValue()); } else { this.showToast(cmp, 'error', 'Error', 'There was an error retreiving the trainings.'); } }); cmp.set('v.showSpinner', true); $A.enqueueAction(action); }, register : function(cmp, trainingId) { const action = cmp.get('c.registerForTraining'); action.setParams({ 'volunteerId' : cmp.get('v.volunteerId'), 'trainingId' : trainingId }); action.setCallback(this, function(response) { const state = response.getState(); cmp.set('v.showSpinner', false); if ('SUCCESS' === state) { cmp.set('v.trainingVM', response.getReturnValue()); this.showToast(cmp, 'success', 'You are registered!', 'You are now registered. See you at the training!'); } else { this.showToast(cmp, 'error', 'Error', 'There was an error registering you for the training.'); } }); cmp.set('v.showSpinner', true); $A.enqueueAction(action); }, showToast : function(cmp, severity, title, message) { let toastEvent = $A.get('e.force:showToast'); toastEvent.setParams({ 'title': title, 'message': message, 'type' : severity }); toastEvent.fire(); }, unregister : function(cmp, attendanceId) { const action = cmp.get('c.unregisterFromTraining'); action.setParams({ 'volunteerId' : cmp.get('v.volunteerId'), 'attendanceId' : attendanceId }); action.setCallback(this, function(response) { const state = response.getState(); cmp.set('v.showSpinner', false); if ('SUCCESS' === state) { cmp.set('v.trainingVM', response.getReturnValue()); this.showToast(cmp, 'success', '', 'You have successfully unregistered from the training.'); } else { this.showToast(cmp, 'error', 'Error', 'There was an error unregistering you from the training.'); } }); cmp.set('v.showSpinner', true); $A.enqueueAction(action); }, });
const address = /^[\w\d,\\.-]+$/ const cc = /^(\d{4})\s?\-?\s?(\d{4})\s?\-?\s?(\d{4})\s?\-?\s?(\d{6})$/ const code = /^\d+$/ const email = /^(?:(?:[\w`~!#$%^&*\-=+;:{}'|,?\/]+(?:(?:\.(?:"(?:\\?[\w`~!#$%^&*\-=+;:{}'|,?\/\.()<>\[\] @]|\\"|\\\\)*"|[\w`~!#$%^&*\-=+;:{}'|,?\/]+))*\.[\w`~!#$%^&*\-=+;:{}'|,?\/]+)?)|(?:"(?:\\?[\w`~!#$%^&*\-=+;:{}'|,?\/\.()<>\[\] @]|\\"|\\\\)+"))@(?:[a-zA-Z\d\-]+(?:\.[a-zA-Z\d\-]+)*|\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])$/m const http = /^(http(s)?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/ const hex = /^[A-Fa-f\d]+$/ const ipv4 = /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/ const md5 = /^[A-Za-z0-9]{5,32}$/ const login = /^[a-zA-Z\d][A-z\d.-_+]+$/ const phone = /^\+?[\d\s]{0,16}$/ const tag = /^[\w]+$/ const text = /.*/ const title = /^.*$/ const uri = /^[a-z0-9-]+$/ const XMLTag = /^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/ export { address, cc, code, email, http, hex, ipv4, login, md5, phone, tag, text, title, uri, XMLTag, }
exports.version = {major: 2, minor: 4, patch: 0, build: 0};
import React from 'react'; import { Link } from 'gatsby'; import styled, { css } from 'styled-components'; import Layout from '../layout/layout'; import { mutedAccent, mutedSecondary } from '../css/colors'; const PageLink = styled(Link)` display: inline-block; padding: 1rem 1.25rem; `; export default () => { return ( <Layout> <section css={css` display: flex; flex-direction: column; padding: 6.375rem 17.5rem; text-align: center; `}> <img src="../headshot.svg" alt="Headshot" /> <div> <h1 css={css` display: inline; `}> My name is Krystal Klumpp. I'm a Senior UI Engineer at SoFi. </h1> <p css={css` display: inline; font-size: 2.25rem; font-weight: 500; `}> {" "}I primarily work with JavaScript, HTML5, CSS3 & responsive design techniques.</p> </div> <div> <a href="https://www.linkedin.com/in/krystalklumpp/">Contact me</a> </div> </section> <section css={css` background-color: ${mutedAccent}; display: flex; padding: 6.375rem 17.5rem; `}> <img src="../icon_dev.svg" alt="" css={css` margin-right: 60px; `} /> <div> <h2>Why I'm an engineer</h2> <p css={css` font-size: 1.25rem; font-weight: 500; `}> Before I became a developer, one criticism I often heard was that I was always trying to learn something new. Jack of all trades, master of none and all that nonsense. But programming is a field where an overly developed sense of curiosity is a basic requirement just to remain relevant. And now this 'weakness' is a strength. </p> </div> </section> <section css={css` padding: 6.375rem 13.75rem; display: flex; justify-content: center; `} > <div css={css` padding: 0 .8rem; text-align: center; `}> <img src="../icon_preso.svg" alt="" /> <h2>Presentations</h2> <div css={css` margin-top: 0; `}> <PageLink to="/presentations">Check them out</PageLink> </div> </div> </section> <section css={css` background-color: ${mutedSecondary}; padding: 6.375rem 13.75rem; `}> <h2>About me</h2> <p>After graduating with a BA in Japanese Language and Literature from the University of Georgia, I took the next logical step and enlisted in the U.S. Army. While in the Army I worked as a target audience analyst and cultural expert over the course of two deployments to Afghanistan.</p> <p>Post-Army I spent two months on a solo bike tour across the U.S. before moving to Harbin, China for 7 months. After Harbin taught me what cold really means, I headed over to Japan where I lived off of ramen and Pocky for 3 years (yes, I know you're likely weeping with jealousy right now). In Tokyo, I attended the Communication Studies program at Temple University in Tokyo, Japan. Though I had intended to become a journalist, I quickly became more interested in how information was being presented than in the information itself.</p> <p>Aside from the aspects of multimedia journalism that initially caught my attention, the main draw of programming for me was the need to continuously learn and grow.</p> </section> </Layout > ) };
import React from 'react'; import { render } from 'react-dom'; import './assets/styles/style.css'; import HeaderComponent from "./components/Header"; import Slider from "./components/Slider"; import Main from "./components/Main"; import MyMaps from "./components/Maps"; export default class App extends React.Component { constructor(props) { super(props); this.state = { open: false } } render() { return( <div> <HeaderComponent /> <Slider /> <Main /> </div> ); } }
import React from 'react'; import PropTypes from 'prop-types'; import moment from 'moment'; const ForecastItem = props => { const date = moment.unix(props.forecast.dt); const weekDay = moment()._locale._weekdays[date.day()]; const month = moment()._locale._monthsShort[date.month()]; const day = date.date(); const src = require(`../images/${props.forecast.weather[0].icon}.svg`); return ( <li> <img src={src} /> <p>{`${weekDay}, ${month} ${day}`}</p> </li> ); }; ForecastItem.propTypes = { forecast: PropTypes.object.isRequired }; export default ForecastItem;
import Apify from 'apify'; import { inspect } from 'util'; import { convertInputToActorConfigs } from './lib/configs.js'; import { waitForRunToFinishAndPushData, startRun } from './lib/startRunAndPool.js'; const { log } = Apify.utils; const env = Apify.getEnv(); Apify.main(async () => { /** @type {import('../../common/types').ActorInputData} */ // @ts-ignore It's not null const input = await Apify.getInput(); log.debug('Provided inputs:'); log.debug(inspect(input)); const { maxConcurrentDomainsChecked, urlsToCheck } = input; // Log the input log.info('Input provided:'); log.debug(inspect(input, false, 4)); /** @type {import('./types').FrontendActorState} */ // @ts-expect-error It's an object const state = await Apify.getValue('STATE') ?? { runConfigurations: [], totalUrls: urlsToCheck.length, checkerFinished: false, }; Apify.events.on('persistState', async () => { await Apify.setValue('STATE', state); }); // If we haven't initialized the state yet, do it now if (state.runConfigurations.length === 0 && !state.checkerFinished) { state.runConfigurations = convertInputToActorConfigs(input); } // Sort state based on started runs state.runConfigurations = state.runConfigurations.sort((_, b) => Number(Boolean(b.runId))); await Apify.setValue('STATE', state); log.info(`Preparing to process ${state.totalUrls} URLs...\n`); /** @type {import('apify').RequestOptions[]} */ const sources = state.runConfigurations.map((actorInput, index) => ({ url: 'https://localhost', uniqueKey: index.toString(), userData: { actorInput }, })); const requestList = await Apify.openRequestList(null, sources); const runner = new Apify.BasicCrawler({ maxConcurrency: maxConcurrentDomainsChecked, requestList, handleRequestFunction: async ({ request }) => { const { userData } = request; /** @type {{ actorInput: import('../../common/types').PreparedActorConfig }} */ // @ts-expect-error JS-style casting const { actorInput } = userData; if (actorInput.runId) { log.info(`Found run ${actorInput.runId} with actor ${actorInput.actorId} for URL "${actorInput.url}" - waiting for it to finish.`); log.info(`You can monitor the status of the run by going to https://console.apify.com/actors/runs/${actorInput.runId}`); } else { const result = await startRun(actorInput); log.info( `Starting run for "${actorInput.url}" with actor ${actorInput.actorId} and ${ actorInput.input.proxyConfiguration.useApifyProxy ? `proxy ${actorInput.proxyUsed ?? 'auto'}` : 'no proxy' }.`, ); log.info(`You can monitor the status of the run by going to https://console.apify.com/actors/runs/${result.id}`); actorInput.runId = result.id; } // Wait for the run to finish await waitForRunToFinishAndPushData(actorInput); }, handleRequestTimeoutSecs: 2_147_483, }); // Run the checker await runner.run(); // Save the state as done, to prevent resurrection doing requests it doesn't have to do state.runConfigurations = []; state.checkerFinished = true; await Apify.setValue('STATE', state); log.info(`\nChecking ${state.totalUrls} URLs completed!`); log.info(`Please go to https://api.apify.com/v2/datasets/${env.defaultDatasetId}/items?clean=true&format=html to see the results`); log.info(`Go to https://api.apify.com/v2/datasets/${env.defaultDatasetId}/items?clean=true&format=json for the JSON output`); });