text stringlengths 7 3.69M |
|---|
import React from 'react';
import { Link } from 'react-router-dom';
import PropTypes from 'prop-types';
import DisplayErrorsStyled from './DisplayErrorsStyled';
const DisplayErrors = ({ getErrorMessage, msg }) => {
const handleClick = () => {
getErrorMessage(false, []);
};
return (
<DisplayErrorsStyled>... |
import firebase from 'firebase'
const config = {
apiKey: 'AIzaSyDkBwk4y_0owfwnO5ojDvIYved6gOLzppc',
authDomain: 'cspot-ify.firebaseapp.com',
databaseURL: 'https://cspot-ify.firebaseio.com',
projectId: 'cspot-ify',
storageBucket: 'cspot-ify.appspot.com',
messagingSenderId: '154842492597'
}
export const fir... |
const express = require("express");
const connection = require("./db/connection");
require("console.table");
const inquirer = require("inquirer");
require("mysql");
require("mysql2");
// const callback = require("./db/callback");
const PORT = process.env.PORT || 3001;
const app = express();
connection.connect((err) =... |
import React, { Component } from 'react';
import { View, Button, StyleSheet } from 'react-native';
export default class LikeBar extends Component {
displayBtn = (name) => {
alert(name);
}
render() {
return (
<View style={styles.controlContainer} >
<View style={styles.controlBar}>
<B... |
import React from 'react';
import { slide as Menu } from 'react-burger-menu';
import SideItem from './side-item'
import SideNav from 'react-simple-sidenav';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
export default props => {
return (
<Menu>
<a className="menu-item" href="/">
... |
/*
|--------------------------------------------------------------------------
| Utils
|--------------------------------------------------------------------------
*/
import path from 'path';
import fs from 'fs';
import mmd from 'musicmetadata';
import globby from 'globby';
import Promise from 'bluebird';
... |
/*var html = "Сайн уу ";
html = html.replace("уу", " байна уу ");
console.log(html);
var a = "<p>Сайн уу </p>";
html1 = a.replace("p", " strong");
console.log(html1);
var b = "<el>Сайн уу </el>";
html = b.replace(/el/gi, " emmat");
console.log(html);
*/
var incDiv = document.querySelector(".income");
incDiv.insertAd... |
$(function () {
$('#lbl_btn_new').click(function () {
$('#site-map').hide();
$('#tab-body').show();
$('.main-display').show();
$('.main-sheet').resizable();
});
});
$(function () {
$('#add_card').click(function () {
$('#rotate-div').show(... |
import { h, Component } from 'preact';
import axios from 'axios';
import TimeAgo from 'javascript-time-ago';
import en from 'javascript-time-ago/locale/en';
import Rheostat from 'preact-rheostat';
import './rheostat.css';
import Select from 'preact-material-components/Select';
import 'preact-material-components/List/st... |
import { Typography } from "@material-ui/core";
import React from "react";
function MyTypography(props) {
return (
<Typography variant="h3" {...props}>
{props.children}
</Typography>
);
}
export default MyTypography;
|
let path = require('path')
let webpack = require('webpack')
let ExtractTextPlugin = require('extract-text-webpack-plugin')
const join = (dest) => {
return path.resolve(__dirname, dest)
}
let config = module.exports = {
entry: {
application: [
join('web/static/css/application.scss'),
join('web/stat... |
import fs from './fs'
import pify from 'pify'
export async function rm (filepath) {
try {
await pify(fs().unlink)(filepath)
} catch (err) {
if (err.code !== 'ENOENT') throw err
}
}
|
var Tree = function(value) {
var newTree = {};
newTree.value = value;
// your code here
_.extend(newTree, treeMethods);
newTree.children = null; // fix me
newTree.parent = null;
return newTree;
};
var treeMethods = {};
treeMethods.addChild = function(value) {
this.children = this.children === null ?... |
const common = require('./common');
module.exports = {
...common,
globals: {
NODE_ENV: 'test',
TEST_ENV: 'browser'
},
testEnvironment: 'jsdom',
resolver: '<rootDir>/jest/resolver.js'
};
|
/**
* Created by alex on 22.10.2015.
*/
class Type {
constructor (name, size = null, def = null) {
this.name = name;
this.size = size;
this.def = def;
}
toSQL () {
let typeStr = `${this.name}`;
if (this.size) return `${typeStr}(${this.size})`;
return typeStr;
}
}
class Varchar extends Type {
constr... |
import * as types from "./constant"
const initialState = {
animals: [],
loading: false,
authen: false,
login: ""
};
const myReducer = (state = initialState,action) => {
switch(action.type){
case types.AUTHENTICATION:
return {
...state,
authen: tru... |
import ComList from './container/ComList'
import reducer from './reducer'
export {
ComList,
reducer
} |
function handleAjax(data) {
var status = data.status;
switch(status) {
case "begin":
// This is invoked right before ajax request is sent.
break;
case "complete":
// This is invoked right after ajax response is returned.
break;
case "suc... |
import placeholders from '../text/placeholders';
import getErrorMessage from './getErrorMessage';
export function get(key) {
return (obj) => obj[key];
}
export function equal(key, value) {
return (obj) => obj[key] === value;
}
export function getField({
field: { value, error },
id,
name,
onChange,
}) {
... |
/* 🤖 this file was generated by svg-to-ts*/
export const EOSIconsSouthEast = {
name: 'south_east',
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 9h-2v6.59L5.41 4 4 5.41 15.59 17H9v2h10V9z"/></svg>`
};
|
'use strict';
module.exports = {
async getAllUsers() {
return new Promise(function (resolve, reject) {
db.query('SELECT * FROM tb_usuarios', function (err, result) {
if (err) return reject(err);
return resolve(result);
});
});
},
async ... |
import { IndividualItemMain } from './individual-item';
import { Link } from "react-router-dom";
//Código do item único do portifólio que receberá por parâmetro
//a lista de itens da coleção 'Portifolio-item'
export const PortifolioItemMain = ({ items }) => {
return (
items.map((individualItem) => { //Ma... |
import React from "react";
import styles from "./Button.module.css";
const Button = () => {
return <button className={styles.button}>CALL TO ACTION</button>;
};
export default Button;
|
import axios from 'axios';
import { put, takeLatest } from 'redux-saga/effects';
import {
ActionType,
AllUsersAction
} from '../actionTypes';
function* fetchAllUsers() {
try {
const response = yield axios.get('api/user/all');
yield put(AllUsersAction.set(response.data));
} catch (error)... |
var modules =
[
[ "Device addresses", "group___device_addrs.html", "group___device_addrs" ],
[ "General Constants", "group___general_constants.html", "group___general_constants" ],
[ "Device settings", "group___device_settings.html", "group___device_settings" ],
[ "Errors and warnings", "group___error_c... |
'use strict';
const extender = require(`object-extender`);
const utilities = require(`../../modules/utilities`);
/*
* Allows all dependencies to be obtained on a single line.
*/
function prepareDependencies () {
return {
database: this.__dep(`database`),
MessageObject: this.__dep(`MessageObject`),
sharedLog... |
// defino dato deltemperamento
const {DataTypes}=require('sequelize');
module.exports=(sequelize)=>{
sequelize.define('temperament',{
//id se genera solo, sequelize por defecto lo genera solo
name:{
type:DataTypes.STRING,
allowNull:true
},
},{
timestamps... |
import React from "react";
import AxiosGet from "./components/AxiosGet";
function App(){
return (
<div>
<h1>Start React 2021!</h1>
<AxiosGet />
</div>
);
};
export default App; |
showConstruction = false;
showNodeConnections = true;
var Curve = function() {
this.timeKnot = new Knot(0,0,true);
this.knots = new Array();
this.nodes = new Array();
};
Curve.prototype.draw = function(ctx)
{
if (showNodeConnections) {
// Connect nodes with a line
setColors(ctx,'rgb(10,70,160)');
... |
import React, { useEffect, useState } from 'react';
import './App.css';
import logo from './logo.svg';
function App() {
const heros = ['Sharukh Khan', 'Salman Khan', 'Irfan Khan', 'Amir Khan', 'Sakib Khan', 'Salman Khan']
const products = [
{ name: 'Photoshop', price: '99.99' },
{ name: 'Illu... |
const userAuthController = require('../controller/userAuthController')
var router = require('express').Router();
module.exports = function(){
const userCntrl = new userAuthController();
router.post('/register', userCntrl.signUp );
router.post('/authenticate', userCntrl.login);
return router;
} |
(function(){
$(function(){
Route.getcoupon(function(data){
var str = template('txt',data);
$('main ul').html(str);
})
})
})(); |
import React,{Component}from 'react'
import Person from './Person/Person'
class Persons extends Component{
UNSAFE_componentWillMount(){
console.log("[Person.js] componentWillMount.")
}
componentDidMount(){
console.log("[Person.js] componentDidMount")
}
UNSAFE_componentWillReceiveP... |
'use strict';
const React = require('react');
const { Component } = React;
const PropTypes = require('prop-types');
const classnames = require('classnames');
const Header = require('./header');
const Footer = require('./footer');
require('./index.less');
class Layout extends Component {
render() {
const... |
import React, {Component} from 'react';
import {connect} from 'react-redux';
import PropTypes from 'prop-types';
import {Alert, Col, Row} from 'reactstrap';
import {addFlashMessage} from '../../actions/flashMessageAction';
import {getTopicById} from '../../actions/topicAction';
import TopicMainBox from '../../component... |
import * as api from '@/api/card'
export default {
namespaced: true,
state: { cards: [] },
getters: {
getCards: ({ cards }) => boardListId => {
return Array.isArray(cards)
? cards.filter(card => card.boardListId == boardListId)
: null
},
getCard: ({ cards }) => id =>
Array... |
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
/**
* 定义模型 会议室表模型
*/
const meetingSchema = new Schema({
name: String,
position: String,
capacity: Number,
equipment: String,
icon: String,
status: {
type: Boolean,
default: true,
},
appointment_list: [{
start: Number,
... |
import React from 'react'
// import { Link, useParams } from 'react-router-dom'
const Profile = (props) => {
return (
<div>
<div>
<div id='description'>
<ol className="list-decimal list-inside m-6">
{props.project}
</ol>
</div>
{/* <ReactMarkdown so... |
import React from 'react';
import { Link } from 'react-router-dom';
const Greeting = ({ currentUser, logoutSession }) => {
const sessionLinks = () => (
<nav className='session-links'>
<Link to="/login">Login</Link>
<br/>
<Link to="/signup">Sign up!</Link>
</nav>
... |
angular.module('focus.models.userprofile', [
'ngResource'
])
.factory('userProfileModel', [
'$resource',
function($resource) {
return $resource( '/api/user/:id', { id: '@Id' }, {});
}
]); |
import React from 'react';
import PropTypes from 'prop-types';
import './styles/circleButton.css';
export const CircleButton = ({
onClick,
isClicked,
innerCircleClassName,
innerCircleClickedClassName,
outerCicleClassName,
circlesContainerClassName
}) => {
const innerCircleClasses = isClicked ? innerCirc... |
import { all, takeLatest } from 'redux-saga/effects'
import { LoginTypes } from '../reducers/LoginReducer'
import client from 'controllers/HttpClient';
import {test} from './LoginSagas'
/* ------------- API ------------- */
// The API we use is only used from Sagas, so we create it here and pass along
// to the saga... |
/*global define, d3*/
define( [
'jquery',
'underscore',
'qvangular',
'text!./swr-calendarview.ng.html',
'text!./swr-calendarview.css',
'text!./colorbrewer.css',
'./../../js/calendar',
// no return value
'./../../external/d3/d3.min'
], function ( $, _, qvangular, ngTemplate, cssContent, cssColorBrewer, calend... |
// Another way of creating map
const x = new Map([
["Hello", "Ramesh"],
["How are you", "Tell me"],
[1, "Java"],
[2, "Javascript"],
[3, "Golang"]
]);
console.log(x);
// So what i am getting here MAP => array of array
// so lets do one trick
// here is an object
const weekda... |
import styled from 'styled-components';
export const Title = styled.Text`
color: black;
justify-content: center;
font-weight: bold;
align-items: center;
`;
export const Button = styled.TouchableOppacity`
color: black;
height: 30px;
width: 80px;
align-items: center;
justify-content: centar;
`;
|
'use strict';
module.exports = function(app){
var apiKey = process.env.TRANSLATE_KEY
, sentiment = require('sentiment')
, googleTranslate = require('google-translate')(apiKey);
return {
index: function(phrase){
return q.nbind(googleTranslate.translate, googleTranslate)(phrase,... |
const Recipes = require('./recipeModel');
const express = require('express');
const router = express.Router();
//get all recipes
router.get('/', async (req, res) => {
try {
const recipes = await Recipes.getRecipes();
res.json(recipes);
} catch (err) {
res.status(500).json({ message: 'Failed to get sc... |
// <%= projectName %>
|
import React from "react";
import "../Style/Decrease.css";
import { connect } from "react-redux";
function Decrease(props) {
const {decrease} = props
return (
<div className={"decrease"}>
<button onClick={decrease} className={"dec__button"}>DECREASE</button>
</div>
);
}
function mapDispatchToProp... |
const functions = require("firebase-functions");
const admin = require("firebase-admin");
const newUser = functions.auth.user().onCreate((user) => {
return addUser(user);
});
// It creates a new Document when a new User joins
const addUser = (cred) => {
return admin
.firestore()
.collection("users")
.... |
const mongoose = require('mongoose')
const Schema = mongoose.Schema
mongoose.connect('mongodb://localhost:27017/blogProject', {useNewUrlParser: true, useUnifiedTopology: true})
const UserSchema = new Schema({
email: {
type: String,
required: true
},
nickname: {
type: String,
required: true
},... |
Ext.define('PWApp2.store.WellTypeStore', {
extend: 'Ext.data.Store',
storeId: 'WellTypeStore',
fields: ['name' ],
data : [
{ name: 'CBM' },
{ name: 'CONVENTIONAL HYDROCARBON' },
{ name: 'GEOTHERMAL' },
{ name: 'SHALE GAS' },
{ name: 'TIGHT GAS' },
... |
const url = "https://striveschool-api.herokuapp.com/api/product/";
let urlParams = new URLSearchParams(window.location.search);
let id = urlParams.get("id");
const fetchProduct = async () => {
try {
let response = await fetch(url + id, {
headers: {
Authorization:
"Bearer eyJhbGciOiJIUzI1Ni... |
class Player {
constructor() {
this.spot = 0;
}
roll() {
let r = floor(random(1, 4));
this.spot += r;
}
reset() {
this.spot = 0;
}
show(tiles) {
let current = tiles[this.spot];
fill(255);
let center = current.getCenter();
... |
/**
* Copyright (c) Benjamin Ansbach - all rights reserved.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
const Endian = require('./../../Endian');
const CompositeType = require('./../CompositeType');
const Int32 = require('./../C... |
import React from "react";
import {
StyleSheet,
View,
FlatList,
Button,
Text,
TouchableOpacity,
} from "react-native";
import { useSelector, useDispatch } from "react-redux";
import Colors from "../constants/Colors";
import * as trackerActions from "../store/actions/trackerActions";
const ListaTrackers = ... |
var fs = require('fs');
var cp = require('child_process');
var serverFile = 'jsTicket.js';
var server = cp.fork(serverFile);
console.log('Server Script gestartet');
fs.watchFile(serverFile, function (event, filename) {
server.kill();
console.log('Server stopped');
server = cp.fork(serverFile);
consol... |
import {firebaseAction} from 'vuexfire';
export const setLocations = firebaseAction(({bindFirebaseRef}, ref) => {
bindFirebaseRef('locations', ref);
});
export const setUser = ({ commit }, user) => {
commit('SET_USER', user);
};
export const mapCenter = ({ commit }, data) => {
commit('SET_MAPCENTER', data);
};
|
import React from 'react'
import styled from 'styled-components'
import NumberFormat from 'react-number-format';
import {db} from './firebase'
function CartItem ({ id, item }) {
const deletItem = (e) =>
{
e.preventDefault()
db.collection('cartitems').doc(id).delete();
}
let optio... |
import shared from 'shared/utils/helpers';
var helpers = Object.assign({}, shared, {
sortDates(objects, field, order){
return objects.sort((a, b) => {
let dateA = a[field] ? new Date(a[field]) : 0,
dateB = b[field] ? new Date(b[field]) : 0;
if (dateA > dateB) return ... |
const mongoose = require( 'mongoose' ) ;
const { errData } = require('../../response') ;
var itemSchema = new mongoose.Schema ({
Name : { type : String, index: { unique: true } },
Qty : Number,
Unit : String,
UserID : { type : mongoose.Schema.Types.ObjectId, required : true },
});
itemSchema.st... |
import React from 'react'
function UserAvatar({user}) {
return (
<>
<img className= 'user-avatar' src={user.avatar} alt="avatar"/>
</>
)
}
export default UserAvatar
|
let growing = {};
const addPlant = (seedObj) => {
return growing.push(seedObj);
};
const usePlants = (growing) => {
return growing;
};
// Array.isArray(seedObj)
// let seedObj = createCorn;
// console.log(seedObj); |
// Your logo, game name, sponsors etc that shows up when the player starts the game
// Create intro state
var IntroState = {
preload: function() {
},
create: function() {
},
update: function() {
}
}
|
import React from 'react';
import { fireEvent, render } from '@testing-library/react';
import InformationForm from './InformationForm';
import placeholders from '../text/placeholders';
describe('InformationForm', () => {
const fields = {
sender: {
id: 'sender',
name: '보내는 사람',
value: '',
... |
import React from 'react';
import Header from './Header';
const Home = (props) => <div><Header/><h1>Our site</h1>{props.children}</div>;
export default Home |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const difference = (a, b) => {
const s = new Set(b);
return a.filter(x => !s.has(x));
};
exports.default = difference;
|
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Add from 'material-ui-icons/Add';
import Button from 'material-ui/Button';
import Remove from 'material-ui-icons/Remove';
import Table, {
TableBody,
TableCell,
TableHead,
TableRow
} from 'm... |
import React from "react";
import "./mobile.css";
function mobile() {
return (
<div class="container1" style={{ background: "#be3956" }}>
<div class="text-with-animation">Not supported on</div>
<div class="subtext-with-animation">
<span>Mobile</span> <span>Phones</span>
</div>
</div>... |
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter as Router, Switch, Route} from "react-router-dom";
import { Header, Footer} from './components';
import { About, Users, Main, Error } from './pages';
import { ThemeProvider, createTheme } from '@material-ui/core/styles';
import CssBase... |
var mongoose = require('mongoose');
var eventSchema = mongoose.Schema({
title: String,
start: Date,
details: String,
userId: {
type: mongoose.Schema.Types.ObjectId,
required: true,
ref: 'User'
}
});
//this is if there were multiple models in one file
// module.exports = {
// User: mon... |
var array=[];
$(document).ready(function () {
// $('.lista-seleccionable').selectable();
// $('.lista-seleccionable li').draggable();
$('.lista-seleccionable').sortable({
update:function (event, ui) {
array.push(ui.item[0].innerText)
console.log(ui.item[0].innerText)
... |
const { db } = require("../../database");
const { createToken } = require("../../helpers/jwt");
const crypto = require("crypto");
const BASE_URL = "https://warehouse-3.purwadhikafs2.com";
module.exports = {
adminLogin: (req, res) => {
const { email, password } = req.body;
const hashPassword = crypto
.... |
var searchData=
[
['main_2ecpp',['main.cpp',['../main_8cpp.html',1,'']]],
['map_5findex',['map_index',['../classtree.html#a3d4607480844b71710879a7986e8e5aa',1,'tree']]],
['match',['match',['../classgraph__cluster.html#acc9ec322b82fe84e82c2b6c10ba8ab1c',1,'graph_cluster']]]
];
|
/**
* ESP
* Boilerplate app for combining
* Express & Socket.IO with auth
* from Passport.
*/
const config = require('./config');
const express = require('express');
const session = require('express-session');
const passport = require('passport');
const cookie = require('cookie');
const memoryStore = new sessio... |
if (!window.guru) window.guru = {};
if (!guru.shapes) guru.shapes = {};
if (!guru.error) {
guru.error = function(message) {
console.log('%c ERROR %c %s', 'background-color: red; color: white;', 'background-color: transparent; color: inherit;', message);
};
}
if (!guru.warn) {
guru.warn = function(message) {
co... |
({
/**
* aura method to be invoked from Master Flow
*
* @param {Component}
* component
* @param {Event}
* event
* @param {Helper}
* helper
* @return parameters to be sent to master component
*/
getAttributeMethod: function(co... |
import React, { Component } from "react"
import PropTypes from "prop-types"
import styled from "styled-components"
import { connect } from "react-redux"
import { Markdown } from "../common"
import LessonActions from "../../redux/lessonStore"
import { ReactComponent as SkipIcon } from "../../assets/images/skip.svg"
co... |
export function unique (l) {
return Array.from(new Set(l))
}
export function sentimentToPhrasesMap (expressedSentiments) {
const map = {}
expressedSentiments.forEach(expressedSentiment => {
if (map[expressedSentiment.sentiment] === undefined) {
map[expressedSentiment.sentiment] = [expressedSentiment.... |
import RouterHelper from '../RouteHelper';
import React from 'react';
const title = '运输订单';
const prefix = '/order';
const children = [
require('./input').default,
require('./import').default,
require('./accept').default,
require('./pending').default,
require('./complete').default,
require('./all').defaul... |
import React, {Component} from 'react';
import {ScrollView, Text} from 'react-native';
import styles from '../../assets/jammStyle';
import favicon from '../../assets/favicon.png';
export default class ButtonInstr extends Component {
constructor(props) {
super(props);
this.buttonPress = this.buttonP... |
var searchData=
[
['enforceconstraint2_2ecs_67',['EnforceConstraint2.cs',['../_enforce_constraint2_8cs.html',1,'']]]
];
|
// initial migration of users table
export function up(knex, Promise) {
return Promise.all([
knex.schema.createTable('users', function (table) {
table.bigIncrements('id').primary().unsigned();
table.string('first_name', 50);
table.string('last_name', 50);
tab... |
import React from 'react';
import { connect } from 'react-redux';
import { Platform, Text, TouchableOpacity,
View, FlatList, Image, ActivityIndicator, Dimensions,
ScrollView, ImageBackground } from 'react-native';
import ProgressCircle from '../components/ProgressCircle';
import BasicButton from '../components/B... |
const env = process.env;
const http = require('http')
const port = 5000
function sortObject(o) {
var sorted = {},
key, a = [];
for (key in o) {
if (o.hasOwnProperty(key)) {
a.push(key);
}
}
a.sort();
for (key = 0; key < a.length; key++) {
sorted[a[key]] =... |
import React from "react";
import "./App.css";
import 'bootstrap/dist/css/bootstrap.min.css';
import Template from "./template/Template";
function App() {
return (
<>
<Template/>
</>
);
}
export default App; |
//此页面利用reducer进行数据的处理,使得数据处理更加高效
//immutable的特点:1、一旦创建,就不能被更改,任何修改或添加删除都会返回一个新的immutable对象
//2、对象书中一个节点发生变化,只修改这个节点和受它影响的节点,其他节点进行共享
import * as types from './actionTypes.js'
import { fromJS } from 'immutable'
const defaultState = fromJS({//初始化默认数据,用fromJS方法将数据转换为immutable对象
list:['吃饭','睡觉','打豆豆'],
task:''
})
//redu... |
// Pokemon
import React, { Component } from 'react';
import * as actionCreators from './../../../../store/actions'
import { Grid, Image } from 'react-bootstrap'
import fetch from 'isomorphic-fetch';
import './style.css'
import Img from './../../../elements/Img'
class Pokemon extends Component {
constructor(props) {
... |
import Link from 'next/link'
import moment from 'moment'
import renderHTML from 'react-render-html'
import { API } from '../../config'
const Card = ({ blog }) => {
const blogCatagories = () => {
return blog.catagories.map((c, i) => (
<Link key={i} href={`/catagories/${c.slug}`}>
... |
import { Mongo } from 'meteor/mongo';
import SimpleSchema from 'simpl-schema';
SimpleSchema.extendOptions(['autoform']);
export const Carts = new Mongo.Collection('carts');
Carts.attachSchema(new SimpleSchema({
username: {
type: String,
label: "Username",
optional: false,
},
seller: {
type: String,
la... |
import { invertColor } from './../helpers.js';
export const LegoDetail = (brick) => {
let block = `<section class="block-wrapper" style="background-color:#${brick.ColorHex}">
<h3>Name: ${brick.LegoName.toUpperCase()}</h3>
<div class="block-years">Manufactured ${brick.YearFrom} - ${brick.... |
import React, { useContext } from 'react';
import { UserContext } from '../views/context/User';
// import '../custom.css'
function AuthenticatedUser(props) {
const { user, loading } = useContext(UserContext)
return (
<div className="text-nowrap">
{
loading ? <div>Loading . . ... |
// Метод ФУНКЦИИ в объекте
const playList = {
name: "My list",
rating: 5,
tracks: ["track-1", "track-2", "track-3"],
// trackCount: 3,
// старый способ написания функции
getName(x) {
console.log("This is function getName :)");
},
// modern way to declare function in object
changeName(newName) {
... |
$(function () {
$('.slider').slick({
cssEase: 'ease-in',
dots: false,
autoplay: true,
autoplaySpeed: 2000,
arrows: true
});
$('.tabs-stage > div').hide();
$('.tabs-stage > div:nth-child(1)').show();
$('.tabs-nav > li:first-child a').addClass('t... |
import IStore from '../store/IStore.js';
import { Model } from '../lib/mvc.js';
let fileWatches, disableWatch;
const fs = window.require("fs"),
path = window.require('path');
class FileSystem {
static "@inject" = {
store:IStore,
pool:"pool",
root: [Model, {scope:"root"}]
}
... |
function smoothScroll(target,duration){
let target = document.querySelector(target);
console.log(target);
}
smoothScroll("#header-scroll",1000); |
const assert = require('assert');
const Dinosaur = require('../dinosaur.js');
const Park = require('../park.js');
describe('Park', function(){
let tyrannosaurus;
let pteradactyl;
let dilophosaurus;
let park;
beforeEach(function(){
tyrannosaurus = new Dinosaur("Tyrannosaurus", 3);
pteradactyl = new ... |
'use strict';
module.exports = {
check(rules, data) {
return this.app.validator.validate(rules, data);
},
v(rules, data) {
if (!data) {
data = Object.assign({}, this.query, this.request.body, this.params);
}
const errors = this.check(rules, data);
if (errors) {
const { errorStatus,... |
const puppeteer = require('puppeteer');
const GetItems = async (searchTerm ) => {
const browser = await puppeteer.launch({
headless: false,
defaultViewport: null
});
const page = await browser.newPage();
await page.goto(
`https://www.jumia.co.ke/catalog/?q=${encodeURI(searchTer... |
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter } from "react-router-dom";
import { createStore, applyMiddleware } from "redux";
import logger from "redux-logger";
import { Provider } from "react-redux";
import { composeWithDevTools } from "redux-devtools-extension";
import App from... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.