text
stringlengths
7
3.69M
/*--- comment: 123 */ function fn_name() { } /*--- trying: something */ var x
var canvas; var context; var circleSize; var canvasSize; var fade; function drawCircle(x,y,size,color) { //draws a circle context.beginPath(); context.arc(x,y,size,0,2*Math.PI); context.fillStyle = color; context.fill(); context.closePath(); } function randomNum(num) {return Math.floor(Math.ra...
const Discord = require("discord.js"); const { Database } = require("npm.db"); const db = new Database("database"); const moment = require("moment"); exports.run = async (client, message, args) => { if(message.author.id !== '699597747657113653') if(message.author.id !== '548145246983159808') return; const bakımaldıka...
import gql from 'graphql-tag'; export const PAGINATION_CARS = gql` query paginationCars($limit:Int,$offset:Int){ paginationCars(limit:$limit,offset:$offset){ placa modelo tipo marca propietario documento detalle fecha imageUrl } totalCars } `;
// document.addEventListener('DOMContentLoaded', () => { /* マイルストーン1 */ // alertで'You got 5 guesses. Guess 1 to 5'と言うメッセージを表示させ、1から5までの数値を当てるよう指示する。 alert('You got 5 guesses. Guess 1 to 5'); // 答えの数値を2で用意 const answer = 2; // promptで'What do you guess?'と言うメッセージとともに、記入欄を表示させる let guess = prompt('What do you guess?...
function solve(arr, sort) { class Ticket { constructor(destination, price, status) { this.destination = destination; this.price = price; this.status = status; } } let tickets = []; for (let element of arr) { var [destination, price, status] =...
const React = require("react"); const NoteList = require("./note-list"); const NoteForm = require("./note-form"); const App = React.createClass({ // componentDidMount() { // document.body.addEventListener("click", this.handleClick); // }, // componentWillUnmout() { // document.body.remov...
/** * @license * Copyright (C) 2008 Google Inc. * * 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 l...
import * as actionType from '../../redux/actions/actionTypes' const initialState = { users: [ { firstName: 'demo', lastName: 'demo', email: '[email protected]', password: 'demo' }, { emaill: '[email protected]', passwordd: 'demo', } ], isLogged: false } cons...
$(document).on('click', '.messenger-trigger', function(e) { e.preventDefault(); $('.messenger').addClass('open') }) $(document).on('click', '#btn-close', function(e) { $('.messenger').removeClass('open') }) $(document).on('click', '.video-trigger', function(e) { e.preventDefault(); $('.video').addClass('ope...
export const USER_SUCCESS = "USER_SUCCESS" export const USER_FAILURE = "USER_FAILURE" export const USER_REQUEST = "USER_REQUEST"
import { h, createContext, render } from 'preact'; import { useContext, forwardRef } from 'preact/compat'; import { setup, css, styled, keyframes } from '../index'; import { extractCss } from '../core/update'; describe('integrations', () => { it('preact', () => { const ThemeContext = createContext(); ...
var gulp = requre('gulp') gulp.task('copy', function(){ gulp.src('./src/*.html') .pipe('./build') })
import firebaseInstance from '../../middleware/firebase' import {LocalStorage} from 'quasar' import usersActions from '../store/users/actions' const state = { loggedIn: false } const mutations = { setLoggedIn(state, value) { state.loggedIn = value } } const actions = { registerUser({}, payload) { re...
const { RichEmbed } = require("discord.js"); module.exports = async (client, message, args, prefix) => { message.delete(); if (args.length < 1) { return message.channel.send(setEmbed(client, message)); } let length = args[0].length; // Emoji generico // <a:nome:123456789987654321> // ...
var passport = require('passport'); var mongoose = require('mongoose'); LocalStrategy = require('passport-local').Strategy; var User= mongoose.model('User'); module.exports = function() { passport.use(new LocalStrategy( (username,password,done)=> { User.findOne({username:username}).exec((err,user)=> { ...
define([ ], function (namespace) { 'use strict'; /* Sepacial for group and topic management */ return 'group'; });
//rewrite JS code to have something easier to parse //the JS code is no more an AST, but a sequence of intructions (where some instructions can be sequence too) //the main function is rewriteJS(fileName) var esprima = require('esprima'); var fs = require('fs'); var fileName = process.argv[2]; var abst = {}; var tmp...
import React, { useEffect, useState } from "react"; import CircularProgress from "@material-ui/core/CircularProgress"; import Footer from "../components/Footer"; import { useParams, NavLink } from "react-router-dom"; import axios from "axios"; import "./styles/bookdetail.css"; import ArrowBackIcon from "@material-ui/ic...
import React from "react"; function SystemSelectionMenu(){ return( <div> <h1>SystemSelectionMenu</h1> </div> ); } export default SystemSelectionMenu;
export {default as AppNavigation} from './AppNavigation'; export {default as AppContainer} from './AppContainer';
import React from 'react'; import { shallow } from 'enzyme'; import Field from '../Field'; describe('Field Component Tests', () => { const component = shallow(<Field/>); const mockOnChange = jest.fn(); test('Check if component renders without failure', () => { expect(component.find('input').length).toBe(1);...
#!/usr/bin/env node 'use strict'; process.title = 'arc-changelog'; const colors = require('colors/safe'); const gulp = require('gulp'); const conventionalChangelog = require('gulp-conventional-changelog'); function makeChangelog() { console.log('Creating changelog...'); return new Promise((resolve, reject) => {...
// generated by Neptune Namespaces v4.x.x // file: tests/Art.EryExtensions.Aws/DynamoDbPipeline/index.js (module.exports = require('./namespace')) .addModules({ Basics: require('./Basics'), CrossPipelineEvents: require('./CrossPipelineEvents'), Indexes: require('./Indexes') });
import { connect } from 'react-redux'; import dictList from './dictList'; import { removeDictionary, toggleWordCreator } from '../../../../actions/actions'; import { getDictionaries } from '../../../../reducers/getState'; const mapStateToProps = (state) => { return { dictionaries: getDictionaries(state.dictionar...
import React from 'react'; import './ImageLinkForm.css' const ImageLinkForm = ({onInputChange, onButtonSubmit}) =>{ return( <div> <p className="f3" style={{color:"blue"}}> {'This Application will detect faces in your uploaded images. Have fun!'} </p> <div className="center"> ...
const edfFrontBoxStyle = { height: '100%', padding: '25px 0 5px 2px', borderRadius: '4px', boxShadow: '2px 2px 8px -3px rgba(0, 0, 0, 0.5)', backgroundColor: '#eef1f6', display: 'flex', flexDirection: 'column' } const edfBackBoxStyle = { ...edfFrontBoxStyle, padding: '0 0 5px 2px', } const edfImgWrap...
/*changePanel * Used to swap divs that are of the same container type (css class) * panel - the id of the panel to display * containers - the class that is associated with the group of divs */ function changePanel(CollectionName,TabName) { jQuery('.'+CollectionName).hide(); jQuery('#'+TabName).fadeIn(); return ...
import React, { Component } from 'react'; import 'react-bootstrap'; class Blog extends Component{ render() { return ( <div> <section className="engine"> <a rel="external" href="https://mobirise.com">https://mobirise.com/ </a></section> <section className="mbr-section article mbr-par...
$(function () { $(document).on("click", ".sig_btn", function () { var phoneid = $.trim($("#sig_mobile").find(".sig_input").val()); var username = $.trim($("#sig_name").find(".sig_input").val()); // alert(username); var userpwd = $.trim($("#sig_pwd").find(".sig_input").val()); ...
export * from './MyCustomAdapter';
import React from 'react'; import ReactDOM from 'react-dom'; import { Router, Route, hashHistory, IndexRoute } from 'react-router' import { authCheck } from './services/auth'; // Styles import 'bootstrap/dist/css/bootstrap.css'; import './index.css'; // Components import App from './App'; import NotFound from './com...
import { use, assert, expect } from "chai"; import assertArrays from "chai-arrays"; import mocha from "mocha"; import getMovies from "../movie"; use(assertArrays); var moviesResult = null; //get the first movie as the sample test with var movieResult = null; function resetResults() { moviesResult = movieResult = ...
jQuery(document).ready(function () { jQuery('form.repeater').repeater({ // (Optional) // "defaultValues" sets the values of added items. The keys of // defaultValues refer to the value of the input's name attribute. // If a default value is not specified for an input, then it will // have its value cleared...
import React from 'react' import { Text, View, StyleSheet } from 'react-native' const styles = StyleSheet.create({ title: { fontSize: 100 } }) const TestScreen = () => { return ( <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center'}}> <Text style={styles.title}>Test</Text> </...
// Project : Drug Approval Analytics // Version : 0.1.0 // File : \src\utils\scrapers.js // Language : Python 3.9.5 // ----------------------------------------------------------------------------- // Author : John James // Company : nov8.ai // Email : [email protected] // URL : https://github.com/john...
const express=require('express') const route=express.Router(); const theauth=require('../middelware/check') const order=require('../model/ordercol') const product=require('../model/productcol') route.get('/',async(req,res)=>{ const find=await order.find() .then((data)=>{ const ans={ coun...
import {useState, useEffect} from "react"; import {Link} from "react-router-dom"; import axios from "axios"; import AvatarImg from "../../assets/img/main1.jpg"; import PostImgCarousel from "../../components/sub/PostImgCarousel"; import CommentCard from "../../components/card/CommentCard"; import PostFooter from "../../...
function myFizzBuzz(num) { if (typeof num !== 'number') return false; if (num % 3 === 0 && num % 5 === 0) return 'fizzbuzz'; if (num % 3 === 0) return 'fizz'; if (num % 5 === 0) return 'buzz'; return num; } const expected = myFizzBuzz(7) test('Check that it is not divisible 5 and 3' , () => { expect(ex...
const { bindActionCreators } = require('redux') module.exports = function wrapActionCreators(actionCreators) { return dispatch => bindActionCreators(actionCreators, dispatch) }
const User = require('../models/user.model'); module.exports = function(async, Group){ return{ SetRouting : function(router){ router.get('/results', this.getResults); router.post('/results', this.postResults); }, getResults: function(req, res){ ...
import React from 'react'; import { PieChart, Pie, Sector, Cell, Tooltip } from 'recharts'; import {observer, inject} from 'mobx-react'; const COLORS = ['#0088FE', '#00C49F', '#FF8042']; @inject("ViewStore", "ApiStore") @observer class PollChart extends React.Component{ constructor(props) { super(props); ...
"use strict"; var bcrypt = require('bcrypt-nodejs'); var SALT_WORK_FACTOR = 10; var crypto = require('crypto'); module.exports.createRandomHash = function () { var currentDate = (new Date()).valueOf().toString(); var random = Math.random().toString(); return crypto.createHash('sha1').update(currentDate + r...
var $window = $(window); var $up = $('#up'); function checkScroll(event){ var scrollTop = $window.scrollTop(); var 업버튼_보여질_포지션 = 100; if(scrollTop > 업버튼_보여질_포지션) { $up.fadeIn(); } } function goTop(){ $('html, body').animate({scrollTop:0}, 400); } $window.on('scroll', checkScroll); ...
class SymbolTable { constructor(parent) { this.parent = parent; this.symbols = {}; this.symbolCnt = 0; } addSymbol(declNode) { this.symbolCnt += 1; this.symbols[declNode.symbol.raw] = { idx: this.symbolCnt, declNode }; } symbolDefined(raw) { return t...
const autoprefixer = require('autoprefixer') //后处理css css编译完成后(stylus -> css) 通过autoprefixer优化-->css属性加前缀(兼容浏览器) module.exports = { plugins: [ autoprefixer() ] }
//Number //Prototype // IF, IFELSE, ELSE Number.prototype.entre = function (inicio, fim) { return this >= inicio && this <= fim } const imprimirResultado = function (nota ) { if(nota.entre(9, 10)) { console.log(nota + ' Quadro de honra') } else if (nota.entre(7, 8.99)) { console.log(nota + ' ...
// Filename: ScriptEventsPumpHouse.js // Author: Leonard Daly and Don Brutzman // Identifier: http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/ScriptEventsPumpHouse.js // Created: 8 October 2007 // Revised: 14 April 2008 // Reference: http://www.web3d.org/x3d/co...
initMap = function() { var map = new google.maps.Map(document.getElementById('map'), { zoom: 12, center: {lat: 37.3382, lng: -121.8863}, // Initialize map view to Mountain View // styles: gray_mode, // Night mode, }); }; /*global OHE _config*/ var OHE = window.OHE || {}; OHE.map = OHE...
var config = require('./cfg'); var _ = require('lodash'); var Promise = require('bluebird'); var slack = require('slack'); var bodyParser = require('body-parser'); var express = require('express'); var app = express(); app.use(bodyParser.json()); app.post('/', function(req, res){...
const config = require('./db/config.json') const util = require('util') const discord = require('discord.js') const client = new discord.Client({ fetchAllMembers: false, disableEveryone: true}); const { Client, Communicator, FriendStatus } = require('fortnite-basic-api'); const fs = require('fs').promises; const path ...
const TMDB_ENDPOINT = "https://api.themoviedb.org/3"; const APIKEY = "087d40cd76f8efab563b10d15f9a6ae2"; const IMG_PREFIX = "https://image.tmdb.org/t/p/w500"; let xhr; let xhr2; carregaFilmesLancamentos(); carregaFilmesPopulares(); // filmes - Populares - Início // function carregaFilmesPopulares() { xhr = new X...
import React from 'react'; import {Switch, Route} from 'react-router-dom'; import About from './components/About_us'; import Home from './components/Home'; import Gallery from './components/Gallery'; import Reviews from './components/Reviews'; import Blogs from './components/Blogs'; import Order from './components/Orde...
// eslint-disable-next-line import React from "react"; function Footer(){ return(<div> <footer> <div className="ftr-bar"> <div className="In-ftr"> <ul> <li className="ftr-li"><span><h3>All Programs</h3></span> <span><a href="#">Refferal Program</a...
'use strict'; const RequestedCheck = require('./requested.check'); const DocScanConstants = require('../../../doc.scan.constants'); const Validation = require('../../../../yoti_common/validation'); const RequestedWatchlistScreeningConfig = require('./requested.watchlist.screening.config'); /** * @class RequestedWatc...
import SudokuGridView from "./sudoku_grid_view.js" ; class SudokuHintView extends SudokuGridView { constructor(game){ super(game); this.$displayHint = $(".display-hint"); this.$displayHint.on("click", this.displayHint.bind(this)); } updateHint(){ const check = $(".display-hint").children().h...
var express = require('express'); var app = express(); var bodyParser = require('body-parser'); var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/quotes_revisited'); var quoteSchema = new mongoose.Schema({ name : String, quote : String, created_at : Date }) var Quote = mongoose.model('quote'...
const rp = require('request-promise'); const $ = require('cheerio'); const fs = require('fs'); exports.execute = function () { const url = 'https://en.wikipedia.org/wiki/List_of_Presidents_of_the_United_States'; return rp(url) .then(function(html){ //success! const dom = $.load(html)...
import request from '@/utils/request' import basicErrorHandler from './errorHandler' import md5 from 'blueimp-md5/js/md5' export async function post(title, text) { const parseType = 'draft-0.0.1' // 解析方式版本 const hash = md5(title + text) // 用于防止重复提交 return request('/article', { method: 'post', requestType...
import Ember from "ember"; import { test } from 'ember-qunit'; import startApp from '../helpers/start-app'; import Validation from 'furnace-validation'; import PropertyValidator from 'furnace-validation/property'; import ObjectValidator from 'furnace-validation/object'; var App; module('Validator module tests'...
import {Controller} from "stimulus"; export default class extends Controller { /** * * @type {string[]} */ static targets = [ "title" ]; /** * * @param options */ open(options) { if (typeof options.title !== "undefined") { this.titleTarget...
import React from "react" import { Link } from "gatsby" import { useFeatured } from "../queries/useFeatured" import mainBlogStyles from "../styles/mainBlogStyles" const Featured = () => { const posts = useFeatured() const classes = mainBlogStyles() return ( <div className={classes.container}> ...
var pluralizer = function (noun, number) { if (number === 1) { console.log (number + " " + noun); } else if (number > 1) { console.log (number + " " + noun + "s"); } } pluralizer ("cat", 3);
const EventEmitter = require("events"); class Emitter extends EventEmitter{ } let emitter = new Emitter(); emitter.setMaxListeners(11); emitter.on("test",()=>{ console.log("1::hello"); }) emitter.on("test",()=>{ console.log("2::hello"); }) emitter.on("test",()=>{ console.log("3::hello"); }) emitter.on("test",(...
import styled from "styled-components" import {Content} from "../Styled" export const HomeContentWrapper = styled.div` display: flex; flex-grow: 1; ` export const HomeStyledContent = styled(Content)` display: flex; margin-top: 33px; margin-bottom: 33px; `
import React, {useState} from 'react'; function Portfolio() { // const [project, setProject] = useState(0); const [projects] = useState([ { title: 'wordUp', github: 'https://github.com/njderenne/wordUp', deploy: 'https://fast-shelf-56121.herokuapp.com/', ...
routerApp .controller( 'schoolDataControllerHome', [ '$scope', '$http', function($scope, $http) { $scope.$on('LastRepeaterElement', function() { console.log('LastRepeaterElement'); setTimeout(function() { loaded123($scope); }, 250); ...
module.exports = { rules: { // Enforce “for” loop update clause moving the counter in the right direction // https://github.com/eslint/eslint/blob/master/docs/rules/for-direction.md 'for-direction': 'error', // Enforces that a return statement is present in property getters // https://github.com/...
import React from 'react'; import { Link, useHistory } from 'react-router-dom'; const HamburgerMenu = () => { return ( <Link to='/mobile-nav-links'> <div className='hamburger-container'> <div className='line line-1'></div> <div className='line line-2'></div> <div className='line lin...
import { render } from 'react-dom' import React, { useState } from 'react' import { useSprings, animated, interpolate } from 'react-spring' import { useGesture } from 'react-use-gesture' import './App.css' import cardBack from './images/cardback.png'; import cardAH from './cards/AH.jpg'; import card2H from './cards/2...
/* Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b are called amicable numbers. For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55...
chrome.extension.onConnect.addListener(function(port) { port.onMessage.addListener(function(msg) { console.log(msg); displayCSS(msg.sURL, msg.aEmbeddedCSS, msg.aExternalCSS); port.disconnect(); }); }); function displayCSS(sURL, aEmbeddedCSS, aExternalCSS) { document.title = 'CSS - ' + sURL; getElem(...
var level = require('level-test')() , sublevel = require('level-sublevel/bytewise') , index = require('../../index') , search = require('../../search') , db = sublevel(level('level-scout'), { valueEncoding: 'json' }) , num = 0 require('./tape-debug') module.exports = function (installInde...
/** * 说明: * 1、添加公式先按照../公式添加简要.txt,在函数弹出框注册; * 2、公式还要在使用的时候进行全局js注册; */ window.SyswinVal = { getEditFormula: function getEditFormula(spread) { return null; }, isValidFormula: function isValidFormula(sheet, formula) { return true; }, clearFormula: function clearFormula(spread) {}, clearTplCache: function ...
var api_url = "http://localhost:8080/"; jQuery.ajaxSetup({async:false}); function update() { var f = $("#from").val(); var t = $("#to").val(); if(f && t) { dt = { t1: Math.floor(new Date(f)/1000), t2: Math.floor(new Date(t)/1000)+86399 }; $.post(a...
(function (window, document, tplUtils) { 'use strict'; var isInitial = true, name = ''; // id is a string with iframe's id window.runSarineYoutubePlayer = function (id) { var player, tag = document.createElement('script'), devLog = tplUtils.devLog;; if (isInitial) { tag.src = "https://www.youtub...
module.exports = (sequelize, Sequelize) => { const Product = sequelize.define("product", { id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true }, brand_id: { type: Sequelize.INTEGER, references: { mo...
export const getCookieValue = (cookieName) => { const name = cookieName + '=' const ca = document.cookie.split(' ') .filter(c => c.startsWith(name)) if (ca.length >= 1) { const values = ca[0].split('=') return decodeURIComponent(values[1]) } return null } export const setCookieVa...
export { // ACESFilmicToneMapping, // AddEquation, // AddOperation, // AdditiveBlending, // AlphaFormat, // AlwaysDepth, // AlwaysStencilFunc, AmbientLight, AmbientLightProbe, // AnimationClip, // AnimationLoader, // AnimationMixer, // AnimationObjectGroup, // Ani...
import React from 'react'; import { Row, Col, Form, FormControl } from 'react-bootstrap'; import '../../App.css'; const SortBy = (props) => { return ( <div> <Row> <Col md={3}> <div id='search-div'> <p id='small-search-text'>Search {props.pageName}:</p> {/* <Form in...
import initMiddlewares from './middlewares'; import initReducers from './reducers'; const stacks = [ initMiddlewares, initReducers, ]; export default stacks;
$(function() { $(".showUploadTrainingResultsModal").click(function(e) { $.tinybox.show($("#modalUploadTrainingResultsCsv"), { overlayClose: false, opacity: 0 }); }); $("#doUploadTrainingResultsCsv").mupload({ buttonText: "Upload spre...
import { connect } from 'react-redux'; import Example from '../screens/Example'; import { getExampleState } from '../redux/reducers'; import {EXAMPLE_USER_ACTION} from '../actions' const mapStateToProps = (state) => ({ value: getExampleState(state) // uses selector to get state }); const mapDispatchToProps = (dis...
const express = require('express') const hbs = require('hbs') require('./db/mongoose') const User = require('./models/user') const auth = require('./middleware/auth') const bodyParser = require('body-parser') const path = require('path') const app = express() const PORT = process.env.PORT || 3000 // paths for expres...
const Doctor = require('./doctor'); const Pantient = require('./pantient'); const Schedule = require('./schedule'); const User = require('./user'); const Visit = require('./visit'); module.exports = { Doctor, Pantient, Schedule, User, Visit };
alert('어서오세요 사이퍼즈 세계에!!');
import Chart from "../Chart/Chart"; const ExpensesChart = (props) => { return <Chart data={props.filteredData} />; }; export default ExpensesChart;
'use strict'; angular.module('demoAppApp') .controller('ResultDetailController', function ($scope, $rootScope, $stateParams, entity, Result, Investigation) { $scope.result = entity; $scope.load = function (id) { Result.get({id: id}, function(result) { $scope.result = res...
self.__precacheManifest = (self.__precacheManifest || []).concat([ { "revision": "941f0f0fa7438a5cbaf0bb0783f50439", "url": "/index.html" }, { "revision": "90ac4a614d5e4488bd64", "url": "/static/css/main.d848d16b.chunk.css" }, { "revision": "4faf76328267412a5f1c", "url": "/static/js/2....
import * as glext from "./../../GLExt/GLExt.js" import * as sys from "./../../System/sys.js" import * as vMath from "./../../glMatrix/gl-matrix.js"; import * as ui from "./ui.js" import * as command from "./command.js" import * as brushInterpolator from "./brushInterpolator.js" import { CLayer, CRasterLayer, CV...
"use strict"; let camera = null; let defaultEaseTime = 20000000000000000000000000; function createCamera(x, y, z, rx, ry, rz, viewangle) { camera = mp.cameras.new("Cam", {x: x, y: y, z: z}, {x: rx, y: ry, z: rz}, viewangle); camera.setActive(true); mp.game.cam.renderScriptCams(true, true, defaultEaseTime,...
import React from 'react' import './Hero.css' import PlusSign from '../../images/plus-sign.png' import bracketImg from '../../images/brackets.png' class BracketsList extends React.Component { constructor(props) { super(props) console.log('THIS.PROPS', this.props) this.state = { show: true } this.showBra...
import chai from 'chai'; import Deck from '../../lib/deck/Deck'; const SUITS = require('../../lib/deck/suits.json'); const VALUES = require('../../lib/deck/values.json'); import Card from '../../lib/deck/Card'; import _ from 'lodash'; const assert = chai.assert; describe('Deck', () => { let deck; beforeEach((...
import {Form, Input, Icon, Select, DatePicker, Row, Col, Checkbox, Button, AutoComplete} from 'antd'; import React, {Component} from 'react'; import moment from 'moment'; import 'moment/locale/zh-cn'; import SearchModal from '../../components/modal/SearchModal.js' import {articleTypeGetAll} from '../../requests/http-re...
import Rx from 'rxjs/Rx' import { createSubscriber } from '../utils' // Rx.Observable.interval(500) // .take(5) // .subscribe(createSubscriber('interval')) // Rx.Observable.timer(1000, 500) // .take(3) // .subscribe(createSubscriber('timer')) Rx.Observable.of('Hello!', 42, 'wow') .subscribe(createSubscrib...
const pwd = process.env.PWD module.exports = function() { return pwd; }
var level = require('levelup'), levelMultiply = require('level-multiply'), indexPeek = require('./indexing/indexPeek.js'), matcher = require('./matchers/matcher.js'), calibrater = require('./indexing/calibrater.js'), indexer = require('./indexing/indexer.js'), deleter = require('./indexing/deleter.j...
// Setup a host to map to an externally facing IP via NAT-PMP // https://tools.ietf.org/html/draft-cheshire-nat-pmp-03 const natpmp = require('nat-pmp'); const netroute = require('netroute'); exports.getExternalIp = function(port) { console.log('hello') const gateway = netroute.getGateway(); const client = new n...
'use strict'; const byteArrayToString = (byteArray) => { const pad2 = x => x && x.length == 1 ? '0' + x : x; const bytes = Array.from(byteArray || []) .map(x => x !== undefined ? pad2(x.toString(16)) : '?'); return `[${bytes.join(', ')}]`; }; /** * @class Buffer * @param {Object} options * @pa...
module.exports = class Book { constructor(name, author, genre, id) { this.name = name; this.author = author; this.genre = genre; this.id = id; } static create({ name, author, genre, id }) { return new Book(name, author, genre, id); } };