text stringlengths 7 3.69M |
|---|
function displayElements(isLoggedIn) {
if (isLoggedIn) {
jQuery("#profile").show();
jQuery("#login").hide();
jQuery(".mynav").show();
jQuery("#fb-logout").show();
jQuery("#posts").show();
} else {
jQuery("#profile").hide();
jQuery("#login").show();
... |
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b)... |
/* eslint-disable react/prop-types */
/* eslint-disable react/require-default-props */
import React from 'react';
import PropTypes from 'prop-types';
import Icon from '../icon/Icon';
import ShimmerEffect from '../shimmerEffect/ShimmerEffect';
import { NoAnimationFlex } from '../shimmerEffect/NoAnimationContainer';
impo... |
const log = require("metalogger")(); // eslint-disable-line no-unused-vars
const _ = require("lodash");
const formats = {
"hal" : "application/hal+json",
"siren" : "application/vnd.siren+json",
"coljson" : "application/vnd.collection+json",
"uber" : "application/vnd.uber+json",
"jsonapi" : "application/vnd... |
import React from 'react';
const VideoListItem = (props) => {
const { snippet } = props.data;
return (
<div style={styles.elem} onClick={() => props.onVideoSelect(props.data)}>
<img src={snippet.thumbnails.default.url} alt="thumbnail" />
<div style={styles.text}>
<h3>{snippet.title}</h3>
<p>{snipp... |
;(function(){
//设置foot下的当前时间
var nowtime=new Date();
var nowyear=nowtime.getFullYear();
$(".nowtime").html(nowyear);
// 点击视频
$(".video_play").click(function(){
$(this).next().show();
var This=$(this)
var srcNew=$(this).next().find("iframe").attr("_src");
$(this).next().find("iframe").attr("src",srcNew);... |
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { createPropTypes } from '@styled-system/prop-types';
import { maxWidth } from 'styled-system';
import { Box } from '../Box';
const StyledMedia = styled(Box)`
pointer-events: none;
`;
const Media = React.fo... |
/**
* @file MarqueeTable.js
* @author liangxiaojun
*/
import React, {useMemo, useState, useCallback, useEffect} from 'react';
import PropTypes from 'prop-types';
// Components
import {Table} from 'antd';
// Styles
import 'scss/marqueeTable/MarqueeTable.scss';
function MarqueeTable({data, pageSize, interval}) {
... |
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const runSchema = new Schema({
time: {
start: Date,
setup: String,
duration: String,
end: Date,
},
name: String,
runners: [String],
category: String,
});
module.exports = mongoose.model("run", runSchema);
|
SingleCycleForPaying = React.createClass({
mixins: [ReactMeteorData],
getMeteorData: function() {
return {
thisCycle: Cycles.findOne({_id: this.props.thisID}),
};
},
enterBillList: function() {
Meteor.call("setModeAndEditID", "cyclePayList", this.props.thisID);
Meteor.call("generateCyclePa... |
/**
* Objet classique
*/
// // Première moto
// var moto_1 = {
// color : 'black',
// speed : 0,
// accelerate : function()
// {
// this.speed += 1;
// }
// };
// // Deuxième moto
// var moto_2 = {
// color : 'red',
// speed : 0,
// accelerate : function()
// {
// this.speed += 1;
// }
// };
/**
* O... |
function directors (films) {
var obj = {};
films.results.forEach( function ( element) {
var director = element.director;
if (! obj[director]) {
obj[director] = {name: element.director, films: [ element.title]};
} else {
obj[director].films.push( element.title);
}
});
var... |
import {
StyleSheet,
View
} from 'react-native';
import React, { Component } from 'react'
import {Calendar} from 'react-native-calendars';
class CalendarComponent extends Component {
constructor(props) {
super(props);
this.setMarkedDates = this.setMarkedDates.bind(this);
this.state = {
testI... |
function $$(id) {
return $("#" + id);
}
var YiBaDate = {
Data: {
ddlYear: null,
ddlMonth: null,
ddlDay: null,
MonthDay: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
},
///---------下拉框start---------
LoadDropDownList: function (def) {
var defYear = null, de... |
const romanToIntMap = {
I: 1,
IV: 4,
V: 5,
IX: 9,
X: 10,
XL: 40,
L: 50,
XC: 90,
C: 100,
CD: 400,
D: 500,
CM: 900,
M: 1000
};
const romanSymbols = Object.keys(romanToIntMap);
// comment: it's weird that Romans didn't write 990 XM instead of CMXC
module.exports = RomanNumber;
function RomanNumber(v... |
'use strict';
/**
* 该模块是根据前面的模块的摸索整理的出来的自己的一个写法,后面的模块以该模块为模板,但是会修改部分方法或者属性名称。
*/
app.controller('busAtomController',['$rootScope','$scope','$state','$timeout','$http',function($rootScope,$scope,$state,$timeout,$http){
$scope.busAtomIds = [];
/**
* 模块路由路径统一管理
*/
$scope.state = {
list:"app.b... |
'use strict';
var array = [].constructor;
/**
* @ngdoc function
* @name angular.toJson
* @function
*
* @description
* Serializes input into a JSON-formatted string.
*
* @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.
* @param {boolean=} pretty If set to true, the JSON output wi... |
'use strict'
//prueba con var
var numero = 40
console.log(numero)
if(true){
var numero = 50
console.log(numero)
}
console.log(numero)
//prueba con let
var texto ="curso JS"
console.log(texto)
if(true){
let texto = "curso laravel 5"
console.log(texto)
}
console.log(texto) |
window.onload = function(){
//返回顶部的隐藏和显示效果
var oTop=document.getElementById('top');
document.onscroll=function(){
var top=document.documentElement.scrollTop;
if(top==0){
oTop.style.display='none';
}else if(top>500){
oTop.style.display='block';
oTop.style.position='fixed';
}else{
oTop.style.positi... |
import React, { useState, useContext } from 'react'
import M from 'materialize-css/dist/js/materialize.min.js'
import MealContext from '../../context/meal/mealContext'
const AddMealModal = () => {
const mealContext = useContext(MealContext)
const { addMeal } = mealContext
const [name, setName] = useStat... |
/*jshint esversion: 6 */
var should = require('should');
var binarySearch = require('./binarySearchArray.js');
var sinon = require('sinon');
describe('binarySearch', function() {
it('should exist', function() {
should.exist(binarySearch);
});
it('should be a function', function() {
binarySearch.should.... |
import { assoc } from "ramda";
const navigate = (page, params = {}) =>
model => Object.assign(model, ({ page: Object.assign({ params }, page) }));
export const transforms = {
pleaseWaitBegin: assoc("operationInProgress", true),
pleaseWaitEnd: assoc("operationInProgress", false),
uuid: uuid => assoc("uuid", ... |
// 挂载三部曲
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
// 引入公共样式
import './style/reset.scss';
import './style/style.scss';
// 引入仓库
import store from './store';
// 类似mixins, 对各组件提供仓库实例
import { Provider } from 'react-redux';
ReactDOM.render(
<Provider store={store}>
<App /... |
import React, { Component } from 'react';
export default class Header extends Component {
render() {
return (
<div className="nav">
<h1 className="navbar-brand">Health<i className="fas fa-arrows-alt-h"></i>Span</h1>
</div>
);
}
} |
import {graphql} from 'graphql';
import authSchema from '@/api-server/graphql-schemas/auth-schema';
import authResolvers from '@/api-server/resolvers/auth-resolvers';
import adminSchema from '@/api-server/graphql-schemas/admin-schema';
import adminResolvers from '@/api-server/resolvers/admin-resolvers';
import {connect... |
import React from 'react';
import Router from 'react-router';
var RouteHandler = Router.RouteHandler;
export class Top extends React.Component {
render() {
return (
<RouteHandler routerState={this.props.routerState} />
);
}
};
|
function decode(value) {
return value.replace(/&/g, '&')
.replace(/"/g, '"')
.replace(/'/g, "'")
.replace(/</g, '<')
.replace(/>/g, '>');
}
function fnQToArr(q) {
q = decodeURIComponent((q).replace(/\+/g, '%20'));
arr = {};
var a = q.split(/&(?!amp;)/g);
for (x in a) {
... |
/**
* Title: Not found handler
* Description: Return 404 Not found response
* Author: Samin Yasar
* Date: 24/October/2021
*/
// Dependencies
// Module scaffolding
const notFoundHandler = {};
// Defination of handle function
notFoundHandler.handle = (requestProps, callback) => {
console.log(req... |
var vt = vt = vt || {};
vt.LogicClass_500592 = cc.Class.extend({
m_view: null,
ctor: function () {},
setTableView: function (view) {
this.m_view = view;
},
refreshTableView: function () {
//this.m_view.reloadData();
},
setVar: function (key, value) {
this[key] = value;
},
run: function (context, t... |
/* Un objeto que representa a los elementos pintados. Recibe un sprite que tendra la
imagen que lo representa, ademas de los parametros comunes x, y, ancho y alto*/
var Elemento_pintado = function (sprite, x, y, ancho, alto) {
this.sprite = sprite;
this.x = x;
this.y = y;
this.ancho = ancho;
this.alto ... |
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import './home.css';
import '../../service/movie-box-api';
import { getGenres, searchMovies } from '../../service/movie-box-api';
import MovieTile from '../movie-tile/movie-tile';
class Home exte... |
/*
Shhh, this class is a controller. Don't tell anyone.
It contains the logic for events, loops, etc.
This provides the interface for console input.
How do ya feel? HOW?!?!?!?!
*/
if (!window.model)
model = new Object();
model.AirChat = function AirChat(Communicator) {
this.inheritFrom = utils.EventDispatc... |
// using factory function can reduse un nesasry complexcity
//also if we use class base aproch some times we have to deal with this
// or bind.(this)/
// 0.00004 factory functions
//0.00002 class
const Dog = () => {
let sound = "woof";
return {
bark: () => console.log(sound)
};
};
let boxer = Dog();
cons... |
//acquiring the express library
const express = require("express");
//acquiring the functionality of express.Router
const router = express.Router();
router.use("/posts", require("./posts"));
module.exports = router;
|
/*
* Contains 2 start functions, one for accessing a page with an http pw, and the other without it
*
* @package: Blueacorn Start.js
* @version: 1.0
* @Author: Luke Fitzgerald
* @Copyright: Copyright 2015-07-12 13:09:04 Blue Acorn, Inc.
*/
'use strict';
function Start() {
this.start = function(url) {
casper.start... |
import React from 'react'
const XSVG = ({ className, style }) => (
<div style={style} className={`x-svg ${className}`}>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.... |
// ==UserScript==
// @name example-twitter-oauth
// @description Example UserScript for jsTwitterOAuth
// @version 0.1.3
// @namespace https://furyutei.github.io/jsTwitterOAuth
// @author furyu
// @include https://furyutei.github.io/jsTwitterOAuth/example/*
// @include ... |
/**
* Created by dzianismitrakhovich on 22.02.17.
*/
$(function () {
$('#course-add-form').validate({
rules:{
//the course name field is case-insensetive and must contain only letters. Minimum length 3 chars,
// max length 6 chars
courseName:{
required... |
window.$ = window.jQuery = require('jquery/dist/jquery');
require('popper.js/dist/umd/popper');
require('bootstrap/dist/js/bootstrap');
// Navigation
jQuery(function ($) {
$(".hamburger").click(function () {
$(".navigation").toggleClass("open");
})
});
// Smooth Scroll
$(".ar-menu__item-list").on('click', fun... |
$('.owl-carousel').owlCarousel({
loop:true,
margin:10,
nav:false,
responsive:{
0:{
items:1
},
600:{
items:3
},
1000:{
items:5
}
}
})
var owl = $('.owl-carousel');
owl.owlCarousel();
// Go to the next item
$('.custom... |
var User = require('./app/models/user');
var AdminUser = require('./app/models/adminUser');
var JWTUserId = require('./app/models/JWTUserId');
var JWTAdminUserId = require('./app/models/JWTAdminUserId');
var Item = require('./app/models/item');
var News = require('./app/models/news');
var Order = require('./app/models/... |
/* eslint-disable complexity */
const split = arr => {
const middle = Math.floor(arr.length - 1 / 2);
return [arr.slice(0, middle), arr.slice(middle)];
};
const merge = (
arr1,
arr2,
sortFunc = function(a, b) {
return a - b;
}
) => {
const result = [];
while (arr1.length > 0 && arr2.length > 0) {
... |
import React, { Component } from "react";
import "./sass/main.css";
// import Weather from './components/Weather';
import Form from "./components/Form";
import WeatherContainer from "./components/WeatherContainer";
import AlertComponent from "./components/AlertComponent";
const authToken = "bd3be3a2a884168866b96b0f812... |
"use strict";
exports.DefaultSizes = void 0;
var DefaultSizes = {
allDayPanelHeight: 25
};
exports.DefaultSizes = DefaultSizes; |
const util = require('./../../../utils/util.js');
const http = require("./../../../utils/http.js");
const app = getApp();
Page({
data: {
image:'tmp/wx46d5674c81153f30.o6zAJs3oh85Zb1lJE8oWix57vny0.2b862a6493fd893b7fbc37bd8dfd424f.jpg',
baseImageUrl: app.globalData.imageUrl,
messageList:[],
pageSize: 10,
... |
import { getTheme } from '@fluentui/react'
import './contactStyle.css'
import HeaderPage from '../HeaderPage'
import React from 'react';
import * as $ from 'jquery';
import instagram from '../img/instagram.png'
import gmail from '../img/gmail.png'
import {isMobile} from 'react-device-detect';
import FooterPage from '..... |
const fs = require('fs')
const getStream = require('get-stream').array
const csvParse = require('csv-parser')
async function parse () {
const geoRows = await getStream(
fs.createReadStream('./addresses.geocoded.csv')
.pipe(csvParse())
)
let rows = require(`${__dirname}/../actors.json`)
rows = rows.s... |
// console.log("this is both sides");
Message = new Mongo.Collection("message");
// sampleMessages = [
// {text:"hi text1 (m1)",from:"db"},
// {text:"hi text2 (m2)",from:"db"},
// {text:"hi text3 (m3)",from:"db"},
// {text:"hi text4 (m4)",from:"db"}
// ]
if (Meteor.isClient){
// console.log("this is client");... |
import sSettings from'./Settings.module.css';
const Settings =()=>
{
return(
<div>
Settings
</div>
);
}
export default Settings; |
/* eslint-disable consistent-return */
import { Meteor } from 'meteor/meteor';
const getUpdatedUserSettings = (existingUserSettings, newSetting) => {
try {
const userSettings = [...existingUserSettings];
const userSettingToUpdate = userSettings.find(
(settingOnUser) => settingOnUser._id === newSetting... |
/*
Here is the exercise on working on the remaining bom method
Location , Navigator , screen , Window
Follow the Instruction on the comments
1. Declare the UI Variables for selecting on the elements
2. Use the innerHTML property to display the result on each element
3. The Text of the elements will lead you ... |
import Ember from 'ember';
const { service } = Ember.inject;
export default Ember.Component.extend({
session: service('session'),
suggested_movies: [],
actions: {
createMovie: function (model) {
this.sendAction('createMovie', model);
this.set('newMovie.title', null);
this.set('newMovie.d... |
function $(id){return document.getElementById(id);}
var str;
var result;
function display(str0) //显示到文本框
{
str = document.getElementById("text");
str.value = str.value + str0;
}
function equals() //等于
{
str = document.getElementById("text");
process0 = str.value;
process = "process"+"="+str.value.replace('+','$... |
import React from 'react';
import {Button} from 'reactstrap';
import Check from '@material-ui/icons/CheckCircle'
const ItemApproveBudget = (props) => {
let succesBtn = null;
let dangerBtn = null;
if(props.active === true){
succesBtn = 'btn btn-sm mr-2 btn-success'
dangerBtn = 'btn btn-sm m... |
const express = require('express');
const Posts = require('./routes/posts');
const comments = require('./routes/comments');
const Tags =require('./routes/tags');
const app = express();
const port = 8000;
app.use('/api/comments', comments);
app.use('/api/posts', Posts);
app.use('/api/tags', Tags);
app.listen(port, (er... |
import { fork } from 'redux-saga/effects';
import watchUserLoggin from './login/loginWatcher';
import watchUserAuthentication from './register/watcher';
import watchProjectsSagas from './projects/projectWatcher';
import watchUsersSaga from './users/usersWatcher';
import watchTaskSaga from './task/taskWatcher';
export... |
import { Delegate } from 'dom-delegate';
let delegator = null;
export default function getDelegator() {
if (!delegator) {
delegator = new Delegate(document.body);
}
return delegator;
}
|
$(document).ready(function () {
// # Function from BoutiqueAdo mini project
$('#sort-selector').change(function () {
var selector = $(this);
var currentUrl = new URL(window.location);
var selectedVal = selector.val();
if (selectedVal != "reset") {
var sort = selectedVal... |
/**
* Created by rhett on 5/20/14.
*/
angular.module('2048Game')
.factory('FieldMatrix', [function () {
"use strict";
var defaultOptions = {
rows: 4,
cols: 4,
tilesAtInit: 2,
insertableNumbers: [2, 4],
winningNumber: 2048
};
... |
export default {
name: 'bridge',
/*
* 注册桥接
*/
bridgeFun (callback) {
var ua = navigator.userAgent.toLowerCase()
if (ua.indexOf('zebra') > -1) {
function setupWebViewJavascriptBridge (callback) {
if (ua.indexOf('android') > -1) {
if (window.WebViewJavascriptBridge) {
... |
$(document).ready(function() {
//Rerender elements after server response
const ul = $("#group-list");
const rerender = (groupList) => {
let li = '';
groupList.map((student) => {
li += `<li data-id="${student.id}">
<div class="student-name">
... |
import React, { useEffect } from 'react'
import {useDispatch, useSelector} from'react-redux'
import {getSearchFilm} from '../../actions/TMDBapi'
import {useHistory, useParams} from 'react-router-dom'
import moment from 'moment'
const Search = () => {
let dispatch = useDispatch()
let history = useHistory()
let {q... |
/*$Rev: 2692 $ Revision number must be in the first line of the file in exactly this format*/
/*
Copyright (C) 2009 Innectus Corporation
All rights reserved
This code is proprietary property of Innectus Corporation. Unauthorized
use, distribution or reproduction is prohibited.
$HeadURL: http://info.in... |
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import Timestamp from 'react-timestamp';
import { FloatingCard, CardHeader, Picker, BigHeader, Filter, PrimaryButton, Icon } from '../elements';
import { colors } from '../utils';
const RepoBranches = ({ branches }) ... |
import React, { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import ProductsPage from "../ProductsPage";
import { fetchBoards } from "../../actions/boards";
import { PAGE_TITLE, CATEGORY } from "./store";
const Boards = () => {
const state = useSelector((state) => state.boards... |
var React = require('react');
var FilterActions = require('../actions/filterActions');
var Filters = React.createClass({
nameChanged: function(e) {
FilterActions.updateLocation(e.target.value);
},
currentName: function () {
return this.props.filterParams.username;
},
updateParams: function(username) ... |
angular.module('techs', []);
|
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from 'material-ui/styles';
import Card, { CardHeader, CardMedia, CardContent, CardActions } from 'material-ui/Card';
import Avatar from 'material-ui/Avatar';
import IconButton from 'material-ui/IconButton';
import Typography from 'mate... |
import * as domains from './domain';
const axios = require('axios');
export default {
sendSignUp(user) {
const instWithCred = axios.create({
baseURL: domains.AUTH_REQUESTS,
});
return instWithCred.post('/', user);
},
sendLogin(login, password) {
const token = JSON.parse(localStorage.getIte... |
import React from 'react';
import {View, StyleSheet, Text, ListView} from 'react-native';
import {connect} from "react-redux";
import {login} from "../Redux/Actions/actionCreator";
import CardItem from "../Components/Home/CardItem"
import Header from "../Components/Header"
import Colors from "../Constants/Colors"
impor... |
const db = require('../../db/dbConfig')
module.exports = {
addUser,
getUsers,
findUserBy,
findUserById,
addPoke,
getTeam
}
async function addUser(user) {
const [id] = await db('users')
.insert(user)
return findUserById(id)
};
function getUsers() {
return db('users')
};
f... |
import React, { Component } from "react";
import { LoginInfoContext } from "../contexts/logingInfoContextProvider";
export default class Menu extends Component {
static contextType = LoginInfoContext;
changeLogin = () => {
if (this.context.isLogin) {
this.context.logout();
} else {
this.contex... |
import React from "react";
// import assets
import k2award from "../../../assets/images/k2-image.png";
import fosterCare from "../../../assets/images/fc2s.png";
import mra from "../../../assets/images/mra.png";
const CaseStudy = () => {
return (
<div className="container">
<div className="case-study">
... |
import styled from "styled-components";
import { useForm, ValidationError } from '@formspree/react';
import Grid from "react-fast-grid";
import { motion } from 'framer-motion'
import { pageAnimation } from '../animations'
const ContactForm = () => {
const [state, handleSubmit] = useForm(process.env.REACT_APP_CONT... |
var Material = require('./KTMaterial');
var Matrix4 = require('./KTMatrix4');
var KT = require('./KTMain');
function MaterialBasic(textureMap, color){
this.__ktmaterial = true;
var material = new Material({
textureMap: textureMap,
color: color,
shader: KT.shaders.basic
});
this.textureMap = material.text... |
'use strict';
var models = require('../models'),
errors = require('restify-errors');
/* Collection of Users */
exports.getUsers = function(req, res, next) {
var params = req.pms;
params.attributes = req.pms.attributes || {
exclude: ['password', 'loginAttempts', 'createdAt', 'updatedAt']
};
models.User... |
const socket = io()
function createCanvas(width, height, set2dTransform = true) {
const ratio = Math.ceil(window.devicePixelRatio);
const canvas = document.createElement('canvas');
canvas.style.width= `${width}px`;
canvas.style.height=`${height}px`;
canvas.width = width * ratio;
canvas.height ... |
import React, { Component } from "react";
import "./browseContent.css";
import JobResults from "./JobResults";
import ServiceResults from "./ServiceResults";
import { Link } from "react-router-dom";
export default class browseContent extends Component {
state = {
content: this.props.content,
type:... |
import _ from 'lodash';
import AccessibilityModule from '@curriculumassociates/createjs-accessibility';
export default class Button extends createjs.Container {
constructor(options, tabIndex, callBack = _.noop) {
super();
_.bindAll(this, '_onFocus', '_onBlur', '_onClick');
this.callBack = callBack;
t... |
var config = {
apiKey: "AIzaSyAw3THBR3n9vPzYhEH0vODRVlYFwe8UUfE",
authDomain: "la-sierra-cambio-social.firebaseapp.com",
databaseURL: "https://la-sierra-cambio-social.firebaseio.com",
projectId: "la-sierra-cambio-social",
storageBucket: "la-sierra-cambio-social.appspot.com",
messagingSenderId: "... |
const express = require('express');
const router = express.Router();
const mongoose = require('mongoose');
const bcrypt = require('bcrypt-nodejs');
const User = require('../models/user_model');
const jwt = require("jsonwebtoken");
const checkAuth = require('../middleware/check-auth');
// const exjwt = require('express... |
const Vote = require('../models/Vote');
const mongoose = require('mongoose');
const Post = require('../models/Post');
module.exports = {
addVote: async (req, res) => {
if (!req.query.parentId) {
return res.status(400).json({
error: {
message: 'Envie el id del padre del voto en los paramet... |
// This is the main.js file. Import global CSS and scripts here.
// The Client API can be used here. Learn more: gridsome.org/docs/client-api
import './tailwind.css'
import DefaultLayout from '~/layouts/Default.vue'
let config = {
apiKey: "AIzaSyB6YveWu381zxZJ2qg3y2VVWNmrC34SK0M",
authDomain: "toast-masters.firebas... |
describe("Tests for startJob function", function() {
it("Testing to see if 'startJob' function is defined", function() {
expect(startJob).toBeDefined();
});
//I am using military time so the numbers I pass through should reflect the number the user would use
it("Testing startJob to return 18 if... |
define(['jquery', 'tablesorter', 'highcharts'], function() {
var Top = function(url, container) {
$.get(url, function(data) {
container.html(data);
$("table").tablesorter();
});
}
return Top
});
|
import React from "react";
import db from "../db.json";
import styles from "../src/components/quiz.module.css";
import Widget from "../src/components/Widget.js";
import GitHubCorner from "../src/components/GitHubCorner.js";
import QuizBackground from "../src/components/QuizBackground.js";
import QuizContainer from "..... |
import React, { useRef, useState, useEffect } from "react"
import Layout from "../components/Layout/Layout"
import { Helmet } from "react-helmet"
import Scroll from "../components/Home/Scroll"
import Image from "gatsby-image"
import BackgroundImage from "gatsby-background-image"
import Navigation from "../components/Na... |
/**
* Copyright (c), 2013-2014 IMD - International Institute for Management Development, Switzerland.
*
* See the file license.txt for copying permission.
*/
define([
'Underscore',
'util/PubSub',
'util/Type',
'base/ListenerMgr'
], function (_, PubSub, Type, ListenerMgr) {
'use strict';
var... |
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { Query } from 'react-apollo';
import { GET_TODOS } from '../../models/gql/local';
import Todo from './Todo';
const getVisibleTodos = (todos, filter) => {
switch (filter) {
case 'SHOW_ALL'... |
import {
Link, Switch, Route
} from "react-router-dom";
function CocineroPage() {
return (
<div>
<h1>Menú del Cocinero</h1>
<ul>
<li>
<Link to="/cocinero/pedidosingresados">Pedidos Ingresados</Link>
</li>
<li>
<Link to="/cocinero/estadop... |
'use strict';
var React = require('react');
var Reflux = require('reflux');
var Router = require('react-router');
var UserRoleMixin = require('../../mixins/UserRoleMixin');
var SystemStateMixin = require('../../mixins/SystemStateMixin');
var Sidebar = require('./shared/Sidebar.jsx');
var ApprovalStatusFilter = requi... |
app.factory('StreamerQuery', ['$http', function($http) {
var StreamerQuery = {};
StreamerQuery.follows = [];
StreamerQuery.userToken = [];
StreamerQuery.accountQuery = [];
return {
queryStreamerData: function(streamerName) {
return $http.get('https://api.twitch.tv/kraken/channels/' + streamerName ... |
const express = require('express');
const router = express.Router();
const controller = require("../controllers/search")
const multer = require("multer")
router.use('/:lng?/search/:type?',multer().none(),controller.index);
module.exports = router; |
window.onload = function(){
var frame = document.createElement('iframe');
frame.src = 'https://crustyjew.github.io/ChromeExtensionBug/';
document.body.appendChild(frame);
window.addEventListener('message',function(e){
console.log("message received: " + JSON.stringify(e.data));
});
console.log('... |
import * as types from './mutation-types.js'
export default {
[types.INCREMENT_COUNT](state, payload){
payload.count++
},
[types.ADD_TO_CART](state, payload) {
payload.checked = true
state.cartList.push(payload)
}
}
|
import React from 'react'
import { List } from 'antd';
export default function CustomList(props){
return(
<List
itemLayout="horizontal"
dataSource={props.data}
renderItem={item => (
<List.Item>
<List.Item.Meta
title={<a href={item.link}>{item... |
/*
Basic JavaScript - Lesson 35: Use Bracket Notation to Find to Nth-to-Last Character in a String
------------------------------------------------------------------------------------------------
You can use the same principle we just used to
retrieve the last character in a string to retrieve
the Nth-to-la... |
const { get } = require('https')
const request = (url) => {
return new Promise((resolve, reject) => {
const req = get(url, (res) => {
if (res.statusCode === 404) {
resolve(404)
} else if (res.statusCode !== 200) {
reject(new Error(`Something went wrong: ${res.statusCode}`))
}
... |
function pageCount(n, p) {
let frontCnt = Math.floor(p / 2);
let endCnt = Math.floor(n / 2) - frontCnt;
if (frontCnt > endCnt) return endCnt;
return frontCnt;
}
|
var mongoose = require('mongoose');
var Com = mongoose.model('Company');
var sendJSONresponse = function (res, status, content) {
res.status(status);
res.json(content);
};
module.exports.testGet = function (req, res) {
console.log(req.body);
if (req.params && req.params.companyId && req.params.emplo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.