text stringlengths 7 3.69M |
|---|
module.exports = async function(arg) {
await require(arg.__rootDir + '/core/setup.js')(arg);
log('version: ' + pkg.version);
const gyroServer = require('./gyroServer.js');
const {
Mouse,
Keyboard,
Gamepad,
or,
and
} = require('./contro.js');
let gamepad = new Gamepad();
const http = require("http");
... |
import express from 'express';
import businessApi from './business';
import sendMessageByShortMes from './sendMessageByShortMes';
import sendMessageByEmail from './sendMessageByEmail';
import messageSubscribe from './messageSubscribe';
let api = express.Router();
api.use('/business',businessApi);
api.use('/sendMessa... |
module.exports = function(grunt) {
grunt.config('browserify', {
dist: {
files: {
'./bundle.js': ['app.js']
}
}
});
grunt.loadNpmTasks('grunt-browserify');
grunt.registerTask('default', ['browserify']);
}; |
export default function () {
return {
load: ({ resources, Progress }) => {
const totSize = resources.map(it => it.size).reduce((itA, itB) => itA + itB);
const progress = Progress(totSize, resources.map((it) => {
return { size: it.size };
}));
p... |
describe('BarChart', function() {
var chart;
afterEach(function() {
if (chart) {
chart.destroy();
chart = null;
}
});
describe('chartConfig', function() {
it('should configure for stacking', function() {
chart = Ext.create('BarChart', {
... |
import { PATHNAME_TEMPLATE } from '../constants';
import { getPathname } from './getPathname';
describe(`${PATHNAME_TEMPLATE} getPathname`, () => {
const websiteId = 1234;
it('should return the right string', () => {
const actual = getPathname(websiteId);
expect(actual).toBe(`/v2/websites/locations/webs... |
let myRequest = new Request("./beerlist.json");
fetch(myRequest)
.then(function(resp){
return resp.json();
})
.then(function(data){
const locConverter = (ind) =>{
if (ind === 1){
return 'Itaewon';
} else if (ind === 2){
return 'Hannam'... |
/* global it expect describe */
import Immutable from 'immutable';
import * as Reducers from '../../../src/reducers/nodes';
import {clusterUpdate, addNodes, removeNodes} from '../../../src/actions';
describe('reducers - nodes', () => {
const initialState = [
{
pid: 'TEST_ID_1',
hostname: 'mesos',
... |
import {useEffect, useState} from 'react';
async function getRepos() {
const repos = await fetch('/api/getPrivateRepos')
.then(resp => resp.json());
return repos;
}
export default function Repos() {
const [reposList, setRepoList] = useState([]);
useEffect(() => {
getRepos().then(data... |
import mockNaja from './setup/mockNaja';
import fakeXhr from './setup/fakeXhr';
import cleanPopstateListener from "./setup/cleanPopstateListener";
import {assert} from 'chai';
import sinon from 'sinon';
describe('makeRequest()', function () {
fakeXhr();
it('should call success event if the request succeeds', funct... |
;
var check=new Array(); //每正确填写一个输入框则添加一个元素,添加八个元素之后恢复submit按钮
$(function () { //判断isbn的输入框是否为空,为空则提示错误,并将submit按钮置为灰色
var text=document.getElementById("isbn_alert");
var auto=document.getElementById("autofill");
var manual=document.getElementById("manualfill");
var reg = /^[9][7][8,9]\d{10}$/; /... |
window.onload = function (){
// 获得元素
var main_right = document.getElementById('main-right')
var attention = document.getElementById('attention')
var ic_weixin = document.getElementsByClassName('ic-weixin')[0]
var ewm = attention.getElementsByClassName('ewm')[0]
//给ic-weiixn 微信图标绑定一个鼠标进入onmousee... |
// Inside vue.config.js
module.exports = {
// ...other vue-cli plugin options...
pwa: {
name: 'Eagleglobal Markets',
themeColor: '#0476F2',
msTileColor: '#000000',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'black',
iconsPath: {
favicon32: 'img/icons/favicon-32x3... |
function User(userData) {
if (userData) { // если указаны данные -- одна ветка if
this.name = userData.name;
this.age = userData.age;
} else { // если не указаны -- другая
this.name = 'Аноним';
}
this.sayHi = function() {
alert(this.name)
};
// ...
}
// Использо... |
const tpl = require('./util/tpl');
const vfs = require('vinyl-fs');
const path = require('path');
const chalk = require('chalk');
const spawn = require('child_process').spawn;
const through = require('through2');
const log = console.log;
const cwd = process.cwd();
const info = text => log(chalk.... |
// This is a manifest file that'll be compiled into application.js.
//
// Any JavaScript file within this directory can be referenced here using a relative path.
//
// You're free to add application-wide JavaScript to this file, but it's generally better
// to create separate JavaScript files as needed.
// require_tree... |
export function isVoucherProduct(product) {
return product.sku.startsWith('--voucher--')
}
/*
* We add to the non-voucher products the quantity (from the client-side state).
*/
export function withLocalState(localCart, item) {
// Exclude voucher codes
if (isVoucherProduct(item)) {
return item;
}
cons... |
const { User } = require('../models');
const validator = require('validator');
const { to, TE } = require('../services/util.service');
const Sequelize = require('sequelize');
const bcrypt = require('bcrypt');
const bcrypt_p = require('bcrypt-promise');
const crypto = require('crypto');
const CONFIG... |
import React, { useState } from "react";
import TaskChart from "./TaskChart";
import Profile from "./TaskData";
import {
Table,
TableHead,
Checkbox,
TableHeaderCell,
Pane,
Button,
Avatar,
} from "evergreen-ui";
function UniTable() {
const [checkAll, setCheckAll] = useState(false);
const [check, setC... |
var server = require('server.js');
var agents = [];
var cur_time = 0;
export.init = function (homeX,homeY,homeR,officeX,officeY,officeR,agentNums,clockin,clockout) {
}
var initAgent = function(agentNums) {
for (var i = 1; i <= agentNums; i++) {
agent = new Object(),
agent.id = i,
agent.x =... |
const Augur = require("augurbot");
const request = require("request");
const u = require("../utils/utils");
const attempts = new Set();
function getStats(channel) {
if (attempts.size == 0) return Promise.resolve(true);
else return new Promise((fulfill, reject) => {
request("https://stats.foldingathome.org/api... |
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from 'material-ui/styles';
import Paper from 'material-ui/Paper';
import Typography from 'material-ui/Typography';
import Divider from 'material-ui/Divider'
import Grid from 'material-ui/Grid'
const styles = theme => ({
root: theme... |
'use strict';
let clientScripts = require('../config/scripts.js');
let Award = require('../models/award.model.js');
let Grammy = require('../models/grammy.model.js');
let _ = require('lodash');
let chance = require('chance').Chance();
let async = require('async');
exports.editor = function(req, res){
let finalDataA... |
/* eslint-disable no-param-reassign */
import test from 'ava';
import WebId from '../dist/webid.cjs';
/** @todo import this from ./src/constants.js once ava updates @babel/core */
const DefaultOptions = {
delimiter: '-',
delimiterInShortid: false,
lower: true,
maxLength: 128,
remove: null,
strict: true,
};
const... |
PIXI.VideoTexture = function( source, scaleMode )
{
if( !source ){
throw new Error( 'No video source element specified.' );
}
// hook in here to check if video is already available.
// PIXI.BaseTexture looks for a source.complete boolean, plus width & height.
if( (source.readyState === so... |
function Animal(name, weight) {
this.name = name;
this.weight = weight;
this.getName = function() {
return this.name;
};
this.getWeight = function() {
return this.weight;
};
this.setWeight = function(weight) {
this.weight = weight;
};
}
function Bear(name, weight) {
Animal.call(this, nam... |
import React, { Component } from "reactn";
import {
View,
Button,
Text,
TouchableOpacity,
StyleSheet,
Animated,
FlatList
} from "react-native";
import InventoryListItem from "./InventoryListItem";
import firebase from "../../Firebase";
import * as data from "../shared/data";
const db = firebase.firestor... |
var pull = require('pull-stream');
var test = require('tape');
var black_box = require('./index.js');
var blackbox = new black_box();
test('should work as composed through stream', function (t) {
t.plan(5);
blackbox.add('demo');
blackbox.add('split', 'demo');
blackbox.on('demo', function (data) {
... |
export default theme => ({
root: {
padding: theme.spacing.unit * 2,
overflow: 'hidden'
},
inputs: {
...theme.flexColumnCenter
},
buttons: {
...theme.flexColumnCenter
},
scrollbar: {
width: 500,
height: 573,
display: 'flex',
flexDirection: 'row',
fontSize: 20,
color:... |
angular.module('timelineApp.controllers').controller('RegisterCtrl', ['$scope', '$http', 'AuthService', function($scope, $http, AuthService) {
$scope.submit = function() {
var payload = ('username=' + $scope.register.username + '&password=' + $scope.register.password +
'&first_name=' + $scope.register.firstnam... |
const mongoose = require('mongoose');
let TournmentSchema = require('./tournment-schema');
TournmentSchema.statics = {
createTournment
}
let TournmentModel = mongoose.model('tournment', TournmentSchema);
module.exports = TournmentModel;
async function createTournment(body, requestUser) {
let tournment = ne... |
import Layout from "../components/Layout";
import axios from "axios";
import {env} from "../next.config";
import Link from "next/link";
import {useState, useEffect} from "react";
import moment from "moment";
const Home = ({ categories}) => {
const [setTrending, setTrendingState] = useState([]);
useEffe... |
import React, {Component} from 'react';
class Index extends Component {
render() {
return (
<div className={`container`}>
<h1>Welcome!</h1>
<div>
This site is designed for sharing KC ship lists and equip(work in progress) info.
... |
const test = require('./testHelper')('kevm');
const assert = require('assert');
const mallet = test.mallet
// import key
let res = mallet.importPrivateKey(test.prvKeyA, 'passw0rd');
assert.strictEqual(res, test.accA);
// new key
const accB = mallet.newAccount('passw0rd');
res = mallet.listAccounts().filter(a => a !=... |
import styled from "styled-components";
import stylers from "@paprika/stylers";
export const Content = styled.div`
&:focus {
${stylers.focusRing.subtle(true)}
}
`;
|
/*
* This is the model representation of the Users table. It represents a single
* user.
*/
var Bookshelf = require('bookshelf').DB;
/* So this model is a little more complicated. Recall from our DB schema that
* we've got a join/bridge table for followers.
*
* The problem is, Bookshelf wants us to tell it wha... |
import React from 'react';
import { Link } from 'react-router';
import RaisedButton from 'material-ui/RaisedButton';
const styles = {
base: {
width: '600px'
},
button: {
margin: '0 10px'
}
};
const ButtonCenter = () => (
<div style={styles.base} className="boxItemCenter">
<... |
var tokki = angular.module("tokkiApp");
tokki.config(["$stateProvider", "$urlRouterProvider",
function($stateProvider, $urlRouterProvider){
$stateProvider
.state('system.sii.recibidos', {
url: "/recibidos",
templateUrl: "pages/sii/xmlrecibidos/recibidos.html",
controller: "XmlRecibidos",
resolv... |
import React, {useState , useEffect} from "react";
import "./geradorPosts.css";
import api from "../../Connection/Api";
export default function GeradorPosts() {
const [logado , setLogado] = useState([]);
const [mensagem, setMensagem] = useState("");
let numero = localStorage.getItem("nome");
useE... |
import Siembra from '@/models/ModeloSiembra';
export default {
namespaced: true,
state: {
siembra: new Siembra('', '', '', '', '', '', '', ''), // Modelo siembra
formSiembraValido: false, // Indica si el formulario de siembra es valido
},
actions: {
},
mutations: {
/... |
var app = angular.module('myApp.filters.defaultValueFilter', []);
app.filter('defaultValue', function () {
return function (input, params) {
//console.log(input);
//console.log(params);
if (!input) {
return params;
}
return input;
};
}); |
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript({
code: "[...document.getElementsByTagName('button')].forEach(button => button.innerHTML = '<span>🥚</span>')"
});
});
|
var hooksObject = {
// Called every time an update or typeless form
// is revalidated, which can be often if keyup
// validation is used.
formToModifier: function(modifier) {
// console.log('formToModifier');
// console.log(modifier);
var _set = modifier.$set
if(_set && _set.securityDepositInCen... |
/**
* 类型扩展支持
* @desc 用于导入数据类型扩展
* @author wangxin
*/
'use strict'; // javascript 严格说明
/**
* 模块引用
* @private
*/
let { logger, fsh } = require('../framework');
const DIR_TYPE_EXTEND = "../extends";
let sysRoot = undefined;
/**
* 执行数据类型扩展导入。
* @param {string} catalog 扩展文件(.js)所在的目录
*/
va... |
function Controller() {
function openMenu() {
APP.openCloseMenu();
}
function openOptions() {
APP.openCloseOptions();
}
function openNextWindow() {
APP.openWindow(params);
}
function closeWindow() {
APP.onClose && APP.onClose() && (APP.onClose = null);
... |
import { useState, useEffect } from 'react';
import { connect } from 'react-redux';
import { Link, useHistory } from 'react-router-dom';
import { useToasts } from 'react-toast-notifications';
import { fetchAllUser, deleteUser } from '../../redux/actions/userManageActionCreator';
import UserModalAdd from '../dashboard/U... |
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, { Component } from 'react';
import { StyleSheet, View, SafeAreaView, Text, ImageBackground } from 'react-native';
import PickerModal from 'react-native-picker-modal-view';
const data = require("./top20.... |
import React , { Component } from 'react';
import {Link} from 'react-router-dom';
import {AboutDiv} from './aboutStyle';
import {CSSTransition} from 'react-transition-group';
import './style.css';
import Button from '@material-ui/core/Button';
import teal from '@material-ui/core/colors/teal';
import { MuiThemeProvider... |
//let lista = [1, 2, 3, 4, 5]
let lista = ['Ovo', 'Sal', 'Leite', 'Massa']
//console.log(typeof lista)
//console.log(Object.keys(lista))
let pessoa = {
nome: 'Tilola',
sobrenome: 'Naosei',
idade: '120'
}
console.log(Object.values(pessoa))//retorna os valores do objeto
console.log(Object.keys(pessoa))//re... |
const { Profile } = require('../../models/profile')
module.exports = (req, res) => {
const profile = new Profile({
firstname: req.query.firstname,
lastname: req.query.lastname,
address: req.query.address,
email: req.query.email,
password: req.query.password,
phonenumber: req.query.phonenumber,
birthday:... |
import { ADD_TODO, FILTER_TODO, GET_TODOS, TOGGLE_TODO } from '../actions/action-types'
let initialState = {
todos: [],
filter: 'All'
}
export default function todoReducer(state = initialState, action) {
let todosCopy = JSON.parse(JSON.stringify(state.todos))
switch (action.type) {
case ADD_... |
const koa = require('koa')
const app = new koa()
const port = 8422
app.context.renderToString = function() {
console.log(`abc`)
}
app.use(async (ctx, next) => {
ctx.renderToString()
ctx.body = 'Hello, world'
})
app.listen(port, function() {
console.log(`✨ Server on: http://localhost:${port}`)
})
|
import React, { useState, useEffect } from "react";
import { BrowserRouter } from "react-router-dom";
import Routes from "./Routes";
import NavBar from "./Navbar";
import UserContext from "./UserContext";
import './App.css';
import JoblyApi from "./api";
import jwt from "jsonwebtoken"
/**
* App:
* - Makes API ca... |
import * as React from 'react';
import debounce from 'lodash/debounce';
import { PropTypes } from 'prop-types';
import { Image, Text, View } from 'react-native';
import { Counter } from 'kitsu/components/Counter';
import { ProgressBar } from 'kitsu/components/ProgressBar';
import { Rating } from 'kitsu/components/Ratin... |
'use strict';
var fs = require('fs'),
path = require('path');
fs.exists('default.html', function(e){
if(e){
console.log("It there.");
}else{
console.log('No there.');
}
});
/*
process.nextTick(function(){
console.log('Next tick callback.');
});
process.on('exit',function(code){
console.log('about to... |
"use strict";
var gulp = require('gulp');
var nodemon = require('gulp-nodemon');
var browserify = require('browserify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
var concat = require('gulp-concat');
var mocha = require('gulp-mocha');
var spawn = require('child_process').spawn;
... |
(function () {
'use strict';
/**
* @ngdoc object
* @name activityForm.controller:ActivityFormCtrl
*
* @description
*
*/
angular
.module('activityForm')
.controller('ActivityFormCtrl', ActivityFormCtrl);
function ActivityFormCtrl($scope, $location, $stateParams, $state, Tags, Activity... |
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
emails: []
},
mutations: {
SEND(state, email) {
state.emails.push(email)
}
},
actions: {
storeSend({commit}, {email}) {
commit("SEND", email)
}
},
modules: {
}
})
|
console.log("Hoisting In Functions & Variables");
console.log(number);
printNumber();
var number = 15;
var printNumber2 = function () {
console.log(`number : ${number}`);
};
function printNumber() {
console.log(`number : ${number}`);
}
|
// global variables
var signalServer = 'https://ec2-52-28-93-228.eu-central-1.compute.amazonaws.com:8888/';
/**
* generates a random room name
* @return {String} room name
*/
function randomRoomName() {
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var length = 10;
var result =... |
function searchbox(){
return `
<div id="searchbox">
<input oninput="throttleFunction()" type="text" id="query" placeholder="Search By Receipe Name">
<div id="searchOptions"></div>
</div>`;
}
export default searchbox;
|
import express from "express";
import config from "./config";
import load from "./loaders";
(async () => {
try {
const app = express();
const server = await load(app);
server.listen(config.port, () => {
console.log(`Server is starting on port ${config.port}`);
});
... |
(function () {
'use strict';
/**
* @ngdoc service
* @name article.factory:Article
*
* @description
*
*/
angular
.module('article')
.factory('Article', Article);
function Article($http,consts) {
var ArticleBase = {};
ArticleBase.getAll = function () {
return $http({
... |
app.factory('dataservice', function($http,$log,$q){
var factory = {};
const ROOT_URL = 'http://localhost:3090';
//Get all pokemon data
factory.getPokemons = function(){
var deferred = $q.defer();
$http.get(ROOT_URL + '/pokemon')
.then(function(data) {
deferred.resolve(data);
},functi... |
import React from 'react';
import { render } from 'react-dom';
// import Counter from './Counter';
import Input from './Input';
import Child from './Child';
import Parent from './Parent';
import Demo from './Demo';
import Counter from './Counter';
import FetchUseEffect from './FetchUseEffect';
render(<FetchUseEffect ... |
import { checkSelector } from '../../utils/util.js';
export default checkSelector(':fullscreen');
|
//IMPORTS
//react
import React, { useState, useEffect, useContext } from "react"; // eslint-disable-line no-unused-vars
//styled-components
import styled from "styled-components";
// router
import { Link } from "react-router-dom";
// contexts
import { UserContext } from "../../../contexts/UserContext";
import { UserMis... |
import React, { createContext, useContext } from "react";
// Context is used to share the data between different components
// Context related code could be moved to separate file
const defaultContextValue = {
id: "1",
name: "user1",
};
const Context = createContext(defaultContextValue);
// const Provider = Contex... |
import React, { Component } from 'react';
import {
Card,
CardBody,
CardHeader,
Col,
Collapse,
Fade,
Form,
FormGroup,
Input,
Label,
Row,
Button,
} from 'reactstrap';
import crypto from 'crypto';
import axios from 'axios';
import { ToastContainer, toast } from 'react-toastify';
import 'react-toast... |
import { cons, car, cdr } from 'hexlet-pairs';
import { getRandomInt } from '../utils';
import gameConstructor from '../index';
const makeExp = (operation, a, b) => cons(cons(operation, a), b);
const getOperation = exp => car(car(exp));
const getA = exp => cdr(car(exp));
const getB = exp => cdr(exp);
const getRand... |
const mongoose = require('mongoose');
const URLSchema = mongoose.Schema({
shortURL: {
type: String,
required: true
},
longURL: {
type: String,
required: true
},
timeOfCreation: {
type: Number,
default: Math.floor(Date.now()/1000),
required: tr... |
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModu... |
import Axios from 'axios';
function CallUrl(updateItemsCallback, url)
{
console.log('CallUrl');
Axios.get(url)
.then((response) => {
console.log('Axios.response.data');
console.log(response.data);
updateItemsCallback(response.data.items)
})
.catch(function(error)
{
conso... |
'use strict';
const YamlTree = require('../index');
const opts = {
encoding: 'utf8'
};
const Tree = new YamlTree('./test/test.raml', opts);
Tree.buildTree(true)
.then(success => {
console.log(Tree.getJson());
})
.catch(err => {
console.log('Something went horribly wrong...\n' + err);
});
|
var tipo = document.getElementById('inputTipo')
var precoValor = document.getElementById('inputPreco')
var carros = document.getElementById('inputCarro')
var nome = document.getElementById('inputNome')
var telefone = document.getElementById('inputFone')
var email = document.querySelector('#email');
var error = document... |
angular.module('app.routes', ['ngRoute'])
.config(function($routeProvider, $locationProvider) {
$routeProvider
// home route
.when('/', {
templateUrl: 'views/pages/login.html',
controller: 'MainController',
controllerAs: 'login'
... |
class Controller {
index(req,res,...args){
res.setHeader('content-type','text/html;charset="utf-8"');
res.end('<h1><a href="/Item/index">Go ToDoList</a></h1>')
}
}
module.exports = new Controller(); |
const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
return sequelize.define('SalesSequenceProfile', {
profile_id: {
autoIncrement: true,
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
primaryKey: true,
comment: "ID"
},
meta_id: {
... |
let price = +prompt('enter price');
let discount = +prompt('enter discount');
let pWd = price / 100 * (100 - discount);
pWd = parseInt(pWd * 100) / 100;
let saved = price - pWd;
saved = parseInt(saved * 100) / 100;
if (!price || !discount || price <= 0 || discount <= 0) {
console.log('Invalid data');
} else {
... |
import { combineReducers } from "redux";
function getUser(state = [], action) {
switch (action.type) {
case "SET_USER":
// console.log(action.payload, "Payload")
return {
...state,
user: action.payload
}
default:
retur... |
import Vue from 'vue';
let initializePageSlug = (state, page) => {
if (state.dictionary[page.slug] === undefined) {
Vue.set(state.dictionary, page.slug, []);
}
}
export default {
namespaced: true,
state () {
return {
all: [],
dictionary: {},
}
},
mutations: {
initialize (state, payload) {
if (p... |
import React, { useEffect, useState } from 'react';
import 'bootstrap/dist/css/bootstrap.min.css';
import { Container, Row, Col, Form, Button } from 'react-bootstrap';
import Autocomplete from '@material-ui/lab/Autocomplete';
import TextField from '@material-ui/core/TextField';
import AutoCompleteSearch from '../AutoCo... |
maskX = 0;
maskY = 0;
function preload() {
mask = loadImage('https://i.postimg.cc/pLfgGM4w/Snake-removebg-preview.png')
}
function setup() {
canvas = createCanvas(400, 400);
canvas.position(400, 200);
video = createCapture(VIDEO);
video.size(300, 300);
video.hide();
poseNet = ml5.poseNet(vi... |
require('dotenv').config();
import app from './app';
app.listen(process.env.SERVER_PORT, () => {
console.log(`Server running on port ${process.env.SERVER_PORT}`);
});
|
#target Illustrator #targetengine main
// ASSUMES PNG'S OF 500x500 PX IN SAME FOLDER AS .AI File
// RENAMES ARTBOARDS TO NAME OF PNG FOUND
// Written by Robert Moggach & Qwertyfly
// Frankensteined together by Herman van Boeijen
function getFolder() { // Frankensteined to just get the folder this file is in
... |
(function (angular) {
"use strict";
var module = angular.module("student", ['ngMaterial']);
function config() {
}
config.$inject = [];
module.config(config);
})(window.angular); |
export class Vector2 {
constructor(x = 0.0, y = 0.0) {
this.x = x;
this.y = y;
}
setTo(x, y) {
this.x = x;
this.y = y;
}
copy(v) {
this.x = v.x;
this.y = v.y;
}
clone() {
return new Vector2(this.x, this.y);
}
normalize() {
... |
$(function(){
init_countdown();
init_dp_star();
$(".J_item_more").click(function(){
$(this).parent().find(".business_display").toggleClass("business_blank");
});
});
/**
* 初始化倒计时
*/
function init_countdown()
{
var endtime = $("#countdown").attr("endtime");
var nowtime = $("#countdo... |
// array to get buttons started
let array = ["Mario", "Luigi", "Link", "Kirby", "Yoshi", "Captain Falcon", "Princess Peach", "Toad", "Bowser"];
let userArray = [];
function createButton() {
let inputValue = $("#input").val().trim()
let newButton = $("<button>");
newButton.text(inputValue).addClass("newButt... |
var base = {};
/**
* ********************************************************************************************************************************
* add the page event actions:
* ********************************************************************************************************************************
*/
$... |
var searchData=
[
['addchild',['AddChild',['../classIComposite.html#a889fcd5161b20592299d25d4e00727b0',1,'IComposite']]],
['addcomponent',['AddComponent',['../classCTower.html#aaabd89603fc2b72be4d42a30e6a6adff',1,'CTower']]]
];
|
import * as React from 'react';
import './Description.css'
export class Description extends React.Component {
render() {
return (
<div className='stack'>
<h1><em>uSober</em></h1>
<div className='icons'>
<img src='selfie.svg' width='20%' alt='' />
<img src='tap.svg' width='20... |
const nunjucks = require('nunjucks');
const path = require('path');
const nodemailer = require('nodemailer');
const Promise = require("bluebird");
const dateFilter = require('../nunjucks/dateFilter');
const currencyFilter = require('../nunjucks/currency');
const limitTo ... |
import {Wall} from './wall.js';
export class Level {
constructor(ctx) {
this.ctx = ctx;
this.walls = this.createWalls();
}
render(){
this.walls.forEach((element) => element.render());
}
createWalls(){
//Some logic to import the walls from a file or create
//them from IA
//Now, we are u... |
(function() {
'use strict';
const showName = (name) => {
console.log(name);
};
showName('Manh');
})();
|
const { Given, When, Then } = require('cucumber');
const assert = require('assert');
const scope = require('../../support/scope');
const testFunctions = require('../../support/functions');
const config = require('../../support/config');
const { tenSeconds, thirtySeconds, oneMinute } = require('../../support/constants')... |
///Validations with user name and password...
// let userEmail = 'asad123'
// let password = 'asad123asad123!@'
// let userChecker = function(myString){
// if((myString.includes(123)) && (myString.length > 6)){
// return true
// }
// return false
// }
// let passChecker = function(pas... |
export class Http {
static instance = new Http();
async get(url) {
try {
const request = (await fetch(url)).json();
return request;
} catch (e) {
console.log('Error get', e);
throw e;
}
}
async post(url, data) {
try {
const request = (
await fetch(url, {
... |
import React from 'react'
import renderer from 'react-test-renderer'
import { StyleRoot } from '@instacart/radium'
import LoadingBox from '../LoadingBox'
it('renders the standard LoadingBox correctly', () => {
const tree = renderer
.create(
<StyleRoot>
<LoadingBox style={{ width: '50px' }} />
... |
'use strict'
import {
StyleSheet,
View,
Text,
TextInput,
TouchableHighlight,
Image,
PixelRatio,
Platform
} from 'react-native'
import React, {Component} from 'react';
import {connect} from 'react-redux';
import { deleteMatch} from '../actions'
import ActionSheet from 'react-native-actionsheet';
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.