text stringlengths 7 3.69M |
|---|
Meteor.startup(function() {
Meteor.users.remove({});
Accounts.createUser({
username: "scotchio",
email: "scotch@example.com",
password: "dummypassword"
});
Channels.remove({});
Channels.insert({
name: "general"
});
Channels.insert({
name: "random"
});
}); |
$(document).ready(function() {
//get List Menu Top
function getMenu(param) {
$.get( "dynamic_content/getMenu/"+param+"")
.done(function( data ) {
$('.menu ul').html(data);
});
}
});
|
//jshint esversion:6
const express=require('express');
const app=express();
const PORT=3000;
const words=require('./words.js');
const gameWeb=require('./gamepage.js');
const currentUser=[];
app.use(express.static("./public"));
app.get('/',(req,res)=>{
res.send(gameWeb.gamePage(words));
});
app.post('/game',expre... |
import React, { Component } from 'react';
import { Grid, Row, Col } from 'react-bootstrap';
import classes from "./UnderHeaderImage.less";
class UnderHeaderImage extends Component {
render() {
const backgroundImage = `url(http://s.lpmcdn.com/lpfile/c/a/8/ca8b1ad297a6f9c148052ea1c10053e8.jpeg)`;
return (
<d... |
import React from 'react';
const List = (props) => {
const { repos } = props;
if (!repos || repos.length === 0) return <p>No data, sorry</p>;
return (
<ul>
<h2 className='list-head'>Vesper.fi Historical Data</h2>
{repos.map((repo) => {
return (
<li key={repo.chainId} className='l... |
import React from "react";
import { connect } from "mqtt";
export default class mqtt extends React.Component {
constructor(props) {
super(props);
this.state = {
mqtt: connect(this.props.url, this.props.options ? this.props.options : null)
};
}
componentDidMount() {
... |
// pages/login/login.js
const util = require('../../utils/util.js')
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
angle: 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
wx.onAccelerometerChange(res => {
... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = createSearchPaginationResolver;
var _graphqlCompose = require("graphql-compose");
var _utils = require("../utils");
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]... |
"use strict";
/// <reference path="../../scene/ComponentConfig.d.ts" />
Object.defineProperty(exports, "__esModule", { value: true });
const BehaviorConfig_1 = require("./BehaviorConfig");
SupCore.system.registerPlugin("componentConfigs", "Behavior", BehaviorConfig_1.default);
|
var path = require('path')
var xmlbuilder = require('xmlbuilder')
var trans = require('./lib/Translate')
var style = require('./lib/style')
var parameter = require('./lib/Parameters')
var uti=require('./lib/uti')
var srs_mector = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 \
+x_0=0.0 +y_0=0.0 +k... |
function saturdayFun(act="roller-skate") {
return `This Saturday, I want to ${act}!`
}
function mondayWork(act="go to the office") {
return `This Monday, I will ${act}.`
}
function wrapAdjective(s="*") {
return function(x="special") {
return `You are ${s}${x}${s}!`
}
}
let encouragingPromptFu... |
var colors = require('colors');
var https = require('https')
var sys = require('sys');
function pad(str, len, withWhat) {
str = '' + str;
len = len || 2;
withWhat = withWhat || '0'
while (str.length < len) str = withWhat + str;
return str;
}
function getDate() {
var now = new Date();
return now.getFullY... |
$(appReady);
// let BASE_URL;
//
// (function getBaseURL() {
// if (window.location.hostname == "localhost") {
// BASE_URL = `http://localhost:3000/api/v1/books/`
// } else {
// BASE_URL = `https://mtb-greads.herokuapp.com/api/v1/books/createBooks`;
// }
// })();
function appReady(){
submitBookForm()... |
const { merge, sortByKey } = require('./util')
module.exports = {
requireFile (filename) {
try {
return require(filename)
} catch (error) {
return {}
}
},
requireJSON (filename) {
return JSON.parse(JSON.stringify(this.requireFile(filename)))
},
loadPackage (name, generator) {
... |
import { createActions } from 'redux-actions';
const actionTypes = {
SET_NAV: 'SET_NAV'
};
const { setNav } = createActions({ [actionTypes.SET_NAV]: payload => payload });
export { actionTypes, setNav };
|
(function(angular) {
angular.module('nameApp').controller('languageController', ['$scope', 'languageService', languageController]);
function languageController($scope, languageService) {
(function init() {
$scope.changeLanguage = changeLanguage;
})();
function changeLanguage(language) {
languageSer... |
'use strict';
angular.module('scrumbo.sprintboard', ['ngRoute'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/sprintboard/:sprintId', {
templateUrl: 'sprintboard/sprintboard.html',
controller: 'SprintboardCtrl'
});
}])
.controller('SprintboardCtrl', ['$rootScope', '$scope',... |
import {combineReducers} from 'redux';
import {GET_EGRESOS_SUCCESS, SAVE_EGRESO_SUCCESS, EDIT_EGRESO_SUCCESS, DELETE_EGRESO_SUCCESS, GET_EGRESOS_DATA_SUCCESS} from "../../actions/administracion/egresosActions";
function list(state=[], action){
switch(action.type){
case GET_EGRESOS_SUCCESS:
re... |
import React, {Component} from 'react'
class IndividualPreviousProduct extends Component {
constructor() {
super()
this.state = {}
this.handleChange = this.handleChange.bind(this)
}
componentDidMount() {
if(this.props.item.status === 'Invalid') {
this.setState({
... |
import axios from 'axios';
import apiKeys from '../apiKeys.json';
const baseUrl = apiKeys.firebaseKeys.databaseURL;
const getEventStaffByEventId = (eventId) => new Promise((resolve, reject) => {
axios.get(`${baseUrl}/eventStaff.json?orderBy="eventId"&equalTo="${eventId}"`)
.then((response) => {
const even... |
//var -> supports only function scoping non fixed variables
//let -> block , function scoping for non fixed variables
//const -> block , function scoping but for fixed variables
// var vs let with if condition
let course = 'Engineering';
if(course === 'Engineering'){
let dept1 = 'Software';
var dept2 = 'govt';... |
let arr = [1,20,15,17,12,7,25,14,13,19,30,16];
console.log(arr);
for(let i = 1; i < arr.length; i++){
let j = i;
let cur = arr[i];
while(j > 0 && arr[j-1] > cur){
arr[j] = arr[j-1];
j--;
}
arr[j] = cur;
}
console.log(arr);
|
function doFirst() {
// pic.addEventListener("dragstart", dragStart, false);
// pic.addEventListener("dragend", dragEnd, false);
cvs = document.getElementById('box');
cvs.addEventListener("dragenter", dragEnter, false);
cvs.addEventListener("dragleave", dragLeave, false);
tshirt = document.getElementById("tshirt... |
import React from 'react';
import { describe, add } from '@sparkpost/libby-react';
import { ComboBox, ComboBoxTextField, ComboBoxMenu, Box } from '@sparkpost/matchbox';
import Downshift from 'downshift';
// This is an example of a multi select downshift typeahead
// A few things are missing from this example:
// - fil... |
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';
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/c... |
var tape = require('tape')
var pull = require('pull-stream')
var Pushable = require('pull-pushable')
var mux = require('../')
module.exports = function(serializer) {
var client = {
hello : 'async',
goodbye: 'async',
stuff : 'source',
bstuff : 'source',
things : 'sink',
suchstreamwow: 'duple... |
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import Detail from './Detail';
const Section = styled.section`
display: grid;
grid-template-columns: repeat(6, 240px);
grid-gap: 40px 0px;
`;
function Board({ children, detail, isDetail, resetDetail, handleMo... |
"use strict";
/* eslint-env node, mocha */
var helloHandler = require("../myService/handler");
var assert = require("assert");
describe("Sample Tests", function() {
describe("Greetings", function() {
it("I greet the Yow West audience", function() {
helloHandler.hello({}, {}, (_, response)=>{
assert.... |
require("dotenv").config();
const fs = require("fs");
const path = require("path");
const fetch = require("node-fetch");
const request = require("request");
const PDFDocument = require("pdfkit");
const Product = require("../models/product");
const Order = require("../models/order");
exports.getProducts = (req, res, n... |
/*!build time : 2014-09-16 2:10:53 PM*/
KISSY.config("modules",{"kg/xscroll/1.1.8/plugin/scrollbar":{requires:["node","base","anim","kg/xscroll/1.1.8/util"]}}); |
const generateGuid = () => {
var timeinMs = new Date().getTime();
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (char) => {
var r = (timeinMs + Math.random() * 16) % 16 | 0;
timeinMs = Math.floor(timeinMs / 16);
return (char == "x" ? r : (r & 0x3) | 0x8).toString(16);
});
return... |
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import { createDrawerNavigator } from '@react-navigation/drawer';
import auth fr... |
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import $ from 'superagent';
import superagentJsonapify from 'superagent-jsonapify';
superagentJsonapify($);
// import util from '../../lib/util.js';
import './index.less';
class LoginBar extends React.Componen... |
var x = 2;
var y = 4;
var add = x + y;
var sub = x - y;
var mult = x * y;
var dvd = x / y;
var pow = Math.pow(x, y);
var sqrt = Math.sqrt(y);
console.log(add, sub, mult, dvd, pow, sqrt);
|
/*
* Copyright (C) 2021 Radix IoT LLC. All rights reserved.
*/
const comparatorPredicates = {
eq: val => val === 0,
ne: val => val !== 0,
le: val => val <= 0,
ge: val => val >= 0,
lt: val => val < 0,
gt: val => val > 0
};
const tokenSubstitutes = {
'\\\\': `\\\\`,
'\\*': '\\*',
'... |
export default{
regions:[
'Africa', 'Americas', 'Asia', 'Europe', 'Oceania'
],
flags: [],
details: []
} |
"use strict";
exports.DataGridViewProps = void 0;
var DataGridViewProps = {};
exports.DataGridViewProps = DataGridViewProps; |
import React from 'react';
import {
View,
Text,
ListView,
ScrollView,
Alert,
} from 'react-native';
import { PView } from 'rnplus';
import {
COLOR_LIST_BORDER,
STYLE_ALL,
STYLE_SCROLL_VIEW,
} from '../../common/styles.js';
import NavBar from '../../common/NavBar';
class WebX extends PView {
routerPl... |
'use strict';
import 'react-native';
import React from 'react';
import Text from '../Text';
import renderer from 'react-test-renderer';
jest.setTimeout(15000);
test('renders correctly', () => {
const tree = renderer.create(<Text size="sm" weight="bold" color="primary">hello</Text>).toJSON();
expect(tree).toMa... |
module.exports = [
{
"name": "[PETSOLICITOR]",
"label": "Petitioner's Solicitor",
"description": "Petitioner's Solicitor",
"category": "PROFESSIONAL",
"type": "CASE",
"substantive": true,
"patterns": [
{
"roleType": {
... |
import axios from "axios";
export default {
// Gets all books
getDishes: function() {
return axios.get("/api/dish");
},
// Gets the book with the given id
getDish: function(id) {
return axios.get("/api/dish/" + id);
},
getProfileDish: function(name) {
return axios.get("/api/dish/" + name)
}... |
define(['frame'], function(ngApp) {
'use strict';
ngApp.provider.controller('ctrlNotice', ['$scope', 'http2', 'srvTmplmsgNotice', function($scope, http2, srvTmplmsgNotice) {
var oBatchPage, aBatches;
$scope.tmsTableWrapReady = 'N';
$scope.oBatchPage = oBatchPage = {};
$scope.batc... |
import {
AUTHENTICATE,
LOGOUT,
VERIFY_TOKEN,
} from '@/web-client/actions/constants';
import {
cond,
constant,
isPlainObject,
negate,
stubTrue,
flow,
get,
isString,
identity
} from 'lodash/fp';
const initialState = null;
const tokenProcessor =
flow([
cond([... |
// debugger;
const $util = require('util');
const $NodeClass = require('./node_1');
// debugger;
const $methodList = require('./methods_1b');
const $tagNameSolutionList = require('./method_2');
const $Tools = require('./tools');
// 主要在分離出所有的 tag
class FindTags {
constructor() {
this.nodeList... |
/**
* @author 王集鹄(wangjihu,http://weibo.com/zswang)
*/
AceCore.addModule("Manager", function(sandbox){
/**
* 事件集合
*/
var events = sandbox.getConfig("Events");
/**
* 类库
*/
var lib = sandbox.getLib();
/**
* 聊天室api
*/
var chatApi = sandbox.getExtension... |
(function() {
'use strict'
angular
.module('checkIn', [
'ui.router',
'customer',
'keypad'
])
})() |
fetch("http://localhost:3000/ships")
.then(response => response.json())
.then(ships => shipList(ships))
function shipList(ships) {
const list = document.querySelector(".list-ships");
list.innerHTML = "";
ships.forEach(ship => {
const item = document.createElement("li");
item.innerText = ship.name;
... |
import React from 'react';
import { View, StyleSheet, AsyncStorage } from 'react-native';
import { Notifications, Permissions } from 'expo';
const NOTIFICATION_KEY = 'UdaciCards:notifications';
// Push Notification
export function clearLocalNotification() {
return AsyncStorage.removeItem(NOTIFICATION_KEY).then(
... |
/**
* @Summary: short description for the file
* @Date: 2020/3/19 12:29 PM
* @Author: Youth
*/
const {createProxyMiddleware} = require('http-proxy-middleware')
module.exports = function (app) {
app.use('/g2',createProxyMiddleware(
{
"target": "https://view.inews.qq.com",
"changeOrigin": true
... |
'use strict';
describe('Loading Test Chrome Extension (integration)', function () {
var url = 'https://localhost:12222';
// Dummy variables so that functions can be passed to browser window
var window;
var login = function() {
return browser.executeScript(function() {
window.click('.login_button');
});
... |
var bunyan = require('bunyan');
var log = bunyan.createLogger({name: "node-socketio-chat"});
var express = require('express');
var app = express();
var server = require('http').createServer(app);
var io = require('socket.io')(server);
var port = 3000;
if(process.argv[2] === undefined) {
// do nothing
} else {
... |
$(function () {
$("#userName").on("keyup", function () {
if($(this).val().length <= 0){
$(this).attr("placeholder", "请输入手机号");
$(this).siblings("i").addClass("hide");
} else {
$(this).siblings("i").removeClass("hide").on("click", function () {
$("#... |
import { toRomNum } from "./roman-numerals";
describe("Converting Between Numbers and Roman Numerals", () => {
describe("Converting Num to RomNum", () => {
describe("Simple Numbers", () => {
it("Should return Is for each number <4", () => {
expect(toRomNum(1)).toBe("I");
expect(toRomNum(2))... |
test('des07', () => {
const alphabetGrec = [
'α',
'β',
'γ',
'δ',
'ε'
]
const [alpha, beta] = alphabetGrec
const rest = [alphabetGrec[2], alphabetGrec[3], alphabetGrec[4]]
console.log(rest)
}); |
import React from 'react'
import { Link } from 'react-router-dom'
import PosmeLogo from './images/PosmeLogo.png'
import './login.css'
import TextField from '@material-ui/core/TextField'
import Grid from "@material-ui/core/Grid"
import Home from '../../pages/Home'
const Login = props => {
return (
<>
... |
'use strict';
require('mocha');
var assert = require('assert');
var Base = require('templates');
var toc = require('./');
var app;
describe('verb-toc', function() {
beforeEach(function() {
app = new Base();
app.use(toc);
app.create('pages');
app.create('layouts', {viewType: 'layout'});
app.engin... |
// This is a small program. There are only two sections. This first section is what runs
// as soon as the page loads and is where you should call your functions.
$(document).ready(function(){
const $display = $('#display');
// TODO: Call your apply function(s) here
applyFilterNoBackground(reddify);
applyFilte... |
// import openSocket from 'socket.io-client';
import io from 'socket.io-client'
import { loadState, saveState } from 'trading_app/lib/utils/localStorage'
class WebSocketService {
constructor() {
const agentAddress = loadState('REKCLE::IP') || '127.0.0.1'
saveState('REKCLE::IP', agentAddress)
this.socket... |
import { connect } from "react-redux";
import Projects from "./Projects";
import actions from "../../redux/actions";
const mapStateToProps = state => ({
...state.projectsParams
});
export default connect(
mapStateToProps,
actions
)(Projects);
|
class Librarian {
constructor(name, library) {
this.name = name;
this.library = library;
}
greetPatron(name, morning = false){
if (morning == true){
return `Good morning, ${name}!`
} else{
return `Hello, ${name}!`
}
}
findBook(bookName){
var fantasyBooks = this.library.s... |
canvas=document.getElementById("myCanvas");
ctx=canvas.getContext("2d");
color="red";
ctx.beginPath();
ctx.strokeStyle=color;
ctx.lineWidth=2;
ctx.rect(150,143,430,200);
ctx.stroke();
color="blue";
ctx.beginPath();
ctx.strokeStyle=color;
ctx.lineWidth=6;
ctx.arc(250,210,40,0,2*Math.PI);
ctx.stroke();
color="black";
c... |
exports.Section = `
type Section {
title: String!
description: String!
category: String!
videos: [Video]
}
`;
|
import "./styles.css";
document.getElementById("app").innerHTML = `
<h1>Hello Vanilla!</h1>
<div>
We use the same configuration as Parcel to bundle this sandbox, you can find more
info about Parcel
<a href="https://parceljs.org" target="_blank" rel="noopener noreferrer">here</a>.
</div>
`;
// 分割代入
// const my... |
import React from 'react';
import styled from 'styled-components';
const AvatarContainer = styled.div`
margin-right: 30px;
`;
const AvatarImage = styled.img`
margin-top: 24px;
width: 90px;
height: 90px;
border-radius: 100px;
`;
const Username = styled.p`
font-family: Arial, Helvetica, sans-serif;
font-... |
var gulp = require('gulp');
var pkg = require('./package.json');
// Gulp Package
var browser = require('browser-sync');
var ts = require('gulp-typescript');
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
var header = require('gulp-header');
var plumber = require('gulp-plumber');
// Path
var bui... |
import { AuthenticationError, ForbiddenError } from "apollo-server";
import models from "./../../graphql/models/index.js";
import { encryptor } from "./Encryption.js";
import jwt from "jsonwebtoken";
import _ from "lodash";
export const auth = {
authorize: async (license, credentials) => {
if (!license)
th... |
// LAY DANH SACH LOAI NGUOI DUNG
export const LAY_DANH_SACH_LOAI_NGUOI_DUNG_REQUEST =
"LAY_DANH_SACH_LOAI_NGUOI_DUNG_REQUEST";
export const LAY_DANH_SACH_LOAI_NGUOI_DUNG_SUCCESS =
"LAY_DANH_SACH_LOAI_NGUOI_DUNG_SUCCESS";
export const LAY_DANH_SACH_LOAI_NGUOI_DUNG_FAILURE =
"LAY_DANH_SACH_LOAI_NGUOI_DUNG_FAILURE";... |
import React, { useContext } from "react"
import { SearchWrapper, SearchInput, SearchIcon, SearchButton } from "./Styled"
import { ContentContext } from "../DataContent"
export function Search(props) {
const [dispatch, actions] = useContext(ContentContext)
const handleChange = e => {
const input = e.t... |
import {applyMiddleware, combineReducers, createStore} from 'redux';
import {createForms} from 'react-redux-form';
// reducers
import {Dishes} from './reducers/dishes';
import {Comments} from './reducers/comments';
import {Promotions} from './reducers/promotions';
import {Leaders} from './reducers/leaders';
import {Au... |
/*
* Copyright (C) 2021 Radix IoT LLC. All rights reserved.
*/
serialPortFactory.$inject = ['$http'];
function serialPortFactory($http) {
const baseUrl = '/rest/latest/server/serial-ports';
class SerialPort {
static list(params = {}) {
return $http({
method: 'GET... |
import Vue from 'vue';
import App from '../components/App.vue';
export function createApp(data = {
list: [],
sort: 0,
type: 0,
sortFn: () => null,
filtFn: () => null,
}) {
const app = new Vue({
render: h => h(App, {
props: data,
}),
});
return { app }
} |
/*
* @Author: xr
* @Date: 2021-03-20 12:05:07
* @LastEditors: xr
* @LastEditTime: 2021-03-20 12:10:24
* @version: v1.0.0
* @Descripttion: 功能说明
* @FilePath: \ui\src\store\index.js
*/
import { createStore } from 'vuex'
import modules from './modules'
export default createStore({
modules
})
|
/***
* Project: MDL
* Author: Rushan Arunod
* Module: GPS Services
*/
'use strict';
var serviceName = 'mdl.mobileweb.service.gpstrack'
angular.module('newApp').service(serviceName,['$http','$location','settings','mdl.mobileweb.service.login',
function($http,$location... |
import React, { Component } from "react";
import JobDB from "../../utils/DB/JobDB"
import "./Results.css"
import {Redirect} from "react-router-dom"
class JobResults extends Component {
state = {
applied: "",
type: this.props.type,
filter: this.props.filter,
userID: "",
jobs: ... |
const path = require("path");
const router = require("express").Router();
const apiRoutes = require("./api");
// Add Imported API Routes and add the "/api" part the the URL request
router.use("/api", apiRoutes);
// If no API routes are hit then send back to the React app by default
router.use(function(req, res) {
r... |
//handleData will calculate sum of revenue and stuff on the home page -applist-company card
export const handleData = (arr) => {
//sumObj contains sum of field revenue,adRequest,adResponse, impressions which are initialized with 0
const sumObj = { revenue: 0, adRequest: 0, adResponse: 0, impressions: 0 };
arr.for... |
import instanceAxios from '../api.config'
class TestStepAPI {
// The fields from the testObj update must be the same as in the Test model (see backend)
async create(lessonId) {
const { data } = await instanceAxios.post(`/lesson/test/create/${lessonId}`)
return data
}
async update(id, updateObj) {
... |
import React, {useEffect, useState, Fragment} from 'react';
import {useSelector, useDispatch} from 'react-redux';
import {addAsset} from '../../actions/assetActions';
import {addLiability} from '../../actions/liabilityActions';
import Alert from '../alert/Alert';
const Item = ({component_type, user_id}) => {
const ... |
import { useEffect } from 'react';
function useCreateRoom(socket, room, setRoom, isCreated) {
useEffect(() => {
if(isCreated) {
socket.emit('create room', room.name, room.host.name, room.host.allowVideo);
socket.emit('join room', room.name);
setRoom({...room, isCreated:... |
//犬
function autodog() {
// 定期的に通知する内容を記載
const url = "http://shibe.online/api/shibes?count=1&urls=true&httpsUrls=true"; //URL+cityID
const resdog = UrlFetchApp.fetch(url);
Logger.log(resdog);
const dogimg = JSON.parse(resdog.getContentText());
Logger.log(dogimg);
const jsonData = {
use... |
function updateRecentPosts(){
jQuery.ajax({
url: "posts?actionName=recentPosts",
method: "GET",
contentType: "",
success:function(posts){
var postsArray = JSON.parse(posts)
var $recntPostsContainer = $(".recent");
for(var i in postsArray){
$recntPostsContainer.append('<div class="recent-post">... |
module.exports = (app) => {
const duckie = require("../controllers/duckie.controller");
app.get("/", duckie.welcome);
app.post("/api/following", duckie.getFollowingUser);
app.post("/api/followers", duckie.getFollowersUser);
app.post("/api/:followerId/follow/:userToFollowId", duckie.followUser);
app.del... |
"use strict";
$(function() {
//查询购物车列表
shoppingQuery();
function shoppingQuery() {
$.utils
.ajax({
url : "/shoppingCart/queryshoppingCartList",
success : function(data) {
var div;
if (data.length == 0) {
div = '<div class="col-sm-12 orderList">'
+ '<p class="title"><stro... |
define([
'extensions/views/view'
],
function (View) {
var SectionView = View.extend({});
return SectionView;
});
|
import React, {Component} from 'react'
import {StyleSheet, Text, View,Button} from 'react-native';
class Images extends React.Component{
render(){
return (
<View>
<Image
source={require('/react-native/img/favicon.png')}
/>
<I... |
/*
On each page we have a filter. The filter contains tags.
Treat this as a component.
Actions:
get filter values
add to filter
remove from filter
get next - ajax call
get previous - ajax call
get pages - ajax call (paginated)
*/
if (typeof Filter === "undefined") {
var Filter = {
... |
import React, { Component } from "react";
import Cart from "../components/Orders/Cart";
import { connect } from "react-redux";
import * as actions from "../store/actions/index";
class CartContainer extends Component {
proceed = () => {
this.props.history.push("/checkout");
};
render() {
ret... |
// Inputs du formulaire
var radioSalle1 = document.getElementById("1");
var radioSalle2 = document.getElementById("2");
var radioSalle3 = document.getElementById("3");
var radioSalle4 = document.getElementById("4");
var radioSalle5 = document.getElementById("5");
var radioSalle6 = document.getElementById("6");
... |
const divisas = require('./divisas.json');
const express = require('express');
const app = express();
app.use(express.json());
app.get('/', function (request, response) {
response.end('Hello BEDU');
});
app.get('/divisas', function (request, response) {
const catalogo = divisas.map(divisa => divisa.moneda... |
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var cors = require('cors');
var methodOverrid... |
"use strict";
require([__dirname + "/../low.js", __dirname + "/tools.js"], function (low, tools)
{
exports.Box = function Box()
{
var m_item = $(
low.tag("div")
.html()
);
this.get = function ()
{
return m_item;
};
this.add ... |
function mapToObject (map) {
let obj = {};
for (let [k, v] of map) {
if (v instanceof Map) {
obj[k] = mapToObject(v);
} else {
obj[k] = v;
}
}
return obj;
};
export { mapToObject };
|
class Response {
constructor() {
this.cookies = {};
}
cookie(name, payload) {
this.cookies[name] = payload;
}
clearCookie(name) {
delete this.cookies[name];
}
}
module.exports = Response;
|
let express = require('express');
let router = express.Router();
let Users = require('../models').User;
let middleware = require('../auth/middleware');
/* path /auth/ */
/**
* @swagger
* /auth/login:
* post:
* summary: User authentication
* description: 'to log in the user. NOTICE that cookies must b... |
(function () {
var app = angular.module('myApp');
app.controller('CustomersController', ['$scope','CustomersService', function ($scope,customersService) {
$scope.customers = customersService.getCustomers();
}]);
})(); |
import { MapLayer } from "react-leaflet";
import L from "leaflet";
import "leaflet-routing-machine";
import { withLeaflet } from "react-leaflet";
import React from 'react';
class Routing extends MapLayer {
constructor(props) {
super(props);
}
createLeafletElement() {
//console.log("ele-leaf create");
... |
var musicVolume = 0.5;
var soundVolume = 0.5;
(function(){
try {
if(localStorage.getItem("musicVolume") != null) {
musicVolume = parseFloat(localStorage.getItem("musicVolume"));
soundVolume = parseFloat(localStorage.getItem("soundVolume"));
}
} catch (error) {
console.error("Can't find save... |
const express = require('express');
const app = express();
const path = require('path');
const csv = require('fast-csv');
app.set('view engine', 'ejs');
app.use(express.static(path.join(__dirname, 'public')));
app.get('/', function (req, res) {
res.render('pages/index');
});
app.get('/about', function (req, res) ... |
const config = require('../../config');
const {
DocScanClient,
} = require('yoti');
module.exports = async (req, res) => {
const docScanClient = new DocScanClient(
config.YOTI_CLIENT_SDK_ID,
config.YOTI_PEM
);
try {
const media = await docScanClient.getMediaContent(
req.session.DOC_SCAN_SES... |
import {
basicAfterEach,
basicBeforeEach,
FR_EMOJI,
ALL_EMOJI,
mockFrenchDataSource,
tick
} from '../shared'
import Picker from '../../../src/picker/PickerElement.js'
import { getByRole } from '@testing-library/dom'
import { DEFAULT_DATA_SOURCE, DEFAULT_LOCALE } from '../../../src/database/constants'
import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.