text stringlengths 7 3.69M |
|---|
import express from "express";
import MarcaControler from "../controlers/marca.controler.js"
import authControler from "../controlers/auth.controler.js";
const router = express.Router();
router.post("/", authControler.verifyToken, MarcaControler.createMarca);
router.put("/", authControler.verifyToken, MarcaControler.... |
import React, { useContext } from 'react';
import ItemsContext from '../../contexts/ItemContext';
import { Wrapper } from './styles';
const ListItem = React.forwardRef(({ item, index, ...props }, ref) => {
const { title, description } = item;
const { removeFromItems } = useContext(ItemsContext);
return (
<... |
function pageclass() {
if ($(this).width() >= 1400) {
$('.page').addClass('large').removeClass('small');
} else {
//mobile class
//if ($(window).width() <= 400 || (/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))) {
if ($(window).... |
// error event handler
function errorHandler(xhr, status) {
if (status != null) {
alert(status);
} else {
let msg = xhr.responseText;
if (msg){
msg = JSON.parse(msg);
alert(msg.message);
}
}
return false;
};
// ConfigService工具,封装ajax与config后端交互
var ConfigService = {
login: funct... |
var GameLayerManager = (function () {
function GameLayerManager() {
}
var d = __define,c=GameLayerManager;p=c.prototype;
d(GameLayerManager, "instance"
,function () {
if (!GameLayerManager._instance) {
GameLayerManager._instance = new GameLayerManager();
}... |
import React from "react";
const CountrySelect = (props) => {
console.log(props);
return <h1>Country Select</h1>;
};
export default CountrySelect;
|
/**script for change pictures in slider Drifter section**/
sliderDrifter();
function sliderDrifter() {
var $sliderItems = $(".drifter-slider-nav-list");
$sliderItems.on("click", function () {
if (event.target.nodeName === "LI" || "SPAN") {
var elTarget = event.target;
if (el... |
function dotProduct(vectorA, vectorB){
var sum = 0;
for (index = 0; index < vectorA.length; index++){
sum += vectorA[index] * vectorB[index];
}
return sum.toFixed(2);
}
function calculateError(target,actual){
var error = 0;
error = target - actual;
return error.toFixed(2);
}
function adjustWeights(inpu... |
/* eslint-disable react/no-array-index-key */
/* eslint-disable react/prop-types */
/* eslint-disable react/destructuring-assignment */
/* eslint-disable jsx-a11y/no-static-element-interactions */
/* eslint-disable jsx-a11y/click-events-have-key-events */
/* eslint-disable no-underscore-dangle */
/* eslint-disable pref... |
//npm
import React, { useState, useCallback } from 'react';
import { useDispatch } from 'react-redux';
import Button from 'react-bootstrap/Button';
import Form from 'react-bootstrap/Form';
//Module
import authOperations from '../redux/auth/auth-operations';
export default function LoginView() {
const dispatch = useD... |
//
// this file generate some boilerplate IR code from c code
// like truncate, so the language just call functions that are "alwaysinline"
// this will easy things
//
// http://llvm.org/docs/LangRef.html#icmp-instruction
//
// _ession operators
//
var operators = [
{operator: "+", type: "binary", function: "__sum_... |
const COLS = 10;
const ROWS = 20;
const BLOCK_SIZE = 30;
//This is the size in px;
const KEY = {
//This is the code of the keys in the keyboard
LEFT: 37,
RIGHT: 39,
DOWN: 40,
SPACE: 32,
TOP: 38
};
Object.freeze(KEY);
|
function override (target, prop, functionRef) {
const next = target[prop] ?? function () { return undefined }
Reflect.defineProperty(target, prop, {
value () {
return Reflect.apply(functionRef, this, [arguments, next.bind(this)])
},
writable: true
})
}
export default override
|
import {
FETCHING,
SUCCESS,
FAILURE,
ADD_NEW_FRIEND,
DELETE_FRIEND
} from "../actions";
const initialState = {
friends: [],
isFetching: false,
error: null
};
export const friendsReducer = (state = initialState, action) => {
switch (action.type) {
case FETCHING:
return {...state, isFetching... |
import * as React from 'react';
import Avatar from 'material-ui/Avatar';
import Divider from 'material-ui/Divider';
import Badge from 'material-ui/Badge';
import { List, ListItem } from 'material-ui/List';
import { Tabs, Tab } from 'material-ui/Tabs';
import logo_slb from './logo-slb.png';
import logo_png from './logo-... |
$(document).ready(function() {
"use strict";
var av_name = "RegEx2NFAExampleFS";
var av = new JSAV(av_name);
var frames = PIFRAMES.init(av_name);
// Load the config object with interpreter and code created by odsaUtils.js
var config = ODSA.UTILS.loadConfig({av_name: av_name}),
interpret = config.in... |
import React, { Component } from 'react';
import { Table } from 'antd';
import { getCustomerName, formatDate } from '../common/utils';
export default class RateListTable extends Component {
render() {
let { locale, dataSource, pagination, loading, onChange, sorter } = this.props;
const columns = ... |
var http = require('http'),
httpProxy = require('http-proxy'),
args = require('minimist')(process.argv.slice(2));
var proxy = httpProxy.createProxyServer({}),
to = args._[0] || 'http://localhost';
var server = http.createServer(function(req, res) {
var url = req.url,
delay = 0;
if (url) {
to... |
const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
return sequelize.define('DirectoryCountry', {
country_id: {
type: DataTypes.STRING(2),
allowNull: false,
primaryKey: true,
comment: "Country ID in ISO-2"
},
iso2_code: {
type: DataTypes.... |
module.exports = async (req, res, next) => {
try {
await req.ApiPack.serialize();
next();
} catch(e) {
return res.status(500).send({
message: e.toString()
});
}
};
|
const Replay = {
namespaced: true,
state() {
return {
points: [],
timer: null,
status: 'empty',
floor: -10,
ceil: 10,
breakPoint: null
}
},
actions: {
PLAY({ commit, state }) {
if (state.timer ===... |
/**
* Created by m.shaechmetov on 20.05.2014.
*/
(function(){
var app = angular.module("myWebApp",[]);
app.controller("PageController", function(){
this.activeTab = 0;
this.isActive = function(tab){
return this.activeTab === tab;
};
this.setTab ... |
$(document).ready(function() {
$("#tournament-tabs").tabs();
$("#teams").mCustomScrollbar({
scrollButtons: { enable: true },
theme: "dark"
});
$('#create-team').live('click', function() {
window.location = UrlBuilder.buildUrl(false, 'tournaments', 'create');
});
... |
import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
const FormTitle = ({ children, className }) => {
return (
<div className={ classNames('d-block', className) }>
<h3 className='text-primary'>{ children }</h3>
</div>
)
}
FormTitle.propTypes = ... |
/* Libraries */
const commando = require('discord.js-commando');
/* Command */
class PlayingNowCommand extends commando.Command
{
/* Constructor */
constructor(client)
{
super(client,
{
name: 'playingnow', //Name of command
group: 'music', //Command group... |
/*************SHADOW PROGRAM SETUP**************/
function shadowSetup(gl){
//Read shader source
var vertexSource = document.getElementById("vs_shadow").text;
var fragmentSource = document.getElementById("fs_shadow").text;
var shadowProgram = shadersSetup(gl,vertexSource,fragmentSource);
// with the verte... |
noseX = 0;
noseY = 0;
function preload(){
img_clown_nose = loadImage("https://i.postimg.cc/DzGrnqqq/red-nose.png");
}
function setup(){
canvas = createCanvas(500 , 400);
canvas.center();
video = createCapture(VIDEO);
video.size(500 , 400);
video.hide();
poseNet = ml5.poseNet(video ,... |
'use strict';
/**
* @author Thales Pinheiro
* @since 10/07/2011
* @copyright Thales Pinheiro
* @requires assert
* @requires lodash
* @requires key-renamer
* Key-renamer benchmark
*/
const Benchmark = require('benchmark');
const suite = new Benchmark.Suite;
const keyRenamer = require('./bin/key-renamer');
// ... |
import * as actionTypes from '../constants/actionTypes';
const initialState = {
show: false,
refs: []
};
const onlyAddNewRef = (state, newRef) => {
if (state.refs.findIndex(ref => ref.linkHash === newRef.linkHash) >= 0) {
return state;
}
return {
...state,
refs: [...state.refs, newRef]
};
};
... |
const User = require('../models/User')
const mongoose = require('mongoose')
const { sendmail } = require('../utils/mailer')
const crypto = require('crypto')
const jwt = require('jsonwebtoken')
exports.registerUser = async (req,res) => {
try{
console.log("hey")
const user = new User (req.b... |
var mmh3 = require('murmurhash3');
var N = 100000;
console.time('hash');
var i2 = 0;
for (var i = 0; i < N; i++) {
mmh3.murmur32(i + "", function (err, hashbalue) {
i2++;
if (i2 == N)
console.timeEnd('hash');
if (err) throw err;
});
}
//total time: 1.63 s <--- TOO BAD |
import { Navigation } from "react-native-navigation";
import { Platform } from "react-native";
//https://oblador.github.io/react-native-vector-icons/
import Icon from "react-native-vector-icons/Ionicons";
import { name as appName } from "../../app.json";
//REF https://wix.github.io/react-native-navigation/#/screen-api... |
/* 🤖 this file was generated by svg-to-ts*/
export const EOSIconsStar = {
name: 'star',
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>`
};
|
/// Debug
let logToConsole = true;
/// Global variables
let searchEngines = {};
let searchEnginesArray = [];
let selection = "";
let targetUrl = "";
let lastAddressBarKeyword = "";
/// Constants
const DEFAULT_JSON = "defaultSearchEngines.json";
const getFaviconUrl = "https://get-favicons-node.herokuapp.com/icon?url="... |
function getJoke() {
document.getElementById("setup").textContent = "";
document.getElementById("punchline").textContent = "";
event.preventDefault();
const jokeType = document.querySelector('input[name="jokeType"]:checked').value;
console.log("value " + jokeType);
const URL = "https://officia... |
uri = "mongodb+srv://paocs:[email protected]/spoti-fai?retryWrites=true&w=majority"
module.exports = uri; |
import React from 'react'
import {
Col,
Label,
Input,
FormGroup,
FormText
}from 'reactstrap'
const Vprice = ()=>(
<FormGroup row >
<Col xs={2}/>
<Label for="name" xs={2}>库存计算方式</Label>
<Col xs={6}>
<Label xs={4}><Input type="radio" name="limit"/>下单减库存</Label>... |
module.exports = function (config) {
var bowerComponentsPath = 'vendor/assets/javascripts/bower_components/',
appJsPath = 'app/assets/javascripts/';
config.set({
basePath: '',
frameworks: ['browserify', 'mocha'],
files: [
'https://cdn.socket.io/socket.io-1... |
define([
'apps/system3/office/office',
'apps/system3/office/car/car.service'], function (app) {
app.module.controller("office.controller.car.maintain", function ($scope, $sce, $stateParams, $uibModal, $timeout, carService) {
$scope.showAllCar();
$scope.$watch("currentCar", fu... |
// 服务端的 router.js
app.get('/loadMore', function(req, res) {
var curIdx = req.query.index
var len = req.query.length
var data = []
for (var i = 0; i < len; i++) {
data.push('news' + (parseInt(curIdx) + i))
}
setTimeout(
function() {
res.send(data)
}, 2000
... |
$(document).ready(function() {
var second = 0;
$.ajax({
url: "http://localhost:8000/text1.txt",
cache: false
})
.done(function( html ) {
$( "#text" ).append( html );
});
$("#newText").click(function(){
$.ajax({
url: "http://localhost:8000/text2.txt",
cache: false
})
.done(function( html ) {... |
import React from 'react';
import classes from './Footer.module.scss';
const footer = () => {
const year = new Date().getFullYear();
return (
<footer>
<div className={classes.Footer}>
<p>© {year}, This app was built with React by Michael Owens(<a href="https://www.mowenste... |
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter as Router, Link, Route } from 'react-router-dom';
import './index.css';
import demo from './routes/demo';
import home from './routes/home';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(
<Router>
<div>
... |
var thumb94="TkSWZ9/CYkrrc5VP0dIfEmWzpWcz3FP6jmPx9rlbjigAvDzIbgJzza2DuUGJO6ELfhjc1KFIUqlRn/gKsUwjzdDI+u7b9DM4XSUJjXksWz75BgmIezs7U8NrvrjAeZM3aoDLh2QaGueSvvnvKy60DtVP2IpMfLmGxy4QsspuS15GGUmskpI2nEIkTzKIrx5FfQLgvR05DCeSipF0IRMtlJhxv1Y23hRERL6tT8xld0ZQVa/d6rc/T05mNT/a1jEHPCBUwoeuVqk9bZh5UqOS1tY9fL/ItP3U//jKqt7/mh0II7ZUWp... |
import React from "react";
import { Card } from "react-bootstrap";
const styles = {
width: "18rem",
margin: 0,
float: "left",
minHeight: "550px"
}
function ProgressCard(props) {
return (
<Card style={styles}>
<Card.Body>
<Card.Title>Day {props.id}</Card.Title>
... |
import React from 'react';
import PropTypes from 'prop-types';
import { TouchableWithoutFeedback, View } from 'react-native';
import NativeIcon from 'react-native-vector-icons/Feather';
export function Icon(props) {
const { color, ...otherProps } = props;
return <NativeIcon color={String(color)} {...otherProps} /... |
function newCustomers(start, end) {
// переменные startDate и endDate для сервлета
var data = {
startDate: start.format('MM/DD/YYYY'),
endDate: end.format('MM/DD/YYYY')
};
// посылаем ajax запрос, получаем массив обьектов для графика
$.ajax({
... |
console.log("AI loaded");
const MAX_DEPTH = 5;
function getWinProbability(state, player, depth = 0) {
if (depth >= MAX_DEPTH) {
return 0.5;
}
let maybeWin = checkWin(state);
if (maybeWin == 1) {
return 1 == player ? 1 : 0;
} else if (maybeWin == 2) {
return 2 == player ? 1 : 0;
}
let emptyId... |
/**
* call express middleware
*/
app.service('RiotApi',function($http){
this.id = null;
this.setChampDetailId = function(input){
this.id = input;
};
this.getChampDetailId = function(){
return this.id;
};
/**
* general url to get static data
* by specifying the genre pa... |
import { Component } from "react";
import Productos from "./components/Productos";
import Layout from "./components/Layout";
import { Title } from "./components/Title";
import { NavBar } from "./components/NavBar";
class App extends Component {
state = {
productos: [
{ name: "tomate", price: 1500, img: "/p... |
import styled from 'styled-components';
export const HeaderStyles = styled.header`
padding: 0.5rem 0;
border-bottom: 0.25rem solid rgba(0, 0, 0, 0.1);
background: ${props => props.theme.light};
.container {
display: flex;
align-items: center;
justify-content: space-between;
}
.logo {
font... |
import Vue from 'vue';
const Layout = Vue.extend({
provide() {
return {
Layout: {
alignment: 0,
bottomMargin: 0,
column: 0,
columnSpan: 0,
fillHeight: false,
fillWidth: false,
leftMargin: 0,
margins: 0,
maximumHeight: 0,
maximu... |
import React from "react";
import { Route, Redirect, Switch } from "react-router-dom";
import MobileMenu from "./mobile-menu/MobileMenu";
import Dashboard from "./dashboard/Dashboard";
import MissionComplete from "./mission-complete/MissionComplete";
import Gauge from "../../components/molecules/gauge/Gauge";
import P... |
const url = "https://striveschool-api.herokuapp.com/api/product/";
const fetchProducts = async () => {
try {
let response = await fetch(url, {
headers: {
Authorization:
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MDUxZTIxMjg5YzI2ZjAwMTU3ZjljMjIiLCJpYXQiOjE2MTU5OTE2OTEsImV4cCI... |
import clsx from 'clsx';
import React from 'react';
import styles from './_barter-option.module.scss';
const BarterOption = ({ title, img, onClick, active = false, imgActive, tabIndex, setActiveTab }) => {
const handleClick = () => {
setActiveTab(tabIndex);
};
return (
<div className={clsx({ [... |
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator,CardStyleInterpolators} from '@react-navigation/stack';
import firebase from 'firebase';
import MemoListScreen from './src/screens/MemoListScreen';
import MemoDetailScreen from './src/screens/MemoDe... |
import { GET, POST } from "./API";
export const getReceipt = ({ id }) => GET('GET_RECEIPT', 'GetReceipt/', { trxId: id });
export const bindReceipt = id => POST('BIND_RECEIPT', 'BindCustomerToReceipt/', { CustomerToken: localStorage.getItem(process.env.REACT_APP_TOKEN_KEY), TrxId: id});
export const receiptReduce... |
function validarDatos() {
var nombre = document.getElementById("txtNombre").value;
if (nombre.trim() == "") {
alert("El nombre no debe estar vacio");
return;
} else if (nombre.length < 3 ) {
alert("El nombre debe contener al menos 3 caracteres");
return;
}
v... |
import { connect } from 'react-redux';
import { getAllAlbums } from '../Actions/actions';
import Albums from '../Components/Albums'
const mapStateToProps = state => {
return {
albumsObj: state.albums.albumsObj
}
};
const mapDispatchToProps = dispatch => {
return {
requestAllAlbums: function() {
di... |
import Model from 'kredits-web/models/contribution';
import contributors from '../../tests/fixtures/contributors';
import processContributionData from 'kredits-web/utils/process-contribution-data';
const items = [];
const data = [
{ id: 1, contributorId: 1, confirmedAt: 1000, claimed: false, vetoed: false, amount: ... |
// ###################################################################
gulp.task('clean', ['clean:build', 'clean:dist']);
gulp.task('clean:build', function(callback) {
del(DIR.build, {force: true}, callback);
});
gulp.task('clean:dist', function(callback) {
del(DIR.dist, {force: true}, callback);
});
gulp.t... |
/*
* Parses user and browser info from HTTP headers into discrete fields
*/
'use strict';
const async = require('async');
const ConfiguredAction = require('../../lib/configured_action');
const exceptions = require('../../lib/exceptions');
const log = require('../../lib/logger');
const requestHeaderParser = require... |
import React from 'react';
import firebase from 'firebase';
import { Text, View, ScrollView } from 'react-native';
import { config } from '../config/firebase';
import styles from './styles';
import { app, db } from '../config/firebase';
import FridgeList from './FridgeList';
class Fridge extends React.Component {
c... |
/*!
* SAP UI development toolkit for HTML5 (SAPUI5/OpenUI5)
* (c) Copyright 2009-2015 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
sap.ui.define(['jquery.sap.global','./ViewSettingsItem','./library'],function(q,V,l){"use strict";var a=V.extend("sap.m.Vie... |
import React from 'react';
export default function Footer () {
return (
<div>
<h7>Coppyright 2019 Ifeoma Okah</h7>
</div>
)
}
|
'use strict';
angular.module('vegewroApp')
.factory('fbUseWorker', [function() {
return {
fetchLastPosts : function(fbFeeds, token, postsNoOlderThan, deferred) {
$.Hive.create({
worker: 'workers/1.fbFetchPostsWorker.min.js',
created: function() {
... |
import React, { Component } from 'react';
import {
View,
StyleSheet,
} from 'react-native';
import propTypes from 'prop-types';
import moment from 'moment-timezone';
import * as _ from 'lodash';
import MoisCardList from './moisCardList';
class MoisCard extends Component {
constructor(props) {
super(props);
... |
Ext.define('App.controller.PageController', {
extend: 'Ext.app.Controller',
nextPageCmp:null,
goPage: function( data ) {
switch(data.nextPage) {
case 0:
this.nextPageCmp = Ext.getCmp('StartPage');
break;
case 1:
this.nextPage... |
import { v4 as uuidv4 } from "uuid";
// import { createValidator } from "express-joi-validation";
// import { Joi } from "joi"
let users = [];
// const querySchema = Joi.object({
// query: Joi.string().required()
// })
export const getUsers = (req, res) => {
users = users.filter((user) => !user.isDeleted);
... |
// Import dependencies
const express = require('express');
const fetch = require('node-fetch');
const mongoose = require('mongoose');
// const jwt = require('jsonwebtoken');
const app = express();
mongoose.connect('mongodb://localhost:27017/bookshelf', { useNewUrlParser: true });
// Import local files
const Book = re... |
/*****************************************************************
** Author: Asvin Goel, [email protected]
**
** A plugin for reveal.js adding a chalkboard.
**
** Version: 2.1.0
**
** License: MIT license (see LICENSE.md)
**
** Credits:
** Chalkboard effect by Mohamed Moustafa https://github.com/mmoustafa/... |
import React, {Component} from "react";
import {
View,
Text,
TouchableOpacity,
} from "react-native";
import * as CommonStyle from '../styles/Common';
export default class MessageDialogBox extends Component {
constructor(props) {
super(props);
this.onPressOk = this.onPressOk.bind(... |
/*
Istruzioni:
Create una todo list usando VueJS.
Potete dare sfogo alla creativitá e per quanto riguarda l'HTML e il CSS.
Se non sapere che fare, di seguito trovate uno screenshot.
Funzionalitá:
La nostra todo list avrá alcune tasks di default predefinite
L'utente puó inserire nuove tasks
Cliccando sulla "X" l'utente ... |
/*
* ProGade API
* http://api.progade.de/
*
* Copyright 2012, Hans-Peter Wandura (ProGade)
* You can find the Licenses, Terms and Conditions under: http://api.progade.de/api_terms.php
*
* Last changes of this file: Aug 21 2012
*/
function classPG_Wysiwyg()
{
// Declarations...
this.sColorPickerRichEditCom... |
var express = require('express');
var Goods = require('../models/goods');
var router = express.Router();
router.get('/', function (req, res) {
Goods.find({}, function (err, goods) {
res.json({
success: true,
data: goods
})
})
})
router.post('/', function (req, res, nex... |
import React, {Component} from 'react'
import {StyleSheet, Text, View} from 'react-native'
var ToastAndroid = require('../ToastAndroid');
class HelloRND extends Component {
constructor(props) {
super(props);
this.state = {};
}
componentDidMount() {
/*接收传递过来的参数*/
this.setSt... |
import React, { useEffect, useState } from 'react';
import { useDispatch, useSelector } from "react-redux";
import { boardActions } from "../../slices/boardSlice";
import { codeActions } from "../../slices/codeSlice";
import "./css/CreateBoard.css";
function CreateBoard({setShowCreateBoard}) {
// setShowCreateBoar... |
/**
* Voice connection guide here:
https://discord.js.org/#/docs/main/stable/topics/voice
*/
const auth = require('./auth.json')
const Discord = require('discord.js')
const ytdl = require('ytdl-core')
const bot = new Discord.Client()
/**
* Ready event tells your bot to start reacting to
information.
*/
bot.on('re... |
'use strict';
const Hero = require('../../../models/hero');
// Get all Heroes
exports.getHeroes = (req, res) => {
Hero.find({}).exec((err, heroes) => {
if(err) {
return res.status(500).send({message: err.message});
}
return res.status(200).send(heroes);
});
};
// Get One ... |
import React from 'react';
import { Link } from "react-router-dom";
function Navitem(props) {
return (
<div>
<div>
{
<ul>
<li style={{paddingTop: "5rem"}} className="navbar_li">
<Link className="navbar_link" t... |
var condition_id = "";
var ShowUserConInfo = "";
function loadData(conditionID) {
if (conditionID != null && conditionID != "") {
Ext.Ajax.request({
url: '/PromotionsUser/UserConInfo',
method: 'post',
params: {
condition_id: conditionID
},
... |
const ResetPasswordController = function (AuthService, $stateParams, $timeout, $state) {
const ctrl = this;
ctrl.submitted = false;
ctrl.mail = "";
ctrl.validation = {
validCode: false,
}
ctrl.feedback = {
message: "",
showing: false,
type: "error"
};
const setValidation = (valid) => {
$timeout(() =>... |
import Ember from 'ember';
var urlSegment = Ember.Object.extend({
segment: undefined,
segmentName: undefined,
isDynamic: Ember.computed('content', function(){
if(this.get('segment').charAt(0)==="{") {
return true;
}else {
return false;
}
}),
reset: function(){
if (this.get('isDy... |
import React from 'react';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import style from './Router.module.css';
import DefaultLayout from '../DefaultLayout/DefaultLayout';
export default function RouterComponent() {
return (
<Router>
<DefaultLayout />
</Router>
);
}
|
import React, { Component} from 'react';
class CompletedEvent extends Component{
handleCheckEvent=(eventInfo,currentCard)=>{
console.log(eventInfo.status)
console.log(currentCard)
eventInfo.status = !eventInfo.status
this.props.onUpdateLastEventDay(eventInfo,currentCard)
}
handleDeleteEven... |
import { API_BASEURL, API_KEY } from '../../config';
/**
* Creates a URL to the API.
*
* @param {string} path - API resource, including a `/` prefix.
* @returns {string} - API url
*/
const createApiUrl = path => `${API_BASEURL}${path}?api_key=${API_KEY}`;
export default createApiUrl;
|
angular.module('wubApp', ['ui.bootstrap', 'uiGmapgoogle-maps', 'wubServices'])
.config(function(uiGmapGoogleMapApiProvider) {
uiGmapGoogleMapApiProvider.configure({
// key: 'your api key',
v: '3.17',
libraries: 'weather,geometry,visualization'
})
})
.controller('LocationController', functio... |
/**
* Created by dfitzgerald on 9/10/15.
*/
var addContactFromShareJbox = new jBox('Tooltip', {
onOpen: function(){
this.options.ajax.url = '/viewer/contact/new_contact_from_share/';
},
ajax: {
reload: true
},
attach: $('#add_contact'),
trigger: 'click',
closeOnClick: 'bod... |
// import head from './head.js'
const Add = (num) => {
return num + 1// head(num)
}
export default Add |
import Link from 'next/link';
import React from 'react';
import { services_data } from '../../../data';
const services_items = services_data.filter(ser => ser.service_p);
const ServiceArea = () => {
return (
<>
<div className="tp-service-area pt-110 pb-130">
<div className="container">
<... |
$(function() {
// Show top-menu on phone screen
$('.header__menu-button').on('click', function(){
var e = $('.header__nav');
if ( e.is(':hidden') ) {
e.slideDown();
} else {
e.slideUp();
}
});
// Show submenu
$('.first-level-link').on('click', function(){
$(this).toggleClass('active-color-accent')... |
'use strict';
/**
* @ngdoc function
* @name ossuClientApp.controller:MainCtrl
* @description
* # MainCtrl
* Controller of the ossuClientApp
*/
angular.module('ossuClientApp')
.controller('MainCtrl', function (localStorageService, $uibModal) {
function checkLocalStorage(key) {
return localStorageServ... |
var Motor = require('./motor');
var Pumps = function () {
this._specialNames = [];
for (var n in this) {
if (this.hasOwnProperty(n)) {
this._specialNames.push(n);
}
}
};
Pumps.prototype = {
_isSetup : true,
_pumps : {},
_pumpsArry: [],
setup : function (o... |
describe('pixi/loaders/SpineLoader', function () {
'use strict';
var expect = chai.expect;
var SpineLoader = PIXI.SpineLoader;
it('Module exists', function () {
expect(SpineLoader).to.be.a('function');
});
});
|
const UI = {
picture: document.querySelector(".picture"),
newPictureButton: document.querySelector("#newPictureButton"),
autoplayButton: document.querySelector("#autoplayButton")
}
let pictureData;
let autoplayInterval;
UI.newPictureButton.addEventListener("click", () => {
fetchPicture();
})
UI.autop... |
require('chai').should();
const KtotamBot = require('..');
const bot = new KtotamBot({
message: 'Кто там?'
});
describe('ktotam-bot', () => {
it('greeting', async () => {
bot.on('message', (data) => {
data.should.deep.equal({
client: 'userId',
text: 'Кто там?'
});
});
bot.... |
const express = require('express')
const authCheck = require('../config/auth-check')
const Comment = require('../models/Comment');
const User = require('../models/User');
const Reply = require('../models/Reply');
const router = new express.Router()
function validateReplyCreateForm(payload) {
const errors... |
menuApp.controller('MainController', ['$scope', function($scope) {
$scope.today = new Date();
$scope.appetizers = [{
name: 'Caprese',
description: 'Mozzarella, tomatoes, basil, balsmaic glaze.',
price: 4.95
}, {
name: 'Mozzarella Sticks',
description: 'Served with ma... |
let gulp = require('gulp');
let server = require('gulp-webserver');
let fs = require('fs');
let path = require('path');
let url = require('url');
let scss = require('gulp-sass');
let autoprefixer = require('gulp-autoprefixer');
let mock = require('./mock');
//起服务
gulp.task('server', function() {
return gulp.src('sr... |
var bid = 222; //
var i = 2;
var win;
var errorMsg;
Ext.Loader.setConfig({ enabled: true });
Ext.Loader.setPath('Ext.ux', '/Scripts/Ext4.0/ux');
Ext.require([
'Ext.form.Panel',
'Ext.ux.form.MultiSelect',
'Ext.ux.form.ItemSelector'
]);
Ext.define('gigade.Image', {
extend: 'Ext.data.Model',
fields... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.