text stringlengths 7 3.69M |
|---|
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(['module', 'exports', './polyfills', './constants', './utils', './logger', './events', './keymaps'], factory);
} else if (typeof exports !== "undefined") {
factory(module, exports, require('./polyfills'), requ... |
import React from 'react';
function RecipeMeta(props) {
return (
<div className="recipe-meta">
<h1>{props.title}</h1>
<div>
<p>Time: {props.time}</p>
<p>Servings: {props.servings}</p>
</div>
</div>
)
}
export default RecipeMet... |
console.log('ggg') |
import React from "react";
import "./App.css";
import { Route, Link, Switch } from "react-router-dom";
import Login from "./components/Login";
import PrivateRoute from "./utils/PrivateRoute";
import FriendPage from "./components/FriendPage";
function App() {
return (
<div className="App">
<nav>
<... |
import Template from "./template";
import paper from "paper";
import ComponentPort from "../core/componentPort";
export default class Chamber extends Template {
constructor() {
super();
}
__setupDefinitions() {
this.__unique = {
position: "Point"
};
this.__heri... |
/* jshint indent: 2 */
module.exports = function(sequelize, DataTypes) {
const Roles = sequelize.define('Roles', {
id: {
type: DataTypes.INTEGER(11),
allowNull: false,
primaryKey: true,
autoIncrement: true
},
name: {
type: DataTypes.STRING,
allowNull: false
}
}, {
classMethods: {
assoc... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class StatementCreate {
constructor(model) {
if (!model)
return;
this.userId = model.userId;
this.type = model.type;
this.month = model.month;
this.year = model.year;
this.openBal... |
const express=require("express")
const router=express.Router()
const controller=require("../controllers/contact")
router.post("/sendMail",controller.setMail)
module.exports=router; |
import firebase from 'firebase';
export function updateAPIkey(value) {
//create a firebase update object
let firebaseUpdates = {};
//update the
firebaseUpdates[`/users/${firebase.auth().currentUser.uid}/CV_API_KEY`] = value;
//send the update to firebase
firebase.database().ref().update(firebaseUpdates);... |
// pages/cartoon/index.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
inputShowed: false,
showHistory: false,
inputVal: "",
isFixedTop: false,
list: [],
nextPage: null,
lasttPage: null,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.pullu... |
(function () {
angular
.module('myApp')
.controller('JoinGroupController', JoinGroupController)
JoinGroupController.$inject = ['$state', '$scope', '$rootScope'];
function JoinGroupController($state, $scope, $rootScope) {
$rootScope.setData('showMenubar', true);
$rootScope.... |
function gerarTabuada() {
var inicio = document.getElementById("txtnumber");
var res = document.getElementById("selres");
if (inicio.value === "") {
alert("Impossível Gerar Tabuada, Por favor digite um número!!!");
} else {
var f = Number(inicio.value);
for (let c = 0; c <= 10; c++) {
var nu... |
import http from 'http'
import express from 'express'
import React from 'react'
import { renderToString } from 'react-dom/server'
import { match, RouterContext } from 'react-router'
import routes from './modules/Routes'
import apis from './api'
import path from 'path'
var app = express();
var PORT = process.env.PORT ... |
import React, { Component } from 'react';
import Pere from './Pere';
import { MyContext, ColorContext } from './MyContext'; // on importe nos contexts, dans lequel on met l'element parent le plus haut
class Arbre extends Component {
state = {
user: {
name: 'damien',
age: 29
... |
var express = require('express');
var request = require('request');
var bodyParser = require('body-parser');
var app = express();
const SLACK_EVENT = require('./util/slack-events');
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.set('port', (process.env.PORT || 5000));
var c... |
import {ADD_TASK,DELETE_TASK ,DID_TASK} from ('./taskTypes');
export const addTask =(task)=>({
type: ADD_TASK,
payload:task
})
export const deleteTask = (id)=>({
type:DELETE_TASK,
payload: id
})
export const didTask = (id)=>({
type: DID_TASK,
payload: id
})
|
import { useEffect, useState } from "react";
import userApi from "../../../api/userApi";
export default function PaymentHisory() {
const [state, setState] = useState();
//Hỏi anh Vương chỗ này
// useEffect(async () => {
// const res = await userApi.getProfilePayment();
// if (res) {
// console.log("... |
angular.module('gt-gamers-guild.layout-ctrl', [])
.controller('LayoutCtrl', function($scope) {
$scope.hello = 'hello';
});
|
export default "someothertext";
|
'use strict';
var assert = require("chai").assert
, exponential = require("../lib/everpolate.js").exponential
describe('Exponential interpolation function', function () {
it('Evaluates interpolating value at the number \'x\'', function(){
assert.deepEqual( exponential(2, [1, 3, 7], [1, 5, 10]), [2.2360679774... |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import ClothingPicker from './ClothingPicker';
class DesignPortal extends Component {
state = {
hati: 0,
topi: 0,
jacketi: 0,
bottomi: 0,
shoesi: 0
}
save = () => {
const outfit = [this.props.filteredhats[t... |
import React, { Component } from 'react';
import { auth, database } from '../firebase';
import CurrentUser from '../user/CurrentUser';
import SignIn from '../signIn/SignIn';
import TodoList from '../todoList/TodoList';
import AddTodo from '../addTodo/AddTodo';
import NavContainer from '../navigation/NavContainer';
i... |
let numberOne = 0.7;
let numberTwo = 0.1;
// numberOne = ((numberOne * 100) + (numberTwo * 100) / 100);
numberOne += numberTwo;
numberOne += numberTwo;
numberOne += numberTwo;
numberOne += numberTwo;
numberOne += numberTwo;
numberOne += numberTwo;
numberOne += numberTwo;
numberOne += numberTwo;
numberOne += numberTw... |
import actionTypes from './../actionTypes';
import ActionCreator from "./";
import store from "./../store";
export const GetUserInfo = (userid, token) => {
_GetUserInfo(userid, token);
return {
type: actionTypes.USER_GET_USER_INFO,
};
}
export const SaveUserInfo = (userInfo) => {
return {
... |
export { default as Card} from "./CardElement" |
import React, { useState } from 'react';
import './style.css';
import img from './img/resultsBg.svg';
import { Link } from 'react-router-dom';
export const Results = ({ name, counter, numberOfAnimals, onBackToGame }) => {
const [backToGame, setBackToGame] = useState(false);
return (
<>
<div className="s... |
/*
* App Ownership Authorization For Matching Routes
* Must be mounted after users authorize.
* Possible Route Usage: /apps/:appId/*
*/
const AppModel = rootRequire('/models/App');
module.exports = (request, response, next) => {
const userId = request.user.id;
const { appId } = request.params;
AppModel.fin... |
var namespacede_1_1telekom_1_1pde_1_1codelibrary_1_1ui_1_1modules =
[
[ "login", "namespacede_1_1telekom_1_1pde_1_1codelibrary_1_1ui_1_1modules_1_1login.html", "namespacede_1_1telekom_1_1pde_1_1codelibrary_1_1ui_1_1modules_1_1login" ]
]; |
import * as Promise from 'bluebird'
export const audioContext = new AudioContext();
export const manSamples = {
a: '/SWAR1505_TalkingJpnM/00.mp3',
b: '/SWAR1505_TalkingJpnM/01.mp3',
c: '/SWAR1505_TalkingJpnM/02.mp3',
d: '/SWAR1505_TalkingJpnM/03.mp3',
e: '/SWAR1505_TalkingJpnM/04.mp3',
f: '/SWAR1505_Talkin... |
import React, { useEffect } from "react";
import { Route, Switch } from 'react-router-dom';
import Accueil from '../../components/Accueil';
import Affretement from '../../components/Affretement';
import Carte from '../../components/Carte';
import Distribution from '../../components/Distribution';
import FormDevis fr... |
/**
* Created by xiaojiu on 2017/2/9.
*/
define(['../../../app'], function(app) {
app.factory('collectDifferenceConfirm', ['$http', '$q', '$filter', 'HOST', function($http, $q, $filter, HOST) {
return {
getThead: function() {
return [{
field: 'pl4GridCount',... |
function customLine(x1,x2,y1,y2) {
this.x1=x1;
this.x2=x2;
this.y1=y1;
this.y2=y2;
}
var changeTicks = 0;
var changed = false;
var canvasWidth = 500;
var canvasHeight = 500;
var imgX = 0;
var imgY = 0;
var imgScale = 1.0;
var invScale = 1.0;
var UI = new Array();
var cnv;
var mode = 'move';
var bg... |
var target,
smallScreen = window.matchMedia("(max-width: 992px)").matches;
MarkerTarget.prototype = new google.maps.OverlayView();
function initMap() {
var map,
center = smallScreen ? {lat: 35.88, lng: 14.44} : {lat: 38, lng: 22},
zoom = 6,
srcTarget = '/images/maplogo.png',
boundsTarget = new google... |
module.exports = (sequelize, type) => {
return sequelize.define('aerista', {
id: {
type: type.INTEGER,
primaryKey: true,
autoIncrement: true
},
nombre1: {
allowNull: false,
type: type.STRING(50)
},
nombre2: {
a... |
Component({
data: {
//输入框聚焦状态
isFocus: true,
//输入框聚焦样式 是否自动获取焦点
focusType: true,
valueData: '', //输入的值
dataLength: '',
boxList: [1, 2, 3, 4]
},
// 组件属性
properties: {
},
// 组件方法
methods: {
// 获得焦点时
handleUseFocus() {
this.setData({
focusType: true
})
... |
export default {
title: 'Inside UK\'s Technocracy And Mafia Behind It1',
seo: 'Democracy and capitalism are incompatible: money always talks. learn how the Conservative neo-elite are robbing population with Industrial Strategy.',
topics: ['UK', 'politics'],
og: {
image: './life-sucks/img/technocracy.jpg',
... |
function cargarOrdenes(){
var id = document.getElementById('doctor').value;
axios.post('/getOrdenes/'+id)
.then((resp)=>{
var tabla = document.getElementById('tablaordenes');
var cont = tabla.rows.length;
for (i = 0; i < (cont); i++) {
document.getElementById("borrar").remove();
... |
import reducer from "./modal";
import { modal } from "../actionTypes";
describe("modal reducer", () => {
it("should return the initial state", () => {
expect(reducer(undefined, {})).toEqual({
show: false,
title: "",
type: "primary",
onConfirm: null,
onCancel: null
});
});
it... |
import request from '@/utils/request'
// 查询系统镜像列表
export function listImage(query) {
return request({
url: '/docker/image/list',
method: 'get',
params: query
})
}
// 查询系统镜像详细
export function getImage(id) {
return request({
url: '/docker/image/' + id,
method: 'get'
})
}
// 新增系统镜像
export fu... |
var ul = document.getElementsByTagName('ul')[0];
var liLiveCollection = ul.getElementsByTagName('li');
var liStaticCollection = ul.querySelectorAll('li');
console.log(liLiveCollection);
console.log(liStaticCollection);
ul.removeChild(ul.firstElementChild);
console.log(liLiveCollection);
console.log(liStaticCollecti... |
import React from 'react'
import { Link } from 'react-router-dom'
import Logo from '../assets/images/logo.png'
/**
* Función para mostrar el footer del sitio
* @returns Footer
*/
const Footer = () => {
return (
<footer>
<div className="container">
<div className="footer-cont... |
var1=61;
var2=60;
var3=var1+var2;
var4=var1-var2;
var5=var1/var2;
var6=var1*var2;
console.log("the addtion of two numbers is :",var3);
console.log("the subctraction of two numbers :",var4);
console.log("the division of two numbers is :",var5);
console.log("the mulctipication of two numbers",var6); |
import React, { useContext, useEffect, useState } from 'react';
import { Link, useHistory } from 'react-router-dom';
import copy from 'clipboard-copy';
import RecipeContext from '../hooks/RecipeContext';
import recipeRequest from '../services/recipeRequest';
import whiteHeartIcon from '../images/whiteHeartIcon.svg';
im... |
import React from 'react';
import SingleProject from './SingleProject';
import GridList from '@material-ui/core/GridList';
import GridListTile from '@material-ui/core/GridListTile';
import GridListTileBar from '@material-ui/core/GridListTileBar';
import ListSubheader from '@material-ui/core/ListSubheader';
import Modal... |
/**
*description:商品选择弹框
*author:fanwei
*date:2014/06/26
*/
define(function(require, exports, module){
var Fenye = require('../../widget/dom/fenye');
var Related = require('../../widget/dom/related');
var bodyParse = require('../../widget/http/bodyParse');
function GoodsSelect(opts) {
opts = op... |
const crawlDomain = require('./src/crawler.js');
const util = require('util');
// Stop after visting MAX_PAGES
let MAX_PAGES = 50;
// The domain name should be passed in as a single argument e.g. 'www.google.com'
let domain = process.argv[2];
// Optional max pages
let new_max = process.argv[3];
if (!isNaN(parseInt... |
import { connect } from 'react-redux';
import EditDialog from './EditDialog';
import {postOption, fetchJson, showError, validValue} from '../../../common/common';
import {Action} from '../../../action-reducer/action';
import {getPathValue} from '../../../action-reducer/helper';
import {updateTable} from './OrderPageCon... |
/**
* 화면 초기화 - 화면 로드시 자동 호출 됨
*/
function _Initialize() {
// 단위화면에서 사용될 일반 전역 변수 정의
// $NC.setGlobalVar({ });
// 단위화면에서 사용될 일반 전역 변수 정의
$NC.setGlobalVar({
ROWCHAK: "",
LAST_YN: ""
});
// 탭 초기화
$NC.setInitTab("#divMasterView", {
tabIndex: 0,
onActivate: tabOnActivate
... |
import React, { useState, useEffect, useContext } from 'react';
import { useHistory } from 'react-router-dom';
import { useMutation } from '@apollo/client';
import { TextField, Button, Typography } from '@material-ui/core';
import { NotificationContext } from '../context';
import { LOGIN } from '../queries';
const Log... |
class Repository {
constructor(modelInstance) {
this.modelInstance = modelInstance;
}
findRecord(where = {}, attributes, include, options = {}) {
let params = { where };
if (attributes) {
params.attributes = attributes;
}
if (include) {
params.include = include;
}
if (opti... |
import request from '@/utils/request'
const chart = {
// 获取sysIframeGet
sysIframeGet(data) {
return request({ url: '/sysIframeGet', method: 'post', data })
},
// 获取getShouLiJieCun
getShouLiJieCun(data) {
return request({ url: '/chart/getShouLiJieCun3', method: 'post', data })
},
// 获取受... |
import Ember from 'ember';
const { Component, computed } = Ember;
export default Component.extend({
valueChosen: computed('property', function() {
return this.get('property') !== undefined;
}),
valid: computed('valueChosen', 'property', function() {
return this.get('valueChosen') && (this.get('property... |
import React, { Component } from "react";
import PropTypes from "prop-types";
import ModelRating from "./presenter";
import { WEBSITE_PATH } from "../../config/constants"
class Container extends Component {
static propTypes = {
pathname: PropTypes.string.isRequired,
model_filter: PropTypes.shape({ ... |
import React from 'react'
import { Link, BrowserRouter as Router } from 'react-router-dom'
import BranchTile from '../../src/components/BranchTile'
describe('BranchTile', () => {
let wrapper
let branch = {
id: 1,
name: 'test branch',
repository_id: 1,
user_id: 1,
branch_goal: 'branch ... |
import axios from '../../axios'
/*
* 保险模块
*/
// 请求保险报价
export const saveMemberQueryInsurance = data => {
return axios({
url: '/insurance/saveMemberQueryInsurance',
method: 'post',
data
})
}
// 所有保险公司
export const getCompanys = () => {
return axios({
url: '/insurance/getC... |
//Company Name
let company = "GOOG";
let i = 0;
let totalLength;
let dateText;
//Intialize let
let initialPriceListLow, initialPriceListHigh, initialDate;
let priceListLow, priceListHigh;
let date;
let maxValue;
let minValue;
let valueMain;
let timeValue;
let initialColor =[130, 200, 200];
let finalColor = [200,... |
import React from "react";
import { useSelector } from "react-redux";
import { setLang } from "../../../dispatches/setLang";
const langs = [
{
key:"en",
name:"English",
flag:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHcAAAA+CAMAAAAmsHQcAAAAqFBMVEX///+/CzAAJ2jowcO7ABe+ACy8ABv//v6/DjPmur6... |
linearSearch = (arr, value) => {
for (let i in arr) {
if (arr[i] === value) return i;
}
return -1;
};
console.log(linearSearch([1, 2, 3, 4, 5, 6, 7, 8], 3));
//Big O of Linear Search is O(n) as n(Items in array) grows so does the time it takes to perform the function
|
import { Component } from '@angular/core';
var FlightHistoryComponent = (function () {
function FlightHistoryComponent() {
}
return FlightHistoryComponent;
}());
export { FlightHistoryComponent };
FlightHistoryComponent.decorators = [
{ type: Component, args: [{
template: "\n<div class=\... |
import React from 'react'
import { Card } from '../../Card/Card'
import { KillerDetails } from './KillerDetails'
import { getEpisodeBySeasonAndEpisode } from '../../../services/seasons/seasonServices'
import { Title } from '../../Titles/Title/Title'
import { ThemeContext } from '../../../contexts/theme-context'
export... |
import React, { useState, useEffect } from 'react'
import { Link, withRouter } from 'react-router-dom'
import { Button, Card, Input, Form, Icon, message } from 'antd'
import './style.css'
import { authServices } from '../../services/'
const Login = (props) => {
const [ loading, setLoading ] = useState(false)
const ... |
import WeatherByHour from "./weatherbyhour";
function WeatherDataPerDay({
weatherPerDay,
setClassVar,
setHourbyWeather,
classVar,
}) {
return (
<div className="weather-temperature">
{weatherPerDay.map((weather) => {
const classActive = classVar === weather.dt_txt ? "is-active" : "";
... |
function register(env) {
env.addGlobal("blog_post_archive_url", handler);
}
function handler(selected_blog, year, month, day) {
return `http://blog.hubspot.com/marketing/archive/${year}/${ month }/${ day }`;
}
export {
handler,
register as default
};
|
/**
* @file This module contains all the unit tests of the application. Unit tests are
* implemented with the NodeUnit unit test library.
*/
var nodeUnit = require('nodeunit');
/**
* Test the home page with a unit test. TODO: Currently this is only provided
* for demonstration purposes.
*
* @param {object} tes... |
import { createContext,useState } from "react";
const WeatherContext=createContext();
export const LocationProvider=(props)=>{
const [location,setLocation]=useState("Istanbul");
const values={
location:location,
setLocation:setLocation
}
return <WeatherContext.Provider value={values}>{... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';
import Card from '@material-ui/core/Card';
import CardHeader from '@material-ui/core/CardHeader';
import CardContent from '@material-ui/core/... |
//Creats a low-fidelity loading spinner. Refactored spinner1.js.
const sentence = "|/-\\|/-\\|";
let delay = 100;
for (const char of sentence) {
setTimeout(() => {
process.stdout.write(`\r${char} `);
}, 0 + delay);
delay += 200;
}
setTimeout(() => {
process.stdout.write('\n');
}, delay + 50);
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FindCourseClassByModule = exports.FindCourseClass = void 0;
class FindCourseClass {
constructor(classRepo) {
this.classRepo = classRepo;
}
async execute(id) {
var courseClass = null;
var courseClasse... |
const jwt = require('jsonwebtoken')
const myFunction = async () => {
// Needs to store a unique code for the user to be authenticated, the user id is nice
// The second (string) is another unique value that makes sure it was not changed. A random
// series of characters are enough
// Third, object to customize ... |
export {requestService} from './RequestService';
|
import React from 'react';
import {Slide, Heading, Text} from 'spectacle';
export default (
<Slide transition={["zoom"]} bgColor="primary">
<Heading size={5} caps lineHeight={1} textColor="secondary">
Разработка веб-сервисов на Go
</Heading>
<Text margin="10px 0 0" textColor="tertiary" size={1} bol... |
import "./phaser.js";
// You can copy-and-paste the code from any of the examples at https://examples.phaser.io here.
// You will need to change the `parent` parameter passed to `new Phaser.Game()` from
// `phaser-example` to `game`, which is the id of the HTML element where we
// want the game to go.
// The assets (a... |
var sql = require('./BaseModel');
// const Config = require('../globals/Config');
var timeController = require('../controllers/TimeController');
// const _config = new Config();
var Task = function (task) {
this.task = task.task;
this.status = task.status;
this.created_at = new Date();
};
Task.getStockB... |
import React, { Component, createContext, Fragment } from 'react';
import styled from 'styled-components';
import InfiniteScroll from 'react-infinite-scroller';
import ReactLoading from 'react-loading';
import axios from 'axios';
import uuid from 'uuid/v4';
import posed, { PoseGroup } from 'react-pose';
import Game fro... |
export const ADD_WATCHED_MOVIE = "ADD_WATCHED_MOVIE";
|
var express = require('express');
var path = require('path');
var app = express();
var connections = (process.env.NODE_ENV === 'production')
? require('./config/config.live') : require('./config/config.dev');
var url = connections.hostname + ':' + connections.port;
app.use(express.static(path.join(__dirname, './di... |
require('dotenv').config();
const got = require('got');
const {
CHALLONGE_USERNAME,
CHALLONGE_API_KEY,
CHALLONGE_TOURNAMENT_ID,
DB_HOST,
DB_PORT,
DB_DATABASE,
DB_USER,
DB_PASSWORD
} = process.env;
const { Pool } = require('pg');
const pool = new Pool({
user: DB_USER,
host: DB_HOST,
database: DB_... |
// 所谓Promise, 就是一个对象,用来传递异步操作的消息
// 异步加载图片
function loadImageAsync(url) {
return new Promise(function(resolve, reject) {
var image = new Image();
image.onload = function() {
resolve(image);
}
image.onerror = function() {
reject(new Error('Could not load imag... |
import API from '../backend'
export const addTodo = (todo) => {
return fetch(`${API}/add`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
todo: todo
})
}).then(res ... |
// @flow
import React from "react";
import { connect } from "react-redux";
import { Navigation } from "./Navigation/Navigation.js";
import { toggleLibraryFactors } from "lk/redux/actions.js";
function LibraryFactors( props )
{
const ListForm = props.listLibraryForm;
return(
<section className="b-section activ... |
import React from 'react';
import Container from '../components/container'
const About = () => {
return (
<Container>
<h1>About</h1>
<p>Laborum aliquip cillum veniam labore ipsum magna qui anim. Et nisi eu culpa sit cupidatat magna excepteur commodo. Reprehenderit enim id elit est l... |
const mysql = require("mysql");
const express = require("express");
const bodyParser = require("body-parser");
const cors = require("cors");
const app = express();
const port = process.env.PORT || 1100;
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(cors());
// CONEXION A MI B... |
import React, {useState} from "react";
import PropTypes from "prop-types";
import useInput from "../../Hooks/useInput";
import PostPresenter from "./PostPresenter";
const PostContainer = ({
id,
user,
files,
likeCount,
isLiked,
comments,
createdAt,
caption,
location
}) => {
const [isLikedS, setIsLik... |
'use strict';
describe('Controller: SpeedtestsCtrl', function () {
beforeEach(module('myApp'));
var SpeedtestsCtrl,
scope,
$location,
$httpBackend,
deferred,
q,
routeParams = {},
sFactory;
afterEach(function() {
$httpBackend.verifyNoOutstandingExpectation();
$ht... |
function textEditor(){
this.variableDeclaration = false;
this.forLoop = false;
this.whileLoop = false;
this.ifStatement = false;
this.forLoopWithIfStatment = false;
}
textEditor.prototype.checkForIfStatementInForLoop = function(node){
var nodeBody = node["body"]["body"];
for(var j = 0; j < nodeBody.le... |
import React from 'react'
import Questions from './questions'
import './styles.css'
export default class extends React.Component {
constructor(props) {
super(props)
this.state = {
survey: props.survey
}
}
render() {
const { questions } = this.state.survey
... |
import React, {useState, useCallback, useEffect} from "react";
import $ from 'jquery';
import List from './components/AttackPatterns'
const SERVER_IP = 'http://127.0.0.1:3001/';
const App = () => {
// defining current view (list or grid)
const [currentView, setCurrentView] = useState("list");
// handling cha... |
/**
* Created by lilit on 2018-06-05.
*/
//then import users and tweets at shared.js
export const RECEIVE_USERS = 'RECEIVE_USERS';
export function receiveUsers (users) {
return {
type: RECEIVE_USERS,
users
}
} |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { Grid, Header, Segment, Button, Icon, Dimmer, Loader, Message, Label, Card } from 'semantic-ui-react';
import DatePicker from 'react-datepicker';
import moment from 'moment';
import { get... |
//Action creators are functions that return an action,
//an action is just an object that flows through all the different
//reducers, reducers can then use that action to produce a different value
//for a particular piece of state
export function selectBook(book) {
//selectBook is an ActionCreator, it needs to ret... |
module.exports = {
'secret': 'jwtsecretxxxxx'
}; |
import someModule from './some-module';
const answer = () => 42;
console.log(answer());
console.log(someModule.some);
|
/*#################################################### Klasse Arrow ###################################################*/
function Arrow(bc,type){
//********************** Attribute **************************
//************************************************************
this.bc;
this.hLine;
this.sta... |
(function () {
'use strict';
angular
.module('sketchbook')
.factory('GhostService', fnGhostService);
/** @ngInject */
function fnGhostService() {
fnGhostService.fnGetColor = function (attrObj, value) {
var returnValue = attrObj.defaultColor ? attrObj.defaultColor : ... |
import { ADD_FORM, UPDATE_FORM, REMOVE_FORM } from '../actions';
const initialState = {
key : 0,
forms : []
}
function remove(array, element) {
return array.filter(e => e.key !== element);
}
export default (state = {...initialState}, action) => {
switch (action.type) {
case ADD_FORM: {
state.forms.... |
var win = 0
var loss = 0
var guess = 0
var guessLeft = 9
var letterArray = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
var rand = letterArray[Math.floor(Math.random() * letterArray.length)];
console.log(rand);
var userGuess = prompt("pick a letter:")
for... |
import React, { Component } from "react";
import { connect } from "react-redux";
import { Row, Col } from "reactstrap";
import Usage from "./Usage";
import Register from "./Register";
import MessageRegister from "./MessageRegister";
import { Link } from "react-router-dom";
import setting from "../img/setting.png";
impo... |
import React, {Component} from 'react';
import AddAsset from './AddAsset'
import muiTheme from './muitheme'
const styles = {
rootContainerStyle: {
display: "flex",
flexDirection: "column",
position: "absolute",
height: "100%",
width: "100%",
justifyContent: "flex-start"
},
formContainer: {
display: "... |
// function hi(userName){
// console.log("Hi, ${userName}.");
// }
// hi('Thomas')
/*
- Write a function that takes two parameters:
- one parameter is for a first name,
- the other parameter is for a last name;
- have them come together in a variable inside the function.
- consol... |
Package.describe({
name: 'universe:react-chartjs',
version: '1.0.2',
// Brief, one-line summary of the package.
summary: '',
// URL to the Git repository containing the source code for this package.
git: '',
// By default, Meteor will default to using README.md for documentation.
// To avoid submitting ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.