text stringlengths 7 3.69M |
|---|
import React from 'react';
import JavaScriptIcon from '.././assets/images/SkillIcons/javascript.png';
import NodeJSIcon from '.././assets/images/SkillIcons/nodejs2.png';
import ReactIcon from '.././assets/images/SkillIcons/reactIcon.png';
import Vue from '.././assets/images/SkillIcons/vue.png';
import Spring from '../.... |
window.addEventListener('load', () => {
getCourse();
var today = new Date();
var date =
today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate();
document.getElementById('CurrentDate').value = date;
let currentTime = document.getElementById('CurrentTime');
currentTime.value = Convert... |
import express from 'express';
import logger from 'morgan';
import bodyParser from 'body-parser';
import dotenv from 'dotenv';
import path from 'path';
import swagger from 'swagger-jsdoc';
import webpack from 'webpack';
import winston from 'winston';
import webpackMiddleware from 'webpack-dev-middleware';
import valida... |
const patient = artifacts.require('./Patient.sol')
contract('patient',(accounts) =>{
before(async()=>{
this.patient = await patient.deployed()
})
it('Deployed successfully and Patient node functioning', async() =>{
const address = await this.patient.address
assert.notEqual(address,null)
assert.notEqual(a... |
// const UNSPLASH_API_KEY = "u6tWjbvOWBGP-qtcuKtMOlRSbJ-_mgw2UhmahMp6nMI";
const body = document.querySelector("body");
const IMG_NUMBER = 2;
function paintImage(imgNumber){
// const unsplash = unsplash.photos.getPhoto(`UNSPLASH_API_KEY`);
// console.log('unsplash');
const image = new Image();
image.src... |
import { useState, useEffect } from 'react'
import { getCountry } from '../Api/index'
import { Link, useParams } from 'react-router-dom'
import './countryPage.css'
const CountryPage = () => {
const { country } = useParams()
const [countryData, setCountryData] = useState([])
useEffect(() => {
getCou... |
/**
* This is the common script for the ASSET application
*/
// ***************** GLOBAL VARIABLES *****************
var bldGrp = '';
var gendrVal = '';
var themeID = '';
var HOSP_CNTRLLS=
{
HOSP_FIELDS : ['txtFldASSETHospName','txtFldASSETHospCode','txtFldASSETHospAddr1','txtFldASSETHospCity',
... |
StudentCentre.combo.AssignmentStatus = function(config) {
config = config || {};
Ext.applyIf(config, {
fieldLabel: _('studentcentre.ass_status')
,name: 'status'
,width: 300
,hiddenName: 'status'
,emptyText: 'Select status...'
,typeAhead: true
,valueField: 'status'
,displayField:... |
import angular from 'angular';
import 'bootstrap/dist/css/bootstrap.css';
import angularMeteor from 'angular-meteor';
import template from './assetWarehouse.html';
import { Warehouses } from '../../api/assets/warehouses.js';
class AssetWarehouseCtrl {
constructor($scope) {
$scope.viewModel(this... |
import axios from 'axios';
import {
SEARCH_FINISHED,
LOADING_SEARCH,
NEXT_PAGE_LOADED,
LOADING_MORE,
UPDATE_FILTER,
} from './types';
export const searchText = (query) => async (dispatch) => {
try {
dispatch({
type: LOADING_SEARCH,
});
const params = new URLSearchParams(query);
const... |
import axios from "axios";
import filterParams from "./filterParams";
export default {
getUsers: function() {
return axios.get("/api/pets");
},
saveUser: function(userData) {
return axios.post("/api/users", userData);
},
getPets: function() {
return axios.get("/api/pets");
... |
'use strict';
const bcrypt = require('bcrypt');
module.exports = {
up: async (queryInterface, Sequelize) => {
return queryInterface.bulkInsert('users', [
{
rut: "123456-1",
password: bcrypt.hashSync("123456",10),
role: "ADMINISTRADOR",
}
],
{
});
},
down:... |
import {StyleSheet} from "react-native";
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor:"#FFFF"
},
input:{
flex:1,
fontSize:30,
color:"black",
marginRight:20,
},
inputContainer:{
flexDirection:"row",
marginTop:50,... |
var express = require('express');
var router = express.Router();
router.get('/country/:lang?', function(req, res, next) {
let select = (req.params.lang && req.params.lang == 'en') ? " country_en country " : " country ";
let order = (req.params.lang && req.params.lang == 'en') ? " country_en " : " country ";
... |
"use strict";
var parser_1 = require("../../src/parser/parser");
var immutable_1 = require("immutable");
var fs = require("fs");
describe("parser", function () {
var testData = "$15.05\nmixed fruit,$2.15\nvanilla calamari,$2.15\nfrench fries,$2.75\nside salad,$3.35\nhot wings,$3.55\nmozzarella sticks,$4.20\nsampler... |
import React from 'react';
import {
CartItemContainer,
CartItemMedia,
ItemDetails,
ItemName,
ItemPrice,
} from './cart-item.styles';
/**
* Cart Item Component
*
* @param {*} { Item }
* @returns
*/
const CartItem = ({ item }) => {
return (
<CartItemContainer>
<CartItemMedia src={item.imageUr... |
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const getters = {
token: state => state.user.token,
name: state => state.user.name,
roles: state => state.user.roles,
permissionIdents: state => state.user.permissionIdents,
permission_routes: state => state.permission.routes,
}
// https... |
import axios from "axios"
const apiHost = process.env.VUE_APP_API_HOST||"/";
let baseURL = "api";
if(apiHost){
baseURL=`${apiHost}api`
}
export default axios.create({baseURL:baseURL}); |
import React from 'react';
import './search.scss'
import Search_nav from './search_nav'
import Search_box from './search_box'
import Search_nav_left from './search_nav_left'
import Content from './content_box'
import pic6 from './gengduo.png'
import S_Footer from './S_footer'
class Search extends React.Co... |
module.exports = Array.from(Array(5), (_, i) => ({
id: i,
name: `dummy_restaurant_${i}`
})) |
const app = require('./main');
app.listen(process.env.PORT || 3333, () => {
console.log(`backend running env: ${process.env.NODE_ENV || 'dev'}`);
});
|
import { MenuItem } from "@material-ui/core";
import { formatRelative, subDays } from "date-fns";
import { useRouter } from "next/router";
const NotificationItem = ({ data }) => {
const router = useRouter();
return (
<MenuItem onClick={() => router.push(data.url)}>
<div className="w-96 flex items-cente... |
import axios from 'axios'
import qs from 'qs'
// axios 配置
axios.defaults.timeout = 5000
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
axios.defaults.baseURL = 'https://www.easy-mock.com/mock/590009b5739ac1685205bd59/demo'
// POST传参序列化
axios.interceptors.request.use((c... |
var dir__fdcab30c5f47fb34f64374d4556859fe_8js =
[
[ "dir_fdcab30c5f47fb34f64374d4556859fe", "dir__fdcab30c5f47fb34f64374d4556859fe_8js.html#ac7c003f71081e45f67c94956f703b7fa", null ]
]; |
/**
* MailController
* To handle Mail related functions
*/
// const parse5 = require('parse5');
const cheerio = require('cheerio');
const fs = require("fs");
const path = require("path");
const signatures = [
"",
"Thanks and Regards, <br>Ashwin P Chandran",
"Regards, <br>Ashwin",
"Love you,<br>Wolf... |
import React from 'react'
import PropTypes from 'prop-types'
import Radium from '@instacart/radium'
import MaskedTextInput from 'react-text-mask'
import { colors } from '../../styles'
import withTheme from '../../styles/themer/withTheme'
import { themePropTypes } from '../../styles/themer/utils'
import FormComponent fr... |
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Chart from './Graph';
import CryptoSelected from './CryptoSelected';
const useStyles = makeStyles(theme => ({
box: {
width: '100%',
marginLeft: '2vw',
height: '45vw',
position: '-webkit-sticky',
position: 'sticky',
to... |
import React, {Component} from 'react'
import Form from 'react-bootstrap/Form'
import FormControl from 'react-bootstrap/FormControl';
import FormGroup from 'react-bootstrap/FormGroup'
import Button from 'react-bootstrap/Button';
import PostsService from '../services/posts-service';
import { UserConsumer } from ... |
import React, {Component} from 'react';
import {View,Text,StyleSheet,Button,TextInput,YellowBox , Keyboard} from 'react-native';
import { connect } from 'react-redux';
import { checkLogin,changeEmail,changeSenha,SignInAction } from '../actions/AuthActions';
import { LoadingItem } from '../components/LoadingItem';
imp... |
$(function() {
resetGrid();
$(window).resize(function() {
resetGrid();
});
});
function resetGrid() {
var w = getWindowWidth(),
h = getWindowHeight(),
m = 25;
$g = $(".grid"),
$c = $(".col-13, .col-23");
// set grid width & height to the window width and height - margin * 2
$g.width(w - (m * 2));
... |
/*
* Route: /apps/:appId/messages/:appMessageId?
*/
const AppMessageModel = rootRequire('/models/AppMessage');
const AppSourceContentModel = rootRequire('/models/AppSourceContent');
const appAuthorize = rootRequire('/middlewares/apps/authorize');
const appDeviceAuthorize = rootRequire('/middlewares/apps/devices/auth... |
import React, { useEffect, useState } from 'react';
import { ReactComponent as StockIcon } from './../../../static/icons/16_appruved ligh.svg';
import { ReactComponent as BuyIcon } from './../../../static/icons/16_buyed ligh.svg';
import { ReactComponent as QuestionIcon } from './../../../static/icons/24_question ... |
import styled from 'styled-components';
export const TipHover = styled.div`
padding: 10px 15px;
visibility: hidden;
opacity: 0;
position: absolute;
top: ${({ top }) => `${top}px` || 'calc(100% + 10px)'};
background: #252a34;
border-radius: 4px;
box-shadow: 0 22px 17px 0 rgba(205, 205, 205, 0.5);
tran... |
$("#role a").click(function() {
e.preventDefault();
$('a').removeClass('active');
$(this).addClass("active");
}); |
import findByEmail from './findByEmail';
export default findByEmail;
export * from './findByEmail';
|
import React, { Component } from 'react';
import './App.css';
class App extends Component {
constructor(props) {
super(props);
this.state = {elementList : []};
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
this.setState(
{
elementList : this.state.elementList.c... |
const jwt = require('jsonwebtoken');
const jwtGenerator = require('../utils/jwtGenerator');
const keys = require('../config/keys');
module.exports = function (req, res, next) {
//parse the cookie to get the refresh token
const token = req.cookies.refreshToken;
//validate the token
try {
const decoded = jw... |
const { resolve } = require('path');
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
entry: [
'whatwg-fetch',
'babel-polyfil... |
var searchData=
[
['core',['Core',['../namespace_digital_opus_1_1_m_b_1_1_core.html',1,'DigitalOpus::MB']]],
['digitalopus',['DigitalOpus',['../namespace_digital_opus.html',1,'']]],
['mb',['MB',['../namespace_digital_opus_1_1_m_b.html',1,'DigitalOpus']]]
];
|
var fib = module.exports = function(n) {
if (n < 0) { throw new Error('Eh?') }
else if (n == 0) { return 0 }
else if (n == 1) { return 1 }
else if (n == 2) { return 1 }
else { return fib(n - 1) + fib(n - 2) }
}
|
import React from "react";
import styled from "@emotion/styled";
import { spacing } from "@mui/system";
import {
Avatar as MuiAvatar,
Container as MuiContainer,
Grid,
Typography,
} from "@mui/material";
const Wrapper = styled.div`
${spacing};
background: ${(props) => props.theme.palette.backg... |
/**
* This is largely s copied with minor stylistic adjustments from Freja 1.1
* I renamed it from Controller.history to distinguish between window.history
*/
Freja.UndoHistory = function() {
this.cache = [];
this.maxLength = 5;
this._position = 0;
this._undoSteps = 0;
};
/**
* Creates a snapshot... |
const express = require("express");
const Router = express.Router({mergeParams : true});
const catchAsync = require('../utils/catchAsync');
const {isLoggedIn , validateReview , reviewsAuthorise} = require("../middleware");
const review = require("../controllers/reviews");
Router.post("/" , isLoggedIn , validateReview ... |
// pages/news/news.js
Page({
/**
* 页面的初始数据
*/
data: {
isOpen: true,
array: [{
label: 'sfdf',
value: 'aa',
children: [{
label: 'eee123',
value: 'dsfsfs'
}]
}, {
label: 'sdfdsfdsg',
value: 'bb'
}, {
label: 'sfdsf',
value: 'cc'
... |
const Intern = require('../intern')
describe('adding a school name',()=>{
it('Should add a school name using the constructor',()=>{
const testVal = 'DVC';
const testGuy = new Intern('Marko',888,'email@email.com',testVal);
expect(testGuy.school).toBe(testVal);
});
});
describe('getSchool... |
import ProgressBarDemoRoute from 'routes/ProgressBarDemo'
describe('(Route) ProgressBarDemo', () => {
let _route
beforeEach(() => {
_route = ProgressBarDemoRoute({})
})
it('Should return a route configuration object', () => {
expect(typeof(_route)).to.equal('object')
})
it('Configuration should ... |
const estimateGasCreation = (contractInstance, bytecode, constructorParams) => {
return new Promise((resolve, reject) => {
if (!contractInstance || !bytecode) {
reject('No contract instance or bytecode given')
}
const input = {
data: bytecode
}
if (c... |
(function() {
'use strict';
angular
.module('cyber.services')
.factory('EventService', EventService)
EventService.$inject = ['$resource'];
function EventService($resource) {
return $resource('events/:eventId',
{
eventId: '@eventId'
},
... |
var outer = document.createElement('div')
outer.className =('container')
var contentcontainer = document.createElement('div')
async function catcontent(section) {
try {
contentcontainer.innerHTML = ''
var url = `https://api.nytimes.com/svc/topstories/v2/${section}.json?api-key=3OB0bcgpIW3TVAPG7VwV58M... |
const fontSize = {
fontSize: '35px'
};
const Franchising = () => (
<div className="Potato franchising-wrapper w-100" id="franchising">
<h3>Franchise Package</h3>
<div className="franchise-container container">
<div className="row">
<div className="col-md-6 col-lg-4 c... |
function craftItem(inventory, stacks, recipe, items){
let result = [];
let isEnoughtItem = false;
let resourceForCraft = [];
/////////Check availability items in inventory by recipe
for (let i = 0; i<recipe.ingredients.length; i++) {
let findItems = inventory.findItems(recipe.ingredients[i].typeId, stac... |
import React from 'react';
import PageRoot from '../tags/page-root/page-root.jsx';
import Heading from '../tags/heading/heading.jsx';
import Rhythm from '../tags/rhythm/rhythm.jsx';
import Wrapper from '../tags/wrapper/wrapper.jsx';
import ComponentList from '../styleguide/component-list.jsx';
export default ({ loca... |
'use strict'
const redux = require('redux');
const createStore = redux.createStore;
const initalState = {
counter: 0,
status: false
}
//Reducer
const rootReducer = (state = initalState, action) => {
switch(action.type) {
case 'SET_COUNTER':
return { ...state, counter: state.counter + 1 }
case 'A... |
class Game {
constructor(canvasId){
this.canvas = document.getElementById(canvasId)
this.canvas.width = 450
this.canvas.height = 650
this.ctx = this.canvas.getContext('2d')
this.fps = 1000 / 60
this.intervalId = undefined
this.background = new Background(thi... |
// Given a string, find the length of the longest substring without repeating characters.
// Examples:
// Given "abcabcbb", the answer is "abc", which the length is 3.
// Given "bbbbb", the answer is "b", with the length of 1.
// Given "pwwkew", the answer is "wke", with the length of 3. Note that the answer must b... |
'use strict'
require('dotenv').config()
const express = require('express')
const server = express();
const pg = require('pg')
const superagent = require('superagent');
const methodOverride = require('method-override');
// const client = new pg.Client(process.env.DATABASE_URL)
const client = new pg.Client({ connection... |
var app = angular.module('distEdit', ['toastr']);
app.controller('distEditCtrl', function($scope, distSer,$stateParams,$state,toastr){
$scope.showed=true
distSer.gitName().then(function(response){
if(response.data.code == 0){
$scope.names = response.data.data;
}
});
distSer.... |
import {h,render,patch} from '../../source/vue/vdom'
//节约性能 先把真实节点用对象表示出来 ,再通过对象渲染到页面上
// 前端操作dom的时候 排序 -> 正序 反序列 删除
//虚拟dom 只是一个对象
//vue template render函数 s
//初始化 将虚拟节点 渲染到页面
//<div id='container><span style='color:red'>hello </span>wz<div>
let oldVnode = h('div',{id:'container'},
h('li',{style:{background:'red'... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { observer } from 'mobx-react';
import http from 'common/http';
import utils from 'common/utils';
import AsynchronousLinkSelectTree from 'components/AsynchronousLinkSelectTree';
class FlowParameter extends Component {
construct... |
import React, { useState } from 'react';
import './style.css';
import API from '../../../Utilities/API';
export default function CreateSprint({ isOpen, toggle }) {
const [sprint, setSprint] = useState({
name: null
});
const showHideClassName = isOpen
? 'modal display-block'
: 'modal display-none';
... |
import React from "react";
import { useState } from "react";
import Dialog from "./UI/Dialog/Dialog";
import TextField from "./UI/TextField/TextField";
import { PlusOutlined } from "@ant-design/icons";
function AddGenre({ handleCreate }) {
const [name, setName] = useState("");
const [isDialogOpen, setIsDialogOpen]... |
function AccessMap(mapEl, captionEl) {
this.accessible = false;
this.statistics = false;
this._mapEl = mapEl;
this._captionEl = captionEl;
this._points = [];
this._data = undefined;
this._lastSelectedPoint = undefined;
this._d3Voronoi = d3.geom.voronoi().x(function(d) {
return d.x;
}).y(function(d... |
/**
* Created by iyobo on 2017-04-14.
*/
import React, {Component, PropTypes} from 'react';
import GenericFieldInput from './generic/GenericFieldInput';
import DateInput from './date/DateInput';
import BooleanInput from './boolean/BooleanInput';
import TextAreaInput from './textarea/TextAreaInput';
import RichTextInp... |
import React , {useRef} from 'react'
import {Link , useLocation, useHistory} from "react-router-dom"
function Navbar() {
const navBtn = useRef(null)
const history = useHistory()
let location = useLocation()
const ToggleNav = () => {
navBtn.current.classList.toggle("hidden")
}
const logo... |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import ColorPicker from './color/ColorPicker';
import styles from './joinplayer.less';
class JoinPlayer extends Component {
constructor(props) {
super(props);
this.state = {
name: props.playerName || '',
color: props.player... |
function populate() {
if (quiz.isEnded()) {
}
else {
// show question
var element = $(".quiz-screen__title");
element.html(quiz.getQuestionIndex().text);
// show options
var choices = quiz.getQuestionIndex().choices;
for (var i = 0; i < choices.length; i++) {
... |
const arrayCubeRootToJson = (arr) => {
try {
let rootJson = {};
arr.map((number) => {
let cubeRoot = Math.cbrt(number);
if (cubeRoot === 0 || isNaN(number)) throw new Error();
rootJson[number] = cubeRoot;
});
return rootJson;
} catch (error) {
throw new Error(error);
}
};
mo... |
import test from 'tape';
const sut = require('../');
test('Validate kid numbers', (t) => {
t.plan(3);
const correct = sut.kidNumber('270236900527');
const incorrect = sut.kidNumber('-270236900527');
const chars = sut.kidNumber('dsfdfs');
t.ok(correct, 'Given a valid kid number, validation should be successf... |
'use strict';
const config = require('../helpers/config');
const apiUrl = config.get('API_ROOT');
module.exports = {
login: `${apiUrl}/users/login`,
register: `${apiUrl}/users/register`,
task: `${apiUrl}/tasks/{id}`
}; |
function Booster()
{
this.pick = function(boost, total, ordem, cores, total_cor)
{
var pick = Math.floor(Math.random() * total);
var pick_cor = Math.floor(Math.random() * total_cor);
var aux = null;
var aux2 = null;
parc = 0;
for (var i = 0; i < boost.length ; i++ )
{
if (parc + boost[i][... |
const express = require('express');
const cookieParser = require('cookie-parser');
const next = require('next');
const errorHandler = require('./catsapi/middleware/error');
const connectDB = require('./config/db');
const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev });
const handle = app.getRe... |
const webBaseTransformGroup = require("..");
const webJSTransformGroup = {
name: "web/js",
transforms: [
...webBaseTransformGroup.transforms,
"name/ti/camel",
],
};
module.exports = webJSTransformGroup;
|
import React, {Component} from 'react';
import { Input, Select, Button,Icon,Table } from 'antd';
const Option = Select.Option;
const Search = Input.Search;
import './css/sellerList.css';
export default class SellerList extends Component{
constructor(props){
super(props);
this.supplierName='';
... |
import React from 'react';
import PropTypes from 'prop-types';
import {Redirect, Route, Switch} from 'react-router-dom';
import {Answer} from './answer';
import {Article} from './article';
import {Creation} from './index';
//import {Review} from './review';
import {languageHelper} from '../../../tool/language-helper'... |
define([
// Application.
"app"
],
function(app) {
var User = app.module();
User.Collection = Backbone.Collection.extend({
url: function() {
console.log("user getdata");
return "https://api.github.com/orgs/" + this.org + "/members?callback=?";
},
cache: true,
parse: function(obj)... |
import React, { Component } from 'react';
import { Link, NavLink } from 'react-router-dom';
import {Navbar, Nav, NavDropdown, Container, Button} from 'react-bootstrap';
import './Nav.css';
import Logo from '../../Assets/logo.png';
class Navigation extends Component {
render() {
return (
<Navbar... |
import axios from "axios";
import {setAlert} from "./alert";
import {
GET_POSTS,
POST_ERROR,
UPDATE_LIKES,
DELETE_POST,
ADD_POST,
GET_POST,
ADD_COMMENT,
} from "./types";
import { Redirect } from "react-router-dom";
//Get posts
export const getPosts = () => dispatch => {
axios.get("/po... |
const chai = require('chai');
const chaiHttp = require('chai-http');
const should = chai.should();
const app = require('../../express_server.js');
chai.use(chaiHttp);
describe('/---Index Route Tests---/', () => {
it('should return 200 and render text when / is called', () => {
return chai.request(app)
.... |
function register(env) {
env.addGlobal("blog_tag_url", handler);
}
function handler(selected_blog, tag_slug) {
return `http://blog.hubspot.com/marketing/tag/inbound-marketing`;
}
export {
handler,
register as default
};
|
import { Component } from "react";
class Bubble extends Component {
getNumber(n) {
if (!n) {
return "";
}
return n > 9 ? "9+" : n;
}
render() {
return (
<span style={styles.bubble}>{this.getNumber(this.props.value)}</span>
);
}
}
export default Bubble;
const styles = {
bubbl... |
import React from 'react';
import {StyleSheet, View, Image } from 'react-native';
import fourImage from '../assets/image/4285.jpg'
export default class Picture extends React.Component {
render() {
return (
<View style={styles.container}>
<Image source={fourImage} style={{width:300, height:300,}}/>... |
'use strict';
/**
* @author ankostyuk
*/
describe('app travel ui', function(){
var $controller, $httpBackend;
function createAppTravelFormController(scope) {
return $controller('appTravelFormController', {
$scope: scope
});
}
beforeEach(angular.mock.module('app'));
... |
import Title from 'antd/lib/typography/Title';
import Checkbox from 'components/UI/Checkbox';
import Flex from 'components/UI/Flex';
import React from 'react';
import styles from './_filter_box.module.scss';
import { ReactComponent as ArrowActive } from './../../static/icons/16_arrow_active.svg';
import { ReactCo... |
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
//Read the package.json (optional)
pkg: grunt.file.readJSON('package.json'),
// Metadata.
meta: {
basePath: '.',
srcPath: 'src/',
deployPath: 'www/'
},
jade: {
debug: {
options: {
data: {
debug: true,
pretty: true,
... |
function botao(){
document.getElementById("agradecimento").innerHTML = "Obrigado por clicar"
}
function clicou() {
window.open("https://google.com")
window.location.href = "https://www.uol.com.br"
}
function trocar() {
document.getElementById("trocar").innerHTML = "Olha que bacana!"
}
function... |
/* eslint-disable jsx-a11y/anchor-is-valid */
import styled from 'styled-components';
import React from 'react';
const StyledDesignCardContainer = styled.div`
width: 32.7rem;
height: 47.8rem;
border-radius: 1.5rem;
background-color: var(--extra-light-peach-color);
transition: 0.2s ease-in-out;
... |
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import s from './Login.css'
import { changeField } from '../../actions/Login/actions'
class Login extends Component{
render(){
return(
<div className={`${s.wrapper}`}>
<div cla... |
import React from "react";
import JobCard from './JobCard';
// render list of job cards
function JobList({ rightJobs }) {
if (!rightJobs) {
return (<div><p>No jobs available</p></div>)
}
return (
<div className="col-md-4">
{rightJobs.map(job => (<JobCard job={job} />))}
</div>
);
}
export d... |
import React, { Component } from 'react';
import { RootNavigator } from "./config/navigation";
import { isSignedIn } from "./auth";
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
signedIn: false,
checkedSignIn: false
};
}
componentWillMount... |
import React from "react";
export default class UnknownPath extends React.Component {
render() {
return (<h1>Sorry, this page doesn't exist</h1>)
}
} |
/*
* @lc app=leetcode.cn id=396 lang=javascript
*
* [396] 旋转函数
*/
// @lc code=start
/**
* @param {number[]} nums
* @return {number}
*/
var maxRotateFunction = function(nums) {
let rotateNum = [];
let maxNum = Number.MIN_SAFE_INTEGER;
// 求出旋转数组
for (let i = 0; i < nums.length; i++) {
rota... |
class LRMove {
constructor(element, leftCallback, rightCallback) {
this.el = element
this.oldX = 0
this.flag = false
this.leftCallback = leftCallback ? leftCallback : ()=>{}
this.rightCallback = rightCallback ? rightCallback : ()=>{}
}
init() {
this.el.addEventListener("touchstart", (e) =... |
const Header = ({ round, currentScore, time }) => {
return (
<>
<h1 className="game-title">Reaction Time</h1>
<div id="game-header">
<h2 className="game-progress">Round: {round}</h2>
<h2 className="game-progress">Score: {currentScore}</h2>
... |
'use strict';
module.exports = function (grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
... |
const Discord = require("discord.js")
const botconfig = require("../../botconfig.json");
exports.run = async (bot, message, args) => {
if (message.channel.id !== botconfig["verify_setup"].verify_channel) {
// If the channel it wasn't verification channel, ignore it.
return;
}
await
aw... |
var assert = require('assert');
var Queue = require('../dist/queue.js').Queue;
describe('Testing queue.js', function () {
var queue = new Queue();
it('Add 1 into queue and its size should be 1', function () {
queue.enqueue(1);
assert.equal(1, queue.getSize());
});
it('Push 2 and 3... |
export function square(x) {
if (typeof x !== 'number') {
throw TypeError('The param should be number!')
} else {
return x * x
}
}
export function cube(x) {
if (typeof x !== 'number') {
throw TypeError('The param should be number!')
} else {
return x * x * x
}
}
|
import axios from 'axios'
import qs from 'qs'
import { defaturl } from './apiUrl'
axios.defaults.baseURL = defaturl
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
// 修改默认配置
// axios.defaults.headers.post['Content-Type'] = 'application/json'
// axios.defaults.headers.get['Content-Type... |
angular.module('ngApp.payment', [
'ui.router',
'ngApp.common'
])
/**
* Each section or module of the site can also have its own routes. AngularJS
* will handle ensuring they are all available at run-time, but splitting it
* this way makes each module more "self-contained".
*/
.config(function config($statePro... |
'use strict';
module.exports = ['eslint:recommended', { rules: { 'eol-last': 'error', 'no-undef': 'off' } }];
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.