text stringlengths 7 3.69M |
|---|
const _id = Symbol('id')
const _name= Symbol('name')
const _blood =Symbol('blood')
const _contact= Symbol('contact')
class Person{
constructor(id,name){
this[_id]= id;
this[_name]=name;
this[_blood]=null;
this[_contact]=null;
}
get id(){
return this[_id]
... |
/**
* Created by wj on 2016/5/26.
*/
import { angular, ionic } from 'library'
export default angular.module('about', [ionic])
.config(function ($stateProvider) {
"ngInject"
$stateProvider
.state('about', {
url: '/about',
controllerAs: 'vm',
... |
import React, { useState } from 'react';
import { useHistory } from 'react-router-dom';
import AppNav from './AppNav';
import '../styles/Meals.css';
import DatePicker from 'react-date-picker';
import { Container, Form, FormGroup } from 'reactstrap';
import 'react-date-picker/dist/DatePicker.css';
import 'react-calendar... |
/**
* @file san-xui/x/forms/builtins/StaticItem.js
* @author leeight
*/
import StaticItem from '../StaticItem';
const tagName = 'ui-form-static';
export default {
type: 'static',
tagName,
Component: StaticItem,
builder(item, prefix) {
return `
<${tagName}
mapper... |
// var express = require('express');
// var router = express.Router();
// var users = require("./users");
/* GET home page. */
module.exports = function (app) {
app.get("/", function (req, res) {
res.render('index', { "title": "主页" });
});
// app.get("/users", users);
// register
app.get("/reg", function (req,... |
import React from 'react';
// style
import classes from './BackgroundVideo.scss';
// assets
import backgroundMp4 from '../../../assets/images/video.mp4';
import backgroundWebM from '../../../assets/images/video.webm';
// background video for landing page that autoplays muted and looped
// if mp4 not supported, webm ... |
function autoPlayYouTubeModal(){
var trigger = $("body").find('[data-toggle="modal"]');
trigger.click(function() {
var theModal = $(this).data( "target" ),
videoSRC = $(this).attr( "data-theVideo" ),
videoSRCauto = videoSRC+"?autoplay=1" ;
$(theModal+' iframe').attr('src', videoSRCauto);
$(theM... |
import React from 'react';
import styled from 'styled-components';
const Page = styled.button`
height: 40px;
width: 40px;
border-radius: 5px;
cursor: pointer;
border: 0.5px solid grey;
&:hover{
background-color: lightblue;
}
`;
const PageRow = styled.div`
margin: 25px 0;
`;
function Pagination ({totalPages... |
/**
* Created by Sushant on 17/06/17.
*
* App Constants
*
* React app
*
*/
import APIConfig from './api';
import ErrorMessages from './errors';
export { APIConfig, ErrorMessages } |
const mongoose = require('mongoose')
const { omit } = require('lodash')
const ObjectId = mongoose.Schema.Types.ObjectId
const productSchema = mongoose.Schema(
{
storeId: { type: ObjectId, ref: 'stores', require: true },
storeBranchId: [{ type: ObjectId, ref: 'store_branches', require: true }],
categoryI... |
/* @jsx jsx */
import React from 'react';
import { Link } from 'gatsby';
import PropTypes from 'prop-types';
import { Heading, Text } from '@rebass/emotion';
import { jsx, css } from '@emotion/core';
import styled from '@emotion/styled';
import themeGet from '@styled-system/theme-get';
import { color } from 'styled-sys... |
(function(module)
{
'use strict';
module.directive('beachesDirectivesPageContainer', [
'$sce',
'$location',
'$anchorScroll',
'beachesServicesWordpress',
'beachesServicesAnchorExtractor',
'beachesServicesHeader',
function($sce, $location, $anchorScroll, wordpress, anchorExtractor, headerService)
{
r... |
module.exports = function(grunt) {
'use strict';
grunt.config('shell', {
mongo: {
command: 'mongod',
options: {
async: true
}
}
});
grunt.loadNpmTasks('grunt-shell');
};
|
import { useSelector } from "react-redux";
export const useOrgData = () => {
return useSelector((state) => state.organisation);
};
export const useAuthUser = () => {
return useSelector((state) => (state.auth && state.auth.user) || {});
};
|
var http = require("http"),
url = require("url"),
querystring = require("querystring"),
zerorpc = require("zerorpc"),
formidable = require("formidable"),
config = require("./config"),
ws = require('ws'),
ua_parser = require('ua-parser'),
fs = require('fs'),
path = require('path');
... |
import React from 'react';
import { Link } from 'react-router-dom';
import Image from '../shared/Image';
import './ContactCard.css';
const ContactCard = ({isFavorite, smallImageURL, name, id, companyName}) => {
return (
<Link className={`Card ${isFavorite ? 'favorite' : ''}`} to={id}>
<Image src={smallIma... |
import PropTypes from 'prop-types';
export const statePropTypes = {
isFetching: PropTypes.bool.isRequired,
error: PropTypes.string.isRequired,
data: PropTypes.array.isRequired
};
export const postPropTypes = {
id: PropTypes.string.isRequired,
timestamp: PropTypes.number.isRequired,
title: PropTypes.string.isReq... |
var fs = require('fs');
var browserify = require('browserify');
var babelify = require('babelify');
var exorcist = require('exorcist');
var dirname = require('path').dirname;
/**
* Define the tasks that make up a build
* @type {Object}
*/
var tasks = [processJS];
/**
* Process JS with babel + br... |
const setDevServer = require('./setup-dev-server')
const path = require('path')
const serverTemplatePath = path.resolve(__dirname, '../../../frontend/src/templates/index.ssr.html')
const { createBundleRenderer } = require('vue-server-renderer')
const debug = require('debug')('lime:ssr')
const { renderToClient } = req... |
module.exports = {
name: 'Participant',
isArchived:false,
isSystem: true,
preventShortcut: true,
preventReport: true,
clientLink: 'NO_LINK',
documentDate: 'USE_CREATION_DATE',
documentDateLabels: {fr: 'Date de création', en: 'Creation date'},
documentStatus: 'NO_DRAFT',
fields:[{
l... |
'use strict';
const eventData = require('../../data/events/message');
const getMessage = async (req, res, next) => {
try {
const eventlist = await eventData.getMessage();
res.send(eventlist);
} catch (error) {
res.status(400).send(error.message);
}
}
const getSliderMessage = asyn... |
function countProps(object) {
// Пиши код ниже этой строки
return Object.keys(object).length;
// Пиши код выше этой строки
}
|
/*jshint strict:false, loopfunc:true*/
/*global describe, before, it*/
var ObjectID = require("mongodb").ObjectID;
var ZSchema = require("../src/ZSchema");
var assert = require("chai").assert;
function hrtoms(t) {
return (t[0] * 1e9 + t[1]) / 1e6;
}
describe("https://github.com/zaggino/z-schema/issues/39", funct... |
import { useState , useEffect } from 'react'; //import state library from react.
import './App.css';
import Posts from './components/Posts';
function App_API () {
const [posts,setPosts] = useState ([]);
const [index,setIndex] = useState(0);
useEffect(() => {
fetch('https://jsonplaceholder.typicod... |
import React from 'react'
import './MovieCard.css'
const MovieCard = ({ id, poster_path, average_rating }) => {
const star = '⭐️'
return (
<article className="movie-card" id={id} >
<img className="movie-poster" src={ poster_path } alt='movie poster'/>
<p className="movie-rating">{star.repeat(Mat... |
var searchData=
[
['msg_5ferror',['msg_error',['../group___debug___private___variables.html#ga57ad017acd4535fe089f54ed903b3e9e',1,'debug.c']]],
['mutex',['mutex',['../structt__cola.html#afc659d089f5608a17e8650e59a7e26fc',1,'t_cola']]],
['mask_20for_20state_20indication_20service',['Mask for STATE INDICATION servi... |
const path = require('path')
const fs = require('fs')
const Bull = require('bull')
const Arena = require('bull-arena')
function init (app) {
const queues = []
fs
.readdirSync(__dirname)
.filter(file => file.indexOf('.') !== 0 &&
file !== 'index.js' &&
file !== 'READM... |
'use strict'
var assert = require('chai').assert,
sinon = require('sinon'),
Pomodoro = require('../models/pomodoro.model')
require('sinon-mongoose')
describe('Get all pomodoros', function () {
it('should return all pomodoros', function (done) {
var PomodoroMock = sinon.mock(Pomodoro),
... |
// Login / Registration Partial 1 Controller___
qAndAApp.controller('PartialControllerOne', ['$scope', '$location', 'clientSideFactory',
function($scope, $location, clientSideFactory){
$scope.registerUser = function(newUser){
console.log(newUser);
clientSideFactory.registerUser(newUser);
}
$sc... |
import React from 'react'
export default class Error extends React.Component{
render(){
return(
<div className="alert alert-danger alert-dismissible fade show">
<strong>Error!</strong> A problem has been occurred while submitting your data.
</div>
)
}
}
|
export {default as Filter} from './Filter'
export {default as CardDeck} from './CardDeck' |
const fs = require("fs");
//to read the json file
const data = fs.readFileSync("../students.json", "utf-8");
//converting to js object
const obj = JSON.parse(data);
const getStudentByIndex = function (index) {
for (let i = 0; i < obj.students.length; i++) {
if (i === index) {
return obj.students[i];
}
... |
import React from 'react';
import { ListBox } from '../../ListBox';
describe('Select', () => {
const subject = props =>
global.mountStyled(
<ListBox {...props}>
<ListBox.Option value="option-1">Option 1</ListBox.Option>
<ListBox.Option value="option-2">Option 2</ListBox.Option>
</List... |
import Microcastle from '../../index.js';
import { createStore, combineReducers, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import I from 'immutable';
import thunk from 'redux-thunk';
import RelationEditor from './Relation';
const schema = {
team: {
onNew: sinon.spy((v) => P... |
/* Nastav si následující tři údaje podle svého vlastního uvážení. Číslo vyjadřuje intenzitu tréninku vydělenou deseti */
var nehrajici = 7, /* 70 % */
stridajici = 7, /* 70 % */
hrajici = 4; /* 40% */
var select = document.getElementsByTagName('select');
for(i in select) {
if( i % 2 == 0) continue;
if( selec... |
import React from "react";
function CardsExtension(props) {
return (
<div className="card">
<div className="cardInsider">
<div>
<div>
<img className="imageExtension" src={props.imgURL} width="100" alt="imageExt" />
<div className="activeDiv">Active</div>
... |
import React, {useEffect, Component} from 'react';
import {View, Text, ScrollView} from 'react-native';
import {Navigation} from 'react-native-navigation';
import { useSelector, useDispatch } from 'react-redux';
import styles from './styles';
import Comments from './comments';
import { Card, Button, Icon } from 'reac... |
var Pattern = require('../src/url-match')
module.exports = {
'pattern.match': {
'returns {} when matching simple route': function(test) {
var pattern = Pattern.generate("/foo")
test.deepEqual(pattern.match("/foo"), { namedParams: {}, queryParams: {}});
return test.done();
},
'returns ... |
$(function () {
var loadForm = function (event) {
var btn = $(this);
$.ajax({
url: btn.attr("data-url"),
type: 'get',
dataType: 'json',
beforeSend: function () {
$("#modal").modal("show");
},
success: function (data) {
... |
const cheerio = require("cheerio");
const request = require("request");
let matchdata = require("./batsman");
function getAllMatchLink(allMatchLink)
{
request(allMatchLink, function(error, response, data) { compute(data); } );
}
module.exports = getAllMatchLink;
function compute(html)
{
let mydoc = cheerio... |
import {postConstant} from '../Actions/constants';
const initialState = {
postDetails:[],
error:'',
message:'',
postRefresh:false,
loading:false,
singlePostLoader:false,
singlePost:{},
singlePostRefresh:false
}
const postReducer = (state = initialState,action)=>{
switch(action.type){
case... |
import React, {Fragment} from "react";
import {connect} from "react-redux";
import {addDrawPoints, addSlide, removeSlide, resetDrawPoints, setSlide} from "../../../../redux/actions";
import {withRouter} from "react-router-dom";
import Button from "react-bootstrap/Button";
import ButtonGroup from "react-bootstrap/Button... |
$(document).ready(function () {
$('.i-check').iCheck({
checkboxClass: 'icheckbox_quacol',
radioClass: 'icheckbox_quacol',
//increaseArea: '20%' // optional
});
var albumNameLength = parseInt($('#album-name').attr('maxlength'));
$('#album-name-char-counter').text(albumNameLength);
$('#album-na... |
#!/usr/bin/env node
const jscodeshiftExecutable = require.resolve(".bin/jscodeshift");
const path = require("path");
const execa = require("execa");
process.argv.shift();
process.argv.shift();
const args = [
"-t",
path.resolve(__dirname, "../transform.js"),
...process.argv
];
const result = execa.sync(jscodeshift... |
'use strict';
const { Router } = require('express');
const router = Router();
const User = require('./../models/user')
const Survey = require('./../models/survey');
const allLanguages = require('./../controllers/allLanguages');
const filters = ["All languages", ...allLanguages];
const middleware = require('./../contro... |
ricoApp.service('IndexedDb',function($q){
var db;
this.init = function(){
var defer =$q.defer();
if(db!=undefined){
defer.resolve(db);
};
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB || window.shimIndexedDB;
if (indexedDB==null){
... |
import { useEffect } from 'react'
const useDocumentTitle = (title) => {
useEffect(() => {
// Check that the window and document are defined
if (typeof window !== 'undefined' && document) {
// Update the document title using the browser API
document.title = title;
}
... |
const passport = require('passport');
const GitHubStrategy = require('passport-github2').Strategy;
const user = require('../../server/controllers/users.server.controller');
const config = require('../config');
module.exports = passport.use(new GitHubStrategy({
clientID: config.strategies.github.clientID,
... |
import {playMode} from 'common/js/config'
import {loadStorage} from '../common/js/cache'
const state = {
singer: {},
playing: false,
fullScreen: false,
playlist: [],
sequenceList: [],
mode: playMode.sequence,
currentIndex: -1,
disc: {},
topList: null,
searchHistory: loadStorage()
}
// 不需要currentSo... |
/*
* This file is for the Bretton Woods Dynamic Ski Map
* It will pull in a JSON file and load up the open / closed trails onto
* an image displayed using HTML.
*
* File created: 1/28/2016 12:30PM EST
* Last edited: 1/28/2016 12:30PM EST
* Created by: Jason Downing
*
*/
var ski_data;
/*
Global co... |
"use strict"
import React from 'react';
import {
Well,
Panel,
FormControl,
FormGroup,
ControlLabel,
Button
} from 'react-bootstrap';
import {connect} from 'react-redux';
import {findDOMNode} from 'react-dom';
import {bindActionCreators} from 'redux';
import {postBooks} from '../../actions/bookActions';
c... |
import {TransformService} from "./transform.service";
import {add} from "./addList";
import * as handlerbtn from './handlerbtn';
export class Search {
constructor(query) {
this.query = query;
}
Createtodo(user) {
axios.post(this.query, JSON.stringify(user))
.then(funct... |
export const GET_TOPICS = "GET_TOPICS"
export const CHANGE_TAB = "CHANGE_TAB"
export const SIGN_IN = "CHANGE_SIGN"
export const SIGN_OUT = "SIGN_OUT"
export const GET_TOPIC = "GET_TOPIC"
export const CLICK_LIKE = "CLICK_LIKE"
export const CHANGE_TOPIC = "CHANGE_TOPIC"
export const CREATE_TEXT = "CREATE_TEXT"
export con... |
import React, { Component } from 'react';
import {StyleSheet, Platform, Dimensions} from 'react-native';
import {
View,
Button,
Text,
TouchableOpacity,
TextInput,
AsyncStorage
} from "react-native";
import LocalStore from '../LocalStore'
import {User} from "./User";
import LoginAction from "./Lo... |
/*
* @lc app=leetcode id=210 lang=javascript
*
* [210] Course Schedule II
*/
// @lc code=start
/**
* @param {number} numCourses
* @param {number[][]} prerequisites
* @return {number[]}
*/
var findOrder = function (numCourses, prerequisites) {
const map = {};
function ensure(i) {
if (!m... |
languages['ger']['head'] = 'NYANJA CAT!'
languages['trk']['head'] = ' NYANJA CAT!'
languages['jpn']['head'] = 'ニャンジャ語の猫!'
languages['rom']['head'] = 'PISICA NYANJA!'
languages['eng']['head'] = 'NYANINJA!'
languages['esp']['head'] = '¡NYANJA CAT!'
languages['frn']['head'] = 'NYANJA CAT!'
languages['cat']['head'] = 'NYIA... |
var startTime = Date.now();
console.log(startTime);
var newDate = new Date();
console.log(newDate);
console.log(newDate.toString());
var date = new Date(2015, 4, 11, 12, 10, 20, 50);
console.log(date);
console.log(date.getYear());
console.log(date.getFullYear());
console.log(date.getMonth());
console.log(date.getDate... |
//////////////////////////////////////
//Required
//////////////////////////////////////
var gulp = require('gulp');
// var util = require('gulp-util');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var plumber = require('gulp-plumber');
var autoprefixer = require('gulp-autoprefixer');
var j... |
// FireDetails.js
import React, { Component, Suspense } from 'react';
import {
Badge,
Col,
ListGroup,
ListGroupItem,
Row
} from 'reactstrap';
import Moment from 'react-moment';
class FireDetails extends Component {
loading = () => <div className="animated fadeIn pt-1 text-center">Loading...</div>
rende... |
import * as types from './mutation-types'
export default {
[types.SIGN_IN](state, info) {
if (info.username === 'music' && info.password === '123456') {
state.signin = true;
state.userName = info.username;
} else {
console.log('User name or password error, please ... |
// export function
export const getParameterByName = function ( name ) {
name = name.replace( /[\[]/, "\\\[" ).replace( /[\]]/, "\\\]" );
var regexS = "[\\?&]" + name + "=([^&#]*)", regex = new RegExp( regexS ), results = regex
.exec( window.location.href );
if ( results == null ) {
return "";
} e... |
const Discord = require("discord.js");
const db = require('quick.db');
module.exports = {
name: "setprefix",
aliases: ["sp"],
usage: "Setprefix <New Prefix>",
description: "Set The New Bot Prefix!",
run: async (client, message, args) => {
if (!message.member.hasPermission("MANAGE_GUILD")) {
... |
import Component from '@glimmer/component';
import debugLogger from 'ember-debug-logger';
import { action } from '@ember/object';
export default class TwyrButtonComponent extends Component {
// #region Private Attributes
debug = debugLogger('twyr-button');
_element = null;
// #endregion
// #region Constructor
... |
"use strict";
var _ = require('underscore'),
React = require('react'),
Playlist = require('views/Playlist'),
VideoPlayer = require('views/VideoPlayer'),
DataModel = require('model/Datamodel');
var MainUI = React.createClass({
displayName: 'MainUI',
getInitialState: function() {
return {
currentStory: 0,
... |
import React, { Component, Fragment } from 'react';
export default class YearSelect extends Component {
constructor(props) {
super(props);
this.state = {
showSelector: this.props.showSelector
};
}
render() {
const { showSelector } = this.state;
... |
const fileUpload = require('express-fileupload');
const { config } = require('../config');
const uploadFile = fileUpload({
useTempFiles: true,
tempFileDir: config.files.storagePath
});
exports.uploadFile = uploadFile;
|
import React from 'react'
const MenuIcon = (props) => {
const { toggleMenu, navIsVisible } = props;
function handleClick() {
toggleMenu(prev => {
return !prev
})
}
return (
<div role="button" tabIndex="0" onKeyUp={e => {
if (e.key === "Enter") {
... |
'use strict';
const mongodbUrl = 'mongodb://127.0.0.1:27017';
const mongodbDbName = 'fe-cli';
const mongodbCollectionName = 'project';
module.exports = {
mongodbUrl,
mongodbDbName,
mongodbCollectionName,
};
|
var express= require ('express');
var app = express();
var path = require('path');
var server=require('http').createServer(app);
var io=require('socket.io').listen(server);
var redis=require('redis');
var redisclient=redis.createClient('6379','127.0.0.1');
// redisclient.on("error", function(error) {
// console.... |
import React, { Component } from 'react'
import { connect } from 'react-redux'
import Login from './Login.js'
class Dashboard extends Component {
render() {
const { users, authedUser } = this.props;
return (
<div>
{authedUser === null ?
<div>
<Login />
</d... |
import React from "react"
import classNames from "classnames"
import PropTypes from "prop-types"
import "./filters.scss"
function Filters({ values, filters, type, onFilterChange }) {
return (
<div className="filters">
<p className="title">Launch Year</p>
<hr />
<div className="inline-wrapper">... |
//creates an aobject to keep track of values
const Calculator = {
Display_Value: '0', //this displays 0 on the screen
First_Operand: null, //first operand, null for now
Wait_Second_Operand: false, //checks if second operand has been input
operator: null, ... |
import { useState } from 'react'
import Resume from '../About/Resume.pdf'
import "./style.css"
export default function About({ refName }) {
const [readMore, setReadMore] = useState(false);
const linkName = readMore ? '- Fewer Details' : '+ More Details'
const extraInfo = <><p id="try">
<ul styl... |
angular.module('cadastrarEventoCtrls', []).controller('cadastrarEventoCtrl', ['$scope', '$state', '$stateParams', 'eventoService',
'$cordovaImagePicker',
function ($scope, $state, $stateParams, eventoService, $cordovaImagePicker) {
$scope.imgURL = document.getElementById("files");
//INICIO DO UPL... |
// Закусочная
// Сеть фастфудов предлагает несколько видов гамбургеров:
// маленький (50 тугриков, 20 калорий)
// большой (100 тугриков, 40 калорий)
// Гамбургер может быть с одним из нескольких видов начинок:
// сыром (+ 10 тугриков, + 20 калорий)
// салатом (+ 20 тугриков, + 5 калорий)
// картофелем (+ 15 тугрико... |
var gulp = require('gulp');
var map = require('map-stream');
// https://github.com/jeremyfa/yaml.js#use-with-nodejs
var YAML = require('yamljs');
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require(... |
//http://www.codewars.com/kata/prefill-an-array
function prefill(number, v) {
var array = [];
if (number === 0 || number === "0")
return [];
else if (typeof number == "string") {
if (isNaN(parseInt(number)) || isNaN(number))
throw new TypeError(number + " is invalid");
a... |
import React, { Component } from 'react'
import { Navbar, Nav, Carousel } from 'react-bootstrap';
import Navbartop from './Navbartop'
import ImageSlider from './ImageSlider'
import ScrollDown from './Scrolldown'
import MainMenu from './MainMenu'
export class Homepage extends Component {
render() {
return ... |
test('class10', () => {
class myClass {
constructor() {
this._test = null
}
set test (value) {
this._test = value
}
}
const instance = new myClass()
instance.test = 'coucou, tu veux voir mon code ?'
console.log(instance._test)
}) |
import React from 'react'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import Sidebar from '../../components/Sidebar'
import GuessBox from '../../components/GuessBox'
import Ranking from '../../components/Ranking'
import Panel from '../../components/Panel'
import ToolsSidebar from ... |
import React, { useState } from "react";
import { useLocation } from "react-router-dom";
// ? Components
import { Control } from "./control/Control";
import { Filter } from "./Filter";
import { Logo } from "../../assets/icons/Logo"
// ? Styles
import "./styles/header.css";
export const Header = ({ authorized, jogs, ... |
const administratorUI = ((SET) => {
let count = 0
return {
resetCount: () => {
count = 0
},
renderDetail: data => {
let no = 1;
let html = `
<div class="row">
<div class="col-md-12">
<d... |
const request = require('request');
const mysql = require('mysql');
const { con } = require('../util/db');
exports.startPage = function (req, res) {
let weatherList = {};
weatherList.data = { found: false };
res.render('index.ejs', { weatherList: weatherList });
};
exports.getApiData = function (req, res... |
"use strict";
// there are 7 types of data variables here we tried a few
const bool = true;
const num = 42;
const str = "Peter";
const obj = {
cats: 2,
cars: 1,
};
const nothing = null;
let undf;
const symbol = Symbol("symbol");
console.log(bool);
console.log(num);
console.log(obj);
console.log(symbol);
// thats ho... |
var mongoose = require("mongoose");
const Joi = require("@hapi/joi"); //for validating data in mongoose
const modelSchema = new mongoose.Schema(
{
text: String,
roomId: {
type: mongoose.Schema.Types.ObjectId,
},
user: {
type: mongoose.Schema.Types.ObjectId,
ref: "User",
},
u... |
import React from 'react'
//Component for each album card
export const Albums = (props) => {
return (
<div className="cover-container">
<img src={props.url} alt={props.name} className='album-art'></img>
<div className="opacity-layer"></div>
<div className="icon-container">
... |
let aesAlgo = {
name: "AES-CTR",
length: 128,
counter: new Uint8Array(16),
// publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
// hash: {name: "SHA-256"}, //can be "SHA-1", "SHA-256", "SHA-384", or "SHA-512"
};
let rsaAlgo = {
// with RSA-OAEP encoded message length must not exceed key length... |
let x = ""
var laugh = function(num) {
for(let i = 0 ; i < num ; i++){
x = x + "ha"
}
return x;
}
console.log(laugh(3));
|
//CLIENT-SIDE JAVASCRIPT
$(function() {
// compile blog template
var template = _.template($('#old-blog-posts-template').html());
//get all archived blog posts
var all = function (){
$.get('/api/microblogs', function (data) {
var allBlogPosts = data;
console.log(allBlogPosts);
//iterate ... |
function Monster(stats) {
// this object will be available to the returned monster object.
var monster = {
damage: stats.damage,
health: stats.health,
blockChance: stats.block,
description: stats.description,
name: stats.name
};
// Ret... |
define(['Angular', 'Directive'], function (ng, Directive) {
'use strict';
return ng.module('angularControllers', []);
}); |
// Javascript functionality
// Linking HTML file to ApplicationController.java file
var game;
function display(game){
console.log(game);
$( 'columnOfCards .cardLocation' ).html("");
$.each(game.cols[0], function(key, val) {
$( '#c1 .l'+key ).html(val.value + " of " + val.suit);
});
$.each... |
import React, {useContext} from 'react'
import { NavLink } from 'react-router-dom'
import { AuthContext } from '../context/auth'
import Logout from './Logout'
const Header = () => {
const {user} = useContext(AuthContext)
return (
<header>
<nav className='container nav-bar'>
... |
"use strict";
const CLIEngine = require( "eslint" ).CLIEngine;
const assert = require( "assert" );
const glob = require( "glob" );
const _ = require( "lodash" );
let cli = new CLIEngine( {
cwd: __dirname,
} );
describe( "ESLint Validation", function () {
describe( "Pass Tests (Results should have no warnings ... |
const { TBL_USERS } = require('../migrations/20191127122918_init')
const { USERS } = require('./data/users')
exports.seed = async function(knex) {
await knex(TBL_USERS).del()
await knex(TBL_USERS).insert(USERS)
}
|
import Root from './src/containers/Root';
import { configureStore } from './src/store/configureStore';
import { InitDb } from './src/utils/db';
import { setUseLocalDataApi, setWebApp, setInitialToken} from './src/utils/env';
export { Root, configureStore, InitDb, setUseLocalDataApi, setWebApp, setInitialToken };
|
import React from 'react'
import { connect } from 'react-redux'
import styles from './styles.module.scss'
import {
addIndex,
reduce,
find,
} from 'ramda'
const is = (index, current) =>
addIndex(reduce)(
(highlight, ind, i) => highlight && (index[i] === ind),
true,
current
)
const high... |
import {
ADD_EMP,
GET_EMP,
DELETE_EMP,
UPDATE_EMP,
SET_CURRENT_EMP,
CLEAR_CURRENT_EMP,
FILTER_EMP,
CLEAR_FILTER_EMP,
SET_ALERT,
CLEAR_ALERT,
} from "./actions";
export default (state, action) => {
switch (action.type) {
case GET_EMP:
return{
...state,
... |
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import request from 'superagent';
import { Button, Form, Table } from 'reactstrap';
export default class MikanTable extends React.Component {
constructor(props) {
super(props);
this.state = {
items: []
};
}
componentWi... |
import React from 'react';
import { Layout } from 'element-react';
import SlideMenu from './menu/'
import Headers from './header/'
export default class Admin extends React.Component{
render () {
return (
<Layout.Row>
<Layout.Col span="2" className="slide-menu">
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.