text stringlengths 7 3.69M |
|---|
const path = require("path");
const { merge } = require("webpack-merge");
const base = require("../base/webpack.base");
module.exports = merge(base({
tsConfigFile: 'config/modules/definitelyTypedTransformer/tsconfig.json'
}), {
entry: {
index: './definitelyTypedTests/src/index.ts'
},
output: {
... |
const {app,BrowserWindow} = require('electron')
const electron=require
//Ruta donde se encuentra nuestro proyecto
const path = require('path')
//Ruta pero en formato URL
const url = require('url')
//constantes para impresion en PDF
const fs= require('fs')//sistemas de archivos
const os=require('os')//sistemas operativ... |
// understands how to filter a dataset
function DataFilter(data){
this._data = data;
}
DataFilter.prototype = {
filter: function(filter){
out = [];
if (typeof filter === 'undefined'){
filter = ''; // default value
}else{
filter = filter.toLowerCase();
}
... |
import express from "express";
const router = express.Router({ mergeParams: true });
import { getCart, setCart } from "../handlers/routes/cart";
router
.route("/")
.get(getCart)
.put(setCart);
export default routerCombiner => {
routerCombiner.use("/cart", router);
};
|
var photos = [
{"file": "1.jpg", "title": "First photo", "description": "1 photo description"},
{"file": "2.jpg", "title": "Second photo", "description": "2 photo description"},
{"file": "3.jpg", "title": "Third photo", "description": "3 photo description"},
{"file": "4.jpg", "title": "Fourth photo", "descripti... |
(function($, Strophe) {
/**
* Conversation
* Class representing a conversation between two users.
*/
window.Conversation = function(params) {
// Required parameters
var _params = {
httpBind: null,
roomId: null,
userId: null,
sid: null,
rid: null,
device: null
... |
module.exports = {
fakeKeeper: require('./fakeKeeper'),
fakeWallet: require('./fakeWallet')
}
|
import React, {Component} from 'react';
import { connect } from 'react-redux';
import NavButton from '../../../../components/NavButton/NavButton';
import {showFinal, incrementActiveId, decrementActiveId} from '../Topbar/topBarActions';
import './navbar.css';
class Navbar extends Component {
constructor (props) {
... |
///The Spread Operator with the array...
//The Arrow Function...
var addNumber = (x, y, z) => (console.log(x + y + z))
//Array..
let nums = [3, 2, 1]
//Calling the function..
addNumber(...nums)
//Adding inner of the array with Sread Operator...
let boys = ['Asad', 'Anik', 'Hossain']
let total = [... |
/*TMODJS:{"version":30,"md5":"fe8fe0f18c9799e9deacfbacf5f3898a"}*/
define(function(require) {
return require("../template")("info/list", function($data, $id) {
var $helpers = this, $escape = $helpers.$escape, data = $data.data, $out = "";
$out += '<section class="info_wrap m_b"> <section class="info... |
$(document).ready(function () {
'use strict';
/*========================================================================
Header carousel
==========================================================================*/
$('.carousel').carousel({
interval: 5000,
pause: 'none'
});
/*============... |
/**
* Import Phaser dependencies using `expose-loader`.
* This makes then available globally and it's something required by Phaser.
* The order matters since Phaser needs them available before it is imported.
*/
import PIXI from 'expose-loader?PIXI!phaser-ce/build/custom/pixi.js';
import p2 from 'expose-loader?p2!... |
"use strict";
const firstPlayer = {
name: 'Baltasis',
color: 'white'
}
const secondPlayer = {
name: 'Juodasis',
color: 'black'
}
const board = {
selector: '#checkers',
styleSelector: 'style',
width: 8,
height: 8,
color: [firstPlayer.color, secondPlayer.color]
} |
(function (scope) {
const {SIZES, Tank,Bullet} = scope;
class GameObjectsFactory {
constructor(width, height) {
this.bounds = {width, height};
}
createTank(leftPosition, direction, color, image) {
const {height} = this.bounds;
const {HEIGHT,} = SIZE... |
import * as actionTypes from "./actionTypes";
import axios from "axios";
const instance = axios.create({
baseURL: "https://api-chatr.herokuapp.com/"
});
const setLoading = () => ({
type: actionTypes.SET_MESSAGES_LOADING
});
export const fetchMessageList = channelID => {
return async dispatch => {
dispatch(... |
const express = require('express')
const router = express.Router()
// controllers
const {listAllStations, createStations} = require('../controllers/stations')
//routes
router.get('/stations', listAllStations);
router.post('/stations/create', createStations)
module.exports = router |
import React from 'react';
import Slot from "./components/Slot"
//this is a new project in react
//slote Machine
class Newapp extends React.Component {
render() {
return (
<>
<Slot a="hi" b="hi" c="hi"/>
<Slot a="kjk" b="hasan" c="sakib "/>
<Slot a="😍" b="😍" c="😍"/... |
$(function() {
var app = new window.modules.app();
// инициаизация
app.init($('.app'), [45.116751, 34.158592], 9);
app.domElem.on('init', function() {
app._addPlacemark([45.116751, 34.158592], 'Крым', 'Привет NAMASTE ;)');
app._addPlacemark([45.122584, 34.056969], '1', 'пыщь!');
... |
angular
.module("verificaciones")
.controller("FoliosCtrl", FoliosCtrl);
function FoliosCtrl($scope, $meteor, $reactive, $state, $stateParams, toastr) {
let rc = $reactive(this).attach($scope);
this.action = true;
this.subscribe('folios',()=>{
return [{}]
});
this.subscribe('usuarios',()=>{
return [{"pr... |
Ext.define('Accounts.view.main.MainView', {
extend: 'Ext.form.Panel',
xtype: 'mainView',
requires : ['Accounts.store.AccComboStore'],
title: 'Daily Transactions',
layout: 'anchor',
scrollable : true,
listeners : {
'afterrender' : function(){
var combo = Ext.getCmp('mainAcc');
combo.focus();
}... |
function gtag_formsent_conversion(destination) {
gtag('event', 'conversion', {'send_to': destination});
}
//Event snippet for Click on Link conversion page
function gtag_click_conversion(url, destination) {
const callback = function() {
if (typeof url !== "undefined") {
window.location = url... |
// Script to set up the application database
// DO NOT EDIT THIS FILE DIRECTLY - configuration values are interpolated from .env by scripts/generate-db-init-script.js
db.createUser({
user: '{{username}}',
pwd: '{{password}}',
roles: [
{
role: 'dbOwner',
db: 'remotr'
}
]
})
db.daemons.insertO... |
import "../styles/scss/main.scss";
const LogIn = () => {
const view = `
<div class="login-box">
<div class="login-head">
<h1>Вход</h1>
</div>
<section class="login-box-form">
<div class="login-title">
В войдите в свой аккаунт
</div>
<form id="... |
/* eslint-disable prettier/prettier */
$(document).ready(() => {
$("#dogService").click(() => {
$("#dog-services").toggle();
});
$("#catService").click(() => {
$("#cat-services").toggle();
});
$("#rabbitService").click(() => {
$("#rabbit-services").toggle();
});
});
document.addEventListener("D... |
function runTest()
{
FBTest.openNewTab(basePath + "script/3985/issue3985.html", function(win)
{
FBTest.enableScriptPanel(function(win)
{
FBTest.progress("Wait till the iframe is loaded");
var url = basePath + "script/3985/issue3985-iframe.js";
FBTest.setBreak... |
../../js/Clarity.js |
import React, { Component } from "react";
export default class Hog extends Component {
constructor() {
super();
this.state = {
detailsShow: false
}
}
handleClick = () => {
this.setState({ detailsShow: !this.state.detailsShow })
}
render() {
con... |
//import liraries
import React, { Component } from 'react';
import { View, Text, StyleSheet, TextInput, TouchableOpacity } from 'react-native';
import firebase from 'firebase';
// create a component
class EmailAndPassword extends Component {
state={
email:'',
password:'',
error:'',
l... |
import React from "react";
import { Header } from "@primer/components"
import styles from "./header.module.scss";
export const AppHeader = () => {
return <Header>
<Header.Item>
<Header.Link href="#" fontSize={2}>
ITEM
</Header.Link>
</Header.Item>
</Head... |
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const UserSchema = new Schema({
firstName: {
type: String,
trim: true,
required: "First Name is Required",
},
lastName: {
type: String,
trim: true,
required: "Last Name is Required",
},
password: {
type: Strin... |
var controller = require('../controllers/searchController');
const routes = (app) => {
app.route('/search')
.get(controller.searchget)
}
module.exports = routes; |
import React, { createContext, useContext, useReducer } from 'react'
import appReducer from './appReducer'
import appStateDefaults from './appState'
export const AppContext = createContext(undefined)
// eslint-disable-next-line react/prop-types
export const AppContextProvider = ({ children }) => (
<AppContext.Provi... |
import React, { Component } from 'react'
import Nav from '.././components/Navigation'
import SP from '.././components/SinglePage'
import img from '.././img/img2.jpg'
class Blog_csgo extends Component {
render() {
return (
<>
<Nav title="PUBG"/>
<SP url="/best-gam... |
import React, { useState } from "react";
import axios from "axios";
import Card from '@material-ui/core/Card';
import Layout from '../components/layout.jsx';
import CardContent from '@material-ui/core/CardContent';
import TextForm from '../components/textform.jsx';
import Divider from '@material-ui/core/Divider';
impor... |
module.exports = function() {
var AppControllerService = require('../app-controller-service/index.js'),
UserController = new AppControllerService('users'),
GroupController = new AppControllerService('groups'),
$participantInput = $('input[name="participants"]'),
$participantDropdown = $('.participant-... |
function init() {
var x = $('#coordinate_x').val().replace(',', '.'),
y = $('#coordinate_y').val().replace(',', '.'),
address = $('#current_address').val(),
title_on_marker = $('#marker_head').val();
if (x != 'None' && y != 'None') {
$('#map').css('height', '400px');
myMa... |
import { Mongo } from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import { check } from 'meteor/check';
export const Organizations = new Mongo.Collection('organizations');
Meteor.methods({
createOrg(org) {
try {
let orgId = Organizations.insert(org);
return { _id: orgId };
}... |
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'GG.' });
});
router.get('/login' , (req, res, next) => {
res.json({message:'Hi sir.'});
});
router.post('/users/login' , (req, res, next) => {
let u... |
$(document).ready(function() {
$(document).on('submit', '#registration_form', function(e){
var path = window.location.pathname;
var page = path.split("/").pop();
e.preventDefault();
var email = $('#email').val();
var password = $('#password').val();
var name = $('#name').val();
var surName =... |
"use strict";
// Express
const app = require("express")();
// Models
const { Product } = require("./models");
// DB Connection
const mongoose = require("mongoose");
mongoose.Promise = require("bluebird");
app.use((req, res, next) => {
mongoose
.connect("mongodb://localhost/async_development", {
useMongoCli... |
/* eslint-disable react/display-name */
import React from 'react'
import { withTranslation } from 'react-i18next'
import { Container, Row, Card } from 'reactstrap'
import Header from '../components/Headers/Header.jsx'
import DataTable from 'react-data-table-component'
import orderBy from 'lodash/orderBy'
import CustomL... |
document.querySelector(".right_side").style.background="#d3c26f";
|
const config = require("../config.json");
const Discord = require("discord.js");
const {
getRandomMeme,
getLocalRandomMeme
} = require(`@blad3mak3r/reddit-memes`);
function formatNumber(num) {
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')
};
const subreddits_tattoo = [
`Best_tatt... |
'use strict'
const ChattingRoom = require('./ChattingRoom');
function Rooms(){
this.rooms = new Array();
}
Rooms.prototype.addRoom = function(repsId){
let chattingRoom = new ChattingRoom(repsId);
rooms.push(chattingRoom);
return chattingRoom;
};
Rooms.prototype.deleteRoom = function(repsId){
let index = this.... |
import React, {createContext, useState, useEffect} from 'react';
import axios from 'axios';
export const NewsContext = createContext()
export const NewsContextProvider = (props) => {
const [data, setData] = useState();
const apiKey = 'http://newsapi.org/v2/everything?domains=lemonde.fr&apiKey=8d459dea89ba417d... |
import React from "react";
import HomeHeaderBootstrap from "../reusableComponents/HomeHeaderBootstrap";
import ResourcesLIst from "./ResourcesList";
import StickyFooter from "../reusableComponents/stickyFooter";
const Resources = () => {
return (
<div className="main-container">
<div className="container">
... |
import Koa from 'koa'
import { getPage } from './github.js'
import { get, set } from './cache.js'
const app = new Koa();
const githubApiToken = process.env.GITHUB_API_TOKEN
app.use(async ctx => {
const cached = get()
if (cached) {
return ctx.body = cached
}
const page = await getPage(githubAp... |
(function(w, d){
const cl = console.log
const create_modal = new bootstrap.Modal(d.getElementById('create_modal'))
const create_first_modal = new bootstrap.Modal(d.getElementById('create_first_modal'))
const add_note_modal = new bootstrap.Modal(d.getElementById('add_note_modal'))
const add_survey_modal = n... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import ProjectCard from './ProjectCard/ProjectCard';
import classes from './Project.module.css';
import {
getAsync,
postAsync,
putAsync,
deleteAsync,
} from '../../../../../tool/api-helper';
import { languageHelper } from '../../../.... |
define(['jquery', 'echarts'], ($, echarts) => {
let module = {};
let chart;
module.init = (el) => {
var chart = echarts.init(document.getElementById(el));
var options = {
title: {
text: '预算 vs 开销',
subtext: '纯属虚构'
},
tooltip: {
trigger: 'axis'
},... |
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
module.exports = mongoose.model('ListItem', new Schema({
name: {
type: String,
required: true
},
quantity: {
type: Number,
required: true
},
unit: {
type: String,
required: true
},
... |
//Função da mascara para substituir valores
function mask(element, maskName) {
setTimeout(function () {
var valor = maskName(element.value);
if (valor != element.value) {
element.value = valor;
}
}, 1);
}
//Função para aplicar a mascara em cima de um elemento na pagina (id)
... |
function showList(){
document.getElementById("addList").style.display = "block";
document.getElementById("cover").style.display = "block";
}
function showThing(){
document.getElementById("addThing").style.display = "block";
document.getElementById("cover").style.display = "block";
}
function hideAll(){
document... |
import { useState, useEffect } from 'react';
import { Container, Row, Col } from 'react-bootstrap';
import {fs, auth} from '../../../config/firebase.js'
import {EncomendasItem} from './indivudal-item/encomenda-item.js';
const EncomendasList = () => {
const [items, setItems] = useState([]);
useEffect(() => {
... |
function createDrawObject(name,model,cubeColor,fakeColor,eyePos,lightPos,spin,translation,scale) {
var pickObj= new Object();
pickObj.name = name;
pickObj.model = model;
pickObj.cubeColor = cubeColor;
pickObj.fakeColor = fakeColor;
pickObj.eyePos = eyePos;
pickObj.lightPos = lightPos;
pickObj.spin = spi... |
define(["app"],
function (app) {
var Tracker = Backbone.Model.extend({
testGaAccount : "UA-65962807-1",
testBaiduAccount : "d91da0c4c2d6f4f817bf6826f16cec40",
initialize: function (opt) {
var gaAccount = this.testGaAccount;
var baiduA... |
/* global document */
System
.import("app.module")
.then(() =>
angular
.element(document)
.ready(() => angular.bootstrap(document, ["app"], {strictDi: true}))
);
|
import React from 'react';
import styles from './styles/splash.scss';
import BlockchainDemo from './components/BlockchainDemo';
import ArrowWrapper from './components/ArrowWrapper';
const Splash = () => {
return (
<div className={`row ${styles.container1}`}>
<BlockchainDemo />
<ArrowWrapper />
</... |
async function fetchInitialDeals() {
try {
const response = await fetch('https://bakesaleforgood.com/api/deals');
const responseJson = await response.json();
return responseJson;
} catch (error) {
console.error(error);
}
}
async function fetchDealDetail(dealId) {
try {
... |
import React, { Component } from 'react';
import {Link, withRouter} from 'react-router-dom';
import { connect } from 'react-redux';
class DashboardMenu extends Component {
constructor(props) {
super(props);
console.log("props ===>", props);
this.state = {
match : prop... |
class Turtle {
constructor(x, y) {
this.x = x;
this.y = y;
this.location = {
'x': x,
'y': y
};
this.direction = "e";
this.walked = [];
this.xMax = 0;
this.xArray = [];
this.yMax = 0;
this.yArray = [];
}
... |
import React from "react";
import Table from "./Table";
import Form from "../Forms/Form";
class App extends React.Component {
state = {
characters: [
{
name: 'D-Dog',
job: 'Ju Jitsu Man',
},
{
name: 'B-Dog',
... |
import { renderString } from '../../src/index';
describe(`A color picker module`, () => {
it(`unnamed case 0`, () => {
const html = renderString(`{% color "color" %}`);
});
it(`unnamed case 1`, () => {
const html = renderString(`{% color "my_color_picker", label="Choose a color", color="#00000... |
/**
* creates the resizer object
* @return {Objects} resizer object with Various helper methods.
*/
var resizer = d3scomos.resizer = (function(){
/**
* return the resize handle
* @return {[type]} [description]
*/
var dragSE = d3.behavior.drag()
//.origin(Object)
.on("... |
"use strict";
var _ = require('lodash');
var models = require('../models');
var logger = require('../logger');
var FeedbackMeta = module.exports;
FeedbackMeta.findById = function (uuid, callback) {
models.FeedbackMeta.findById(uuid).then(function (data) {
return callback(null, data);
}, function (... |
/**
* Service
*/
angular.module('ngApp.systemAlert').
factory('SystemAlertService', function ($http, config, SessionService) {
var getAllSystemAlerts = function (trackSystemAlert) {
return $http.post(config.SERVICE_URL + '/SystemAlert/GetSystemAlerts', trackSystemAlert);
};
... |
var mocha = require('mocha')
var chai = require('chai')
var expect = chai.expect
var SpyJSONToHarnessJSON = require('../src/SpyJSONToHarnessJSON')
mocha.describe('Spy JSON to Harness JSON', function () {
mocha.it('One Variable', function () {
var spyJSON = {
testedFunctionCall: 'testFunction(... |
import React, { useContext } from "react";
import { StyledLink, SvgIcon } from "@common/Generic.js";
import { ThemeContext } from "@common/Layout";
import { Help } from "@styles/svg/Buttons";
import styled from "styled-components";
const StyledSvg = styled(SvgIcon)`
width: 3vh;
height: 3vh;
margin: 1vh;
`;
export... |
import gql from 'graphql-tag'
export const getAllVideos = gql`
query VideoPaginator($first: Int!, $page: Int) {
videos(first: $first, page: $page) {
data {
id
title
video_url
}
}
}
`
|
/* eslint no-new-object: 'off' */
const assert = require('assert');
const obvl = require('../');
describe('OBVL', () => {
let fallbackValue = { a: 1, b: 2, c: 3 };
it('should return `value` when `value` is Object.', () => {
let emptyObject = {};
let objectInstance = new Object();
assert.strictEqual(obvl(emp... |
import React from 'react';
import { Switch, Route, Redirect } from 'react-router';
import dashboard from './dashboard/dashboard';
import Login from './login/Login';
import PrivateRoute from './auth-guard';
const ReactRouter = props => {
return (
<Switch>
<Route exact path="/login" component={Login} />
... |
import React, {useState} from "react";
import AddUser from "./components/Users/AddUser";
import UserList from "./components/Users/UserList";
const DUMMY_USERS = [
{
name: "Ai",
age: 31,
id: "e1",
},
{
name: "Kevin",
age: 35,
id: "e2",
},
{
name: "Gavin",
age: 37,
id: "e3",... |
import { Schema, arrayOf } from 'normalizr';
import bookSchema from './bookSchema';
const author = new Schema('author', {
idAttribute: 'name',
});
author.define({
books: arrayOf(bookSchema),
});
export default author;
|
'use strict';
angular.module('questionnaire2', [
'questionnaire2.service'
]);
|
/*
* Создайте функцию truncate(str, maxlength), которая проверяет длину строки str и, если она превосходит maxlength, заменяет конец str на "…", так, чтобы её длина стала равна maxlength.
Результатом функции должна быть та же строка, если усечение не требуется, либо, если необходимо, усечённая строка.
Например:
trun... |
var game = {
nums: [[0]],
price:[[1]],
cash: 1,
counter: [],
}
var check = 0;
function init() {
setInterval(loop, 50);
updateTable();
}
function loop() {
check++;
var nums = game.nums;
var cps;
for (var i = 0; i < nums.length; i++) {
if(i == 0... |
import React, { Component } from 'react';
import { Typography } from '@material-ui/core';
import { withStyles } from '@material-ui/core/styles';
import svg from '../../images/undraw_moonlight_5ksn.svg';
const styles = {
root: {
display: 'flex',
flexDirection: 'column',
width: '100%',
height: '100%',
... |
import React from 'react';
// MATERIAL COMPONENTS
import { makeStyles } from '@material-ui/core/styles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableContainer from '@material-ui/core/TableContainer';
... |
const fs = require('fs');
//逐步操作
//1.打开文件 fs.openSync(path[, flags, mode])
//path为文件的路径
//flag用于表明需要什么操作,
//w-打开文件用于写入。如果文件不存在则创建文件,如果文件已存在则截断文件。
//'a' - 打开文件用于追加。如果文件不存在,则创建该文件。
// const fd = fs.openSync('./01-aa.txt','w');//fd相当于一个打开文件成功后返回的标识
const fd = fs.openSync('./01-aa.txt','a');//fd相当于一个打开文件成功后返回的标识
//2.写入内容... |
'use strict';
describe("StateEvent Unit Tests", function() {
beforeEach(module('myApp'));
var $httpBackend;
var StateEvent;
beforeEach(inject(function($injector, _StateEvent_) {
StateEvent = _StateEvent_;
$httpBackend = $injector.get('$httpBackend');
$httpBackend.when('GET', 'http://mywifi.dev... |
import React,{Component} from 'react';
import {View,Text,StyleSheet,FlatList,AsyncStorage,Image,StatusBar,TouchableOpacity,ImageBackground} from 'react-native';
import jwt from 'jwt-decode';
import api from '../services/api';
class Consultas extends Component{
static navigationOptions={
header:null,
... |
/* Mongolian initialisation for the jQuery UI date picker plugin. */
$(document).ready(function() { //alert('alert1');
$.datepicker.regional['mn'] = {clearText: 'Effacer', clearStatus: '',
closeText: 'Хаах',
prevText: 'Өмнөх',
nextText: 'Дараах',
currentText: 'Одоо',
monthNames: ['1 дүгээр сар','2 дугаар са... |
// Install node.js, navigate to the app.build.js file path,
// and then run this command: "node js/libs/r.js -o js/app/config/build-single.js"
//
// Version optimizing app file sample.js
({
baseUrl: "../../",
paths: {
jquery: "empty:" // CDN
},
out: "../sample.min.js",
name: 'app/sample'
})
|
Array.prototype.quickSort = function(){
quickSortHelper(this, 0, this.length-1);
function quickSortHelper(arr,start,end){
if(start<end){
var part = partition(arr,start,end);
quickSortHelper(arr,start,part-1);
quickSortHelper(arr,part+1,end);
}
}
fu... |
const mongoose = require('mongoose');
let PaymentsHistorySchema = mongoose.Schema({
userID: {type: String, ref: 'User'},
amount: {type: Number},
remainMoney: {type: Number},
fromUser: {type: String, ref: 'User'},
typeAdvisoryID: {type: String, ref: 'TypeAdvisory'},
status: {type: Number},
createdAt: {
type: N... |
function multiProcessOutput() {
const outputData = {};
return {
generateOutput() {
const realOutput = [];
const processesOutput = Object.keys(outputData);
for(let i = 0; i < processesOutput.length; i++) {
const processOutput = outputData[processesOu... |
const Lesson = require("../models/lessonModel");
const Teacher = require("../models/teacherModel")
/**
* Récupérer la liste des professeurs
* @param {*} req
* @param {*} res
*/
exports.getTeachers = (req, res) => {
Teacher.getTeachers((err, data) => {
if (err) {
res.status(500).send({
... |
app.service('httpInterceptors', ['$timeout', '$rootScope', function($timeout, $rootScope) {
return {
request: function(config) {
log(config);
warn("Request Received : " + Date());
return config;
},
response: function(config) {
log(config)... |
import { Component } from 'react';
import Link from 'next/link';
import Header from '../components/header';
import withEnvAndCookies from '../lib/withEnvAndCookies';
class HomePage extends Component {
render() {
return (
<main>
<Header />
<h3>Test: {process.env.SHOP_SLUG}</h3>
<section>
<p>
... |
// Copyright (C) 2018-Present Masato Nomiyama
import React from 'react'
import { withStyles } from '@material-ui/core/styles'
import Typography from '@material-ui/core/Typography'
import { theme, style } from '../theme'
const customStyle = theme => {
return {
...style,
body: {
margin: '0 0 0 16px',
... |
import { put, takeLatest } from 'redux-saga/effects';
import axios from 'axios';
function* getGrowingRoom(action) {
try {
// get growing room data
let response = yield axios.get('api/process/growing_room');
console.log(`growing room `, response);
// set table to redux state
yield put({ type: 'SET... |
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
var CategorySchema = new Schema({
title: { type: String, required: true, maxLength: 100 },
color: { type: String, default: "white" },
active: { type: Boolean, default: true, required: true },
});
module.exports = mongoose.model("Category", Catego... |
const redisClient = require('../redisClient');
function Users(){
this.client = redisClient.getRedis();
};
module.exports = new Users();
// Insert the redis online key
Users.prototype.upsert = function (connectionId,meta){
this.client.hset(
'online',
meta._id,
JSON.stringify({
... |
test('test one', () => {
let text = 'testing';
expect(text).toBe('testing');
}); |
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import NewsArticle from './NewsArticle';
const Container = styled.div`
display: flex;
flex-wrap: wrap;
gap: 10px;
width: 100%;
justify-content: center;
align-items: center;
`;
const NewsContainer = ({ ar... |
const express = require("express");
const session = require('express-session');
const fs = require('fs');
const port = 3000;
const app = express();
let reviews = [];
app.set('views', './templates');
app.set('view engine', 'ejs');
app.use(express.static('public'));
app.use(session({
secret: 'my-secret',
resave: t... |
class Contact{
constructor(){
}
}
class ContactSuccess{
constructor(){
this.bindAllButton();
}
bindAllButton(){
$("button#homepage-redirect").click(() => {
window.location.href = "/";
})
}
}
(() => {
switch (window.location.pathname.replaceAll("/", ""... |
// pages/consultant_activity/lottery.js
Page({data: {}}) |
import { render, screen } from "@testing-library/react"
import Applicant from "./Applicant"
test("renders an applicant", () => {
render(
<Applicant
id="my-id"
name="my name"
description="my description"
thumb="/my/thumb/url"
/>
)
const nameElement = screen.getByText(/my name/i)
... |
import React, { useState, useEffect } from 'react';
import ProjectsList from './ProjectsList';
import SingleProject from './SingleProject';
import { makeStyles } from '@material-ui/core/styles';
import ProjectsForm from './ProjectsForm';
import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Pa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.