text
stringlengths
7
3.69M
/* Treehouse FSJS Techdegree * Project 4 - OOP Game App * Phrase.js */ class Phrase { constructor (phrase) { this.phrase = phrase.toLowerCase(); } /* Adds letter placeholders to the display when the game starts */ addPhraseToDisplay () { const phraseUL = document.getEle...
/// <binding BeforeBuild='clean:css, compileSass' ProjectOpened='watch' /> /// <vs BeforeBuild='clean:css, compileSass' SolutionOpened='watch' /> var gulp = require('gulp'); var sass = require('gulp-sass'); var minifyCSS = require('gulp-minify-css'); var del = require('del'); gulp.task('compileSass', function () { ...
import BlockManager from 'block_manager'; import BlocksView from './view/BlocksView'; describe('BlockManager', () => { describe('Main', () => { var obj; var idTest; var optsTest; beforeEach(() => { idTest = 'h1-block'; optsTest = { label: 'Heading', content: '<h1>Test</h1...
var React = require("react"); var About = React.createClass ({ displayName: "About", /* jshint ignore:start */ render : function () { return ( <h1> About </h1> ); } /* jshint ignore:end */ });
import React from 'react' import { Card, Table, Breadcrumb, Modal, Button, message, notification } from 'antd' import DropOption from '@/components/DropOption' import CategorCreate from './CategorCreate' import axios from 'axios' import { paginat } from '@/utils/pagination' const confirm = Modal.confirm; class Catego...
// controller function yourChosenBar(barNo){ if (chosenBar == barNo) {chosenBar = null;} else {chosenBar = barNo;} show(); } function removeBar(chosenBar){ if (chosenBar) {numbers.splice(chosenBar -1, 1);} show(); } function addBar(input...
/** * The script enables Tessy on a webpage. * Needs to be present in the <head> before all other scripts. * Browser-ready version of this script is ./monetization-browser.js */ const { initPluginOptions, initWebMonetizationAPI, simulateWebMonetization } = require('../src/index'); initWebMonetizationAPI(wind...
const crypto = require('crypto'); const { execSync } = require('child_process'); const Sentry = require('@sentry/node'); Sentry.init({ dsn: 'https://[email protected]/1491332', release: require('../../package.json').version, maxBreadcrumbs: 10 }); const getStdout = cmd => { const stdo...
module.exports = { theme: { colors: { white: "#ececec", black: "#000025", red: "#A7425D", blue: "#385170", darkBlue: "#142d4c", lightBlue: "#3498db", }, extend: {}, }, variants: {}, plugins: [], corePlugins: { preflight: false, }, }
const fetch = require("node-fetch"); async function covidData() { try { const res = await fetch("https://api.covid19api.com/summary"); if (res.status >= 400) { console.log("Bad request from server"); } const data = await res.json(); console.log(data); } catch (error) { console.log(e...
/** * 舆情级别管理页面js */ $(function(){ $("#select").click(function(){ $.ajax({ url: webRoot + 'website/query', type: 'post', data: $("#select_form").serialize(), dataType: 'json', success: function(data){ if(data.code == 0){ $("#dg").datagrid('loadData',data); } else { $.m...
// ==UserScript== // @name nocarousel for pyimagesearch.com (Opera/Chrome) | Jason // @description Turns off the annoying sidebar carousel. Sorry Adrian. The script finds a <div> with the ID of "pyimg_gurus_carousel" and assigns it a new ID of "nocarousel", thus preventing the carousel function. Script adds innerHTML a...
$(document).ready(function () { var isAnimationRunning = false; $(window).scroll(function (e) { if (!isAnimationRunning) { isAnimationRunning = true; var $slides = $('.ee-flip-slider .swiper-slide-active'); var translate3d = []; $slides.animate( { deg: 15 }, { ...
import React from 'react'; import { Link } from 'react-router-dom'; import './Booking.css'; import { useState } from 'react'; import ReactDatePicker from 'react-datepicker'; const Booking = () => { const [startDate, setStartDate] = useState(new Date()); return ( <div className="full-container"> ...
'use strict'; (function(){ var services = angular.module('multitrack.services', ['ngResource']); services.factory('UsersFactory', ['$resource', function($resource){ return $resource('/users', {}, { query: { method: 'GET', isArray: true}, create: {method: 'POST'} }); }]); services....
import React from 'react'; import { Link } from 'react-router-dom'; const BookTitleDetails = ({ book, link }) => { return ( <div> { link ? <p className="h3 fw-bold"><Link className="text-dark text-decoration-none" to={{ pathname: `/book/${...
const fs = require('fs'); const path = require('path'); const Sequelize = require('sequelize'); const logger = require(__loggerPath); const CoreHelper = require(__rootPath + '/components/helpers/CoreHelper'); const defaultDatabase = forward.config.database.defaultDatabase; const databaseConnectionInfo = forward...
import React, { Component } from "react"; import { NavItem, Nav} from "react-bootstrap"; import translator from "../../middleware/translator" class HeaderLinks extends Component { constructor(props){ super(props); this.logout = this.logout.bind(this) } logout(){ localStorage.removeItem('token'); w...
// 1 $(document).ready(function() { $("#msg").html("<p>jQuery Hello World</p>"); }); $(document).ready(function() { $("#newdiv").click(function() { alert("Hello world!"); }); }); // 2 $(document).ready(function() { $("p").on({ mouseenter: function() { $(this).css("color", "red"); } }); })...
const tasteDiveUrl = "https://tastedive.com/api/similar?callback=?"; const googleBooksUrl = "https://www.googleapis.com/books/v1/volumes"; const amazonProductAddUrl ="https://webservices.amazon.com/onca/xml"; let i = 0; let text = "Let's find your next book!"; let speed = 75; function headerTypeWriter(){ if(i ...
(function () { 'use strict'; /** * @ngdoc object * @name 0621fetedlm.controller:C0621fetedlmCtrl * * @description * */ angular .module('0621fetedlm') .controller('C0621fetedlmCtrl', C0621fetedlmCtrl); function C0621fetedlmCtrl() { var vm = this; vm.ctrlName = 'C0621fetedlmCtr...
/* Dec 2013 Hugo Rodrigues */ (function($) { $.fn.resizeImages = function (options, callback) { var defaultVal = { parent: false, minWidth: false }; var obj = $.extend(defaultVal, options); totalImage=(this.length-1); this.each(function () { var selObject = $(this); selObject.one('load', ...
function a() { $('#loading').show(); $.post("phpscript/date.php",{Yes:1},function(data){ var salt=$("#password").val(); var password = CryptoJS.HmacSHA512(data, salt); $("#password").val(password); $("#loginform").submit(); }); } function b() { $('#loading').show(); $("#loginform").submit(); } //---------...
/** * I'll show my coding starting to ending * codeWriting process giving 1,2,3,4 * */ /** * MODEL */ //console.log(typeof myLibrary); //object /** * VIEW */ var controller = (function () { //console.log(typeof dataHolder); // object var DOMStrings={ modalContainer: 'modal-container', modalDO...
const data = { USD: {EUR: 0.82, GBP: 0.74, TRY: 7.66}, EUR: {USD: 1.23, GBP: 0.91, TRY: 9.37}, GBP: {USD: 1.35, EUR: 1.10, TRY: 10.30}, TRY: {USD: 0.13, EUR: 0.11, GBP: 0.097} }; const currencyKeys = Object.keys(data); function createCurrencyElements(elements, root, inputName){ for(let i =0; i< el...
import React from "react"; import { Switch, Route } from "react-router-dom"; import Home from "../Home/Home"; import About from "../About/About"; import Contact from "../Contact/Contact"; import Createjob from "../Jobs/Createjob"; import Myposts from "../Jobs/Myposts"; import Jobs from "../Jobs/Jobs"; import Teachers ...
import React, { useEffect } from "react"; import Footer from "./Footer/Footer"; import { useDispatch, useSelector } from "react-redux"; import { loginStateOnLoad } from "./actions/userActions"; import InvLogo from "../Large.png"; const Home = () => { const auth = useSelector((state) => state.users); const dispatch...
import React, { useState } from 'react'; import classNames from 'classnames'; import styles from './index.module.scss'; const Color = () => { const [active, setActive] = useState(false); return ( <div className={styles.root}> <div className={classNames({ ...
module.exports = (vemto) => { return { canInstall() { return true }, onInstall() { vemto.savePluginData({ text: 'Hello world!!' }) }, beforeCodeGeneration() { let data = vemto.getPluginData() vem...
import * as action from '../../src/redux/cars/actions' describe('cars action', () => { it('should give proper action', () => { const expectedObject = { type: action.GET_CAR_REQUEST, payload: { nextPage: false, resetPage: true, skip: 10...
/** * Created by chester on 04.11.16. */ function Terrain(){ this.geometry=new THREE.PlaneGeometry(500,500,16,16); this.material=new THREE.MeshBasicMaterial({color:0x43940C}); this.terrain=new THREE.Mesh(this.geometry,this.material); this.terrain.rotation.x=-Math.PI/2; } Terrain.prototype.addToScene=f...
import { combineReducers } from 'redux'; import auth from './auth' import user from './user' import note from './note' const appReducer = combineReducers({ auth, user, note }); export default appReducer;
'use strict'; angular.module('table99', [ 'ngStorage', 'table99.config', 'table99.controllers', 'table99.services', 'table99.directives', 'ui.router', 'ui.bootstrap', 'ngFacebook', 'slickCarousel', 'ngFileUpload', 'ngMaterial', 'angular-loading-bar', 'angularMoment', ...
// @flow import type { ApiServiceInterface } from "shared/services/ApiServiceInterface"; export class ScriptService { api: ApiServiceInterface; endpoint: string = "/script"; constructor(apiService: ApiServiceInterface) { this.api = apiService; } isUniqueScript(query: Object) { return this.api.get(`...
import { createAction } from 'redux-actions'; export const setStarData = createAction('set star data');
// Global variabe for entire app var app = app || {}; // my-plugins (function($) { //my-tab $.fn.codeTab = function($tabCon) { var tabBtns = $(this), tabNav = tabBtns.parent().parent(), curTabbtn, curTabCon, curTabSet, curTabNavSet; function tabShowHide(e) { e.preventDefault(); curTabBtn...
const fountain = require('fountain-generator'); module.exports = fountain.Base.extend({ configuring() { this.mergeJson('package.json', { dependencies: { axios: '^0.15.3' } }); if (this.options.js === 'typescript') { this.mergeJson('package.json', { dependencies: { ...
//导入常量 import { ADD_VALUE, ADD_TO, ADD_INFONUM } from './mutations-type' export default { //操作的状态比较单一 [ADD_VALUE](state, payload) { payload.newProduct.value += payload.payload.value // console.log(payload.payload.value); // console.log(payload.newProduct.value); }, [ADD_TO](state...
'use strict'; import { Disposable } from 'metal'; var parseFn_; /** * The `Disposable` class provides and interface releasing any private variables * or event handlers that should be cleaned up when the component is disposed. */ class Uri extends Disposable { constructor(uriStr) { super(); this.parsedUri = (...
({ getUpcomingEventList: function (component, event, helper) { var region = window.sessionStorage.getItem("regionStorage"); let regionVal = region; let recordCount = component.get("v.recordCount"); if(regionVal) { helper.callServer( component, ...
import React, { Component, Fragment } from 'react'; import { Router, Route, withSiteData } from 'react-static'; import Routes from 'react-static-routes'; import { injectIntl } from 'react-intl'; import ReactGA from 'react-ga'; import { logPageView } from 'js/helpers/googleAnalytics'; import I18nController from 'compone...
'use strict' var web = "https://dmedinac.github.io/endeco-web/index.html#"; const ip = "192.88.0.12"; console.log(web,ip);
import {userAPI} from "../api/api"; const SET_USERS = 'SET_USERS', TOGGLE_FOLLOW = 'TOGGLE_FOLLOW', SET_CURRENT_PAGE = 'SET_CURRENT_PAGE', SET_TOTAL_COUNT = 'SET_TOTAL_COUNT', TOGGLE_IS_FETCHING = 'TOGGLE_IS_FETCHING', TOGGLE_IS_FOLLOWING_PROGRESS = 'TOGGLE_IS_FOLLOWING_PROGRESS'; let initialState...
import { mount } from '@vue/test-utils'; import { expect } from 'chai'; import ProjectLink from '@/components/ProjectLink.vue'; describe('ProjectLink', () => { const link = '#'; const title = 'test'; let wrapper; beforeEach(() => { wrapper = mount(ProjectLink, { propsData: { link, t...
var searchData= [ ['leave_5fgame',['leave_game',['../client__thread_8h.html#a42a0849dd88c8efd0747a304aa5ecea5',1,'client_thread.h']]], ['login',['login',['../client_8h.html#a183fbb1ab8be41f5bf8011b67bca7c20',1,'client.c']]] ];
import React from 'react'; import PropTypes from 'prop-types'; import styled from 'styled-components'; import { createPropTypes } from '@styled-system/prop-types'; import { margin, layout, compose } from 'styled-system'; import { groupByValues } from '../../helpers/array'; import { deprecate } from '../../helpers/propT...
(function($){ jQuery(document).ready(function($) { if ($('#slider-testimonials').length) { $("#slider-testimonials ul").jcarousel({ scroll: 1, wrap: 'both', initCallback: mycarousel_initCallback, itemVisibleInCallback: mycarousel_itemVisibleInCallback, buttonNextHTML: null, buttonPrevH...
function resize(){ $(".create-game-content").css({ position: "absolute", left: ($(window).width() - $(".create-game-content").outerWidth())/2, top: ($(window).height() - $(".create-game-content").outerHeight())/2 }); }; $(document).ready(function(){ resize(); }); $("#create-game").c...
import React from 'react' import { Container, Row, Col } from 'reactstrap' import { connect } from 'react-redux' const UserProfile = (props) => { return ( <div> <Container> <Row> <Col sm={{ size: 6, offset: 3 }}> <h1 className="text-center">User Profile Page</h1> ...
APP.directive('propertyAppraisal', function ($http, $compile, $timeout, $uibModal) { return { replace: false, transclude: true, scope: {}, templateUrl: '/public/templates/propertyAppraisal.html', link: function (scope, elem, attrs) { scope.buttonDisabled = false;...
// pages/uploadPic/uploadPic.js const app = getApp(); import common from '../../common/common' Page({ /** * 页面的初始数据 */ data: { camera:false, picStatus:false, tip:'', tipStatus:false, faceId:null, faceUrl:null }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { con...
try { require('dotenv').load(); } catch(error) { // console.error(error); } var express = require('express'), app = express(); var bodyParser = require('body-parser'); var cors = require('cors'); var methods = require('./methods'); app.use(express.static(__dirname + '/public')); app.use(bodyParser.urlencoded({ e...
const Menu = [ { id:1, image:"./images/meggi.jpg", name:"Meggi", category:"breakfast", price:"Rs.40", description:"loremLorem ipsum dolor sit amet consectetur adipisicing elit. Quasi accusamus, itaque odio cupiditate facere eaque nulla possimus harum dolore illum, ame...
import {Component} from 'react'; import style from './About.css'; export default class About extends Component { render(){ return( <div className={style.derp}> <h1 className={style.title}>About Page</h1> </div> ); } }
import React, {useState} from 'react'; import { Text, StyleSheet, TextInput, TouchableWithoutFeedback, Keyboard, KeyboardAvoidingView, View, Alert, Button, Platform, } from 'react-native'; import {Auth} from 'aws-amplify'; export default function Account({navigation}) { const [email, setEmail] = ...
/** * 코드 수 확인.. */ Ext.define('Ext.ux.plugins.CounterCode', { extend: 'Ext.util.Observable', alias: 'plugin.counterCode', constructor: function (config) { Ext.apply(this, config || {}); this.callParent(arguments); }, init: function (field) { fie...
//THIS FILE IS JSUT FOR CODE REVIEW const User = require("../src/Users"); const Admin = require("../src/Admin"); const Orders = require("../src/Orders"); const user1 = new User("Joseph", "[email protected]", "pass123"); // const user2 = new User("Joseph", "[email protected]", "pass123joe"); const user2 = new User("Victor...
var shell = require('shelljs'); var _ = require('lodash'); module.exports = function(grunt) { const defaults = { "version-file" : "src/native/libmypaint/SConscript", "version-var-name" : "brushlib_version", "version" : "UNKNOWN", "dest" : "bin/info", "export-name" : "INFO"...
document.addEventListener('DOMContentLoaded', () => { const overlay = document.querySelector('.overlay'); fetch('http://109.236.74.74:9900/getdata') .then(res => res.json()) .then(data => { if (data.success = 'succses') { document.querySelector('.card__succses').classList.add('vis...
import React, { Component } from "react"; import axios from "axios"; import { Card, Button, Form } from "react-bootstrap/"; export class Favorite extends Component { constructor(props) { super(props); this.state = { FavDigimon: [], show: false, showData: false, name: "", img: "",...
export const ADD_VALUE = 'add_value' export const ADD_TO = 'add_to' export const ADD_INFONUM = 'add_infonum'
const express = require('express'), massive = require('massive'), cors = require('cors'), bodyParser = require('body-parser'), session = require('express-session'); // controllers const accountController = require('./controllers/accountController'), listingController = require('./controll...
import React, { Component } from 'react'; import { Settings, constants } from '@db-man/components'; import SearchBricksWrapper from 'Application/SearchBricksWrapper'; import ErrorBoundary from './ErrorBoundary'; import './index.css'; export default class Application extends Component { render() { const dbs = J...
var url = "http://localhost:3000/geladeira/geladeira-brastemp-clean-frost-free-378-l-220v"; casper.test.begin('Phantomjs Tests >> Reviews pagination', 11, function(test) { casper.start(url, function() { casper.page.injectJs("https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"); te...
import styles from './Input.module.scss' const Input = (props) => { const { isTextarea = false, label, error, handleChange, value, name, fixedValue, placeholder = '' } = props return ( <div className={styles.wrapper}> <span>{ label }</span> {isTextarea ? ( <textarea name={name} value={value ...
function Eye(tx, ty, ts) { this.x = tx; this.y = ty; this.size = ts; this.angle = 0; this.update = function(mx, i,j) { this.x = i; this.y = j; this.angle += mx; //this.angle = atan2(my - this.y, mx - this.x); }; this.display = function() { pu...
import { useForm } from 'react-hook-form'; import { useRouter } from 'next/router'; import { useMutation } from '@apollo/react-hooks'; import { CREATE_ITEM } from './productsMutations'; import uploadImage from '../../utils/uploadImage'; const AddProduct = () => { const { register, handleSubmit } = useForm(); cons...
import { USER_ADDS_TO_FAVORITES_REQUEST, USER_ADDS_TO_FAVORITES_SUCCESS, USER_ADDS_TO_FAVORITES_FAILED, USER_LOGOUT, } from '../types/userActions'; import { USER_AUTHORIZATION_SUCCESS, USER_AUTHORIZATION_FAILED, USER_AUTHORIZATION_REQUEST, USER_STATUS_AUTHORIZATED, USER_STATUS_NON...
const DistanceMatrix = require('./DistanceMatrix'); const notFoundError = "DistanceMatrix: sum: Sequence not found in matrix."; const dm = new DistanceMatrix([['A', 'AAAAA'],['B', 'ATCGA'],['C', 'A-CGA']]); test("Can sum distances of each sequence", () => { expect(dm.sum('A')).toBeCloseTo(2.06624580752); expect(d...
require("dotenv").config(); var Spotify = require("node-spotify-api"); var keys = require("./keys.js"); var spotify = new Spotify(keys.spotify); var axios = require("axios"); var fs = require("fs"); var moment = require("moment"); moment().format(); var command = process.argv[2]; var userInput = process.argv.slice(3)....
var LogServer = require('./scripts/logserver.js'); var async = require('async'); var guid = require('guid'); var Thing = require('./scripts/thing.js'); /** * Specifies number of log entries to cycle through before logging * an error. * * @type {number} */ var failureFrequency = 13; var messageCount = 0; var logge...
import React from 'react'; import { render, cleanup } from '@testing-library/react'; import Categories from '../categories'; afterEach(cleanup) it('should take a snapshot', async () => { const { asFragment } = render(<Categories />) expect(asFragment(await <Categories />)).toMatchSnapshot() }) it('ren...
const getGoogleResultLinks = require('../utils/googleLinks'); const pageLibrariesPromise = require('../utils/librariesFinder'); const scraper = async (browser, searchTerm) => { const editedSearchTerm = searchTerm.split(' ').join('%20'); const url = `https://www.google.com/search?q=${editedSearchTerm}&num=7` ...
define([ 'require', 'ng-material' ], function(require){ var ngApp = angular.module('cfo-pet-adoption-data-entry', ['ngMaterial']) .config(function($mdThemingProvider) { $mdThemingProvider.theme('default') .primaryPalette('cyan',{ 'default': '800' ...
/* * File created on May 18, 2013 * * Copyright 2008-2013 Virginia Polytechnic Institute and State University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apach...
import React from 'react'; import {Text, TouchableOpacity} from 'react-native'; const ButtonDesign= ({onPress,children})=>{ const{buttonStyleMethod,textStyle}=styles; return( //<TouchableOpacity onPress={()=>console.log('butona tıkladınnnnn')} /*style={buttonStyleMethod}*/ > //<TouchableOpacity...
'use strict'; angular.module('tasks').directive('taskSlots', function(){ return { restrict: 'EA', controller: 'TasksController', templateUrl: '/modules/tasks/views/task-slots.client.view.html' }; });
import React from 'react'; import './DropdownImage.css'; import { IconContext } from 'react-icons/'; import { AiFillHome } from 'react-icons/ai'; import { FaBox } from 'react-icons/fa'; import { GiMagnifyingGlass } from 'react-icons/gi'; import { MdPermContactCalendar } from 'react-icons/md'; import { FaUsers } from ...
module.exports = { bool : /^true|false$/i, datetime : /^\d{13}$/, device : /^(web|iphone|android)$/i, device_token : /^\w{64}$/, email_auth_key : /^\w{32}$/, id : /^\w{24}$/, img ...
import DateView from './DateView' export default DateView;
/** * Charts Routes */ import React from 'react'; import { Redirect, Route, Switch } from 'react-router-dom'; import { Helmet } from "react-helmet"; // async components import { AsyncRechartsComponent, AsyncReactChartsjs2Component } from 'Components/AsyncComponent/AsyncComponent'; const ChartsComponent = ({ match ...
function demo() { cam ( [0, 30, 35] ); set({ fps: 60, broadPhase: 2, // 1: BruteForce | 2: Bvh gravity: [ 0, -9.80665, 0 ], }); var ground = add({size:[50, 10, 50], pos:[0,-5,0] }); //var ground = add ({ type:'plane', size:[50,0,50]}) // basic geometry body va...
//https://medium.com/javascript-in-plain-english/5-tricky-javascript-problems-to-check-before-your-next-interview-part-1-60fdecaa59d6 /*Call invokes the function and allows you to pass in arguments one by one commma separated, Apply invokes the function and allows you to pass in arguments as an array. Bind returns a ...
import React from 'react' import { mount } from 'enzyme' import Wrapper from './Wrapper' it('renders content', () => { const onSubmit = jest.fn() const wrapper = mount( <Wrapper onSubmit={onSubmit} /> ) const username = wrapper.find('.username') const password = wrapper.find('.password') const button...
/** * */ alert("check your password"); history.back();
import React, { Component } from 'react'; import Instafeed from 'react-instafeed'; import headshot from '../headshot.jpg' class AboutMe extends Component { render() { const instafeedTarget = 'instafeed'; return ( <div className="about-me-body"> <div className="slant-top-right"></div> ...
//TODO //Add a enemy damage fix - his attacks and damahge on hero are not perfect //Add music and jumping music // canvas = document.getElementById("gameCanvas"); //to fix the height and width of canvas canvas.width = window.innerWidth; canvas.height = window.innerHeight; // Gets hold of the canvas area canvasB...
const DEFAULT_TIMEOUT = 10000; export default function ({ route, $axios, store }) { $axios.defaults.timeout = DEFAULT_TIMEOUT; }
class PuzzleSolverException extends Error { constructor(message, extra) { super(); Error.captureStackTrace(this, this.constructor); this.name = "PuzzleSolverException"; this.message = message; if (extra) { this.extra = extra; } console.log(this.name + ": ", this.message, this.extra ?...
"use strict"; exports.DesktopTooltipStrategy = void 0; var _tooltipStrategyBase = require("./tooltipStrategyBase"); var _tooltip = _interopRequireDefault(require("../../tooltip")); var _support = require("../../../core/utils/support"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { d...
const path = require('path'); const fs = require('fs'); const libName = process.env.LIBNAME; const packageJson = require(path.resolve(__dirname,`../node_modules/${libName}/package.json`)); let packagePath; if (packageJson.main){ packagePath = packageJson.main.slice(-3) === '.js' ? packageJson.main : `${packageJson....
'use strict'; export async function get(url, successCallBack, failCallBack) { try { let data = await RNFetchBlob.fetch('GET',url,Header); if (data.respInfo.status === 200){ return successCallBack(await data.json()); }else { return failCallBack(data.json()); }...
import React, { Component, propTypes } from 'react'; import './scores.css'; import Table from './table.js'; export class Element extends React.Component { constructor(props) { super(props); } render() { return ( <div className='container'> <div className='row justify-content-center align-i...
import FetchEm from './FetchEm'; import appConfig from '../config/appConfig'; const userFetch = new FetchEm({ successCode: 0, addTimestamp: false }); userFetch.configSetRootAddress(appConfig.userApiAddress); userFetch.configSetResponseInterceptor(res => { res.message = res.data && res.data.errors ? res.data.err...
import React, { useContext, useEffect } from 'react'; import { PrincipalContext } from '../context'; import axiosClient from '../config/axios'; import Spinner from './Spinner'; import Swal from 'sweetalert2'; const CardContact = () => { const { dataContacts, setDataContacts, setOpacity, s...
// const mongoose = require('mongoose'); const mongoose = require('./../config'); const Schema = mongoose.Schema; const userSchema = new Schema({ username: { //用户名,自定义的,不可重复 type: String, required: true, }, password: String, name: String, //真实姓名 id: { //学号 type: String, required: true }, ...
/** * UserController * * @description :: Server-side logic for managing Users * @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers */ var bcrypt = require('bcrypt'); var UserController = { register: function(req, res) { var user = User.create(req.body).exec(function(err) { if (err)...
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var mapping = {}; var original = ''; var step_val = 0; function resetChar() { for (var i=0; i<chars.length; i++) { mapping[chars[i]] = chars[i]; } render(); } function resetStep () { $('#slider').val(0); $('#step').html(0); render(); } function subtitute(cip)...
import React from 'react' import {bodyParts} from './images' import {useGlobalContext} from './context' const Display = () => { const {openFrameandFilterMuscle} = useGlobalContext() return ( <section className="cards-container"> <div className="card"> {bodyParts.map((bodyPart,in...
var app,io; exports.init= (app_ref,io_ref) => { app = app_ref; io=io_ref; let device = require(`./device`); device.init(app,io); return { device:device } }