text stringlengths 7 3.69M |
|---|
// Object is not iterable only array and string is iteratable so how can i iterate object for loop
// We can notdirectly iterate on object we need to firstly transform object in to array then we can iterate easily
const weekdays = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];
const openingHours = {
... |
import React from 'react';
import moment from 'moment';
import { Session } from 'meteor/session';
import { withTracker } from 'meteor/react-meteor-data';
const FeatListItem = (props) => {
const className = props.feat.selected ? 'item item--selected' : 'item';
return (
<div className={className} onClick={() =... |
import { createTransport } from "nodemailer";
const MAIL_SENDING_E_MAIL = "[email protected]";
const MAIL_SENDING_MAIL_PASSWORD = "ckpassforgmail";
const transportOptions = {
host: "smtp.gmail.com",
port: 465,
secure: true,
auth: {
user: MAIL_SENDING_E_MAIL,
pass: MAIL_SENDING_MAIL_PASSWORD,... |
(function () {
$.log('init sound')
})
|
const ptr$ = (from, to) => {
return {
get v() {
return from();
},
set v(i) {
return to(i);
}
};
};
const refName = "ptr$(";
const indName = "$";
document.body.querySelectorAll('script').forEach((tag) => {
tag.getAttributeNames().forEach((name) => {
... |
const router = require('express').Router();
let Resto = require('../models/restaurant.model');
router.route('/').get((req, res) => {
Resto.find()
.then(restaurant => res.json(restaurant))
.catch(err => res.status(400).json('Error: ' + err));
});
router.route('/add').post((req, res) => {
//add ... |
import { GET_PROFILE_GITHUB_DATA_START, GET_PROFILE_GITHUB_REPOS_START } from '../../consts/actionTypes'
export const getProfileData = payload => ({
type: GET_PROFILE_GITHUB_DATA_START,
payload
})
export const getProfileRepos = payload => ({
type: GET_PROFILE_GITHUB_REPOS_START,
payload
}) |
const fs = require('fs');
const handleError = require('./handle-error');
const VALID_COMMANDS = {
CLEAR: 'CLEAR',
FLAG: 'FLAG',
UNFLAG: 'UNFLAG',
END: 'END'
};
const NUM_ROWS = 8;
const NUM_COLS = 8;
const commandsFile = fs.readFileSync('./commands.json');
const { commands } = JSON.parse(commandsFile)
com... |
import cx from 'classnames'
import React, { PureComponent } from 'react'
import { findDOMNode } from 'react-dom'
import PT from 'prop-types'
import rAF from 'dom-helpers/util/requestAnimationFrame'
import { noop } from '../utils/utils'
import {
UNMOUNTED,
WILL_ENTER,
DID_ENTER,
WILL_LEAVE,
DID_LEAVE,
hasE... |
/**
* AIT - building an http server on top of the net module
* this program displays a page that says hello if you go to
* localhost:8080/hello... and goodbye if you go to localhost:8080/goodbye
*/
var net = require('net');
/**
* Request object - takes http request string and parses out path
* @param s - http ... |
let bt = document.querySelectorAll('.bt')
/*con el foreach recorremos todos los elementos que esten en el bt*/
bt.forEach(e =>{
e.addEventListener('click', function(e){
const padre = e.target.parentNode;
padre.children[1].classList.toggle('animation')
padre.parentNode.children[1].class... |
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
function TreeNode(val) {
this.val = val;
this.left = this.right = null;
}
/**
* @param {TreeNode} root
* @return {number}
*/
var sumNumbers = function(root) {
var result =... |
chrome.runtime.onMessage.addListener(function (request) {
if (request.name === "procedure") {
switch (request.procedure) {
case 1:
var select = document.getElementById("p_kctsm");
select.value = 14; // 设为通识英语
document.getElementsByName("bt")[1].cl... |
angular.module('ngApp.preAlert').factory('PreAlertService', function ($http, config, SessionService) {
var PreALertInitials = function (shipmentId) {
return $http.get(config.SERVICE_URL + '/TradelaneShipments/PreALertInitials',
{
params: {
shipmentId: shipme... |
import isNumber from 'lodash/isNumber'
export default class Execution {
constructor() {
this.op = null;
this.left = null;
this.right = null;
this.parent = null;
}
setLeft(val) {
if (val instanceof Execution) {
val.parent = this;
}
this.le... |
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const {
VENUE_CATEGORIES,
COUNTRIES,
VENUE_DOORPOLICIES,
VENUE_PAYMENT_METHODS,
VENUE_MUSIC_TYPES,
VENUE_VISITOR_TYPES,
VENUE_DRESSCODES,
VENUE_FACILITIES,
} = require('../../shared/constants');
const {
pointSchema,
translatedSch... |
const state = {
stops: [],
isLoading: false,
favorites: [],
};
const getters = {};
let lastQuery;
const actions = {
findStops({ commit, rootGetters }, query) {
if (!query) return commit('setStops', []);
lastQuery = query;
commit('setLoading', true);
return rootGetters['api/api']
.findSt... |
export const config = {
api: {
baseUrl: 'https://reels--video.herokuapp.com',
baseVideoUrl: 'https://www.youtube.com/embed',
imgURL: 'http://image.tmdb.org/t/p', // /{movieSize}/{movieIMGid}
imgagesSizes: {
backdrop_sizes: ['w300', 'w780', 'w1280', 'original'],
logo_sizes: ['w45', 'w92', 'w154', '... |
import React from 'react';
import Card from '../card';
import Grid from '@material-ui/core/Grid';
import PropTypes from 'prop-types';
const CardList = (props) => {
if(!props.cardClickFunc || !props.listData)
return null;
return (
<Grid data-test="cardListContainer" container spacing={2}>
{props.listData.map... |
import React, { useState } from "react";
import ReminderIcon from "@material-ui/icons/NotificationsOutlined";
import AccessTimeIcon from "@material-ui/icons/AccessTime";
import ArrowBackIcon from "@material-ui/icons/ArrowBack";
import "./Reminder.css";
import {
Button,
Card,
CardContent,
ClickAwayListener,
Di... |
// 分页器业务逻辑和代码
class Pagination {
constructor (select, options = {}) {
// options 是使用者传递进来的对象数据类型, 里面包含使用者需要的配置
// 构造函数体
// 你写的所有 this.xxx = yyy
// 都是将来 Pagination 创建出来的实例对象身上的成员
this.ele = document.querySelector(select)
// 需要一个表示当前是第几页的属性
// current: 当前
this.current = 1
// 需要一个表示一共... |
"use strict";
exports.__esModule = true;
function getCounter() {
function counter(str) {
}
counter.title = '123';
counter.add = function (str) { };
return counter;
}
var counter = {
title: '123',
add: function (str1) { }
};
var Sub = /** @class */ (function () {
function Sub() {
... |
import React from 'react'
import {Form, Button} from 'semantic-ui-react';
import "../../index.css"
class DogForm extends React.Component {
constructor() {
super()
this.state = {
name: '',
age: '',
breed: ''
}
}
// keep state up-to-date as the form fills for an... |
import React from 'react'
import { storiesOf } from '@storybook/react'
import BlockHeading from './index'
storiesOf('core|Components/Block Heading', module).add(
'with text content',
() => <BlockHeading>Sample Content</BlockHeading>,
{
info: 'Demonstates basic usage with text content',
}
)
|
export function makeAbsoluteURL(url) {
return url.startsWith('http://') ? url : 'http://theatrics.ru' + url;
}
|
import React, { Component } from 'react';
//import { connect } from "react-redux"
import Modal from 'react-responsive-modal';
import Datetime from 'react-datetime';
// import Select from 'react-select';
import Joi from 'joi-browser';
import Input from './helper/input';
import TextArea from './helper/textArea';
import S... |
import router from '../router'
import store from '../store'
const USERLOGIN = 'loginStatus'
//获取登录状态
export function getStatus() {
return localStorage.getItem(USERLOGIN)
}
//设置登录状态
export function setStatus(status) {
localStorage.setItem(USERLOGIN, status)
}
//移除登录状态
export function removeStatus() {
localS... |
import { StyleSheet } from 'react-native'
export default StyleSheet.create({
T1: {
fontSize: 20,
},
T2: {
fontSize: 18,
},
T3: {
fontSize: 16,
},
T4: {
fontSize: 14,
},
T5: {
fontSize: 12,
},
})
|
const mongoose = require('mongoose');
const Job = require('../models/job');
const Client = require('../models/client');
// post clients/add
exports.addClient = async (req, res) => {
const client = new Client({
name: req.body.name,
email: req.body.email,
phone: req.body.phone,
jobs: [],
})
await... |
import React from "react"
class Card extends React.Component {
constructor(props) {
super(props)
this.state = ({ image: this.props.src, faceUp: true })
}
flip() {
// use this form of setState since updates might be asynchronous
// see: https://facebook.github.io/react/docs/state-and-lifecycle.ht... |
import React from 'react';
import { Link } from 'react-router';
/**
* React component implementation.
*
* @author dfilipovic
* @namespace ReactApp
* @class TopRow
* @extends ReactApp
*/
const TopRow = (props) => (
<header className="bg-grad-stellar mt70">
<div className="container">
<div className="row m... |
var questionCounter = 0;
var selecterAnswer;
var correctTally = 0;
var incorrectTally = 0;
var unansweredTally = 0;
var questionArray = [
questions[0] = "What was Jason Voorhees' original mask?",
questions[1] = "In what movie did Johnny Depp make his acting debut?",
questions[2] = "Michael Myers received a round... |
import React, { useState } from 'react';
import {
Button,
Form,
Grid,
ModalHeader,
} from 'semantic-ui-react';
import { ChromePicker } from 'react-color';
import type Pillar from '../types/Pillar';
import { LOADING_TIME } from '../Constants';
import { deepCopyPillar } from '../logic/PillarHelper';
import { conv... |
_.Error = {
get: function(type) {
var err;
switch (type) {
case "PRODUCER_MISSING":
err = "Please fill the producer name";
break;
}
return err;
}
};
function error(type) {
return _.Error.get(type);
}
|
"use strict";
let money,time;
function start() {
money = +prompt("Ваш бюджет на месяц?", "");
time = prompt("Введите дату в формате YYYY-MM-DD", "");
while (isNaN(money) || money == "" || money == null ) {
money = +prompt("Ваш бюджет на месяц?", "");
}
}
start();
let appData = {
budget: money,
expen... |
const bs = require('browser-sync').create();
bs.init({
server: {
baseDir: "./public"
},
watchOptions: {
ignoreInitial: true,
ignored: '*.txt'
},
files: ['./public'],
host: 'localhost',
port: 7301,
logPrefix: "webpack",
logLevel: "info",
reloadDelay: 1500... |
import React, {useState, useEffect} from 'react';
import {connect} from 'react-redux';
import {getCategory} from '../redux/reducer';
import {withRouter} from 'react-router';
import CurrencyInput from 'react-currency-input';
const Categories = (props) => {
const onInputChange = (float, mask, e) => {
e.tar... |
(function () {
'use strict';
var Orders = require('../src/Orders');
var Fees = require('../src/Fees');
describe("Orders tests", function () {
var mockOrderItems, mockFlattenedFees, mockFees;
beforeEach(function () {
mockOrderItems = [
{
"or... |
"use strict";
let argv = require('yargs').argv,
gulp = require('gulp'),
concat = require('gulp-concat'),
include = require('gulp-include'),
pug = require('gulp-pug'),
replace = require('gulp-replace'),
stylus = require('gulp-stylus'),
uglify = require('gulp-uglify'),
browserify = req... |
#!/usr/bin/env node
const path = require("path");
const fs = require("fs");
const YAML = require("yamljs");
const Handlebars = require("handlebars");
const program = require("commander");
program
.version("1.0.0")
.option("-o, --output <path>", "Docusaurus output documents path", "./docs")
.option("-w, -... |
const express = require('express');
const fs = require('fs');
const router = express.Router();
var AdmZip = require('adm-zip');
const dbconnection = require('./../dataaccess/dbcontext');
const dbquery = require('./../dataaccess/query');
const multer = require('multer');
//const upload = multer({ dest: 'projects/' });
... |
const computePath = require('./utils').computePath
module.exports = options => ({
entry: [computePath('../src/app.ts')],
html: {
template: computePath('../index.html')
},
plugins: [
require('@poi/plugin-typescript')()
],
publicPath: './',
configureWebpack(config, context) {
const tsLintRule =... |
import React from 'react';
import './ClockListItem.scss';
import AnalogClock from '../AnalogClock/AnalogClock';
const ClockListItem = ({clock, onDelete}) => {
const getClockLabel = () => {
if (clock.timezone) {
const splitted = clock.timezone.split('/').reverse();
return (
splitted.map((ite... |
$(function(){
$('.carousel-item').eq(0).addClass('active');
var total = $('.carousel-item').length;
var current = 0;
$('#moveRight').on('click', function(){
var next=current;
current= current+1;
setSlide(next, current);
});
$('#moveLeft').on('click', function(){
var prev=... |
import actionTypes from './actionConstants';
const bankActionCreators = {
depositIntoAccount(amount) {
return {
type: actionTypes.DEPOSIT_INTO_ACCOUNT,
amount: amount
};
},
withdrawFromAccount(amount) {
return {
type: actionTypes.WITHDRAW_FROM_ACCOUNT,
amount: amou... |
var express = require('express'),
app = express(),
XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var log = require('./logger').logger.getLogger("HTTP-Client");
var subscriptionService = require('../db/schemas/subscriptionService'),
config = require('../config'),
uuid = require('uuid');
... |
function addNewLivechat(thing, livechat){
addNewThing(thing);
things[thing.elemId].docId = livechat._id;
let newLivechat = $('.livechat').clone();
newLivechat.removeClass('prototype');
newLivechat.css('display', 'flex');
$(`#${thing.elemId}`).append(newLivechat);
livechat.messages.forEach((message) => {
... |
'use strict';
/**
* @ngdoc function
* @name recnaleerfClientApp.controller:UserCtrl
* @description
* # UserCtrl
* Controller of the recnaleerfClientApp
*/
angular.module('recnaleerfClientApp')
.controller('menuCtrl', ['$scope','$location', 'UserSrv', '$ionicLoading','$state',function ($scope,$location,UserSr... |
'use strict';
const { clone, camelCase } = require('../../../../node_modules/lodash');
const { errors } = require('../../../lib/constants');
const ServiceError = require('../../../lib/util/service-error.js');
const { supportedTypes } = require('../../../lib/repository/config-repository');
module.exports = (req, res, ... |
import React, { Component } from 'react';
import { AppRegistry, Text, View } from 'react-native';
import Database from '../../database/Database';
export default class LogoutComponent extends Component {
static logoutUser = () => {
Database.getItemWithChildPath (Database.firebaseRefs.userLocationsRef, `/... |
document.addEventListener('DOMContentLoaded', Generator.welcome)
|
export { DetailCard } from './DetailCard';
|
import React, { Component } from 'react'
import Square from './Squares'
class GameBoard extends Component {
constructor(props) {
super(props);
this.state = {
previousBoard: Array(9).fill(null),
board: Array(9).fill(null),
xTurn: true,
undoDisabled: true,
restartDisabled: true,
... |
import React from 'react';
import './Aside.scss';
const Aside = () => {
return (
<aside className="react-aside">
<h2>DAYRY APP</h2>
<div>Comment whit no sense</div>
</aside>
);
};
export default Aside;
|
const Route = require('express').Router()
const UserController = require('../controllers/userController')
Route.get('/', UserController.getUsers)
Route.post('/register', UserController.register)
Route.post('/login', UserController.login)
Route.get('/unique/:email', UserController.cekEmail)
module.exports = Route |
const reducer = (state = [], action) => {
Object.freeze(state);
switch(action.type) {
case 'ADD_FRUIT':
return [
...state,
action.fruit
];
case 'REMOVE_FRUIT':
let newState = [...state];
newState.pop();
return newState;
default:
return state;
}
};
e... |
angular.module('rl-prevnext', [])
.directive('rlPrevnext', ['$document', function ($document) {
return {
restrict: 'EA',
replace: true,
scope: {
maxpages: '@',
callback: '&'
},
controller: ['$scope', function ($scope) {
} ],
templateUrl: "../scripts/lib/rl-prevnext/rl-prevnext.html",
... |
/**
* Created by xyh on 2017/6/7.
*/
import React from 'react';
import {
View,
Image,
Dimensions,
ToastAndroid,
StyleSheet
} from 'react-native';
import ViewPager from 'react-native-viewpager';
var deviceWidth = Dimensions.get('window').width;
const BANNER_IMGS = [
require('./../image/bann... |
// Set the require.js configuration for your application.
require.config({
deps: ["main"],
baseUrl: "assets/js/app/",
paths: {
// app
"main": "config/main",
"app": "config/app",
// base
"jquery": "vendor/jquery/jquery-2.2.2",
"backbone": "vendor/base/back... |
import validator from "validator";
export const validatePhoneNumber = (number) => {
const isValidPhoneNumber = validator.isMobilePhone(number);
return isValidPhoneNumber;
};
|
import React from 'react';
import { Text, StyleSheet } from 'react-native';
import { isFunction } from 'lodash';
const styles = StyleSheet.create({
main_text: {
fontSize: 17,
},
});
class Label extends React.PureComponent {
setRef = (view) => {
const { setRef } = this.props;
if (isFunction(setRef)) ... |
$(document).ready(function () {
"use strict";
var input1 = [36, 17, 28, 23];
var input2 = [20, 13, 14, 15];
var output1 = ["", "", "", ""];
var output2 = ["", "", "", ""];
var av = new JSAV("extMergeSortCON");
// Create an array object under control of JSAV library
var arr1 = av.ds.array(input1, {inde... |
/*
弹窗的基础类
*/
cc.Class({
extends: cc.Component,
properties: {
TOP: false, //此视图是否需要保持在最上面
LOCK: false, //是否要锁定此界面,不能自动执行上拉动作
TIMID: false, //此弹窗打开时,不隐藏其他弹窗,直接覆盖其上
UNIQUE: true, //此视图是否同时只能显示一个
ALWAYS_SHOW: false, //是否一直显示此视图
_all_data: { default: {}, visible: fa... |
"use strict";
const StickerMessage = require(__dirname + "/../../lib/message/sticker-message");
exports.testBuildStickerMessageSanity = test => {
const stickerId = 123;
const message = new StickerMessage(stickerId);
const messageBody = { "type": "sticker", "sticker_id": stickerId };
test.deepEqual(message.toJson... |
class FlowChart {
} |
const TEMPERATURE = "temperature";
const PRESSURE = "pressure";
const HUMIDITY = "humidity";
const TEMPERATURE_PL = "temperatura";
const PRESSURE_PL = "ciśnienie";
const HUMIDITY_PL = "wilgotność";
const URL = "http://192.168.191.239:1410/sensorsData";
const green = "rgb(0, 132, 0)";
const blue = "rgb(11,47,227)";
con... |
import WelcomeController from "welcome/welcome.controller";
export default {
templateUrl: "welcome/welcome.html",
controller: WelcomeController
};
|
$(function(){
// 初始化变量
$.fn.zidingyi=function(datas){
var datas=$.extend({
one:200,
two:'eddie',
three:false
},datas);
var aa=1;
function f1(){
console.log(datas.one+','+datas.two+','+datas.three);
};
f1();
}
}(jQuery)) |
var website = require('../models/website.js');
// check if job is in the database and invoke callback with results
exports.getWebsite = function (id, callback) {
website.findOne({ id: id }, function (err, website) {
callback(err, website);
});
}
// complete job by storing website in database
exports.storeWe... |
//Suvrajit karmaker
function myFunction() {
if (validate() == true) {
let question1 = new InputTypeMethod("div1", "question1");
question1.removeElement();
question1.update();
let question2 = new McqMrqMethod("div2", "question2", "radio");
question2.removeElement();
... |
/**
* Created by Administrator on 2016/3/28.
*/
import React,{
View,
Navigator,
Text,
BackAndroid,//回退按钮的功能
StyleSheet,
Component
} from "react-native"
import {SearchIndex} from "./SearchIndex"
import {SearchResult} from "./SearchResult"
var _navigator;
export class SearchWelcome extends Compo... |
import React, { useContext } from 'react';
import Menu from '@material-ui/core/Menu';
import MenuItem from '@material-ui/core/MenuItem';
import IconButton from '@material-ui/core/IconButton';
import LanguageIcon from '@material-ui/icons/Language';
import Tooltip from '@material-ui/core/Tooltip';
import Divider from '@m... |
import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';
import Style from './index.module.less';
import { inject, observer } from 'mobx-react';
import { notification } from 'antd';
import { addTopic } from '@common/api';
import Upload from '@components/upload/index';
import Avatar from ... |
import React from 'react';
export const images = {
defaultAddThumbnail: '/assets/images/add_thumbnail.png',
thumbnailMedia: '/assets/media/show_thumb_2.png'
};
|
const { ApolloServer, gql } = require("apollo-server");
// books example
const books = [
{
title: "arry potta",
author: "jk rowling"
},
{
title: "jurassic park",
author: "michael crichton"
}
];
const typeDefs = gql`
# book
type Book {
title: String
author: String
}
# the 'quer... |
var cloudinary = require('cloudinary');
cloudinary.config({
cloud_name: 'pricepls',
api_key: '287145665136215',
api_secret: 'Kfl99Unbk9CQKMf-kp6twk9DqeQ'
});
var s3_key_id = "AKIAITBZK2MKHOYDZY4Q";
var s3_key = "n5PdKny+tDuoDXbC0I9QLXCe/EjuzrJ8gHofYEYQ";
var lwip = require('lwip');
var s3 = require('s3');... |
console.log("hello from js");
var xyz = 1;
(function(){
console.log("hello from iify" + xyz )
})();
|
$( document ).ready(function() {
// -------- MENU --------------------------------
showMenu();
// show menu
function showMenu() {
$("#show_menu").animate({width:"0px"}, 100, function() {
$(".left_section").show();
$(".left_section").animate({width: "20%"}, 100);
});
}
$("#show_menu").click(function(){ s... |
const state={
position:{}, //存放位置信息
city:'', //存放城市名称
orderAddress:'', //存放收货地址
showPosition:false, //表明首页是否出现要求选地址的页面
};
export default state;
|
const router = require('express').Router();
const Contact = require('../Models/ContactModel');
router
.route('/')
.get((req, res) => {
Contact
.find()
.then(response => {
res.status(200).json(response)
})
.catch(err => {
re... |
const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()
const jwt = require('jsonwebtoken')
require('dotenv').config()
// Instead of using on middleware to authenticate user
// Using two middlewares one for authentication and the other
// for authorization helps when you just know if user... |
import { Data, newCharacter, newSkill, newSkillEffect, newDamageSkill, newSingleTargetDamageSkill, newBasicSingleTargetDamageSkill } from '../CharacterDataStructure'
Data.characters.push(newCharacter('Reimu Hakurei', 'https://en.touhouwiki.net/images/thumb/f/f7/Th175Reimu.png/355px-Th175Reimu.png', 18, 120, 100, [
n... |
function e () {
var type = arguments[0];
for (var i=0; i<arguments.length; i++ {
}
} |
const express = require('express')
const exphbs = require('express-handlebars');
let helper = require('./controller/helper');
var paginateHelper = require('express-handlebars-paginate');
const app = express()
const port = process.env.PORT || 5000
// Configure template Engine and Main Template File
app.engine('hbs', e... |
/* 🤖 this file was generated by svg-to-ts*/
export const EOSIconsDataUsage = {
name: 'data_usage',
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 2.05v3.03c3.39.49 6 3.39 6 6.92 0 .9-.18 1.75-.48 2.54l2.6 1.53c.56-1.24.88-2.62.88-4.07 0-5.18-3.95-9.45-9-9.95zM12 19c-3.87 0-7-3.... |
var connect = require('connect');
var router = require('./middleware/router');
var router = {
GET: {
'/users': function(req, res){
res.end('tobi, loki, ferret');
},
'/user/:id': function(req, res, id){
res.end('user ' + id);
}
},
DELETE: {
'/user/:id': function(req, res, id){
res.end('deleted use... |
$(function () {
var index = 0;
var ulImg = $(".wrap-imgList");
var imgWidth = $(".wrap-imgList li").eq(0).width();
var timerid;
timerid = setInterval(autoplay2, 4000);
$(".wrap-hd li").on('mouseenter', function () {
clearInterval(timerid);
$(this).addClass("on").siblings().remo... |
// Logging Middleware
export const Logger = store => next => action => {
console.group(action.type);
console.log("%cPrevious state:", 'color: #b3bd2d; font-weight: bold', store.getState());
console.log("%cAction", 'color: #6FAAF7; font-weight: bold', action);
let fin = next(action);
console.log("%c... |
import dcopy from 'deep-copy';
export const defaultActionSet = {
'SetGlobalVariables': null,
'PlaySounds': [{
SoundType: 0,
Val: ''
}],
'InitializeActorDialog': null,
'SetZone': null,
'ResetGame': false
};
export const defaultDialog = {
'IsRoot': true,
'EntryInput': [''],
'AlwaysExec': dcopy... |
module.exports = function(config){
config.set({
basePath : './',
files : [
'public/javascripts/vendor/require/build/require.js',
'public/javascripts/vendor/CesiumUnminified/Cesium.js',
'http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js',
'public/javascripts/vendor/angular/angular.js',
'pub... |
'use strict';
describe('getData', function () {
var scope;
beforeEach(function () {
module('utils');
inject(function ($rootScope) {
scope = $rootScope.$new();
});
});
it('should invoke jasmine spy handler with object represented in json file',
inject(functi... |
import riot from 'riot'
import {secondsToPeriod} from 'utils'
riot.mixin('format-helpers', {
timeAgo: function (val) {
if (!(val instanceof Date)) {
val = new Date(Date.parse(val))
}
const seconds = (new Date().getTime() - val.getTime()) / 1000
return `${secondsToPeriod(seconds)} ago`
}
})
|
module.exports = {
jwtSecret: process.env.JWT_SECRET || '02bb575a-bfa9-4c8c-aaca-33a752744fef'
}; |
module.exports = {
port: 3000,
server: {
api: '/api'
},
db: {
path: 'mongodb://localhost/testTask'
}
}; |
/* @flow */
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import createSagaMiddleware from 'redux-saga';
import ReduxThunk from 'redux-thunk';
import ReduxPromise from 'redux-promise';
import firebase from 'firebase';
import red... |
import electron from 'electron';
import fs from 'fs';
import path from 'path';
class Directories {
constructor() {
this.temp = this.initializeDir('temp', 'mpv');
this.files = this.initializeDir('appData', 'mpv-files');
}
initializeDir(base, dir) {
let fullDir = this.getDir(base, di... |
// API endpoints
const historyUrl = "https://boston-weather.phillipbaker.repl.co/history";
const forecastUrl = "https://boston-weather.phillipbaker.repl.co/forecast";
const currentUrl = "https://boston-weather.phillipbaker.repl.co/current";
// SVG dimensions
const w = 600;
const w2 = 400;
const h = 600;
const h2 = 300... |
/*Almacenamos las urls de las APIs en un objeto*/
const api={PAISES:'https://restcountries.eu/rest/v2/all', VECINOS:'https://api.geodatasource.com/neighbouring-countries'}
let lista = document.querySelector('#country');
/*Inicializamos el objeto XMLHttpRequest*/
function inicializaXhttp(){
return new XMLHttpReq... |
(function () {
"use strict";
var fs = require('fs');
var _ = require('underscore');
var util = require('util');
var when = require('when');
module.exports = function (_stream, _bytesCount, _width_set) {
var avgbuf = [ ],
avgindex = [ ],
peakbuf = [ ];
function update(chunk) {
for (var chunkIn... |
class Ball {
constructor(x,y,width,height){
var options = {
isStatic : false,
restituion:0.3,
friction:0.5,
density:1.2
}
this.body = Bodies.circle(200,500, 5, [options] )
World.add(this.body,world)
}
display(){
ellipseMode(CENTER);
fill("dark pink")
el... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.