text stringlengths 7 3.69M |
|---|
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
client.user.setActivity("Rickrolled" , {type:"WATCHING"})
client.guilds.forEach((guild) => {
console.log(" - " + guild.name)
guild.channels.forEach((ch... |
// pages/foodSuccess/foodSuccess.js
//获取应用实例
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
orderNum: 0,
banner: ""
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.setData({
orderNum: options.orderNum
})
this.getBanner();
wx.setNavigationBarTitle(... |
var _ = jst.DomX;
var ctPanel = null, contentLayout = null, mainLayout = null, crumbArea = null;
jst.complete(function() {
crumbArea = _.$("crumbArea");
ctPanel = new jst.ui.FlowPanel({
border : 0
});
ctPanel.setEl("content");
contentLayout = new jst.ui.BorderLayout({ // 内容区布局,不设定autoResize,由主布局驱动;
center ... |
import React, { useContext } from 'react';
// Context
import { ProductContext } from '../contexts/ProductContext';
const Product = props => {
const { products, addItem } = useContext(ProductContext);
return (
<div className="product">
<img src={props.product.image} alt={`${props.product.title} book`} />
<h... |
var searchData=
[
['fixoutofboundsuvs',['fixOutOfBoundsUVs',['../class_m_b2___texture_bake_results.html#a2691265940fa5099d4d559875ba02a72',1,'MB2_TextureBakeResults']]]
];
|
#!/usr/bin/env node
// in the Script Goal
'use strict';
console.log(1);
----------------------------------------------------
[
["hashbang", "#!/usr/bin/env node"],
["comment", "// in the Script Goal"],
["string", "'use strict'"],
["punctuation", ";"],
"\r\nconsole",
["punctuation", "."],
["... |
var app;
(function () {
'use strict';
app = angular.module("ticModule", [
'ui.bootstrap']);
})();
(function () {
app.controller('ticController', function ($scope, $http, $compile, $uibModal, $timeout) {
$scope.ticArray = [null, null, null, null, null, null, null, null, null];
... |
import 'foundation-sites/dist/foundation.css';
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import { apiHost, routing } from './app.config';
import moviesPage from './container/movies-page';
export default angular.module('app', [uiRouter, moviesPage])
.config(routing)
.value('apiH... |
//Base
import React, { Component } from 'react';
//Component
import Navigation from '../../../molecules/Navigation';
class Navi extends Component {
render() {
let navLinks = [
{
id: 0,
title: 'Home',
url: "/",
el: 'a',
style: 'nav-link',
... |
import React from 'react';
import { Grid,Paper, Avatar, TextField, Button, Typography } from '@material-ui/core'
import LockOutlinedIcon from '@material-ui/icons/LockOutlined';
import axios from 'axios';
import {Link, Redirect} from 'react-router-dom'
// const config = {
// headers: { Authorization: `Bearer ${loca... |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import queryString from 'query-string';
import PropTypes from 'prop-types';
import { setArticle, setCategory } from '../actions/blog';
import Loader from '../components/Loader';
import BlogSer... |
'use strict';
// Declare app level module which depends on filters, and services
angular.module('lochApp', [
'ngRoute',
'lochApp.filters',
'lochApp.services',
'lochApp.directives',
'lochApp.controllers'
])
.config(['$routeProvider', function($routeProvider) {
... |
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
import homeComponent from '../pages/home/'
import memberComponent from '../pages/member/'
import shopcarComponent from '../pages/shopcar/'
import searchComponent from '../pages/search/'
import newListComponent from '../pages/newList/'
import newInf... |
import {configureStore} from '@reduxjs/toolkit';
import authSlice from './features/auth-slice';
import cartSlice from './features/cart-slice';
import productSlice from './features/product-slice';
import wishlistSlice from './features/wishlist-slice';
export const store = configureStore({
reducer:{
cart:cartSlic... |
// Copyright (c) 2014 Readium Foundation and/or its licensees. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, t... |
module.exports = {
css: {
files: '_src/sass/**/*.scss',
tasks: ['sass', 'cssmin'],
},
images: {
files: '_src/img/**/*.{png,jpg,gif,svg}',
tasks: ['newer:imagemin:dynamic'],
},
uglify: {
files: '_src/js/**/*.js',
tasks: ['concat']
}
} |
'use strict';
(function(){
var modals = document.getElementsByClassName('modal');
var overlay = document.querySelector('#modal-overlay')
var links = document.getElementsByClassName('show-modal');
var closeModalButtons = document.getElementsByClassName('close-modal');
var showModal = function(... |
const express = require('express');
const expressLayouts = require('express-ejs-layouts');
const mongoose = require('mongoose');
const session = require('express-session');
const app = express();
// Middleware EJs view
app.use(expressLayouts);
app.set('view engine', 'ejs');
// Bodyparser
app.use(express.urlencoded({... |
function solve(args){
var numJumpsAllowed = +args[0],
trackLen = +args[1],
fleas = [],
fleasLen, currentPos = [],
winner, winIn
flagLen = 0;
args.splice(0, 2);
fleas = args;
fleasLen = fleas.length;
function printHasTags(p){
for(var i = 0; i < 2; i+=1){
var hashTags = '';
for(var j = 0; j < p; j+... |
import React from 'react';
import '../assets/css/style.css';
import HeaderDR from './HeaderDR';
import LeftContentDR from './LeftContentDR';
import RightContentDR from './RightContentDR';
export default function DressingRoom(props) {
return (
<div className="container-fluid">
<div className="r... |
function fnButtons() {
$("#consultar").bind("click", function () {
var datos = new Array();
console.log(post(317));
console.log(post(318));
});
}
function convertirini() {
var DateSplit = this['tcFechaInicio'].value.split("-");
var Year = DateSplit[0];
var Month = DateSplit[... |
const TypeAdvisory = require('../models').TypeAdvisory;
const create = async function (req, res) {
const body = req.body;
if (!body.name || !body.price || (!body.limitNumberRecords && body.type === 1) || !body.description) {
return ReE(res, 'ERROR0011', 400);
}
if (body.type === 2) {
let duplicateTypeAdvisory =... |
import React, { useState, useEffect } from 'react';
import { MoedaReal, MonetaryFormat } from '../../utils';
import { hoje, amanha } from '../../constants';
import './styles.css';
const FechamentoCaixa = () => {
const [vendas, setVendas] = useState([]);
const [input, setInput] = useState(0);
const [isFechado, s... |
function register(env) {
env.addGlobal("cta", (guid, align_opt) => handler(env, guid, align_opt));
}
function handler(env, guid, align_opt) {
return env.getCTAManager().render(guid, align_opt);
}
export {
handler,
register as default
};
|
function Combatant(health, attack, name) {
this.health = health;
this.attack = attack;
this.name = name;
this.attackEnemy = function(enemy) {
console.log(
"Enemy with name: " +
enemy.getName() +
" is attacked by " +
this.name +
" for " +
this.attack
);
... |
module.exports = {
getProduct: async (req, res) => {
const db = req.app.get("db");
allProduct = await db.product.get_product();
return res.status(200).send(allProduct);
},
addOrder: async (req, res) => {
const db = req.app.get("db");
const { total, user_id, quantity } = req.body;
const { ... |
const REPOSITORY_NAME = window.location.origin.includes('localhost')
? ''
: 'Readable';
export function getPhoto(id, size) {
return `https://api.adorable.io/avatars/${size ? size : '47'}/${id}.png`;
}
export function capitalize(text) {
return text.charAt(0).toUpperCase() + text.slice(1);
}
// Create GUID
// ... |
/*!
* SAP UI development toolkit for HTML5 (SAPUI5)
*
* (c) Copyright 2009-2014 SAP SE. All rights reserved
*/
jQuery.sap.declare("sap.viz.ui5.controls.common.BaseControlRenderer");sap.viz.ui5.controls.common.BaseControlRenderer={};
sap.viz.ui5.controls.common.BaseControlRenderer.render=function(r,c){};
|
import fire from '../src/Config/fire'
function iamclose(){
fire.auth().signOut().then(function() {
// Sign-out successful.
alert("LogOut SuccessFull")
}).catch(function(error) {
// An error happened.
});
alert("aaaaaa")
} |
import { ADD_TO_CART, CLEAR_CART, REMOVE_FROM_CART } from "../actions/types";
export default function cartReducer(state,action){
if (action.type === ADD_TO_CART) {
if (action.quantity > 0) {
return {
cart :[...state.cart,{product: action.productInfo ,quantity: action.qu... |
/*
* @lc app=leetcode.cn id=535 lang=javascript
*
* [535] TinyURL 的加密与解密
*/
// @lc code=start
/**
* Encodes a URL to a shortened URL.
*
* @param {string} longUrl
* @return {string}
*/
var encode = function (longUrl) {
this.map = new Map();
this.id = 0;
this.id++;
this.map.set(this.id, longUrl)... |
const express = require("express");
const mongoose = require("mongoose");
const bodyParser = require("body-parser");
const cors = require('cors');
const app = express();
const postRoutes = require('./routes/posts');
app.use(bodyParser.json());
app.use(cors());
app.use(postRoutes);
const PORT = 8000;
const DB_URL =... |
import React from 'react';
import {
StyleSheet,
ScrollView
} from 'react-native';
import MenuItem from './MenuItem';
import PDP from './PDP';
const styles = StyleSheet.create({
container: {
backgroundColor: '#F5FCFF'
}
});
type MainMenuProps = {
items: Array<Object>,
navigator: Object
};
... |
import MusicClient from '../../lib/music/Client';
const { ipcRenderer } = window.require('electron');
const client = new MusicClient(ipcRenderer);
function load(music) {
return {
type: "LOAD_MUSIC",
data: music,
};
};
function startLoading() {
return {
type: "START_LOAD_MUSIC",
... |
const { Entity, clauses } = require("../src/entity");
const { expect } = require("chai");
const moment = require("moment");
const uuidV4 = require("uuid/v4");
/*
todo: add check for untilized SKs to then be converted to filters
*/
let schema = {
service: "MallStoreDirectory",
entity: "MallStores",
table: "Store... |
import { StyleSheet } from 'react-native';
const onboardingStyles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center'
},
button: {
height: 50,
width: 100,
alignItems: 'center',
justifyContent: 'center',
b... |
import React from 'react';
import logo from "../images/logo.png";
const Header = () => {
return (
<div>
<nav>
<img className="logoapp" src={logo} alt="Logo le bon burger" />
</nav>
</div>
);
};
export default Header; |
'use strict';
var knex = require('../../connection.js');
var Node = require('./helpers/create-node.js');
var Way = require('./helpers/create-way.js');
var Relation = require('./helpers/create-relation.js');
var Change = require('./helpers/create-changeset.js');
var serverTest = require('./helpers/server-test');
var t... |
import moment from 'moment';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import utils from 'common/utils';
import { DatePicker } from 'antd';
import { observable, computed, action, toJS } from 'mobx';
import { observer } from 'mobx-react';
import styles from './DateRange.scss';
const ... |
import React, { useEffect, useState } from 'react'
import { useHistory, useParams } from 'react-router-dom'
import { CSSTransition } from 'react-transition-group'
import Header from '../../components/Header'
import { getSinderDetailRequest } from '../../api/request'
import SongList from '../../components/SongList'
impo... |
import React from "react";
import MainBody from "./MainBody";
import Services from "./Services";
import Header from "./Header";
import Projects from "./Projects";
const HomePage = () => {
document.title = "Home | Lawrence Thomas ";
return (
<div>
<Header />
<MainBody />
<Services />
<Pr... |
const { formatWithOptions } = require("util");
var member = ["egoing", "k8805", "hansuk"];
for (var i = 0; i < member.length; i++) {
console.log(member[i]);
}
console.log();
var roles = {
programmer: "egoing",
designer: "k8805",
manager: "hoya",
};
for (var name in roles) {
console.log("object => " + name ... |
function getFavColor() {
return ['mistyrose', 'pink']
}
// var colors = getFavColor()
// var favColor = colors[0]
var [favColor, meh] = getFavColor()
console.log(favColor)
function getPerson() {
return {
name: 'codebusters',
number: 15
}
}
// var { name: wdiName } = getPerson()
// console.log(wdiName... |
function onlyTests(testData) {
// keep the tests with `only` flag set to true
// or keep all the tests if no tests have the `only` flag set to true
const executedTestsData = testData.filter((tcData) => tcData.only);
if (executedTestsData.length === 0) {
return testData;
}
return execu... |
$(document).on('turbolinks:load', function () {
$('#product_table').DataTable({
"bAutoWidth": false,
"processing": true,
"info": true,
"stateSave": true,
"serverSide": false,
"ajax": {
"url": "/homepage/get_list_products",
"type": "GET",
"dataSrc":"",
"complete": functi... |
//组件化:就是页面的一部分,把页面的一部分进行组件化写在另一个页面,然后导出,便于维护修改
//引入react和属于react的Compontent函数
import React,{Component,Fragment} from 'react'
import * as actionCreator from'./store/actionCreator.js'
import { connect } from 'react-redux'
import './index.css';
import { Input,Button,Row,Col,List } from 'antd';
//容器组件,只负责业务逻辑和数据的处理
//用构造函... |
jQuery.fn.shake = function(intShakes, intDistance, intDuration) {
this.each(function() {
$(this).css("position","relative");
for (var x=1; x<=intShakes; x++) {
$(this).animate({left:(intDistance*-1)}, (((intDuration/intShakes)/4)))
.animate({left:intDistance}, ((intDurati... |
let factStudents = document.getElementById("fact-students");
let factTeachers = document.getElementById("fact-teachers");
let factActivities = document.getElementById("fact-activities");
let factCourses = document.getElementById("fact-courses");
function count(element, limit) {
let counter = 0;
let i = setInterval(f... |
//document.writelnは、指定された文字列を表示するための命令です。
document.writeln('Hello, World !'); |
// Connect to server
var io = require('socket.io-client'),
config = require('./config.json'),
stats = require('./stats.js'),
ip = '127.0.0.1',
socket = io.connect('http://'+config.host+':'+config.port+'/', {reconnect: true});
// Add a connect listener
socket.on('connect', function() {
// Announce ourselves to ... |
$("add_list").submit(function(event){
alert("inserted successfully");
})
if(window.location.pathname=="/")
{
$ondelete = $(".table tbody td a.del");
$ondelete.click(function()
{
var id = $(this).attr("data-id")
var request ={
"url":`http://localhost:3000/api/list/${id}`,... |
import React, {Component} from 'react';
export default class Add extends Component{
render(){
return(
<div className ="add-button">
<button onClick = {this.props.setAccess}>+</button>
</div>
);
}
}
|
const {delay, parsePrice} = require('.')
module.exports = async ({page, origin, destination, departDate, returnDate, goto}) => {
const departDateString = toISOString(departDate)
const returnDateString = toISOString(returnDate)
await page.setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/5... |
const bcrypt = require('bcrypt');
module.exports = {
/**
* @returns A random number
*/
rng() {
return Math.random().toString(36).substr(2, 6);
},
/**
*
* @param {email} email
* @param {password} pass
* @returns {red} If username or password is empty
* @returns {green} If username and pa... |
var express = require("express");
var router = express.Router();
// Middleware
const calendarAuth = require("../middleware/calendarAuth");
const checkAuth = require("../middleware/check-auth");
// Controller
const calendarController = require('../controller/calendar');
router.get('/googleOath',checkAuth,calendarCont... |
const {deployContracts} = require("../scripts/deploy_contracts");
const {expect} = require('chai');
describe("ERC6786", () => {
let erc721Royalty;
let erc721;
let royaltyDebtRegistry;
const tokenId = 666;
beforeEach(async () => {
const contracts = await deployContracts();
erc721Ro... |
const express = require("express");
const {
createBook,
getAllBooks,
updateBook,
deleteBook,
getBook,
getPublishedBooks,
} = require("../controllers/bookControllers");
const router = express.Router();
router.route("/books").get(getAllBooks).post(createBook);
router.route("/books/:id").patch(up... |
var webpack = require('webpack');
module.exports = {
entry: [
__dirname + '/index.jsx'
],
module: {
loaders: [{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel'
},{
test: /\.less$/,
loaders: ["style", "css", "less"]
}
]
},
resolve: ... |
import React from "react";
import logo from "./logo.svg";
import "./App.css";
import Movie from "./hoc/Movie";
import FunctionalMovie from "./hoc/FunctionalMovie";
import HookUsers from "./hook/HookUsers";
import TodoPage from "./context/TodoPage";
function App() {
return (
<div className="App">
<header classNam... |
import axios from "axios";
const URL = process.env.REACT_APP_BASE_URL;
export default class noteService {
addNote = (data) => {
console.log(data);
return axios.post(
process.env.REACT_APP_BASE_URL + "/notes/addNotes",
data,
{
headers: {
Authorization: localStorage.getItem(... |
function CountAnimals(tur,horse,pigs) {
return (tur*2)+(horse*4)+(pigs*4)
}
console.log(CountAnimals(2,3,5));
console.log(CountAnimals(1,2,3));
console.log(CountAnimals(5,2,8)); |
({
doInit: function (component, event, helper) {
helper.getCart(component, event);
},
nextPage: function (component, event, helper) {
helper.updateCart(component, event);
}
}); |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Utils = undefined;
var _mysql = require('mysql');
var _mysql2 = _interopRequireDefault(_mysql);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const Utils = exports.Utils = {
_m... |
var instru_xC3_xA7_xC3_xB5es_8c =
[
[ "CLASSMANAGER_SERV", "instru_xC3_xA7_xC3_xB5es_8c.html#a5c7b181a46e1bf752e98109ae790381f", null ],
[ "instr_getstatic", "instru_xC3_xA7_xC3_xB5es_8c.html#ad7215ec43e477fd0d714312ff9b2cbc5", null ],
[ "instr_invokeVirtual", "instru_xC3_xA7_xC3_xB5es_8c.html#ac93ee3bf1967... |
$(document).ready(function () {
$(".tab1").click(function () {
$(".notice").show();
$(".gallery").hide();
})
$(".tab2").click(function () {
$(".notice").hide();
$(".gallery").show();
})
$(".notice>p>a").click(function () {
$(".pop").show();
$(".bg").... |
import api from './request';
import path from 'path';
const urls = {
root: 'user',
register: () => path.join(urls.root, 'register'),
login: () => path.join(urls.root, 'login')
};
function register(credentials) {
return api.post(urls.register(), credentials);
}
function login(credentials) {
return api.post(... |
var express = require("express");
var app = express();
var surveyTable = [
{
key: "quickPoll",
position: 1,
name: "Quick Poll",
openDate: new Date(),
closedDate: new Date(),
languages: [
{ value: "Mn", viewValue: "Mandarin" },
{ value: "Fr", viewValue: "French" },
{ value: ... |
/**
* 运费管理
*/
import React, { Component, PureComponent } from 'react';
import {
StyleSheet,
Dimensions,
View,
Text,
Button,
Image,
FlatList,
RefreshControl,
TouchableOpacity,
} from 'react-native';
import Header from '../../components/Header'
import { connect } from 'rn-dva'
... |
const fs = require('fs')
const admin = require('firebase-admin')
const config = require('../firebase.json')
// set up firebase admin connection
admin.initializeApp({
credential: admin.credential.cert(config),
databaseURL: 'https://ruhacksapp.firebaseio.com',
})
const passportConfigFile = './passportConfig.json'
l... |
import React from 'react';
import './style.css';
import {Link} from 'react-router-dom';
const NavBar = ()=>{
return(
<div className="navbars">
<Link to="" className="link">Home</Link>
<Link to="/post" className="nolinks">Post</Link>
<Link to="/signup" className="nolinks... |
import * as Yup from 'yup';
import Student from '../models/Student';
class StudentController {
async store(req, res) {
const schema = Yup.object().shape({
name: Yup.string().required(),
email: Yup.string()
.email()
.required(),
age: Yup.string().required(),
weight: Yup.str... |
import Vue from 'vue'
// 时间格式化
const formatDate = (date, fmt) => {
const newDate = new Date(date)
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (newDate.getFullYear() + '').substr(4 - RegExp.$1.length))
}
const o = {
'M+': newDate.getMonth() + 1,
'd+': newDate.getDate(),
'h+': newDate.get... |
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableContainer from '@material-ui/core/TableContainer';
import TableHead from '@... |
var Vermelho = 'N'
var Verde = 'N'
function setColor(btn) {
var buttom = document.getElementById(btn)
if (btn == "Verde" && Verde == 'N') {
buttom.style.backgroundColor = "green"
buttom.style.color = "white"
Verde = 'S'
} else
if (btn == "Verde" && Verde == 'S') {
... |
/*
* 从url?id=0001取id
*/
function getParameter(){
var str=window.location.search;
var a_id=str.substring(4,8);
if(a_id){
alert(a_id);
}
}
/*
* 取指定参数
*/
function getParameters(name) {
alert("a");
console.log(name);
var param=window.location.search;
var len = param.length;
var start = ... |
/**
* Created by JonIC on 2016-11-09.
*/
url = require('url');
exports.login = function(req, res){
//res.render('index', { title: 'express'});
console.log(req);
// if the man come this app newly then register that man.
// if the man is customer then return non friend, non match, non herself ... |
//약관세션체크
function checkAgree(next_func){
if(jQuery("#accept_agreement").is(":checked") == false) {
alert('개인정보수집에 동의해 주세요.');
return false;
}
var popupWindow = window.open( "", "auth_popup", "left=200, top=100, status=0, width=450, height=550" );
return eval(next_func+"(popupWindow)");
}
// kcb인증창 띄우기
func... |
const ufo = require('../dist/index')
console.log(ufo)
|
require("../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/personal_package/_query_components/answered_questions" ], {
"185e": function(e, n, o) {
o.r(n);
var a = o("f3e7"), t = o.n(a);
for (var c in a) [ "default" ].indexOf(c) < 0 && function(e) {
... |
// jscs:disable jsDoc
module.exports = function () {
return function ttl (Model, instance, callback) {
this.client.ttl(this.createEphemeralKey(Model, instance.getPrimaryKey()), callback || function () {})
}
}
|
const CONST = require('../../../utils/const.js')
const HTTP = require('../../../utils/http.js')
const INTERACTION = require('../../../utils/interaction.js')
const GET_SCHOOL_RECORD = "/campus_deliver/deliver_list?channel=1&format=json"
function getSchoolRecord(suc, fail) {
var url = CONST.SERVER + GET_SCHOOL_R... |
'use strict';
const
{
GULP_DEST_KEY,
GULP_WARN_KEY,
createIgnoreResult,
createPluginError,
createTransform,
filterResult,
hasOwn,
isErrorMessage,
makeNPMLink,
organizeOptions,
resolveFormatter,
resolveWriter,
writeResults,
} = require('#util');
const { promisify } = ... |
import React, { PureComponent } from 'react';
import {
Text,
View,
Image,
TouchableHighlight,
} from 'react-native';
import screen from '../../common/screen'
import ComicStoreBookComponent from './ComicStoreBookComponent'
export default class ComicStoreFreeComponent extends PureComponent{
render()... |
import { connect } from "react-redux";
import ScoretablePageView from "./ScoretablePageView";
import fetchScoretable from "../../actions/scoretable/fetchScoretable";
const mapStateToProps = (state, ownProps) => {
return {
loading: state.scoretable.loading,
scoretable: state.scoretable.results
};
};
const ... |
var app = new Vue({
el: "#app",
data: {
decimal:"",
},
computed:{
binary:{
get: function(){
if (this.decimal !== "") return (this.decimal >>> 0).toString(2);
return "";
},
set: function(newValue){
if(newValue !== ""){
this.decimal = parseInt(newValue,2);
} else {
this.decima... |
console.log('running QUnit from Node');
var qunit = require('./js/lib/qunit').QUnit;
//todo this seems to work but doesn't report anything
qunit.test("a Sample Module", function() {
qunit.ok(true, "this test is fine");
});
qunit.init(); |
import actionTypes from './homeActionTypes';
export function loadTmdbConfig() {
return async (dispatch) => {
let tmdbPosterSizes = [];
let tmdbBackdropSizes = [];
let tmdbSecureBaseUrl = '';
try {
const response = await fetch('/image/config');
const responseData = await respon... |
/*
The Stanton measure of an array is computed as follows: count the number of 1s in the array.
Let this count be n.
The Stanton measure is the number of times that n appears in the array.
Write a function which takes an integer array and returns its Stanton measure.
Example:
The Stanton measure of [1, 4, 3, 2, 1, 2... |
export const toInteger = num => {
num *= 1
if (num != num) return 0
if (num == 0 || !isFinite(num)) return num
return Math.floor(Math.abs(num))
}
export const toLength = val => {
let len = toInteger(val)
return len <= 0
? 0
: Math.min(len, Number.MAX_SAFE_INTEGER)
}
export const getMethod = (ob... |
//action的type即使组件内和reducer内不相同页不会报错,抽取出来重新赋值可以避免这种错误并且促会错会报错容易修改
export const CHANG_ITEM = 'change_item'
export const ADD_ITEM = "add_item"
export const DEL_ITEM = "del_item"
export const DATA_LOAD = "data-load" |
//Library
const express = require('express');
const router = express.Router();
//Builders
const RequestBuilder = require('../builders/RequestBuilder');
//Routes
router.use('/login', require('./login'));
router.use('/articles', require('./articles'));
router.use('/accounts', require('./accounts'));
// router.use('/doc... |
import React from "react";
import {Button, Card, message} from "antd";
const success = () => {
const hide = message.loading('Action in progress..', 0);
// Dismiss manually and asynchronously
setTimeout(hide, 2500);
};
const Loading = () => {
return (
<Card title="Loading" className="gx-card">
... |
import React, { Component, Suspense } from "react"
import $ from "jquery"
import { Control, LocalForm, Errors } from 'react-redux-form';
import { Row, Label, Col, Container, Breadcrumb, BreadcrumbItem, Button, InputGroupText, InputGroupAddon, InputGroup} from 'reactstrap';
import { Link, BrowserRouter as Router, Route... |
import { expect, assert } from 'chai';
import request from 'supertest';
const alphaSortFunction = (a, b) => {
if(a.email < b.email) return -1;
if(a.email > b.email) return 1;
return 0;
};
describe('UserController', function() {
const userPath = '/user';
let myRequest;
before(function(){
global.fixtur... |
export const routes = {
gifSearch: "/",
recipesSearch: "/recipesSearch"
};
|
export const AN_OBJECT = {
something: 'something',
};
export const A_STRING = '';
|
// # Quintus platformer example
//
// [Run the example](../quintus/examples/platformer/index.html)
// WARNING: this game must be run from a non-file:// url
// as it loads a level json file.
//
// This is the example from the website homepage, it consists
// a simple, non-animated platformer with some enemies and a
// t... |
import React from "react";
import Card from "@material-ui/core/Card";
import Button from "@material-ui/core/Button";
import axios from "axios";
import Snackbar from "@material-ui/core/Snackbar";
import MuiAlert from "@material-ui/lab/Alert";
import TextField from "@material-ui/core/TextField";
import Dialog from "@mate... |
/* eslint-disable react-native/no-inline-styles */
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React from 'react';
import {View} from 'react-native';
import {Container, Content, Text} from 'native-base';
import RNColorPalette from './react-native-color-p... |
//Exceution Context
//Global
//function
// const asdasd ={
// }
// function Asdas(){
// console.log(this);
// }
// const x = new Asdas();
console.log('1');
console.log('2');
const timeoputId = setTimeout(() => {
console.log('after 5 sec');
}, 5000);
console.log('3');
setTimeout(() => {
console.log('... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.