text stringlengths 7 3.69M |
|---|
const router = require("express").Router();
const updateProject = require("../helpers/updateProject");
const checkProject = require("../middleware/verifyProjects");
router.put("/projects/",checkProject, (req, res) => {
updateProject(req, res);
});
module.exports = router; |
$ ( document ).ready ( function( ) {
$ ( "#banner_logo-img" ).click ( function( ) {
location = "/";
} );
$ ( "#banner_title" ).click ( function( ) {
location = "/";
} );
var imgData = $ ( "#img-data" ).html ( );
$ ( "#public-share-image" ).html ( "<img id='public-share-image-img' src='" + imgData + "' >" ... |
/* eslint-disable no-console */
import crypto from 'crypto';
import { mailchimpApi, formatUpdateResponse, formatFormInput } from '../utilities';
function md5(str) {
return crypto
.createHash('md5')
.update(str)
.digest('hex');
}
export default function doUpdateUser(event, _, cb) {
const mailingListId... |
const SearchResults = ({ userDetails }) =>{
let months = ["Jan","Feb","March","April","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"]
let joinDate = new Date(userDetails.created_at)
let date = joinDate.getDate()
let month = joinDate.getMonth()
let year = joinDate.getFullYear()
console.lo... |
var url = "https://fewd20.herokuapp.com/chat";
var user;
var message;
var usedMessage = [];
function messageData(){
$.get(url, function(data, status){
for (var i = 0; i < data.length; i++){
console.log(data[i]);
if (usedMessage.indexOf(data[i].message) === -1){
usedMessage.push(data[i].message);
$('#... |
const markmass = 78;
const markheight = 1.69;
const johnmass = 92;
const johnheight = 1.95;
const BMImark = markmass / markheight ** 2;
const BMIjohn = johnmass / (johnheight * johnheight)
console.log(BMImark, BMIjohn);
const firstName = 'vrushabh';
const age = 18;
const birthYear = 2002;
const idea = `${firstNa... |
import './App.css';
import Form from "./Form";
function App() {
return (
<div className="App">
<div className="container">
<div className="header">
<h1>Dictionary</h1>
<i className="sentence">dic·tio·nary | \ ˈdik-shə-ˌner-ē</i>
</div>
<div className="formrow">... |
// http://crbug.com/1079333: registerProtocolHandler() silently fails when
// called from a background page or popup, so we need to open a tab.
chrome.tabs.create({"url": "register.html", "selected": true});
|
import Picker from 'react-giphy-component'
import React, { Component} from 'react'
class Gif extends Component {
constructor(props){
super(props);
this.state={
visible:false
}
}
log = (gif) => {
{this.props.addGif(gif)};
this.setState({
visible:true
})
}
render ()... |
var firebaseadmin = require('../firebase-admin.js');
var senderModel = require('../models/sender');
var recieverModel = require('../models/reciever');
var rtdb = firebaseadmin.database();
var userHelper = require('./userHelper');
var header = "[messagesHelper]";
var messageSocketURI = "messageSocket/";
var messagesHelp... |
//Create QR code object using imported script from HTML
var qrcode = new QRCode("qrcode");
var submit = document.getElementById("submit");
submit.addEventListener("click", function(){
console.log("Button pressed");
var request = new XMLHttpRequest();
var url = 'https://ms57713.starbucks.net/beta/api/starpa... |
import React from "react";
import "./Register.css";
import { Redirect } from "react-router-dom";
export default class Register extends React.Component {
constructor(props) {
super(props);
this.state = {
username: "",
email: "",
password: "",
repassword: "",
usertype: "",
i... |
import axios from "axios";
import { getAuth } from "./auth";
const API_URL = `http://localhost:3000/api`;
const api = axios.create({
baseURL: API_URL,
headers: {
"Content-Type": "application/json",
},
});
api.interceptors.request.use((config) => {
const { token } = getAuth();
config.headers.tokens = to... |
var year = '2019';
var month = '04';
var day = '26';
var hour = '11';
var minute = '34';
var second = '27';
// var result = `${year}/${month}/${day} ${hour}:${minute}:${second}`//빈칸을 채워주세요
const result = year.concat('/',month,'/',day,' ',hour,':',minute,':',second);
//concat() 메서드는 매개변수로 전달된 문자열을 메서드를 호출한 문자열에 붙여 새로운... |
import React, { Component } from 'react'
import "./app-style.css";
import Logo from "../img/KDC-logo.png"
class Home extends Component {
render() {
return (
<div className="home-page">
<div className="home-box">
<h3 className="home-header">
... |
module.export ={
plugin:{
autoprefixer: {}
}
}
|
import React from 'react';
import { MyStylesheet } from './styles';
import DynamicStyles from './dynamicstyles';
import { addIcon } from './svg';
class FindEmployee {
showprofileimage() {
const dynamicstyles = new DynamicStyles();
const myuser = dynamicstyles.getuser.call(this);
const searc... |
import React, {Component} from 'react'
import Catalog from '../../components/catalog'
export default class CatalogPage extends Component{
render(){
return (
<Catalog/>
)
}
}
/*const AddItem = styled.div`
display: flex;
flex-direction: row;
background-color: $... |
define([
'./auth.interceptor'
], function () {
'use strict';
}); |
import React, { useContext } from 'react';
import { TaskListContext } from '../context/TaskContext';
import {Task} from "./Task";
import {ListGroup} from "reactstrap";
export const TaskList = () => {
const { tasks } = useContext(TaskListContext);
return (
<ListGroup className="mt-4">
{tasks... |
import React from 'react'
import ReactMde from 'react-mde'
import 'react-mde/lib/styles/css/react-mde-all.css'
import * as Showdown from 'showdown'
// change this
// const selectedTab = 'write'
const selectedTab = 'preview'
const content = `
# This is a header And this is a paragraph
# This is a header And this is a ... |
import React from "react";
import Card from '../components/Card';
import ItemContainer from './ItemContainer'
import SearchBox from '../components/SearchBox'
//Selection list displays the info (in cards) of every item belonging
//to the selected category passed through the selectedCategory prop
class SelectionList... |
import faker from "faker";
const mount = (el) => {
let products = "";
for (let i = 0; i < 5; i++) {
const name = faker.commerce.productName();
products += `<div>${name}</div>`;
}
el.innerHTML = products;
};
// Context/Situation #1
// running file in development in isolation
// using local index.html... |
import React, {} from 'react';
import { Bar } from 'react-chartjs-2';
import { ClipLoader } from 'react-spinners';
import {
onClearAll,
clearAll,
askQuestion,
connectToRoom,
onQuestionReceived,
answerStudentQuestion,
onStudentQuestionAnswered,
onLecturerQuestionAnswered,
onJoinError... |
import React from 'react';
const VideoBanner = () => {
return (
<React.Fragment>
<section className="banner" >
<div className="video-container">
<video className="featured_video" poster="" autoPlay="autoPlay" playsInline="playsInline" muted="muted" loop="lo... |
$(function () {
'use strict';
$('.tree-radio').on('change', function(){
if (this.checked) {
var selector = '#' + $(this).closest('.modal').attr('id');
console.log(selector);
var trigger = $('[href="' + selector +'"]');
var label = $(this).data('label');
... |
import React, {Component} from 'react';
import MoreInfo from './MoreInfo';
export default function Map(props) {
return ( props.displayAllCharacters.map( (e,i) => {
return (
<div className="list-parent" key = {i} >
<div className="names-list">
<div className="names-list-sep... |
import _ from 'lodash';
import { utils } from '../../../common/utils';
export const ROLE_ALL = '*';
/**
* Auth middleware
* @param {array} roles
* @param {string|function} failedCb
*/
export function auth(roles, failedCb) {
const reject = (req, res, next) => {
if (utils.isFunction(failedCb)) return failedCb... |
/**
* LINKURIOUS CONFIDENTIAL
* Copyright Linkurious SAS 2012 - 2018
*
* - Created on 2014-11-25.
*/
'use strict';
// internal libs
const crypto = require('crypto');
const stream = require('stream');
// external libs
const _ = require('lodash');
const clarinet = require('clarinet');
const Promise = require('blue... |
import { faUserCircle } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import React from 'react';
import { Link } from 'react-router-dom';
export default function Avatar(props) {
if (props.isLoading) {
return null;
}
return (
<Li... |
import React, { Component } from 'react'
import axios from 'axios'
export class TestingAxios extends Component {
constructor(props) {
super(props)
this.state = {
posts: [],
title: '',
userID: '',
body: ''
}
this.getTitles();
... |
//5.1
/* const ages = [22, 14, 24, 55, 65, 21, 12, 13, 90];
const agesFiltered = ages.filter(function(age){
return age > 18
})
console.log(agesFiltered) */
//5.2
const ages = [22, 14, 24, 55, 65, 21, 12, 13, 90];
const agesFilteredPair = ages.filter(function(age){
return age%2===0
})
console.log(agesFiltered... |
import { Container, Typography } from "@material-ui/core";
import Hero from "../../Component/Reuseable/Hero";
const Location = () => {
return (
<>
<Container>
<Hero
title="Location"
p1content="IQ is a multinational group of companies employing more than 40 staff in 5 countries. We currently have pr... |
var changeImg, nextImg, prevImg;
changeImg = function(lnk) {
var project, sourceImg, sourceImgKey, targetImg;
project = $(lnk).parent().parent().parent().parent().parent().attr("id");
targetImg = $("#" + project + " .project_image img");
sourceImg = $(lnk).attr("href");
sourceImgKey = lnk.innerHTML;
target... |
import identifyPersonByPhone from './identifyPersonByPhone'
export default {
identifyPersonByPhone
} |
var gulp = require('gulp');
var sass = require('gulp-sass');
var fs = require('fs');
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var clean = require('gulp-clean');
var gm = require('gulp-gm');
gulp.task('default', ['sass-styles', 'folder-structure'], function ()... |
import React from 'react';
import Grid from './Grid';
export default function Shape({ name, grid, click }) {
const CLASS = 'gf-shape';
return (
<button className={CLASS} onClick={click} title={name} >
<Grid rows={grid} />
</button>
);
}
Shape.propTypes = {
name: React.PropTypes.string.isRequir... |
import React from 'react';
import AddBookForm from './AddBookForm';
import UpdateBookForm from './UpdateBookForm';
import DeleteBookForm from './DeleteBookForm';
import Board from './Board';
import store from '../store/index';
import { Provider } from 'react-redux';
function App() {
return (
<Provider store={sto... |
//listen for form submit
document.getElementById('myform').addEventListener('submit', saveBookmark);
// Saves bookmark
function saveBookmark(e){
//form values
var siteName = document.getElementById('siteName').value;
var siteUrl = document.getElementById('siteUrl').value;
if (!validateForm(siteName,... |
import { auth } from './firebase';
// Register
export const doCreateUserWithEmailAndPassword = (email, password) =>
auth.createUserWithEmailAndPassword(email, password);
// Login
export const doSignInWithEmailAndPassword = (email, password) =>
auth.signInWithEmailAndPassword(email, password);
// Logout... |
const mathFunctions = require('./models/math')
const hello = require('./models/hello')('Jamshidbek');
const port = 5000;
const http = require('http');
const server = http.createServer((req,res) => {
res.writeHead(200,{
'Content-Type': 'text/html',
})
res.write(`
<!DOCTYPE html>
<ht... |
function sum(a) {
let currentSum = a;
let calc = true;
function f(b) {
if(b && calc){
currentSum += b;
}else{
calc = false;
}
return f;
}
f.toString = function() {
return currentSum ? currentSum : 0;
};
return f;
}
console.log(sum(1));
console.log(su... |
import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import { useRouteMatch } from 'react-router-dom';
import 'react-semantic-ui-datepickers/dist/react-semantic-ui-datepickers.css';
import { changePath, useFetchNamesQuery } from '../../store';
import { LoadingComponent } from '../Loading... |
export default {
props: {
config: {
type: Object,
required: true
},
fullscreen: {
type: Boolean,
default: false
}
},
mounted() {
this.bus.$on("dashboard.refresh", this.doRefresh);
},
beforeDestroy() {
thi... |
import React from 'react';
import PhotoUploadForm from './photo_upload_form_container';
class PhotoUploadButton extends React.Component {
render(){
return (
<div className='photo-upload-button-container'>
<button className='photo-upload-button'
onClick={() => this.props.openModal(<PhotoU... |
/*
* @lc app=leetcode id=1031 lang=javascript
*
* [1031] Maximum Sum of Two Non-Overlapping Subarrays
*/
// @lc code=start
/**
* @param {number[]} A
* @param {number} L
* @param {number} M
* @return {number}
*/
var maxSumTwoNoOverlap = function(A, L, M) {
// Lmax, max sum of contiguous L elements before t... |
// chiedo all'utente se vuole scommettere su pari o dispari
// chiedo all'utente di inserire un numero tra 1 e 5
// faccio generare all'AI un numero random tra 1 e 5
// tramite una funzione sommo i due numeri e controllo che la somme sia pari o dispari e la scelta dell'utente e ritorno una risposta a schermo
var ... |
const renderFtl = require('./render-ftl')
module.exports = app => {
app.route('/').get((req, res) => renderFtl(req, res))
app.get('/js/lodash.min.js', (req, res) => {
res.sendFile('lodash/lodash.min.js', {
root: './node_modules/'
})
})
app.get('/js/react.development.js', (req, res) => {
res.s... |
/// <reference path="guidetools/guidestep.js" />
/// <reference path="tools/receivecall.js" />
/// <reference path="tools/parkedguides.js" />
/// <reference path="tabmanager.js" />
/// <reference path="asyncwebpartloader.js" />
/// <reference path="pagestatesmanager.js" />
if (TdcGuideManager == null || typeof (TdcGu... |
(function() {
var H = document.documentElement.clientHeight;
var fontSize = H / 10;
var curShowPage = 0;
document.documentElement.style.fontSize = fontSize + 'px';
var myScroll;
var elements = [];
var length = $('.bg-img').length;
for (var i = 0; i < length; i++) {
elements.push(... |
'use strict';
var path = require("path");
var supportFile = ["js"];
module.exports = function (param) {
let _, fs;
fs = param.fs, _ = param._;
[].forEach(function (folder) {
let files;
files = fs.readdirSync(path.join(__dirname, folder));
return files.forEach((file) => {
... |
import React from 'react';
import SearchPage from './SearchPage'
import { MainHeader } from 'Components'
class Search extends React.Component {
constructor(props) {
super(props);
const query = this.props.query;
this.state = {
value: query
};
}
componentWillReceiveProps(nextProps) {
c... |
import t from 'tcomb';
import _ from '//src/nodash';
import { match } from '../match';
import { value } from './value';
import { squish } from '../string.js';
export function extendProps(superProps, subProps, strict) {
const extendedProps = _.mapValues(subProps, (subProp, key) => {
// see if there was a sup... |
var structvertex3_d =
[
[ "label", "structvertex3_d.html#a6294e6614f1bb7ac73020c203a5f34c1", null ],
[ "x", "structvertex3_d.html#a6c6ee4315d72adbc5abb17e6af802087", null ],
[ "y", "structvertex3_d.html#aa1f4823bf2a3f648b1b0b39ef7ea5891", null ],
[ "z", "structvertex3_d.html#a67f3819dff895cb47284c34ec85... |
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const isDevelopment = process.argv.indexOf('--development') !== -1;
const entryPath = path.join(__dirname, 'src/js/index.js');
const entry = isDevelopment ? [
'webpack-hot-middleware... |
'use strict';
var bluebird = require('bluebird');
var util = require('util');
var assert = require('assert');
/**
* typical callback
*/
function calculatorCB(input, outputCallback) {
util.log('calP', input);
setTimeout(function () {
util.log('calP done', input);
outputCallback(undefined, input * 10);
... |
const countOdd = function(numbers, start, end) {
if (start==end) {
return 0;
}
let isOdd = numbers[start] % 2 != 0 ? 1 : 0;
return isOdd + countOdd(start+1, end);
}
console.log(countOdd([1,2,3,4,5,], 0, 4))
module.exports = countOdd; |
console.log("coucou je vais recuperer les infos ici");
/*
let urlButtonActualisation = "a[href='https://authentification-candidat.pole-emploi.fr/compte/redirigervers?url=https://actualisation-authent.pole-emploi.fr/acces.htm&actu=true']";
let urlEspacePerso = "https://candidat.pole-emploi.fr/espacepersonnel/"
*/
var UR... |
// @flow
import React from 'react';
import { View, StyleSheet, Text } from 'react-native';
import {
UIComponent,
UIStyle,
} from '../services/UIKit';
type Props = {
text: string,
colorFrom: string,
colorTo: string,
fotStyle: any,
length: ?number,
};
type State = {};
export default class TextGradien... |
#! /usr/bin/env node
const childProcess = require('child_process');
const c = require('chalk');
const _ = require('lodash/fp');
const minimatch = require('minimatch');
const {headClean, headMessage, pushFiles} = require('./core/git');
const {makeError} = require('./core/utils');
const executeScript = require('./core/s... |
// const $ = document;
// const banner = $.querySelector('#js-banner');
// const headerContainer = $.querySelector('#header-container');
// $.addEventListener("DOMContentLoaded", () => {
// window.addEventListener("resize", () => {
// if (window.innerWidth > 768) {
// // console.log('bigger than 768px', w... |
country = [{id:"al",name:"Albania"},
{id:"dz",name:"Algeria"},
{id:"ar",name:"Argentina"},
{id:"am",name:"Armenia"},
{id:"au",name:"Australia"},
{id:"at",name:"Austria"},
{id:"bh",name:"Bahrain"},
{id:"bd",name:"Bangladesh"},
{id:"by",name:"Belarus"},
{id:"be",name:"Belgium"},
{id:"bj",name:"Benin"},
{id:"bo",name:"Bol... |
import React from "react";
import { HomeContainer } from "./home.styles";
import HomeMenu from "../../components/home-menu/home-menu.component";
const Home = () => (
<HomeContainer>
<HomeMenu />
</HomeContainer>
);
export default Home;
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
angular.module('actorFinderApp', ['ngResource'],
function($interpolateProvider) {
$interpolateProvider.startSymbol('<%');... |
import ItemsOption from './diagram.items_option';
class NodesOption extends ItemsOption {
_getKeyExpr() {
return this._diagramWidget._createOptionGetter('nodes.keyExpr');
}
_getItemsExpr() {
return this._diagramWidget._createOptionGetter('nodes.itemsExpr');
}
_getContainerChildrenExpr() {
retur... |
var express = require("express");
var router = express.Router();
var mongo = require("../../connection");
var md5 = require('md5');
router.post("/", async function (req, res) {
const db1 = mongo.get().collection("user");
var result = {
status:'',
role:'',
uname:''
};
var ar = await db1.find({ _id: req.... |
import React, { Component } from 'react';
import styles from '../public/index.sass';
import styles2 from '../public/carousel.css';
import { Link } from 'react-router-dom';
import emblem_iphone from '../public/img/emblem_iphone_mobile.jpg';
import menuIcon from '../public/img/menuIcon.jpg';
import emblemIcon from '../pu... |
export const TOGGLE_GRID = 'TOGGLE_GRID';
export const TOGGLE_POINT = 'TOGGLE_POINT';
|
import Rx from 'rxjs/Rx'
import { createSubscriber } from '../utils'
/* -- Part 1 --
const
simple$ = new Rx.Observable(observer => {
console.log('Generating observable...')
setTimeout(() => {
observer.next('An Item!')
setTimeout(() => {
observer.next('Another Item!')
observer.c... |
import React, { Component } from 'react';
import './SettingsForm.css';
export default class SettingsForm extends Component {
state = {
label: ''
};
onLabelChange = (e) => {
this.setState({
label: e.target.value
});
};
onSubmit = (e) => {
e.preventDe... |
import axios from 'axios'
export const fetchTeams = (campaigns) => (dispatch) => {
dispatch({
type: 'FETCH_TEAMS'
})
let endpoint = `${process.env.SUPPORTER_URL}/search/pages_totals.json`
let params = {
campaign_id: campaigns,
group_by: 'teams',
limit: 5
}
return axios
.get(endpoint, ... |
export default [ '$locationProvider', function( $locationProvider ) {
$locationProvider.html5Mode( true );
}];
|
function concat (arrOne, arrTwo) {
var arr = [];
for (i = 0; i < arrOne.length; i++) {
arr.push(arrOne[i]);
}
for (x = 0; x < arrTwo.length; x++) {
arr.push(arrTwo[x]);
}
return arr;
} |
import React from 'react';
import './BuzzerPopup.css';
const buzzerPopup = (props) => (
props.can_buzz ? null
:
<div className={'buzzer'} style={{
color: props.buzzer_side === 'red' ? 'white' : 'black',
background: props.buzzer_side === 'red' ? 'lightgreen' : 'lightskyblue'}}>
<h1>TEAM {pro... |
import Router from "koa-router";
import config from "../../config";
const { modules } = config;
export default function initModules(app) {
const modulesDirs = modules.map(name => `${__dirname}/${name}`);
modulesDirs.forEach(mod => {
const router = require(`${mod}/router`); // eslint-disable-line import/no-dy... |
import { createRouter, createWebHistory } from 'vue-router'
const routes = [
{
path:'/',
redirect:'/home',
},
{
path:'/home',
name:'home',
component:()=>import("../views/home/home.vue"),
},
{
path:'/category',
name:'category',
component:()=>import("../views/category/category.v... |
function initMap () {
var location = {lat: 38.871857, lng: -77.056267};
var map = new google.maps.Map(document.getElementById("map"), {
zoom: 14,
center: location
});
}
$(window).scroll(function(){
if($(this).scrollTop() > 100){
$('#scroll').fadeIn();
}else{
... |
isc.TabSet.create({
ID: "SearchTabSet",
// width: "100%",
// height: "30%",
tabs: [{
id: "search",
title: "search",
pane: crmMainSearchForm
},{
id: "DailyReportTabset",
title: "Daily Report",
pane: dailyReport ,
}]
}); |
const _ = function (obj) {
if (Object.getPrototypeOf(obj) === _) { return obj }
if (!(this instanceof _)) { return new _(obj) }
var o = Object.create(_)
o._wrapped = obj
return o
}
// Current version.
_.version = '0.0.1'
module.exports = _
// 常用函数
_.noop = function () {}
_.identity = function (x) { return ... |
var myMoney = 10;
if (myMoney > 9) {
var taxHaven = myMoney * myMoney;
}
console.log(taxHaven); |
import React, { Fragment } from 'react';
import { ActivityIndicator } from 'react-native';
import { Camera as ExpoCamera, Permissions, ImageManipulator } from 'expo';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import { DropDownHelper } from '../../utils/helpers/dropdown';
import {
CameraButtonsConta... |
const TasksModels = require('../models/tasks');
const middlewares = require('./middlewares');
const getAll = async () => {
const tasks = await TasksModels.getAll();
return tasks;
};
const getAllAlphabetic = async () => {
const tasks = await TasksModels.getAllAlphabetic();
return tasks;
};
const getAllStatus ... |
var app = getApp()
// pages/stepThird/stepThird.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
*... |
import React from "react";
import firebase from "firebase/app";
import "firebase/auth";
import { Link } from "react-router-dom";
import "../scss/signIn.scss";
import "../scss/mediaSignIn.scss";
function SignIn({ email, password, onPassword, onEmail, onLine }) {
let [errors, setErrors] = React.useState(null);
cons... |
const {MongoClient}=require('mongodb')
const MONGO_URL='mongodb://localhost:27017';
const DB_NAME='tododb';
async function writeTasks(){
const client= await MongoClient.connect(MONGO_URL)
const tododb=client.db(DB_NAME)
const todos=tododb.collection('todos')
const result=await todos.insertMany([
... |
import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import { AtIcon } from 'taro-ui'
import PropTypes from 'prop-types'
import Item from './Item'
import './index.scss';
class OrderCell extends Component {
static propTypes = {
item: PropTypes.object,
handleClick: Pro... |
import React from 'react';
import MatchListItem from './match_list_item';
class MatchList extends React.Component {
constructor(props) {
super(props);
this.state = { matches: [] };
this.paginationInit();
}
paginationInit() {
this.offset = 0;
this.limit = 20;
}
componentDidMount() {
... |
function renderStudents(students) {
let studentsHTML = `
<div style="display: flex; flex-direction: column; align-items: center;">
<h1>Roll Call!</h1>
</div>
`
for (let i = 0; i < students.length; i++) {
if (students[i].isPresent) {
studentsHTML += `
<div styl... |
const msgerForm = get(".msger-inputarea");
const msgerInput = get(".msger-input");
const msgerChat = get(".msger-chat");
function Message(from, message) {
this.from = from;
this.message = message;
}
function Position(from, X, Y) {
this.from = from;
this.X = X;
this.Y = Y;
}
const BOT_IMG = "asset... |
// canvasエレメントの取得
let canvasElement = document.getElementById( 'canvas' );
// WebGL, glCubicの初期化
gl3.initGL( canvasElement );
if( !gl3.ready ) { console.log( 'initialize error' ); return; }
let gl = gl3.gl;
// バッファ長の決定,小さければ小さいほど高レスポンス
let bufferSize = 2048;
let canvasWidth = bufferSize;
let canvasHeight = 1;
canvasE... |
/*!
* Copyright (c) 2016 Nanchao Inc.
* All rights reserved.
*/
'use strict';
var Modbus = require('./modbus');
function ModbusRtuMaster(port, timeout) {
this._option = {
mode: 'ascii',
timeout: timeout
};
this._master = new Modbus(port, this._option);
}
// read status common handler... |
import { API_ROUTES } from 'api/config';
import { CALL_API } from 'constants';
/**
*
* Fetch employee data from server
*
*/
export const FETCH_EMPLOYEE_RECORDS = '@@employees/FETCH_EMPLOYEE_RECORDS';
export const FETCH_EMPLOYEE_SUCCESS = '@@employees/FETCH_EMPLOYEE_SUCCESS';
export const fetchEmployees = () => (... |
function mash(){
return `You will live in a ${getHome()}, and you will have ${getKidCount()} kids, you'll drive a ${getCar()}, and your salary will be ${getCash()}!`;
}
function getHome(){
if (process.argv[2]){
let homes = ["Mansion", process.argv[2], "Shack", "House", "North Korea"];
return ... |
import React, { Component } from 'react';
import { Shortcuts } from 'react-shortcuts';
import { toInteger, toArray, last, map, includes } from 'lodash';
import axios from 'axios';
import AlbumCardsContainer from '../components/AlbumCardsContainer';
import StarMusiqAlbumsFetcher from '../lib/CORSEnabledStarMusiqAlbumFe... |
// you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
function solution(A) {
// write your code in JavaScript (Node.js 4.0.0)
var hash = {}, counter = 0, i;
for ( i = 0; i < A.length; i++ ){
if ( hash[ A[i] ] === undefined ){
hash[... |
var startTime = 0;
var indexToDir = {
'0': 'left',
'1': 'down',
'2': 'up',
'3': 'right'
};
var keysPressed = {
up: false,
right: false,
down: false,
left: false
}
var chart = {
right: {
list: [],
pointer: 0
},
left: {
list: [],
pointer: 0
... |
import React from "react";
export const Wrapper = ({ props, children }) => {
return (
<>
<style jsx>{`
.Wrapper {
width: calc(100% - 10vw);
margin: 0 auto;
position: relative;
z-index: 2;
}
@media only screen and (max-width: 1024px) {
... |
const frontEndLogos = [
{
img: './public/assets/images/icons/html5.svg',
name: 'HTML5'
},
{
img: './public/assets/images/icons/css-3.svg',
name: 'CSS3'
},
{
img: './public/assets/images/icons/javascript.svg',
name: 'Javascript'
},
{
img... |
/**
* This is my custom i18n component. It lets me
* handle with precision the behavior of a switch
* in the user's language preference.
* In all cases, when the user changes the language,
* texts and links in the navigation will do the same,
* based on the routes defined here. And it navigate to
* the tr... |
test('class02', () => {
function myClass (initial) {
this.test = initial
}
const instance = new myClass(false)
console.log(instance.test)
}) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.