text stringlengths 7 3.69M |
|---|
import React, { useState } from 'react';
import { connect } from 'react-redux';
import './Login.scss';
import Button from '../Button/Button';
import InputField from '../InputField/InputField';
import { loginUser } from '../../store/actions/auth';
const Login = ({ history, loginUser, isAuth }) => {
const [data, ... |
/*
* @lc app=leetcode id=121 lang=javascript
*
* [121] Best Time to Buy and Sell Stock
*/
// @lc code=start
/**
* @param {number[]} prices
* @return {number}
*/
var maxProfit = function(prices) {
if (!prices.length) return 0;
const dp = new Array(prices.length).fill(0);
let min = prices[0];
for (let ... |
import Types from "sequelize";
import props from "../settings/props.js";
const { DataTypes } = Types;
const Todos = props.sequelize.define(
"todo_list",
{
todo_id: { type: DataTypes.INTEGER, primaryKey: true },
todo_title: DataTypes.STRING,
todo_body: DataTypes.STRING,
},
{
freezeTableName: true... |
import React, { Component } from "react";
import { connect } from "react-redux";
import { createDogList } from "../../actions/dogActions";
import PropTypes from "prop-types";
import TextInput from "../common/TextInput";
import SelectOnce from "../common/SelectOnce";
import M from "materialize-css/dist/js/materialize.mi... |
function printShirt() {
// Change the colour of the t-shirt
var colList = document.getElementById("js-colour-list");
document.getElementById("js-tShirt").style.backgroundColor = colList.options[colList.selectedIndex].value;
// if nothing has been selected then change the picture
if (document.getEl... |
/**
* Created by Joey on 2015/12/14.
*/
var preStat = "";
var preList = [];
var NOTIFY = Notify();
var interval_id;
var intF = function (start) {
if (interval_id)
window.clearInterval(interval_id);
if (!start) {
return;
}
interval_id = window.setInterval(function () {
refresh(... |
function checkCashRegister(price, cash, cid) {
var currencyCent = {
'ONE HUNDRED': 10000,
'TWENTY': 2000,
'TEN': 1000,
'FIVE': 500,
'ONE': 100,
'QUARTER': 25,
'DIME': 10,
'NICKEL': 5,
'PENNY': 1
};
var currencyKeys = Object.keys(currenc... |
angular.module('nemesisApp').controller('userController',
function ($scope, $mdSidenav, $rootScope, $location, $http, $mdDialog) {
$scope.user = {}
$scope.refresh = () => {
$http.get('/api/usuario')
.then(res => {
$scope.users = res.data
}, err => {
console.log(err)... |
import React from 'react';
import axios from 'axios';
import { Link } from 'react-router-dom'
const DisplayQuizs = ({quizs}) => {
return (
<ul>
{quizs.map((quiz, i) => {
return (
<li key={i}>
{quiz.name}, {quiz.type}
<span><Link to={`/${quiz.id}`}>view</Link></span>
</li>
)
})}
... |
/*zoomGraph.js : class defining zoom behavior on the graph
zoom in and zoom out on x and y axis by scrolling mouse wheel
peak intensity is also adjusted by ctrl + mouse wheel
*/
class GraphZoom
{
scrollTimer;//detect if scroll has ended or not
constructor(){}
adjustPeakHeight = (scaleFactor) => {
... |
var wrapper;
wrapper = document.getElementById('main-slider');
wrapper.children[0].style.height = window.innerWidth + 'px';
wrapper.style.height = window.innerWidth + 'px';
// items.json 파일의 json 형식에 문제가 있어 수정했습니다.
function loadJSON(jsonfile, callback) {
var xobj = new XMLHttpRequest();
xobj.overrideMimeT... |
/**
* Created by caoguangyao on 2014/11/4 0004.
*/
var apiIp ='http://v2.api.njnetting.cn/';//全局的接口地址
function GetQueryString(name){ //获取浏览器的参数
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return decodeURIComponent(r[2]); return n... |
import './style.css';
//creating contructor for ball object
class Ball{
constructor(top,left,height){
this.top=top;
this.left=left;
this.high=1.6;
this.speed=5;
this.direction=1;
this.kick=false;
this.scoreText=false;
}
}
//creating initial starting point for theball
const initialX=40;
c... |
/*!
* Basic postMessage Support
*
* Copyright (c) 2013-2016 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
*
* Handles the postMessage stuff in the pattern, view-all, and style guide templates.
*
*/
// alert the iframe parent that the pattern has loaded assuming this view was loaded in an ifra... |
var dir________________________________07c2df013bb20677b8e65a9f18968d2c________________8js________8js____8js__8js_8js =
[
[ "dir________________07c2df013bb20677b8e65a9f18968d2c________8js____8js__8js_8js", "dir________________________________07c2df013bb20677b8e65a9f18968d2c________________8js________8js____8js__8js... |
/* Toggle between adding and removing the "responsive" class to topnav when the user clicks on the icon */
function myFunction() {
var x = document.getElementById("tn");
if (x.className === "top-nav") {
x.className += " responsive";
} else {
x.className = "top-nav";
}
}
// When the user ... |
const weatherForm = document.querySelector('form')
const search = document.querySelector('input')
const msgError = document.querySelector('#message-1')
const msgTemperature = document.querySelector('#message-2')
const msgAddress = document.querySelector('#message-3')
const msgTimezone = document.querySelector('#me... |
import * as React from 'react'
import Picture from '../../images/Picture.jpg'
import { InfoBox, SmallAboutContainer, StyledTitle, StyledParagraph, StyledLink } from './smallAbout-style';
export default function SmallAbout({lang}) {
const translatedData = {
pt: {
aboutTitle: "SOBRE MIM",
... |
var app = angular.module('executUpload', ['toastr']);
app.controller('executUploadCtrl', function($scope, executSer,$stateParams,$state,toastr){
$scope.showed=true
var infoData ={id: $stateParams.id};
//获取ID
executSer.exectId(infoData).then(function(response){
if(response.data.code== 0){
... |
const config = require('./app/config/config');
var rimraf = require('rimraf');
if (!config.testOnRinkeby) {
rimraf.sync('./db');
console.log("Cleared DB");
}
const express = require('express');
const app = express();
const https = require('https')
const Router = require('named-routes');
var r... |
import React, { PropTypes } from 'react';
import ReactDOM from 'react-dom';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from './EditPage.less';
import { getObject } from '../../../../common/common';
import {SuperForm, SuperToolbar, SuperTable2, ModalWithDrag,Title} from '../../../../compon... |
import {
SET_QUERY,
SAVE_QUERY,
SEARCH_RESULT_OVERVIEW,
SEARCH_LOADING
} from "../actions/types";
const initialState = {
hotelQuery: { results: [] }, // all the hotels that match
searchQuery: null, // the search arguments
loading: true
};
// ...state = current state
export default function(state = initi... |
import React from 'react'
import renderer from 'react-test-renderer'
import { StyleRoot } from '@instacart/radium'
import Row from '../Row'
it('renders Row correctly', () => {
const tree = renderer
.create(
<StyleRoot>
<div>
<Row />
</div>
</StyleRoot>
)
.toJSON()
... |
import React, { useEffect } from 'react'
import { BrowserRouter, Switch, Route } from 'react-router-dom'
import LoginPage from '../Pages/Login'
import { useSelector, useDispatch } from 'react-redux'
import MainView from '../Pages/MainView'
import DashboardPage from '../Pages/Dashboard'
import OffersPage from '../Pages/... |
import React from "react";
import ReactDOM from "react-dom";
class Layout extends React.Component {
constructor (props) {
super(props);
this.state = {
joke: []
};
}
fetchMusic () {
fetch('https://api.chucknorris.io/jokes/random?category=music')
.then(results => {
... |
import React from 'react';
const FeaturesModal = ({ modal, modalTitle }) => (
<div className="modal fade" id="modalCenter" tabIndex="-1" role="dialog" aria-labelledby="modalCenterTitle" aria-hidden="true">
<div className="modal-dialog modal-dialog-centered modal-lg" role="document">
<div className="modal-c... |
import { Card, Button, Form } from 'react-bootstrap'
export const EditDemo = () => {
return (
<Card>
<Card.Body>
<Card.Title>Edit Demo</Card.Title>
<Card.Text>
<Form>
<Form.Group className="mb-3" controlId="formBasicName">
<Form.Label>Name</Form.Label>
... |
const express = require("express");
const router = express.Router();
/**
* Express router for /toppic
*
* Render a toppic task configure web page back to user
*/
const toppic = router.get('/toppic', function (req, res) {
if (req.session.passport === undefined) {
res.write("Please log in first to use to... |
// pages/note/note.js
Page({
/**
* 页面的初始数据
*/
data: {
list:[],
},
properties: {
// list: {
// type: Object,
// value: []
// },
},
detail:function(e){
console.log(JSON.stringify(e.currentTarget.dataset))
wx.navigateTo({
url: './detail?id=' + e.currentTarget.data... |
var dom = localStorage.getItem("dom");
document.getElementById("status").textContent = dom;
|
import { render, screen, cleanup, act, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import axios from "axios";
import DeleteTodoBtn from "../../components/DeleteTodoBtn";
describe("DeleteTodoBtn", () => {
beforeEach(() => {
axios.delete = jest.fn((url, body) => {... |
jest.dontMock('../List.react');
describe('List Component', function() {
it('counts up or down in increments of 1 or 5', function() {
var React = require('react/addons');
var ListComponent = require('../List.react');
var TestUtils = React.addons.TestUtils;
var initItems = ['Welcome', 'to', 'React'];
... |
const chart = (state=[], action) => action.type === `SET_CHART` ? action.payload : state;
export default chart; |
import React, { Component } from "react"
import Playlist from "./Playlist.jsx"
import NewPlaylistModal from './NewPlaylistModal.jsx'
import './playlist.css'
export default class PlaylistsView extends Component {
render() {
return (
<React.Fragment>
<div className="d-flex playlistTi... |
var $document = $(document);
$document.ready(function() {
initClipboard()
$('.btn-down:contains(百度离线)').on('click',function(){
var self = this
var toURL= 'http://pan.baidu.com/disk/home'
doCopy()
openPage(toURL)
// initTour()
})
$('.btn-down:cont... |
describe('standard.lang', () => {
test.todo('Atributo value retorna a lang corrente')
test.todo('Metodo setValue define uma nova linguagem')
})
|
var os = require('os'),
getIP = require('external-ip')(),
ip = '127.0.0.1',
accounts = {};
var stats = {
setAccounts: function (accs) {
accounts = accs;
},
sendStats: function (socket) {
if (ip == '127.0.0.1') {
setTimeout(function () {
stats.sendStats(socket);
}, 100);
return;
}
socket.e... |
import styled from "styled-components";
const CalendarTitleStyled = styled.h3`
font-family: Montserrat;
font-style: normal;
font-weight: 600;
font-size: 16px;
line-height: 24px;
text-align: center;
color: #5b5b5b;
`;
const CalendarWrapper = styled.div`
display:flex;
flex-direction:row;
ju... |
import React from 'react';
import { useHistory } from 'react-router-dom';
import styled from 'styled-components';
const StyledDiv = styled.div`
color: red;
padding: 20px;
`;
const BackButton = styled.button`
display: flex;
align-self: baseline;
padding: 5px;
background: transparent;
border: 1px ... |
// Generated by CoffeeScript 1.10.0
(function() {
var PDFDocument, doc;
PDFDocument = require('pdfkit');
doc = new PDFDocument;
doc.pipe(fs.createWriteStream('output.pdf'));
doc.font('fonts/PalatinoBold.ttf').fontSize(25).text('Some text with an embedded font!', 100, 100);
doc.addPage().fontSize(25).te... |
import React, { Component } from 'react'
import axios from 'axios'
import Pagination from '../Pagination/Pagination';
import Rating from '../../Rating/Rating'
import { connect } from 'react-redux'
import { addCpu } from '../../../Ducks/Reducer'
import { withRouter,Link } from 'react-router-dom'
class CpuTable extends ... |
let webpack = require('webpack');
//let deepScope = require('webpack-deep-scope-plugin').default;
let path = require('path');
let package = require('./package.json');
module.exports = (env, argv) => {
let nodeTarget = {
target: "node",
entry: "./src/index.ts",
mode: argv.mode || 'development',
output: {
path:... |
import { AsyncStorage } from "react-native";
import Orientation from 'react-native-orientation';
import React, { Component } from 'react';
import { AppRegistry, Image, StatusBar } from "react-native";
import {
Button,
Text,
Container,
List,
ListItem,
Content,
Icon,
Left,
Body,
Right
} from "native-b... |
const sizes = {
phoneMini: '320px',
phoneSmall: '360px',
phone: '375px',
phoneWide: '384px',
phablet: '414px',
tabletSmall: '480px',
tablet: '640px',
tabletWide: '750px',
desktop: '900px',
desktopWide: '1200px',
}
export const media = {
phone: `(min-width: ${sizes.phoneMini}`,
phoneMini: `(min-w... |
function startTimer(duration, display) {
var timer = duration, minutes, seconds;
setInterval(function () {
minutes = parseInt(timer / 60, 10);
seconds = parseInt(timer % 60, 10);
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds;... |
var React = require('react');
module.exports = () => (
<div>
<h1 className="text-center page-title">About</h1>
<div className="callout">
<p>
This is a weather application build on React.
I have build it for <b>The Complete React Web App Developer Course</b>.
</p>
<p>
... |
const setTime = (val) => {
var y = val.split('-')[0];
var m = val.split('-')[1];
var dhms = val.split('-')[2];
var d = dhms.split('T')[0];
return( y+'/'+m+'/'+'/'+d )
};
export { setTime }; |
import React from "react";
import styled from "styled-components";
import Title from "../../atoms/Title/Title";
import ProductInfo from "../../molecules/ProductInfo/ProductInfo";
const StyledWrapper = styled.div`
padding: 2rem 0.5rem;
@media (min-width: 768px) {
padding: 2rem 4rem;
}
`;
const StyledFlexWra... |
`use strict`;
const tabsNav = document.querySelector('.tabs-nav');
const tabsContent = document.querySelector('.tabs-content');
const tabClone = tabsNav.firstElementChild.cloneNode(true);
tabsNav.removeChild(tabsNav.firstElementChild);
const articles = Array.from(document.getElementsByTagName('article'));
for(let arti... |
Citations.insert = function(userId, citation, auteur) {
var set = {
citation: citation,
auteur: auteur,
user_id: userId,
date: new Date()
};
Citations.log.trace("Citations.insert", set);
return CitationsCollection.insert(set);
}
|
export const bekahAgain = {
"name": "bekah likes gifs",
"skills": "gif hunting",
"gif": "https://media.giphy.com/media/cFdHXXm5GhJsc/giphy.gif"
}
export default bekahAgain |
import Head from 'next/head'
export default ({title = 'This is the default title' }) => (
<Head>
<title>{ title }</title>
<meta charSet='utf-8' />
<link rel='stylesheet' href='/static/react-md.amber-teal.min.css' />
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto... |
import React, { Component } from 'react';
import { composeWithTracker } from 'react-komposer';
function composer(props, onData) {
const subscription = Meteor.subscribe('getSolutions',props.taskId);
if (subscription.ready()) {
console.log(Solutions.find().fetch());
const data = {
rea... |
export default class IndexController {
/**
* For API testing
*
* @param {Object} req
* @param {Object} res
*/
ping(req, res) {
res.json({ status: 200 });
}
/**
* Renders home page
*
* @param {Object} req
* @param {Object} res
*/
index(req, res) {
res.render('index');
}... |
// import { xianRequest } from './xianRequest'
// import commonTip from './common'
// export default {
// xianRequest,
// commonTip
// }
|
window.addEventListener("DOMContentLoaded", function(){
jQuery(function($) {
/**
* zoom: "5",
* data_x: null,
* data_y: null,
* text: "Yandex Maps",
* code: "45035"
*/
console.log(mapObj);
ymaps.ready(WPYML_init);
function WPYML... |
// theme.js
export const lightTheme = {
body: '#E2E2E2',
text: '#363537',
link: {
normal: 'slateblue',
hover: 'cornflowerblue',
},
border: '1px solid #363537',
}
export const darkTheme = {
body: '#111',
text: 'GhostWhite',
link: {
normal: 'royalblue',
hover: 'blue',
},
border: '1px ... |
import Footer from '../components/Footer';
import Whatsapp from '../img/whatsapp-clone.jpg';
import Hulu from '../img/hulu-clone.jpg';
import Google from '../img/google-clone.jpg'
import GitHub from '../img/github-project.jpg';
import MealFinder from '../img/meal-finder-project.jpg';
import OmniFood from '../img/... |
(function($) {
// Сохраняем функции, которые описаны в файле misc/ajax.js.
// beforeSend подготавливает AJAX запрос перед его отправкой.
// success вызывается после успешного выполнения AJAX.
// error вызывается после неудачного выполения AJAX.
var beforeSend = Drupal.ajax.prototype.beforeSend;
... |
module.exports = {
stylist_username: '<...>',
stylist_password: '<...>',
oauth_consumer_key: '<...>',
oauth_consumer_secret: '<...>',
grant_type: 'client_credentials',
site_url: 'https://pos.shortcutssoftware.com/site/<...>'
}; |
var controls = {
key: function(value) {
game.numbers.click(value);
},
reset: function() {
},
help: function() {
view.animate.move_screen(-1920);
game.reset();
},
play: function() {
view.animate.move_screen(-960);
game.reset();
},
about: function() {
view.animate.move_screen(0);
game.timer.pa... |
// Copyright 2012 Dmitry Monin. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applica... |
let cursos = ['Programacion','MKT','UX','Data Science','Python']
//destructuracion array
let [programacion,mkt] = cursos;
//console.log(cursos);
//console.log(programacion);
//console.log(mkt);
//desctructuracion objeto
let persona = {
nombre: "Carli",
edad: 24,
domicilio: "Congreso 1661 6A"
}
let {no... |
import React from 'react';
import './App.css';
import Layout from './components/Layout.js'
function App() {
document.title = "Stat Roller";
return (
<div className="container">
<Layout/>
</div>
);
}
export default App;
|
(function(){
'use strict';
angular.module('app.consultorios', [
'app.consultorios.controller',
'app.consultorios.services',
'app.consultorios.router',
'app.consultorios.directivas'
]);
})();
|
export const SET_INGREDIENTS = 'SET_INGREDIENTS';
export const LOAD_RECIPES = 'LOAD_RECIPES'; |
/* 🤖 this file was generated by svg-to-ts*/
export const EOSIconsSwapVert = {
name: 'swap_vert',
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"/></svg>`
};
|
/* Generated from Java with JSweet 3.0.0-SNAPSHOT - http://www.jsweet.org */
var quickstart;
(function (quickstart) {
/**
* Classe contente il main per la generazione della pagina home.html
* @author miche
* @class
*/
class Home {
static main(args) {
let divBar ... |
class Player {
constructor(name, type, x, y, size = 30) {
this.name = name;
this.type = type;
this.size = size;
this.arrows = type == "Police" ? [65, 68, 87, 83] : [37, 39, 38, 40];
this.color = type == "Police" ? "red" : "black";
this.x = x;
this.y = y;
}
draw(ctx) {
ctx.beginPath... |
function a() {
console.log(this);
this.newvariable = 'hello';
}
var b = function() {
console.log(this);
}
a();
console.log(newvariable); // not good!
b();
var c = {
name: 'The c object',
log: function() {
var self = this;
self.name = 'Updated c object';
conso... |
import React from 'react';
import './Enrolled.css'
const Enrolled = (props) => {
const addClasses = props.addClasses;
console.log(addClasses)
let total=0;
for (let i = 0; i < addClasses.length; i++) {
const course = addClasses[i];
total = total+course.price;
}
return (... |
var url = require('url')
var websocket = require('websocket-stream')
var MuxDemux = require('mux-demux')
var Model = require('scuttlebutt/model')
var duplexEmitter = require('duplex-emitter')
window.socket = websocket('ws://' + url.parse(window.location.href).host)
var emitter
var connected = false
var mdm = MuxDemu... |
/**
MODULOS EXPRESS
**/
let logger = require(process.cwd() + '/utils/logger.js'); //gerador de logs
let express = require('express');
let Router = express.Router();
let security = require('../utils/security');
let utilsFunctions = require('../utils/functions');
/**
CONEXAO DB
**/
let db = require('../config/connect')... |
const DBF = require('stream-dbf');
const createCsvWriter = require('csv-writer').createObjectCsvWriter;
const parseAddrObj = (filename) => new Promise((resolve, reject) => {
const FILE_NAME = filename;
let data = [];
let index = 0;
const parser = new DBF(`./files/fias_dbf/${FILE_NAME}`, {encoding: 'cp866', ... |
import React from 'react'
import { BrowserRouter, Switch } from 'react-router-dom'
import css from './styles.css'
import Navigation from '../Navigation'
const Router = (props) => {
return (
<div>
<BrowserRouter>
<main>
<Navigation />
<Swi... |
app.controller('main', [
'$scope',
'$rootScope',
'$http',
'$routeParams',
function ($scope, $rootScope, $http, $routeParams) {
var api = $rootScope.site_url;
$scope.loaderInit = () => {
//Total cart contents and Total Cart Price
$http.post(api + '/cart/fetchJson').then(function (response) {
$scope.c... |
require("../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/packageA/map/_price_select" ], {
"0d90": function(t, e, a) {
a.r(e);
var n = a("9295"), c = a.n(n);
for (var r in n) [ "default" ].indexOf(r) < 0 && function(t) {
a.d(e, t, function(... |
'use strict';
const skeleton = require('./../skeletons/url');
module.exports = {
up: (queryInterface, Sequelize) => queryInterface.createTable(skeleton.name, skeleton.skeleton, skeleton.options),
down: (queryInterface, Sequelize) => queryInterface.dropTable('url')
}; |
const FORM_PRIMITIVE = 0;
function decode(buffer) {
let bytesRead = 0;
let tag = buffer.readUInt8(bytesRead);
bytesRead += 1;
const cls = tag >> 6;
const form = tag >> 5 & 1;
let tagCode = tag & 0b11111;
if (tagCode === 0b11111) {
tagCode = 0;
let byte;
do {
byte = buffer.readUInt8(... |
window.esdocSearchIndex = [
[
"parexgram-js/src/alternation.js~alternation",
"class/src/alternation.js~Alternation.html",
"<span>Alternation</span> <span class=\"search-result-import-path\">parexgram-js/src/alternation.js</span>",
"class"
],
[
"parexgram-js/src/charset.js~charset",
"class/... |
process.chdir(__dirname);
const fs = require("fs");
const { rollup } = require("rollup");
const { bundleSize } = require("../lib/rollup-plugin-bundle-size.cjs");
const consoleLogMock = jest.fn();
global.console = { ...global.console, log: consoleLogMock };
beforeEach(() => {
consoleLogMock.mockClear();
});
functi... |
const path = require("path");
module.exports = {
entry: ["./js/index.js"],
output: {
path: path.resolve(__dirname, "out"), //output directory
filename: "out.js", //output file (merge all JS-files will into one out.js file)
publicPath: "out"
},
module: {
rules: [
//scripts rule (*.js)
... |
const path = require('path')
module.exports = {
mode: 'none',
entry: './src/main.js',
output: {
filename: 'bundle.js',
path: path.join(__dirname, 'dist'),
publicPath: 'dist/'
},
module: {
rules: [
{
test: /.jpg$/,
use: {
loader: 'url-loader',
options:... |
// В HTML есть пустой список ul#ingredients.
// < ul id = "ingredients" ></ >
// В JS есть массив строк.
// const ingredients = [
// 'Картошка',
// 'Грибы',
// 'Чеснок',
// 'Помидоры',
// 'Зелень',
// 'Приправы',
// ];
// Напиши скрипт, который для каждого элемента массива ingredients
// с... |
const http = require("http");
const url = require("url");
const PORT = 8080;
let counter = 8999;
const routeHandlers = {
GET: {
"/": (req, res) => res.end("Hello, World!"),
"/goodbye": (req, res) => res.end("Goodbye, World!")
},
POST: {
"/counter": (req, res) => {
counter++;
res.end(cou... |
$(function () {
//*****************************************************
// グルーバル変数
//*****************************************************
var mode = "";
var checkNum = "";
var groupNo = "";
//20200323 ADD ?
//var SubmitMode = "";
//20200317 ADD 詳細・見積追加
var CheckNum = ""; //resu... |
/**
* CSS Relative colors
* The CSS Relative Color syntax allows a color to be defined relative to another color using the `from` keyword and optionally `calc()` for any of the color values.
* @see https://caniuse.com/css-relative-colors
*/
/**
* @type {import('../features').Feature}
*/
export default {
'': /(... |
(function () {
"use strict";
angular.module('public')
.controller('SignUpController', SignUpController);
SignUpController.$inject = ['MenuService', 'UserService'];
function SignUpController(MenuService, UserService) {
var $ctrl = this;
// invoke IFFE to fire up controller actions to save data from ... |
const body=document.querySelector('section');
const div=document.createElement('div');
const el = document.createElement('div');
el.classList.add('visualizzaDOT');
div.classList.add('container');
body.appendChild(el);
el.appendChild(div);
document.querySelector('body').classList.add('no-scroll');
const dot1=document.cr... |
import React from 'react'
import { Paper } from '@material-ui/core'
import { makeStyles } from '@material-ui/core/styles'
const useStyle = makeStyles((theme) => ({
card: {
padding: theme.spacing(1, 1, 1, 2),
margin: theme.spacing(1),
},
}))
export default function Card() {
const classes = useStyle()
return (
... |
var WIDTH = 1216;
var HEIGHT = 800;
var heroSpeed = 400;
var deadPartsKeys = [
'deadParts0',
'deadParts1',
'deadParts2',
'deadParts3',
'deadParts4',
'deadParts5',
'deadParts6',
'deadParts7'
];
|
import{ useState, useEffect,useRef } from "react";
const useLocalStorage = (
key,
standardDefault = '',
{ serialize = JSON.stringify, deserialize = JSON.parse } = {}
) => {
const [state, setState] = useState(() => {
const valueInLocalStorage = window.localStorage.getItem(key);
if (valueInLocalStora... |
function round(value, decimals) {
return Number(Math.round(value+'e'+decimals)+'e-'+decimals);
}
function toGrade(letter, isRetake) {
if (letter == "A") {
if (isRetake == "Y") {
return 3.7;
}
else {
return 4.0;
}
}
else if (letter == ... |
import React from 'react';
import axios from 'axios';
import Loading from './shared/Loading';
import Form from './shared/Form';
let todoUrl = 'https://api.vschool.io/marcus/todo/';
class TodoList extends React.Component {
constructor(props) {
super(props);
this.state = {
todos: [],
loading: tru... |
var proto = require('proto')
var ks = require("keysight")
var Gem = require('gem');
var Style = require("gem/Style")
var Text = require("gem/Text")
module.exports = proto(Gem, function(superclass) {
this.name = 'TextEditor'
this.defaultStyle = Style({
Text: {
minWidth: 100,
wo... |
var Schema = require('mongoose').Schema;
var userSchema = new Schema({
local:{
username: String,
pass: String,
}
});
|
require("dotenv").config();
var DEBUG = process.env.NODE_ENV === "development";
var express = require("express");
var app = express();
const db = require("./db");
const session = require("express-session");
const KnexSessionStore = require('connect-session-knex')(session);
const store = new KnexSessionStore({
kne... |
const getAll = (req, res, next) => {
const db = req.app.get("db");
db
.getAll(req.user.authid)
.then(response => {
res.status(200).json(response);
})
.catch(err => {
res.status(500);
});
};
const getCurrUser = (req, res, next) => {
const db = req.app.get("db");
if (req.user) {
... |
import React,{Component} from 'react';
import { Menu, Icon ,Modal,Form,Input, Button, Label } from 'semantic-ui-react';
import firebase from '../../firebase'
import {connect} from 'react-redux';
import {setChannel,setPrivateChannel}from '../../actions';
class Channels extends Component {
state={
chan... |
// TODO: Implement these methods: https://fiveminutes.jira.com/browse/SEEXT-2978
export default {
arePushNotificationsEnabled:
console.log.bind(null, 'Push notifications are available on Android unless the user' +
' explicitly disabled them'),
openSettings: console.log.bind(null, 'Open settings not... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.