text
stringlengths
7
3.69M
const gulp = require("gulp"); const babel = require("gulp-babel"); const uglify = require("gulp-uglify"); const header = require("gulp-header"); // using data from package.json var pkg = require("./package.json"); var banner = ["/**", " * <%= pkg.name %>", " * @version v<%= pkg.version %>", " * @l...
Template.video.isActive = function () { return Session.get('status') === 'video'; }; Template.video.rendered = function () { if (Session.equals('status', 'video')) { var tag = document.createElement('script'); tag.src = "https://www.youtube.com/player_api"; var firstScriptTag = docum...
function demo() { // config physics setting phy.set( {substep:1, gravity:[0,-9.81,0]}); // add static ground phy.add({ type:'plane', size:[300,1,300], visible:false }); // add dynamic sphere phy.add({ name:'box1', size:[1,1,1], pos:[-100,2,0], density:1, restitution:0.5, friction:0.9 }); phy.add({ name:'bo...
const chalk = require('chalk'); module.exports = function(){ console.log(chalk.yellow( ` 1) Try googling along the lines of "random integer javascript" or "random num in range js" and "round up number javascript" 2) Make sure that the final value is stated on the same line after the "return...
import React, { Component } from 'react'; // import { Link } from 'react-router-dom'; import {Grid, Row, Col, Image,} from 'react-bootstrap'; import API from "../utils/API" import './About.css' export default class About extends Component { state = { email: [], }; componentDidMount() { this.loadEmail(); console...
var gulp = require("gulp"); // # 1) Chargement du "task automater" var browserSync = require('browser-sync').create(); var sass = require('gulp-sass'); var ts = require('gulp-typescript'); var sourcemaps = require('gulp-sourcemaps'); gulp.task('browser-sync', ['sass', 'ts'],() => { browserSync.init({ ser...
/* 给你个整数数组 arr,其中每个元素都 不相同。请你找到所有具有最小绝对差的元素对,并且按升序的顺序返回。 示例 1: 输入:arr = [4,2,1,3] 输出:[[1,2],[2,3],[3,4]] 示例 2: 输入:arr = [1,3,6,10,15] 输出:[[1,3]] 示例 3: 输入:arr = [3,8,-10,23,19,-4,-14,27] 输出:[[-14,-10],[19,23],[23,27]]   提示: 2 <= arr.length <= 10^5 -10^6 <= arr[i] <= 10^6 来源:力扣(LeetCode) */ /** * @param {number[]...
import React from "react"; import ProductHero from "../ProductHero"; function Products() { return ( <> <ProductHero /> </> ); } export default Products;
/*jshint esversion: 6 */ import { $, $$ } from "./helpers.js"; import { getList } from "./template.js"; const url = "/api/todo"; // setting the api path const fetchTodos = () => { // GET TODOS function fetch(url) // FetchAPI GET .then(res => res.json()) .then(todos => { getList(todos)...
var maildir_2lib_8h = [ [ "maildir_check_empty", "maildir_2lib_8h.html#ac1193cf5991629c477975ee74c97a65a", null ], [ "maildir_gen_flags", "maildir_2lib_8h.html#ac1b43584aaf8f3ddc0ebf28da7cc2bfb", null ], [ "maildir_msg_open_new", "maildir_2lib_8h.html#ae87ffa67156fad45fc687d8453fc384d", null ], [ "maild...
vti_encoding:SR|utf8-nl vti_timelastmodified:TW|06 Mar 2015 16:20:13 -0000 vti_author:SR|DWANE\\Dwane vti_modifiedby:SR|DWANE\\Dwane vti_nexttolasttimemodified:TW|06 Mar 2015 16:20:13 -0000 vti_timecreated:TR|06 Mar 2015 21:00:21 -0000 vti_cacheddtm:TX|06 Mar 2015 21:00:21 -0000 vti_filesize:IR|95931 vti_extenderversio...
// ########################CONFIG######################## var express = require('express'); var app = express(); var bodyParser = require('body-parser'); var path = require('path'); var mongoose = require('mongoose'); app.use(bodyParser.json()); app.use(express.static( __dirname + '/anonymousNotesApp/dist' )); // ###...
import { Text, View, StyleSheet, SafeAreaView, FlatList, TouchableOpacity, ActivityIndicator } from "react-native"; import React, { useEffect } from 'react'; import { connect } from 'react-redux'; import { scheduleReducer } from '../services'; import { getSchedules } from "../services"; import { Card } from 'react-nati...
const categories = [ { _id: "5fe5c183db9b000a30e0774a", name: "Ichimlik", }, { _id: "5fe5c18bdb9b000a30e0774b", name: "Shirinlik", }, { _id: "5fe5c169db9b000a30e07749", name: "Taom", }, ]; export const getCategories = () => { return [...categories]; };
console.log("hello world"); // This tutorial will cover many ways to use conditional statements in JavaScript. // What are conditionals? // Very often when you write code, you want to perform different actions for different decisions. // You can use conditional statements in your code to do this. // In JavaScript we...
let putUrl = "http://localhost:9595/product"; let gUrl = "http://localhost:9595/product/all"; function display(url, callback){ let xhr = new XMLHttpRequest(); xhr.open("GET", url); xhr.onreadystatechange = function(){ if(this.readyState===4 && this.status===200){ callback(this); console.log(this); }else...
import PropTypes from 'prop-types' import { css } from '@emotion/core' import { sizes } from '../../config' // eslint-disable-next-line import/prefer-default-export export const gridded = { styles: ({ theme, gapped, gap, breakpoint }) => { let gapValue = null if (gapped) { gapValue = gap ? theme.sizin...
// Paperless should be the only globally exposed object Paperless = {}; window.D = console; /* * Manage all of the files on the page */ Paperless.FileManager = { files: [], // Hide all files from display hide_all_files: function(){ $('.code_container').hide(); $('.filelink a...
import { Image } from './Image' import React from 'react' import { theme } from '../theme' import { Card } from './Card' import { LinkAreaAnchor } from './LinkAreaAnchor' import { VisuallyHidden } from './VisuallyHidden' import { responsiveSpace } from './HorizontalList' export const GoodreadsCard = ({ book: { h...
const app = getApp() Page({ data: { list: [], page: 1, limit: 10, finished:false }, goToPage(e) { wx.navigateTo({ url: `/pages/job/index?id=${e.currentTarget.dataset.id}` }) }, onLoad() { app.fun.post('/user/deliveryList', { page: this.data.page, limit: this.data....
import PropTypes from 'prop-types' import React from 'react' import MainIndicatorContainer from './LoadingIndicatorContainers/MainIndicatorContainer' function MessagesListHeader(props) { const {messagesCount} = props return ( <div className='c12q1r7z'> <h2 className='c17zq7b5'>Messages</h2> <p> ...
config({ 'menu': {requires: ['event','component/base','component/extension','node']} });
import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; import Modal from '@material-ui/core/Modal'; import Backdrop from '@material-ui/core/Backdrop'; import Fade from '@material-ui/core/Fade'; import Fab from '@material-ui/core/Fab'; import SendRoundedIcon from '@material-ui/icons/SendRounde...
define(function (require) { 'use strict'; var View = require('view'), // Templates menuTemplate = require('text!templates/menu.html'); function MenuView () { View.apply(this, arguments); } _.extend(MenuView.prototype, View.prototype, { classList: ['menu'], domEvents: { '.main .item.create-grid': { ...
$(document).on("click", ".add-to-cart", function() { var id = $(this).data("id"); $.ajax({ type: "POST", url: "assets/include/add_to_cart.php", data: { pid: id }, }); var items = parseInt($(".cart-items").text()); $(".cart-items").text(items + 1); var current = parseInt(...
import React, {Component} from 'react'; import shouldPureComponentUpdate from 'react-pure-render/function'; //ref1 { statuses: [] } //ref1 { statues: [{id:1, content: "asdf"}] } if(JSON.stringify(statues) === JSON.stringify(statuses)){ } class Toolbar extends Component { //onClick={this.addLike.bind(this)} ...
import React from 'react'; import BlendedStars from './BlendedStars.jsx'; import SearchReviews from './SearchReviews.jsx'; import { TopBarStyleContainer } from './Styles.js'; const TopBarContainer = (props) => { return ( <TopBarStyleContainer> <BlendedStars stars={props.stars} visibleReviews={props.visibl...
import React from 'react'; import PropTypes from 'prop-types'; import { Route, Redirect } from 'react-router'; import { withStyles } from '@material-ui/core/styles'; import Grid from '@material-ui/core/Grid'; import Card from '@material-ui/core/Card'; import CardMedia from '@material-ui/core/CardMedia'; import { conne...
import { takeLatest, put } from 'redux-saga/effects'; import log from '../../common/libs/logger'; import { SECTION_GET } from '../actions/types'; import { sectionSet } from '../actions'; import api from '../../common/libs/api'; export function* sectionGet({ payload: { id } }) { log.info('sectionGet fired...', id); ...
//set up var flash = require('connect-flash'); var express = require('express'); var http = require('http'); var mongoose = require('mongoose'); var autoIncrement = require('mongoose-auto-increment'); var passport = require('passport'); var d = require('domain').create(); var fs = require('fs'); var app = express(); ...
/** * component class */ class Component { constructor(options) { Object.assign(this, options); // transfer scope to Scope defineGetterSetter(this.scope); // debug Component.instances.push(this); } /** * render to a dom node * @param {St...
import React from "react"; import PropTypes from "prop-types"; const Student = () => { return <>hello from student component</>; }; Student.propTypes = {}; export default Student;
exports.withdrawableExplain = { WITHDRAWN: 1, REFUNDED: 2, DISABLED_BY_ADMIN: 3, NORMAL: 4, NOT_YET_PAYABLE: 5, }; exports.paymentRecordMeaning = { FAILED_PAYMENT_REFUND: -10, FAILED_PAYMENT_EXECUTION: -5, PAYMENT_CREATED: 0, PAYMENT_COMPLETE: 5, PAYMENT_REFUNDED: 10, }; export...
const os = require('os'); const fs = require('fs'); console.log("Filesystem "); let filename = 'test.txt'; let message = 'Welcome to Nodejs'; let cpu = os.cpus(); fs.appendFile(filename, message, function (error) { if (error) { console.log('Error on create the file: ' + filename); } }); fs.readFile(f...
export const fetchSummoner = (summoner, success, errors) => { $.ajax({ url: `/api/summoners/${summoner}`, success, errors }); };
import theme from './theme'; import Button from './button-default'; export default function Hero(props) { const buttonStyles = ` background-color: #3333339c; ` return ( <div> <div className="hero-container"> <div className="content-container"> ...
const express = require('express') const cors = require('cors') const logger = require('morgan') const app = express() app.use(logger('dev'))// combined = full info && dev = development info app.use(express.json()) app.use(express.urlencoded({ extended: false })) app.use(cors()) app.get('/status', (req, res) => { ...
'use strict'; const path = require('path'); const Metalsmith = require('metalsmith'); const collections = require('metalsmith-collections'); const layouts = require('metalsmith-layouts'); const watch = require('metalsmith-watch'); //const markdown = require('metalsmith-markdown'); //const permalinks = require('metalsmi...
/** * Created by dell-pc on 2017/6/28. */ function Drag(id) { this.disX = 0; this.disY = 0; this.oDiv = document.getElementById(id); //·ÀÖ¹ÍϳöÒ³Ãæ var _this = this; this.oDiv.onmousedown =function(){ _this.fnDown(); }; } Drag.prototype.fnDown=function(e) { var oe = e || event;...
//link to http var http = require('http'); var url = require('url'); //start http server so we can run in browser http.createServer(function(req, res) { //get the temperature from url - we need the true parameter to read the individual values var query = url.parse(req.url, true).query; ...
function logout() { auth.signOut(); console.log('User Logged Out! '); console.log("Opened: "+window.location.href); var path = window.location.href; var split = path.split("/"); var x = split.slice(0, split.length - 1).join("/") + "/"; console.log("To be replaced with : "+ x+"index.html"); window.location.r...
import React from 'react'; const Bit = props => ( <div className={props.className}> <p>{props.body}</p> <h5>{props.timestamp}</h5> </div> ); export default Bit;
import React from 'react'; import './index.scss'; import Calendar from 'react-calendar'; const CalendarComponent = ({ onChangeValue, shadow }) => ( <div className="Calendar__component" style={!shadow ? { boxShadow: 'none' } : {}}> <Calendar onChange={onChangeValue} /> </div> ); export default CalendarCompone...
'use strict' const {ServiceProvider} = require('@adonisjs/fold') const admin = require('firebase-admin') class FirebaseAdminProvider extends ServiceProvider { register () { this.app.singleton('FirebaseAdmin', () => { const Config = this.app.use('Adonis/Src/Config') const config = { credenti...
if(window.Promise){ var promise = new Promise(function(resolve, reject){ var request = new XMLHttpRequest() request.open('GET', 'http://api.icndb.com/jokes/random') request.onload = function(){ if(request.status == 200){ resolve(request.response); console.log('we got data') } else { reject(Err...
var mongo = require('mongoskin'); var Promise = require('bluebird'); var helper = require('./helper.js'); var config = { host: '127.0.0.1', port: '27017', dbName: 'library' }; var log = helper.getLogger('db'); exports.connect = function(callback) { if (helper.db) { callback(null, helper.db); } log.info('连接...
const https = require('https'); const slack_path = process.env.SLACK_PATH; const slack_channel = process.env.SLACK_CHANNEL; const textFromPayload = function (payload) { if (payload._raw) { return payload._raw; } if (payload.errorMessage) { return payload.errorMessage; } return JSON.stringify(payload...
/** * @file RadioSelect.js * @author leeight */ import {DataTypes, defineComponent} from 'san'; import {create} from './util'; import {asInput} from './asInput'; const cx = create('ui-radioselect'); const cx2 = create('ui-radio'); /* eslint-disable */ const template = `<div class="{{mainClass}}"> <ul> ...
export const state = () => ({}); export const mutations = {}; export const getters = {}; export const actions = { async list({ commit }, { filters, currentPage, pageSize, sort }) { let r = await this.$axios.post( "/api/category", { filters: filters, currentPage: currentPage, pa...
const Burger = () => ` <div class="burger"> <span class="burger-line"></span> <span class="burger-line"></span> <span class="burger-line"></span> </div> `; export default Burger;
import React from "react" import { View, Image, ImageBackground, TouchableOpacity, Text, Button, Switch, TextInput, StyleSheet, ScrollView } from "react-native" import Icon from "react-native-vector-icons/FontAwesome" import { CheckBox } from "react-native-elements" import { connect } from "react-re...
var express = require('express'); const querystring = require('querystring'); var router = express.Router(); var page = require('../views/framed_article/template.marko'); var feedmodel = require('../model/feeds'); var feedkey = "local"; router.get('/', function (req, res, next) { var source = req.query.source; ...
document.addEventListener("DOMContentLoaded", function(event) { // Hamburguer toggle function toggleNav(){ document.getElementById("nav-list").classList.toggle("is-open"); } document.querySelector("#hamburguer").addEventListener("click", toggleNav); });
require(['view/a', 'view/b'], function(a, b) { a.say('hello'); b.say('world'); });
const math = require("./app").math; describe("math function", () => { test("multiply is correct", () => { const input1 = 11, input2 = 22, method = "times"; output = 242; expect(math(input1, input2, method)).toEqual(output); }); test("pass an invalid input", () => { const input1 = "11", input2 = 2...
import React, { useState, useContext } from "react"; import { makeStyles, withStyles } from "@material-ui/core/styles"; import Select from "react-select"; import Paper from "@material-ui/core/Paper"; import Typography from "@material-ui/core/Typography"; import Avatar from "@material-ui/core/Avatar"; import exclude fro...
import React, { Component, Fragment } from 'react'; import Button from '../UI/button'; import Image from '../UI/image'; import Par from '../UI/paragraphs'; import Counter from '../holders/counter'; import Modal from 'react-modal'; import WhatsApp from '../../images/iconfinder_whatsapp_287520.png' import Ig from ...
var sha256 = require("js-sha256"); /** * =========================================== * Export model functions as a module * =========================================== */ module.exports = dbPoolInstance => { const create = (user, callback) => { // run user input password through bcrypt to obtain hashed passw...
import React, { useReducer } from 'react'; import './GiftBox.css'; //ACTIONS const TOGGLE_BOX = '[GiftBox] Toggle' const toggleBox = () => { return { type: TOGGLE_BOX } } //REDUCERS (Update) const DEFAULT = { open: false, wasOpen: false } const reducer = ( state = DEFAULT, {type} ) => { switch(type) { ...
import React from "react"; import Card from "./Card"; //CategoryList displays a list of all 6 default categories inside a Card component class CategoryList extends React.Component { render() { return( <div> { this.props.categories.map((categoria, index) => { return ( //...
(function() { 'use strict'; angular.module('app') .directive('headerShrink', function($document) { return { restrict: 'A', link: function($scope, $element, $attr) { var resizeFactor, scrollFactor, blurFactor; var header = $document[0].body.querySelector('.about-header')...
//Define Objects and see if it working //https://api.myjson.com/bins/13ocs4 console.log("It works!"); var inputBox = document.querySelector("#input"); console.log("inputBox", inputBox); var obj = document.querySelector("#object"); console.log("object", object); var logList = document.querySelector("#logLis...
blue_21_interval_name = ["佳里","塭子內","看坪","樹林","槺榔口","永吉","三股","十份里","金德興","九塊厝"]; blue_21_interval_stop = [ ["佳里站","愛明橋","南佳里","南勢","鎮南宮"], // 佳里 ["蚶西港","劉厝","西劉厝","外渡頭","塭子內","永昌宮","蚶寮","蚶寮尾"], // 塭子內 ["看坪","下看坪","春園休閒農場"], // 看坪 ["樹林"], // 樹林 ["義合","下義合","槺榔口"], // 槺榔口 ["永吉"], // 永吉 ["東三股","三股","佳里榮民之家"], // 三股 ["十份里...
import React from 'react' import ReactDOM from 'react-dom' import Modal from '../../node_modules/react-bootstrap/lib/Modal' import Popover from '../../node_modules/react-bootstrap/lib/Popover' import Tooltip from '../../node_modules/react-bootstrap/lib/Tooltip' import OverlayTrigger from '../../node_modules/react-boot...
jQuery(document).ready(function(){ jQuery('#nav-account').addClass('active'); get_account_data(); // fill input fields with account data function get_account_data() { jQuery.ajax({ url: base_url+"account/get_account_data", cache: false, contentType: false, processData: false, ...
import { Meteor } from 'meteor/meteor'; import { createContainer } from 'meteor/react-meteor-data'; import React, { Component, PropTypes } from 'react'; import { Link } from 'react-router'; import RaisedButton from 'material-ui/RaisedButton'; import baseTheme from 'material-ui/styles/baseThemes/lightBaseTheme'; impor...
/* Facebook sharing*/ window.fbAsyncInit = function() { // FB JavaScript SDK configuration and setup FB.init({ appId : '1679995098975056', // FB App ID cookie : true, // enable cookies to allow the server to access the session xfbml : true, // parse so...
import React from 'react' import { graphql } from 'gatsby' import { Container, Section, BigHeading } from '../elements' import specialBackground from '../../static/specialSectionBackground.png' import Layout from '../components/Layout/Layout' import SEO from '../components/SEO' import PostCarousel from '../components/P...
var NAVTREEINDEX3 = { "command__parse_8c.html#a8769157e701120c7855feed61fa6741f":[2,0,32,23], "command__parse_8c.html#a89f64a00e7616e86cb8a32502bf51bd2":[2,0,32,22], "command__parse_8c.html#a8cd7794996f6a70cacd47a88c9182366":[2,0,32,16], "command__parse_8c.html#a9606ade62612df075df6ae982722ed63":[2,0,32,48], "command__...
/* eslint-disable react/prop-types */ import React, { useState, useEffect } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import Button from '@material-ui/core/Button'; import TextField from '@material-ui/core/TextField'; import Dialog from '@material-ui/core/Dialog'; import DialogActions from '...
var config = require('../config/config'); var Reward = require('../models/reward.model'); var User = require('../models/user.model'); var Nonce = require('../helpers/Nonce'); var Web3 = require('web3'); var Tx = require('ethereumjs-tx'); const web3 = new Web3(new Web3.providers.HttpProvider(config.web3.provier)); cons...
const ads_controller = require('./ads_controller'); module.exports = { ads_controller }
var User = require("../models/user") module.exports = { verifyLoggedInUser : (req, res, next) => { if (req.session && req.session.userId) { next(); } else { res.redirect("/users/login"); } }, currentLoggedUserInfo : (req, res, next) => { if (req.sessi...
import { Command } from './command' export class RemovePersonsCommand extends Command { constructor({ id = 0, params } = {}) { super() this.cmd = { id, method: 'personnelData.removePersons', params, } } }
$(function() { var rmbtn_cb = function() { if(!confirm('真的要删除吗?')) return; var row = $(this).parent().parent(); var isbn = row.children(':eq(0)').text(); $.get("./cart?action=rm&isbn=" + isbn, function(res) { var json = JSON.parse(res); if(json.errno == 0) row.remove(); else alert("删除失败!...
Component({ properties: { majorList: { type: Array, value: [] }, majorListType: { type: String, value: "" } }, methods: { choseMajor: function choseMajor(e) { var item = e.currentTarget.dataset.item; ...
import PropTypes from 'prop-types'; import React from 'react'; import { COLOR_TYPE, SIZE, SVG_COLORS, TYPE } from '../constants'; const Mark = ({ ratio, type, label }) => { const angle = Math.PI * ratio - Math.PI / 2; return ( <> {type !== TYPE.MAIN ? ( <> <ellipse cx={90 ...
(function () { "use strict"; /*global mockModalInstance*/ describe("DomainRemoveEntitlementsPromptCtrl", function () { var ctrl, domain, EntitlementsService, AlertsService; beforeEach(inject(function(_$injector_) { EntitlementsService = _$injector_.get("EntitlementsService"); AlertsService ...
import LRU from "lru-cache"; export default function (_moduleOptions) { const ONE_HOUR = 1000 * 60 * 60; const axCache = new LRU({ maxAge: ONE_HOUR }); this.nuxt.hook("vue-renderer:ssr:prepareContext", (ssrContext) => { ssrContext.$axCache = axCache; }); }
const gfm = require('cmark-gfm-js'); const fs = require('fs'); const markdown = fs.readFileSync(0, 'utf-8'); const html = gfm.convert(markdown); console.log(html);
import { getOrdinalColorScale } from '@nivo/colors'; import { curveFromProp, withDimensions, withTheme } from '@nivo/core'; import { line } from 'd3-shape'; import withPropsOnChange from 'recompose/withPropsOnChange'; export const commonEnhancers = [ withDimensions(), withTheme(), withPropsOnChange(['colors'], (...
import React from "react"; import MovieElement from "./MovieElement/MovieElement"; import LoadingScreen from "./LoadingScreen/LoadingScreen"; import "./MainContent.scss"; const MainContent = (props) => { if (props.movies.length > 0) { return ( <div className="mainContent"> {props.movies.map((movie,...
Ext.QuickTips.init(); Ext.onReady(function(){ Ext.override(Ext.menu.DateMenu, { render : function() { Ext.menu.DateMenu.superclass.render.call(this); if (Ext.isGecko || Ext.isSafari || Ext.isChrome) { this.picker.el.dom.childNodes[0].style.w...
import getReference from '../../src/actions/getReference'; describe('Configuration', () => { it('contains all the attributes of the handler', () => { expect(getReference.config).toBeTruthy(); expect(getReference.method).toEqual('GET'); expect(getReference.path).toEqual('/reference'); expect(getRefere...
import { connect } from 'react-redux'; import Trade from './trade'; import { getCurrentPrice } from '../../actions/price_actions'; import { trade } from '../../actions/transaction_actions' const mapStateToProps = (state, ownProps) => { return { coin: ownProps.match.params.coin, price: state.entities.prices, ...
import { Router, Route, Link } from 'react-router'; var React = require('react'), Draggable = require('react-draggable'); var body = document.body; var Home = React.createClass({ mixins: [ReactFireMixin], componentWillMount: function () { this.bindAsArray(new Firebase("https://critlink.firebaseio.com/"));...
var mutt__history_8h = [ [ "mutt_hist_complete", "mutt__history_8h.html#a9115fdadb99ef83565f9e4d5e436d3be", null ], [ "mutt_hist_observer", "mutt__history_8h.html#a48141d10454e61aa47334280ad18ace4", null ] ];
const {Given} = require('cucumber'); Given (/^I Launch the application$/, ()=> { const element = $('android=new UiSelector().resourceId("android:id/text1").text("App")') // wait for the element on home page to visible element.waitForExist({ timeout: 5000 }); });
/** * Copyright 2016 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in wr...
nj = require('numjs') module.exports = { //TODO: more numerically stable implementation. //also dear JS: implement operator overloading, this sucks sigmoid: function(x) { x_out = nj.multiply(x, -1) x_out = nj.add(nj.exp(x_out), 1) x_out = nj.divide(nj.ones(x_out.shape), x_out) ...
jQuery.noConflict(); (function($) { $(function() { getCount(); setInterval(getCount, 1000); var mailboxLink = $('.t3-megamenu a[href="'+$('#alertMessages').attr('href')+'"]'); mailboxLink.append($('#countUnread')); if($('#countUnread').html() > 0) { $('#countUnread').show(); } }); function getCount...
const nodeExternals = require("webpack-node-externals"); const path = require("path"); const TerserPlugin = require("terser-webpack-plugin"); const glob = require("glob"); module.exports = { entry: glob .sync("./dist/typescript/*.tsx") .reduce(function (entry, filePath) { entry[path.par...
var exec = require('cordova/exec'); var PLUGIN_NAME = 'ExternalApp'; var ExternalApp = { openYoutube: function(videoId, options, success, error) { exec(success, error, PLUGIN_NAME, 'openYoutube', [videoId, options || {}]); }, getAppStartTime: function(success, error) { // [workaround] 파라메터...
let mongoose = require('mongoose') let configurationSchema = new mongoose.Schema({ dosenTidakTetapMaxTime: String, password: String, payrollPasswordOther: String, payrollPasswordMonthly: String }) let Configuration = mongoose.model('Configuration', configurationSchema) module.exports = Configuration
import React, { Component } from "react"; import { connect } from "react-redux"; import { firestoreConnect } from "react-redux-firebase"; import { compose } from "redux"; import { Layout } from "antd"; import { BrowserRouter as Router } from "react-router-dom"; import SideNav from "./components/SideNav/SideNav"; import...
import React from "react"; import { render, fireEvent, getAllByPlaceholderText, getByLabelText, wait, } from "@testing-library/react"; import Header from "./Header"; import axios from "axios"; import userEvent from "@testing-library/user-event"; axios.get = jest.fn().mockResolvedValue({ data: [] }); axios.po...
var search = $( '.search' ), result = $( '.result' ), ajax = null; // Listen to keyup event search.on( 'keyup', function() { // Get and trim value var value = search.val(); value = $.trim( value ); // Abort ajax if( ajax ) ajax.abort(); // Ajax call ajax = $.ajax( { url : 'https://graph.faceb...
export const SET_HEADER_COMBO = 'HEADER:COMBO:SET'; export const SET_HEADER_PERIOD = 'HEADER:PERIOD:SET';
// packages import React from 'react' import { Route, Switch } from 'react-router-dom' // components
const fs = require('fs'); fs.readFile('./input.txt', (err,data)=>{ console.time("fun challenge") if(err) { console.log('error'); } console.log(data.toString('utf8')); console.timeEnd("fun challenge") })