text stringlengths 7 3.69M |
|---|
import React, { useState, useEffect } from "react";
import MUIDataTable from "mui-datatables";
import axios from "axios";
import { token, API_SERVER } from "../../../helper/variable";
import {
Button,
Modal,
ModalBody,
ModalFooter,
ModalHeader,
Col,
Input,
} from "reactstrap";
import { ToastContainer, toa... |
import React, { useState, useEffect } from 'react'
import axios from 'axios'
import {
RadialChart,
} from 'react-vis';
export const TankChart = () => {
const [dataSet, setData] = useState([]);
const GetTanques = async () => {
const { data } = await axios.post(`/GetInventariosByUserKey`, { opc: 1 ... |
import DataType from 'sequelize';
import Model from '../sequelize';
// import { initializeDB } from '../config';
// import Pair from './Pair';
// import User from './User/User';
const Trade = Model.define('Trade', {
id: {
type: DataType.INTEGER(11),
allowNull: false,
primaryKey: true,
autoIncrement: ... |
import ShopPage from 'layouts/shopPage'
import ProductList from 'pages/product/productList'
import ProductPage from 'pages/product/productPage'
import AboutPage from 'pages/aboutPage'
const routes = [
{ // Auth Routes
path: '/auth',
redirect: 'auth/sign-in',
component: () => import('layouts/auth'),
c... |
import {Component} from "react";
const Dialog = class extends Component{
constructor(props){
super(props);
this.state = {
html : props.html
};
}
componentDidUpdate(){
if(this.state.html){
document.querySelector(".shadow").style.display = "block";
}
let domShadow = document.querySelector(".shadow");... |
$(function () {
$('.b-comment__btn').on('click', function (e) {
e.preventDefault();
var d = new Date();
var month = d.getMonth() + 1,
day = d.getDate(),
output = d.getFullYear() + ' ' + (month < 10 ? '0' : '') + month + ' ' + (day < 10 ? '0' : '') + day;
va... |
'use strict';
/**
* Currently used plugins:
* - gulp-lazypipe
* - gulp-sass
* - gulp-autoprefixer
* - gulp-combine-media-queries
* - gulp-minify-css
* - gulp-rename
*/
// ---------------------------------------------------------------------
// Components
// ----------------------------------------------------... |
const express = require('express');
const User = require('../models/user');
const uploadCloud = require('../config/cloudinary.js');
const isEmpty = require('../helpers/helpers');
const router = express.Router();
/* GET Profile page */
router.get('/', (req, res, next) => {
const session = req.session.currentUser;
... |
var yellow = function() {
var yellowBg = document.getElementById("background").style.backgroundColor = "yellow";
}
var red = function() {
var redBg = document.getElementById("background").style.backgroundColor = "red";
}
var blue = function() {
var blueBg = document.getElementById("background").style.backgroundCo... |
const express = require('express');
const config = require('./config/server.js');
const app = express();
const helloWorldRoutes = require('./routes/hello.js');
app.use(helloWorldRoutes);
app.listen(config.port, () => console.log(`App listening on port ${config.port}!`));
|
var classde_1_1telekom_1_1pde_1_1codelibrary_1_1samples_1_1playground_1_1_play_ground_activity =
[
[ "onCreate", "classde_1_1telekom_1_1pde_1_1codelibrary_1_1samples_1_1playground_1_1_play_ground_activity.html#a0f484216846cf0cc88f2dc0881a80237", null ],
[ "LOG_TAG", "classde_1_1telekom_1_1pde_1_1codelibrary_1_1... |
const React = require('react');
const Rating = require('react-rating');
const DrinkStore = require('../../stores/drink_store');
const DrinkActions = require('../../actions/drink_actions');
const CheckinIndex = require('../checkin/checkin_index');
const DrinkPage = React.createClass({
getInitialState(){
return ... |
// Une varias capas
// Se comunica con el modelo
// *Pendiente: Añadir capa de validación a todos los controladores
const rodentMonitoringGatheringCenterModel = require('./rodent-monitoring-gathering-center.model');
module.exports = {
// Crear un nuevo registro monitoreo roedor centro acopio
async createRod... |
var q = require('q')
var crypto = require('crypto')
// var keys = require('../keys')
var moment = require('moment')
var request = require('request')
var qs = require('querystring')
var ENDPOINT_API = 'https://www.mercadobitcoin.net/api/'
var ENDPOINT_TRADE_API = 'https://www.mercadobitcoin.net/tapi/v3/'
// DOCS:
// h... |
const initialState = {
songs: [],
artist: ''
}
export default (state = initialState, action) => {
switch (action.type) {
case 'SEARCH_ARTIST':
return {
...state,
songs: action.payload.songs,
artist: action.payload.artist
}
... |
var searchData=
[
['settings',['settings',['../namespaceIITBPortal_1_1settings.html',1,'IITBPortal']]],
['urls',['urls',['../namespaceIITBPortal_1_1urls.html',1,'IITBPortal']]],
['wsgi',['wsgi',['../namespaceIITBPortal_1_1wsgi.html',1,'IITBPortal']]]
];
|
var express = require('express');
var roomsRouter = express.Router();
//------------------------------------------------------------------------
// Models
var Room = Utils.getModel('Room');
//------------------------------------------------------------------------
// Validator
var validator = Utils.getValidator('room... |
// Require jQuery
ihl0700_cTable = function(){
// Sample Request Format
/*
http://localhost/api?
queries[search]=keyword
&sorts[title]=1
&page=1
&perPage=20
&offset=0
*/
this.constructor = function(o){
this.url = o.url;
this.requestFunction = o.requestFunction;
this.callbackFunction = o.ca... |
/**
*检验用户输入是否合法
*/
var blogurl_err='';
function check()
{
fields=document.getElementsByTagName("input");
for(i=0;i<fields.length-2;i++)
{
val=fields[i].getAttribute('name');
if(fields[i].value=='')
{
alert('每一项都必须填写');
eval('document.form1.'+val).focus();
return false;
}
else if(t(... |
import path from 'path';
import convert from 'koa-convert';
import koaStatic from 'koa-static';
const cwd = process.cwd();
const ENV = process.env.NODE_ENV;
const prod = ENV === 'production' ? 'publish' : '';
const staticServer = convert(koaStatic(path.join(cwd, prod, 'static')));
export default staticServer;
|
/**
Program for finding even number in given array using forEach
**/
function fnFindEvenNumber(array_element) {
var even_number = [];
array_element.forEach(function(items){
if(items%2 == 0) {
even_number.push(items)
}
})
return even_number;
}
var array_element=[12,14,3,5]
alert(fnFindEvenNumber(ar... |
$("li").click(function() {
$(this).addClass("completed");
});
$("li > span").click(function() {
$(this).parent()
.fadeOut(1000, function() {
this.remove();
})
});
$("input").keypress(function(event) {
if (event.which === 13 && this.value !== "") {
$("ul").append("<li><span><i class... |
var assert = require("../assert.js");
var test = require("../test.js");
module.exports.runTests = runTests;
function runTests() {
// assert.True() tests
test.run(function () { assert.True(true); });
test.run(function () { assert.Throws(function () { assert.True(false); }); });
// assert.False() te... |
process.env.DEBUG = "mongo-seeding";
const { Seeder } = require("mongo-seeding");
const path = require("path");
(async () => {
try {
const seeder = new Seeder({
database: process.env.MONGODB_URI,
dropDatabase: true
});
const pathToSeeds = path.join(__dirname, "../s... |
/**
* Created by cl-macmini-63 on 1/10/17.
*/
'use strict';
const responseFormatter = require('Utils/responseformatter.js');
const adminSchema = require('schema/mongo/adminschema');
const codeSchema = require('schema/mongo/stateCodes');
const constantSchema = require('schema/mongo/constantsschema');
const mapperSc... |
const express = require('express')
const path = require('path')
const cors = require('cors')
const bodyParser = require('body-parser')
const fs = require('fs')
const app = express()
const port = 433
app.use(cors())
app.get('/api/list', (req, res) => {
fs.readdir('./assets/', (err, items) => {
result = it... |
/**
* Created by bastien on 09/06/2017.
*/
import {html} from 'snabbdom-jsx';
import xs from 'xstream';
export const FormUser = (sources) => {
const submit$ = sources.DOM.select('submit-new-user').events('click');
const sendDataBack = 4;
const vTree$ = xs.of(
<form className="ui form">
... |
/* vim: et sw=4 ts=4 */
jQuery(function($){
var debug = null;
var features = {};
var newfeature = function( name , type, config ){
features[name] = { enabled: null };
var feature = features[name];
if ( type == "name" ) {
feature.name = config;
}
if (... |
export * as h1ActionTypes from "./h1ActionTypes";
export * as h1Actions from "./h1Actions";
export * as h1Selectors from "./h1Selectors";
export * as h1Constants from "./h1Constants";
export * as h1Reducer from "./h1Reducer";
export { default as H1 } from "./components/H1.jsx";
|
import { execSync } from 'child_process'
import prompt from 'prompt'
import { checkError, confirmResponsePattern, isPositiveResponse } from './utils'
import { version as packageVersion } from '../../package.json'
prompt.message = 'Confirm'
const confirmRelease = {
name: `This will publish version ${packageVersion} ... |
var fs = require('fs');
var shell = require("shelljs");
var os = require('os');
var ifaces = os.networkInterfaces();
var request = require('request');
var IPs = [];
module.exports = {
// searches all the ip addresses to the devices that is connected on the same network
FindIPs : function(){
IPs = [];
... |
import React from 'react';
import RecentPostsPageMobile from './RecentPostsPageMobile';
import RecentPostsPageDesktop from './RecentPostsPageDesktop';
export default class RecentPostsPage extends React.Component {
constructor(props) {
super(props);
}
render() {
if (this.props.isMobile) {
return (... |
import axios from 'axios'
axios.defaults.baseURL = 'http://api.k-hansol.com/'
axios.defaults.withCredentials = true;
export const initialState = {
};
const ADD_POST = 'ADD_POST';
const POST_LOAD = 'POST_LOAD';
const ADD_POST_REQUEST = 'ADD_POST_REQUEST';
const ADD_POST_FAILURE = 'ADD_POST_FAILURE';
const ... |
import * as actionTypes from '../../types';
/**
*
* @param {object} data
* @returns {object} object
*/
const getProductDetailSuccess = (data) => {
return {
type: actionTypes.GET_PRODUCT_DETAIL_SUCCESS,
payload: {
product: data,
loadingProductDetail: false,
p... |
/*
Title:redpackets
Author:cui xu
Date:2017-7-22 11:22:45
Version:v1.0
*/
var REDPACKET = {
init: function(data,func) {
this.couponTimes = 0;
this.getCouponActivity(data,func);
},
//执行检测红包
getCouponActivity: function(data,func) {
var _this = this;
GHutils.load({
url: GHutils.API.USER.registerCoupon,
... |
let express = require('express');
let router = express.Router();
const yelp = require('yelp-fusion');
const token = 'Y8s6dW3uAs-TZ34YRekghk7llJxJuj3JjNAcLtADi-OZ02Dl66_soagZHv-eTyQFHC8fGWfxblXrZxyW3msB1GARItcv2KG0qhzgowweVi4qxdw3fijzXeIyKKd2XXYx';
const client = yelp.client(token);
router.use(function(req, res, next){... |
import React from "react";
import {Collapse, NavbarBrand, Navbar, NavItem, NavLink, Nav, Container} from "reactstrap";
// Import child components
import NavbarProfile from "./dashboard/Navbar.Profile.components"
// Import authContext
import {useAuthContext, fetchUserProfile} from "../services/AuthReducer"
// Create ... |
const errors = require('../index');
describe('Error Tests', () => {
it('Should export an object', () => {
expect(errors).toBeDefined();
expect(errors).toBeInstanceOf(Object);
});
it('Should export more than one property', () => {
expect(errors).toBeDefined();
expect(errors).toBeInstanceOf(Object... |
import React, { useState } from 'react';
import styles from '../styles/pages/Portfolio.module.scss';
import Rectangle from '../components/Rectangle';
import TextTitle from '../components/TextTitle';
import { useSelector } from 'react-redux';
import AwesomeSlider from 'react-awesome-slider';
import AwsSliderStyles from... |
import isClass from './isClass';
export default function isStatelessComponent( element ) {
return !isClass(element) && typeof element === 'function';
} |
module.exports = [{
folder: 'user',
route: 'user.route.js',
controller: 'user.controller.js',
model: 'user.model.js',
url: '/user'
}]
|
#!/usr/bin/env node
'use strict';
const script = process.argv[2];
require(`./scripts/${script}`);
|
var btnElement = document.getElementById('btn');
btnElement.onclick = function () {
var firstNameValue = document.getElementById('firstName').value;
var lastNameValue = document.getElementById('lastName').value;
var fullNameValue = firstNameValue+' '+lastNameValue;
document.getElementById('fullName').... |
import React from "react";
import {Route, Switch} from "react-router-dom";
import eCommerce from "./eCommerce";
import ErrorPages from "./errorPages";
import Extras from "./extras";
import ListType from "./listType";
import UserAuth from "./userAuth";
const CustomViews = ({match}) => (
<Switch>
<Route ... |
var myApp = angular
.module("myModule",[])
.controller("myController", function($scope, $http){
$scope.location = "";
$scope.displayWeather = false;
var getWeather = function(){
$scope.weatherURL = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(selec... |
// Globals:
const url = "https://600ff44f6c21e1001704fac2.mockapi.io/minor-web/api/";
// GET REQUEST
const teams = fetch(`${url}/squads/1/teams/1/members`)
.then((response) => response.json())
.then((data) => {
console.log(data);
const person = getPerson(data, "Veerle");
createElements(person[0]);
})... |
var text,
word;
function wordOccur(text, word) {
var arr = [],
count = 0,
len,
i,
resCheck,
resArr;
arr = text.split(" ");
len = arr.length;
for (i = 0; i < len; i++) {
resCheck = word.toLowerCase();
resArr = arr[i].toLowerCase();
if (resCheck == resArr) {
count++;
}
}
console.log(count);
... |
/**
* Created by Wwei on 2016/9/1.
*/
Ext.define('Admin.view.brand.BrandController', {
extend: 'Admin.view.BaseViewController',
alias: 'controller.brand',
requires: ['Admin.view.brand.BrandForm'],
search: function () {
var me = this,
grid = me.lookupReference('grid'),
... |
import { tagName } from '@ember-decorators/component';
import BaseDropdownMenuItem from 'ember-bootstrap/components/base/bs-dropdown/menu/item';
@tagName('li')
export default class DropdownMenuItem extends BaseDropdownMenuItem {}
|
const intialState = {
openModalForTeacher : true,
teacherDetails : {}
}
const sliderReducer = (state = intialState, action) => {
switch (action.type) {
case 'OPEN_MODAL':
return { ...state,
openModalForTeacher : !openModalForTeacher
};
default:
return state;... |
import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import PropTypes from 'prop-types';
import { apiDelete } from 'utils/axios';
import * as Sentry from '@sentry/browser';
import 'draft-js/dist/Draft.css';
import 'draftail/dist/draftail.css';
import {
Button,
Dialog,
DialogActions,
... |
define('TopHudView', [
'createjs',
'TopHudPlayerView',
'ViewConstants'
], function (createjs, TopHudPlayer, ViewConstants) {
var container;
var TopHud = function() {
this.playerHuds = [];
};
TopHud.prototype.initialize = function (assets, parent, players) {
container = new createjs.Container();
container... |
const mysqlUtil = require('../utils/MySQLUtil');
const _ = require('lodash')
const moment = require('moment')
class Message {
async createChat(params) {
const { from, to, subject } = params;
const result = await mysqlUtil.query('INSERT INTO `chat` (fromuser, touser, subject) VALUES (?, ?, ?);', [f... |
import React from "react"
import { Article, Title, Link, Image, Category, Excerpt } from "./style"
import parse from "html-react-parser"
const Teaser = ({ data }) => {
return (
<Article>
<Image
style={{ marginBottom: "18px" }}
fluid={{
...data.featuredImage,
sizes: "(max... |
/*============================================================================
MessageGate Request Module
============================================================================*/
let jsforce = require('jsforce');
let secrets = require("../../secrets/secrets.js");
let fs = require("fs");
let mailer = require(... |
const ERC4907Demo = artifacts.require("ERC4907Demo");
module.exports = function (deployer) {
deployer.deploy(ERC4907Demo, "ERC4907Demo", "ERC4907Demo");
};
|
/**
* Calculates the euclidian distance between two vec2's
*
* @param {vec2} a the first operand
* @param {vec2} b the second operand
* @returns {Number} distance between a and b
*/
export default function distance(a, b) {
var x = b[0] - a[0],
y = b[1] - a[1]
return Math.sqrt(x*x + y*y)
} |
import React, { useState } from 'react'
import {useHistory} from 'react-router-dom'
import styled from 'styled-components'
// action
import { addEvent } from '../store/action/eventAction'
// Redux hook
import { useDispatch } from 'react-redux'
const StyledAddEvent = styled.div`
background-color: #202C59;
min-hei... |
module.exports.createControllers = function(app, properties, serviceLocator, bundleManager) {
bundleManager.forEachProperty('controllerFactories', function(bundle, factory) {
serviceLocator.logger.verbose('Adding controllers from: ' + bundle.name);
factory(app, properties, serviceLocator, bundle.path + '/views');
... |
import styled from 'styled-components'
import homepic from '@a/images/iconku/u3225.png'
import companypic from '@a/images/iconku/u3827.png'
const Wrap=styled.div`
height: 100%;
width:100%;
display:block;
position: relative;
background-color:rgba(242, 242, 242, 0.6);
.back{
display:block;
position: ... |
export const Formatter = {
formatTime(d){
if (!(d instanceof Date)) {
d = new Date(d)
}
var h = d.getHours(),
m = d.getMinutes()
return h + ':' + (m < 10 ? '0' + m : m)
},
formatDate(d){
if (!(d instanceof Date)) {
d = new Date(d)
... |
function receivesAFunction(callback) {
callback();
}
function returnsANamedFunction(){
return function index(){
}
}
function returnsAnAnonymousFunction(){
return function(){
}
} |
const isPrime = test => {
if(test === 2){return true}
else if(test % 2 === 0 || test < 2){return false}
else{
for(let i = 3; i <= Math.sqrt(test); i = i+2){
if(test % i === 0){
return false
}
}
return true
}
}
const circularPrimesBelow = limit => {
let count = 0
for(let i = ... |
import React from "react";
import { Link } from "react-router-dom";
import DevelopmentPlan from "../../containers/DevelopmentPlan";
import TopBar from "./TopBar";
const NeedsBox = props => (
<div className="needs-box">
<div className="label">{props.label}</div>
{props.errors.map(error => (
<div classNa... |
import React from "react";
import { compose, withProps } from "recompose";
import {
withScriptjs,
withGoogleMap,
GoogleMap,
Marker,
Circle
} from "react-google-maps";
const MapComponent = compose(
withProps({
googleMapURL:
"https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry,drawin... |
var all________________f________8js____8js__8js_8js =
[
[ "all________f____8js__8js_8js", "all________________f________8js____8js__8js_8js.html#a0597c9ee061a805e54a5d0c6365b249f", null ]
]; |
import React from "react";
import SocialIcons from "../../UI/SocialIcons/SocialIcons";
import styles from '../Header/Header.module.css'
const Header = (props) => {
let niza = ["container-fluid", styles.Content];
return (
<header>
<div className={niza.join(" ")}>
<div classNam... |
(function(){
var World = {
Food:{
x:null,
y:null,
generate:function(){
}
},
Size:{
width: 100,
height: 100
}
}
var Center = {
x: 9,
y:9
};
var Direction = {
up:1,
right:2,
left:-2,
down:-1
}
function gameOver(length){
alert("Your Score:"+length);
}
function ... |
/* CC3206 Programming Project
Lecture Class: 203
Lecturer: Dr Simon WONG
Group Member: CHAN You Zhi Eugene (11036677A)
Group Member: FONG Chi Fai (11058147A)
Group Member: SO Chun Kit (11048455A)
Group Member: SO Tik Hang (111030753A)
Group Member: WONG Ka Wai (11038591A)
Group Member: YEUNG Chi Shing (11062622A) */
v... |
/**
* Created by michael on 5/16/2017.
*/
import React, {PureComponent} from "react";
import {FlatList, View} from "react-native";
import CONSTANTS, {MainTheme} from "../../Constants";
import NotifInListItem from "../../components/NotifInListItem";
import ListLoadMoreView from "../../components/ListLoadMoreView";
imp... |
const AWS = require('aws-sdk');
const jwt = require('jsonwebtoken');
const BaseAuthorizer = require('./baseAuthorizer');
const { policyEffects, jwtOptions, authorizerTypes } = require('../constants/auth');
class UserAuthorizer extends BaseAuthorizer {
constructor(event) {
super();
this.event = event;
con... |
'use strict';
// 批次处理开始时间(生成),批次处理完成时间(生成),当前处理进度(状态位,记录当前处理到第几个步骤),批次状态(状态位,0未开始,1运行中,2已完成,3挂起,4废止)
module.exports = app => {
const tableName = 'aux_repeat_result';
const { STRING, BIGINT, INTEGER } = app.Sequelize;
const Repeat = app.model1.define(
'Repeat',
{
/* 通用字段 */
dataId: { type: BIG... |
import styled from "styled-components";
const NumberForms = styled.div`
display: block;
margin-right: auto;
margin-left: auto;
`;
const Form = styled.form`
text-align: center;
margin: auto;
width: 50%;
margin-bottom: 50px;
`;
const Label = styled.label`
color: #d31027;
display: block;
font-size: ... |
(function() {
var lati;
var long;
var city;
var state;
var country;
var latlon;
var count = 0;
var places;
var i;
var address1 = "1121%20Lady%20Carol%20Dr.";
const document = window.document
console.log(window)
const $locationid = document.querySelector('#locationid')
const $weatherid =... |
import actionTypes from '../actionTypes';
import ActionCreator from ".";
import store from "../store";
export const FetchPurchaseGem = (userid, isNeedSpinner, token, request_data, callbackFunc) => {
const data = new FormData();
data.append('amount', request_data.amount);
data.append('purchase_type', reques... |
var UnitController = require('../controllers/UnitController');
module.exports = function (app) {
app.post('/unit/getUnitBy', function (req, res) {
console.log('/unit/getUnitBy', req.body)
UnitController.getUnitBy(req.body, function (err, task) {
if (err) {
res.send(err... |
import React from "react";
import { Button, Container, Slide } from "@material-ui/core";
import { Link } from "react-router-dom";
function About() {
return (
<Container>
<Slide direction="up" in={true} timeout={1000}>
<div style={{ marginBottom: 50 }}>
<div>
... |
import React from "react"
import { Link } from "gatsby"
import LocalizedLink from "../components/LocalizedLink"
import Layout from "../components/layout"
import SEO from "../components/seo"
import Steps from "../components/Steps"
import { css } from "@emotion/core"
import { useTranslation } from "react-i18next"
imp... |
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const ReviewSchema = require('./review').schema;
// Create a Schema
const ProductSchema = new Schema({
name: {
type: String,
required: true
},
category: {
type: String,
required: true
},
brand: {
... |
var listScrpts;
var current;
var durationtotal;
var player;
// var saudacao;
$(function() {
/*
* listScrpts = new HtmlImport("imports"); listScrpts.addItem("question",
* "question.html"); listScrpts.load();
*
* $('#video').click(function(e) { this.pause(); alert(e.pageX + ' , ' +
* e.pageY); alert(current);... |
import firebase from 'firebase'
const firebaseConfig = {
apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,
projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,
storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.R... |
export var AppConfig = {
landingPageRestClient: {
baseUrl: 'https://newtoms-landingpage-process-api.us-e1.cloudhub.io/api'
}
}
|
import React, { useState } from 'react'
import FormData from 'form-data'
import qs from 'qs'
const NewsletterForm = () => {
const [emailState, setEmail] = useState(``)
const [errorState, setError] = useState(``)
const [successState, setSuccess] = useState(``)
const [loading, setLoading] = useState(false)
le... |
//--------------------------------------------------------------------------------;
// SERVER;
//--------------------------------------------------------------------------------;
//------------------------------;
global.REQUIRES = {};
//------------------------------;
global.REQUIRES.http = require('http'... |
const path = require('path')
const resolve = dir => path.join(__dirname, dir)
module.exports = {
css: {
loaderOptions: {
less: {
javascriptEnabled: true
}
}
},
chainWebpack: config => {
config.resolve.alias.set('@', resolve('src'))
},
devServer: {
proxy: {
'/api': {
... |
app.filter('trusted', function($sce){
return function(link){
return $sce.trustAsResourceUrl(link);
};
}); |
const exec = require('child_process').execSync;
var paperkey = '';
var keybaseRepoName = '';
var username = '';
var githubRepoURL = '';
var githubRepoName = '';
var githubUsername = '';
var githubRepoIsPrivate = '';
var cmd = '';
var useSSH = false;
function execute(cmd, cwd){
if(cwd == ''){
return exec(cmd);
... |
exports.handle = function(data) {
console.log("Received data" + data);
var carrotData = JSON.parse(data);
var db = require('nano')('http://localhost:5984/carrot');
console.log("Persisting data");
db.insert(carrotData, '', function(err, body) {
if (!err)
console.log(body);
});
return true;
} |
import React from "react";
import { Image, ListGroupItem } from "react-bootstrap";
import { FaTrash } from "react-icons/fa";
export default function CartProduct({ product, handleRemoveFromCart }) {
const { id, title, image } = product;
return (
<ListGroupItem className="custom-list-group-item">
<Image s... |
import selectedTeaReducer from './../../reducers/selected-tea-reducer';
import * as a from './../../actions/index';
import initialState from './../../initialState';
const testId = Object.keys(initialState.masterTeaList)[0];
describe ('selectedTea', () => {
test('Should return default state if there is no action typ... |
/*
================================
Coder: Emily Yu
Date: 02/11/2019 - 02/23/2019
Main Related Files: textAdventureGame.html, textGameStyle.css
Description:
Text adventure game where player types in instructions to forward the story.
Feature within This Javascript File:
This part of the file checks user's... |
//document.getElementById('theBigTitle').innerText = "Xiangyu Gan";
//document.getElementById('theBigTitle').attributes[1].nodeValue = "Xiangyu Gan"; |
const Discord = require("discord.js");
const fs = require("fs");
const ms = require("ms");
var mongoose = require("mongoose");
mongoose.Promise = global.Promise;mongoose.connect(process.env.MONGO_URL);
var User = require('./../schemas/user_model.js');
var Item = require('./../schemas/shop_model.js');
function isNumeri... |
const About = () => (
<div className='container'>
<div className='col-5'>
<h3>Arun!</h3>
<p>I am Arun, a product designer and engineer from India. I like to make digital experiences easier and simpler for people. I have worked with multiple teams in roles of design, engineering, product and marketing. </... |
// Gets the schema of the first media type defined in the `content` of the path operation
// https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#user-content-parameterContent
module.exports = pathOperation => {
try {
if (pathOperation.requestBody.content) {
const type = Object.keys(pa... |
import Link from 'next/link';
import React from 'react';
const contents = {
shapes: [
'bp-chose-5.1.png',
'bp-chose-5.2.png',
'bp-chose-5.3.png',
],
feature_bg: '/assets/img/feature/fea-2.png',
subtitle: 'Why Choose us',
title: 'We provide the best',
highlight_text: 'solution for',
text_1: 'B... |
//
// Counts the total number of lines in a file - async
//
// Usage:
// nodejs Async_Line_Counter.js file_path
//
//
// We need the file system module
var fs = require("fs");
var logging = false;
if(logging)
console.log(process.argv);
var filePath = process.argv[process.argv.length - 1];
if(logging)
... |
var assert = require("chai").assert;
var sinon = require("sinon");
var { objToString } = require("../");
describe("objToString()", function () {
it("returns an empty string when given an empty object", function () {
var actual = objToString({}, () => "");
assert.equal(actual, "");
});
it("invokes the t... |
<script>
$(document).ready(function () {
$('.mt-toggle-container nav em:contains("No headers")').closest('.mt-toggle-container').css('display', 'none');
$('.noindex .mt-toggle-collapse').trigger('click');
$('ol li.elm-back-to-top a').attr('href', 'javascript:void(0);');
$(document).on('click... |
import { GET_PROGRAMS, DELETE_PROGRAM, ADD_PROGRAM } from "../actions/types.js";
const initialState = {
programs: []
};
export default function(state = initialState, action) {
switch (action.type) {
case GET_PROGRAMS:
return {
...state, // gets all properties of initialState.
programs: a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.