text stringlengths 7 3.69M |
|---|
let Post = require("../models/post");
let Profile = require("../models/profile");
let PostState = require("../models/postState")
//let CommentState = require("../models/commentState")
exports.check = function (req, res) {
PostState.find({
username: req.session.user
}, function (err, doc) {
if (... |
import React from 'react';
import { Link } from 'react-router-dom';
import Styles from './TopBarContent.module.scss'
class TopBarContent extends React.Component {
constructor(props) {
super(props);
this.TopBarContentRef = React.createRef();
}
render() {
return(
<div cl... |
require("./sequelize");
const {user} = require("./models/user");
const {registration} = require("./models/registration");
const {configuration} = require("./models/configuration");
const {url} = require("./models/url");
const {device} = require("./models/device");
configuration.hasMany(device, {foreignKey: 'configura... |
// start up the program.
// loads configuration, users and tasks. schedules task executions. watches
// task directory & task files for changes
var path = require('path');
var async = require('async');
var tasks = require(path.join(__dirname, 'tasks'));
var users = require(path.join(__dirname, 'users'));
var data =... |
(function ()
{
'use strict';
angular
.module('employee.create')
.controller('createController', createController);
function createController($scope,empApi,empService){
$scope.submit = function(){
empApi.employees().save({
'id': $scope.id,
'name':... |
export const Error = ({ message }) => {
return <div className="alert alert-danger my-3">{message}</div>;
};
|
import Navbar from "./components/Navbar"
import Card from "./components/Card"
import CardDesc from "./components/CardDesc"
import Cart from "./components/Cart"
import Login from "./components/Login"
import Register from "./components/Register"
import ProductInfo from "./components/ProductInfo"
import Products from "./... |
import React, {Fragment} from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
TouchableOpacity,
Image,
Dimensions,
} from 'react-native';
import {SvgXml} from 'react-native-svg';
import SVG from '../components/SvgComponent';
const TESTDATAS = [
{
exist: true,
... |
let app;
let fs = require("fs");
function init(express){
app = express;
console.log("Launching REST API...");
/*============================================================================
Main Endpoints
============================================================================*/
let rest_users = ... |
function convert() {
var lines = document.getElementById("input").value.split('\n');
console.log(lines);
var output = "String page=\"\";\n";
for (var i = 0; i < lines.length; i++) {
output += "page+=\"";
output += lines[i].replace(/\"/g, '\\\"');
output += "\";\n";
}
document.getElementById("output").value ... |
// function sumArg() {
// return [].reduce.call(arguments, function(a, b) {
// return a + b;
// });
// }
function sumArg() {
arguments.reduce = [].reduce;
return arguments.reduce(function(a, b) {
return a + b;
})
}
console.log(sumArg(1,2,3,4,5,6)); |
// Code in ~2 hours by Bemmu, idea and sound code snippet from Viznut.
// 2011-09-30 - Modifications by raer.
// 2011-10-07 - Modifications by raer.
// 2019-04 - modernisation by edave64 and opensofias
const $form = document.forms[0];
// ui object contains input elements
const ui =
't0, tmod, seconds, separation,... |
// pages/info/child-components/info-item/info-item.js
Component({
/**
* 组件的属性列表
*/
properties: {
iconPath: String,
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
itemClick() {
this.triggerEvent('itemClick', {}, {})
}
}
})
|
import React, { Component } from "react";
import {
FormLabel,
FormInput,
FormValidationMessage
} from "react-native-elements";
import styled from "styled-components/native";
import Axios from "axios";
const Title = styled.Text`
color: palevioletred;
font-weight: bold;
font-size: 20px;
`;
const Container ... |
import React from 'react'
import { RegisterForm } from '../components/RegisterForm';
export const Register = () => {
return (
<RegisterForm />
)
}
|
// const MongoClient = require('mongodb').MongoClient;
// module.exports = function(agenda) {
// agenda.define('archive ride', function(job, done) {
// // Connect to the db
// MongoClient.connect('mongodb://localhost:27017/data', function(err, db) {
// if (!err) {
// // If no error then I query... |
function validateform(){
var fname = document.getElementById("FName").value;
var lname = document.getElementById("LName").value;
var uname = document.getElementById("UName").value;
var add1 = document.getElementById("address").value;
var zip = document.getElementById("zip").value;
var rbtn1 = document.getElementB... |
export function fetchMovies() {;};
|
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'module-resolver',
{
root: ['./App'],
extensions: [
'.ios.ts',
'.android.ts',
'.ts',
'.ios.tsx',
'.android.tsx',
'.tsx',
'.jsx',
... |
var gulp = require('gulp');
var watch = require('gulp-watch');
var url = require('url');
var proxy = require('proxy-middleware');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var browserSync = require('browser-sync').create();
var buffer = require('vinyl-buffer');
var browse... |
var nameLocalStoregeIdentificadores = 'identificadores';
var idEdicao = "";
function adicionarIdentificador() {
const tipoIdentificador = document.getElementById('tipoIdentificadorSl').value;
const areaGeografica = document.getElementById('areaGeograficaSl').value;
const data = document.getElem... |
/*
Escribe las funciones para llevar a cabo las siguientes
operaciones para un array de una dimensión:
a) Establecer los 10 elementos del array a cero.
b) Añadir 1 a cada uno de los elementos del array.
c) Muestra los valores del array separados por espacios.toString()
*/
function init(){
var list= new Array();
doc... |
function puntoMedio() {
var x1 = Number(prompt("En la cordenada 1 escribe tu x1"));
var x2 = Number(prompt("En la cordenada 1 escribe tu x2"));
var y1 = Number(prompt("En la coedenada 2 escribe tu y1"));
var y2 = Number(prompt("En la coedenada 2 escribe tu y2"));
productoUno = (x1+x2)/2;
productoDos = (y1+y2)... |
var stat = require('node-static');
var bodyParser = require('body-parser');
var express = require('express');
var d = require('../libjs/durable');
var app = express();
var host = d.getHost();
var fileServer = new stat.Server(__dirname);
app.use(bodyParser.json());
function printAction(actionName) {
return fun... |
"use strict";
exports.__esModule = true;
var mobile_1 = require("./mobile");
var MobileLibrary_1 = require("./MobileLibrary");
var nokia3210 = new mobile_1.mobile("Nokia3210", "3210", "Nokia", 4, "black", false, 0, 50);
var iPhone3G = new mobile_1.mobile("iPhone3G", "3G", "iPhone", 12, "white", false, 1, 150);
var sams... |
var indexSectionsWithContent =
{
0: "_acdimnpqrstu",
1: "acdimnpqrstu",
2: "i",
3: "_"
};
var indexSectionNames =
{
0: "all",
1: "classes",
2: "namespaces",
3: "functions"
};
var indexSectionLabels =
{
0: "All",
1: "Classes",
2: "Namespaces",
3: "Functions"
};
|
const crypto = require('crypto')
const digest = (string) => {
return crypto.createHash('md5').update(string).digest('hex')
}
const addSalt = ({ password, salt }) => {
let ticket = digest(digest(digest(password) + salt) + 'charlene')
return ticket
}
const randstr = (len = 16) => {
let s = 'abcdefghijklmnopqrs... |
function clickpic(e) {
var x = e.offsetX;
var y = e.offsetY;
console.log(x,y);
if (e.target.getAttribute("id")=="confess1"){
e.target.setAttribute("class", "confess2");
e.target.setAttribute("id", "confess2");
}
else if (e.target.getAttribute("id")=="confess2"){
e.tar... |
import { Injectable } from '@angular/core';
var LeaveComponentGuard = (function () {
function LeaveComponentGuard() {
}
LeaveComponentGuard.prototype.canDeactivate = function (component, route, state) {
return component.canDeactivate();
};
return LeaveComponentGuard;
}());
export { LeaveComp... |
// Members handler
const _data = require("./data");
const helpers = require("./helpers");
const config = require("./config");
const { _tokens } = require("./tokensHandler");
const members = (data, callback) => {
const acceptableMethods = ["post", "get", "put", "delete"];
if (acceptableMethods.indexOf(data.method) ... |
const nodeFetch = require('node-fetch')
const { createApi } = require('unsplash-js')
const dotenv = require('dotenv').config()
const unsplash = createApi({
accessKey: process.env.UNSPLASH_ACCESS_KEY,
fetch: nodeFetch
})
const getRandomLandlordImage = async () => {
const { response } = await unsplash.photos.getR... |
function myselfPlugin() {}
myselfPlugin.prototype.apply = function(compiler) {
compiler.plugin('run', function(compiler, callback) {
console.log('webpack 开始构建');
callback();
})
}
module.exports = myselfPlugin; |
const mongoose = require('mongoose');
const secrets = require('../config/secrets');
const autores = require('../models/autores.model');
const recetas = require('../models/recetas.model')
//Conectarse a mongo!
mongoose.connect(secrets.mongo_URL, {
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndM... |
(function (angular) {
"use strict";
function constructor($location, usersService) {
var vm = this;
function addUser(user) {
var index=usersService.addUser(user);
$location.path("/list");
}
vm.addUser = addUser;
}
constructor.$inject... |
var mongoose = require('mongoose');
var keyRecord = require('../models/keyRecord');
var Keyword = require('../models/keyword');
var async = require("async");
var constant = require('../constants.js');
exports.addRecord = function(req,res){
console.log(req.body);
var type = req.body.type;
var key = req.body.key... |
/**
*
* @authors zx.wang ([email protected])
* @date 2016-08-22 18:08:16
* @version $Id$
*/
/**
* Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target?
* Find all unique quadruplets in the array which gives the sum of target.
* Note: The solution set mu... |
/*
My friend wants a new band name for her band.
She like bands that use the formula: 'The' + a noun with first letter capitalized.
dolphin -> The Dolphin
However, when a noun STARTS and ENDS with the same letter, she likes to repeat the noun twice and connect them together with the first and last letter, combined i... |
import React, { useContext } from 'react';
import cn from 'classnames';
import style from './style.module.css';
import { StateContext } from '../../app/App';
export const Preloader = () => {
const {state: {
preloaderText,
isAppReady,
}} = useContext(StateContext);
return (
<div className={cn(style.... |
window.onload = function (){
var btn = document.getElementById("tAdd");
var body = document.getElementById("block");
loadFeed();
btn.addEventListener("click",(event)=>{
let user = "Utkarsh";
event.preventDefault();
text = document.getElementById("tweetCnt").value;
if(text == ""){
}
... |
var expect = require('chai').expect;
var getBossMW = require('../../middleware/boss/getBossMW');
describe('getBoss middleware ', function () {
it('should return boss with id 1 from db and put it to res.locals.boss', function (done) {
const mw =getBossMW({
BossModel: {
findOne: (p1,cb) => {
... |
// Generated by CoffeeScript 1.4.0
(function() {
var Cc, Ci, Cm, Cr, Cu, ObserverHandler, WebTxt, data, file, sendSMS, tabs, widget, widgets, _ref,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
data = require('sdk/self').data;
WebTxt = (function() {
function WebTxt... |
/*
后台登录 内在灵魂,沉稳坚毅
生成时间:Sat Oct 08 2016 破门狂人R2-D2为您服务!
*/
define('adminLogin', [
'avalon',
'text!../../package/adminLogin/adminLogin.html',
'css!../../package/adminLogin/adminLogin.css',
'../../obj/bridge/User',
'../../plugins/isIt/isIt.js',
'../../plugins/Gate/Gate.js'
], function (avalon, ... |
import invariant from 'invariant';
let __DefaultComponent;
export const setDefaultComponent = Component =>
(__DefaultComponent = Component);
export const getDefaultComponent = () => {
invariant(__DefaultComponent, '[Redux Intl] Default component is not set.');
return __DefaultComponent;
};
|
(function(){
"use strict";
angular
.module("Main.cart",[] )
.controller("cartController", cartController);
function cartController($http, $scope, $rootScope, cartService) {
/*$scope.removeItem = function(cartProduct){
cartService.removeItem(cartProduct);
}*/
... |
const gulp =require("gulp");
gulp.task("hello",function(){
console.log("hello");
})
//html
gulp.task("copy-html",function(){
return gulp.src("html/*.html")
.pipe(gulp.dest("dist/html"))
.pipe(connect.reload());
})
//images拷贝图片
gulp.task("images",function(){
return gulp.src("images/**/*")
.pipe(... |
/**
* Change color of logotype, menu button,
* language links and top links when scroll
*/
import $ from 'jquery';
import ScrollMagic from 'scrollmagic';
import debounce from 'lodash/debounce';
// selectors for sections on page that may trigger changes of color
const sections = ['.hero-group', '.footer', '.toparea... |
/**
* File: user list item
* Author: Filip Jarno
* Date: 23.08.2014
*/
define([
'backbone',
'marionette',
'jquery',
'underscore',
'config'
], function (Backbone, Marionette, $, _, config) {
'use strict';
var CLASS = {
USER_LIST_ITEM: 'user-list-item',
LIST_GROUP_ITEM: ... |
'use strict';
import JWT from 'passport-jwt';
import { UserAccount } from '../models/user';
import config from '../config/database';
const AUTH_HEADER = 'jwt';
exports.AUTH_HEADER = AUTH_HEADER;
exports.config = function(passport) {
const opts = {};
opts.secretOrKey = config.secret;
opts.jwtFromRequest = JWT.... |
const Intern = require('../lib/Intern');
test("creates a Intern object", () => {
const intern = new Intern("Tony", "1", "[email protected]", "UNISA");
expect(intern.name).toEqual("Tony");
expect(intern.id).toEqual("1");
expect(intern.email).toEqual("[email protected]");
expect(intern.school).toEqu... |
import React from "react";
import {Card, Select} from "antd";
const Option = Select.Option;
const WithValue = () => {
function handleChange(value) {
console.log(value); // { key: "lucy", label: "Lucy (101)" }
}
return (
<Card className="gx-card" title="With Value">
<Select labelInVa... |
/**
* FLOOR MANAGER
* populates the dance floor
*/
var floorMgr = {};
floorMgr.addPartyAnimal = function(){
// for testing
//$( ui.floor ).text( JSON.stringify(round.animalsCreated) );
//$( ui.floor ).append( JSON.stringify(ANIMIX.currParts) + "<br>" );
//console.log( ANIMIX.currParts );
var newAnimal = {};
... |
var IsHelpedBys = require('../models/isHelpedBys')
, _ = require('lodash')
, writeResponse = require('../helpers/response').writeResponse
, dbUtils = require('../neo4j/dbUtils');
/**
* @swagger
* definition:
* IsHelpedBy:
* type: object
* properties:
* id:
* type: integer
* sin... |
/**
* Created by root on 6/17/16.
*/
var db = require('../routes/helper/db');
var async = require('async');
var validator = require('../routes/helper/validator');
var pushController = require('../routes/helper/send_push');
//We'll store the socket ids
//to check if user is connected or not
var connected = {};
//Us... |
var class_object_pool_1_1_startup_pool =
[
[ "prefab", "class_object_pool_1_1_startup_pool.html#a2bda7f7361547d012d331f23f6594c56", null ],
[ "size", "class_object_pool_1_1_startup_pool.html#a5edd1a6e6eb9c58b75233b641bffb8ef", null ]
]; |
var BarGraph = React.createClass({
getDefaultProps: function() {
return {
width: '500px',
height: '100px'
};
},
componentDidMount: function() {
var el = this.getDOMNode();
ns.create(el, this.props);
if(this.props.chem){
ns.update(el, this.props.chem);
}
// dispatcher... |
import React from 'react';
const Timer = ({timeLeft}) => {
const timeLeftLength = Object.keys(timeLeft).length;
return (
<div id="timer" className="timer">
<div className="timer__body">
{timeLeftLength !== 0 && (
<>
<div className="timer-cell timer-cell_type_day">
... |
import db from '../models/index.js';
import fanPageQueries from '../DB/queries/fanPage-queries.js';
const { User, FanPage } = db;
//add fanPage queries
const { addUpvote, removeUpvote } = fanPageQueries;
// return all fan pages ordered by date created
const exploreData = async (req, res) => {
try {
// sen... |
class Platform extends Entity {
constructor({ behaviour, ...options }) {
super(options);
this.gameObject = new GameObject({
startX: options.startX, startY: options.startY, width: options.width, height: options.height
});
this.behaviour = behaviour;
this.collider = new Collider({
isTrig... |
var sectorData;
var tickerData;
var graphOptions;
var sectorChart;
var tickerChart;
var sectorctx = document.getElementById("sector-chart");
var tickerctx = document.getElementById("ticker-chart");
// Utility Functions
function getSectors(quotes){
var sectors = {}
for (var d in quotes){
if (quotes[d]['se... |
const mongoose = require('mongoose');
const fileSchema = new mongoose.Schema({
length: Number,
chunkSize: Number,
uploadDate: Date,
filename: String,
md5: String,
contentType: String,
});
exports.File = mongoose.model('File', fileSchema);
const ObjectId = mongoose.Schema.ObjectId;
const chunkSchema = new mong... |
//引入express模块
const express = require("express");
//定义路由及中间件
const router = express.Router();
//引入数据模型模块
const Fri = require("../models/fri");
// 登陆接口
router.post('/login', function(req, res, next) {
var username = req.body.username;
var password = req.body.password;
if(username === 'murphyli' && password === '... |
import React, { useEffect, useState } from "react";
import HotelList from "./HotelList";
import Typography from "@material-ui/core/Typography";
import { fetchHotelData } from "./apiHelper/profileHelper";
import GoogleMap from "./GoogleMap";
import Grid from "@material-ui/core/Grid";
import { MDBContainer } from "mdbrea... |
function Controller() {
function changeSettings() {
var a = Titanium.UI.createAnimation({
left: APP.numberOperation(-$.mapView.size.width, "/", 2, false),
duration: 300
});
var a2 = Titanium.UI.createAnimation({
left: 20,
duration: 300
... |
var socketIO = require('socket.io'),
http = require('http'),
port = process.env.PORT || 8080;
ip = process.env.IP || '127.0.0.1',
server = http.createServer().listen(port,ip,function(){
console.log('start socket');
}),
io = socketIO.listen(server);
io.set('origins','*:*');
var run = function(socket)
{
// user-ha nh... |
// author: catomatic
// website: https://github.com/catomatic
// source: personal projects library
var quickSort = function(someList) {
var listLen = someList.length;
if (listLen > 1) {
var pivot = someList[Math.floor(listLen / 2)];
var less = [];
var equal = [];
var greater = [];
for (i = 0; ... |
module.exports = {
"POST": {
"validate": 'body',
"schema": {
"type": "object",
"properties": {
"type": {
"type": 'string'
},
"public_key": {
"type": 'string'
},
... |
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { withFirebase } from '../Firebase';
import * as ROUTES from '../../constants/routes';
const PasswordForgetLink = () => (
<p>
<Link className="linkstyle" to={ROUTES.PASSWORD_FORGET}>Forgot Password?</Link>
<... |
import { Random } from 'mockjs'
import createMock from 'util/create-mock'
// 示例查看地址:http://mockjs.com/examples.html#DPD
// 占位符 的格式为:
// @占位符
// @占位符(参数 [, 参数])
// 注意:
// 用 @ 来标识其后的字符串是 占位符
// 占位符 引用的是 Mock.Random 中的方法
// 通过 Mock.Random.extend() 来扩展自定义占位符
// 占位符 也可以引用 数据模板 中的属性
// 占位符 会优先引用 数据模板 中的属性
// 占位符 支持 相对路径 ... |
///TODO: REVIEW
/**
* @param {number[]} height
* @return {number}
*/
var maxArea = function(height) {
var l = 0, r = height.length -1;
var max = 0;
while ( l < r) {
max = Math.max(max, (r-l) * Math.min(height[l] , height[r]));
if (height[l] < height[r]) l++;
else r--;
}
return max;
};
console.... |
import React from "react";
import ReactDOM from "react-dom";
import AppContainer from "./components/AppContainer";
import "./styles/styles.scss";
import { ThemeProvider } from "@material-ui/core/styles";
import theme from "./styles/theme";
import "fontsource-roboto";
require("dotenv").config();
ReactDOM.render(
<... |
$(window).load(function() {
/* Mansonry */
// Animate loader off screen
$(".se-pre-con").fadeOut(500);
$('.picsBox').masonry({
itemSelector: '.picBox',
isFitWidth: true,
isAnimated: true
});
})
$(document).ready(function(){
/* Popup form */
// $('.switchTab ul li').click(function()... |
import Link from 'next/link';
import React from 'react';
import { ArrowRight, HighlightTwo } from '../../../svg';
const hero_contents = {
shapes: [
'hero-shape-5.1.png',
'hero-shape-4.png',
'hero-shape-4.png',
'hero-shape-5.2.png',
],
subtitle: <>Offer is going on till friday , <b>$84,99</b><span... |
angular.module('ngApp.express').controller("ExpressCreateShipmentController", function ($scope, $uibModal, UserService, SessionService, AppSpinner, Upload, config, $translate, PreAlertService, CustomerId, Hub, Bags, TradelaneBookingService, ExpressIntegrationShipmentService, toaster, TradelaneShipmentService, TopAirli... |
import React from "react"
import { Link } from "react-router-dom"
import { TwitterPicker } from "react-color"
export default function Settings(props) {
function handleNicknameChange(event) {
props.onChange({nickname: event.target.value})
}
function handleColorChange(color, event) {
props.... |
import clearModal from './clearModal';
const togglePopup = () => {
const popupToggle = document.querySelectorAll('.open-popup, .callback-btn, .fixed-gift, .popup'),
giftPopup = document.getElementById('gift'),
forms = document.querySelectorAll('#form2, #form1'),
thanks = document.getElementById('thanks')... |
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('private_block_log', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
blockNumber: {
allowNull: false,
... |
/*
* ヘッダ部のレイアウト編集
*
**/
var NEW_PARTS_BEG = 1;
var CURR_NEW_PARTS = NEW_PARTS_BEG;
var CURR_EDIT_TOP_PARTS_NO;
var CURR_EDIT_MAIN_PARTS_NO;
var CURR_EDIT_PARTS_CLASS;
var EXT_LIST;
var PAGEID;
var DLG_OBJ;
var DLG_OUTER_OBJ;
var DLG_STS;
var DLG_BTN_COLOR;
var NARROW_WIDTH = 320;
var MMAREA;
var PAGE_LIST_TO... |
//http://stackoverflow.com/questions/5643767/jquery-ui-autocomplete-width-not-set-correctly
jQuery.ui.autocomplete.prototype._resizeMenu = function () {
var ul = this.menu.element;
ul.outerWidth(this.element.outerWidth());
}
$(document).ready(function() {
var who = [
'Firefighter',
'Web Developer',
'... |
const sveltePreprocess = require('svelte-preprocess');
const autoprefixer = require('autoprefixer');
const production = !process.env.ROLLUP_WATCH;
module.exports = {
preprocess: sveltePreprocess({
sourceMap: !production,
scss: {
prependData: `@import "src/assets/scss/variables.scss";`
},
postc... |
//"TaskId": "T_PRYCTSGSALFQY_996"
|
exports.validateBookingInfo = function(req, res, next) {
var body = req.body;
if(body.start_time > body.end_time){
return next(new Error("Start time should greater than end date."))
}
return next();
};
|
import React from 'react';
import ReactDOM from 'react-dom';
// redux
import {Provider} from 'react-redux';
import store from "./store"
// components
import App from './components/App/container';
// styles
import './style.css';
import 'bootstrap/dist/css/bootstrap.min.css';
// axios
import axios from 'axios';
axio... |
const intersection = require('lodash/intersection')
const isNonEmptyString = require('predicates/isNonEmptyString')
const { classes } = require('typestyle')
const mergeClasses = (baseStyle = {}, ...args) => args.reduce((before, style = {}) => {
return {
...before,
...style,
...intersection(Object.keys(b... |
import styled from "styled-components";
import { below } from "../utilities/mediaQueries";
export const StyledTrack = styled.div`
border: transparent;
background: #050607b7;
box-shadow: 1px 1px 20px #14181e;
min-width: 36vw;
max-width: 36vw;
height: 14vh;
border-radius: 5px;
margin: 3vh auto;
display... |
angular.module('boosted')
.directive('footerView', function() {
return {
restrict: 'E',
templateUrl: 'public/app/directives/footer/footer.html',
controller: function($scope, service){
$scope.addEmail = function(email){
service.addemail... |
/**
* Created by zhuo on 2017/9/17.
*/
class Enemy extends LiveObject {
constructor(name, mh, pp, mp, pd, md, speed, exp,desc) {
super(name, mh, pp, mp, pd, md, speed);
this.exp = exp || 1;
this.isLiving = true;
this.items = [];//携带道具
this.desc = desc || '管理员忘记描述了';
}
... |
class People {
constructor(name, email, phone) {
this.name = name;
this.email = email;
this.phone = phone;
};
toString() {
return `Name: ${this.name} | e-Mail: ${this.email} | Phone: ${this.phone}`;
};
}
class Client extends People {
constructor(id, name, email, ... |
import React from 'react';
import { storiesOf } from '@storybook/react';
import { select } from '@storybook/addon-knobs';
import List from './List';
storiesOf('List', module).add('demo', () => (
<List
listType="liveOrder"
list={[
{
id: 1,
name: 'INVO/BTC',
lastPrice: 0.00022,
... |
/**
* http://www.geeksforgeeks.org/insertion-sort/
* Maintain a sorted portion of the array, and insert the remaining elements into the correct position
* in the sorted portion.
*/
const insertionSort = arr => {
for (let i = 1; i < arr.length; i++) {
let cur = arr[i];
let j = i - 1;
while (j >= 0 && ... |
//requires
var express = require('express');
var app = express();
var calc = require('./modules/calculate.js');
var path = require('path');
var bodyParser = require('body-parser');
//globals
var port = 5000;
//uses
app.use(express.static('public'));
app.use(bodyParser.urlencoded({extended:true}));
//route for calcul... |
var SearchSheetView = Backbone.View.extend({
initialize: function () {
_.bindAll(this, "render");
this.stack = [];
this.account = new AccountModel();
this.inbox = new TaskListModel();
this.areas = new AreaCollection();
this.tags = new TagCollection();
this.m... |
/* global module:true, test:true, expect:true */
/* global ok:true, equal:true */
"use strict";
module("group a");
test("a basic test example", function () {
ok(true, "this test is fine");
});
test("a basic test example 2", function () {
ok(true, "this test is fine");
});
module("group b");
test("a basic tes... |
const config = require('dotenv').config();
const { Client } = require('pg')
console.log(process.env.PGDATABASE)
const client = new Client({
user: process.env.PGUSER,
host: process.env.PGHOST,//'boat.colorado.edu',
database: process.env.PGDATABASE,//'vbd23',
password: process.env.PGPASSWORD,//'viirs2018',... |
var app = new Vue({
el: '#app',
data: {
name: "",
link: "",
question: "",
location: "",
radius: "",
fields: []
},
methods: {
saveForm: function () {
if (this.validateForm()) {
this.fields.push({
question: this.question,
location: this.location,
... |
import React from 'react';
import todoStore from '../../stores/TodoStore';
import * as TodoActions from '../../actions/TodoActions';
import Tasks from './Tasks';
class Todo extends React.Component {
constructor() {
super();
this.getTodos = this.getTodos.bind(this);
this.state = {
todos: todoStore.getAll(),
... |
var render="datalist";
var win="addWindow";
var wform="saveForm";
var qform="queryForm";
var path = $('#path').val();
/**
* 数据列表
* @type
*/
var tcolumn=[[
{field:'name',title:'名称',width:120,sortable:true,align:'center'},
{field:'type',title:'类型',width:120,sortable:true,align:'center',
formatter:function(... |
define(function(require, exports, module){
var G=require('../../c/js/globale');
var encode64=require('../../c/js/base64').encode64;
var md5=require('../../c/js/md5').md5;
var main = {
init:function(){
var self=this;
self.loginToken=$('#J-loginToken').val();
... |
const core = require("@actions/core");
(async () => {
try {
console.log(process.cwd());
let file = core.getInput("file", { required: true });
let githubUsername = core.getInput("github-username", { required: true });
let parsedMapping = JSON.parse(file);
const slackId = parsedMapping[0][githubUse... |
export default async function ({ system, wait }) {
try {
const req = RetryRequest('/api/login/register', {
headers: {
'Content-Type': 'application/json'
}
});
const res = await req.post(JSON.stringify(this));
if (res.responseText === 'exist') ... |
export function checkHttpStatus(response) {
if (response.code >= 200 && response.code < 300) {
return response
} else {
//console.log(response);
var error = new Error(response.statusText)
error.response = response
throw error
}
}
export function parseJSON(response) {
return response.json()
}
export fun... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.