text stringlengths 7 3.69M |
|---|
export {
addIngredient,
removeIngredient,
fetchIngredients,
} from "./burgerBuilder";
export { purchaseBurger, fetchOrders } from "./order";
export { auth, authLogout, setAuthRedirectPath,checkAuthState } from "./auth";
|
import build from 'redux-object'
export default ({ transactionsIndex, transactions }) =>
transactionsIndex.currentPage &&
transactionsIndex.currentPage
.map(id => build(transactions, 'items', id))
.filter(t => t)
|
class localstorage {
constructor(){
this.merchId = this.initialization();
this.coordinates = this.initialization('coordinates');
//intial values
console.log('MerchantId :',this.merchId,' coordinates :', this.coordinates)
}
initialization(type='merchId'){
var data = null;
if(type=='merchId'){
if(!local... |
let libcec = require( 'node-cec' );
let NodeCec = libcec.NodeCec;
let CEC = libcec.CEC;
let cec = new NodeCec( 'node-cec-monitor' );
// -------------------------------------------------------------------------- //
//- KILL CEC-CLIENT PROCESS ON EXIT
process.on( 'SIGINT', function() {
if ( cec != null ) {
cec.... |
// yarn -D add babel-eslint eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react prettier eslint-config-prettier eslint-plugin-prettier eslint-plugin-react
module.exports = {
"extends": ["airbnb", "prettier", "prettier/react"],
"plugins": ["prettier"],
"parser": "babel-esli... |
'use strict';
var CLOUD_WIDTH = 420;
var CLOUD_HEIGHT = 270;
var CLOUD_X = 100;
var CLOUD_Y = 10;
var GAP = 10;
var TITLE_GAP = GAP * 2;
var TITLE_Y = CLOUD_Y + TITLE_GAP;
var GRAPH_HEIGHT = 150;
var GRAPH_WIDTH = 40;
var GRAPH_GAP = 50;
var OWN_GRAPH_COLOR = 'rgba(255, 0, 0, 1)';
var drawTable = function (context, x... |
import React from "react"
import ReactDOM from "react-dom"
function MyInfo() {
return (
<div>
<h1> James </h1>
<p> My name is James </p>
<ul>
<li> New York </li>
<li> Tokyo </li>
<li> Seoul </li>
</ul>
</div>
)
}
ReactDOM.render(
<MyInfo ... |
const express = require('express');
const Model = require('../globalModel');
const authRequired = require('../middleware/authRequired');
const helper = require('../helper');
const router = express.Router();
router.get('/:id', authRequired, async (req, res) => {
const seller_profileID = req.params.id;
const re... |
/**
* Created by admin on 2016/12/28.
*/
exports.createOrder = function (req, res) {
};
exports.login = function (req, res) {
var username = req.body.username;
var passwd = req.body.passwd;
User.findOne({username: username}).then(function (data) {
req.session.userId = data._id;
res.jsonp... |
// n files
// serial
// using loops // functions
let files = ["../f1.txt", "../f2.txt", "../f3.txt"];
let fs = require("fs");
// let idx = 0;
// while (idx < files.length) {
// fs.readFile(files[idx], function (err, data) {
// console.log(data + "");
// idx++;
// });
// }
// closures in javascript
funct... |
let express = require("express")
let router = express.Router()
let mongoose = require("mongoose")
var Food= require("../models/foods")
var mongodbUri= "mongodb+srv://leon:liang369369@wit-donation-cluster-lovf9.mongodb.net/foodhub?retryWrites=true&w=majority"
mongoose.connect(mongodbUri,{useNewUrlParser:true})
mongoose.... |
import React from 'react'
import { Global } from '@emotion/core'
import { withTheme, ThemeProvider } from 'emotion-theming'
import siteTheme from './theme/theme'
import cssGlobal from './theme/global'
// Component
import Router from "./routes";
import OrderProvider from './context/OrderContext';
import PaymentProvi... |
import React from "react";
import {
FlatList,
ScrollView,
Text,
View,
TouchableOpacity,
Image,
Dimensions,
TouchableHighlight,
} from "react-native";
import styles from "./styles";
import Carousel, { Pagination } from "react-native-snap-carousel";
import {
getIngredientName,
getCategoryName,
getCa... |
import React, { useEffect } from "react";
import { useHistory } from "react-router";
import { admin } from "../../Proxy/proxy";
import Dashboard from "./Dashboard";
import WaterInfo from "./WaterInfo";
function UserCover() {
const history = useHistory();
useEffect(() => {
if (localStorage.getItem("token") == n... |
import React, {Component} from 'react';
import {
Text,
View,
FlatList,
Button,
TouchableOpacity,
Image,
Alert
} from 'react-native';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import * as editActions from '../../reducers/edit.action';
import ViewIte... |
new Vue({
el:"#app",
data:{
playerHealth: 100,
monsterHealth: 100,
gameIsRunning: false,
turns:[]
},
methods:{
onClickStartGame: function(){
this.playerHealth = 100;
this.monsterHealth = 100;
this.gameIsRunning = true;
this.turns = [];
},
onClickAttack: functi... |
const express = require('express');
const mongoose = require('mongoose')
//const routes = require('./routes')
const app = express()
mongoose.connect('mongodb+srv://root:dallatorre@cluster0-jbpgu.gcp.mongodb.net/test?retryWrites=true&w=majority')
app.use(express.json)
app.get('/oi', (req, resp) =>{
console.log("... |
/* JUST INCASE: THIS BONUS FUNCTION RE-ARRANGES THE ELEMENTS OF AN ARRAY IN ASCENDING ORDER. */
/* The function is written in Vanilla JavaScript. */
/* This Function uses Merge Sort Algorithm to sort the elements of an array in ascending order. */
/* Written in Entirety by Vakindu Philliam. */
function mergesort... |
// 默认值
const initialState = {
pageTitle: '首页',
flag: 1,
}
// 一个reducer就是一个函数
export default function index(state = initialState, action = {}) {
// 不同的action有不同的处理逻辑
switch (action.type) {
case 'SET_PAGE_TITLE':
return Object.assign({}, state, {
pageTitle: '9988'
})
default:
r... |
import React from 'react';
function Sea() {
return(
<div>
<div class="card-deck container">
<div class="card" style={{backgroundColor:'#337dece3'}}>
<div class="card-img">
<img variant="top" alt="image7" src={require('../Component/Imag... |
import { combineReducers } from 'redux';
import expandMenu from './expandMenu';
export const navbar = combineReducers({
expandMenu
});
export default navbar;
|
/**
* Created by Þórður on 2.12.2014.
*/
var should = require('should');
var _ = require('lodash');
var tictactoe = require('./tictactoe.js');
describe('join game command', function(){
var createGameEvent = {
id:"1337",
event: "GameCreated",
user:{
userName:"Doddi"
},
name:"GameOfLife",... |
// @flow
import TimeoutError from 'local/timeout-error';
describe('TimeoutError', () => {
it('can throw error', () => {
expect(() => { throw new TimeoutError(); }).toThrowError('Timeout error');
expect(() => { throw new TimeoutError('Foobar message'); }).toThrowError('Foobar message');
});
it('can throw... |
import TextField from './text-field';
import Checkbox from './checkbox';
import DropDown from './dropdown';
import Button from './button';
import Table from './table';
import Code from './code';
import Menu from './menu';
export {
TextField,
Checkbox,
DropDown,
Button,
Table,
Code,
Menu
};
|
import React, { useState, useEffect, useRef } from "react";
import { IoTimerOutline } from "react-icons/io5";
import { Button, Container, Image } from "react-bootstrap";
import { useDispatch } from "react-redux";
import NavbarBackMolecule from "../molecules/NavbarBackMolecule";
import MyDate from "../common/MyDate";
im... |
/**
* Created by Bhanu on 27/03/2016.
*/
"use strict";
(function(){
angular
.module("profileApp")
.controller("HeaderController" , HeaderController);
function HeaderController($scope, $location, $anchorScroll){
$scope.scrollTo = function(id) {
console.log("Scroll To " + i... |
import React from 'react'
import CourseForm from '../../components/course/CourseForm'
import TextInput from '../../components/_common/TextInput'
describe('Component: Course Form', function () {
const props = {
course: { id:'',authorId:'',category:'',length:'',title:'test'},
allAuthors:[],
onChange:()=>{}... |
global.APP_BASE = __dirname + '/app/';
global.BASE_DIR = __dirname + '/';
global.CONTROLLER = global.APP_BASE + 'controller/';
global.ROUTER = global.APP_BASE + 'routers/'; |
var hash_8c =
[
[ "SOME_PRIME", "hash_8c.html#a50f000039b5766ad8ff2166e1dcb4ec2", null ],
[ "gen_string_hash", "hash_8c.html#a145bffd967cf163cb6f48dd0961faa28", null ],
[ "cmp_string_key", "hash_8c.html#af725d05cd3ceef42e227b5ad563ba0eb", null ],
[ "gen_case_string_hash", "hash_8c.html#a06edd29ca46927cf... |
import React from 'react';
import {Portal} from "../../layouts/portal/portal";
import {Backdrop, CtxIcon, CtxNavbar} from "./styles";
import {Link} from "react-router-dom";
import {withAnimation} from "../../hoc/with-animation";
function BaseContext({ title, onClose, children, visibility }) {
return (
<Portal>... |
import React from 'react'
import { Image } from 'react-bootstrap'
import { Typography } from '@material-ui/core'
import CloseIcon from '@material-ui/icons/Close';
import { Row } from "react-bootstrap"
import { makeStyles } from '@material-ui/core/styles';
import Popover from '@material-ui/core/Popover';
//import Typogr... |
import Ember from 'ember';
import ENV from '../config/environment';
/* global FB */
export default Ember.Controller.extend({
actions: {
logout: function() {
this.get('session').invalidate();
},
loginFacebook: function () {
var that = this;
FB.login(functi... |
import Storage from '../utils/storage';
const storage = new Storage();
const signout = () => {
storage.delete('token');
};
export default signout;
|
import { makeDataLoaders as makeLiftDataLoaders } from './Lift';
import { makeDataLoaders as makeResortDataLoaders } from './Resort';
export default (db) => Object.assign({},
makeLiftDataLoaders(db),
makeResortDataLoaders(db),
);
|
import react, {useContext} from "react";
import {useHistory} from 'react-router-dom';
import Container from "@material-ui/core/Container";
import {makeStyles} from "@material-ui/core/styles";
import ClassRoundedIcon from '@material-ui/icons/ClassRounded';
import Button from '@material-ui/core/Button';
import Avatar fro... |
$(document).ready(function(){
$(document).on("click", "#ship_shop_add", function() {
var ship_shop_id = $('#ship_shop_id').val();
if(ship_shop_id == '')
{
$("#ship_shop_id").focus();
showMsgPop("Vui lòng chọn Shop!");
return false;
}
else{
$("#message_pop_show").html('');
}
$.... |
import React, { useEffect } from "react";
import { Link, withRouter } from "react-router-dom";
import { withFormik, Form, Field, ErrorMessage, FieldArray } from "formik";
import * as yup from "yup";
const CreateQuiz = ({
values,
touched,
errors,
setFieldValue,
setShowCreateEditModal,
}) => {
return (
... |
/**
* create by chuchur 2017-02-02 11:42:23
* anthor:chuchur / chuchur@qq.com
*/
var s = {
'改版2016pc头部弹出商品': 'kuyu/pc/headFloatList', // ok
'新活动热区': 'kuyu/pc/hotArea', //
'wap水平广告': 'tclWapLevel', // ok
'wap大图广告': 'tclWapBigAd', //
'PC端左侧推荐商品': 'pcLift', // ok
'平台分类树': 'plateCategoryTree', //
'大... |
import React, { Component } from 'react'
import TodoContent from './TodoContent'
import {Provider} from '../context'
// 定义一条数据 来渲染子组件
// 数据最好写在construct里
// props接收父组件的状态
// 点击回车时 自动增加一条数据并渲染视图
// 当todo.length为0 时 渲染其他dom
// 判断isFinish的值 为false放在上面 true放在下面
class TodoList extends Component {
constru... |
var app = getApp();
var api = require("../api.js");
Page({
data: {
id: null,
step: 0,
requestFlag: false
},
drawLoading: function drawLoading() {
var that = this;
var steps = this.data.step;
var speed = 100;
var type = this.data.type;
if (ste... |
import React from 'react';
import { Platform, StatusBar } from 'react-native';
import { AppLoading, Font, Icon, DangerZone } from 'expo';
import { Provider } from 'react-redux';
import DropdownAlert from 'react-native-dropdownalert';
import firebase from 'firebase';
import AppNavigator from './navigation/AppNavigator';... |
// @flow
import zlib from 'zlib'
import { VectorTile } from './'
export default function parseTile (data: Buffer) {
const tile = { features: [] }
const vectorTile = new VectorTile(zlib.gunzipSync(data))
for (const layer in vectorTile.layers) {
const tileLayer = vectorTile.layers[layer]
for (let i = 0; ... |
import PropTypes from 'prop-types'
import { css } from '@emotion/core'
import { alignments } from '../../config'
// eslint-disable-next-line import/prefer-default-export
export const aligned = {
styles: ({ textAlign }) => css`
text-align: ${textAlign};
`,
propTypes: () => ({
textAlign: PropTypes.oneOf(a... |
function solve(arr) {
let sum = arr.reduce((a, b) => a += b);
let min = Math.min(...arr);
let max = Math.max(...arr);
let product = arr.reduce((a,b) => a *= b);
let joined = arr.join('');
console.log(`Sum = ${sum}`);
console.log(`Min = ${min}`);
console.log(`Max = ${max}`);
console.... |
import eventEmitter from '../../helpers/eventEmitter';
export default (sequelize, DataTypes) => {
const likeDislikes = sequelize.define('likeDislikes', {
userId: DataTypes.INTEGER,
slug: {
type: DataTypes.STRING
},
like: DataTypes.BOOLEAN,
dislike: DataTypes.BOOLEAN
}, {
hooks: {
... |
(function() {
'use strict';
describe('SearchController Test', function() {
var toTest;
beforeEach(module('template'));
beforeEach(inject(function(_$controller_) {
toTest = _$controller_('SearchController')
}));
it('should return false', function() {
expect(toTest.searchInitiate... |
export default {
appname: 'platzimusic',
apiKey: '41041fa83f6d98b67236bd213f41b77d',
secret: '2f5a376d54a9f09e5bcc21bcff8fef2f',
registeredTo: 'cyberman_'
}
|
import {describe, it} from 'mocha';
import {expect} from 'chai';
import _ from 'lodash';
import {
GraphQLObjectType,
GraphQLSchema,
GraphQLString,
graphql
} from 'graphql';
import {
getFieldsFromAst,
getFieldsFromInfo
} from '../';
describe('Fields', () => {
describe('getFieldsFromAst', () => {
it('... |
import {StyleSheet} from 'react-native';
export default StyleSheet.create({
listItem: {
flexDirection: 'row',
height: 150,
margin: 15,
backgroundColor: 'white',
elevation: 2
},
listItemImg: {
height: '100%',
width: '30%'
},
listItemBody: {
flexDirection: 'column',
padding:... |
import React from 'react';
/** Wizard class
* responsibilities:
* 1. keep track of selected tab - internal variable, default comes form props
* 2. provide navigation controls between the tabs, respective to tab states
* tab responsibilities:
* 1. have a 'title' to be presented in the navigation
* 2. have a 'stat... |
module.exports = {
disabled: false, // 可省略
master: {
user: process.env.XXT_MONGO_USERNAME,
password: process.env.XXT_MONGO_PASSWORD,
host: 'mongodb',
port: 27017,
},
}
|
let finObj = {};
function insertItems(key){
let obj = finObj;
for(i in obj){
if(obj[i]){
let items = obj[i].items;
for(let i = 0;i<items.length;i++){
let itemsLength = items[i].length;
if(itemsLength !== 3){
let lastItemArr = items[i][itemsL... |
export const REGISTER_USER = 'REGISTER_USER';
export const LOG_IN = 'LOG_IN';
|
import React, { Component } from "react";
import "./Characteristics.css";
export default class Characteristics extends Component {
constructor(props) {
super(props);
}
render() {
return (
<div className="characteristic">
<img src={this.props.img}/>
<h2>{this.props.title}</h2>
<p>{th... |
OC.L10N.register(
"core",
{
"Please select a file." : "Seleccionatz un fichièr.",
"File is too big" : "Fichièr tròp voluminós",
"Invalid file provided" : "Fichièr invalid",
"No image or file provided" : "Cap de fichièr pas provesit",
"Unknown filetype" : "Tipe de fichièr desconegut",
"In... |
import { StyleSheet, Dimensions, Platform } from 'react-native';
const window = Dimensions.get('window');
import Constants from 'expo-constants';
import colors from '../../assets/colors';
import theme from '../../assets/theme';
export default styles = StyleSheet.create({
container: {
flex: 1,
},
navBar: {
... |
import React from 'react';
export default function PageFooter() {
return (
<div id="footer">
<ul className="copyright">
<li>© Michael Codner</li>
<li>
Source: <a target="blank" rel="noopener noreferrer" href="https://github.com/mhcodner/mhcodner.github.io">GitHub</a>
... |
var currentNode;
function showGameForm (element) {
currentNode = element;
var parentNode = element.parentNode;
var grampNode = parentNode.parentNode;
var date = grampNode.children[0].innerHTML;
var time = grampNode.children[1].innerHTML;
var team1 = grampNode.children[2].innerHTML;
var team2 =grampNode.childr... |
/**
* Invoice
*/
import React, { Component } from 'react';
import Button from '@material-ui/core/Button';
// page title bar
import PageTitleBar from 'Components/PageTitleBar/PageTitleBar';
// intl messages
import IntlMessages from 'Util/IntlMessages';
// rct card
import { RctCard } from 'Components/RctCard/index';... |
export const ACTION_CLOSE_SIDEBAR = 'ACTION_CLOSE_SIDEBAR';
export const ACTION_OPEN_SIDEBAR = 'ACTION_OPEN_SIDEBAR';
export const ACTION_TOGGLE_SIDEBAR = 'ACTION_TOGGLE_SIDEBAR';
export const closeSidebar = () => dispatch => dispatch({
type: ACTION_CLOSE_SIDEBAR,
});
export const openSidebar = () => dispatch => di... |
const AWS = require('aws-sdk');
const { bucketName } = require('../helpers/constants');
AWS.config.update({
accessKeyId: '[accessKey]',
secretAccessKey: '[secretKey]'
});
module.exports = {
sign: (req, res) => {
const S3 = new AWS.S3();
const params = {
Bucket: bucketName,
... |
function solve(array)
{
let field=[[false, false, false],
[false, false, false],
[false, false, false]];
function hasPlacesLeft()
{
for (let i = 0; i < field.length; i++) {
for (let j = 0; j < field.length; j++) {
... |
export function getItems(data) {
return {
type: 'GET_ITEMS',
payload: data
}
}
export const deleteItem = (_id) => {
return {
type: "DELETE_ITEM",
payload: _id
}
}
export const getTotalPrice = (price) => {
return {
type: "GET_TOTAL_PRICE",
payload: pr... |
// Write a method to return all subsets of a set
// Recursion
const subSetHelper = (set, subsets, numElements) => {
if (numElements === 0) {
subsets.push(new Set());
return;
}
else if (subsets.length === 0) {
let element = Array.from(set)[numElements - 1];
let newSet = new ... |
'use strict';
ApplicationConfiguration.registerModule('modals');
|
JournalApp.Views.PostForm = Backbone.View.extend({
template: JST["posts/post_form"],
events: {
"click button.post-form-submit": "submitForm"
},
render: function() {
var renderedContent = this.template({
post: this.model
});
this.$el.html(renderedContent);
return this;
},
submi... |
const path = require('path')
const _ = require('lodash')
const Service = require('egg').Service
const excelToJson = require('convert-excel-to-json')
const recipeParse = require('../util/recipe').parse
const regNameSpecs = /(\S+)((\S+))/
class OrderService extends Service {
async isExit (date) {
const { ctx } = ... |
var questions = [
"Explain one of the pillars of OPP",
"Explain a left join",
"What are the 4 pillars of OOP",
"Explain a Subquery, give an example",
"Explain a SQL Join",
"What is the difference between a list and an array",
"What is the difference between a list and a dictionary/map... |
var http = require('http')
var fs = require('fs')
http.createServer(
function(req, res){
fs.readFile('cadastro22.html',
function(err, data){
res.writeHead(200, {'Content-Type': 'text/html; charset= UTF-8'})
res.write(data)
res... |
$(document).ready(function(){
$('#page1').hide();
$('#btn1').on('click', function() {
$('#page2, #page3, #page4, #page5').hide();
$('#page1').slideToggle(1000);
});
$('#page2').hide();
$('#btn2').on('c... |
$(document).ready(function() {
var $postButton, $multipartPostButton;
OData.defaultError = function(err) {
alert("Error: " + err.message + " - " + err.response.body);
};
$postButton = $("#post").button();
$postButton.click(function() {
$.post("servlet/customers");
});
$multipartPostButton = $("#multipa... |
// Primitive test script for OData JSON CSDL
//
// TODO: switch to unit test tool - mocha and chai
// TODO: add negative test cases that expect an error
var fs = require('fs');
var util = require('util');
// files
var draft04 = JSON.parse(fs.readFileSync("json-schema-draft-04.json"));
var edm = JSON.parse(f... |
var hummus = Meteor.npmRequire('hummus');
var fs = Meteor.npmRequire('fs');
var os = Meteor.npmRequire('os');
var path = Meteor.npmRequire('path');
var mkdirp = Meteor.npmRequire("mkdirp");
createBillPDF = function(bill) {
mkdirp(path.join(process.env["PWD"], '/public/bills/', bill.cycle.name));
var outfile = path... |
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||... |
'use strict';
var React = require('react');
var ReactNative = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
ScrollView,
TouchableOpacity
} = ReactNative;
var Controllers = require('react-native-controllers');
var { Modal } = Controllers;
var badgeCounter = 1;
var SearchScreen = Rea... |
"use strict";
/*
Copyright [2014] [Diagramo]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writi... |
/*global
$, dSearch,
dSearch.instrumentNames
*/
/*jslint devel: true */
/*jshint esversion: 6 */
/*eslint-env browser*/
'use strict';
/*
* todo: parse out value labels
*
* todo: simplify the dictionarySearch by removing blanks properties.
*
* todo: API token page has a nice Event table which has three columns: Uniq... |
var trendingLineChart;
var arraydata = [];
var sdata;
var doughnutData;
var yearHE = $('#yearHE').val();
$.ajax({
type: 'get',
url: base_url + 'admin/getCountForChart',
data: { "yearHE": yearHE },
success: function(response) {
var count = response.empcount.length;
for(x = 0; x<count ; x++) {
var ... |
jQuery(document).ready (function (){
$('form').hide();
$('h3').click(function(){
$('form').toggle();
});
});
let firstName = document.querySelector('#firstName');
let lastName = document.querySelector('#lastName');
let email = document.querySelector('#clientEmail');
let phoneNumber = document.querySelector('#... |
(function () {
"use strict";
/*global mockModalInstance*/
describe("AddToDomainModalCtrl", function () {
var $q,
ctrl,
device,
$rootScope,
DomainMgmtService,
AlertsService,
getDomainsResult,
getDeviceDomainListResult,
addDomainDevicesResult;
... |
function BST(value) {
this.value = value;
this.left = null;
this.right = null;
}
module.exports = BST;
// Is the value we want to insert less than or greater than the root node
// If it is less than the root node is the left child empty. If yes insert value there. Else traverse to that node and make it the... |
Vue.directive('underline', {
bind(el, binding, vnode) {
el.style.textDecoration = "underline";
}
});
|
import React from 'react'
import { StyleSheet } from 'quantum'
const styles = StyleSheet.create({
self: {
fontSize: '20px',
color: '#000000',
marginBottom: '20px',
textAlign: 'center',
},
})
const Title = ({ children }) => (
<div className={styles()}>
{children}
</div>
)
export default Ti... |
import React, { useState } from "react";
import axios from "axios";
const HomeScreen = () => {
const [name, setName] = useState("");
const [age, setAge] = useState(0);
const [country, setCountry] = useState("");
const [position, setPosition] = useState("");
const [wage, setWage] = useState("0");
const [em... |
//Word bank
var bandNames = ["Ingested", "Decapitated", "Archspire", "Behemoth", "Acrania", "Necrophagist"]
//Get word from word bank
var guess = bandNames[Math.floor(Math.random() * bandNames.length)];
//Show input box with dashes & split letters
var displayGuess = [];
for (i = 0; i < guess.length; i++) {
dis... |
import {hashHistory} from 'react-router';
import axios from 'axios';
import URLSelectedarchParams from 'url-search-params';
import {actionType} from '../reducers/modules';
import {API_URL} from '../../config';
export const fetchAvailableModules = () => (dispatch) => {
dispatch({type: actionType.FETCH_AV_MODULES_... |
var tags = [
'hello',
'world',
'blah'
];
module.exports = tags;
|
import { Add_TODO, COMPLET_TODO, COMPLET_ALL_TODO, CLEAR_TODO, DELETE_TODO } from '../types'
const initState = [
{
id: 0,
value: '',
checked: false
}
]
export function add(state = initState, action){
switch (action.type){
case Add_TODO:
return [
... |
const util = require("util");
const mysql = require("mysql");
const connection = mysql.createConnection({
host: "localhost",
user: "root",
password: "Apollo1215!",
database: "company_DB"
});
connection.connect();
//Setting up a connection.query to use promises instead of callbacks
//This allows us to ... |
var Player = function(username, socket) {
this.socket = socket;
this.username = username;
this.color = undefined;
};
module.exports = Player;
|
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { Link, useLocation } from 'react-router-dom';
import fire from '../../firebase';
import RegisterForm from '../../components/RegisterForm/RegisterForm';
import { LOGIN_ROUTE } from '../../routes';
const Signup = ... |
'use strict'
const express = require('express');
const mongoose = require('mongoose');
const xml2js = require('xml2js');
const config = require('../../config');
const weixin = require('../controllers/weixin');
let router = express.Router();
router
.post('/payresult', weixin.wxPayCallback);
module.exports = route... |
bridge.service('healthDataService', ['$http', '$rootScope', '$q', function($http, $rootScope, $q) {
var service = {
getAll: function(trackerId) {
var url = '/api/v1/healthdata/'+trackerId;
return $http.get(url);
},
getByDateRange: function(trackerId, startDate, endDa... |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import './personal.scss';
import Input from '@material-ui/core/Input';
import Button from '@material-ui/core/Button';
import SaveIcon from '@material-ui/icons/Save';
export const TextFieldExampleSimple = (props) => (
<div>
<... |
import scores from "./scores.js";
function startScreen() {
document.dispatchEvent(
new CustomEvent("changeState", { detail: "start screen" })
);
}
const btnBack = document.querySelector("#btn_back");
const congratulationsMessage = document.querySelector(".WinRound");
const winPage = {
start() {
//docume... |
import axios from 'axios'
import { qs } from 'misc/helpers'
const http = axios.create({
baseURL: 'https://api.github.com/'
})
export const SearchUser = (term, page) => {
return http.get(`search/users?${qs({q: term, page})}`)
}
|
// pupu sits to eat
pupueat3: {
time: 1800,
next: 'pupueat5',
init: function(t){
timeline.pupurun.init(t,true,120);
var
paths = frames.bunny_loopeater,
elem, anim, i,
path0 = transSVGPath( paths[0][0], [ -120, -20 ], 1.33 ),
path1 = transSVGPath(... |
var lib_8c =
[
[ "pop_get_field", "lib_8c.html#a02fea670debdd85f5fc42b27b50b7344", null ],
[ "pop_parse_path", "lib_8c.html#a6838234c95ab9171c2edcf35aa8e6526", null ],
[ "pop_error", "lib_8c.html#a93baf2f3aa10dc68eddfc17191172666", null ],
[ "fetch_capa", "lib_8c.html#a408a66a06e087854500a1de8fbf2d3c8",... |
class Users{
constructor(){
this.users=[];
this.addUser=(id,name,room)=>{
const user= {id, name, room};
this.users.push(user);
return user;
}
this.removeUser=(id)=>{
const user= this.users.filter((user)=> user.id === id)[0];
if(user){
... |
var TableTenantsController = function(tenants, $scope, $location) {
$scope.tenants = tenants;
$scope.editTenant = function(id) {
$location.path($location.path() + id);
};
angular.element(document).ready(function () {
$('#tenantsTable').dataTable({
"aLengthMenu": [[25, 50, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.