text stringlengths 7 3.69M |
|---|
app.controller('terminalController', function($scope, $timeout, $interval, contentService) {
// $scope.demoCommandsComplete = false;
// $scope.terminalCommandList = contentService.getTerminalContent();
// $scope.terminalCommandIndex = 0;
// runTerminalCommands(3500);
// $scope.nextCommand = functio... |
window.addEventListener('load', () => {
const canvas = new fabric.Canvas('canvas');
canvas.isDrawingMode= true
let width = 500, height = 500
canvas.setHeight(height);
canvas.setWidth(width);
canvas.backgroundColor="black";
let pencil = new fabric.PencilBrush(canvas)
pencil.width = 80
pencil.color = ... |
let products = [
{
id: '001',
name: 'iPad Pro',
price: 30900,
storage: 32,
type: 'iPad',
size: '12.9'
},
{
id: '002',
name: 'iPad Pro',
price: 34900,
storage: 128,
type: 'iPad',
size: '12.9'
},
{
id: '003',
name: 'iPad Pro',
price... |
import React from 'react'
import { Image, StyleSheet, Text, TouchableHighlightBase, View } from 'react-native'
const AppSms = ({Source, Name, ShortSms}) => {
return (
<TouchableHighlightBase style={styles.AppSms} >
<Image style={styles.Profile} source={Source} />
<View>
... |
//Validar los campos numericos si son requeridos
const isNumero = (value, { req }) => {
if (req.body.generaFacturaElectronica) {
if (!Number(value)) {
return false
}
return true;
} else {
if (value != '') {
if (!Number(value)) {
return fals... |
angular.module('app')
.controller('ConfirmationController', function ($scope, $rootScope) {
$rootScope.isAdmin = false;
}) |
import * as BsIcons from "react-icons/bs";
import * as AiIcons from "react-icons/ai";
import * as ImIcons from "react-icons/im";
import * as RiIcons from "react-icons/ri";
import * as VscIcons from "react-icons/vsc";
import * as TiIcons from "react-icons/ti";
import {Link} from "react-router-dom";
import {useRef, useS... |
/*
*
* WorkList constants
*
*/
export const ADD_WORK_REQUEST = 'app/WorkList/ADD_WORK_REQUEST';
export const REMOVE_WORK_REQUEST = 'app/WorkList/REMOVE_WORK_REQUEST';
export const GET_WORKS_LIST_REQUEST = 'app/WorkList/GET_WORKS_LIST_REQUEST';
export const GET_WORKS_LIST_SUCCESS = 'app/WorkList/GET_WORKS_LIST_SU... |
// Copyright (c) 2016-2018, BuckyCloud, Inc. and other BDT contributors.
// The BDT project is supported by the GeekChain Foundation.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// ... |
/**
* Set $ to jQuery
*/
jQuery(document).ready(function ($) {
});
/**
* Owl Slider 2.X
*/
var owl = $(".feature-slider");
owl.owlCarousel({
items: 2,
nav: true,
center: true,
loop: true,
margin: 30
});
/**
* Get url Query in JS
*/
function urlQuery (data) {
var qd = {};
// Put url Que... |
import React,{useState,useEffect} from 'react'
import axios from 'axios'
const Planets= ({id}) =>{
const [SW,setSW]=useState({
name:"",
climate:"",
terrain:"",
surface_water:"",
population:0
})
useEffect(()=>{
axios.get("https://swapi.dev/api/planets/"+id)
... |
//
// Represents a label component
import View from './View'
export default class Label extends View {
/** The High Fidelity overlay type */
get type() { return "text" }
/** Text shown in the label */
get text() { return this.getProperty("text") || "" }
set text(v) { this.setProperty... |
const express = require('express');
const Course = require('../model/Course');
const {arrayMongooseObject} = require('../../util/mongoose');
const {mongooseObject} = require('../../util/mongoose');
const Role = require('../model/Role');
const UserCourse = require('../model/UserCourse');
const { requiresAuth } =... |
const mongoose = require('mongoose');
const accountSchema = mongoose.Schema(
{
user_id: {
type: mongoose.Types.ObjectId,
ref: 'User',
required: true
},
bank_id: {
type: mongoose.Types.ObjectId,
ref: 'Bank',
required: true
},
balance: {
type: Number,
... |
const rulesFiles = [
'./rules/bestPractices',
'./rules/errors',
'./rules/es6',
'./rules/imports',
'./rules/node',
'./rules/strict',
'./rules/style',
'./rules/variables'
]
module.exports = {
extends: rulesFiles.map(require.resolve),
parserOptions: {
ecmaVersion: 9
}
}
|
import React, { useEffect, useState } from 'react';
import {bubbleSort, selectSort, throttle, debounce, } from '../../common/utils'
function FunText(){
const [viewWith, setViewWith] = useState(window.innerWidth)
// useEffect(() => {
// document.addEventListener('keydown',throttle(()=> {console.log("节... |
/**
* @jest-environment jsdom
*/
import React from "react";
import { shallow } from "enzyme";
import Login from "./Login";
import { StyleSheetTestUtils } from 'aphrodite';
StyleSheetTestUtils.suppressStyleInjection();
describe("<Login />", () => {
it("Login renders without any errors", () => {
const wrap... |
import React, { useContext } from 'react';
import { ShowContext } from '../contexts/ShowContext';
const Navbar = () => {
const { shows } = useContext(ShowContext);
return (
<nav>
<h1>To Watch</h1>
<p>{shows.length} more shows to go</p>
</nav>
);
};
export default Navbar;
|
var CronJob = require('cron').CronJob;
var Media = require("../models/media");
var UserRecord = require("../models/userRecord");
var MediaRecord = require("../models/mediaRecord");
var Comment = require("../models/comment");
var cronInterval = "0 */5 * * * *"; // should be run every ten minutes "0 */10 * * * *"
var d... |
import React, { Component } from "react";
import PropTypes from "prop-types";
import { withStyles } 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 TablePagination from "@materi... |
// carré du nombre
// let nb = prompt("Entrer un nombre");
// let carre = nb*nb;
// console.log(carre);
//
// // demande le prénom, répond par Bonjour prenom
//
// let prenom = prompt("Entrer un prénom");
// console.log(`Bonjour ${prenom}`)
//
// lit le prix d'un article hors taxe,
// nb d'articles, taux de TVA,
// et... |
import React from 'react';
import CountDownTimer from '../deadLineTime';
const MainList = (props) => {
return (
<>
{props.state.map((miss, i) => {
return <div key={Math.random()} className="flex flex-row items-center px-1 py-3 border-b-2
border-blue-400 ... |
const input = 325489;
const getNextXY = (x, y, direction) => {
switch (direction) {
case 'right':
return { newX: x + 1, newY: y };
case 'left':
return { newX: x - 1, newY: y };
case 'up':
return { newX: x, newY: y + 1 };
case 'down':
return { newX: x, newY: y - 1 };
}
};
co... |
import { FaBell } from "react-icons/fa";
export default {
name: "event",
type: "object",
title: "Event",
fields: [
{
name: "type",
type: "string",
title: "Type"
},
{
name: "elapsed",
type: "number",
title: "Elapsed"
},
{
name: "player",
type: "... |
var roleMineralTransporter = {
/** @param {Creep} creep **/
run: function(creep, village) {
if (BASE_CREEP.run(creep, village) == -1){
return;
}
// move to mySource, find the nearest container. // TODO resources on the ground
// pick up, then move to nearest FROM li... |
'use strict'
/**
* directives:
* combox
* tmsEditable
* tmsArrayCheckbox
* tmsDatepicker
* tmsAutoUpdate
* dndlist
*/
angular
.module('ui.tms', ['ng', 'ngSanitize'])
.controller('ComboxController', [
'$scope',
function ($scope) {
$scope.aChecked = []
if ($scope.evtPrefix === undefined) $... |
import React from 'react';
import 'font-awesome/css/font-awesome.min.css';
import { Link } from 'react-router-dom';
const OrdersForm = () => (
<form className="form-inline">
<div className="form-group">
<div className="input-group">
<div className="input-group-addon">
<i className="fa fa-... |
//Parse the information from the html survey page into a JSON so that the apiRoute can transmitt this information to the service
var question1 = {
options: ["Mexico","United States","Colombia","Spain"],
question:"Where do you like to vacation?"
}
var question2 = {
options: ["Be happy","Endure Pain","Follo... |
'use strict';
module.exports = (sequelize, DataTypes) => {
const Item = sequelize.define('Item', {
itemName: DataTypes.STRING,
itemDesc: DataTypes.TEXT,
price: DataTypes.INTEGER
}, {});
Item.associate = function(models) {
Item.belongsToMany(models.Transaction, { through: models.TransactionItem })
... |
const express = require('express');
const mdAut = require('../middlewares/autenticacion');
const app = express();
const ctrl = require('../controller/Oficios/oficioCtrl');
const ctrlTurno = require('../controller/Oficios/turnosCtrl');
const ctrlRespuesta = require('../controller/Oficios/respuestaCtrl');
app.post('/',... |
export const getContacts = state => state.phonebook.contacts;
export const getIsLoading = state => state.phonebook.isLoading;
export const getError = state => state.phonebook.error;
export const getVisibleContacts = state => {
const contacts = getContacts(state);
const filter = state.phonebook.filter;
return con... |
const fs = require('fs');
const { execSync } = require('child_process');
const globalContents = fs
.readFileSync(__dirname + '/../src/fe/implicit/global.js')
.toString();
const globalInjects = globalContents
.match(/export const ([^ =]+)/g)
.map(a => a.slice(13));
let injects = {
// this is rollup option, n... |
import React from 'react'
export const Footer = () => {
let year = new Date().getFullYear();
let Footercss =
{
position :"relative",
top: "20vh",
// bottom : "0px",
width: "100%"
}
return (
<footer className="bg-dark text-light py-1 " style={Footercss}>
... |
angular.module('crm').filter('characters', function () {
return function (input, chars, breakOnWord) {
if (isNaN(chars)) return input;
if (chars <= 0) return '';
if (input && input.length > chars) {
input = input.substring(0, chars);
if (!breakOnWord) {
var lastspace = i... |
import { test, moduleForComponent } from 'ember-qunit';
import startApp from '../../helpers/start-app';
import Ember from 'ember';
import Token from 'ember-simple-auth-token/authorizers/token';
import Session from 'ember-simple-auth/internal-session';
import EphemeralStore from 'ember-simple-auth/session-stores/ephemer... |
//loads environmental variables into process.env global variable injected by node at runtime
require('dotenv').config();
require("./config/connection");
var cors = require('cors')
const express = require("express");
const app = express();
app.use(cors())
const path = require("path");
const env = process.env.NODE_ENV... |
const canvas = document.querySelector("canvas");
const context = canvas.getContext("2d");
// line
context.beginPath(); // Start a new line, new path, new shape/drawing/object. "We want to draw something new."
context.moveTo(20, 20); // Starting coordinates (x, y) "Place pen here."
context.lineTo(300, 40); // Ending c... |
import { Truck } from "./connectors";
const resolvers = {
Query: {
truck(_, args) {
return Truck.find({ where: args });
},
allTrucks() {
return Truck.findAll();
}
}
}
export default resolvers; |
const swc = require("../pkg");
it("should be loadable", function () {
const output = swc.transformSync("class Foo {}", {});
});
|
../../bower_components/gsap/src/minified/TimelineMax.min.js |
import React from 'react'
import Loadable from 'react-loadable'
import { Spin, Icon } from 'antd'
function Loading() {
return <Spin size="large" indicator={<Icon type="loading" />} />
}
const LazyLoad = (loader) => {
return Loadable({
loader,
loading: Loading,
delay: 300,
})
}
export default LazyLo... |
import React from "react";
import Typography from "@material-ui/core/Typography";
const TermsDataShow = ({ data, number }) => {
return (
<div style={{ margin: "10px 0" }}>
<Typography
variant="h6"
color="initial"
style={{ fontSize: "18px", fontWeight: "bold" }}
>
{numb... |
/**
* Created by Administrator on 2016/8/9.
*/
var $recommend_class = $('.recommend_class');
var $lf_list = $('.leifeng_list');
var $oul = $lf_list.children('ul');
var $yc = $recommend_class.children('.leifeng_yc');
$('.nowDay').addClass('Day_on').on('click',function () {
$oul.eq(0).show().siblings().hide();
... |
// @flow
import * as React from 'react';
import renderer from 'react-test-renderer';
import { Provider } from '../HotelDetailScreenContext';
const Child = () => null;
const getWrapper = (guestCount = 4) =>
renderer
.create(
<Provider guestCount={guestCount}>
<Child />
</Provider>,
)
... |
console.log('Задание 4. Обьем цилиндра.');
var heigth = 10,
diameter = a7,
a7 = 100 / 25;
p = 3.14,
radius = diameter / 2;
var VCilindra = p * (radius * radius) * heigth + ' ' + 'куб.м.';
console.log('Ответ: ' + VCilindra);
console.log(''); |
import React from 'react'
function HeaderTitle(props){
return(
<div>
<h1 className="display4">{props.title}</h1>
<div className="lead">{props.tagline}</div>
</div>
)
}
export default HeaderTitle |
(function () {
'use strict';
angular
.module('app.stockArticlelot')
.controller('StockArticlelotController', StockArticlelotController);
StockArticlelotController.$inject = ['logger',
'$stateParams',
'$location',
'StockArticlelot',
'TableSettings'... |
const commonFunction = require("../functions/commonFunctions")
const privacyModel = require("../models/privacy")
const userModel = require("../models/users")
const likeModel = require("../models/likes")
const favouriteModel = require("../models/favourites")
const videoModel = require("../models/videos")
const channelMo... |
var analyzeTerrain = function(island){
"use strict";
var MAX_MODIF = 100;
var COPPER_MODIF = 10;
var SILVER_MODIF = 10;
var COAL_MODIF = 10;
var ZINC_MODIF = 10;
var NICKEL_MODIF = 10;
var IRON_MODIF = 15;
var ALUMINIUM_MODIF = 15;
var LEAD_MODIF = 15;
var GOLD_MODIF = 60;
var GEMS_MODIF = 70;... |
import { combineReducers } from 'redux';
import user from 'reducers/user_reducer';
import products from 'reducers/products_reducer';
import site from 'reducers/site_reducer';
const rootReducer = combineReducers({
user,
products,
site
});
export default rootReducer;
|
import { LOAD_ONE_USER, LOAD_ONE_USER_FAILED, LOAD_ONE_USER_SUCCESS, LOAD_USERS, LOAD_USERS_FAILED, LOAD_USERS_SUCCESS } from "../types/types";
export const loadAllUsers = () => {
return ({
type: LOAD_USERS
});
};
export const getAllUsersSuccess = (users) => {
return({
type: LOAD_USERS_SUC... |
import Api from "../api";
export const ACTION_GET_DATA = "ACTION_GET_DATA";
export function getData() {
return {
type: ACTION_GET_DATA,
};
}
export const ACTION_SET_DATA = "ACTION_SET_DATA";
export function setData(data) {
return {
type: ACTION_SET_DATA,
payload: data,
};
}
export const ACTION_DE... |
'use strict';
angular.module('pharmassistApp')
.controller('UserprofileCtrl', function ($scope, djangoAuth, Validate, apiService, $state, toastr) {
$scope.model = {'first_name':'','last_name':'','email':''};
$scope.complete = false;
var url = 'http://localhost:8000/rest-auth/user/'
apiService.get(url)... |
const axios = require('axios');
const { latitude, longitude } = require('../epicenterCoords.json');
const baseUrl = 'https://api.yelp.com/v3/businesses/search?';
const apiKey = process.env.YELP_APIKEY;
const options = { headers: { Authorization: `Bearer ${apiKey}` } };
const setupUrl = (category) => {
const query =... |
import Todo_16 from './components/Todo_16';
import React from 'react';
import './App.css';
function App_16(){
return(
<div>
<h1>My Todo</h1>
<Todo_16 text='Learn React' />
<Todo_16 text='Say HI' />
<Todo_16 text='Say Bye' />
</div>
)
}
export default App_16; |
import React, { Component } from 'react';
import BookModel from '../models/BookModel'
class NewBook extends Component {
state ={
categoryId: this.props.match.params.id ,
name: '' ,
author: '',
cover: '',
note: '',
}
handleSubmit = (event) => {
event.preventDefault();
BookModel.create(... |
import { RECORD_ON, RECORD_OFF } from "../actions/types";
const INTIAL_STATE = {
record: false,
};
export default (state = INTIAL_STATE, action) => {
switch (action.type) {
case RECORD_ON:
return { ...state, record: true };
case RECORD_OFF:
return { ...state, record: false };
default:
... |
var _api = require("../api.js");
var _api2 = _interopRequireDefault(_api);
var _api3 = require("../../../utils/api.js");
var _api4 = _interopRequireDefault(_api3);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _toConsumableArray(arr) {
... |
import React from 'react';
import { Link } from "react-router-dom"
import styles from "./HeaderLeft.module.css"
import Button from '../../../Utility/Button';
import Heading from "../../../Utility/Heading"
function HeaderLeft() {
return (
<section className={styles.header_left} >
<Hea... |
const User = require('../models/user');
const Notifications = require('../models/notification');
const admin = require('../../firebase');
const rabbitmq = require('../controllers/rabbitmq')
/*
send_notification function sends notification for
the given tokens with the given payload. it receives
the tokens ... |
'use strict'
const {CONFIG} = require('../configs')
const UserModel = require('../models/User')
const UserHelper = require('../dbHelper/userHelper')
const crypto = require('crypto')
const koajwt = require('koa-jwt') // 用于验证token
const jwt = require('jsonwebtoken') // jsonwebtoken在服务端生成token返回给客户端
const md5 = str => cr... |
var mysql = require("mysql");
var inquirer = require("inquirer");
var connection = mysql.createConnection({
host: "localhost",
port: 3306,
user: "root",
password: "password",
database: "bamazon_db"
});
connection.connect(function (err) {
if (err) throw err;
console.log("connected as id " + connection.th... |
import React from "react";
import { useRoutes } from "hookrouter";
import { BrowserRouter as Router } from "react-router-dom";
import { Login, Home, Main, Workplace, Meetings, Colleagues } from "../pages";
import { MainNavbar, NoPageFound } from "../components";
import "./App.css";
const routes = {
"/": () => <Log... |
/*
Create and export conf variables
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
*/
// Container for all the enviournmnets
var enviournmnets = {};
enviournmnets.staging = {
httpPort: 3000,
httpsPort: 3001,
envName: 'staging',
hashingSecret: 'aPrivateStringForStag... |
/*
* Loading image
* Used in ./Dashboard.js while contactsAreLoading Redux state is true.
*/
import React from 'react';
import loader from '../images/loading.svg';
const Loading = () => (
<div className="loading">
<img src={loader} alt="loading..." />
</div>
);
export default Loading;
|
const signUp = require('./signUp');
const inboundSMS = require('./inboundSMS');
const validation = require('./validation');
module.exports = {
signUp,
inboundSMS,
validation
} |
//Task 5
function areaOfTri(a,b,c){
var s = (a + b + c)/2 ;
var x = s*(s-a)*(s-b)*(s-c);
var area=Math.sqrt(x);
return area;
}
console.log(areaOfTri(2,2,2));
|
import {
TokenCreateTransaction,
TransferTransaction,
StatusError,
Client,
Status,
Hbar, PrivateKey
} from "@hashgraph/sdk"
export function hederaClient(account_id, private_key, network) {
let client = network === 'testnet'
? Client.forTestnet()
: Client.forMainnet()
re... |
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
// Files regexes
const assetRegex = /\.(gif|png|jp(e*)g|svg|woff|w... |
jQuery(document).ready(function($) {
$(function() {
$(".menu").lavaLamp({
fx: "backout",
speed: 700,
click: function(event, menuItem) {
return false;
}
});
});
}); |
class brazier extends obj{
constructor(cena, positionX,positionZ, index){
super();
this.model = "models/brazier/scene.gltf"; //atribuicao do modelo gltf a variavel
this.loader = new THREE.GLTFLoader();
this.loader.load(this.model, function (gltf){ // load do modelo
... |
angular.module("servicios.ofertaYempleo",[])
.service('OfertaEmpleoServi', ['$http', '$q', '$ionicLoading', '$ionicPopup', '$state', 'CONFIG', function($http,$q,$ionicLoading,$ionicPopup,$state,CONFIG ) {
var http = {
post: function (url,data) { return this.peticion("POST... |
const IMG_WIDTH = 4096;
const IMG_HEIGHT = 4096;
const IMG_PATH = `https://picsum.photos/id/1/${IMG_WIDTH}/${IMG_HEIGHT}`;
const SECRET = 'Rofl1234';
const {width, height} = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
const img = new Image(IMG_WIDTH, IMG_HEIGHT);
img.src = IMG_PATH;
img.cro... |
//二次封装Message框,设置默认参数
import { Message as elementMessage } from 'element-ui'
export function Message(options){
options = Object.assign({
duration: 2000
},options)
elementMessage(options)
}
|
var searchData=
[
['calctimefornewday',['calcTimeForNewDay',['../class_actions_calendar.html#a54994066a3ea4c7f56cff15bae20a510',1,'ActionsCalendar::calcTimeForNewDay()'],['../classmain_win.html#a63293c7cdab54cf78b86e7c69a3bff7a',1,'mainWin::calcTimeForNewDay()']]],
['calendar_2ecpp',['calendar.cpp',['../calendar_8c... |
(function () {
'use strict';
angular
.module('panel10')
.config(config);
function config($stateProvider) {
$stateProvider
.state('panel10', {
url: '/10',
templateUrl: 'panel10/views/panel10.tpl.html',
controller: 'Panel10Ctrl',
controllerAs: 'panel10'
});
... |
import Home from './Home';
import Profile from './Profile';
import List from './List';
import PR from './PR';
import AddNew from './AddNew';
import Edit from './Edit';
import Screen from './Screen';
export {Home, Profile, List, PR, AddNew, Edit, Screen};
|
/* ------------------------------------------------------------------
Math Object Examples
-------------------------------------------------------------------- */
// Math PI
let piValue = Math.PI;
console.log(`Pi Value : ${piValue}`);
// Math sqrt
let sqrt = Math.sqrt(256);
console.log(`s... |
/**
* Created by Administrator on 14-3-14.
*/
define(function(require){
require('placeholder');
require('tagsinput');
require('jquery-ui');
require('application');
require('bootstrap-switch');
require('bootstrap-select');
}); |
import React from 'react'
import {Select} from 'antd'
export const PAGE_SIZE = 10;
//额外对象类型
const Option = Select.Option
export const TARGET0 = [
{key: '4', value: '产品', subs: [1, 2, 3]},
{key: '5', value: '科技', subs: [1, 2, 3]},
{key: '6', value: '项目', subs: [1, 2, 3]},
{key: '7', value: '事件', subs: [1, 2, 3... |
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import { Theme as UWPThemeProvider, getTheme } from "react-uwp/Theme";
import {BrowserRouter} from 'react-router-dom';
import IdleViewComponent from './IdleView.js';
import LoginEmailComponent from './LoginEmail.js';
import LoginPasswor... |
(function($) {
function expand(entry, addTo) {
if (entry.type == "SECTION") {
var h = 'h' + entry.depth;
addTo.append('<' + h + ' class="section">' + entry.title + '</' + h + '>');
} else if (entry.keys) {
addTo.append('<div class="keys">' + entry.type + ' ' + entry.keys + '</div>');
}
if (entry.... |
// Open modal
// переменная(хранилище значений), после = это то, что мы в него помещаем
const modal = document.querySelector('.modal')
const button = document.querySelector('.map-form-button')
const buttonClose = document.querySelector('.modal-close')
//чтобы кнопка стала реагировать ее нужно подписать на события
bu... |
import { StatusBar } from "expo-status-bar";
import React from "react";
import {
StyleSheet,
Text,
TextInput,
TouchableOpacity,
View,
} from "react-native";
import { createAppContainer } from "react-navigation";
import { createStackNavigator } from "react-navigation-stack";
import Main from "./screens/Main";
... |
import React from 'react';
import { connect } from 'react-redux';
import RevelationsContainer from '../containers/RevelationsContainer';
const mapStateToProps = state => {
return {
revelations: state.revelations
};
};
const Revelations = connect(
mapStateToProps
)(RevelationsContainer)
export default Revel... |
/*global Connection, authentication */
Connection.on('start', function(event) {
event.sessionId = authentication.sessionId;
if (event.options.authed && authentication.isAuthed() === false) {
// Short circuit the connection attempt if we know we are not authenticated
event.status = Connection.SESSION_EXPIRE... |
import validator from 'validator';
import React from 'react';
import ReactDOM from 'react-dom';
console.log(validator.isNumeric('a'));
const template = (
<p>Hola</p>
);
ReactDOM.render(template, document.getElementById('app')); |
module.exports = {
'env': {
'browser': true,
'node': true,
},
'plugins': ['react'],
'parser': 'babel-eslint',
'extends': 'airbnb', /* see https://github.com/airbnb/javascript */
'rules': {
// eslint
'strict': 0,
'space-before-function-paren': ['error', 'never'],
'func-names': 'off',
... |
"use strict";
/// <reference path="../../scene/componentEditors/ComponentEditorPlugin.d.ts" />
Object.defineProperty(exports, "__esModule", { value: true });
const TextRendererEditor_1 = require("./TextRendererEditor");
SupClient.registerPlugin("componentEditors", "TextRenderer", TextRendererEditor_1.default);
|
const hdt = require('hdt');
const fs = require('fs-extra');
const path = require('path');
const {config, logger} = require('@ucd-lib/fin-node-utils');
const api = require('@ucd-lib/fin-node-api');
const HAS_GRAPH = 'http://digital.ucdavis.edu/schema#hasGraph';
const FILE_NAME = 'http://www.ebu.ch/metadata/ontologies/e... |
import * as fs from 'fs'
const phoneNumber = '762-5387'
const rawString = fs.readFileSync('./src/testData/sample_dictionary.txt')
const dictionary = rawString.toString().split('\r\n')
let parsedNumber = ''
parsedNumber = parsedNumber.concat(...phoneNumber.split('-'))
if (parsedNumber.match(/^[0-9]+$/) === null){
... |
/**
* Publish layout function
*/
function GridLayout(colCount, tiles) {
return calculateGridfor(colCount, tiles);
}
/*
* Calculates the positions of tiles.
*
* The algorithm works as follows:
* An Array<Number> with length colCount (spaceTracker) keeps track of
* available tiling positions, where element... |
import React, { Component } from 'react';
import querystring from 'query-string';
import AuthService from '../AuthService';
const authRedirect = 'https://login.fullstackchu.com';
export default function withAuth(AuthComponent) {
const Auth = new AuthService(authRedirect);
return class AuthWrapped extends Component... |
app.controller('PostsCtrl', [
'$scope',
'$stateParams',
'posts',
function($scope, $stateParams, posts){
$scope.post = posts.posts[$stateParams.id]; //vzima id za saotvetnia post
$scope.incrementUpvotes = function(post) {
post.upvotes +=1;
};
$scope.addComment = function() {
if($scope.b... |
const $logoutButton = $('#logout');
const $appButton = $('.app-button');
const $modalTest = $('.modal-test');
const $pastaButton = $('.pasta-button');
const $saladsButton = $('.salads-button');
const $sandwichesButton = $('.sandwiches-button');
const $calzonesButton = $('.calzones-button');
const $proBowlsButton = $('.... |
require('./bootstrap');
require('./components/markdown');
require('./components/hamgurger');
require('./components/previewImage');
require('./components/add-lesson');
require('./components/ajaxLike');
require('./components/date-picker');
require('./components/sessionFlash');
require('./components/imgSlider');
require... |
var o = require("./Common_RankList"),
i = require("./utils/NodeUtil"),
n = require("./Common_Data"),
a = require("./ComPage"),
s = require("./FishCfgMgr"),
c = require("./Fish_UserData"),
r = require("./EChannelPrefix"),
l = require("./wxDisplayCheck"),
d = require("./Common_GlobalEventU... |
var io = require('socket.io');
var _ = require('underscore');
var deck = require('./deck');
var DAL = require('./dal');
var tables = require('./tabledecks');
function Io() {
return {
init: function(server) {
var objServ = io.listen(server);
var table;
objServ.sockets.on... |
const PORT = process.env.PORT || 5000;
var ip = require('ip');
var server = require('http').createServer();
var io = require('socket.io')(server);
server.listen(PORT, function () {
console.log("Server address: " + ip.address() + ":" + PORT);
});
var events = ["connect", "getInfo", "setInfo", "info", "messa... |
'use strict';
const fs = require('fs');
fs.readFile('1-readFileSync.js', 'utf8', (err, buffer) => {
if (err) {
console.log(err);
process.exit(0);
}
console.log(`File size: ${buffer.length}`);
const src = buffer.toString();
const lines = src.split('\n').filter(line => !!line);
const content = line... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.