text
stringlengths
7
3.69M
const Express = require("express"); const router = Express.Router(); const mongoUser = require("../../controller/mongoUser"); const isLoggedIn = require("../../middlewares/isLoggedIn"); const { newSong } = require("../../controller/mongoSong"); router.post("/", isLoggedIn, async (req, res) => { const data = { mess...
var nFib = function(n) { var first = 0; var second = 1; for (var i = 2; i <= n; i++) { var temp = second; second += first; first = temp; } return second; }
import { createStore } from 'redux'; const ADD_TODO = 'ADD_TODO'; const TOGGLE_TODO = 'TOGGLE_TODO'; const CHANGE_VISIBILITY_FILTER = 'CHANGE_VISIBILITY_FILTER'; function addTodo(text) { return { type: ADD_TODO, text }; } function toggleTodo(todo) { return { type: TOGGLE_TODO, todo }; } function todoReducer(stat...
var breakDancer = function(top, left, timeBetweenSteps) { makeDancer.call(this, top, left, timeBetweenSteps); // this.$node.removeClass('dancer'); this.$node.addClass('breakdancer'); // we plan to overwrite the step function below, but we still want the superclass step behavior to work, // so we must keep a c...
'use strict'; /* * DATABASE: Mongo */ const mongoose = require(`mongoose`); const MongooseSchema = mongoose.Schema; const extender = require(`object-extender`); const DatabaseBase = require(`./databaseBase`); const Property = require(`../../modules/schema/property`); const Reference = require(`../../modules/schema/...
// eslint-disable-next-line no-unused-vars class HttpClient{ constructor(){ } }
/** * Created by chrismorgan on 5/18/15. */ var mongoose = require('mongoose'); var locationTypes = "commercial residential".split(" "); var schema = mongoose.Schema({ companyId: {type: String, required: true }, driverId: {type: String, required: true }, pickUpDate: {type: Date, required: true }, cr...
import React from 'react'; import I18n from '@aaua/i18n'; import {useSelector} from 'react-redux'; import {MainCard, Header} from '@aaua/components/common'; import AutocompleteScreen from '@aaua/components/common/AutocompleteScreen'; import styles from './styles'; const Cities = ({onSelectCity}) => { const { ...
import React from 'react'; import 'bootstrap/dist/css/bootstrap.min.css'; import Navbar from './Component/Navbar' import Home from './Component/Home' import Footer from './Component/Footer' import Copyright from './Component/Copyright' function App() { return ( <div> <Navbar/> <Home/> <Footer/> ...
var reactVueTemplateParser = require('./compiler'); const traverse = require('babel-traverse'); const { SourceMapConsumer } = require('source-map'); function sourceMapAstInPlace(tsMap, babelAst) { const tsConsumer = new SourceMapConsumer(tsMap); traverse.default.cheap(babelAst, node => { if (node.loc) { ...
/** * Copyright IBM Corp. 2016, 2021 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { act } from 'react-dom/test-utils'; import LocaleButton from '../LocaleButton'; import React from 'react'; import ReactDOM from 'reac...
'use strict'; module.exports = function(sequelize, DataTypes) { var Unit = sequelize.define('Unit', { rkap: DataTypes.FLOAT, ra: DataTypes.FLOAT, ri: DataTypes.FLOAT, prognosa: DataTypes.FLOAT, }, { classMethods: { associate: function(models) { // associations can be defined here ...
// import required dependencies // const bcrypt = require('bcrypt'); // const jwt = require('jsonwebtoken'); // import required files const conn = require('../configs/db'); console.log('model'); // where I am module.exports = { loginUser: function(data_login) { return new Promise( function(resolve, reject) { ...
/* Peripheral example runs Bluetooth radio as a Bluetooth 4.0 peripheral with one service. Service has a single characteristic, which has a single-byte value. created 16 Apr 2015 by Tom Igoe */ var bleno = require('bleno'); var PrimaryService = bleno.PrimaryService; // instantiate PrimaryService var Characterist...
'use strict'; describe('Thermostat', () => { let thermostat; beforeEach(() => { thermostat = new Thermostat(); }); it('starts at 20 degrees', () => { expect(thermostat.getCurrentTemperature()).toEqual(20); }); it('increases temperature', () => { thermostat.up(); expect(thermostat.getCurre...
const mysql = require("mysql"); module.exports = function(app, connection) { app.get("/", function(req, res) { connection.query("SELECT * FROM about", function(err, results) { err ? res.send(err) : res.send(JSON.stringify(results)); }); }); };
const express = require("express"); const router = express.Router(); const passport = require("passport"); require("./google-setup.js"); router.get( "/login", passport.authenticate("google", { scope: ["profile", "email"] }) ); router.get("/fail", async (req, res) => { res.send("Auth Fail."); }); router.g...
(function(){ var scrollLink = document.querySelector('.home-top__scroll-link'), block = document.querySelector('#portfolio'); if(scrollLink) { var href = scrollLink.getAttribute('href'); scrollLink.addEventListener('click', function (e) { e.preventDefault(); history.pushState(null, null, href); ...
const balancePoint = (array) => { const leftSum = []; const rightSum = []; const difference = []; let i, j; let l = 0; let r = 0; for(i = 0; i < array.length; i++) { j = array.length - i - 1; l += array[i]; r += array[j]; leftSum[i] = l; rightSum[j] = r; }; for(i = 1; i < array.leng...
import { SET_USERNAME } from '../actions/profile' function login (state = {}, action) { switch (action.type) { case SET_USERNAME: return {...state, username: action.username}; default: return {...state}; } } export default login;
export const ProjectData = [ { name: "Macroman", description: "An easy way for users to track calorie consumption by the use of macronutirents.", link: "https://github.com/Cliffcoding/MacroMan", style: "project--1 ", techUsed: "jQuery, JavaScript, Firebase, Materialize, Git, GitHub, ...
angular.module('starter.controllers', []) .controller('AppCtrl', function($scope, $ionicModal, $timeout, $location) { // With the new view caching in Ionic, Controllers are only called // when they are recreated or on app start, instead of every page change. // To listen for when this page is active (for exampl...
import axios from "axios"; import React from "react"; import PropTypes from "prop-types"; import { FaBed, FaStar } from "react-icons/fa"; import Spinner from "./Spinner"; import ErrorMessage from "./ErrorMessage"; class HotelPage extends React.Component { constructor(props) { super(props); this.state ...
import React from 'react' import './scoreList.css' import { withRouter } from 'react-router-dom' import myTest from 'api/test/test' import myTopic from 'api/topic/topic' import myTime from 'utils/time' import { PullToRefresh, ListView } from 'antd-mobile'; import { connect } from 'react-redux' import MyTime from...
'use strict'; const Playlists = function() { const root = document.querySelector('.playlist'); const playlistRoot = root.querySelector('ul'); const render = function(data) { playlistRoot.innerHTML = ""; data.forEach(function(element) { let li = document.createElement('li') li.textContent = ...
var mongoose = require( 'mongoose' ); var Main = require('../models/main'); var config = require('../config'); exports.savemain = function(req, res, next){ const uid = req.params.id; const ticketid = req.body.ticketid; const dt = req.body.mdate; const tool = req.body.mtool; const desc = req.body.mdesc; co...
import React from 'react'; import PropTypes from 'prop-types'; import { TextInput, StyleSheet, TouchableOpacity } from 'react-native'; import Block from '../Block'; import Typography from '../Typography'; import { colors, fontFamily, sizes } from '../../../constants/theme'; const Input = (props) => { const { label...
import React from 'react'; import styles from './Canvas.module.css'; import {connect} from "react-redux"; import {changeHeight, changeWidth} from '../redux/bannerSize/banner.actions' class Canvas extends React.Component { constructor(props) { super(props); this.canvas = React.createRef(); ...
import React from 'react' import { Navagation } from '../index.js' import './error404.scss' class Error404 extends React.Component { render () { return ( <h1>Error 404</h1> ); } } export default Error404;
import React from 'react'; import PropTypes from 'prop-types'; export default class Button extends React.Component { constructor() { super(); } render() { return ( <button onClick={this.props.changeName}>{this.props.firstName}</button> ) } } Button.propTypes = { firstNam...
'use strict'; const urlParse = require('url-parse'); const dbHandle = require('./Database/connect'); const UrlNode = dbHandle.model('UrlNode', require('./Schemas/UrlNode')); const Request = dbHandle.model('Request', require('./Schemas/Request')); /** * Creates a new request if UrlNode does not exist * or updates re...
var express = require('express'); var router = express.Router(); var dblite = require('dblite').withSQLite('3.8.6+'); var fs = require('fs'); var crypto = require('crypto'); var format = require('string-format'); var events = require('events'); var auth_model = require('./model/auth_model'); var utlity= require('./sms...
#!/usr/bin/env node require ('proof')(4, prove) function prove (assert) { var rects = require('../../area.js') var a = new rects.Area(-10, 5, -5, 0) var b = new rects.Area(0, 7, 0, 7) assert(a.containsPoint(-2, -2), true, "Square(-10, 5, -5, 0) contains point(-2, -2)") assert(b.containsPoint(2,2...
const express = require('express') const createUser = require('../controllers/user').createUser const router = express.Router router.post('/', (req, res) => { const user = req.body createUser(user) }) router.get('/', (req, res) => { }) module.exports = router
/** * 服务器端统计在线人数 */ // 1. 加载net核心模块 var net = require('net'); // 2. 创建一个服务应用程序,得到一个服务器实例对象 var server = net.createServer(); var count = 0; // 3. 监听客户端的连接事件,连接成功就会执行回调处理函数 server.on('connection', function (socket) { count++; console.log('welcome, 当前在线人数:' + count); socket.write('remoteAddress' + socket.re...
'use strict' /* Global Imports */ import Debug from 'debug' import { Ticket, User } from '../models' import { Sequelize } from 'sequelize' /* Config vars */ const debug = new Debug('nodejs-hcPartnersTest-backend:db-api:ticket') export default { findAll: () => { debug('findAll Ticket') const tickets = Tick...
'use strict'; module.exports = (sequelize, DataTypes) => { const Coin = sequelize.define('Coin', { name: DataTypes.STRING, symbol: DataTypes.STRING, address: DataTypes.STRING, amount: DataTypes.DOUBLE(18,6), decimal: DataTypes.INTEGER, abi: DataTypes.TEXT }, { tableName: 'coin', comm...
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var VertexArrayObject = /** @class */ (function () { function VertexArrayObject(buffer, options) { if (options === void 0) { options = {}; } this._buffer = buffer; this._glContext = null; this._glVertexArray...
import { createLocalVue, shallowMount } from "@vue/test-utils"; import VueRouter from "vue-router"; import AppHeader from "@/components/AppHeader"; const localVue = createLocalVue(); localVue.use(VueRouter); describe("AppHeader component", () => { it("Should render correctly", () => { const wrapper =...
import Vue from 'vue' import App from './App.vue' import Header from './Components/Header_footer/Header' import Footer from './Components/Header_footer/Footer' Vue.component('app-header', Header) Vue.component('app-footer', Footer) Vue.directive('awesome', { bind(el, binding, vnode){ el.innerHTML = binding.va...
import React, { Component } from 'react'; import './App.css'; import KakaoLoginMaking from './component/KakaoLoginMaking'; import BibleFinder from './component/BibleFinder'; import BibleRemember from './component/BibleRemember'; import Signup from './component/Signup'; import SeparateSit from './component/SeparateSit';...
const mix = require('laravel-mix'); mix .js('resources/js/~Plugins/plugins.js', 'public/js/plugins.bundle.js') .js('resources/js/App/app.js', 'public/js/app.bundle.js') .js('resources/js/Login/app.js', 'public/js/login.bundle.js') .sass('resources/sass/vendors.scss', 'public/css/o...
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import utils from 'common/utils'; import './TextExt.scss'; const PREFIX = 'text-ext'; const cx = utils.classnames(PREFIX); let index = 0; class TextExt extends Component { componentDidMount() { this._text.style.position = 'absolute'; ...
import { Data } from '../../CharacterDataStructure' import * as SkillFunctions from '../../SkillFunctions' Data.functions.skill.ATBModifierTarget = (G, caster, target, params) => { target.current.progress += params.value; if (target.current.progress < 0) target.current.progress = 0; } Data.functions.skill.DamageTa...
import express from 'express'; import cors from 'cors'; import uuid from 'uuid'; const fakeCars = { _id: "60e5403569523a475aff3fbb", id: 97045, title: "Ferrari 246 dino GT 1973", makeId: 4400, price: 566, makeKey: "Ferrari", images: [ { uri: "https://particle...
const React = require('react'); module.exports = () => ( <div> <h3>ChannelList</h3> <ul> <li>#test</li> <li>#fun</li> </ul> </div> );
/** * Implement Gatsby's Node APIs in this file. * * See: https://www.gatsbyjs.org/docs/node-apis/ */ // You can delete this file if you're not using it /* eslint-disable @typescript-eslint/no-var-requires */ // @ts-check // const { fetchTeamsFromTBA } = require("./lib/apiFetches") // const { uniq } = require("ram...
var mongoose = require('mongoose'), Bid = mongoose.model('Bid'); function bidsController() { var _this = this; this.logout = function(req, res) { res.json({ future: 'logout' }); } this.bid = function(req, res) { console.log("bid--------",req.body) var b...
'use strict'; const scriptInfo = { name: 'Guess Sex', desc: 'Guess the sex of a user based on their chat history', createdBy: 'IronY' }; // Original concept credited to http://www.hackerfactor.com/GenderGuesser.php const _ = require('lodash'); const Models = require('bookshelf-model-loader'); const sampleSize = 1...
export { FloatingButton } from './FloatingButton'
const mongoose = require('mongoose'); const schema = mongoose.Schema; const codedefSchema = new schema({ code: Number, code_type: Number, definition: String, picture_url: String, }); mongoose.model('code_definition', codedefSchema);
"use strict"; const express = require('express'); const router = express.Router(); const comment = "Thanks for visiting my website!"; // GET home page router.get('/', (req, res) => { res.render('index'); }); // GET resume page router.get('/resume', (req, res) => { res.render('resume'); }); module.exports = router;
import *as ActionTypes from '../Action/types'; const intialState = { numa:1 }; export default(stateA=intialState,action)=>{ switch(action.type){ case ActionTypes.UPDATE_A:{ return{...stateA,numa:stateA.numa+action.payloadA} } default: ...
/* 🤖 this file was generated by svg-to-ts*/ export const EOSIconsEscalatorWarning = { name: 'escalator_warning', data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 7.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5S17.83 8 17 8s-1.5.67-1.5 1.5...
import { Map } from 'immutable'; import { LOAD_CALENDAR_EVENTS, LOAD_EVENTS_SUCCESS, LOAD_EVENTS_FAILURE } from '../actions/activities'; import { getToken } from '../../services/utility'; const initState = new Map({ isLoading: false, events: null, error: false }) /** * * @function * Cette fonction est un ...
/***** Todo: -place byte with certain endian -can have a breakpoint return byte, and any input into the 'return' function will write to that byte -string and bytes Why does gameboy 'catch up' after breakpoint? For holding down keys, only the last key is repeated -use timeout loop instead? -doesnt work properly whe...
"use strict"; require.config({ baseUrl: "../static/js", paths: { layui: "libraries/layui/layui", jquery: "libraries/jquery" } }); require(["jquery", "layui"], function ($) { const formatNum = n => { n = n.toString(); return n[1] ? n : '0' + n; }; const formatTime = date => { const yea...
import { mapState, mapActions } from 'vuex'; import _ from 'lodash'; import editTable from '@/components/edit-table'; export default { data() { return { keyword: '', isValid: false, loading: false, pageSize: 10, pageSizes: [10, 20, 30, 50, 100], dataToUpdate: null, edit...
import React from 'react'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import { compose } from 'redux'; // import get from 'lodash.get'; import { Button, Form, Input, Select, Col, Row } from 'antd'; import buttonStyle from '../../antdTheme/button/style/index.less'; import formStyle from '../../ant...
import { queryObjToString } from "github-query-validator"; import { SEARCH_RESULTS, UPDATE_LICENSE, UPDATE_FORK_SELECTION, UPDATE_SEARCH_STATUS } from "./types"; function parseResponse(repos) { return repos.map( ({ fork, stargazers_count, html_url, name, license, owne...
'use strict'; /** * Module Dependencies. */ var _ = require('lodash'); var options = ["limit", "skip"], idRegExp = /^[0-9a-fA-F]{24}$/g, helper; module.exports = exports = helper = {}; helper.merge = function(body, query) { _.merge(body, query, function(a, b) { if (_.isArray(a)) { ...
const express = require('express'); const router = express.Router(); const Repository = require('../models/repository.js'); router.get('/get', async (req, res) => { try { const repositories = await Repository.find({}); return res.status(200).json({ success: true, repositories }); } catch (error) { re...
module.exports = function(grunt) { grunt.initConfig({ pkg : grunt.file.readJSON('package.json'), cssmin: { options: { banner: '/* <%= grunt.template.today("yyyy-mm-dd HH:MM") %> */' }, combine: { files: { 'assets/css/publish-min.css':[ 'assets/css/reset....
exports.questions = [ { full: 'Twas the night before Christmas', cloze: 'Christmas' }, { full: 'The standard way to create an object prototype is to use an object constructor function', cloze: 'constructor' }, { full: 'With a constructor function, you can use the new keyword to create new objects from t...
import React from 'react'; import { Navbar } from 'react-bootstrap'; import { Link } from 'react-router-dom'; //component to create the home button which links to the app's homepage. visible on all app screens const HomeButton= () => ( <Navbar> <Navbar.Header> <Navbar.Brand> <Link className="homeBu...
import React, {Component} from 'react'; import './NERTagging.css'; class NERTagging extends Component { state = { visible: false, }; componentDidMount() { document.addEventListener('contextmenu', this._handleContextMenu); document.addEventListener('click', this._handleClick); ...
Router.configure({ layoutTemplate: 'layout', loadingTemplate: 'loading', notFoundTemplate: 'notFound', waitOn: function() { return [Meteor.subscribe('notifications')] } }); BookmarksListController = RouteController.extend({ template: 'bookmarksList', increment: 50, bookmarksLimit: function() { ...
import { createStore, applyMiddleware, compose } from 'redux'; import persistState from 'redux-localstorage'; import rootReducer from './reducers'; const initialState = {}; const middleware = []; const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; const composedEnhancers = composeEnhance...
import createQueue from 'shared/bull/create-queue'; export const addQueue = (name, data, opts) => { const worker = createQueue(name); return worker.add({ ...data }, { ...opts }); }; export const createJob = ( name, // name of the job ) => { try { console.log(`New job initiated: ${name}`); return add...
const API_DOMAIN = "https://tny.ie/api" export const APIReq = async (path, method, body) => { const apiKey = localStorage.getItem("token") let request if (apiKey === null) { request = await fetch(API_DOMAIN + path, { method: method, mode: 'cors', headers: { ...
import React, { Component } from 'react'; import { Form, Card, Row, Col, } from 'react-bootstrap'; class RadioCheckInPanel extends Component { constructor(props, context) { super(props, context); this.state = { disabledComboBox: false, }; } onChangeTeste = (e, setFieldValue) => { setFie...
function getCookie(key) { key += '='; let decoded_cookie = decodeURIComponent(document.cookie); let cookie_array = decoded_cookie.split(';'); for (let iii = 0; iii < cookie_array.length; ++iii) { let each_entry = cookie_array[iii]; while (each_entry.charAt(0) == ' ') each_entry = each_...
import { RestService } from '../../services/rest'; import { serviceOptions } from '../../services/serviceOptions'; export function pyrest(options) { var inst = new RestService(); serviceOptions(inst, 'pyrest', options); inst.getCurrentBlockHeight = getCurrentBlockHeight; return inst; } function get...
import styled from 'styled-components'; export const StyledSection = styled.section``; export const StyledFirstSection = styled.section` background-image: url('https://woojoo.s3-us-west-1.amazonaws.com/bg4.webp'); height: 80vh; background-repeat: no-repeat; background-size: cover; display: flex; ...
const modes = { bus: "bus", tube: "tube" }; const maxFare = 3.2; class Trip { constructor(card) { this.zonesTravelled = []; this.fare = 3.2; this.card = card; this.mode = ""; } enterFrom(station, mode) { if (this.card.balance > this.fare) { this.zonesTravelled.push(...findZone(station))...
/* global describe, it, expect */ /* jshint expr: true */ var WindowsLiveStrategy = require('../lib/strategy') , chai = require('chai'); describe('Strategy', function() { describe('constructed', function() { var strategy = new WindowsLiveStrategy({ clientID: 'ABC123', clientSecret: 'secret...
import React, { Component } from 'react'; import 'bootstrap/dist/css/bootstrap.min.css'; class Test extends Component{ constructor(props){ super(props); this.onDellEvent = this.onDellEvent.bind(this); } onDellEvent(event){ this.props.onDell(event); } render(){ retur...
import React,{useState} from 'react'; import '../index.css'; import axios from 'axios'; import { Card, Form, Button, Alert,Nav, Navbar,NavLink} from 'react-bootstrap'; import { Redirect } from "react-router-dom"; import logo from "./images/freelancerlogo.png"; function Login(props){ const[state,setState]=u...
// import React from 'react' import ProjectItem from "./ProjectItem"; import projects from "../data.js"; function ProjectList() { // const projectItems = projects.map(project => { // return ( // <ProjectItem // name={project.name} // about={project.about} // image={project.image} // ...
addLoadEvent(exercise); function exercise() { var btn1 = document.getElementById('btn1'); var bt2 = document.getElementById('btn2'); var label = document.getElementById('label').getElementsByTagName('h1')[0]; if(btn1) { btn1.addEventListener('click', function() { moveEle('picwall', {'desX': -773, 'desY': 0}); ...
import { Notify } from 'quasar' // import { firestoreAction } from 'vuexfire' // import User from '../../models/User.js' // import { createPusherUser } from '../../services/pusher' // export const addUserToUsersCollection = async (state, userRef) => { // const user = new User({ // email: state.email // }) // ...
var tnt_theme_track_buttons = function() { var factor = 0.2; var gBrowser; var path = tnt.utils.script_path("buttons.js"); var theme = function(gB, div) { gBrowser = gB; var control_panel = d3.select(div) .append("div") .attr("id", "tnt_buttons_controlPanel") .style("margin-left", ...
/* eslint-disable */ const { spawn } = require('child_process'); const { Buffer } = require('buffer'); const ls = spawn(/^win/.test(process.platform) ? 'npx.cmd' : 'npx', [ 'craco', 'start', ]); ls.stdout.on('data', data => { console.log(`${data}`); if (data.toString().includes('To ignore, add') || data.toSt...
//index.js //获取应用实例 const app = getApp() Page({ data: { scrollTop: 100, array: [{ msg:'你好', time:'yesterday', text:'Anna', icon:'../../image/1.jpg' },{ msg: '在吗', time: 'today', text: 'Bill', icon: '../../image/2.jpg' }, { msg: '请问你', ...
/** * * @author Anass Ferrak aka " TheLordA " <[email protected]> * GitHub repo: https://github.com/TheLordA/Instagram-Clone * */ import React, { useState, useContext } from "react"; import { Link, useHistory } from "react-router-dom"; import AuthenticationContext from "../contexts/auth/Auth.context"; import...
angular.module('iCanHelp') .directive('emailUnique', function () { return { restrict: 'A', require: 'ngModel', link: function (scope, element, attr, ctrl) { ctrl.$parsers.push(function (viewValue) { // set it to true here, otherwise it...
/* * Controller *************/ // Import module // const dateformat = require('datformat') // Import de model const User = require('../DB/models/User') const bcrypt = require('bcrypt') module.exports = { // Method put editOne: (req, res) => { let boolAdmin = false let boolVerified = false ...
// Code generated by coz. DO NOT EDIT. /** * Done page of the-components * @module the-done */ 'use strict' import TheDone from './TheDone' import TheDoneStyle from './TheDoneStyle' export { TheDone, TheDoneStyle, }
import { convertPercentHrToTime } from "../helpers/convertPercentHrToTime"; test("Convert the hours work to a workable time input", () => { expect(convertPercentHrToTime(8)).toBe("08:00"); expect(convertPercentHrToTime(8.5)).toBe("08:27"); expect(convertPercentHrToTime(10.6)).toBe("10:33"); expect(convertPerce...
import Config from './config.js'; export default class Report { constructor(instance) { this.JSON = {}; this.instance = instance; this.canvas = window.canvas || document.querySelector('#canvas'); } create() { this.JSON = { filename: Config.appname, d...
import React from "react" import { FaSearch } from "react-icons/fa" import livLogo from "../assets/images/Liv-Logo-New.png" import giantLogo from "../assets/images/Giant-Logo-New copy.png" import navLinks from "../constants/navlinks" import { Link } from "gatsby" const Navbar = ({ isOpen, toggleSidebar }) => { retur...
const Hotel = require("../../models/emodels/Hotel"); const errorWrapper = require("../../helpers/error/errorWrapper"); const CustomError = require("../../helpers/error/customError"); const getAllHotels = errorWrapper(async (req, res, next) => { return res.status(200).json(res.advanceQueryResults); }); const getHot...
var path; var hitOptions = { segments: true, stroke: true, fill: true, tolerance: 5 }; var textItem = new PointText({ content: 'Click and drag to draw a line.', point: new Point(20, 30), fillColor: 'black', }); //The dot var path = new Path.Circle(new Point(5, 5), 2); path....
(function() { 'use strict'; angular.module('veegam-trials') .service('projectsSvc', projects); projects.$inject = ['httpservice', 'apiUrl', 'utilsService']; function projects(httpservice, apiUrl, utilsService) { var self = this; apiUrl = apiUrl + "/project-service"; sel...
//META { "name": "SelectionDefinition" } *// var SelectionDefinition = (function() { class SelectionDefinition { constructor() { this.stylesheet_name = "sd-stylesheet"; this.stylesheet = ` .sd-popup {position: absolute; white-space: pre-line; color: white; background: rgba(50, 50, 50, 0.7); padding: 6px; ...
import styled from '@emotion/styled'; export const Input = styled.input` padding: 5px 10px; margin-right: 20px; border: 1px solid black; border-radius: 4px; `; export const Btn = styled.button` padding: 5px 10px; border: 1px solid black; border-radius: 4px; `;
/* Returns the the radian value of the specified degrees in the range of (-PI, PI] */ export function degToRad(degrees) { var res = (degrees / 180) * Math.PI; return res; } /* Returns the radian value of the specified radians in the range of [0,360), to a precision of four decimal places.*/ export function rad...
const ShopActionTypes = { FETCH_COLLECTIONS_START : 'FETCH_COLLECTIONS_START', FETCH_COLLETIONS_SUCCESS : 'FETCH_COLLETIONS_SUCCESS', FETCH_COLLETIONS_FAILURE : 'FETCH_COLLETIONS_FAILURE' }; export default ShopActionTypes;
import * as dynamoDbLib from "./libs/dynamodb-lib"; import { success, failure } from "./libs/response-lib"; export async function main(event, context, callback) { const params = { TableName: "DynamoDBNotifications", KeyConditionExpression: "RecipientId = :RecipientId", ExpressionAttributeValues: { ...
const ROT = require('rot-js'); const Game = function(options = {}) { this.options = options; this.display = null; this.currentScreen = null; this.screenMap = {}; this._init(options); }; Game.prototype._init = function _init(options) { this.display = new ROT.Display(options); this._bindEven...