text stringlengths 7 3.69M |
|---|
import React, { useState, useEffect, useRef } from "react";
import { Title, useDataProvider } from "react-admin";
import moment from "moment";
import { Card, CardContent, CardActions, Button } from "@material-ui/core";
import monthToRoman from "./monthToRoman";
import SimCanvas from "./SimCanvas";
import ReactToPrint f... |
import React, { useState, useContext } from 'react'
import styled from 'styled-components'
import MealItem from './MealItem';
const Container = styled.div`
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
/* This is better for small screens, once min() is better supported */
... |
const MongoClient = require('mongodb').MongoClient
async function schools (db) {
const schools = db.collection('schools')
await schools.insertOne({
name: 'Lycée Liberté',
city: 'Paris',
loc: {
type: 'Point',
coordinates: [1, 2]
}
})
return schools.createIndex({
name: 'text',
... |
var signalr_connection = null;
$(function () {
//创建连接对象connection
signalr_connection = new signalR.HubConnectionBuilder()
.withUrl(ApiService.SignalRUrl.APIService + "/chatHub")
.configureLogging(signalR.LogLevel.Information)
.build();
//启动connection
signalr_connection.start()
.then(function ()... |
// cria uma função e retorna um objeto
// com valores fixos ou com parametros
// factory simples é uma função que retorna um novo obj
function criarPessoa() {
return{
nome: 'João',
sobrenome: 'Vicente'
}
}
console.log(criarPessoa())
/* MINHA TENTATIVA
function criarProduto (){
return{
pro... |
//执行用时 :104 ms 在所有 JavaScript 提交中击败了97.27% 的用户
//内存消耗 :36.8 MB, 在所有 JavaScript 提交中击败了71.93% 的用户
var combinationSum = function(candidates, target) {
let res = [];
let tempRes = [];
let length = candidates.length;
let temp = 0;
candidates.sort((a,b) => {
return a - b > 0
});
res = getRe... |
var app = angular.module("yoursearch", []);
app.controller("core", function ($scope, $http) {
$scope.values = [];
$scope.temp = [];
$scope.init = function () {
runApis("nfl"); //Default Search Term
};
$scope.checkIfEnterKeyWasPressed = function ($event, myValue) {
var keyCode = $e... |
(function () {
'use strict';
angular
.module('Egharpay')
.factory('YouTubeService', YouTubeService);
YouTubeService.$inject = ['$http'];
function YouTubeService($http) {
var service = {
search: search
};
return service;
function search(se... |
/**
* @author Mario Arturo Lopez Martinez
* @author Chris Holle
*/
import React from "react"
import { useQuery } from "@apollo/react-hooks"
import TeamCard from "components/cards/teamCard"
import { Mutation } from "react-apollo"
import { TEAM_DELETE_QUERY, TEAM_QUERY } from "data/queries"
export default () => {
... |
import React from 'react';
import './index.css';
import { Descriptions } from 'antd';
class ShowDescription extends React.Component {
shouldComponentUpdate(newprops){
if (this.props.data===newprops.data){
return false;
}
return true;
}
render() {
let bordered = ... |
import React, { Component } from 'react'
import './css/header.css';
export default class HeaderUserProfile extends Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
handleClick(event) {
this.props.clickToggle();
}
render() {
return (
... |
/*global RefinementCategory, searchDepartmentsComparator*/
var RefinementCategories = Phoenix.Collection.extend({
model: RefinementCategory,
comparator: function(filter) {
return searchDepartmentsComparator(filter.attributes);
},
setSelState: function(selectedRefinementIds, options) {
if (!_.isArray(sel... |
export default {
header: "Search",
view: "Search"
};
|
const observe = require('../../lib/Vue/observeObject')
const arr = [1,2,{l:12},4];
const obj = {q:1,w:2,u:{e:12}};
observe(arr, (type,value) => {
console.log(`set handle from ${type}, value is ${value}`);
})
observe(obj, (type,value) => {
console.log(`set handle from ${type}, value is ${value}`);
},false)
o... |
import withSplitting from 'lib/withSplitting';
export const Main = withSplitting(() => import('./Main'));
|
if (DashboardServiceDetailsTool == null || typeof (DashboardServiceDetailsTool) != "object") {
var DashboardServiceDetailsTool = new Object();
};
(function ($) {
(function (context) {
context.itemsPerPage = '10';
context.loadTool = function () {
TdcAsyncWebPartLoader.ShowTool({
... |
import path from 'path';
import pkg from './package.json';
import json from '@rollup/plugin-json';
import typescript from '@rollup/plugin-typescript';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
const NAME = pkg.name;
const UMD_NAME = pkg['umd-name'];
const tsCon... |
const CACHE_NAME = "Progressive-v2";
var urlsToCache = [
"/",
"../../nav.html./",
"../../index.html./",
"../../pages/home.html./",
"../../pages/about.html./",
"../../pages/contact.html./",
"../../css/materialize.min.css./",
"../../js/materialize.min.js./",
"../../js/nav.js./"
];
// install cache
se... |
// Drawable Functions
CharacterHandler.component_classes[General.COMPONENT_MOVER] = function(info) {
var values = info["val"];
this.magnitude = values["ms"];
this.accelerate = General.unpack_boolean(info["a"]);
this.vector = new Point3(info["c"].x, info["c"].y, info["c"].z);
this.face_direction = General.unpack_... |
import React, { useState } from 'react';
import useFetchJobs from './useFetchJobs.js';
import { Container } from 'react-bootstrap';
import JobDetail from './JobDetail';
import Job from './Job';
import Header from './Header';
import InfiniteScroll from 'react-infinite-scroll-component';
import SearchJob from './SearchJo... |
var nlp = require('compromise')
nlp.extend(require('compromise-numbers'))
var t = nlp('dinasour').nouns().toPlural()
console.log(t.text())
// .match() - Match text
let doc = nlp('i went on a talk, i walk')
let m = doc.match('. walk', { fuzzy: 0.7 })
console.log(m.text())
let ex = nlp("You are Ankita Patel").match(... |
$(document).ready(function() {
//check for returning player
if (localStorage.getItem('visited') != 'true') {
//set score and round number to default
localStorage.setItem('score', 0);
localStorage.setItem('round', 1);
//run setup for new players
firstTime();
}
})
let firstTime = () => {
//display tutorial... |
/**
*
* playlist list view
*
*/
define([
'configuration',
'utilities',
'backbone',
'underscore',
'jquery',
// using require js text for templates
'text!application/templates/playlist/list-0.0.1.html',
'text!application/collections/playlists-0.0.1'
], function(configuration, utiliti... |
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import { createStore } from "redux";
import { Provider } from "react-redux";
import { act } from "@testing-library/react";
///////////////INITIALIZE REDUCER//////... |
import React, { Component } from "react";
import PropTypes from "prop-types";
import classnames from 'classnames';
import Card from '@material-ui/core/Card';
import CardHeader from '@material-ui/core/CardHeader';
import CardMedia from '@material-ui/core/CardMedia';
import CardContent from '@material-ui/core/CardConten... |
/* Magic Mirror
* Module: MMM-MyWeather
*
* By John Wade
* MIT Licensed.
*/
Module.register("MMM-MyWeather", {
defaults: {
updateInterval: 10 * 60 * 1000,
animationSpeed: 5,
initialLoadDelay: 10,
retryDelay: 2500,
image: false,
... |
export const dateFilter = (a,b) => a.dates[a.dates.length-1].start - b.dates[b.dates.length-1].start |
import React, { Component } from 'react'
import { StyleSheet } from 'quantum'
import Header from './Header'
const styles = StyleSheet.create({
self: {
width: '100%',
overflow: 'hidden',
},
})
class Selector extends Component {
static defaultProps = {
base: [],
update: [],
filter: '',
}
... |
import React, { Component } from 'react';
import { Navbar, Nav } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import styled from 'styled-components';
export default class TopBar extends Component {
constructor(props) {
super(props)
this.state = {
}
}
render() {
... |
import Vue from 'vue/dist/vue'
import StarRating from 'vue-star-rating'
var star = new Vue({
el: "#reviews-index",
components: {
'star-rating': StarRating
},
})
|
import React, {Component} from 'react';
import {
Text,
View,
StyleSheet,
ScrollView,
TextInput,
TouchableOpacity,
FlatList,
} from 'react-native';
import DataList from './DataList';
import {storeData} from '../utils/Method';
import AsyncStorage from '@react-native-community/async-storage';
import {Colors... |
const { Model, DataTypes } = require("sequelize");
class Producer extends Model {
static init(connection) {
super.init(
{
name: DataTypes.STRING,
email: DataTypes.STRING,
phone: DataTypes.INTEGER,
},
{
sequelize: connection,
}
);
}
static associate(... |
import React, { Fragment , useState, useEffect} from 'react';
import { animated, useSpring } from 'react-spring'
import InputNumber from 'react-input-number';
import 'react-bootstrap-range-slider/dist/react-bootstrap-range-slider.css';
import RangeSlider from 'react-bootstrap-range-slider';
import './App.css';
con... |
import React from 'react';
import { Router, Route, hashHistory, IndexRoute } from 'react-router';
import App from './components/app'
import Test from './components/test'
export default (
<Router history={hashHistory}>
<Route path="/" component={App} >
<IndexRoute component={Test} />
</Route>
</Route... |
'use strict';
let config = {
// 服务端 host
host: 'http://localhost:3000',
// web 开发环境的 host
webHost: 'http://localhost:8080',
// 跨域白名单
whiteOrigins: [
'http://localhost:8080',
'http://www.paidepaiper.top',
'http://www.paidepaiper.xyz'
]
};
module.exports = config;
|
const words = new URLSearchParams(window.location.search);
var loc = words.get('location'), cords;
var currentUnixTime = Math.round(Date.now() / 1000), targetDate = new Date();
var timestamp = targetDate.getTime()/1000 + targetDate.getTimezoneOffset() * 60;
var localDate, offsets;
var formattedAd;
var day, temp, ... |
import React from "react"
import Responsive from "react-responsive"
import { Box } from "rebass"
import styled, { ThemeProvider } from "styled-components"
import Footer from "../components/footer"
import Header from "../components/header"
import { theme } from "../utils/styles"
import { rhythm } from "../utils/typograp... |
// controller.js
// This class handles input and converts it to control signals
var inherits = require("inherits");
var extend = require("extend");
var EventEmitter = require("events").EventEmitter;
// TODO https://developer.mozilla.org/en-US/docs/Web/Guide/API/Gamepad
function ControlManager() {
var self = this;
... |
import { describe, it } from 'mocha';
import React from 'react';
import { Link } from 'react-router';
import { shallow } from 'enzyme';
import { expect } from 'chai';
import App from './App';
describe('<App />', () => {
const app = shallow(<App />);
it('has link to chat', () => {
expect(app.contains(<Link t... |
import { Button } from '@material-ui/core';
import React, { useState } from 'react';
import Main from './components/BMT/Main';
const App = () => {
const [remittance, setRemittance] = useState(null);
const switchRemittance = () => {
switch (remittance) {
case 1:
return <Main />;
case 2:
... |
const express = require('express');
const dotenv = require('dotenv');
const logger = require('./middelware/logger');
const morgan = require('morgan');
const color = require('colors');
const connectDB = require('./config/db');
// load env vars
dotenv.config({ path: './config/config.env'});
const app = express();
// B... |
import { SEARCH_USER } from "./type";
export const searchUserMsg = (data)=>{
return (dispatch)=>{
dispatch({
type : SEARCH_USER,
payload : data
})
}
} |
var React = require('react');
var NavMenuButton = React.createClass({
render: function(){
return (
<div id='pf-nav-menu-btn'
className={this.props.menuOpen ? 'pf-nav-menu-btn pf-nav-close-icon' : 'pf-nav-menu-btn pf-nav-open-icon'}
onClick={this.props.handleClick}>
</div>);
}
});
module.exports ... |
import React, { Component } from 'react';
//import logo from './logo.svg'; // src={logo}
import { borderBox } from '../style-lib';
import { widthFlex } from '../style-lib';
import styled from 'styled-components';
const CheckList = styled.aside`
padding: 30px;
text-align: left;
overflow-y: auto;
min-hei... |
import template from './template';
import to from './to';
import fromUser from './from';
export default {
template,
to,
from: fromUser,
};
|
import React from "react";
import { QuizResult } from "./QuizResult";
import { Link } from "react-router-dom";
export const QuizCompleted = ({
result,
questions,
answers,
isCorrect,
isSelectedOption,
}) => {
return (
<div className="result-box">
<QuizResult result={result} /... |
module.exports = function(app) {
require('./application')(app);
require('./site')(app);
require('./notFound')(app);
require('./helo')(app);
};
|
const initState = {
name: 'hazyzh',
num: 11
}
/**
* todos reducer
* @param {Array} [state=[]] initstate
* @param {Object} action action
* @return {object} same as the initstate
*/
const inofoReducers = (state = initState, action) => {
switch (action.type) {
case 'ADD_NUM':
{
return {.... |
'use strict'
module.exports = function (sequelize, DataTypes) {
var Pin = sequelize.define('Pin', {
uid: DataTypes.STRING,
name: DataTypes.STRING,
title: DataTypes.STRING,
hex: DataTypes.STRING,
lat: DataTypes.DECIMAL,
lng: DataTypes.DECIMAL,
heading: DataTypes.INTEGER,
pitch: DataType... |
console.log("connected");
function printReverse(arr){
for(var i=arr.length-1;i>=0;i--)
console.log(arr[i]);
}
}
printReverse([3,6,2,5]);
function isUniform(arr){
var first=arr[0];
for(car i=1;i<arr.length;i++)
{
if(arr[i]!==first){
return false;
}
}
return true;
}
isUnif... |
/* eslint-env mocha */
const color = require('../')
const chai = require('chai')
chai.should()
const red = '\u001b[38;2;255;0;0m\u001b[10m'
const redbg = '\u001b[48;2;255;0;0m\u001b[10m'
describe('the color function', () => {
it('should handle single red, green and blue values as well as # color codes and color names... |
define( [ "ember", "ember-data" ], function( Ember, DS ) {
var get = Ember.get,
nocache_url = "%@?_=%@";
function nocache( attr ) {
return Ember.computed( attr, function() {
return nocache_url.fmt( get( this, attr ), +new Date() );
});
}
return DS.Model.extend({
large: DS.attr( "string" ),
medium: D... |
var router = require("express").Router();
//allows joining of file names
var path = require("path");
//returns the notes.html file
//best practice is separate files
//one file for these and one file for api routes
router.get("/notes", function (req, res) {
//.sendfile contatonates
//belongs to the response ob... |
// @flow
import * as React from 'react';
import { defaultTokens } from '@kiwicom/mobile-orbit';
import { View } from 'react-native';
import { type TranslationType } from '@kiwicom/mobile-localization';
import type { OnLayout } from '../types/Events';
import Text from './Text';
import StyleSheet from './PlatformStyleS... |
class APIFeatures {
constructor(query, queryObject) {
this.query = query;
this.queryObject = queryObject;
}
filter() {
//filtering and advanced filtering
const excludeFieldsObj = {
sort: 'sort',
limit: 'limit',
page: 'page',
fields: 'fields',
};
let queryObj = {};
... |
console.log("Hello");
console.log("Apples");
console.log("This is a statement");
console.log("This is also a statement");
var myFunc = function (name, weather) {
console.log('This is a statement');
console.log("Hello " + name + ".");
console.log("It is " + weather + " today");
};
myFunc("Jeong", "sunny");
v... |
var
passport = require('passport'),
LocalStrategy = require('passport-local').Strategy,
User = require('../models/User.js')
//creating session for cookie, does login
passport.serializeUser(function(user,done){
done(null, user.id)
})
//takes cookie, translate, find id, find user with id, go to user page
passpo... |
my.controller('allProjects',["$scope","$http"
,function($scope, $http){
var url= "http://localhost:3000/allprojects"
$http({
url:url,
method: "GET",
isArray: true
})
.success(function(data){
console.log(data)
$scope.as= data.projects;
console.log($scope.as)
})
.error(function(data){
co... |
//已经战胜 20.44 % 的 javascript 提交记录
//解决思路: 先通过二分法找到与target相等的位置,然后再分别找到与出现最早的位置和最晚的位置
//时间复杂度: O(logn)
var searchRange = function(nums, target) {
let len = nums.length;
if(len === 0) return [-1,-1];
let left = 0;
let right = len-1;
let mid = left + parseInt((right-left)/2);
while(mid<=len-1 && mi... |
import Info from '@material-ui/icons/Info';
import Tilt from 'react-tilt';
import InfoOutlinedIcon from '@material-ui/icons/InfoOutlined';
import React from 'react';
import './navbar.css';
export const AboutButton = () => {
return (
<Tilt className="Tilt aboutButton" options={{ max : 70 }} style={{}}... |
var view={
displayMessage: function(msg){
var messageArea = document.getElementById('messageArea');
messageArea.innerHTML = msg;
$(messageArea).addClass('show');
var a = controller.guesses;
setTimeout(function () { if ((!model.gameOver) && a == controller.guesses) {$(messageArea).removeClass('show');}}, 8... |
'use strict';
const _ = require('lodash');
const useragent = require('useragent');
const uaParser = require('ua-parser-js');
const seeagent = require('../lib');
const ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36';
const uas = [];
for (l... |
import React from 'react';
import Select from './Select';
import renderer from 'react-test-renderer';
import { shallow } from 'enzyme';
test('It renders the select component when you pass in an array of options', () => {
const props = {
name: 'Test',
options: ['calico', 'pooch', 'spaghetti'],
... |
const { Entrypoint } = require('@pm2/io')
const pm2 = require('pm2')
class App extends Entrypoint {
onStart (cb) {
this._config = this.io.initModule({
events: ['adonis:hop']
})
pm2.connect((err) => {
if (err) {
return cb(err)
}
pm2.launchBus((err, bus) => {
i... |
class Visualization extends ISteppable{
constructor(element) {
super();
this.squareSize = 100;
this.colors = ["#ff3232", "#32CD32", "#3232ff", "#ffa500"];
this.currentStep = 0;
this.maxStep = 8;
this.init(element);
}
init(element){
this.scene = new ... |
import React from 'react'
import { connect } from 'react-redux'
import { Grid, Icon } from 'semantic-ui-react'
import { pushRoute, unavailable } from '../../../actions'
const items = [{
icon: 'home',
route: '/',
feature: '首頁',
},{
icon: 'food',
route: '/food',
feature: '飲食熱量紀錄',
},{
icon: ... |
myApp.factory('messages',function(){
var messages = {};
messages.list = [
{
id: 0,
text: "Welcome"
}];
messages.add = function(message){
messages.list.push(
{
id: messages.list.length,
text: message
});
};
return messages;
}); |
module.exports = (Plugin, BD, Vendor, v1) => {
const {Api, Storage} = BD;
let {$} = Vendor;
const minDIVersion = '1.3';
if (!window.DiscordInternals || !window.DiscordInternals.version ||
window.DiscordInternals.versionCompare(window.DiscordInternals.version, minDIVersion) < 0) {
const... |
import React, { useState } from 'react';
import {
ListItem,
ListItemText,
Typography,
IconButton,
Box,
Popover,
} from '@material-ui/core';
import DeleteIcon from '@material-ui/icons/Delete';
import EditIcon from '@material-ui/icons/Edit';
import { useSelector, useDispatch } from 'react-redux';
import Comme... |
import {
Block,
BlockTitle,
Button,
Col,
Link,
List,
ListItem,
Navbar,
NavLeft,
NavRight,
NavTitle,
Page,
Card,
Icon,
Row,
CardHeader,
CardFooter,
Stepper,
CardContent,
f7,
} from "framework7-react";
import React from "react";
const StarForReviews = ({ starNumber }) => {
retur... |
import HomeIcon from './img/home-7.svg';
import TVIcon from './img/tv-21.svg';
export default [
{
name: 'Home',
icon: HomeIcon
}, {
name: 'Manage TV Shows',
icon: TVIcon
}
]
|
import {
CHANGE_SEARCH,
LOAD_VENUES,
LOAD_VENUES_SUCCESS,
LOAD_VENUES_ERROR,
LOCATION_CHANGED,
} from './constants';
export function changeSearch(search) {
return {
type: CHANGE_SEARCH,
search
};
}
export function loadVenues() {
return {
type: LOAD_VENUES,
};
}
export function venuesLoa... |
import React from "react";
import { Typography } from '@material-ui/core';
export default function OComponent(props) {
return (
<>
<Typography variant="h1" style={{ color: "orange", fontWeight: 700 }}>O</Typography>
</>
)
}
|
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import firebase from '@react-native-firebase/app';
import Routes from './src/routes';
const firebaseConfig = {
apiKey: 'AIzaSyDFrLX-eiA37O30bHhxZPWu2CIQC6KKQMg',
authDomain: 'meau-550bb.firebaseapp.com',
databaseURL: 'https:... |
import axios from "axios";
const addCommentForm = document.getElementById("jsAddComment");
const commentList = document.getElementById("jsCommentList");
const commentNumber = document.getElementById("jsCommentNumber");
const addCommentButton = document.getElementById("jsAddCommentButton");
const removeCommentButton =... |
import React, { Component } from 'react';
class WorkFooter extends Component {
render() {
return(
<div className='footer'>
{this.props.work.endnotes &&
<div className='notes'>
<h6>End Notes</h6>
<div dangerouslySetInnerHTML={{__html: this.props.work.endnotes}}>
... |
const mongoose = require('mongoose');
const chai = require('chai');
const User = require('../src/users');
describe('/users', () => {
beforeEach((done) => {
User.deleteMany({}, () => {
done();
})
.catch(error => done(error));
});
describe('POST /users', () => {
it('creates a new user in th... |
/*
* 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 in writing, software
* distribut... |
import './modal.css'
import {AnimatePresence, motion} from "framer-motion";
import {forwardRef, useImperativeHandle, useState} from "react";
function SmallModal(props, ref) {
const [open, setOpen] = useState(false)
useImperativeHandle(ref, () => {
return {
add: () => setOpen(true),
end: () => set... |
import styles from './index.less'
import 'braft-editor/dist/index.css'
import 'braft-extensions/dist/code-highlighter.css'
import React from 'react'
import { Base64 } from 'js-base64'
import ArticleComment from './ArticleComment'
import BraftEditor from 'braft-editor'
import CodeHighlighter from 'braft-extensions/dist... |
import React, { useState } from 'react'
import { PostService } from '../../../services/post.service';
function CommentAdd({postId,onCommentAdd}) {
const [content, setContent] = useState('');
async function submit(e) {
e.preventDefault();
const comment = await PostService.addComment(postId, co... |
'use strict';
import { STORE_BANKS_DATA } from '../actions/actionTypes';
import { ListView } from 'react-native';
const initialState = {
banksList: new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2})
};
export default function rates(state = initialState, action) {
if (action.type === 'STORE_BANKS_DAT... |
$(function(){
//页面加载完成之后执行
//pageInit();//ajax获取数据
//myPageInit();//本地数据
pageInitCustom();//自定义数据解析
});
//formatter:对列进行格式化时设置的函数名
function editFormaterLiner(cellValue, options, rowObject) {
console.log(options);
if (cellValue) {
return "<a href='javascript:void(0);' data-val='" + JSON.stringify(rowObject) + "... |
import React from "react";
import "./Footer.css";
import TwitterIcon from "@material-ui/icons/Twitter";
import InstagramIcon from "@material-ui/icons/Instagram";
import FacebookIcon from "@material-ui/icons/Facebook";
import { NavLink } from "react-router-dom";
import Footer_data from "./F__Data";
export default functi... |
import React, { Component } from 'react';
import './App.css';
import TodoItem from './components/TodoItem'
import arrdown from './image/icon/arrow-down.svg'
class App extends Component {
constructor() {
super();
this.state = {
toDoList: [
{ title: "Đi Làm", isComplete: false },
{ title:... |
var foo = true;
if (foo) {
let bar = foo * 2;
console.log( bar );
}
console.log( bar ); // ReferenceError |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { addComment } from '../actions/commentAction';
class AddComment extends Component {
state = {
comment: ''
};
onSubmit = event => {
event.preventDefault();
this.props.addComment(this.state.comment);
this.s... |
months=['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
months_complete=['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'];
var current_year = (new Date).getFullYear();
var current_month = (new Date).getMonth... |
const RefundsPage = require('../pageObjects/refundsPage.js');
const headerPage = require('../pageObjects/headerPage');
const { defineSupportCode } = require('cucumber');
defineSupportCode(function ({ Then, When }) {
let refundsPage = new RefundsPage();
When(/^I click on Refunds button$/, async function () {
a... |
const fs = require('fs');
const util = require('util');
const path = require('path');
const dataPath = path.join(__dirname, 'mockData.json');
const writeFile = util.promisify(fs.writeFile);
const readFile = util.promisify(fs.readFile);
const saveMockData = async (data) =>
await writeFile(dataPath, JSON.stringify(da... |
var msg = 'Hello World';
console.log(msg);
var http = require('http');
var os = require('os');
var hostname = os.hostname();
var fs = require('fs');
var qs = require('qs');
var moment = require('moment');
var port = process.env.PORT || 3000;
function handleRequest (request, response) {
response.writeHeader(200, {... |
import React from 'react';
import styled, { ThemeProvider, createGlobalStyle } from 'styled-components';
import styledNormalize from 'styled-normalize';
import { Helmet } from 'react-helmet';
import Header from '../components/header';
import Footer from '../components/footer';
const GlobalStyle = createGlobalStyle`
... |
const mongoose = require('mongoose');
let menuItemSchema = new mongoose.Schema({
name: {
type: String,
required: true,
unique: true
},
restaurant_id: {
type: mongoose.ObjectId,
ref: 'Restaurant',
required: true
},
description: {
type: String,
required: true
},
price: {
type: Number,
required... |
/* eslint indent: 0 */
const DOMPurify = require('dompurify');
const marked = require('marked');
const yo = require('yo-yo');
const cardClass = 'cardContainer';
const RENDER_MD = 1;
module.exports = (cardInfo) => {
const cardId = `yellowCard-${cardInfo.id}`;
let dragging = false;
let x0 = 0;
let x1 = 0;
let... |
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import { Box, Avatar } from '@material-ui/core';
import RoomIcon from '@material-ui/icons/Room';
import VideocamIcon from '@material-ui/icons/Videocam';
const useStyles = makeStyles((theme) => ({
avatar: {
height: 24,
width:... |
var app = angular.module('MasteryMaster', ['ngRoute']);
app.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'champMasteries.html',
controller: 'champMasteriesController',
activeTab: 'champMasteries'
})
.when('/achievem... |
import React, {Component} from 'react';
import {
View,
Text,
StyleSheet,
TabBarIOS
} from 'react-native';
import { Actions } from 'react-native-router-flux';
const base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAQAAACSR7JhAAADtUlEQVR4Ac3YA2Bj6QLH0XPT1Fzbtm29tW3btm3bfLZtv7e2ObZnms7d8Uw09... |
'use strict';
import {Utils} from '../util'
let utils = new Utils();
export const actions = {
/**
* 通过手机验证码获取jwt token
* @param commit
* @param state
* @param verify_payload
*/
getAuthToken ({commit, state}, verify_payload) {
return new Promise((resolve, reject) => {
utils.post('/auth/ver... |
// I got to use the css toggle switch
// https://ghinda.net/css-toggle-switch/
//THINGS TO CONSIDER:
// Key value pair >>>>this is what I need to look up
// I could I use the changing property setting to save settings?????
// REDOFOME THE DATABASE AND ADD CLASSES TO IT
//ALERT FUNCTIONALITY
const alertBanner = do... |
//apply redux in the ContactList element
import React from 'react';
import { connect } from 'react-redux';
import {menuChangeView, entryLogoutAccount,menuPopulateUsers} from '../../../../actions';
import Header from '../header';
import SearchBar from '../searchbar';
import Filter from '../filter';
import ContactList... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.