text stringlengths 7 3.69M |
|---|
import React, { Component } from 'react';
import {withRouter} from "react-router-dom";
class Login extends Component {
constructor(props) {
super(props);
this.onSubmit = this.onSubmit.bind(this);
}
onSubmit(e) {
e.preventDefault();
const regex = /^[0-9]+$/;
const userId = document.getElemen... |
const BASE_IP = 'localhost'; // 테스트
// const BASE_IP = '58.229.183.87'; // 실서버
const BASE_PORT = 8000; //angular
// exports.API_SERVER = 'http://' + BASE_IP + ':3000';
exports.CHAT_SERVER = 'http://' + BASE_IP + ':3001';
// export const API_URL = API_SERVER + '/api';
// export const IMG_URL = API_SERV... |
(function() {
/**
* Throws exception with optional message if condition is false.
* @param {boolean} condition
* @param {string} [message=Assertion failed]
*/
function assert(condition, message) {
if (!condition) {
message = message || "Assertion failed";
if (type... |
// --------------------------------- for Contact Us page------------------------------------
import { displayMessage } from "./script-shared.js";
const messageOnMessageSubmit = "Message was successfully sent";
const sendMessageButton = document.getElementById('sendMessageButton');
const contactForm = document.getEleme... |
/**
* Quink, Copyright (c) 2013-2014 IMD - International Institute for Management Development, Switzerland.
*
* This file is part of Quink.
*
* Quink is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundatio... |
"use strict";
//get observation target data maxDate and minDate
function ajaxGetDateBound() {
loading("Calculating...");
//console.log(getFunction());
var URLs = "php/_dbqueryGetDate.php";
$.ajax({
url: URLs,
type: "GET",
data: {
data: JSON.stringify(observeTargetTmp)... |
/**
* Date Author Des
*----------------------------------------------
* 2018/5/18 gongtiexin 登陆组件
* */
import React, { Component } from 'react';
import { inject, observer } from 'mobx-react';
import { Link } from 'react-router-dom';
import PropTypes from 'prop-types';
import ... |
'use strict'
const appEventEmitter = require('../appEventEmitter');
const liveLogins = require('../notifications/liveLogins');
//Dummy impl; ideally it will read a que and emit event for a specific user
setInterval(() => {
let allLiveLogins = liveLogins.getAll();
for(let i = 0; i < allLiveLogins.length; i++){... |
var structAnsiAttr =
[
[ "attr", "structAnsiAttr.html#a6f96f39ebfeebf2ee366e18f4329eb2f", null ],
[ "fg", "structAnsiAttr.html#adb4ab54c8f829bd8cfaf094fdb476765", null ],
[ "bg", "structAnsiAttr.html#af5d23b90bdd04c64a734ded7c452bc9f", null ],
[ "pair", "structAnsiAttr.html#a7b35e9ab905f75615091259003a9... |
exports.puppeteer = () =>{
const fs = require('fs');
const assert = require('assert');
const puppeteer = require('puppeteer');
puppeteer.launch().then(async () => {
console.log("poppeteer start...")
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(... |
import React, { useContext } from "react";
import { ThemeContext } from "./themeContext";
import Button from "./components/Button";
import Body from "./components/Body";
const App = () => {
const { theme } = useContext(ThemeContext);
return (
<main className={`${theme}-theme`}>
<Button />
<Body />
... |
app.controller('apiClubController', function($scope, Gapi, $rootScope, $modal, $timeout, $filter, ngTableParams) {
$rootScope.trampLevels = [
{name: "Novice", value: 1},
{name: "Intermediate", value: 2},
{name: "Inter-advanced", value: 3},
{name: "Advanced", value: 4},
... |
module.exports = {
// method of operation
get: {
tags: ["Purchase"], // operation's tag.
description: "Get purchase details of a specific customer", // operation's desc.
operationId: "getCustomerPurchase", // unique operation id.
parameters: [
// expected params.
... |
var app1 = new Vue({
el: '#app-1',
data: {
message: 'Hello there'
}
});
var app2 = new Vue({
el: '#app-2',
data: {
message: 'Yes I am glad that you wanted to see me :))'
}
});
var app3 = new Vue({
el: '#app-3',
data: {
seen: true
}
});
var app4 = new Vue({
... |
import Head from "next/head";
import Header from "../components/partials/Header";
import Footer from "../components/partials/Footer";
import Video from "../components/partials/utils/Video";
import { useRouter } from "next/router";
import { Context } from "../context/Context";
import { useContext, useEffect } from "reac... |
document.addEventListener("DOMContentLoaded", function(event) {
var btnTr = document.getElementById("btnTr");
btnTr.onclick = function(){
tr();
}
var btnEo = document.getElementById("btnEo");
btnEo.onclick = function(){
eo();
}
var btnAr = document.getElementById("btnAr");
btnAr.onclick = functi... |
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function(Controller) {
"use strict";
return Controller.extend("uk.me.seancampbell.controller.Main", {
});
}); |
var Poseidon ={
age: 16001,
hobbies: ["swimming", "killing fish", "tidal waves"],
favoritePlaces: ["Pacific Ocean", "Great Pacific Garbage Patch", "Gary's Bathtub"],
friends: [],
enemies: [
{
name: "Hades",
age: 16001.5,
hobbies: ["Dying", "Spongebaths", ... |
module.exports = {
validateData(arr) {
for (let i = 0; i < arr.length; i++) {
switch (typeof arr[i]) {
case 'string':
return (
arr[i] &&
arr[i].trim() != '' &&
arr[i] !== null &&
arr[i] !== 'undefined'
);
default:
... |
const diagram = new dhx.Diagram("diagram_container", {
type: "org",
defaultShapeType: "img-card",
scale: 0.9
});
diagram.data.load('http://localhost/pmii_bondowoso/assets/dhtmlx/data.json');
// const template = ({ photo, name, post, phone, mail }) => (
// <div class="dhx-diagram-demo_personal-card">
// ... |
// test/unit/index.test.js
const Module = require('../../src');
describe('This module', () => {
it('Should exist', () => {
expect(Module).not.toBeUndefined();
});
});
|
'use strict';
/*
* @author Rachel Carbone
*/
var app = angular.module('editor.controllers', []);
app.controller('HeaderMainCtrl', ['$scope', '$state', 'AuthService', 'USER_ROLES',
function($scope, $state, AuthService, USER_ROLES) {
$scope.currentUser = AuthService.getUser();
$scope.userRoles = ... |
const db = require('./db');
module.exports.new = (user_email, billing_date, billed, btc_hashes, eth_hashes, btc_address, eth_address)=>{
return new Promise((res,rej)=>{
db.connect().then((obj)=>{
obj.none('insert into orders (email, billing_date, billed, btc_hashes, eth_hashes, btc_address, eth... |
var expCtrl = angular.module('expCtrl', []);
expCtrl.controller('expCtrl', function($scope, Experience) {
$scope.formData = {};
Experience.getAll()
.success(function(data) {
$scope.projects = data;
});
}); |
function parallax(){
$(".my-paroller").paroller({ factor: 0.1, factorXs: 0.1, factorSm: 0.1, type: 'foreground', direction: 'vertical' });
}
$(document).ready(function(){
parallax();
})
|
import React from 'react';
import { connect } from 'react-redux';
import {
Row, Col
} from 'antd';
import CustomBreadcrumb from '@/components/BreadCrumb';
import Query from './query';
import EndPoints from './endpoints';
import Counters from './counters';
import Charts from './charts';
const Graph = () => (
<>
... |
const fp = require('fastify-plugin')
module.exports = fp(async function (fastify
, opts) {
fastify.decorate('user', {
hasUser: function (pid) {
if (pid instanceof Number) {
pid += ''
}
return opts.user[pid] !== undefined
},
getUser: fu... |
const { peopleRepo } = require('./people-repo');
const express = require('express');
const app = express();
app.get('/people', async (req, res) => {
const response = await peopleRepo.readPeople();
res.set('Content-Type', 'application/json');
res.set('Access-Control-Allow-Origin', '*');
res.send(response);
});... |
// ///////////////////////////////
// This module contains functions
// that manage user data
// ///////////////////////////////
// Email registration and login
export const register = ( app, email, password ) => app.auth.createUserWithEmailAndPassword( email, password )
export const login = ( app, email, password ) =... |
import React from 'react';
import { Link } from 'react-router-dom';
import '../../grid.css';
import './populartourism.css';
import dalat from '../../img/tourslist/popularTourism/cathedral-of-da-lat-360x480.jpg';
import nhatrang from '../../img/tourslist/popularTourism/nha-trang-360x225.jpg';
import phuquoc from '../.... |
import React, { useState } from "react";
import { Slider, Typography } from "@material-ui/core";
// or
export default function Nav({
onQuickSort,
onMergeSort,
onReset,
isRunning,
onHeapSort,
onBubbelSort,
onValueChange,
barValue,
}) {
const [value, setValue] = useState(10);
const handleChange = (sli... |
let num = 123;
let num2 = "24";
let sum = num + +num2;
console.log(sum); |
import React, { PureComponent } from 'react';
import { Link } from 'react-router-dom';
import styled from 'styled-components';
import fire from '../../firebaseConfig';
import TextFields from '../../components/TextField/index';
import FlatButton from '../../components/Buttons/FlatPlain';
export const Wrapper = styled.d... |
import React, { Component } from 'react';
import './Profile.scss';
import { ProfileHead } from 'components/ProfileHead';
import { ProfileBody } from 'components/ProfileBody';
class Profile extends Component {
state = {
data: {},
isData: false
};
constructor() {
super();
this.setState({... |
(function($, window) {
'use strict';
/** Prevent duplicate loading */
if ($.ui.HierarchicalSelect) {
return;
}
var Class = {
create: function() {
return function() {
this.initialize.apply(this, arguments);
};
}
};
... |
const express = require("express");
const cors = require("cors");
const mongoose = require("mongoose");
const port = process.env.PORT || 8080;
const dotenv = require("dotenv");
const router = require("./routers/allapis");
dotenv.config();
const app = express();
app.use(cors());
app.use(express.json());
//database
mong... |
function updateBacklog() {
resetBacklog();
var teamVal = document.getElementById("backLogSelect").value;
if (teamVal == "All") {
$.ajax({
url: '/Home/GetAllUnsized',
type: 'GET',
dataType: 'json',
cache: false,
error: function () {
... |
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import Topbar from './components/Topbar/Topbar';
import Sidebar from './components/Sidebar/Sidebar';
import Backdrop from './components/Backdrop/Backdrop';
import Calendar from './components/Calendar/Calendar';
class Main extends Rea... |
Ext.define('AM.view.common.ReportPanel',
{
extend: 'Ext.Panel',
alias: 'widget.common_reportPanel',
requires: ['AM.view.graph.Line',
'AM.view.graph.HorizontalBar',
'AM.view.graph.VerticalBar',
'AM.view.map.GMapPanel'],
initialize: function () {
... |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { injectIntl, intlShape } from 'react-intl';
import muiThemeable from 'material-ui/styles/muiThemeable';
import { setSimpleValue } from '../../store/simpleValues/actions';
import { withRouter } fr... |
/*
CONTENTS
1) Methods for simulating backup thread assembly
2) Methods for simulating backup processing
3) Method for estimating backup completion times (backupTimeEstimator)
*/
/**************** 1) Assembling backup threads ****************/
function openThreadCount(backups, maxThreads) {
/*
Return the # of op... |
import React, { Component } from 'react'
import Sidebar from './Sidebar'
import CircularProgress from '@material-ui/core/CircularProgress';
import Backdrop from '@material-ui/core/Backdrop';
import axios from '../config/axios';
import { Calendar, momentLocalizer } from "react-big-calendar";
import moment from "moment"... |
export default function parseURLQuery(query) {
const result = {};
for (const segment of query.split('&')) {
const equalIndex = segment.indexOf("=");
if (equalIndex > -1) {
const key = segment.slice(0, equalIndex);
const value = segment.slice(equalIndex + 1);
result[decodeURIComponent(key)]... |
import { createAsyncThunk, createEntityAdapter, createSlice } from '@reduxjs/toolkit'
import PouchDb from 'pouchdb'
import PouchDbFind from 'pouchdb-find'
import moment from 'moment'
import omit from 'lodash/omit'
PouchDb.plugin(PouchDbFind)
const db = new PouchDb('scans')
db.createIndex({ index: { fields: ['order']... |
/* eslint-disable no-console */
const chalk = require('chalk')
function logCli(msgType, message) {
if (message && typeof message === 'string') {
console.log(
chalk.bgBlue.black(` ${msgType.toUpperCase()} `),
`${message.toUpperCase()}`
)
} else if (msgType && typeof msgType === 'string') {
c... |
/*
Mon Oct 20 2014 21:00:11 GMT+0800 (CST)
combined files by KMD:
easydialog/kissy5.0_code/index.js
easydialog/kissy5.0_code/alert.js
easydialog/kissy5.0_code/common.js
easydialog/kissy5.0_code/confirm.js
easydialog/kissy5.0_code/prompt.js
*/
define('kg/easydialog/2.5.0/index',["./alert","./confirm","./prompt"],funct... |
$(function(){
// 隐藏视频控制框
setTimeout(function(){
var video=document.getElementsByClassName("yl_video")[0];
video.controls=false;
if(video.currentTime>=2*60){
video.controls=true;}
},10)
// 回到顶部
$(window).on("scroll", function() {
var h = $(window).scrollTop();
if(h > 50) {
$(".back-top").css("display... |
jQuery(document).ready(function($){
// image upload js for homepage
$('.upload-wrap input[type=file]').change(function () {
var id = $(this).attr('id');
var newimage = new FileReader();
newimage.readAsDataURL(this.files[0]);
newimage.onload = function (e) {
$('#bg').css('backgr... |
app.controller('SiteController', function($scope, $routeParams, $location) {
});
|
var o = function() {
function r() {
this.currentCount = 0, this.limitCount = 0, this.propId = 0, this.propIcon = "";
}
return r.get = function(a, e, t, o) {
void 0 === o && (o = "");
var i = new r();
return i.propId = a, i.currentCount = e, i.limitCount = t, i.propIcon = o, i... |
import inquirer from 'inquirer';
export function queryCommands() {
return inquirer.prompt([
{
type: 'list',
name: 'command',
message: 'choose: ',
choices: [
{ name: 'Create file', value: 'createFile' },
{ name: 'Create folder',... |
import React from 'react'
import { Appbar } from 'react-native-paper'
const ToolBar = ({ title, statusBarHeight, action }) => {
const Action = action ?
<Appbar.BackAction
onPress={action}
/> : null
return (
<Appbar.Header statusBarHeight={statusBarHeight} >
{Action}
... |
export const value1 = 1;
export const value2 = 2;
export const value3 = 3;
export const value4 = 4;
export const value5 = 5;
export const value6 = 6;
export const value7 = 7;
export const value8 = 8;
export const value9 = 9;
export const value10 = 10;
export const value11 = 11;
export const value12 = 12;
export const v... |
$('.btn-reject').click(function(){
$('input[name="vendor_draft_id"]').val($(this).attr('data-id'));
$('.modal_reject').modal('show');
});
$('.btn-reject-submit').click(function(){
$(this).attr('disabled', 'disabled');
$(this).html('Please wait...');
$.post($('#reject_url').val(), $('.modal_reject... |
/**
* enable fetching object consequential peroperties
* example:
* var foo = {bar: {foo: 3}}
* foo.get('bar.foo') === 3
*/
Object.prototype.get = function (prop) {
const segs = prop.split('.');
let result = this;
let i = 0;
while (result && i < segs.length) {
result = result... |
const users = [
{
id:1,
name:'Tanya Sinclair',
text: 'I’ve been interested in coding for a while but never taken the jump, until now. I couldn’t recommend this course enough. I’m now in the job of my dreams and so excited about the future. ',
job: "UX Engineer",
imagen:... |
import Button from "components/website/button/Button";
import asset from "plugins/assets/asset";
import Title from "components/website/pages/home/section-news/title/TitleStyle1";
import { useRouter } from "next/router";
import { ListNews } from "components/website/pages/news/list-news/ListNews";
import { Row, Wrapper }... |
$(function() {
// Set up the background image by creating a new image element inside a div
// that takes up the entire screen and is centered to accomadate for large
// images.
var root = $("#root");
var imgSrc = root.data("image-src");
var container = $("<div>");
container.css("z-index", -100);
contai... |
import React from 'react';
import styled from 'styled-components';
import { FieldPrimary } from '../../../../lib/elements/field';
import { FieldLayout } from '../../../../lib/elements/layout'
import { SubmitButton } from '../../../../lib/elements/button'
import { ErrorMessage, PendingMessage } from '../../../../lib/ele... |
import React from "react";
import styled from "styled-components";
import API from "../../module/api";
import { Container, Row, Col } from "reactstrap";
import { Button, Form, FormGroup, Input } from "reactstrap";
import { Textfit } from "react-textfit";
const Headline = styled(Textfit)`
text-align: center;
font... |
import { connect } from "react-redux";
import AdminsComponent from "../../Admin/AdminUser/admin";
import {
fetchAdmins,
deleteAdmins,
patchAdmin,
} from "../../actions/actions_admin_adminusers";
const mapStateToProps = state => ({
adminUser: state.adminUser,
});
const mapDispatchToProps = dispatch => ({
fet... |
#!/usr/bin/env node
// // Övning - dependencies
// const clc = require("cli-color");
// for (let i = 0; i <= 100; i += 1) {
// if (i % 2 === 0) {
// console.log(clc.blue(i));
// } else {
// console.log(clc.red(i));
// }
// }
//Övning - Publicera ett paket till npm
const clc = require("cli-color");
if (p... |
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { withStyles } from 'material-ui/styles'
import { reduxForm, change } from 'redux-form'
import compose from 'recompose/compose'
import { connect } from 'react-redux'
import update from 'immutability-helper'
import Chip from 'material-ui/... |
function forclear(){
document.getElementById('output').innerHTML="0";
}
function removeZero(){
let value=document.getElementById('output').innerHTML;
if (value=="0") {
value = " ";
document.getElementById("output").innerHTML = value;
}
}
function perc(){
let value=document.getElement... |
const arryLi = [
'Սահմանադրություն',
'Սահմանադրական օրենք',
'Օրենսգիրք',
'Սահմանադրության փոփոխություններ',
'Օրենք',
'Հռչակագիր',
'Դեկլարացիա',
'Հրամանագիր',
'Ուղերձ',
'Որոշում',
'Համատեղ որոշում',
'Օրենքի ուժ ունեցող որոշում',
'Կարգ',
'Կարգադրություն',
'Հայտա... |
const express = require('express');
const apiController = require('../controllers/apiController');
const router = express.Router();
router.route('/news').get(apiController.getAllNews);
router.route('/news/:id').get(apiController.getNews);
router.route('/players').get(apiController.getAllPlayers);
router.route('/playe... |
"use strict";
require("run-with-mocha");
const assert = require("assert");
const testTools = require("./_test-tools")
const IIRFilterNodeFactory = require("../../src/factories/IIRFilterNodeFactory");
describe("IIRFilterNodeFactory", () => {
it("should defined all properties", () => {
const IIRFilterNode = IIRF... |
m.elements({
links: $('a')
}); |
import express from 'express';
import { getter, getAll } from '../controllers/general/getter';
import updater from '../controllers/general/updater';
import deleter from '../controllers/general/deleter';
import createUser from '../controllers/users/createUser';
import signIn from '../controllers/users/signIn';
import ac... |
import "@babel/polyfill";
import "./import/modules";
import "./import/components";
import {
User
} from "%ui%/es6-class";
import {
DOM
} from "%ui%/dom-creator";
import {
getIncrementor
} from "%ui%/hosting";
import singleton from "%ui%/mediator";
// import { randomValue,
// myPromise,
... |
$(document).ready(function () {
//Shipping address form validations
$("#existing-address-form").validate({
rules: {
existingAddress: {
required: true
}
},
messages: {
existingAddress: {
required: "Please, select an exis... |
import React, { PureComponent } from 'react'
export default class Footer extends PureComponent {
render() {
return (
<footer class="footer-distributed ui container">
<div class="footer-right">
<a href="https://www.facebook.com/achhabra1">
<i class="facebook icon"></i>
... |
module.exports = function (message, emojiMap) {
if(!message || !message.payload || !message.payload.text) {
return []
}
var renderDom = []
// 文本消息
var temp = message.payload.text.replace(/\&\;/g, '&')
var left = -1
var right = -1
Object.keys(emojiMap).forEach(function(item) {
temp = temp.spl... |
import ViewerLayer from "../../layer/ViewerLayer";
import VectorLayer from "ol/layer/Vector";
import VectorSource from "ol/source/Vector";
import Fill from "ol/style/Fill";
import Stroke from "ol/style/Stroke";
import Vue from "vue";
import axios from "axios";
import GeoJSON from "ol/format/GeoJSON";
import Style from ... |
X.define("modules.homePage.home",["model.homeModel","model.userModel","model.companyModel","common.layer"],function (homeModel,userModel,companyModel,layer) {
//初始化视图对象
var view = X.view.newOne({
el: $(".xbn-content"),
url: X.config.homePage.tpl.home
});
//初始化控制器
var ctrl = X.contr... |
import Compiler from '../src/Compiler.js';
let compiler=new Compiler()
test("1",()=>{expect(compiler.calc("1")).toBe(1)})
test("11",()=>{expect(compiler.calc("11")).toBe(11)})
test("1+2=3",()=>{expect(compiler.calc("1+2")).toBe(3)})
test("1 plus 2=3",()=>{expect(compiler.calc("1 plus 2")).toBe(3)})
test("1plus2=3",()=>... |
import React, { Component } from 'react';
import { withStyles } from '@material-ui/core/styles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableHead from '@material-ui/core/TableHead';
import TableRow fro... |
const clientes = []
let indice = 0
class Pessoa {
constructor(nome, aniversario, endereco, email, telefone) {
this.nome = nome
this.aniversario = aniversario
this.endereco = endereco
this.email = email
this.telefone = telefone
}
getNome = () => {
return this.n... |
/**
* @name DashboardSectionTitle
* @author Mario Arturo Lopez Martinez
* @overview Title for dashboard sections
* @param {string} title to be displayed
* @example <DashboardSectionTitle title="Projects" />
*/
import React from "react"
import styled from "styled-components"
const Background = styled.div`
font... |
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param {number} r The red color value
* @param {number} g The green... |
import React from 'react'
import Sidebar from './Sidebar'
import MainImage from '../photos/homepage.jpg'
import Suitcase2 from '../photos/suitcase2.jpg'
import Event1 from '../photos/event1.jpg'
import Money1 from '../photos/money1.jpg'
import { Icon, Statistic, Grid, Image, Segment, Header } from 'semantic-ui-react'
... |
const hyperswarm = require("hyperswarm-web");
const hypercore = require("hypercore");
const ram = require("random-access-memory");
const pump = require("pump");
const { toPromises } = require("hypercore-promisifier");
const sw = hyperswarm();
async function createCore() {
const response = await fetch("https://krc1s... |
import HolidayImg from "../images/this_holiday_539.png";
const ThisHoliday = () => {
return <section className="hero this-holiday xl:mx-20">
<div>
<img className="hero-img" src={HolidayImg} alt="holiday pass" />
</div>
<div className="overlay bg-gray-800 text-center px-10 py-20 text-white sm:bg-transparen... |
import { combineReducers } from 'redux';
import usuarios from '../modules/reducers'
export default combineReducers({
usuarios
}); |
const chai = require('chai');
const nock = require('nock');
const sinon = require('sinon');
const logger = require('@elastic.io/component-logger')();
const reassemble = require('../lib/actions/reassemble');
const objectStorageUri = 'https://ma.estr';
process.env.ELASTICIO_OBJECT_STORAGE_TOKEN = 'token';
process.env.E... |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import ExerciseHeaderContainer from './ExerciseHeaderContainer';
import { getExerciseById } from '../reducers';
class ExerciseContainer extends Component {
componentDidMount() {
console.log(this.exercise);
}
render() {
co... |
import {getUsers} from "./userAdministration";
export const MAX_USERNAME_LENGTH = 50;
export const MIN_USERNAME_LENGTH = 3;
export const MAX_PASSWORD_LENGTH = 128;
export const MIN_PASSWORD_LENGTH = 8;
export const usernameLoginConfig = {
required: "Please, inform your name",
maxLength: {
value: MAX_... |
/*
Write a function called recursiveRange which accepts a number and adds up all
the numbers from 0 to the number passed to the function.
*/
function recursiveRange(n) {
// base case: n = 0
if (n === 0) return 0;
return n + recursiveRange(n - 1);
}
console.log(recursiveRange(6)); // 21
console.log(recursiveRa... |
/*eslint no-console: 0, no-unused-vars: 0, no-shadow: 0, newcap: 0*/
/*eslint-env node, es6 */
"use strict";
var express = require("express");
module.exports = function() {
var app = express.Router();
let store = {};
store.accounts = [];
app.get('/', (req, res) => {
res.status(200).send(store.accounts);
})... |
import React from 'react'
const ColorBtn = ({ color, text }) => {
const onClick = () => {
console.log({ color })
}
return <button onClick={onClick}
style={{ backgroundColor: color }} className="colorbtn">{text}</button>
}
export default ColorBtn
|
import { Link, IndexLink } from 'react-router';
import h from 'react-hyperscript';
import './header.scss';
function Header() {
return (
h('nav', { className: 'jumbotron header' }, [
h(IndexLink, { to: '/', activeClassName: 'active' }, 'Home'),
h('span', ' | '),
h(Link, { to: '/report', ... |
appModule.controller('resetPasswordController', ['$scope', 'resetPasswordService', 'retrievePasswordService','$location', function ($scope, resetPasswordService,retrievePasswordService, $location) {
$scope.user = {};
$scope.initialize = function () {
$scope.currentTime = new Date();
$scope.res... |
isc.TabSet.create({
ID: "BodyTabSet",
// width: "100%",
// height: "30%",
tabs: [
//{
// id: "CaseContent",
// title: "BodyContent",
// pane: bodyprofilePane
//
// },
{
id: "caseEdit",
title: "Edit",
pane: crmItemBodyEditForm
}]
}); |
import { useEffect, useState, useContext } from 'react'
import api from '../api/api'
import { Context } from '../context/AuthContext'
export default() => {
const { state } = useContext(Context)
const [todos, setTodos] = useState([])
const [errorMessage, setErrorMessage] = useState('')
const userId = st... |
import { REHYDRATE } from 'redux-persist/constants';
export default (state = [] ,action) => {
switch (action.type) {
case REHYDRATE:
return action.payload.tripList || [];
case 'add_OldTrip':
return [action.payload, ...state];
break;
case 'remove_OldTrip':
return [...st... |
//TODO, parallel initialization, subsequent, and waiting for callback.
var Client = function(params){
this.isInitialized = false;
this.hasFailed = false;
this.initializationRequirements = {
"requestHandler": [],
"gameSession": ["requestHandler"],
"multiplayerSessionManager": ["ga... |
// Other Event
$(function(){
//Hover effect
$('.hover-light').hover(
function () {
$(this).addClass('hover-light-on');
},
function () {
$(this).removeClass('hover-light-on');
}
);
//Modal close
$("#close").click(function () {
$("div#out").fadeOut("fast");
});
});
|
export const GET_API_DATA = 'GET_API_DATA';
export const DELETE_API_DATA = 'DELETE_API_DATA';
export const GET_GENDER_DATA = 'GET_GENDER_DATA';
export const DELETE_GENDER_DATA = 'DELETE_GENDER_DATA';
export const GET_CITY_DATA = 'GET_CITY_DATA';
export const DELETE_CITY_DATA = 'DELETE_CITY_DATA';
export const getRe... |
// Global namespace, window variables, etc.
$ = jQuery;
var App = {
windowWidth: $(window).width(),
windowHeight: $(window).height(),
scrollTop: $(window).scrollTop(),
};
$(window).resize(function() {
App.windowWidth = $(window).width();
App.windowHeight = $(window).height();
});
$(window).scroll(functio... |
const MenuItem = (data) => `
<li class="menu__items-item">
<a class="menu__items-link" href="#${data.hash}">${data.name}</a>
</li>
`;
export default MenuItem;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.