text stringlengths 7 3.69M |
|---|
angular.module('app.services', [])
.directive('loggedin', [function(){
return {
restrict: 'AE',
replace: true,
templateUrl: 'nav/loggedinnav.html'
};
}])
.directive('loggedout', [function(){
return {
restrict: 'AE',
replace: true,
templateUrl: 'nav/loggedoutnav.htm... |
import Component from '@ember/component';
import { computed } from '@ember/object';
import layout from './template';
import CurrencyDataLoaderMixin from '@upfluence/ember-upf-utils/mixins/currency-data-loader';
import { formatPrice } from '@upfluence/ember-upf-utils/helpers/format-price';
export default Component.exte... |
import React from 'react'
const Login = (props) => {
return (
<div className="login">
<h1>Login</h1>
<form>
<input type="text" name="username" placeholder="username" />
<input type="password" name="password" placeholder="password" />
<button type="submit">Login</button>
... |
Glagol.events.once('changed', reload);
module.exports = function (state) {
console.warn('reocnnect', state)
Object.keys(state).forEach(function (input) {
var connections = state[input];
input = input.split('/')
var mixer = _.model.Mixers()[input[0]];
if (!mixer) return console.error('no mixer', inp... |
//Destructuring
//*array
//*object
// const person ={
// name:"ali",
// age:12,
// lastname:"rezaei"
// }
// const name = person.name;
// const lastname = person.lastname;
// const { name : firstName,lastname } = person;
// person.name = "jafar";
// console.log(firstName,lastname);
// const arr = ["App... |
const path = require('path')
let extension
process.platform === 'win32' ?
extension = 'ico' // .ico on Win32
:
extension = 'png' // .png on Darwin
module.exports = {
png: path.join(__dirname, 'static', `logo.png`),
ico: path.join(__dirname, 'static', 'logo.ico')
} |
const { Router } = require('express');
const Tweet = require('../models/Tweet');
module.exports = Router()
.post('/', (req, res) => {
const { handle, text } = req.body;
Tweet.create({
handle,
text
}, (err, createdTweet) => {
res.send(createdTweet);
});
})
.get('/', (req, res) =... |
import {reducer, ActionType, ActionCreator} from './data.js';
const questionGenre = {
genre: `metall`,
tracks: [
{
id: 0,
genre: `metall`,
src: `https://upload.wikimedia.org/wikipedia/commons/4/4e/BWV_543-fugue.ogg`,
},
{
id: 1,
genre: `rap`,
src: `https://upload.wik... |
var baseWebStorage = require("./baseWebStorage");
var webLocalStorage = function ls(wsKey) {
this.wsKey = wsKey;
};
webLocalStorage.prototype.setData = function(param,value,isDelete) {
if(typeof localStorage != 'undefined') {
var found,
ls = JSON.parse(localStorage.getItem(this.wsKey) || ... |
/* eslint no-console: off */
// custom console
console.log('Hello world!')
const asciiArtM = `%c
........ ........
@MMMMMMM. .MMMMMM@
MMMMMMM. .MMMMMM.
@MMMMMMM. .MMMMMMM.
@M @MMMMM. .M.@MMMMM.
@M @MMMMM@ .M. @MMMMM.
@M @MMMMM@M@ @MMMMM.
@M .MMMMM@ @MMMMM.
.MM@ ... |
import { getOwner } from '@ember/application';
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';
export default class HttpErrors402Controller extends Controller {
@service intl;
@action
openSupportChannel() {
const csChat ... |
/*
You are having a BBQ, after the BBQ you are left with the rubbish.
You have 3 recycling boxes:
Red: Plastics, Green: Glass, Blue: Card.
You will need to sort the rubbish according to the material and return the number of items in each box in the form of an array i.e [2,3,4] where 2 is the number of plastic items,... |
(function() {
'use strict';
angular
.module('app')
.controller('RegisterController', RegisterController);
// RegisterController.$inject = [];
/* @ngInject */
function RegisterController($state, $auth) {
var vm = this;
vm.user = {};
vm.register = __register;
console.log('RegisterController()');
... |
Ext.define('cfa.controller.help.HelpController',{
extend: 'Ext.app.Controller',
requires: ['cfa.view.help.HelpView', 'cfa.view.help.HTMLPanel'],
config: {
routes: {
'help': 'showHelpPage',
'help/:path' : 'showHelpById'
},
refs: {
main: 'main'
}
}... |
_.parseInt = function(val,radix) {
if(typeof val === 'string'){
val = val.replace(/^0+/g,'');
}
return parseInt(val,radix);
} |
//51 53 55 59 60 63 64 71
const skirtsImageLinks = {
51: [
'https://404-images-fec.s3-us-west-1.amazonaws.com/51_multi_1.jpeg',
'https://404-images-fec.s3-us-west-1.amazonaws.com/51_multi_2.jpeg',
'https://404-images-fec.s3-us-west-1.amazonaws.com/51_multi_3.jpeg',
'https://404-images-fec.s3-us-west-... |
// JavaScript source code
var express = require('express');
var path = require('path');
var app = express(); //our server
app.set('view engine', 'pug'); // allows to set varialbes for express
app.use(express.static(path.join(__dirname, 'public')));
//app.use(express.static('node_modules'));
//app.use(... |
import React, {useEffect, useState} from 'react'
import {
Text,
View,
StyleSheet,
Image
} from 'react-native'
import Axios from 'axios'
const key = 'faf981d79c94b75d3c34a1b45c9330b9'
const MovieDetail = (props)=>{
const getMovieURL = `https://api.themoviedb.org/3/movie/${props.movieid}?api_key=${k... |
console.log('Bucles - Ejercicio 3');
|
import Vue from "vue";
import './style/index.scss';
import {
getmaxAndminObj,
hasOwn,
isFunction,
isObject,
mergeOptions,
isHasValue
} from "@utils/index.js"
import FilterPanel from "./filterPanel/index.js"
import defaultC from "./editCell/default.vue"
import selection from "./editCell/select... |
/**
* Created by Liu.Jun on 2020/11/5 15:24.
*/
export function isString(str) {
return String(str) === str;
}
function genIdFn() {
let preKey = `${+new Date()}`;
let key = 0;
return () => {
const curTimestamp = `${+new Date()}`;
if (curTimestamp === preKey) {
key += 1;
... |
import React from "react";
import { Link } from "react-router-dom";
const NavBar = () => {
return (
<div>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/map">View Map</Link>
</li>
<li>
... |
const members = [
{
id: 1,
name: 'John Doe',
email: 'johndoe@gmail.com',
status: 'inactive'
},
{
id: 2,
name: 'Susan Ibach',
email: 'ibachsusan@gmail.com',
status: 'active'
},
{
id: 1,
name: 'Bill Gate',
email: '... |
Template.articleEdit.onCreated(function() {
Session.set('articleEditErrors', {});
});
Template.articleEdit.helpers({
errorMessage: function(field) {
return Session.get('articleEditErrors')[field];
},
errorClass: function (field) {
return !!Session.get('articleEditErrors')[field] ? 'has-error' : '';
}
... |
console.log('pagy-e2e');
|
const tsRoute = require('express').Router();
const data = require('./../db/data') || [];
tsRoute.get('/', (request, response) => {
response.json(data);
});
tsRoute.post('/', (request, response) => {
const {id, name, phone} = request.body;
const newTs = {id, name, phone};
data.push(newTs);
respons... |
import React from 'react'
import './index.styl'
import Header from '~/main/components/Header'
class Home extends React.Component {
render () {
let { store } = this.props.route
return <div className='Home'>
<Header store={store} />
Home Page
</div>
}
}
export default Home |
import React, { useContext } from "react";
import { TestContext } from "./ContextExample";
const CompB = () => {
const [msg, setMsg] = useContext(TestContext);
console.log("CompB.js");
return (
<div>
<hr />
<div>CompB: {msg}</div>
<input type="text" value={msg}... |
/*
Author: Jacob Williams
Purpose: server.js contains the connection to the server and DB
Useage: node server.js
*/
//creating constant variables
const express =require('express');
const mongoose = require('mongoose');
const app = express();
//digital ocean -> 143.198.105.222
const hostname = 'localhost';
const... |
import React, {PureComponent} from 'react';
import {ActivityIndicator, FlatList, StyleSheet, Text, View, InteractionManager} from "react-native";
import * as Request from "../../common/request";
import * as Config from "../../common/config";
import ComicListCell from "./ComicListCell";
export default class ComicListP... |
const express = require('express');
const app = express();
const http = require('http').Server(app);
const io = require('socket.io')(http);
const PythonShell = require('python-shell');
const router = require('./app/routes');
app.use('/', router);
app.use(express.static(__dirname + '/public'));
var request = requir... |
// document.getElementById('jsButton').onclick = function () {
// JSON.parse(a)
// }
document.getElementById('jsButton').addEventListener('click', function(){
console.log(aa)
}) |
const Koa = require('koa');
const app = new Koa();
const jsonData = require('./person_train.json')
// response
app.use(ctx => {
ctx.body = JSON.stringify(jsonData,undefined,1);
});
app.listen(3000);
|
module.exports = {
Landing: {
api: 'landing',
interval: 1,
params: {
cpid: '',
user_id: '',
user_agent: '',
user_device: '',
current_url: '',
product_code: ''
}
},
Login: {
api: 'login',
... |
// JScript 文件
function ValidateInput()
{
var txtSupplierName = $.trim($("#txtSupplierName").val()); //供应商名称
var ddlContacter = $.trim($("#ddlContacter").val()); //联系人
var txtContactPhone = $.trim($("#txtContactPhone").val()); //联 系 电 话
var txtContacterRole = $.trim($("#txtContacte... |
import isPresent from './isPresent'
/**
* Returns first not blank object.
*/
export default function notBlank() {
for (let i = 0; i < arguments.length; i++) {
const value = arguments[i]
if (isPresent(value)) {
return value
}
}
}
|
export default function bankConfig($stateProvider) {
//$urlRouterProvider.when('', '/authentication');
// Now set up the states
$stateProvider
.state('app.bank', {
url: 'bank',
views: {
'bankInformation@app': {
templateUrl: 'components/ba... |
const genomicRangeQuery = (s, p, q) => {
s = s.split('');
let Amap = s.map(c => c == 'A' ? 1 : 0);
let Cmap = s.map(c => c == 'C' ? 1 : 0);
let Gmap = s.map(c => c == 'G' ? 1 : 0);
let Tmap = s.map(c => c == 'T' ? 1 : 0);
Amap = Amap.reduceRight((s, n, i) => { s[i] = s[i+1] + n || n; return s; }, [0]);
Cm... |
/* becode/javascript
*
* /02-maths/04-sort-numbers/script.js - 2.4: classer des nombres
*
* coded by leny@BeCode
* started at 26/10/2018
*/
// NOTE: don't focus on the existing code structure for now.
// You will have time to focus on it later.
(() => {
// to get the value of an input: document.getElementById... |
import React, { useState, useEffect } from "react";
import styled from "styled-components";
import axios from "axios";
import {
Button,
Paper,
FormControl as MuiFormControl,
Grid,
Input,
InputLabel,
TextField,
Typography,
Tooltip,
Box,
Tab,
Tabs,
Card,
Link
} from... |
// ────────────────────────────────────────────────────────────────────────────────
// MODULES
const path = require('path');
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const autoprefixer = require('autoprefixer');
// ────────────────────────────────────────────────... |
import { shallowMount } from "@vue/test-utils";
import Hero from "@/components/Hero.vue";
describe("Hero", () => {
describe("hero image", () => {
it("renders the hero image", () => {
const wrapper = shallowMount(Hero);
expect(wrapper.find(".hero__image img").exists()).toBe(true);
});
it("inc... |
const { checkToken } = require("../middlewares/auth");
const { Playlist, Track } = require("../models/index");
const {
Op: { like },
QueryTypes,
} = require("sequelize");
const { sequelize } = require("../sequelize");
const { recommendations } = require("../utils/recommendations");
function getSearchQuery(queryPar... |
import React from 'react';
import { Link } from 'react-router';
const Navigation = () => (
<ul className='Navigation'>
<li className='Navigation-item'>
<Link to='/projects' className='Navigation-link'>projects</Link>
</li>
<li className='Navigation-item'>
<Link to='/contacts' className='Navig... |
/**
* 中间图片是为了演示,所以需要利用 js,将其“锁定”的动画解除
*/
$(".hover").mouseleave(
function () {
$(this).removeClass("hover");
}
);
|
let n1 = document.getElementById('num1');
let sum1 = 0;
function plus1() {
sum1 += 1;
n1.innerHTML = sum1;
}
function minus1() {
sum1 -= 1;
n1.innerHTML = sum1;
}
let n2 = document.getElementById('num2');
let sum2 = 0;
function plus2() {
sum2 += 1;
n2.innerHTML = sum2;
}... |
import { createStore } from 'redux';
import reducer from './reducer';
import { addComment } from './actions';
const store = createStore(reducer);
store.dispatch(addComment('pierwszy komentarz'));
store.dispatch(addComment('drugi komentarz'));
export default store;
|
/**
* Creates global functions that serve to facilitate the creation and manipulation of 2-3 trees.
*/
(function () {
"use strict";
/**
* Creates a new array tree. The values are hard coded, this method only work for this instance.
* @param jsav The JSAV that will draw the array nodes.
* @returns {Array... |
var expect = require('expect.js')
, path = require('path')
, fun = require(path.resolve(__dirname, '..', 'src', 'chapter-1-2'))
describe('chapter-1-2', function() {
([
['\0', '\0'],
['abc\0', 'cba\0'],
['a\0', 'a\0'],
['abcdefg\0', 'gfedcba\0']
]).forEach(function(args) {
it('reverses ... |
'use strict';
(function () {
var PIN_STEP = 20;
var uploadPopup = document.querySelector('.img-upload__overlay');
var effectPin = uploadPopup.querySelector('.effect-level__pin');
var effectLevelLine = uploadPopup.querySelector('.effect-level__line');
var convertCoordInPercent = function (coord, fullWidth) ... |
K = require('kefir');
_ = require('lodash');
const add = (a, b) => a + b;
const countTen = K.sequentially(100, _.times(10));
countTen.scan(add, 0)
.log('scan');
countTen.toProperty(() => 100)
.scan(add, 0)
.log('propertyScan');
|
/* See license.txt for terms of usage */
define([
"firebug/lib/object",
"firebug/lib/trace",
],
function(Obj, FBTrace) {
// ********************************************************************************************* //
// Constants
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Compo... |
/*!
* JavaScript Core Object v0.53
*
* Licensed under the new BSD License.
* Copyright 2008-2009, Bram Stein
* All rights reserved.
*/
(function () {
function getInternalType(value) {
return Object.prototype.toString.apply(value);
}
function Clone() {}
Object.extend = function (obj) {
var i = 1, ... |
const PannierReducer = (state = [], action) => {
if(action.type==="AJOUT"){
return [...state,action.payload]
}else if (action.type==="REMOVE_FROM_CART"){
return state.filter(el=>el._id!==action.payload)
}else {
return state
}
}
export default PannierReducer; |
import * as mutations from "./mutations";
export default class Player{
inventory = new Set();
static pieceName = "Player";
static sprite = "Player_South_1.png";
static description = "The player character. You can only have one of these.";
sprite = "Player_South_1.png";
constructor(){
}
... |
var electron = require('electron');
const {remote} = require('electron')
const ipc = electron.ipcRenderer
var myApp = angular.module('myApp',[]);
myApp.controller('MyCtrl', function ($window) {
var vm = this;
vm.openWindow = function(){
//$window.open('html/search_song.html',
//'Search Song... |
$(document).ready(
function()
{
var controller = frontController();
controller.initialize_onload();
$("#tracks").tabs();
$("#charts").tabs();
$('#track-list input:checkbox').live('click', function() { $(this).change(controller.tracklist_checkbox_change)});
$('#track-list a.del').live('click', controller... |
import { Node } from '../helpers/Node'
const BoardEmpty = props => {
return (
Node('div', { class: 'board empty' },
Node('div', { class: 'plus' }, '+')
)
)
}
export default BoardEmpty
|
import React from 'react';
import {fireEvent,render} from '@testing-library/react';
describe('Testing', () => {
it('First test', () => {
expect(true).toBeTruthy()
});
});
|
/**
* Created by nnnyy on 2018-11-24.
*/
const VueBus = {
CloseInventory: "CloseInentory",
StartTimer: "StartTimer",
SetAlertMsg: "SetAlertMsg",
OpenGachaBox: "OpenGachaBox",
HTTP: {
CheckLogin: "/auth/checklogin",
Login: "/auth/login"
},
SOCK: {
NotLogined: "NotLog... |
import { init } from "@rematch/core";
import { plugins } from "f-core";
import * as models from "models";
export const store = init({
models,
plugins: [plugins.actions],
});
|
import * as types from '../actions/ActionTypes';
import update from 'immutability-helper';
const initialState = {
thesaurusWords: {
status: 'INIT',
data: [],
page: 0,
totalPage: '',
categorized: false
},
thesaurusCategories: {
status: 'INIT',
data: ''... |
var fs = require('fs');
var file = fs.createReadStream('../mod_1/file.txt');
var newFile = fs.createWriteStream('file-1.txt');
file.pipe(newFile); |
import React from 'react'
import './App.css'
import './Reset.css'
import { FacebokIcon, GithubIcon, InstagramIcon, TwitterIcon } from './Icons'
import { BrowserRouter as Router, Route, Link } from 'react-router-dom'
import Home from './home/Home'
import About from './about/About'
import Post from './post/Post'
class A... |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
... |
import React from 'react';
import Slider from 'material-ui/Slider';
const style = {
width: '90%',
margin: 'auto'
}
/**
* By default, the slider is continuous. The `step` property causes the slider to move in discrete increments.
*/
const SliderExampleStep = () => (
<Slider step={0.10} value={.5} style={style}/>
... |
/*global console: false, aljabr: false, _: false */
/**
* John Eargle (mailto: jeargle at gmail.com)
* 2007-2019
* aljabr
*/
var aljabr = aljabr || {}
/**
* Immutable, validated Group.
*/
aljabr.Elements = class {
elements = []
elementToIdx = {}
/**
* Initialize the class.
* @param el... |
import { connect } from 'react-redux';
import TagsIndexItem from './tags_index_item';
import { fetchTaggedNotes, setCurrentNote } from '../../../actions/note_actions';
import { setCurrentNotebook } from '../../../actions/notebook_actions';
import { setCurrentTag, deleteTag, fetchTags, fetchNoteTags, removeZeroIdTag } ... |
import { connect } from 'react-redux'
import { push } from 'react-router-redux'
import { setCurrentProject, addCandidate } from '../../../actions/projects'
import ProjectsShowView from './view.js'
const mapStateToProps = state => ({
currentUser: state.currentUser,
...state.currentProject
})
const mapDispatchToPro... |
import React from 'react';
import renderer from 'react-test-renderer';
import {ShowMore} from './show-more.jsx';
import {films} from '../../mocks/test-mocks.js';
it(`ShowMore should render correctly`, () => {
const tree = renderer
.create(
<ShowMore
moviesByGenre={films}
moviesCount={1}
... |
import { h, Component } from "preact";
import style from "./style";
export default ({ article }) => <section class={style.article} />;
|
import React from 'react';
import MainView from './layout/MainView';
import SplashScreen from './layout/SplashScreen';
/**
* The view for the entire app.
*
* @returns {*} The jsx to display the component
* @constructor
*/
const App = () => (
<SplashScreen>
<MainView />
</SplashScreen>
);
export default A... |
/**
* A lookup table of cards to their index.
*/
const cardNames = {
spades: {
ace: 0,
two: 1,
three: 2,
four: 3,
five: 4,
six: 5,
seven: 6,
eight: 7,
nine: 8,
ten: 9,
jack: 10,
queen: 11,
king... |
/*
Une directive retourne une référence vers elle-même via un Object et accepte un certain normbre de paramètres.
Selon moi, les plus importants à connaitre sont restrict, replace, transclude, template, templateUrl et, bien sûr, la propriété link.
*/
myApp = angular.module('myApp', []);
myApp.directive('customButto... |
// Given an array of integers, find the pair of adjacent elements that has the largest product and return that product.
// Example
// For inputArray = [3, 6, -2, -5, 7, 3], the output should be
// adjacentElementsProduct(inputArray) = 21.
// 7 and 3 produce the largest product.
function adjacentElementsProduct(inpu... |
var expect = require('expect.js')
, dataTypes = require(__dirname + "/../data-types")
var fun = function(arr) {
if (arr.length === 0) {
return null
} else {
var midIndex = ~~(arr.length / 2)
, node = null
node = dataTypes['binary-search-tree'].createNode(arr[midIndex])
node.left = fun(... |
Template.footer.helpers({
showVersion: function() {
return app_version + ' build ' + app_build;
}
});
|
import Vue from 'vue'
import Router from 'vue-router'
import HomeView from '@/components/views/home'
import LocationView from '@/components/views/locations'
import TimetableView from '@/components/views/timetables'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
name: 'home',
... |
// CREAR COMPONENTE
Vue.component('card',{
props:{
clasePrincipal:{
type: String,
default:'slider-item'
}
},
template:`
<div class="flex">
<div v-for="item in menuLista" class="card">
<div class="card-top">
<img :src="item.foto" alt="Imagen de Unsplash"/>
<span>U$S {{ite... |
import SwitchDelegate from './SwitchDelegate';
export default SwitchDelegate;
|
const markdownIt = require("markdown-it");
const hljs = require("highlight.js");
const PostContent = props => {
const markdownConfig = {
html: true,
linkify: true,
typographer: true,
highlight: function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.high... |
import React,{Component} from 'react';
import { Button, View, Text , Image ,StyleSheet , TextInput , TouchableOpacity } from 'react-native';
import { createStackNavigator, createAppContainer , createDrawerNavigator } from 'react-navigation';
import DetailsScreen from './DetailsScreen';
import DrawerScreen from './Drawe... |
require("date-format-lite"); // add date format
const xssFilters = require('xss-filters');
class Storage {
constructor(connection) {
this._db = connection;
this.table = "events";
}
// get events from the table, use dynamic loading if parameters sent
async getAll(params) {
let query = "SELECT * FROM ??";
l... |
const dbpool = require("../config/dbconfig");
//var table = 't_admin';
var sql = '';
const pageTotolDao = {
getTotol(arr){
return new Promise((resolve,reject)=>{
//var sql = 'select count(*) as myCount from '+table;
dbpool.connect(sql,arr,(err,data)=>{
resolve(data);
... |
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import GIbuildMain from './giBuildPortal/GIbuildMain'
import MonitorStatus from './MonitorStatus'
import { Prompt } from 'react-router'
export default class SassGIhistoryScope extends Component {
static propTypes = {
actions: PropTypes.ob... |
// Tools / Plugins
var gulp = require('gulp'), // https://www.npmjs.com/package/gulp
browserSync = require('browser-sync').create(), // https://www.npmjs.com/package/browser-sync
sass = require('gulp-sass'), // https://www.npmjs.com/package/gulp-sass
autoprefixer =... |
document.addEventListener('DOMContentLoaded', function(){
// ①変数の宣言
let rowNumber;
let colNumber;
let mineNumber;
let startTime;
let timeoutId;
// let shuffledNumbers = [];
// const row = [];
let sheet = [];
let isPlaying;
let isDead;
// ②関数たち
// ランダムな配列を作る関数
function shuffle(... |
import React, {Component} from 'react';
import './signin.css';
import PropTypes from 'prop-types';
import Nav from 'react-bootstrap/lib/Nav';
import NavItem from 'react-bootstrap/lib/NavItem';
import Sender from './newSender';
class Login extends Component {
constructor() {
super();
this.state = {... |
$(document).ready(onReady);
function onReady(){
console.log(`I'm ready`);
getQuotes();
$('#addButton').on('click', addQuote);
// $('#refreshButton').on('click', getQuotes);
}
function getQuotes(){
console.log('in getQuote');
$.ajax({
method: 'GET',
url: '/quotes',
}).then( ... |
import { Material } from "../material.js";
import { DemoShader } from "../shaders/demoshader.js";
export class DemoMaterial extends Material {
static singleton = undefined;
constructor() {
super();
this.setShader(DemoShader.get());
}
static get() {
if (!DemoMaterial.singleton) DemoMaterial.singlet... |
import test from 'tape'
import stepper from '../../../signals/processes/stepper'
import liftN from '../../../signals/processes/liftN'
import { spy } from 'sinon'
import map from 'ramda/src/map'
import addIndex from 'ramda/src/addIndex'
import flip from 'ramda/src/flip'
const mapIndexed = addIndex(map)
test('liftN', (... |
var Signer = require(__dirname+'/../build/signer');
var PrivateKey = require(__dirname+'/../build/private_key');
var Message = require(__dirname+'/../build/message');
var Signature = require(__dirname+'/../build/signature');
describe('Signer', function() {
it('should accept a private key', function() {
... |
profiles = {
default: {
ExpressEnvironment: {
port: 8080
},
RequestDetector: {
name: 'endpoint1',
route: '/worker',
handler: (req, res) => { res.json(true); }
},
StompNotifier: {
conn: {
host: '127.0.0.1',
port: 61613,
user: 'admin',
pas... |
import React, {Component} from 'react';
import _ from 'lodash';
import moment from 'moment';
class Week extends Component{
constructor(props){
super();
this.state={
selectedEventDates:(_.size(props.selected)>0)?(Object.assign([], props.selected)):([]),
date: props.date,
... |
import React, { Component } from 'react';
import { Select } from 'antd';
import axios from 'axios';
import showError from '../utils/ShowError';
const Option = Select.Option;
const PROJECTS_URL = `${process.env.REACT_APP_SERVER_URL}/api/projects`;
class ProjectSelect extends Component {
constructor(props) {
supe... |
require("dotenv").config();
// const morgan = require('morgan');
const mongoose = require('mongoose');
// const cors = require('cors');
// console.log(process.env);
const {
PORT = 3001,
MONGODB_URI = "mongodb://localhost/cars" //<-- implicit db creation
} = process.env;
(async () => {
try {
const conn = awa... |
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
// Create Schema
const MedSchema = new Schema({
name: {
type: String,
// required: true,
},
email: {
type: String,
// required: true,
},
phone: {
type: Number,
// required: true,
},
age: {
type: Number,
/... |
import React, {Component, Fragment} from 'react'
import {Route} from 'react-router-dom';
import './Body.css';
import Feed from "../Feed/Feed";
class Body extends Component {
render() {
return (
<Fragment>
<button onClick={()=>this.props.dispatch({
type: "NEW... |
/**
* @jsx React.DOM
*/
/**
* Create by Drew on 1/21/2015
*/
var React = require('react'),
Bootstrap = require('react-bootstrap'),
ButtonToolbar = Bootstrap.ButtonToolbar,
Button = Bootstrap.Button;
var ButtonList = React.createClass({
render: function () {
return (
<ButtonTool... |
// ip and the Promise modules used for Async Promises
import {history} from '../index.jsx';
import Promise from 'bluebird';
import crypto from 'crypto';
import * as constvars from '../constvars.jsx';
const dbServer = constvars.DBSERVER_VAR;
export const REG_ATTEMPT = 'REG_ATTEMPT';
export const LOGIN_ATTEMPT = 'LOGIN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.