text stringlengths 7 3.69M |
|---|
{
"class" : "Page::ring::app::check_phone"
}
|
import React from "react";
const TableBirthdayCell = ({ birthDay }) => {
const age = Math.floor(
(new Date().getTime() - birthDay * 1000) /
(1000 * 60 * 60 * 24 * 365).toFixed(1)
);
return <td>{age}</td>;
};
export default TableBirthdayCell;
|
var cards = ["queen", "queen", "king", "king"];
var cardInPlay = [];
var cardOne = cards[0];
var cardTwo = cards[2];
cardInPlay.push(cardOne);
cardInPlay.push(cardTwo);
console.log("user flipped" + " " + cardInPlay);
if (cardInPlay.length === 2) {
if (cardInPlay[0] === cardInPlay[1]) {
alert ("You found a match!");... |
var chai = require('chai');
var assert = chai.assert;
var pairwise = require('../src/pairwise');
it('pairwise', function() {
assert.deepEqual(pairwise([1, 4, 2, 3, 0, 5], 7), 11, 'pairwise([1, 4, 2, 3, 0, 5], 7) should return 11.');
assert.deepEqual(pairwise([1, 3, 2, 4], 4), 1, 'pairwise([1, 3, 2, 4], 4) sho... |
import sayHello from './sayHello'
it('says Hello with no name', () => {
const result = sayHello()
expect(result).toEqual({PHRASE: 'Hello stranger'})
})
it('says Hello with a name', () => {
const result = sayHello({NAME: () => ('WORLD')})
expect(result).toEqual({PHRASE: 'Hello WORLD'})
})
|
import React from "react";
import { Col, Row, Container } from "../components/Grid";
import './style.css';
import me from "../Images/headshot.jpeg";
import Headshot from "../components/Headshot";
const Home = () => {
return (
<Container fluid>
<header>
<Row>
<h1>About Me</h1>
</Row>
... |
app.controller("topicViewCtrl", function ($scope, $http, $routeParams, $location) {
//write the code over here
var baseUrl = "/api/topics"
var id = $routeParams.id;
var subjectId = $routeParams.subjectId;
datePickerId.min = new Date().toISOString().split("T")[0];
var config = {
... |
/* jshint indent: 2 */
module.exports = function(sequelize, DataTypes) {
return sequelize.define('tck_topic', {
tck_topic_id: {
type: DataTypes.INTEGER(10).UNSIGNED,
allowNull: false,
primaryKey: true,
autoIncrement: true
},
code: {
type: DataTypes.STRING(5),
allowNull... |
import Route from '@ember/routing/route';
export default Route.extend({
actions: {
openWindow(url){
//https://flightaware.com/resources/registration/N755PR
window.open(url);
}
}
});
|
function quantityController(isIncreasing, quantity, cost, price){
// Product Quanity
const ProductQuantity = document.getElementById(quantity);
let ProductQuantityValue = parseFloat(ProductQuantity.value);
// Increase or Decrease
if(isIncreasing)
ProductQuantityValue = ProductQuantityValue + 1;
... |
import { quat } from "gl-matrix";
import { wc3Solver } from "../solvers";
export const mdxTests = {
name: 'mdx',
tests: [
{
name: 'base',
load(viewer) {
return viewer.load('Units/Human/Footman/Footman.mdx', wc3Solver);
},
test(viewer, scene, camera, model) {
camera.moveT... |
import React from 'react';
import "./Navigation.css"
const Navigation = ({ onRouteChange, onInputChange, onButtonSubmit, isSignedIn, showPhotoMenu, onButtonSearch, onSearchChange }) => {
//<a className="navLeft f5" id="water" href="http://localhost/Water-Project-1/waterlogged.html">{'Waterlogged Link'}</a>
if ... |
// detect if element is in view code from http://jsfiddle.net/bseth99/kej64/
(function($) {
var $window = $(window),
_watch = [],
_buffer;
function test($el) {
var docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $el.off... |
require('dotenv').config();
const express = require('express'),
app = express(),
server = require('http').createServer(app),
path = require('path'),
dotenv = require('dotenv'),
ENV = require(path.resolve(`./config/env/${process.env.NODE_ENV}`));
require(path.res... |
class DocumentPrototype {
constructor() {}
getFilename() {
return this.filename;
}
clone () {
throw new Error ('we need a concrete prototype!');
}
}
module.exports = DocumentPrototype;
|
const axios = require("axios");
const cheerio = require("cheerio");
module.exports = {
parse: url =>
axios.get(url).then(
resp => {
if (resp.status === 200) {
const html = resp.data;
const $ = cheerio.load(html);
return $;
}
},
error => {
t... |
/**
*检验用户是否已输入,输入是否合法
*/
function check()
{
fields=document.getElementsByTagName("input");
for(i=0;i<fields.length;i++)
{
val=fields[i].getAttribute('name');
ckValue=fields[i].getAttribute('ckName');
if(ckValue!=null)
{
if(ckValue=='博客链接地址' && !isBokee(fields[i].value))
{
alert('请正确填写... |
console.log(getPrimes(10, 100));
function getPrimes(nPrimes, startAt)
{
let arr=[];
for(let ind=startAt;ind<(startAt+nPrimes);ind++){
if (isPrime(ind)){
arr.push(ind)
}
}
console.log(arr)
}
// Returns true if a number is prime
function isPrime(n)
{
for(let i=2;i<n;i++){
... |
import React from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import authActions from '../actions/auth';
import notificationsActions from '../actions/notifications';
import Account from '../tabs/Account/Account';
class AccountContainer extends React.Component {
render() {
... |
import axios from 'axios';
// const defaultGame = { id: 1, name: "teste", description: "teste", price: 100, image: "https://picsum.photos/200/300"};
const getGames = async () => {
let url = 'http://localhost:1337/games';
try {
const response = await axios.get(url);
const content = respons... |
let etapas = [
{
titulo: 'Vereador',
numeros: 5,
candidatos: [
{
numero: '38111',
nome: 'José Carlos',
partido: 'PSE',
fotos: [
{url: 'c-1.jpeg', legenda: 'Vereador'}
]
... |
const User = require('../model/user.model');
const config = require('../config');
var exports = {};
exports.register = function(req, res) {
User.register(req.body.username, req.body.password)
.then(function(data) {
res.json({
status: 1,
message: 'Success'
});
}, function(err) {
... |
//Dont change it
requirejs(['ext_editor_io', 'jquery_190', 'raphael_210'],
function (extIO, $) {
function textFormattingCanvas(dom, data) {
if (! data || ! data.ext) {
return
}
const output = data.out
/*---------------------------------------... |
import React from 'react';
export class TypeWriter extends React.Component {
constructor(props){
super(props);
this.state = {
content: this.props.content, // array of content to iterate over
current_text: "",
};
this.interval_id = null;
this.pause_timeout = null;
this.text_index = 0;
this.forward... |
/**
* Created by h205p2 on 5/18/17.
*/
//berkeleyspn@gmail.com
//GoJackets!
function createSportWidget(location){
var sportsArray = ["boysBase", "boysBask","boysXX", "boysFoot", "boysGolf", "boysLax", "boysSoc","boysTen", "boysTNF", "boysVol", "boysWP", "boysWre", "girlsBask", "girlsFH", "girlsGolf", "girlsL... |
const { default: ClientManager } = require('../dist/index.js')
const run = async () => {
ClientManager.addClientConfig({
name: 'nodejs',
displayName: 'Node.js',
dockerimage: 'node:10',
entryPoint: 'auto',
service: false
})
const client = await ClientManager.getClient('nodejs', {
listene... |
function birdChartDraw(){
$('#print-chart-div').remove();
var date = getBirdDate();
var phases = getVisiblePhases();
var input = {'job': job, 'date': date, 'phases': phases, 'return':'chart-json', 'uid': uid};
jQuery.post('/global/front_desk/reports/production_graph_ajax.php', input, function(data) {
var ... |
import React from 'react';
import { useCollection } from 'react-firebase-hooks/firestore';
import { useFirebase } from '../../hooks/useFirebase';
import { useForm } from '../../hooks/useForm';
import useNotification from '../../hooks/useNotification';
import {
FormWrapper,
FormStyled,
FormGroup,
Legend,
Lab... |
var searchData=
[
['inotify',['INotify',['../interface_i_notify.html',1,'']]],
['ioutils',['IOUtils',['../class_mikkeo_1_1_i_o_1_1_i_o_utils.html',1,'Mikkeo::IO']]]
];
|
export const ADD_PRODUCT = "ADD_PRODUCT";
export const ADD_PRODUCT_SUCCESS = "ADD_PRODUCT_SUCCESS";
export const ADD_PRODUCT_ERROR = "ADD_PRODUCT_ERROR";
export const START_PRODUCTS_DOWNLOAD = "START_PRODUCT_DOWNLOAD";
export const PRODUCTS_DONWLOAD_SUCCESS = "PRODUCTS_DONWLOAD_SUCCESS";
export const PRODUCTS_DONWLOAD... |
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const Service = new Schema({
name: {
type: String,
required: [true, "Please enter a service name"],
index: true
},
price: {
type: Number,
required: [true, "Please enter a price"],
index: true
}
});
module.exports = mon... |
/* global before, describe, it */
var should = require('should')
var request = require('supertest')
var koop = require('koop')({})
var kooplib = require('koop/lib')
var provider = require('../index.js')
before(function (done) {
var model = new provider.model(kooplib) // eslint-disable-line
var controller = new pr... |
import { isTriangle, triangleType, TriangleType } from '../models/Triangle';
test('isTriangle', () => {
expect(isTriangle(0, 0, 0)).toBeFalsy();
expect(isTriangle(0, 1, 1)).toBeFalsy();
expect(isTriangle(1, 0, 1)).toBeFalsy();
expect(isTriangle(1, 1, 0)).toBeFalsy();
expect(isTriangle(null, 0, 0)).toBeFals... |
import * as React from 'react';
import {View, Text} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import {HomeScreen} from '../containers';
import Ma... |
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "818c53907b8485268d896e7a42f29eea",
"url": "/index.html"
},
{
"revision": "99e6c052483b5226e772",
"url": "/static/css/main.0c57c26c.chunk.css"
},
{
"revision": "931c2f9e6b8dde240ee1",
"url": "/static/js/2.... |
import React from 'react';
import {View, Button, TextInput, StyleSheet} from 'react-native';
export class SignUp extends React.Component {
state = {
username: '',
password: '',
email: '',
phone_number: '',
};
onChangeText = (key, val) => {
this.setState({[key]: val});
};
signUp = async ()... |
// from data.js
var tableData = data;
var tbody = d3.select("tbody");
// YOUR CODE HERE!
function populateTable(newdata) {
tbody.html("")
newdata.forEach((rowdata) => {
var row = tbody.append("tr")
Object.values(rowdata).forEach((value) => {
var celldata = row.append("td")
celldata.text(value)
})
})
}
populat... |
import React from 'react';
import userPhoto from '../../assets/images/user3.png';
import styled from 'styled-components';
import ProfileStatusWithHooks from '../Profile/ProfileInfo/ProfileStatusWithHooks';
import {Card} from 'react-bootstrap';
const Styles = styled.div`
.imgIco {
max-height: 150px;
}
... |
/* 🤖 this file was generated by svg-to-ts*/
export const EOSIconsSettingsSystemDaydream = {
name: 'settings_system_daydream',
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 16h6.5a2.5 2.5 0 000-5h-.05c-.24-1.69-1.69-3-3.45-3-1.4 0-2.6.83-3.16 2.02h-.16A2.994 2.994 0 006 13c0 1.6... |
function palindromePermutation(word) {
var charsFrecuencies = createBitVectorFromWord(word);
return charsFrecuencies === 0 || hasExactlyOneBitSet(charsFrecuencies);
}
/**
* Returns a bit vector created based in the word.
* If a letter appears even times, it is set to 0.
* If a letter appears odd times, it ... |
Ext.override(Ext.Element, {
update : function(html, loadScripts, callback){
if(typeof html == "undefined"){
html = "";
}
if(loadScripts !== true){
this.dom.innerHTML = html;
if(typeof callback == "function"){
callback();
}
return this;
}
var id = Ext.id();
var dom = this.dom;
html += ... |
const express =require ('express');
const router = express.Router()
const cors=require('cors')
const Astro=require('../model/userastro')
const app = express();
app.use(cors())
router.get('/astro',(req,res,next)=>{
Bill.find((err,astro)=>{
if(err){
res.json(err)
}
else{
... |
import React from 'react';
import classes from './ResumeButtons.module.css';
const resumeButtons = () => {
return (
<div className={classes.ResumeButtons}>
<button>upload pdf</button>
<button>generate resume</button>
</div>
);
};
export default resumeButtons;
|
export const LOAD_ALL_TASKS = 'LOAD_ALL_TASKS' |
define({
name:'model/training',
requires:[
'core/event',
'core/tizen'
],
def:function traininginit( req) {
var setcount,
count,
title,
setTime=1,
countSet=1,
minutes=0,
seconds=0,
startTime,
state = false;
function setTitle(Title){... |
// Global Arrays to store the name of the breeds for a faster access
var Dog = [
"Labrador Retriever",
"Bulldog",
"Caniche",
"Beagle",
"German Shepherd Dog",
"Golden Retriever",
"French Bulldog",
"Boxers",
"Yorkshire Terrier",
"Rottweiler",
"Welsh Corgie"
]
... |
import Cell from './Cell'
import { Row, Col } from './Row'
import { mixinEvent } from './event'
class Dataset extends Array {
constructor(data, option) {
super()
this.layoutScaleFunc = this.handleLayoutScale(option.layoutScale)
data.forEach(item => {
let cell = item
if (!(item instanceof Cell)... |
import React from "react";
import "./Header.css";
import GitHubIcon from "@material-ui/icons/GitHub";
import LinkedInIcon from "@material-ui/icons/LinkedIn";
import AccountCircleIcon from "@material-ui/icons/AccountCircle";
import MenuIcon from "@material-ui/icons/Menu";
function Header() {
/* on mobile collapse lef... |
$(document).ready(function () {
let $sectionA = $("#section-a");
let $sectionB = $("#section-b");
let $sectionC = $("#section-c");
// Calculate when section enters the screen
function isVisible(section) {
let sectionTop = section.offset().top;
// let sectionBottom = sectionTop + section.outerHeight();
let ... |
"use strict";
function sleep(ms) {
return new Promise(function (resolve) {
return setTimeout(resolve, ms);
});
};
var baozhangTool = {
float: function float() {
var button = document.createElement("button");
button.innerHTML = '点击自动填写';
button.setAttribute("style", "width: 100px;height: 50px;bac... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import Typography from '@material-ui/core/Typography';
import '../../App.css';
import Filter from "@material-ui/icons/FilterNone"
const ... |
define([
'jquery',
'underscore',
'backbone',
'utils/domUtils',
'text!templates/homeUser/passwordReset.html',
'backbones/views/components/passwordResetFormView',
'app/settings',
'app/globals',
"i18n!nls/uiComponents"
], functio... |
const express = require('express');
const AuthController = require('../controller/authController');
const {check} = require('express-validator');
const {authCheck} = require('../util/auth');
const router = express.Router();
const authController = new AuthController();
router.post('/api/registr', [
check('username... |
$(document).ready(function(){
$('.filter-watched').on('click', filterWatched);
$('.filter-unwatched').on('click', filterUnwatched);
})
function filterWatched(event) {
event.preventDefault();
$('.movie').each(function(index) {
if ($(this).find('.movie-watched').text() == 'Watched?: true') {
$(this)... |
const rabbit = require("amqplib");
const { bakeLods, changePermissions } = require("./ConsumerFunctions.js");
const { downloadSelectedFiles } = require("./DownloadFiles.js");
const { uploadLodToDrive } = require("./UploadToDrive")
const QUEUE_NAME = "bitreel-rmq";
const EXCHANGE_TYPE = "direct";
const EXCHANGE_NAME = ... |
'use strict';
const expect = require('chai').expect;
const request = require('superagent');
const Image = require('../model/image.js');
const User = require('../model/user.js');
const Gallery = require('../model/gallery.js');
const Post = require('../model/post.js');
const testData = require('./lib/test-data.js');
c... |
import { AppBar, Divider, Drawer, Hidden, IconButton, List, Toolbar, Typography } from '@material-ui/core';
import { withStyles } from '@material-ui/core/styles';
import { AttachMoney, FlashOn, Home, Menu, TrendingUp } from '@material-ui/icons';
import React from 'react';
import Footer from '../footer';
import ListItem... |
var searchData=
[
['using_20nanoengine_20for_20systems_20with_20low_20resources',['Using NanoEngine for systems with low resources',['../md_nano_engine__r_e_a_d_m_e.html',1,'']]],
['uart_5fbuffer_5frx',['UART_BUFFER_RX',['../ssd1306__uart_8h.html#adff6f1691b8119f8c50293135a28e1b3',1,'ssd1306_uart.h']]],
['uart_5f... |
'use strict'
/** @type {import('@adonisjs/lucid/src/Schema')} */
const Schema = use('Schema')
class OpCategoriesPostsSchema extends Schema {
up () {
this.create('op_categories_posts', (table) => {
table.increments()
table.integer('post_id',11).unsigned().references('id').inTable('op_users')
ta... |
function aboutMe() {
var aboutMeHTML = '<p>This is the section where I give information about me. So, HELLO WORLD.</p>';
document.getElementById('conten-1').onload.innerHTML = aboutMeHTML;
} |
var calculator = require('./CalculatorModule.js');
var rs = require('readline-sync');
//Calculator
var x = rs.question("Please enter a number ");
var symbol = rs.question('Please enter an operator (+, - , / , * ) ');
var y = rs.question('Please enter another number ');
switch(symbol){
case '+':
calculator.add(x, y);
... |
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Settings = Me.imports.lib.settings;
const ApplicationName = "Power Tweaks";
function logMsg(logMessage) {
if (Settings.loggingEnabled() === false) {
return;
}
log(`${ApplicationName} : ${logMessage}`);
} |
import React from "react";
const Header = () => (
<div className="header">
<h1>TASKEY</h1>
<h4>
MODERN
<span> TASK LIST</span>
</h4>
</div>
);
export default Header;
|
$(document).ready(function() {
"use strict";
var av_name = "DPDAFS";
var av = new JSAV(av_name);
var Frames = PIFRAMES.init(av_name);
// Frame 1
av.umsg("Let's try to determine if there is a difference between Deterministic and Non-deterministic PDAs in terms of what languages they can recognize.");
... |
import React, { Component } from 'react';
import * as api from '../apiUtils/api';
import moment from 'moment';
import ArticlePage from './ArticlePage';
import propTypes from 'prop-types';
import { Redirect } from 'react-router-dom'
import LoadingBar from './LoadingBar'
class Article extends Component {
state = {
... |
var structattribute________________________________info________8js____8js__8js_8js =
[
[ "structattribute________________info____8js__8js_8js", "structattribute________________________________info________8js____8js__8js_8js.html#a9fae16e77c5b88addcaf464b6ebfacc0", null ]
]; |
import { StyleSheet } from 'react-native'
import { fontStyles, colors, scale, alignment } from '../../utils'
const styles = StyleSheet.create({
flex: {
flex: 1
},
safeAreaStyle: {
backgroundColor: colors.headerbackground
},
mainContainer: {
backgroundColor: colors.themeBackground
},
subContai... |
(function() {
this.editUi = function(modes) {
this.ui = $('<div/>');
//var nodePreSize = 3;
this.modeData = {}; // [isOn, act, nodePre, nodePreScript]
this.on = function(name, setup) {
var nodePre = [];
var nodePreCompute = function() {
setTimeout( function() {
// invisible child node for pro... |
export const AuthApiConstants = {
authorization: 'authorization'
}
|
/*
sensorTag attitude example using accelerometer, gyrometer, and magnetometer
This example uses Sandeep Mistry's sensortag library for node.js to
read data from a TI sensorTag, and Simon Werner's ahrs library
to calculate heading, pitch, and roll.
https://github.com/sandeepmistry/node-sensortag
https://www.npmj... |
$(document).ready(function(){
$("img").hover(
function(){
$(this).removeClass("active").siblings().addClass("active");
},
function(){
$(this).siblings().removeClass("active");
}
);
});
|
const connection = require('../config/dbconnection');
let Calc = {
getAll: callback => {
let sql = "SELECT * FROM EE_class ORDER BY created_at DESC";
return connection.query(sql, callback );
},
calculate: (req, res, callback ) => {
let weight = Number(req.weight);
let cotwo ... |
import React from 'react';
import logo from '../../assets/images/logo-80x80.png';
import classes from './Logo.css';
const Logo = (props) => <a href={"./"} className={classes.Logo}><img src={logo} alt={"Nuf"}/></a>
export default Logo;
|
const {v4 : uuidv4} = require('uuid')
const express = require("express");
const bodyParser = require("body-parser");
const cors = require("cors");
const port = 5000;
const app = express();
const token =
"esfeyJ1c2VySWQiOiJiMDhmODZhZi0zNWRhLTQ4ZjItOGZhYi1jZWYzOTA0NUIhkufemQifQ";
let nextId = 70888934;
let products ... |
//引入数据库
const mongoose = require('mongoose');
//链接数据库
mongoose.connect('mongodb://localhost/kuazhu',{ useUnifiedTopology: true,useNewUrlParser: true });
let getRandom = (min,max)=>{
return Math.round(min+Math.random()*(max-min))
}
const names = ["tom","bob","amy","peter"];
const majors = ["computer","art","music","m... |
function shimEx() {
console.log('NO AMD,NEED SHIM');
}
function JsonToStr(json) {
return json && JSON.parse(json)
}
|
var express = require('express');
var User = require('../models/user');
var validator = require('../config/validator');
var router = express.Router();
/**
* /admin/user/list路由,将渲染user_list.jade页面
*/
router.get('/list', validator.signinRequired, validator.adminRequired, function (req, res, next) {
/**
* 这里的fetch方法... |
import React, { useEffect, useRef, useState } from "react";
import Options from "./Options";
import TimerComponent from "./TimerComponent";
import { useSelector, useDispatch } from "react-redux";
import { useHistory } from "react-router";
import { updateAnswers } from "../redux/actions/questionsAction";
import { defaul... |
var expect = chai.expect;
describe('scomosTree',function(){
describe('Constructor',function(){
it('Should return instance of scomosTree',function(){
var sTree = new d3scomos.scomosTree();
expect(sTree).to.be.defined;
});
it('should accept default tree node ',function(){
var sTree = new d3scomos.scomosT... |
/*
* Copyright (C) 2009-2014 SAP SE or an SAP affiliate company. All rights reserved
*/
jQuery.sap.require("sap.ui.core.mvc.Controller");
jQuery.sap.require("sap.ca.scfld.md.app.CommonHeaderFooterHelper");
/**
* @class Deprecated, use ScfldMasterController.js instead
* @name sap.ca.scfld.md.controller.BaseMasterCon... |
import React from 'react';
import { findDOMNode } from 'react-dom';
import ReactTestUtils from 'react-dom/test-utils';
import SidenavBody from '../src/SidenavBody';
describe('SidenavBody', () => {
it('Should render a body', () => {
const title = 'Test';
const instance = ReactTestUtils.renderIntoDocument(<Si... |
import React, {Component} from 'react';
import { Navbar,Nav,NavItem,NavDropdown,MenuItem, } from 'react-bootstrap';
class MyNav extends Component {
render(){
return(
<Navbar inverse collapseOnSelect>
<Navbar.Header>
<Navbar.Brand>
<a href="">Vacations</a>
</Navbar.Br... |
import React, {useState} from 'react';
import {View, Text, SafeAreaView, StyleSheet, Image} from 'react-native';
// Styling
import paddings from '../../styles/paddings';
import colors from '../../styles/colors';
export default function HandbagsDetailBagScreen(props){
const {item} = props.route.params
return(
... |
export { displayAfterStart } from "./display" |
$("#ejemplo1").dataTable();
|
import firebase from "firebase/app";
import "firebase/firestore";
// const firebaseConfig = {
// apiKey: "AIzaSyBQ6CPZRaGRaqlYB6YRu8KzYZwJLXaDjNM",
// authDomain: "task-manager-project-42398.firebaseapp.com",
// projectId: "task-manager-project-42398",
// storageBucket: "task-manager-project-42398.appspot.com... |
import {
OPPONENT_SELECTED,
NEW_GAME_CREATED
} from '../actions/newGame';
const initState = { id: null, opponents: null, opponent: null };
const newGame = (state = initState, action) => {
switch (action.type) {
case OPPONENT_SELECTED:
return {
...state,
opponent: action.opponent
};
... |
export default function({Schema, model, Url}){
const reportSchema = Schema({
name: {type: String, required: true},
location: {
type: {
type: String, // Don't do `{ location: { type: String } }`
enum: ['Point'], // 'location.type' must be 'Point'
required:... |
export default location => {
const [language] = location.pathname.split('/').filter(Boolean);
return { language };
};
|
import {
runFlow as runSeriesFlow,
runConfig as runSeriesConfig,
} from './pipeline/series.js';
import {
runFlow as runParallelFlow,
runConfig as runParallelConfig,
} from './pipeline/parallel.js';
import { runTask } from './task/task.js';
runSeriesFlow();
runSeriesConfig();
runParallelFlow();
runParallelConfig()... |
// credits to https://gist.github.com/bennadel/3379332
// for the inspiration
// ======================================================/
import "lodash";
// When rending an underscore template, we want top-level
// variables to be referenced as part of an object. For
// technical reasons (scope-chain search), this spe... |
const fs = require('fs');
const _ = require('lodash');
const yargs = require('yargs').argv;
notes = require('./notes.js');
var command = yargs._[0];
// console.log(process.argv);
// console.log(yargs.argv);
if (command === 'add') {
notes.addNote(yargs.title,yargs.body)
} else if (command === 'list') {
var li... |
import React, { useState } from "react/cjs/react.development";
const SearchInMap = () => {
const [boundary, setBoundary] = useState("");
const [isMouseDown, setMouseDown] = useState(false);
var tempCan = document.getElementById("tempCanvas");
const sX, sY;
const canvasX = tempCan.offsetHeight().l... |
class Deck {
constructor() {
this.deck = this.populateDeck();
this.render();
}
render() {
var img = document.createElement('img');
img.src = './images/PNG/hoyleback.png';
img.id = 'back-card';
var deck = document.getElementById('deck');
deck.innerHTML = '';
deck.appendChild(img);... |
var path = require('path')
var webpack = require('webpack')
var MiniCssExtractPlugin = require('mini-css-extract-plugin')
module.exports = {
entry: {
site: ['./assets/javascripts/index.js', './assets/stylesheets/index.scss']
},
output: {
filename: 'assets/javascripts/[name].js',
path: path.resolve(__... |
import React from 'react'
import { Library, Example } from '@compositor/kit'
import { Button } from 'standard-components'
import { ThemeProvider } from 'styled-components'
import theme from './theme'
export default () => (
<ThemeProvider theme={theme}>
<Library>
<Library.Nav />
<Example name="Button... |
'use strict';
var listen = require('..');
function longRunning(callback) {
setTimeout(callback, 500);
}
var listener = listen();
longRunning(listener(250));
listener.then(function (err) {
if (err && err.name === 'TimeoutError') {
console.warn('Timeout after 250 ms!');
} else {
console.log('Invoking t... |
import React from 'react';
import { Button,
View,
Text,
StyleSheet,
TextInput,
Picker ,
TouchableOpacity,
ScrollView,} from 'react-native';
import { createAppContainer, createStackNavigator } from 'react-navigation'; // Version can be specified in package.json
import DatePicker from 'react-native-datepicker... |
import Button from './Button/Button.js';
import Modal from './Modal/Modal.js';
export {
Button,
Modal
};
|
function wormLength(worm) {
return worm.match(/-/g).length !== 0 ? `${worm.length * 10} mm.` : 'invalid';
}
const result = wormLength('----------');
console.log(result);
// Test.assertEquals(wormLength("----------"), "100 mm.")
// Test.assertEquals(wormLength(""), "invalid")
// Test.assertEquals(wormLength("---_-___... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.