text
stringlengths
7
3.69M
/** * File Description: User Manager, Where actual business logic exists related to users signup, login etc. */ const mongoose = require('mongoose'); const passwordHash = require('../common/helpers/password_hash'); const config = require('../config/index'); /** * function to validate user credentials * @param {*...
'use strict'; const rank = require("../models/rank"); module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.createTable('user', { uuid: { allowNull: false, primaryKey: true, type: Sequelize.UUID, unique: true }, email: { allo...
const navBtn = document.querySelector(".navigation__button"); const navList = document.querySelector(".navigation__wrapper"); const menuLinks = document.querySelectorAll('.navigation__link'); navBtn.addEventListener("click", function (evt) { evt.preventDefault() navBtn.classList.toggle("navigation__button--clo...
const example = "Eu, Fulano, CPF 123.234.345/56, casado com Beltrana, CPF 234.345.456/67, gostaria de solicitar o registro do imóvel adquirido de Sicrano, CPF 345.456.567/78." const removeCPF = (str) => { const regex = /[0-9]{3}\.?[0-9]{3}\.?[0-9]{3}\/[0-9]{2}/g; return str.replace(regex, 'xxx') } removeCPF(examp...
import React, { Component } from 'react'; class EventForm extends Component { render() { return ( <div> <h1>Create an Event</h1> <form onSubmit={this.props.submitEvent}> <div > <div className="form-group col-md-3"> ...
#!/usr/bin/env node require('source-map-support').install() require('../dist/src/server')
self.__precacheManifest = [ { "revision": "242d588634eddc3837dc", "url": "/static/css/main.50c70593.chunk.css" }, { "revision": "242d588634eddc3837dc", "url": "/static/js/main.8c69cc59.chunk.js" }, { "revision": "42ac5946195a7306e2a5", "url": "/static/js/runtime~main.a8a9905a.js" }, ...
var searchData= [ ['bbox_2eh',['BBox.h',['../BBox_8h.html',1,'']]], ['build_2etxt',['build.txt',['../build_8txt.html',1,'']]] ];
const { CommentRef, Wobj, User, Post: PostRepository, } = require('models'); const { Post } = require('database').models; const { postsUtil } = require('utilities/steemApi'); const _ = require('lodash'); /** * Get wobjects data for particular post * @param author {String} * @param permlink {String} * @returns {P...
$(function () { var $item = $(".cj"), $change = $("#change"), //显示剩余机会 $btn = $("#btn"), //开始抽奖按钮 $dialogCon = $('.dialog-wrap1 .con'), $record = $('#record'), $strs = '', lottery = { count: 0, //抽奖次数 bool: true, // 是否可点击 ...
var momentString = require('./momentString'); var moment = require('moment-timezone'); var FlightView = function(flight){ this.flight = flight; this.title = document.createElement('h2'); this.title.innerText = flight.departure + "-" + flight.arrival; this.times = document.createElement('p'); this.times.inner...
import * as Facebook from "expo-facebook"; import axios from 'axios'; import {User} from "./User"; export const LOGIN = "login"; const loginSet = (user) => ({type : LOGIN, user}); const appId = "510959942798496"; // const appSecret = "3d8b00d03544530d8c195afae15294ff"; export default class LoginAction { construct...
months=['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']; var current_year = (new Date).getFullYear(); var current_month = (new Date).getMonth(); var month_view = current_month; var year_view = current_year; function get_content() { console.log('ahi va'); $.post('partials/invoicing_...
import React, { useEffect, useState } from "react"; import { useAsyncFn } from "react-use"; import { Card, Space, Typography, Skeleton, Layout, notification, Row, Col, } from "antd"; import { fetchApi } from "../utils/fetch"; const { Title } = Typography; const spaceStyle = { width: "100%", backg...
export default { async login({ commit }, { id, password }) { const { data } = await this.$axios .post('/activestreamhc/login', { id, password, }) .catch((err) => { return err.response }) console.log(data) if (!data.message) { commit('SET_USER', data) ...
import React, { useState, useEffect, useContext } from 'react'; import ContentContainer from '../components/content-container/content-container.component'; import SearchBar from '../components/search-bar/search-bar.component'; import DataModal from '../components/data-modal/data-modal.component'; import PageContainer ...
function toggleHiddenClass(className, status){ /* status \in {hidden, ''} */ var classArr = document.getElementsByClassName(className); if (classArr.length > 0){ for (i=0; i < classArr.length; i++){ classArr[i].setAttribute('type', status); } } } function check_...
import ajax from './api'; export default { deleteFeedback(vm, id) { return ajax(vm, { method: 'DELETE', url: '/cms/feedback/removeFeedBacks/' + id }); } };
import { html, nothing } from "./../../../node_modules/lit-html/lit-html.js"; let teamTemplate = (team) => html` <article class="layout"> <img src=${team.logoUrl} class="team-logo left-col"> <div class="tm-preview"> <h2>${team.name}</h2> <p>${team.description}</p> <span class="details">...
/** * Router 的子模块自动化引入 * 对于不想注册的路由配置模块,可手动添加验证条件,如: * && key != './demo.js' * */ const files = require.context('./', true, /\.js$/) let configRouters = [] files.keys().forEach(key => { if (key !== './index.js' && key !== './enterprise-info-items.js') { configRouters = configRouters.concat(files(key).defaul...
import { combineReducers } from 'redux'; import { articulos } from './articulo'; const myApp = combineReducers({ articulos }); export default myApp;
export function processSize(size) { return !/^\d+$/.test(size) ? size : `${size}px`; }
var express = require('express'); // requre the express framework var app = express(); var fs = require('fs'); //require file system object // Endpoint to Get a list of users app.get('/', function (req, res) { fs.readFile(__dirname + "/data.json", 'utf8', function (err, data) { res.end(data); // you can a...
$(document).on("ready",function(){ $('#btnAgregar').click(clickenviar); $('#text-comentario').keypress(EnterTexto); var lista= document.getElementById("lista-productos").children; for (var i = 0; i < lista.length; i++) { lista[i].getElementsByClassName("simbolo")[0].addEventListener("click"...
// ==UserScript== // @name AIDungeon Keyboard Hotkeys // @namespace https://github.com/duke1102/aidungeon-kh-user // @version 0.1 // @description Some useful often needed keyboard hotkeys during gameplay // @author duke1102 // @match https://play.aidungeon.io/main/adventurePlay* // @grant ...
import React, {Component} from 'react'; import CountUp from 'react-countup'; import VisibilitySensor from 'react-visibility-sensor'; export default class AboutTwo extends Component { constructor(){ super() this.state = { startCounter: false } } onVisibilityC...
import { observable, action } from "mobx"; import axios from 'axios'; class MovieStore { @observable.ref movies = []; @observable.ref isFetching = false; @observable.ref error = false; @action async fetchMovies() { this.isFetching = true; this.error = null; try { const response = await axi...
import Vue from "vue"; import App from "./App.vue"; import router from "./router"; import store from "./store"; import "amfe-flexible/index.js"; import MainTabbar from "./components/MainTabbar.vue"; import axios from "axios"; import VueTouch from "vue-touch"; import VueCookies from 'vue-cookies' import { Button, Ta...
import { SplitText } from "gsap/SplitText"; import { gsap } from "gsap"; export function introAnimation(){ // var mySplitText = new SplitText("#quote", {type:"chars, words"}), // tl = new TimelineLite(), // numChars = mySplitText.chars.length; var tl = gsap.timeline(), mySplitText = new SplitText...
import {infoLinksList, infoLinksListTitle, infoLinksListItems, infoLinksListItem, infoLinksListLink} from '../../components/InfoLinksList/InfoLinksList.module.scss'; import { NavLink } from 'react-router-dom'; export const InfoLinksList = ({title, linkName}) => { return ( <div className={infoLinksList}> ...
import React from 'react'; import { Input, Panel, Button, Navbar, NavBrand, Nav, NavItem, NavDropdown, MenuItem } from 'react-bootstrap'; class TestRail extends React.Component { render() { return ( <div> <h1 className="header">Dashboard</h1> <p>Get all data from TestRail in Excel format:</...
import * as ActionTypes from './types'; export const registerUser = (userInfo) => { return { type: ActionTypes.REGISTER_USER, payload: userInfo, }; }; export const loginUser = (userInfo) => { return { type: ActionTypes.LOGIN_USER, payload: userInfo, }; }; export const logOut = () => { return...
import { GraphQLObjectType, GraphQLInt } from 'graphql' const DeleteUserType = new GraphQLObjectType({ name:'deleteUser', fields:{ success:{ type:GraphQLInt, resolve:parentValue => parentValue } } }) export default DeleteUserType
const ip = require("../nettools").getIPAdress(); module.exports={ eggExtend:{ /** * 微服务名称 */ name: "default", /** * 注册中心地址 */ discovery: { serverAddr: "127.0.0.1:8848", namespace: "public" }, /** * ...
var _writer = null; $(function() { _writer = new Writer($("#writer-canvas")); _writer.start(); })
import React from "react"; import { Link } from "react-router-dom"; const LogInBtn = (props) => ( <Link to="/Dashboard"> <button onClick={props.handleFormSubmit} type="button" className="btn btn-secondary">Log in</button> </Link> ); export default LogInBtn;
import React, { Component } from 'react'; import { View, ScrollView, SafeAreaView } from 'react-native'; import {Container, Header, Left, Right, Icon, Button, Body, Title} from 'native-base'; import LinearGradient from 'react-native-linear-gradient'; import Carousel, { Pagination } from 'react-native-snap-carousel'; im...
import React from 'react'; import {Alert, View, Text, StyleSheet, Linking} from 'react-native'; import {getAPIVersion} from '../services'; const rowComponent = (title, attribute) => { return ( <View> <Text style={Body.title}>{title}</Text> <Text style={Body.text}>{attribute}</Text> </View> ); ...
import { RECEIVE_TOKEN_SUCCESS } from '../actions/home'; const token = (state = { fetching: true }, action) => { switch (action.type) { case RECEIVE_TOKEN_SUCCESS: return { ...action.data, fetching: false, }; default: return state; } }; export default { token, };
lyb.parse(); var gender = {'M': '男', 'F': '女'}; lyb.ajax(ctx + 'member/info/personal', { type: 'get', dataType: 'json', success: function (result) { if (result.success) { var data = result.data; if(data.headimgurl) document.querySelector('#headImgUrl').src = ...
// @flow import * as React from 'react'; import { connect } from 'react-redux'; import { type Dispatch } from 'redux'; import { select } from '../store'; import { ConnectionGate } from '../ConnectionGate'; import { clear, createConversation, globalSearchByTerm, searchConversationsByTerm, searchConversations...
const app = require('../server/index.js') const supertest = require('supertest') const request = supertest(app) describe('Sample Test', () => { it('should test that true === true', () => { expect(true).toBe(true) }) }); describe('Test the root path', () => { test('It should respond to GET request with statu...
import React, { Component } from "react"; import "./index.css"; import { TabedContainer, DepositTab, WithdrawTab, BetsTab, SecurityTab, SettingsTab, AffiliatesTab, AccountTab, WalletTab, WalletIcon, SettingsIcon, DepositsIcon, WithdrawIcon, RefferalIcon, BetsIcon, UserIcon, UsersIcon, ConfirmedIcon ...
import React from "react"; import Square from "./Square"; class Board extends React.Component { renderSquare(i) { return ( <Square value={this.props.squares[i]} onClick={() => this.props.onClick(i)} strcolor={this.props.strcolor[i]} /> ); } render() { //憨憨第一次尝试 ...
import React, { Component } from 'react'; import { Link } from "react-router-dom"; import './home.css'; import { isMobileOnly, isTablet } from "react-device-detect"; class Heading4 extends Component { render() { const { label, hrLine, data, showEditDelete, onDelete, profile, userAvailable, showDropdown } = this.p...
import zhLocale from "element-ui/lib/locale/lang/zh-CN" //引入element语言包 const fenlanyu = { "menu": { "jilu": "Kirjaa", "wenxunjilu": "Tiedustelun tietue", "biaodanxiangqing": "Lomakkeen yksityiskohdat", "guanquguanli": "Guanin alue", "guanquliebiao": "Tullin hallinto", "guanyuanguanli": "Tullin virk...
function hasTeen(a, b, c){ if (a > 12 && a < 20 || b > 12 && b < 20 || c > 12 && c < 20 ) { return true; } return false; }
var x = 1; function a() { var x = 2; console.log("a ->" + x); b(); d(); function d() { console.log("d ->" + x); } } function b() { var x; console.log("b ->" + x); c(); } function c() { console.log("c ->" +x); // refer to lexical environment // value will be o...
import firebase from "firebase/app"; import "firebase/firestore"; import "firebase/auth"; import cookies from "../json/cookie.json" // INITIALIZE FIREBASE const firebaseConfig = { apiKey: process.env.REACT_APP_FIREBASE_API_KEY, authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN, databaseURL: process...
(function(angular) { 'use strict'; // Referencia para o nosso app var app = angular.module('app'); // Cria o controlador de autenticação app.controller('AuthController', ['$scope', 'User', function($scope, User) { // Redireciona para a página autenticada var user = User.getAuthenticated(); if (user && u...
msgdlzklib = {}; msgdlzklib.columnManager_tooltip = 'Správce sloupců'; msgdlzklib.sortManager_tooltip = 'Správce řazení'; msgdlzklib.filterManager_tooltip = 'Správce filtrů' ; msgdlzklib.resetFilters_tooltip = 'Vymazat filtry' ; msgdlzklib.resetAll_tooltip = 'Vymazat filtry a vrátit původní nastavení' ;
const Benchtable = require('benchtable'); const suite = new Benchtable(); const kTesters = [{ name: 'sse4_crc32c_hw', calculate: require('sse4_crc32').sse42_crc, }, { name: 'sse4_crc32c_sw', calculate: require('sse4_crc32').table_crc, }, { name: 'js_crc32c', calculate: require('../impls/js_crc32c').calcul...
const checkSigninForm = async () => { let username = $("#signin-username").val(); let password = $("#signin-password").val(); if(username=='' || password=='') { // warn that not all information is there return; } let user = await query({ type:'check_signin', params:[username,pas...
import React, {Component} from 'react'; import {View, TouchableOpacity, FlatList, Text, ScrollView, StyleSheet} from 'react-native'; import { getStations } from '../services/FetchStations'; import {ListItem, Icon} from 'react-native-elements' import { withNavigation } from 'react-navigation'; class SearchResults ext...
import React from 'react'; const App = (props) => ( <h1>Login</h1> ); export default App;
import React from 'react' import { MDBRow, MDBCol, MDBView, MDBCard, MDBCardBody, MDBTable, MDBTableHead, MDBTableBody, MDBIcon, MDBBreadcrumb, MDBBreadcrumbItem, MDBFormInline, MDBBtn } from 'mdbreact'; import Spinner from '../Spinner' export default function SpeciesPage({ result_specie, isLoading }) { return isLoad...
import React, { Component } from 'react'; import { Table } from 'react-bootstrap'; import axios from 'axios'; function AnalysisRow(props) { const { res } = props return ( <tr> <td>{res.res} : {res.index}</td> <td> {!!res.notaLink && (<a href={"http://notabenoid...
import React from 'react'; import './App.css'; import { HashRouter as Router, Route, Redirect } from 'react-router-dom'; import CreateEvent from './CreateEvent'; import UserShow from './UserShow' import LandingContainer from './containers/LandingContainer' import NavBar from './components/NavBar' const App = () => { ...
var timesThroughQuestionsLoop = 0; var index = 0; var questions = []; var results = { correct: 0, total: 0 } var getMoreQuestions = new Promise((resolve, reject) => { var questionsUrl = '/questions/1'; spinnerUp(); $.get(questionsUrl, function(retrievedQuestions){ spinnerDown(); resolve(retrievedQues...
import React from "react"; import { withRouter } from 'react-router-dom'; const VideoCard = (props) => { function goToVideo(){ props.history.push("video?v=" + props.video.id); } return ( <div className="video-card" onClick={goToVideo}> <div className="video-thumbnail"> ...
import React, { Component } from "react"; import RaisedButton from "material-ui/RaisedButton"; import axios from "axios"; import { withRouter } from "react-router-dom"; class LoginButton extends Component { constructor(props) { super(props); this.state = { loggedIn: false }; this.handleLogin...
import React from 'react'; function CardOneUnActive(props) { return ( <div className="STwo-cardsection-Fitter"> <div className="cardOnePicture"> <img src={props.CardOneUnActiveImage} alt="" /> </div> <div className="cardOneTitel"> <h4>{props.CardOneUnActiveTitel}</h4> </div> </div>...
const { assert } = require("chai"); const { calculateEntityTreeReferences, sortByDependencyCount, resolveEntityReferences, ReferenceNameNotFoundError } = require("../src/commands/seed/utils"); describe("Seed Utils", () => { describe("calculateEntityTreeReferences", () => { it("should not modify tree wit...
var ipAddress = "10.12.160.168"; var sensorConnections = [ //new WebSocket("ws://" + ipAddress + ":8003"), //new WebSocket("ws://" + ipAddress + ":8002"), new WebSocket("ws://" + ipAddress + ":8001") ]; function startRecord(){ $.get('/startRecord', function(data){ console.log(data); var data = JSON.parse(dat...
/** * Created by Maxim on 27/10/2014. */ var mongoose = require('mongoose') , Schema = mongoose.Schema; var NieuwsitemSchema = new Schema({ text: {type: String, required: false, default: ""}, image: {type: String, required: false}, title: {type: String, required: false, default: ""}, createdOn: {type...
'use strict'; function solve(R, C) { const [r, c] = [R - 1, C - 1]; const galaxy = Array(R).fill(null).map((row, i) => Array(C).fill(null).map((col, j) => r + c + Math.min(i, j) + Math.min(r - i, c - j) + Math.min(i, c - j) + Math.min(r - i, j) )); let [x, y] = [0, 0]; for (let i = 0; i < R; i++) { ...
// module.exports = { // module: { // rules: [ // { // test: /\.js$/, // exclude: /node_modules/, // use: { // loader: "babel-loader" // } // } // ] // } // }; switch (process.env.NODE_ENV) { case 'prod': case 'production': module.exports = requ...
'use strict'; /** * @ngdoc service * @name laoshiListApp.cities * @description * # cities * Service in the laoshiListApp. */ angular.module('laoshiListApp') .constant('cities', [ { 'en':'Aksu', 'zh':'阿克苏市' }, { 'en':'Alashankou', 'zh':'阿拉山口市' }, { 'en':'Altay', ...
import React from 'react' import ReactDOM from 'react-dom' import Results from './Results' const mockProps = { median: [3], getResultText: jest.fn() } test('renders without crashing', () => { const div = document.createElement('div') ReactDOM.render(<Results {...mockProps} />, div) ReactDOM.unmountComponent...
const path = require('path') module.exports = { rootDir: process.cwd(), testEnvironment: 'node', testMatch: ['**/tests/**/*.test.js'], }
(function(window, document) { if(window.ribbonModalLoaded) { //avoid issues if script is loaded twice return; } window.ribbonModalLoaded = true; var ajax_interval; // var iframes_loaded = new Array(); var hide_iframe_submitted = false; var product_id; window.addEventListener( '...
import { Menu } from 'antd'; import { removeToken } from '@utils/auth'; import { Link } from 'react-router-dom'; import ApiMap from '@api/index'; function HeaderOverlayMenu(props) { const { history ,location } = props; const list = [ { name: '个人中心', path: '/userCenter', type: 'go' }, { name:...
import React, {PureComponent} from 'react' import * as actions from './actions' import {connect} from 'react-redux' import {Text, TouchableOpacity, View, TextInput, Button, Image, FlatList, Animated, KeyboardAvoidingView } from 'react-native' import FeedComp from './FeedComp' import FeedComment from './FeedComment' imp...
/* * To run this test : livre/fiche/saving */ function livre_fiche_saving() { my = livre_fiche_saving my.specs = "Test de la sauvegarde des fiches" my.step_list = [ ["Préparation du test", FicheSave_Prepare_test], ["Méthodes et propriétés utiles", FicheSave_Methodes_et_properties], ["Dossiers et fic...
(function () { 'use strict'; var app = angular .module('controllersModule') .controller('ResponsibleController', ResponsibleController); ResponsibleController.$inject = ['$location', '$window', '$rootScope', '$scope', '$timeout', '$modal', 'FlashService', 'modalService', 'ResponsibleSrvc'];...
Page({ data: { role: 0, title: '暂无群组', projects: [], myGroups: [] }, onShareAppMessage: function () { if (!parseInt(getApp().globalData.groupId) || !parseInt(getApp().globalData.role)) { return } var str = '点击链接,加入' + this.data.title ...
import React from 'react'; const Item =({itemImage})=>{ // console.log({itemImage}) return ( <div> <div className="col-sm-6 col-md-3"> <div className="thumbnail thumbnail-custom"> <img src={itemImage} alt="test"/> <div className="tex...
import React, { Component } from 'react' import { View, Text, Button } from 'react-native' import CardView from './CardView' class QuizView extends Component { state = { index: 0, numCorrect: 0, numIncorrect: 0 } showNextView = () => { if(this.state.index + 1 >= this.props.deck.cards.length) { ...
/** * server.js * (C) Nick Rabb 2016 * Nick Rabb <nrabb@outlook.com> * The main server file for Nick Rabb's Public REST * API. */ /*jslint node:true */ 'use strict'; // VARIABLES // ====================================== var db = require('./src/mysql-connect.js'); var express = require('express'); va...
import React, { useRef } from 'react'; import PropTypes from 'prop-types'; import { createPropTypes } from '@styled-system/prop-types'; import styled from 'styled-components'; import { maxWidth } from 'styled-system'; import FocusLock from 'react-focus-lock'; import { Transition } from 'react-transition-group'; import ...
define(['src/util/ui', 'lodash'], function (ui, _) { return async function createSample(roc, allGroups) { const storageKey = 'eln-new-sample-default-groups'; var entrysample = { $content: {} }; var data = { allGroups }; var toFill = { group: {} }; const allGroupNames = allGroups.map((g) => g.name)...
/* global jstz */ $(document).ready(function () { $('#timezone-offset').val((-new Date().getTimezoneOffset() / 60)); $('#timezone').val(jstz.determine().name()); // only enable the submit button once we are sure that the timezone is set var $loginForm = $('form[name="login"]'); if ($loginForm.length) { $l...
const moduleName = require('./egenModule'); const name = moduleName.name.sayName('Max'); console.log(name); const age = moduleName.name.showAge(33); console.log(age); const calculate = moduleName.name.calc(10, 10); // 100 console.log(calculate); const average = moduleName.name.genomSnitt(12345, 54321); console....
export const FETCH_RANKING_PENDING = "FETCH_RANKING_PENDING"; export const FETCH_RANKING_SUCCESS = "FETCH_RANKING_SUCCESS"; export const FETCH_RANKING_ERROR = "FETCH_RANKING_ERROR"; const API_URL = "https://us-central1-csgo-stats-457a9.cloudfunctions.net/ranking"; function fetchRankingPending() { return { typ...
import Validator from "../helpers/validator"; export const POST_BLOG_DETAILS = "POST_BLOG_DETAILS"; export const FETCH_BLOGS = "FETCH_BLOGS"; export const UPDATE_BLOG_DETAILS = "UPDATE_BLOG_DETAILS"; export const DELETE_BLOG = "DELETE_BLOG"; export function loadBlogs(result) { return { type: FETCH_BLOGS, pay...
function Näytä() { }
// Imports // =========================================================================== // ### Deps ### import lodash from 'lodash'; import fp from 'lodash/fp'; // Definitions // =========================================================================== /** * Our very own version of Lodash that we can proceed ...
"use strict" let chcs = (function(){ let t_string = { type: "string", }; let t_bool = { type: "bool", variants: ["false", "true"], }; let t_color = { type: "color", }; let t_float = { type: "float", }; let t_int = { type: "int", }; let t_key = { type: "key", }; let t_region = { type: "enum...
import React, { useState, useEffect, useRef, useMemo } from 'react'; import Resizer from './Resizer'; function ResizablePanels (props) { /*const [state, setState] = useState({ panelsSize: props.panelsSize, resizing: false });*/ const [ resizing, setResizing ] = useState(false); const [ currentPanel, ...
// @flow import * as React from 'react'; import { View } from 'react-native'; import { Translation } from '@kiwicom/mobile-localization'; import { Text, Switch, StyleSheet } from '@kiwicom/mobile-shared'; import { defaultTokens } from '@kiwicom/mobile-orbit'; type Props = {| +remember: boolean, +onRememberCardCha...
const GtfsRealtimeBindings = require('gtfs-realtime-bindings'); const request = require('request'); const fs = require('fs'); const config = JSON.parse(fs.readFileSync('config.json', 'utf8')); const admin = require('firebase-admin'); const serviceAccount = require('./serviceAccountKey.json'); admin.initializeApp({ c...
// test_setSampleData2deviceList.js // 2017.08.18 let deviceList = { "GeneralLighting_1": { "ip": "192.168.50.5", "eoj": "0x013001", "protocol": "ECHONET Lite", "manufacturerNameJa" : "神奈川工科大学", "manufacturerNameEn" : "Kanagawa Institute of Technology" }, "GeneralLighting_2": { ...
import test from "ava"; import Arena from "../../server/arena.js"; import { createPlayer, createMatch } from "../../server/game.js"; import { connectTestRedis, createFakeGames, createFakePlayers, } from "../_setup.js"; test.before(async (t) => { const redis = await connectTestRedis(); t.context.redis = redi...
const { getOffUser } = require('.'); (async () => { let str = '00000user:-,11111'; let str2 = await getOffUser(str); console.log(str + '\n' + str2 + '\n>>>>'); str = '00000user:,11111'; str2 = await getOffUser(str); console.log(str + '\n' + str2 + '\n>>>>'); str = '00000user: nil,11111'; str2 = await g...
const pool = require('../config/dbconfig'); class Lesson { teachers = []; students = []; countVisit = 0; filterParams = {} constructor(id, filterParams) { this.id = id; this.filterParams = filterParams; this.getStudents() .then((data) => { this....
import React, { useState, useEffect } from "react"; import { Box, Text, Heading, IconButton, Button, FormControl, FormLabel, Input, FormErrorMessage, Flex, } from "@chakra-ui/react"; import { CloseIcon, EditIcon } from "@chakra-ui/icons"; import ReactCardFlip from "react-card-flip"; import { Formik,...
import styled from "styled-components"; import { lightestColor } from "../../colors"; import { defaultSpace, halfSpace } from "../../spaces"; import { fontMedium } from "../../typograph"; const Label = styled.span` color: ${lightestColor}; font-size: ${fontMedium}; font-weight: bold; margin-right: ${halfSpace...
import kue from 'kue'; const queue = kue.createQueue(); const blackListed = ['4153518780', '4153518781']; const sendNotification = (phoneNumber, message, job, done) => { const total = 100; job.progress(0, total); if (blackListed.includes(phoneNumber)) { return done(new Error(`Phone number ${phoneNumber} i...
/* globals LOOP_OBJ, define, Template, HTMLToElem */ const CUSTOM_GATE_TEMPLATE = new Template( '<div' + ' class="gate gate-custom gate-{{TYPE}}"'+ ' style="background-color: {{BGCOLOR}}"' + ' draggable="true"' + ' data-clone="true"' + ' data-type="{{TYPE}}"' + ' data-in="{{IN}}"' + ' d...
import React from "react" import Link from "gatsby-plugin-transition-link/AniLink" import styles from "./FeaturedBlogTitle.module.scss" const FeaturedBlogTitle = ({ postAuthor = "", postTitle = "", postSlug = "", postImg = "", postColor = "", isFeatured = true, postAuthorImg = "", date = "", }) => { ...