text stringlengths 7 3.69M |
|---|
window.onload=function(){
setTimeout(logo, 1000);
setTimeout(menu1, 1000);
setTimeout(menu2, 1000);
setTimeout(media, 1000);
setTimeout(indi, 1000);
setTimeout(content, 1500);
setTimeout(img, 1500);
}
function logo(){
var h=document.querySelector('#logo h1');
h.style.opacity = '1';
... |
Grailbird.data.tweets_2012_10 =
[ {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "cmd",
"indices" : [ 111, 115 ]
} ],
"urls" : [ ]
},
"g... |
module.exports = app => {
const jsonp = app.jsonp();
app.get('/api/v1/error', jsonp, app.controller.errorC.insert);
app.get('/api/v1/ajaxError', jsonp, app.controller.errorC.ajaxInsert);
} |
import Vue from 'vue';
import App from './App.vue';
import VueSkycons from 'vue-skycons';
import ProgressBar from 'vuejs-progress-bar';
import vueNumeralFilterInstaller from 'vue-numeral-filter';
const moment = require('moment');
require('moment/locale/en-au');
require('../node_modules/foundation-sites/dist/css/founda... |
const { readFileSync } = require('fs')
const { resolve } = require('path')
const { execSync } = require('child_process')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const webpack = require('webpack')
const package = require('../package.json')
cons... |
import CustomizationManagement from "./CustomizationManagement";
export {CustomizationManagement}
export default CustomizationManagement |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function get() {
return _progressiveLoadable.default;
}
});
Object.defineProperty(exports, "cleanLoadableTags", {
enumerable: true,
get: function get() {
r... |
var thread = require('./thread');
var responses = [];
var list = [];
function test(name){
var hash = "";
while(hash.length !== 5){
var tm = new Date().getTime().toString().substr(-4),
cam = 0;
for(var i = 0; i<4; i++){
if(tm.charAt(i) !== "") {
cam = cam ... |
import React from "react";
import { NavbarDiv, NavbarA, NavbarLi, NavbarLogo } from "./style";
const Navbar = () => (
<NavbarDiv id='home'>
<NavbarLogo
src='https://i.imgur.com/bsceKNV_d.webp?maxwidth=728&fidelity=grand'
alt='Home'
title='Home'
/>
<ul>
<NavbarLi>
<NavbarA
... |
import { combineReducers } from 'redux';
import reducer from './AuthReducer';
export default combineReducers({
auth: reducer
});
|
import React, { Component } from 'react';
import Listing from './Listing';
import'./Listings.css';
class Listings extends Component {
render() {
return (
<div>
<Listing />
</div>
);
}
}
export default Listings;
|
X.define("modules.customerClearance.clearanceDetail",["model.customerClearanceModel","data.currencyData","data.addressData"],function (customerClearanceModel,currencyData,addressData) {
//初始化视图对象
var view = X.view.newOne({
el: $(".xbn-content"),
url: X.config.customerClearance.tpl.clearanceDetai... |
//production.js
const prodConfig = {
//database
jwt_key: "",
jwt_expiration: 360000,
dbConnectionString: "mongodb://34.64.126.115:27017/kyungjoon_test",
mongoDebug: false
};
export default prodConfig;
|
import React, { useState, useEffect } from 'react'
import "./style.css"
// import {useParams,useHistory} from "react-router-dom"
// import API from "../../utils/API"
import BookInfo from "../../components/BookInfo";
import SearchForm from "../../components/SearchForm";
export default function Books() {
const [pag... |
'use strict';
window.onload = function() {
let jojima = document.getElementById("jojima");
let btn10 = document.getElementById("btn10");
let jojimaList = jojima.style;
btn10.onclick = function(){
if( jojimaList.display === "block" ) {
jojimaList.display = "none";
} else {
jojimaList.displa... |
/**
* Created by Administrator on 2016/7/30 0030.
*/
//拼接HTML
function showHtml(dataList)
{
for(var i=0; i<dataList.length; i++) {
var html = '<dl class="dingdan">' +
//'<dt><img src="' + imgUrl + dataList[i].picture + '"/></dt>' +
'<dd>' +
'<span class="aui-iconfont... |
var canvas = document.getElementById('myCanvas');
var ctx = canvas.getContext('2d');
var img = new Image();
img.src = "img/livewait.png";
img.onload = function() {
ctx.drawImage(img, 0, 0, 320, 240, 0, 0, 320, 240);
}
function pushSubmit() {
document.getElementsByTagName('form')[0].submit();
}
var ... |
'use strict'
const pump = require('pump')
const lines = require('vbb-lines')
const through = require('through2')
const csv = require('csv-write-stream')
const fs = require('fs')
// todo: https://developers.google.com/transit/gtfs/reference/extended-route-types
const typesByProduct = {
regional: 2,
suburban: 2,
sub... |
import React, { useContext, useRef, useEffect } from "react"
import "./navigation-links.scss"
import { Link } from "gatsby"
import ProductsMenu from "./ProductsMenu"
import { IsMenuOpenedContext } from "../../../utils/context"
const NavigationLinks = ({ className, classNameLinks }) => {
const { isProductsMenuOpen,... |
import React from 'react';
import './App.css';
import ContentBlock from "./Components/ContentBlock/ContentBlock";
import MyHeaderBlock from "./Components/HeaderBlock/MyHeaderBlock";
import FooterBlock from "./Components/FooterBlock/FooterBlock";
import Card from "./Components/Card/CardLesson";
import {wordsList} from "... |
import React from 'react'
import {Drawer, Form, Button, Col, Row, Input, Select, DatePicker, Icon, Avatar, Card} from 'antd';
import { Checkbox } from 'antd';
const CheckboxGroup = Checkbox.Group;
const { Option } = Select;
const plainOptions = ['Breakfast', 'Lunch', 'Dinner', 'Flights', 'In-city Public Transport', 'I... |
/* begin copyright text
*
* Copyright © 2016 PTC Inc., Its Subsidiary Companies, and /or its Partners. All Rights Reserved.
*
* end copyright text
*/
/* jshint node: true */
/* jshint strict: global */
'use strict';
var debug = require('debug')('vxs:security');
var app = require('../app');
var csrfMethods = ... |
const emailConfig = require('../config/emailConfig')();
const mailgun = require('mailgun-js')({ apiKey: process.env.MAILGUN_API_KEY, domain: emailConfig.domain });
exports.sendMailGunEmail = (recipients, message) =>
new Promise((resolve, reject) => {
const data = {
from: emailConfig.senderAddress,
to... |
var options={
center: new google.maps.LatLng(36.0835,140.0766),
zoom:11,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var markerList=[
{
title:"Mount Tsukuba",
lat:36.2258,
long:140.1050,
category:"Attractions"
},
{
title:"Tsukuba Space Center",
lat:36.0656,
long:140.1281,
cate... |
(function () {
"use strict";
angular.module("vcas").filter("videoMarkCapableFilter", videoMarkCapableFilter);
/* @ngInject */
function videoMarkCapableFilter() {
return function isVideoMarkCapable(str) {
var num = parseInt(str, 10),
text;
if (num === 0) {
text = "No";
... |
import React, { Component } from 'react';
import Icon from "../../media/Icon";
import Button from "../Button";
export default class TypographyTest extends Component {
render() {
return (
<div className='sub-container'>
<h1>Typography</h1>
<div className={'container'}>
<h2>Headi... |
module.exports = comments = [{ movieId: 29085, comment: "Great watch" }];
|
import { Storage } from './storage'
const storage = new Storage();
export class Weather{
constructor(lat, lng){
this.apiKey = '055a53f5a6b68703fe86456a74f6da17';
this.lang = 'pl';
this.lat = lat || storage.getLocationData().lat;
this.lng = lng || storage.getLocationData().lng;
}
// fetch weather... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var protractor_1 = require("protractor");
var ptor_1 = require("protractor/built/ptor");
var log4jsonconfig_1 = require("../config/log4jsonconfig");
// Verify and Close Alert dialog box
var alert = /** @class */ (function () {
function ale... |
function lfwTextHelper(fieldName) {
var listObj = document.getElementById("id_" + fieldName + "_list");
var newText = "";
for(var i=0; i<listObj.options.length; i++)
{
if(i > 0) {
newText += ", ";
}
newText += listObj.options[i].text;
}
var textObj = documen... |
import React from 'react'
import PropTypes from 'prop-types'
import CastaneaMenu from "../../castanea.menu";
import { CastaneaContainer, CastaneaHeader } from "../../../core/components/castanea";
import { HOME_ROUTE, RECIPES_HOME } from "../../castanea.routes";
import './recipes-sheet.scss'
const breadcrumb = [
{
... |
import React, {Component} from 'react';
import Signup from '../components/account/Signup.js'
const api = require('../utils/api.js');
const ReactGA = require('react-ga');
const style = {
signup: {
"display": "inline-block"
}
};
export default class SignupPage extends Component {
constructor(pro... |
// Contient des commandes pour aider à placer les objets
// Fait spawn un objet au sol devant le joueur
RegisterCommand("hg:obj", async ( source, args ) => {
let modelName = args[0];
let coords = GetEntityCoords(PlayerPedId());
let dir = GetEntityForwardVector(PlayerPedId());
coords = [coords[0] +... |
var User = require('./user');
function Models(bookshelf) {
return {
User: User(bookshelf)
}
}
module.exports = Models;
|
//zmienne globalne
var counter = 0, //licznik kliknięć
clickCount = document.getElementById("clickCount"),
myBox = document.getElementById("myBox");
function count() {
"use strict";
counter += 1; //aktualizacja licznika kliknięć
clickCount.innerHTML = counter; //dodanie liczby kliknięć do wewnęt... |
/**
* Copyright 2016 Google Inc.
*
* 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.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
module.exports = {
extends: 'airbnb',
rules: {
'linebreak-style': 0,
'global-require': 0,
'no-plusplus': 0,
'no-undef': 0,
'eol-last': 0,
'no-continue': 0,
'func-names': 0,
'prefer-arrow-callback': 0,
'no-trailing-spaces': 0,
'react/jsx-filename-extension': [1, { extensions: ... |
/* eslint-disable no-dupe-class-members */
import React from 'react'
import {connect} from 'react-redux'
import classes from './LiveSearch.module.css'
import Form from '../../Components/Form/Form'
import ListSearch from '../../Components/ListSearch/ListSearch'
import { findLi } from '../../redux/actions/mainSearch/main... |
import React, { useState } from "react";
import Typewriter from "typewriter-effect";
import Button from "@mui/material/Button";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faGithub, faLinkedin } from "@fortawesome/free-brands-svg-icons";
import styles from "~styles/home.module.scss";
imp... |
var serviceName = 'mdl.mobileweb.service.recordprogress'
angular.module('newApp').service(serviceName, ['settings','mdl.mobileweb.service.login','$http',
function (settings,loginService,$http) {
var vm = this;
vm.webApiBaseUrl = settings.webApiBaseUrl;
vm.m... |
'use strict'
export default (query) => {
// Sanity check
if (
!query ||
typeof query !== 'object' ||
Object.keys(query).length === 0
) {
return ''
}
// Build and return query string
return Object.keys(query).map(key => `${key}=${query[key]}`).join('&')
} |
var express = require("express");
console.log("Let's find out what express is", express);
const parser = require("body-parser");
const path = require("path");
const port = process.env.PORT || 8000;
console.log('port is: ', port)
const app = express();
app.set('view engine', 'ejs');
app.set('views', path.join(__dirna... |
var classbusinessLogic_1_1FacadeImplementationWS =
[
[ "FacadeImplementationWS", "classbusinessLogic_1_1FacadeImplementationWS.html#a22415eec1f4d0a160f02cfdc1ac80825", null ],
[ "bookOffer", "classbusinessLogic_1_1FacadeImplementationWS.html#a0c3a269d277719643ca61e030580812a", null ],
[ "coincide", "classbu... |
$(function() {
var paramStr = commonUtil.getRequestParam("paramStr");
var paramData = JSON.parse(paramStr);
resultHtml.init(paramData);
});
var resultHtml = {
init : function(data) {
// 给检索按钮绑定事件
this.bindResultSearchBtn();
// 填充检索结果表格
this.initTable(data);
// 设置二次检索的
this.setSecondSearchB... |
import React from 'react'
import { Box } from '@chakra-ui/react'
import Form from './Form'
function App() {
return (
<Box w="800px" m="100px auto">
<Form />
{/* <Card /> */}
</Box>
)
}
export default App
|
'use strict';
describe('@property tag', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/propertytag.js'),
myobject = docSet.getByLongname('myobject')[0];
it('When a symbol has a @property tag, the property appears in the doclet.', function() {
expect(typeof myobject.properti... |
import React from 'react';
import styled from 'styled-components';
const StyledDivider = styled.div`
position: relative;
margin: 0 auto;
margin-top: 20px;
width: 30px;
height: 29px;
background: ${({white})=> white ? "url('/img/divider_bg_white.svg')" : "url('/img/divider_bg.svg')"} center cente... |
function getById(id) {
return `SELECT
u.first_name, u.second_name,
v.name,
e_l.lvl,
h_f.change_reason, h_f.ready_to_work, h_f.ready_to_travel,
h_f.motivation, h_f.salary_wish, h_f.other,
c.ru_first_name, c.ru_second_name,
c.eng_first_name, c.eng_second_name,
g.change_date AS date
FROM hrm_feedback ... |
var Main = new function()
{
this.OnLoad = function()
{
$('#content_wrapper').on('touchmove', false);
}
this.sendEmail = function()
{
var input_name = $('#input_name').val();
var input_suggest = $('#input_suggest').val();
if (input_suggest != "")
{
... |
import { createSlice, createAsyncThunk } from "@reduxjs/toolkit";
const url = process.env.REACT_APP_QUOTES_API_URL_GAMES;
const token = process.env.REACT_APP_QUOTES_API_TOKEN;
export const getGameById = createAsyncThunk(
//action type string
"games/getGameById",
// callback function
async (id) => {
console... |
async function preloadTrip(req, res, next) {
req.data = req.data || {};
try {
const trip = await req.storage.getTripById(req.params.id);
if(trip){
req.data.trip = trip;
next();
} else {
res.redirect('/404');
}
} catch (err){
if(err.... |
/*
* Copyright 2018 Cognitive Scale, Inc. All Rights Reserved.
*
* 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.apache.org/licenses/LICENSE-2.0
*
* Unless required b... |
const person = {
age: 25
}
person.age = 28
// person = {}
console.log(person);
|
"use strict";
var siteData = $('#siteData');
var chartsLog = {};
//*******************************
// INIT
//*******************************
$(function () {
//switch bootstrap hidden to jquery hide() on load
initHidden();
initBreakpoint();
deviceSpec();
if (!isBreakpoint('xs')) {
new WOW().... |
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import * as actionCreators from '../actions/actionCreators';
import { addComment, increment, fetchPosts, fetchPostsSuccess, fetchPostsFailure } from '../actions/posts';
import Single from '../components/Single';
function mapStateToProp... |
const { HTTP_CODE, DEFAULT_APP_STATUS } = require("../constants");
const DEFAULT_ERROR_DESCRIPTION = "server unkown error.";
//为上下文添加返回方法
const respHelper = ctx => {
// success 200 code 0
ctx.res.success = (payload = null, description = null) => {
ctx.status = HTTP_CODE.OK;
ctx.body = {
code: DEFAUL... |
import {reducer as formReducer} from "redux-form";
import {combineReducers} from "redux";
import postReducer from "./postReducer";
const RootReducers = combineReducers({
postReducer,
form: formReducer
})
export default RootReducers; |
import React, { useState, useEffect } from "react";
import MovieList from "./Components/MovieList";
import Moviecard from "./Components/Moviecard";
import Ratings from "./Components/Ratings";
import "./App.css";
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
import Description from "./Comp... |
import { connect } from 'react-redux';
import Card from '../../components/Board/Cards/Card';
const mapStateToProps = ({ board: { members } }, { card }) => {
const assignedUsers = members.filter(member => {
let isAssigned = false;
Object.values(card.assignments).forEach(assignment => {
if (assignment.u... |
$(document).ready(function() {
getLocation();
function getLocation(){
$.get("https://ipinfo.io", function(location) {
$(".location").append(location.city + ",").append(location.country);
getWeather(location.loc);
}, "jsonp");
}
function getWeather(loc){
var API_KEY="b07691f16495483da9d93038172305";
var ur... |
import _ from "/ui/web_modules/lodash.js";
export default mnClusterConfigurationController;
function mnClusterConfigurationController($scope, $rootScope, $q, mnClusterConfigurationService, mnSettingsClusterService, mnAuthService, mnHelper, mnServersService, mnAlertsService, mnPromiseHelper, mnWizardService, mnRootCer... |
/*
props.lines = Arr[String]
Takes lines of text and animates them into splash screen
one word at a time
*/
import React, {Component} from 'react';
export default class Title extends Component {
constructor(props) {
super(props);
const words = props.lines.map(line=>line.split(' '));
this.state = {
... |
export const category = state => state.category
export const goodsDetails = state => state.goodsDetails
export const userName = state => state.userName
export const addressInfo = state => state.addressInfo
export const browse = state => state.browse
export const shopOrderList = state => state.shopOrderList
export const... |
/* @flow weak */
import React from "react";
import { View, Dimensions } from "react-native";
import { List } from "native-base";
import styled from "styled-components/native";
import ItemContainer from "../containers/ItemContainer";
const { width, height } = Dimensions.get("window");
const RenderItem = song => <Ite... |
import React, { useState } from "react";
const Filter = ({ searchFunc, filterFunc }) => {
const [activeFilter, setActiveFilter] = useState("all");
const handleButtonPress = (filterType) => {
setActiveFilter(filterType);
filterFunc(filterType);
};
return (
<div className="carousel__body--left">
... |
/**
* Copyright 2016 Google Inc.
*
* 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.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var UserSchema = new Schema({
firstName: String,
lastName: String,
email: {
type: String,
index: true,
match: /.+\@.+\..+/
},
username: {
type: String,
trim: true,
unique: true,
... |
const model = require('./model');
const errorHandler = require('../../services/errors/status-error-handling');
module.exports.createCraftedComponent = function(req, res) {
const id = req.params.id;
if (!_isValidId(id)) {
return _handleInvalidId(res, id);
}
const body = req.body;
if (!_isValidBody(body)) ... |
'use strict';
const chalk = require('chalk');
const COMPLETE_CHAR = chalk.bgBlue(' ');
const INCOMPLETE_CHAR = chalk.bgWhite(' ');
const BAR_WIDTH = 20;
function formatTime(millisecs)
{
let str;
const secs = millisecs / 1000;
if (secs < 1)
str = '< 1 s';
else
{
const... |
function pad(num, size) {
let s = num + "";
while (s.length < size) s = "0" + s;
return s;
}
const MINUTE = 60;
const HOUR = MINUTE * 60;
export default function secondsToString(seconds) {
seconds = Math.round(seconds);
const hours = Math.floor(seconds / HOUR);
seconds -= hours * HOUR;
c... |
(function () {
document.addEventListener('DOMContentLoaded', function () {
var Input = function () {
var inputId = document.getElementById("number_input");
const PIN = "512";
console.log(PIN)
return {
insert: function (newVal... |
import React,{useState} from 'react';
import './App.css';
import {BrowserRouter as Router, Switch, Route, Link} from 'react-router-dom';
import Menu from './components/Menu';
import CreateSurvey from './components/CreateSurvey';
import Publish from './components/Publish';
function App() {
const[sQuestion, setSQuesti... |
import axios from "axios";
import { GET_SIMILAR_MOVIES } from "../types";
export const getSimilarMovies = id => dispatch => {
axios.get(`/.netlify/functions/getSimilarMovies?id=${id}`).then(res =>
dispatch({
type: GET_SIMILAR_MOVIES,
payload: res.data
})
);
};
|
function Cell(x, y, w) {
this.x = x;
this.y = y;
this.w = w;
this.bee = true;
this.revealed = true;
}
Cell.prototype.show = function() {
rect(this.x, this.y, this.w, this.w);
} |
const request = require('../../utils/request');
const querystring = require('querystring');
const songsMapper = require('./songs_mapper');
const options = {
host: 'c.y.qq.com',
method: 'GET',
mode: 'no-cors'
};
const requestQQ = (query) => {
options.path = `/soso/fcgi-bin/client_search_cp?${querystring.stringi... |
({
doSomething : function(component, event, helper) {
console.log(component.get("v.ActivityType"));
var modalBody;
$A.createComponent("c:PersonMarketingActivityEmailPreview", {hashValue : component.get("v.Hash")},
function(content, status) {
if (status === "SUCCE... |
define(function() {
result= {};
result.default_scores= [
{player:'TLS', score:'1000'},
{player:'TLS', score:'800'},
{player:'TLS', score:'600'},
{player:'TLS', score:'400'},
{player:'TLS', score:'200'}
];
if(typeof(Storage) !== "undefined"){
// local store available so use it
result.LOCALAVAILABLE= ... |
var userService = require('../services').user;
module.exports = function(router) {
router.route('/users/:userId/devices/').get(function(req, res) {
var userId = req.params.userId;
userService.getDevices(userId, function(err, devices) {
if(err) {
console.log(err);
return res.json(err);
}
r... |
class Player {
constructor() {
this.ship = R.image(Grfx.SHIP);
this.x = this.y = 0;
this.speed = 250;
this.moveLeft = this.moveRight = false;
this.reset();
}
reset() {
this.x = (Options.WIDTH >> 1) - (this.ship.width >> 1);
this.y = Options.HEIGHT -... |
import React, { Component } from 'react'
import Maincom from './components/Maincom'
import './App.css'
import {BrowserRouter} from 'react-router-dom'
import {Provider} from 'react-redux'
import {ConfigureStore} from './redux/configstore'
const store=ConfigureStore()
export class App extends Component {
render() {
... |
var addTwoNumbers = function(l1, l2) {
let num1 = "";
let num2 = "";
while (l1) {
num1 = num1.concat(l1.val.toString());
l1 = l1.next;
}
while (l2) {
num2 = num2.concat(l2.val.toString());
l2 = l2.next;
}
num1 = parseInt(num1);
num2 = parseInt(num2);
l... |
function multipleofFizzBuzz(num){
if (num%3 === 0 && num%5 === 0){
return "FizzBuzz";
}
else if (num%3 === 0){
return "Fizz";
}
else if (num%5 === 0){
return "Buzz";
}
return num;
}
module.exports = multipleofFizzBuzz;
|
import randomString from 'randomstring';
import moment from 'moment';
/* eslint no-mixed-operators: 0 */
const randomInt = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
export default class {
constructor({
id, name, keyword, mtime, size, type, parentId, index, isBookmarked
} = {
id: `... |
import React, { PropTypes } from 'react';
import { Button, Form, Input, Row, Col, message } from 'antd';
import { intlShape, injectIntl } from 'react-intl';
import { format } from 'client/common/i18n/helpers';
import messages from './message.i18n';
import globalMessages from 'client/common/root.i18n';
import './acc.les... |
function validating()
{
contact_name=document.getElementById('c_name').value;
contact_no=document.getElementById('c_no').value;
email=document.getElementById('email').value;
address=document.getElementById('address').value;
var contact_name_regx=/^([a-z A-Z]{3,15... |
import {
DECREMENTER,
INCREMENTER,
sumUp,
ticketTotalPrice
} from "../utils/Order";
// incrementer tests
test("Should increment number ", () => {
const safeNumber = 0;
const safeNumberPlusOne = INCREMENTER(safeNumber);
expect(safeNumberPlusOne).toBe(safeNumber + 1);
});
test("Should not increment past m... |
import React, { Component } from 'react'
class Nomatch extends Component{
render(){
return <div>
<h1 className='sss'>404</h1>
</div>
}
}
export default Nomatch |
function solve(first, second, third)
{
let totalLength=first.length+second.length+third.length;
let averageLength=totalLength/3;
console.log(totalLength);
console.log(Math.floor(averageLength));
}
solve('chocolate', 'ice cream', 'cake') |
import { fromJS, isKeyed } from 'immutable';
import { ENTITIES_FETCH_COMPLETE } from './types';
const initialState = fromJS({
sessions: {},
stories: {},
votes: {},
users: {},
});
export default (state = initialState, action) => {
const { type, payload } = action;
switch (type) {
case ENTITIES_FETCH_C... |
var EntityTableColumns = function() {
this.ENTITYTYPES = { "name": 0, "label": 1, "description": 2 };
this.COMPONENTTYPES = { "name": 0, "description": 1, "datatable": 2 };
this.ENTITIES = { "entitytype_id": 0 };
this.COMPONENT_SPATIAL = { "position": 0, "orientation": 1 };
this.COMPONENT_MO... |
var lib_hcache =
[
[ "Config used by libhcache", "hc_config.html", null ],
[ "Header cache multiplexor", "hc_hcache.html", null ],
[ "Email-object serialiser", "hc_serial.html", null ]
]; |
const filter = ''
const filterReducer = (state = filter, action) => {
switch (action.type) {
case 'UPDATE_FILTER': {
return action.data
}
default:
return state
}
}
export const updateFilter = (input) => {
return {
type: 'UPDATE_FILTER',
data: input
}
}
export default filterReduc... |
const Ajv = require('ajv');
const ajv = new Ajv();
module.exports = ajv.compile({
type: 'object',
title: 'Create Vote Validator',
properties: {
storyId: { type: 'integer' },
userId: { type: 'integer' },
score: { type: 'integer' },
},
required: ['storyId', 'userId', 'score'],
});
|
let chatbot = require('./chatbot');
module.exports = {
receivedPostback: async (event) => {
var senderID = event.sender.id;
var recipientID = event.recipient.id;
var timeOfMessage = event.timestamp;
var { payload, title } = event.postback;
var preProcessData = payload.split("-");
let head = prePr... |
import { useState } from "react";
import "./App.css"
const PRODUCTS = [
{
id: 1,
name: "PRODUCT ITEM NUMBER 1",
description: "Description for product item number 1",
image: "https://via.placeholder.com/200x150",
price: 10,
quantity: 1,
},
{
id: 2,
name: "PRODUCT ITEM NUMBER 2",
... |
import React, { useState } from "react";
import TableElement from "./TableElement/TableElement";
import "./MovieElement.scss";
const MovieElement = (props) => {
const [isShown, setIsShown] = useState(false);
return (
<>
<div className="movieElement">
<p className="movieTitle">{props.movie.title}... |
//Class 1:
// Fork and clone the repo and set up your project workspace and link files
// Write HTML for your project
//Class 2:
// Declare four global variables for intial state of the list of choices, the computer choice, the user choice, and the winner.
// Practice using console.log() and debugger to debug your ... |
(function () {
'use strict';
angular
.module('0424gartenwerkstatt')
.config(config);
function config($stateProvider) {
$stateProvider
.state('0424gartenwerkstatt', {
url: '/archiv-2016/04-24-gartenwerkstatt',
templateUrl: 'archiv-2016/04-24-gartenwerkstatt/views/04-24-gartenwer... |
import { Form } from 'element-ui'
import router from './router'
import store from './store'
function sleep(){
return new Promise((res,rej)=>{
setTimeout(()=>{
res({
data:['project']
})
},2000)
})
}
import {asyncRoutes} from "@/router/index.js"
async func... |
/* eslint-disable no-use-before-define */
import React from 'react';
import TextField from '@material-ui/core/TextField';
import Autocomplete, { createFilterOptions } from '@material-ui/lab/Autocomplete';
import styled from 'styled-components';
import { Avatar } from '@material-ui/core';
const filter = createFilterOpt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.