text stringlengths 7 3.69M |
|---|
import {
createMachine,
assign,
send,
spawn
} from 'xstate';
import { mapMachine } from './map.machine';
import { logMachine } from './log.machine';
const context = {
logMachine: undefined,
mapMachine: undefined,
userPosition: {
lat: null,
lng: null,
},
}
// Tell map.machine and log.machine each time ... |
function ListNode(val) {
this.val = val;
this.next = null;
}
var addTwoNumbers = function(l1, l2) {
let head, node, isCarry;
while (l1 || l2) {
let sum, next;
if (l1 && l2) {
sum = l1.val + l2.val;
} else if (l1) {
sum = l1.val;
} else {
... |
'use strict';
var ifbCommonServices = angular.module("ifbCommonServices", []);
var ifbControllers = angular.module("ifbControllers", []);
// Declare app level module which depends on views, and components
angular.module('companyFace', ['ui.router', 'angularModalService', 'cgBusy', 'ifbCommonServices', 'ifbControllers... |
import React, {Component} from 'react';
import { StyleSheet, Text, View, ToolbarAndroid, Image, ScrollView, TextInput , TouchableOpacity } from 'react-native';
class Login extends Component {
render(){
return (
<View style={styles.container}>
<ToolbarAndroid
style={styles.toolbar}
t... |
import React, { useState, useEffect } from 'react';
import './App.css';
import './grid.css';
function App() {
return (
<div>
<DrumMachine />
</div>
);
}
const DrumMachine = () => {
const keyArray1 = [
{ "Q": "Piano Chord 1", "src": "https://s3.amazonaws.com/freecodecamp/drums/Chord_1.mp3" },
... |
import React from 'react';
const Navigation = () => (
<div className="navigation">
<input type="checkbox" className="navigation__checkbox" id="navi-toggle" />
<label for="navi-toggle" className="navigation__button">
<span className="navigation__icon"> </span>
</label>
<div className="navi... |
#pragma strict
function StartMenu(){
Application.LoadLevel("Keys");
} |
///TODO: Review
/**
* @param {number[]} nums
* @param {number} k
* @return {boolean}
*/
var checkSubarraySum = function(nums, k) {
for(let i = 0; i<nums.length; i++) {
var sum = nums[i];
for(let j = i+1; j < nums.length; j++) {
sum += nums[j];
if(sum === k) return true;
if(k !== 0 && sum... |
var Stack = function() {
this.top = null
}
Stack.createNode = function(data) {
data = (typeof data === 'undefined') ? null : data
return { data: data, next: null }
}
Stack.prototype.push = function(data) {
var node = Stack.createNode(data)
node.next = this.top
this.top = node
}
Stack.prototype.pop = func... |
const managesModel = require("./manages.model");
module.exports = {
create:(data)=>{
return managesModel.create(data);
},
getManageByMobile:(mob)=>{
return managesModel.find();
},
getManageByWebsite:(web,mob,key)=>{
return managesModel.find({mWebsite:web,mMobile:mob,mKey:key... |
import React, { useContext } from "react";
import {
Modal,
ModalHeader,
ModalBody,
ModalFooter,
Button,
Input,
Form,
Label,
} from "reactstrap";
import { StateContext } from "./contexts/StateContext";
function HeaderModal() {
const { wordsPerLight, setWordsPerLight, modal, setModal } = useContext(
... |
var app = angular.module('predix_redis_login',[]);
app.service('loginFormSubmit',function($http){
this.loginHandler = function(serv_instance_name,password)
{
return $http({
method : 'POST',
url : '/login',
data: {'serv_instance_name':serv_instance_name,'p... |
/*
* @lc app=leetcode.cn id=680 lang=javascript
*
* [680] 验证回文串 II
*/
// @lc code=start
/**
* @param {string} s
* @return {boolean}
*/
var validPalindrome = function (s) {
let left = 0,
right = s.length - 1;
const isPalindrome = (s, l, r) => {
while (l < r) {
if (s[l++] !== s[r--]) {
... |
'use strict';
var _ = require('lodash');
var knex = require('../../connection.js');
var mocks = require('./fixtures/changesets.js');
var XML = require('../../services/xml.js');
var log = require('../../services/log.js');
var Node = require('./helpers/create-node.js');
var Way = require('./helpers/create-way.js');
var ... |
import InvoiceTmp from './base';
export default InvoiceTmp; |
const user = require('../models/user');
const loginRoute = require('./loginRoute');
const signinRoute= require('./signupRoute');
const chatRoute= require('./chatRoute');
const middleware = require("../middlewares/middlewres");
const multer = require('multer')
const upload = multer({ dest: './public/uploads/' })
const... |
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('submit').addEventListener('click', (e) => {
e.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
$.post(`${window.location.pathname}/u... |
const { BigNumber } = require("bignumber.js");
const config = require(`./${
process.env.BOT_ENV || "prod"
}-network-config.json`);
/**
* Returns the minimum expected value by an initiator after deducting reward for swap responder
*
* @param swapValue the actual swap value initiated by the user
* @param rewardInB... |
const assert = require("assert");
function g() {
let x = 1;
return x;
throw 'dead code';
}
function f() {
let c = 1;
let a = g();
let b = 2;
return a + b;
}
let x = f();
assert.equal(x, 3);
|
import nock from 'nock';
import chai, { expect } from 'chai';
import spies from 'chai-spies'
chai.use(spies);
import APIGateway from '../src/APIGateway';
nock.disableNetConnect();
describe('APIGateway', () => {
var apiGateway = new APIGateway;
describe('#requestTo', () => {
context('when response is succes... |
/**
* Created by eriy on 27.02.15.
*/
var TABLES = require( '../constants/tables' );
module.exports = function ( PostGre, ParentModel ) {
return ParentModel.extend( {
tableName: TABLES.USERS
});
}; |
'use strict';
angular.module('myApp', ['photoLibrary'])
.config(['$routeProvider', '$locationProvider', function($routeProvider, $location) {
$location.html5Mode(true).hashPrefix('!');
$routeProvider.
when('/home', {
templateUrl: 'partials/home.html',
controller: 'HomeController'
})
.otherwise({redirectTo: ... |
export const titlebarHeight = (state, height) => {
state.titlebarHeight = height
}
export const toc = (state, toc) => {
state.toc.splice(0, state.toc.length, ...toc)
}
|
var pageSize = 25;
/*******************群組管理主頁面****************************/
//群組管理Model
Ext.define('gigade.PromoAmountGiftModel', {
extend: 'Ext.data.Model',
fields: [
{ name: "id", type: "int" },
{ name: "event_ids", type: "string" },
{ name: "product_id", type: "int" },
{ name: "category_id",... |
import * as constants from '../constants';
export const fetchAllNewSeller = () => ({
type: constants.API,
payload: {
method: 'GET',
url: '/admin/new-seller/get-new-seller',
success: (response) => (getAllNewSeller(response))
}
});
export const fetchNewSellerById = (id, onSuccess, on... |
const jwt = require("jsonwebtoken");
const bcrypt = require("bcryptjs");
const qrcode = require("qrcode");
const db = require("../_helpers/db");
const Role = require("../_helpers/role");
const ErrorHelper = require("../_helpers/error-helper");
const mfa = require("../_helpers/mfa");
const { User } = db;
const refreshT... |
import {
CREATE_POST_REQUEST,
CREATE_POST_SUCCESS,
CREATE_POST_FAILURE,
} from "./postActionTypes";
// create post
export const createPostRequest = () => {
return {
type: CREATE_POST_REQUEST,
};
};
export const createPostSuccess = (data) => {
return {
type: CREATE_POST_SUCCESS,
payload: data,... |
import React, {useState, useEffect} from 'react';
import axios from 'axios'
const Home = () => {
const [daftarBuku, setdaftarBuku] = useState(null)
useEffect( () => {
if (daftarBuku === null){
axios.get(`http://backendexample.sanbercloud.com/api/books`)
.then(res => {
... |
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { dangKyNguoiDungAction } from '../../Redux/Actions/QuanLyNguoiDungAction';
import { NavLink } from 'react-router-dom'
class SignUpPage extends Component {
constructor(props) {
super(props);
this.state = {
... |
import React, { Component } from 'react';
import classnames from 'classnames';
import PropTypes from 'prop-types';
class Like extends Component {
state = {
isActive: false
}
componentDidMount() {
const userLike = this.props.userLike;
this.setState({isActive: (userLike ? true: false... |
/**
*
* @author Anass Ferrak aka " TheLordA " <ferrak.anass@gmail.com>
* GitHub repo: https://github.com/TheLordA/Instagram-Clone
*
*/
import React from "react";
import AuthentificationState from "./contexts/auth/Auth.state";
import Routing from "./routes/Routing";
import "./App.css";
const App = () => {
return... |
Ext.define('Accounts.view.main.MainModel', {
extend: 'Ext.app.ViewModel',
alias: 'viewmodel.main',
requires: [
'Accounts.model.Customer',
'Accounts.model.Item',
'Accounts.model.SalePurchase',
'Accounts.model.Payment'
],
data: {
name: 'Accounts'
},
stores: {
customerStor... |
module.exports = {
generateBitmap: function(bits) {
var bitmap = new Array(bits);
for (i=0; i<bitmap.length; i++) {
bitmap[i] = new Array(bits);
}
for (i=0; i<bitmap.length; i++) {
for (j=0; j<bitmap[i].length; j++) {
if (Math.random() > 0.5) {
bitmap[i][j] = 0;
} else {
bitmap[i][j] = ... |
'use strict';
/**
* @ngdoc function
* @name ossuClientApp.controller:MainmodalcontrollerCtrl
* @description
* # MainmodalcontrollerCtrl
* Controller of the ossuClientApp
*/
angular.module('ossuClientApp')
.controller('MainmodalcontrollerCtrl', function ($scope, $uibModalInstance) {
$scope.ok = function ()... |
const morgan = require('morgan')
module.exports = (options) => {
return morgan('combined');
} |
'use strict';
angular.module('FEF-Angular-UI.Filter', [])
.factory('Filter', ['$filter', 'Utils', function($filter, Utils) {
return {
filter: function(subject, filter) {
var filters = [],
categories = [];
// format the filter object in to an array of 'categories' for each filter 'category'
for ... |
import React from 'react';
import PropTypes from 'prop-types';
import { validate } from 'isemail';
import FormField from './FormField';
const EmailField = props => {
// prevent passing type and validator props from this component to the rendered form field component
const { type, validator, ...restProps... |
export const setCurrentUserPolls = (polls) => {
return {
type: "SET_CURRENT_USER_POLLS",
payload: polls,
};
};
export const addCurrentUserPoll = (poll) => {
return {
type: "ADD_CURRENT_USER_POLL",
payload: poll,
};
};
export const setVotedOption = (votedOption) => {
return {
type: "SET_VOTED_OPTION",
... |
import React from 'react';
import classNames from "classnames";
import styles from "../styles/BrowseRecipes.module.scss";
import RecipeCard from "../../client/components/recipes/RecipeCard";
import {sampleRecipes} from "../../client/components/tour/sampleData";
export default function Index() {
const browseRecipes... |
import PropTypes from "prop-types";
import { PureComponent } from "react";
import Card from "react-bootstrap/Card";
export default class PanelWithTitle extends PureComponent {
static propTypes = {
title: PropTypes.string.isRequired,
panelBody: PropTypes.bool.isRequired,
children: PropTypes.node.isRequire... |
"use strict"
// async function statement
async function foo() {
return await x
}
// async function expression
var bar = async function() {
await x
}
// async gen function statement
async function* foo() {
yield await x
}
// async gen function expression
var bar = async function* () {
await (yield x)
}
// a... |
import React from 'react';
import {createStackNavigator} from '@react-navigation/stack';
import {NavigationContainer} from '@react-navigation/native';
import {DefaultTheme, DarkTheme} from '@react-navigation/native';
//! Navigator
import Permissions from 'features/permissions/Permissions';
import WeatherView from 'fea... |
/*
* jQuery Mobile Framework : "textinput" plugin for text inputs, textareas
* Copyright (c) jQuery Project
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function( $, undefined ) {
$.widget( "mobile.textinput", $.mobile.widget, {
options: {
theme: null,
initSelector: "i... |
'use strict';
let logger = require('tracer').colorConsole();
let express = require('express');
let router = express.Router();
router.get('/', (req, res) => {
res.render('categorys', {layout:'layout', title: 'Danh mục tin - Trạng Nguyên', categorys})
});
module.exports = router; |
/* global require, describe, it */
'use strict';
// MODULES //
var // Expectation library:
chai = require( 'chai' ),
// Module to be tested:
dot = require( './../lib' );
// VARIABLES //
var expect = chai.expect,
assert = chai.assert;
// TESTS //
describe( 'compute-dot', function tests() {
it( 'should exp... |
var continueButton = document.getElementById('continue');
var intro = document.getElementById('intro');
var hiddenDiv = document.getElementById('hiddenDiv1');
document.getElementById('continue').addEventListener('click', function() {
document.getElementById('hiddenDiv1').style.display = 'block';
document.getElemen... |
const APIKEY = 4 b87c57531f0db1d73507427b3dbb26f; |
angular.module('WhatToWear', [])
.factory('Weather', function($http) {
var getWeather = function(zipcode) {
return $http({
method: 'GET',
url:'http://api.openweathermap.org/data/2.5/weather?zip=' + zipcode + ',us&units=imperial&APPID=5c680e5d8c8f29befb9f1c239dfae90b'
}).success(function (da... |
const { Review } = require('../../models/review')
module.exports = (req, res) => {
const review = new Review({
name: req.body.name,
restaurantId: req.body.restaurantId,
stars: req.body.stars,
comment: req.body.comment
})
review.save().then((result) => {
res.send(result)
}, (error) => {
res.status(400)... |
var express = require('express');
var router = express.Router();
var usersController = require('../controllers/users');
/* GET users listing. */
router.get('/', function(req, res, next) {
res.send('respond with a resource');
});
router.post('/login', async (req, res) => {
let email = req.body.email;
let passwor... |
#!/usr/bin/env node
const puppeteer = require('puppeteer');
const Koa = require('koa');
const cors = require('@koa/cors');
const info = (...m) => console.log(...m);
const env = (k, d) => process.env.PRODUCTION
? process.env[k] || (console.error(`ERROR: missing env key '${k}'`), process.exit(1))
: d;
const reporte... |
../../../../../../shared/src/App/MainHeader/Niche/index.js |
const collections = document.querySelectorAll('ul'),
elems = document.querySelectorAll('li'),
blocks = document.querySelectorAll('.book'),
adv = document.querySelector('.adv'),
alink =document.querySelectorAll('a'),
bg = document.getElementsByTagName('body');
console.log(collections);
console.log(el... |
import React from "react";
export const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
},
componentWillMount: function() {... |
var express = require('express');
var router = express.Router();
var appRoot = require('app-root-path');
var commentsModule = require(appRoot + "/javascripts/comments")
/* GET home page. */
router.post('/', function(req, res, next) {
console.log("in comme");
commentsModule.createComment(req.session.username, req.... |
const store = {
getByKey(key) {
try {
const data = localStorage.getItem(key);
if (data === null) {
return null;
}
return JSON.parse(data);
} catch (e) {
return Error(e);
}
},
setItem(key, data) {
try {
const serializedData = JSON.stringify(data);
... |
document.write(
'<div class="sign-box">'
+ ' <div class="sign-form-header">'
+ ' <span class="active">登录</span>'
+ ' <!-- <span class="">注册</span> -->'
+ ' <i id="close-btn" class="close-btn">×</i>'
+ ' </div>'
+ ' <div class="sign-form-body">'
+ ' <form action="#" class="login-form">'
+ ' <input type=... |
import fs from "fs";
import config from "../../../app/server/config/database.json";
const dbImpl = config.db;
/**********************************************************************************
* It is up to you to make sure you implement all functions in your repositories. *
* A sample comment is included in booksh... |
import Router from 'koa-router';
import { getOpportunity, addOpportunity, getOpportunityById } from '../service/opportunity';
async function getList(ctx) {
const result = await getOpportunity();
ctx.body = {
status: '1',
data: result
}
}
async function submit(ctx) {
const id = ctx.params.id;
console.... |
// 更新的模态框
import React, { Component } from 'react';
import {
View, Text, StyleSheet, Modal, TouchableOpacity, Image, Dimensions, Animated, Easing, Platform, Linking, DeviceEventEmitter, Alert,
} from 'react-native';
import { connect } from 'rn-dva';
import Progress from './UpdateProgress';
import CommonStyles from '... |
var express = require("express");
var app = express();
var path = __dirname + "/dist/recipe-book/";
app.use(express.static(path));
var server = app.listen(process.env.PORT || 8080, function () {
var port = server.address().port;
console.log("App now running on port", port);
});
app.get('*', function(req, re... |
import React from "react";
import {
dispatcher as RouteDispatcher,
RouteTo
} from "./RouteDispatcher";
export default class Link extends React.Component {
constructor() {
super();
this.id = this.id = "k" + Math.floor(Math.random() * 999999) + "-" + Math.floor(Math.random() * 999999);
}
componentDi... |
function createLegend(legendDomain, colorScale) {
// 1. create a group to hold the legend
const legend = svg.append("g")
.attr("id", "legend")
.attr("transform", "translate(" + (canvWidth - margin.right + 10) + "," + margin.top + ")")
// 2. create the legend boxes and the text label
// ... |
angular.module("estacionamento").controller("estacionamentoCtrl", function ($scope, $http){
var listarEstacionamento = function (patioId){
$http.get("http://localhost:8080/estacionamento/" + patioId).then((data, status)=>{
$scope.vagas = data.data;
console.log($scope.vagas.length... |
import {Navigation} from "react-native-navigation";
console.disableYellowBox = true;
// メイン画面
import MainScreen from "./screens/MainScreen";
// コンポーネント
// メッセージボックス
import MessageDialogBox from "./component/MessageDialogBox"; // メッセージポップアップ
console.debug("IOS START!!!!!!!!!!!!!");
Navigation.registerCompone... |
/**
* @param {number[]} nums
* @param {number} target
* @return {number}
*/
var search = function(nums, target) {
let left = 0;
let right = nums.length - 1;
let result = search2(nums, target, left, right);
return result;
};
function search2(nums, target, left, right) {
if (left > right) {
return -1;
... |
/*
* 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.
*/
$(function(){
setInterval(function() {
updataRoleStatus();
}, 1000*60);
//修改服务器
function loadVariable(fo... |
"use strict";
/* global grist, window, document, fetch */
let resolve, reject;
grist.rpc.registerImpl('github', {
getImportSource: () => new Promise((_resolve, _reject) => {
resolve = _resolve;
reject = _reject;
})
});
grist.ready();
window.onload = function() {
document.getElementById('import').addEv... |
// let name = "Emi"
// let favoriteNum = 27
// let isAlive = true;
// let address = {
// street: "123 main street",
// city: "austin",
// state: "Texas",
// zip: "78741"
// }
// let favFruits = ['Banana', 'Strawberry', 'Apple'];
// let x = 12;
// let y = 45;
// let z = x + y;
// console.log(z);
// let w = "... |
// Given an array of integers, find the one that appears an odd number of times.
// There will always be only one integer that appears an odd number of times.
// Examples
// [7] should return 7, because it occurs 1 time (which is odd).
// [0] should return 0, because it occurs 1 time (which is odd).
// [1,1,2] should... |
import React, { useState } from 'react'
import { history } from '../redux'
// import Header from './header'
// import Head from './head'
const Dummy = () => {
const [userName, setValue] = useState('')
const onChange = (e) => {
setValue(e.target.value)
}
return (
<div>
<form className="flex items... |
/*
* C.System.TileSchemaManager //TODO description
*/
'use strict';
C.System.TileSchemaManager = function () {
this.schemas = {};
var self = this;
C.Utils.Event.once('initialized', function () {
self.init();
});
};
C.System.TileSchemaManager.prototype.init = function () {
for (var ... |
/**
* Created by clicklabs on 6/12/17.
*/
'use strict';
const responseFormatter = require('Utils/responseformatter.js');
const organizationTypeSchema = require('schema/mongo/organizationtype');
const log = require('Utils/logger.js');
var config=require('../config');
const logger = log.getLogger();
module.exports... |
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
export const fetchposts = createAsyncThunk(
'fetchposts',
async (data, thunkAPI) => {
const response = await fetch('https://jsonplaceholder.typicode.com/posts/')
return await response.json()
}
)
export const todoSlicer = createS... |
//----------------------------------------------------------------------------------------------
// MENU MOBILE
//-----------------------------------------------------------------------------------------------
$.fn.menuMobile = function(options){
console.log('MENU');
var settings = $.extend({
'minWidth'... |
var variables__11_8js =
[
[ "js", "variables__11_8js.html#a36e8bb713520a15833bafb5d93f8949c", null ],
[ "searchData", "variables__11_8js.html#ad01a7523f103d6242ef9b0451861231e", null ]
]; |
spacesApp.controller(
'navigation.controller',
[
function(){
}
]
); |
angular.module('myModule', [])
.directive('myTag1', function () {
return {
restrict: 'ECAM',
template: '<div>myTag1 Template {{ user.id }} {{ user.name }}<span ng-transclude=""></span></div>',
transclude: true,
replace: true, // false。为 true 时模板内容必须包含在标签... |
import { combineReducers } from 'redux';
import articles from './articles';
import signup from './signup';
import login from './login';
import resetpassword from './resetpassword';
import rating from './rating';
import articlelist from './articlesList';
import profileReducer from './profile';
import like from './like';... |
import React from 'react';
import {
Title,
TextBlock,
InvasivePotential,
Resources,
Resource,
Summary,
SexualReproduction,
AsexualReproduction,
EcologicalNiche,
PopulationDensity,
EnvironmentImpact,
ManagementMethod,
ManagementApplication,
OriginalArea,
SecondaryArea,
Introduction,
Breeding,
CaseImage... |
function prixTtc(prixHorsTaxes,nombreArticle,tva){
let ttc = nombreArticle * prixHorsTaxes * (1 + tva);
console.log("Votre Prix TTC est de " + ttc + " €");
}
prixTtc(15,1,0.20);
prixTtc(30,1,0.20);
prixTtc(25,1,0.20);
prixTtc(14,1,0.20);
prixTtc(12,1,0.20);
prixTtc(45,1,0.20);
|
var uid_usuario = '';
var liquidacion_id = 0;
var array_index = 0;
var liquidaciones = new Array();
var ceco_validacion=true;
var orden_validacion=true;
var validacion_rechazo=0;
var array = new Array();
var gastos_origen = new Array();
jQuery( document ).ready( function( $ )
{
$('#loader').show();
window.tabla_regi... |
import React, { useEffect, useState } from 'react';
import styles from './_login.module.scss';
import banner from './../../static/images/Сгруппировать 647.jpg';
import Button from 'components/UI/Button';
import { useDispatch, useSelector } from 'react-redux';
import { useHistory } from 'react-router-dom';
import ... |
// Global variables
var gl;
var program;
var loopID, isPaused;
var then, deltaTime;
var KEY_LEFT = 37;
var KEY_RIGHT = 39;
var KEY_UP = 38;
var KEY_DOWN = 40;
var KEY_A = 65;
var KEY_D = 68;
var KEY_F = 70;
var KEY_G = 71;
var KEY_H = 72;
var KEY_P = 80;
var KEY_Q = 81;
var KEY_S ... |
/* 🤖 this file was generated by svg-to-ts*/
export const EOSIconsTextRotationAngledown = {
name: 'text_rotation_angledown',
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.4 4.91l-1.06-1.06L7.2 8.27l1.48 1.48 2.19-.92 3.54 3.54-.92 2.19 1.48 1.48L19.4 4.91zm-6.81 3.1l4.87-2.23-2... |
import React, { Component } from 'react';
import { Link } from "react-router-dom";
import { Formik, Form, Field } from 'formik';
import {userService} from '../services/user.service';
import * as Yup from 'yup';
//Form validation
const SignupSchema = Yup.object().shape({
password: Yup.string()
.required('Require... |
import React, { Component } from 'react';
import ResetButton from '../helpers/reset';
import distanceCalculator from '../helpers/distanceCalculator';
import { ToastContainer, toast } from 'react-toastify';
import "react-toastify/dist/ReactToastify.css";
export default class TripTracker extends Component {
construc... |
const config = require('../../src/config');
const pactum = require('../../src/index');
const { addInteractionHandler, addWaitHandler } = pactum.handler;
const { expect } = require('chai');
describe('Non CRUD Requests - Numbered Waits', () => {
before(() => {
addInteractionHandler('get bg', () => {
return ... |
import PositionTool from "./positionTool";
import * as Registry from "../../core/registry";
import Feature from "../../core/feature";
import CustomComponent from "../../core/customComponent";
import Params from "../../core/params";
import Component from "../../core/component";
export default class CustomComponentPosit... |
var dirfilter = require ("./dirfilter.js");
var file_path = process.argv[2];
var extension = process.argv[3];
var callback = function(err, data) {
i = 0;
if (err) throw err;
while (i < data.length) {
console.log(data[i]);
i++;
};
};
dirfilter(file_path, extension, callback); |
$(document).ready(function(){
// VARIABLES
var alphabet = "abcdefghijklmnopqrstuvwxyz".split("");
var computerChoice = alphabet[Math.floor(Math.random() * alphabet.length)];
var winCounter = 0;
var loseCounter = 0;
var guessCounter = 9;
var guessedLetters = [];
// FUNCTIONS
function addWin(){
winCounter++;
var... |
module.exports = {
async show(req, res) {
res.setHeader('Content-Type', 'application/json')
return res.status(200).send(true)
},
async delete(req, res) {
return res.status(204).send("delete")
}
} |
// configuring our routes
// =============================================================================
app.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
//route to show the main page
//base page
.state('base',{
url: '/base',
templateUrl: 'templates/base.h... |
import { publicApi } from '../api/api';
export default {
fetchToken(userId, code) {
return publicApi
.get(`/api/token/${userId}/${code}`);
}
} |
const chai = require('chai');
const chaiHttp = require('chai-http');
const mongoose = require("mongoose");
let server = require('../src/server');
let PokemonModel = require('../api/models/pokemon.model');
chai.use(chaiHttp);
let should = chai.should();
describe('Pokemon', () => {
beforeEach((done) => { //Before ea... |
_socialQueue.push({
url: 'http://api.flattr.com/js/0.6/load.js?mode=auto&uid=gargamel&language=sv_SE&category=text',
id: '<?php echo $this->name; ?>',
onload: function(f) {
if ('<?php echo $this->fadeIn; ?>') {
f.awaitRender({
buttons: document.getElementsByClassName('coi... |
$(document).ready(function () {
//PARTICLES SETUP
particlesJS('particles-js',
{
"particles": {
"number": {
"value": 65,
"density": {
"enable": true,
"value_area": 800,
},
},
"color": {
"value": "#d9d9d9",
},
"shape": {
"type": "circle",
"stro... |
import {FEED_BREED_DATA} from '../types/BreedsTypes';
const INITIAL_STATE = {
breeds: {},
};
const BreedsReducer = (state = INITIAL_STATE, action) => {
switch (action.type) {
case FEED_BREED_DATA:
return { ...state, breeds: {...state.breeds, ...action.payload}};
default:
return state;
}
};
... |
import React, { Component } from 'react';
class Signinbutton extends Component {
render() {
return <div>
<div className="container">
<div className="row">
<div className="col s12 center-align button-margin button-style">
<a className="waves-effect... |
function changeColorRed(){
document.getElementById('free').style.borderTop = "5px solid red";
}
function changeColorBlue(){
document.getElementById('professional').style.borderTop = "5px solid blue";
}
function changeColorOrange(){
document.getElementById('enterprise').style.borderTop = "5px solid orange";
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.