text stringlengths 7 3.69M |
|---|
/* TDD style with BDD statements */
import Clogy from './Clogy';
import { singleton } from '../utilities';
// Passing arrow functions to Mocha is discouraged. Their lexical binding of the
// this value makes them unable to access the Mocha context, and statements like
// this.timeout(1000); will not work inside an ar... |
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
let data=[{
"name": "Indigo",
"code": "#cf3",
"imagepath": "http://dummyimage.com/30x30.jpg/5fa2dd/ffffff"
}, {
"name": "Indigo",
"code": "#e95",
"imagepath": "http://dummyimage.com/30x30... |
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
extends: [
'plugin:vue/vue3-recommended',
'eslint:recommended',
'@vue/typescript/recommended',
'@vue/prettier',
'@vue/prettier/@typescript-eslint',
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2... |
const THREE = require('three');
export default class Landscape extends THREE.Mesh {
constructor(geometry, materials, x, y, z) {
super(geometry, materials);
this.position.set(x, y, z);
this.scale.set(.8, .8, .8);
this.rotation.y = - 90 * (Math.PI / 180);
this.castShadow = true;
this.receiveSh... |
export function firebaseConfig() {
const firebaseConfig = {
apiKey: "AIzaSyCFl37E3GSFOOPBiuvjuFPUWtrx3P89tPs",
authDomain: "pmcivilengineer-2788c.firebaseapp.com",
databaseURL: "https://pmcivilengineer-2788c.firebaseio.com",
projectId: "pmcivilengineer-2788c",
storageBucket:... |
'use strict';
/**
* @description creates camel case string from arg
* @param {string} str
* @throws { InvalidArgumentException }
* @returns new string in camelCase form
*/
export const CamelCaseString = str => {
if (typeof str !== 'string')
throw new Error(
`[InvalidArgumentException] ${typeof str} is... |
var HomePage = function () {
'use strict';
// Home page
var objRepo = require('../resources/webObjectRepository.json');
var objLocator = new utils.objectLocator();
var waitActions = new commons.waitActions();
var buttonActions = new commons.buttonActions();
this.rewardsLink = objLocator.fi... |
import Vue from 'vue'
import App from './App'
import store from './store/index.js'
Vue.prototype.$store = store //vuex挂载全局
import util from 'utils/index.js'
Vue.prototype.$util = util //工具挂载全局
import Api from 'request/api.js'
Vue.prototype.$Api = Api //请求方法挂载全局
Vue.config.productionTip = false
App.mpType = 'app'
c... |
var ExperienceFactory = require('./experienceFactory');
var experienceCtrl = require('./experienceCtrl');
var experienceDirective = require('./experienceDirective');
angular
.module('experience', [])
.factory('ExperienceFactory', ExperienceFactory)
.directive('experienceList', experienceDirective)
.cont... |
class TreeCreateFast {
constructor(treeNode, treeConfig) {
this.treeNode = treeNode
this.treeConfig = Object.assign({
fId: 'p_id', // 关联的 parent_id 字段名
id: 'id', // 关联的 parent_id 的 id 字段名
rootId: '0', // 开始的 根节点关联的 parent_id 对应的 字段名
}, treeConfig)
this.treeData = [] /... |
import React from 'react';
import AppBar from 'material-ui/AppBar';
import IconButton from 'material-ui/IconButton';
import IconMenu from 'material-ui/IconMenu';
import MenuItem from 'material-ui/MenuItem';
import MdIconNotifications from 'material-ui/svg-icons/social/notifications';
import MdIconMenu from 'material-ui... |
// a constant is a variable that should be read-only after initial value is set
const express = require('express');
const router = express.Router();
// bring in controller
const deleteCtrl = require('../controllers/delete.controller');
// delete content by id
router.delete('/delete/:id', deleteCtrl.deleteOneById);
mo... |
import MockAdapter from 'axios-mock-adapter';
const senshuken = [
{ id: 1, name: 'クイズ1', desc: '111111111111' },
{ id: 2, name: 'クイズ2', desc: '222222222222' },
{ id: 3, name: 'クイズ3', desc: '333333333333' },
];
export default {
run: (client) => {
const mock = new MockAdapter(client);
mock.onGet('/sens... |
var schema = new Schema({
CLAIMID: Number,
ROOM_FEES_REQ: Number,
PROFESSIONALFEES_REQ: Number,
INVESTIGATION_CHARGES_REQ: Number,
PHARMACY_CHARGES_REQ: Number,
OT_CHARGES_REQ: Number,
OTHER_CHARGES_REQ: Number,
ROOM_FEES_PAID: Number,
PROFESSIONALFEES_PAID: Number,
INVESTIGATION_CHARGES_PAID: Numbe... |
// DO GET EMPLOYEES
function doGetEmployees(page) {
var emplSearchName = $("#empNameSearch").val();
$.ajax({
type : "GET",
url : "../employees?page=" + page + "&search=" + emplSearchName,
success: function(result){
$('#getResultDiv ul').empty();
$('#customerTable ... |
/* globals discard, query, notify, navigate, starters, prefs */
'use strict';
// Context Menu
{
const TST = 'treestyletab@piro.sakura.ne.jp';
const onStartup = async () => {
const contexts = ['browser_action'];
if (chrome.contextMenus.ContextType.TAB && prefs['tab.context']) {
contexts.push('tab');
... |
define([
'https://www.lactame.com/github/adobe-webplatform/Snap.svg/84fbff7d512c8145c522b71fc9c872cb0bcae49a/dist/snap.svg-min.js',
'./sequenceSplitter'
], function (Snap, sequenceSplitter) {
function getSVG(sequence, analysisResult, options) {
const {
width = 600,
leftRightBorders = 20,
spa... |
//This section is written by using Jquery.
//In this project, some pages are written by using pure Javascript and the others pages are written by using Jquery.
//I have done that just for practicing both Javascript and Jquery(a very popular library).
window.onhashchange = function () {
//reload page when changing ha... |
import React, { Component } from 'react'
import authService from '../../services/auth-service'
import usersService from '../../services/user-service'
import { Link, Redirect } from 'react-router-dom';
import qualificationService from '../../services/qualification-service'
import { withAuthConsumer } from '../../context... |
const Sequelize = require('sequelize');
const path = require('path');
const DatabaseSingleton = (function () {
let instance;
function init() {
// IN PRODUCTION:
// return new Sequelize('database', 'username', 'password', {
// host: 'localhost',
// dialect: /* one of 'mysql' | 'mariadb' | 'post... |
const express = require("express");
const nunjucks = require("nunjucks");
const courses = require("./data");
const server = express();
server.use(express.static("public"));
server.set("view engine", "njk");
nunjucks.configure("views", {
express: server,
autoescape: false,
noCache: true,
});
server.get("/", ... |
import React from 'react'
export const getRelationToPrev = (nowValue, prevValue) => {
const rel = nowValue/prevValue * 100;
if (rel < 100) {
return `-${100-rel}%`
}
else if (rel > 100) return `+${rel-100}%`
else return 'Without changes'
}
const Tableelement = ({exchange, baseValues, oneDayAgo}) =... |
const MONTHS = ["Январь", "Февраль", "Март", "Апр.", "Май", "Июнь", "Июль", "Авгус", "Сентябрь", "Октябрь"];
(function () {
let dateFromServer = '2020-04-27T15:23:24.121Z';
let date = new Date(dateFromServer);
// document.body.innerText = getStringFromDate(date);
console.log(date);
})();
(function () {
const... |
//jQuery to collapse the navbar on scroll
$(window).scroll(function() {
if ($(".navbar").offset().top > 50) {
$(".navbar-fixed-top").addClass("top-nav-collapse");
$("#plugin-breadcrumb").addClass("breadcrumb-collapse");
} else {
$(".navbar-fixed-top").removeClass("top-nav-collapse");
$("#plu... |
import React from 'react';
const Notification = () => {
return (
<li className="dropdown dropdown-extended dropdown-notification" id="header_notification_bar">
<a href="javascript:;" className="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
... |
// import { setTimeout } from "timers";
// const setTimeout = require('timers');
// var somePromise = new Promise((resolve, reject) => {
// setTimeout(() => {
// resolve('it worked');
// }, 1000);
// });
// somePromise.then((message) => {
// console.log('resolved', message);
// });
function doSth() {
set... |
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import Paper from 'material-ui/Paper';
var css = require('./Profile.css');
const maleDefault = require('./static/male.png');
const femaleDefault = require('./static/female.png');
import RaisedButton from 'material-ui/RaisedButton';
import Avat... |
define(['zepto'], function($) {
/**
* 收藏
*
* type: 1菜品 2菜谱 3大厨 4商家
*/
return {
// 添加收藏
add: function(favId, type, callback) {
$.ajax({
url: window.ctx + "favorite/add",
data: {
favId: favId,
type: type
},
... |
import '../../../../scripts/common/app'
import View from '../404/views/index.vue'
import image from '../../../../images/403.svg'
const error = App.data.error
if (error && error.code === -1006) {
// 会话超时,重新登录
App.redirect(`/auth/login?url=${encodeURIComponent(App.url)}`)
} else {
new Vue({
el: '... |
import React from 'react';
import List from "../uilib/List";
import KComponent from "../util/KComponent";
import {
kFilteredAlbums,
kAlbum,
setAlbum,
setAlbumFilter,
kAlbumFilter,
} from "../model/browsingModel";
import {
kKeyboardFocus,
keyboardFocusOptions,
} from "../mod... |
import React from 'react'
import styled from 'styled-components'
import BuildControl from './BuildControl/BuildControl'
const Container = styled.div`
width:100%;
background-color: #CF8F2E;
display: flex;
flex-flow: column;
align-items: center;
box-shadow: 0 2px 1px #ccc;
margin: auto;
... |
export { default } from './NewsTabs';
|
import React, { useState, useRef, useCallback } from 'react';
// 在hooks中使用refs
export default function RefsInHooks(props){
const [height, setHeight] = useState(0);
const refHooks = useRef(null); //每次返回的是同一个示例,ref的值发生变化时也不会通知我们
const getRefHooks = () => {
refHooks.current.focus();
}
const ... |
import withError from '../Error/withError';
import Table from './';
const TableWithError = withError(Table);
export default TableWithError; |
import React, { useState, useEffect } from "react";
import { Link } from "gatsby";
import "./styles.scss";
import usePrevious from "../../../utils";
import { CielLogo } from "../../../images/logos";
const Header = () => {
const [scrollUp, setScrollUp] = useState(true);
const [scrollPercentage, setScrollPercentage... |
import React from "react";
import styled from "styled-components";
const Pagination = ({ incIndex, decIndex, currPage, numPages }) => {
return (
<div>
<PaginationButton onClick={decIndex}>
<i className="fas fa-chevron-left"></i>
</PaginationButton>
<PaginationLocation>
Page {cu... |
const test = require('tape');
const randomHexColorCode = require('./randomHexColorCode.js');
test('Testing randomHexColorCode', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof randomHexColorCode === 'function', 'randomHexColorCode... |
import Mock from 'mockjs'
const Random = Mock.Random
export const getUserInfo = (options) => {
// console.log(options);
const template = {
'str|2-4': 'Qiao',
'name|6': 'Qiao',
'age|+2': 23,
'num|4-10': 0,
'float|3-8.2-5': 0,
'bool|1': true,
'bool2|1-9': true,
'obj|2': {
a: 'a... |
require('babel-runtime/regenerator');
require('./main.css');
require('./index.html');
var hello = async (args) => {
const {a, b} = args;
await console.log(`Webpack beyond the basics! ${a} ${b}`);
console.log('Done');
}
hello({a: '1st param', b: '2nd param'});
|
import Proyecto from '../models/Proyecto';
import { validationResult } from 'express-validator';
const crearProyecto = async(req, res) => {
const errores = validationResult(req);
if(!errores.isEmpty()){
return res.status(400).json({errores: errores.array()});
}
try{
const proyecto = n... |
/* @flow */
import WorkOverview from './container/work-overview.jsx'
import Work from './container/work.jsx'
module.exports = {
WorkOverview,
Work
}
|
$(function () {
window.addEventListener('message', function (event) {
var action = event.data.action;
if (action == 'show') {
$('#wrap').fadeIn();
} else if (action == 'hide') {
$('#wrap').fadeOut();
}
});
});
|
import { asyncRoutes, constantRoutes } from '@/router'
import Layout from '@/layout/index'
// 所有的注册异步路由列表
const arr = []
for (const key in asyncRoutes) {
arr.push(asyncRoutes[key])
}
/**
* 根据后台返回数据组装菜单
* @param menus
* @param first
*/
function assemblyRouter(menus, first) {
const res = {}
const menuConfig = ... |
var Article = AV.Object.extend("Article");
var count=0;
var pageSize=10;
function loadData(pageNo) {
if(pageNo==null)
pageNo=1;
AV.Query.doCloudQuery(" select count(*), * from Article order by createdAt desc limit "+(pageNo-1)*pageSize+","+pageSize, {
success: function(result){
//results ... |
/** Script which downloads the DAO contracts repository, installs necessary dependencies and compiles the contracts such
* that they are ready to be deployed to hardhat node for developing locally.
*/
const { readFileSync } = require('fs');
const { join } = require('path');
const { execAndLog, promiseWrapper } = req... |
$(function () {
// 每页显示行数
//var recordCount = parseInt(($(window).height() - 300) / 30);
var parent_column = $("#grid-table").closest('[class*="col-"]');
// 自适应页面大小
$(window).on('resize.jqGrid', function () {
$("#grid-table").jqGrid('setGridWidth', parent_column.width());
})
// 导航条或者... |
const event = require('events').EventEmitter;
const emitFromLog = new event()
//console.log("Warning:",request)
emitFromLog.addListener('print',console.log)
module.exports = {
emitFromLog
} |
function hello ()
var a = 3
var b = -1
var c ;
console.log("Hello world")
c= a + b |
var express= require('express'),
router= express.Router(),
room= require('./room.js'),
bodyParser= require('body-parser'),
urlencodedParser= bodyParser.urlencoded({extended: false});
function ensureAuth(req,res,next) {
if(req.isAuthenticated()) return next();
res.redirect('../login');
}
module.exp... |
import React, {Component} from 'react';
import { ImageBackground} from 'react-native';
import {
List,
ListItem
} from 'native-base';
var gb = require('./images/b.jpg');
class Profile extends Component {
constructor(props) {
super(props);
this.state = {
UserName: '',
UserEmail: '',
Us... |
const keys = require('../config/keys');
const stripe = require('stripe')(keys.stripeSecretKey)
const requireLogin = require('../middlewares/requireLogin');
module.exports = (app) => {
app.post('/api/stripe', requireLogin, async (req,res)=>{
const charge = await stripe.charges.create({
amount: re... |
import React, { useRef, useState } from "react";
import { Button, Grid, makeStyles, TextField } from "@material-ui/core";
import * as Yup from "yup";
import { Formik } from "formik";
import axios from "../../../axios";
import { RotateLeft } from "@material-ui/icons";
const useStyles = makeStyles((theme) => ({
paper:... |
let num = 25;
if (num > 10 && num < 10) {
document.write("Somethings Wrong!");
} |
/* eslint-disable react/forbid-foreign-prop-types */
import {
chromatic,
contained,
margined,
padded,
responsive,
} from '../traits'
// eslint-disable-next-line import/prefer-default-export
export const block = {
styles: () => [
chromatic.styles,
contained.styles,
margined.styles,
padded.st... |
import { css } from 'styled-components';
const FooterStyles = css`
padding: 100px 0 45px;
color: #9c9c9c;
font: 14px/16px var(--ff);
`;
export default FooterStyles;
|
import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Button from '../buttons/Button';
import { COLORS } from '../base/Colors';
import withDisplayName from '../WithDisplayName';
class Pagination extends Component {
state = { pageNumber: 0... |
import tripQueries from '../models/tripQuery';
import busQueries from '../models/busQuery';
// Load Input Validation
import validateTripInput from '../validation/trip';
const tripController = {};
// @route GET api/trip
// @desc get all trips
// @access Private
tripController.getAllTrip = async (req, res) => ... |
/**
* The site object.
*/
var SiteCode = function()
{
var self = this;
/**
* State data.
*/
self.elements = null;
self.updating = false;
/**
* Initializes the site.
*/
self.initialize = function(event)
{
self.elements = {
'list' : $('#order-list')
};
$('#queue [data-role="footer"] a').on('... |
/**
* 封装可编辑 EasyUi dataGrid 插件 1.0.0
*/
;
(function ($, window, document, undefined) {
var defaults = {
target: 'datagrid', // 目标类型,默认为 datagrid,如果是 treegrid 请传入次参数
insertUrl: '', // 新增数据 url
updateUrl: '', // 修改数据 url
deleteUrl: '', // 删除数据 url
id:'grid',
extendPa... |
(function(global) {
var App = {
Utilities: {},
Entities: {},
Components: {},
/* Add an entity to framework pool */
AddUtility: addUtility,
/* Add an entity to framework pool */
CreateEntity: addEntity,
/* Create a component in framework */
Com... |
({
doInit: function (component, event, helper) {
helper.getRecordId(component, event, helper);
},
setApplicationsLoaded: function(component, event, helper){
let existingComponentsLoaded = component.get("v.setOfComponentsLoaded");
let eventParentId = event.getParam("parentCaseRecordI... |
/**
*
* React component that serves as a toggle icon. Uses React Motion to add a
* spring animation whenever icon is clicked. Background color also changes
* to indicate icon state.
*
*/
import React, { PropTypes, PureComponent } from 'react';
import { Motion, spring } from 'react-motion';
import FAIcon from ... |
angular.module('yapp')
.directive('cbfooter',function(){
return {
restrict: 'EA',
templateUrl:'/views/dashboard/cbfooter.html'
}
}); |
import React, {Component} from 'react';
import './App.css';
import Pagination from "./component/pagination";
class App extends Component {
constructor(props) {
super(props)
this.state = {
activePage: 1
}
}
handlePageOnChange = (activePage) =>{
this.setState({ac... |
jQuery(document).ready(function($){
$('.cuckoo-love').live('click',
function() {
var link = $(this);
if(link.hasClass('active')) return false;
var id = $(this).attr('id');
$.post(cuckoo_love.ajaxurl, { action:'cuckoo-love', likes_id:id}, function(data){
link.html(data).addCl... |
import React from 'react';
function Name(props) {
const name = <h1 className="center name">{props.name}</h1>;
return (
name
);
}
export default Name; |
import React from 'react';
import axios from 'axios';
import './App.css';
import UserList from './components/User.js'
import ProjectList from './components/Project.js'
import ProjectByUserList from "./components/ProjectByUser.js";
import ToDoList from "./components/ToDo.js";
import Menu from './components/Menu.js'
impo... |
import React from 'react'
import ThankYou from '../../components/ThankYou'
class ThankYouPage extends React.Component {
render () {
return (
<ThankYou />
)
}
}
export default ThankYouPage
|
const Product = require("../models/Product");
const {model: ProductModel} = require("../models/Product"); //para agregar un objeto nuevo en la base de datos
const postProduct = async (req, res) => {
try{
console.log(req.body);// se necesita un middleware cmo cors y express.json y urlenconded
const {... |
app.controller("operatorLogController",['$scope','dataTableSearchService','sessionStorageService','operatorLogStateService',function($scope,dataTableSearchService,sessionStorageService,operatorLogStateService){
$scope.search = {};
var isF5 = true ;
$scope.operatorLogDataTableProperties = null;
$scope.need... |
var getTVId;
var xmlhttp = null;
//http request pushid
function sendrequset ()
{
if(subinfo)
{
subinfo.style.display ="block";
}
var pushid2 =document.getElementById('pushid').value;
var pushid3 = pushid2.replace(/\s+/g,"");;
// var pushid = pushid3.toLocaleUpperCase();
var pushid =... |
import "@babel/polyfill";
import { login, logout } from "./login";
import { Signup } from "./signup";
import { updateDetails } from "./updateUserDetails";
import { updatePassword } from "./updatePassword";
import { addToCart } from "./addtocart";
import Search from "./search";
const loginForm = document.querySelector(... |
'use strict';
require('dotenv').config()
var response = require('../config/res');
var { pool } = require('../config/database');
var mailConfig = require('../config/email');
const uuidv1 = require('uuid/v1');
const moment = require('moment');
var localFormat = 'YYYY-MM-DD HH:mm:ss';
var SCREET_KEY = process.env.SCR... |
// 객체 선언
class A{
constructor(name, age){
this.name = name;
this.age = age;
}
}
// 객체 생성
console.log(new A('Makr',19)); // A { name : 'Markj', 19}
// class field
class B{
name; // this.name
age; // this.age
}
console.log(new B());//에러 : 클래스에 필드를 직접 넣었으나... 런타임 노드 버전에 따라 실행됨.
co... |
import { createAction, NavigationActions, Storage, delay } from '../utils'
import * as babyService from '../services/babyInfo'
export default {
namespace: 'babyInfo',
state: {
babyList: [],
},
reducers: {
updateState(state, { payload }) {
return { ...state, ...payload }
},
},
effects: {
... |
// const mongoose = require('mongoose');
const Todo = require('../models/todo.model');
const express = require('express');
const router = express.Router();
router.get('/', function(req, res) {
// eslint-disable-next-line array-callback-return
Todo.find(function(err, todos) {
if (err) {
console.log(err);
... |
import React, {useEffect} from 'react'
import axios from 'axios'
import JobComponent from './JobComponent'
import styles from '../Styles/Display.module.css'
function Display({query, handleQueryChange, counter, field, jobs, handleJobChange, take, handleTakeChange, skip, handleSkipChange}) {
const token = "eyJhbGciO... |
import * as actionsTypes from '../actions';
const initialState = {
theme: 'prism-okaidia',
prismShowLoader: false
}
const uiReducer = (state = initialState, { type, payload }) => {
switch (type) {
case actionsTypes.UI_CHANGE_THEME: {
const { theme } = payload
return {
...state,
... |
define(['frame'], function (ngApp) {
'use strict'
ngApp.provider.controller('ctrlMain', [
'cstApp',
'$scope',
'http2',
'srvSite',
'noticebox',
'srvGroupApp',
'srvTag',
'mediagallery',
function (
cstApp,
$scope,
http2,
srvSite,
noticebox,
srvGrp... |
// pages/bleunlock/bleunlock.js
var exportB = require('../../vendor/storageinfo/storageinfo.js');
var flag = 0;
Page({
/**
* 页面的初始数据
*/
data: {
deviceID: "",
servicesList: [],
filterList: [],
list: [],
serviceID: "",
deviceName:"无",
characteristicID:"",
myDataSet:"",
my... |
class KtTemplateParser {
/**
*
* @param text
* @param {DocumentFragment} fragment
* @return {null}
* @private
*/
_parseTextNode (text, fragment) {
let split = text.split(/(\{\{|\}\})/);
while(split.length > 0) {
fragment.appendChild(new Text(split.sh... |
const Expense = require('../models/Expenses');
const Users = require('../models/Users');
async function deleteExpense(id) {
let expense = await Expense.findById(id, 'user');
let user = await Users.findById(expense.user);
user.expenses.splice(user.expenses.indexOf(expense._id), 1);
user.save();
expe... |
'use strict';
import React, {Component} from 'react';
import { View, StyleSheet, StatusBar,TouchableOpacity, SafeAreaView, Image, KeyboardAvoidingView, } from 'react-native';
import {DisplayText, InputField,SubmitButton, AuthBackground} from '../../components';
import styles from './styles';
import { getProfile, LoginE... |
const EOF = Symbol('EOF');
const css = require('css');
let state = data;
let returnState;
let token = null;
let tempBuffer = '';
let lastToken;
let stack = [{type: 'document', children: []}];
let text = '';
let totalText = '';
let cssText = '';
let startCss = false;
let rules = [];
function addCSSRule (text) {
let ... |
var searchData=
[
['main',['main',['../Program_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'Program.cpp']]],
['mlongueurmax',['mLongueurMax',['../classFileAttente.html#a267bd59131a4fee87fff5243b7d6ad57',1,'FileAttente']]],
['mlongueurmoyenne',['mLongueurMoyenne',['../classFileAttente.html#aa3524e08723e1a057ef7... |
import { call, put, takeLatest } from 'redux-saga/effects';
import {
failureMainService,
REQUEST_MAIN_SERVICE,
requestMainService,
successMainService
} from '../actions/main';
import api from '../../../settings/AxiosConfig';
export function* watchRequestMainService() {
yield takeLatest(REQUEST_MAIN... |
var orm = require('../config/orm')
var challenge_member = {
//Expecting newChallengeMember object that includes user_id and group_challenge_id
createChallengeMember: function (newChallengeMember, callback) {
let query = {
table: 'challenge_members',
data: newChallengeMember,
... |
const { CREATED, OK } = require('http-status-codes');
const { logger, logLevel } = require('../common/logger');
const todoService = require('../services/todoService');
const create = async (req, res, next) => {
const { user } = req.authentication;
logger.log(logLevel.INFO, `todoController::create:: Got request fr... |
import React, { Component } from 'react'
import '../static/media.css'
class Images extends Component {
constructor(props) {
super(props)
this.state = {
isClicked: false
}
}
isClicked() {
this.setState({
isClicked: !this.state.isClicked
})
}
render() {
const transform = t... |
require("dotenv/config");
const express = require("express");
const app = express();
const passport = require("passport");
const bodyParser = require("body-parser");
const mongoose = require("mongoose");
const bcrypt = require("bcrypt");
const LocalStrategy = require("passport-local").Strategy;
const server = require(... |
import MYNS from './leaflet.js';
import FAQTZ from './faq.js';
import newsTz from './news.js';
MYNS.toggle= function () {
$(document).ready(function(){
$(".toggle-content-element").click(function(){
$(this).next().slideToggle();
});
});
}
MYNS.toggle(); |
function setup(){
createCanvas (600,400)
background(0)
}
px = 0
py = 0
vx = 3
vy = 3
radius = 30
function draw() {
background(0)
px = px + vx
py = py + vy
if(px > 600||px < 0)(
vx = -vx
)
if(py > 400||py < 0)(
vy = -vy
)
fill(255, 0, 0)
ellipse(px+vx,... |
function solve(matrix = [[]]) {
let isMagical = true;
for (let row = 0; row < matrix.length && isMagical; row++) {
let currentRow = matrix[row];
let rowSum = currentRow.reduce((a, b) => a + b, 0);
for (let col = 0; col < currentRow.length; col++) {
let currentCol = getCol(ma... |
let PI;
const calculateArea = (radius) =>
radius * radius * PI;
PI = 3.14;
calculateArea(10); // 314.0
PI = 42;
calculateArea(10); // 420
// ------------------------------
let counter = 1;
const increaseCounter = () => {
counter++;
return counter;
}
counter; // 1
increaseCounter(); // 2
counter; // 2
|
//= link application.scss
|
import React from 'react'
import Zoom from 'react-reveal/Zoom'
import icon_calendar from '../../resources/images/icons/calendar.png'
import icon_location from '../../resources/images/icons/location.png'
const VenueNFO = () => {
return (
<div className='bck_black'>
<div className='center_wrappe... |
'use strict';
import path from 'path';
// server configuration
export const port = 9966;
export const ui = path.join(__dirname, '../ui');
// database configurations
export const uri = 'http://localhost:5984';
export const db = process.env.NODE_ENV !== 'production' ? 'test' : 'potato'; |
import React from 'react';
import { hot } from 'react-hot-loader';
import Router from './Router';
const App = () => (
<div>
<Router />
</div>
);
export default process.env.NODE_ENV === 'development'
? hot(module)(App)
: App;
|
/**
* Cria um gráfico com barras (com categoria e sub categoria) e multiplas linhas em EIXOS SEPARADOS
* Uso:
try {
let bar_data = [
{"categorie": "2018", "values": [{"value": 9, "rate": "número1"}, {"value": 12, "rate": "número2"}]},
{"categorie": "2019", "values": [{"va... |
import React, { Component } from 'react';
import { string, func } from "prop-types";
import { Grid, Row, Col } from 'react-bootstrap';
import * as basketActions from "../../modules/basket/basket.actions";
import classes from "./Product.less";
import { connect } from "react-redux";
class Product extends Component {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.