text stringlengths 7 3.69M |
|---|
var _templateObject = _taggedTemplateLiteralLoose(["wow\na", "b ", ""], ["wow\\na", "b ", ""]);
function _taggedTemplateLiteralLoose(strings, raw) { strings.raw = raw; return strings; }
var foo = bar(_templateObject, 42, _.foobar());
|
var process = false;
function createElement(time, item, id, created_at) {
return '<li class="list-group-item">' +
'<div class="list-group-item__created">' +
'Дата создания ' + created_at +
'</div>' +
'<div class="form-group">' +
'<input class="form-control time" value="' + time + '">' +
'... |
import React from "react";
import Widget from "../Widget";
import "../../styles/Home.css";
import heroimg from "../../img/hero.jpg";
const Home = () => {
return (
<div className="home">
<div className="textcontainer">
<p className="toptext">
Some of us like to taste the different flavor n... |
const nbaData = {
categories: {
'Terms': 1,
'Lakers': 2,
'Teams': 3,
'Cities': 4.
'Players': 5
},
clues: [
{ question: ""
id: 1,
category: Lakers
}
]
}
export default nbaData; |
const config = require('./config.json');
const http = require('http');
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
const fs = require('fs');
const morgan = require('morgan');
const rfs = require('rota... |
import React from "react";
function ReminderCard(props) {
return(
<div>
<h3>{props.reminder.taskName}</h3>
<p>{props.reminder.taskNotes}</p>
</div>
);
}
export default ReminderCard; |
// Legislator methods
'use strict';
var sunlightApi = require("sunlight-congress-api"),
config = require('../../config');
sunlightApi.init(config.apiKey);
module.exports = class Legislators {
constructor(req, res) {
this.req = req;
this.res = res;
}
get() {
sunlightApi.bills()
.filter('his... |
import React, {useEffect, useRef} from "react";
import Message from "./Message";
import {useSelector} from "react-redux";
const ChatContent = ({messagesHistory}) => {
const user = useSelector(state => state.auth.user);
const contacts = useSelector(state => state.contacts.contactsList);
const bottomRef = us... |
const analyticsPlugin = require('./analytics');
const deleteablePlugin = require('./deleteable');
const imagePlugin = require('./image');
const notifyPlugin = require('./notify');
const paginablePlugin = require('./paginable');
const pushIdPlugin = require('./push-id');
const referencePlugin = require('./reference');
c... |
import { getAlgorithm, addAlgorithm } from './tiling';
var sliceAndDiceAlgorithm = getAlgorithm('sliceanddice');
function rotatedSliceAndDice(data) {
data.isRotated = !data.isRotated;
return sliceAndDiceAlgorithm.call(this, data);
}
addAlgorithm('rotatedsliceanddice', rotatedSliceAndDice); |
var requirejs = require('requirejs');
var path = require('path');
var jquery = require('jquery')(require('jsdom').jsdom().defaultView);
require('backbone').$ = jquery;
requirejs.config({
baseUrl: path.join(process.cwd(), 'app')
});
requirejs.config(requirejs('config'));
global.isServer = true;
global.config = {}... |
import React from 'react'
const Result = ({total, current, score}) => {
return (
<div className='scoreboard-content'>
<div>
<p>Question {current} out of {total}</p>
</div>
<div className='score'>
<p>Score {score}</p>
</div>
</div>
)
}
export default Result
|
/* sentenceSmash
Sentence Smash
Write a method smash that takes an array of words and smashes them together into a sentence and returns the sentence. You can ignore any need to sanitize words or add punctuation, but you should add spaces between each word. Be careful, there shouldn't be a space at the beginning or t... |
var Zephyros = require('node-zephyros');
var z = new Zephyros(),
appdb = fs.createWriteStream('./app.db', {flags: 'a'});
z.bind('m', ['Cmd', 'Ctrl'])
.windowFocused()
.maximize();
var main_screen = {};
z.api().mainScreen().frameWithoutDockOrMenu().then(function(screen){ main_screen = screen; });
z.bind('right',... |
const { HTTP_ERROR_RESPONSE } = require("./constants");
const USER_ERROR = {
CONFLICT: {
message: "User already exists",
HTTP_CODE: HTTP_ERROR_RESPONSE.CONFLICT,
},
INVALID: {
message: "Invalid username or password",
HTTP_CODE: HTTP_ERROR_RESPONSE.FORBIDDEN,
},
};
const... |
class CustomerController {
static authenticate(user){
return new Promise(resolve => {
ConnectionServer.sendRequest('lawyer/login','POST', user , resolve);
});
}
static getDataCep(cep){
return new Promise(resolve => {
ConnectionServer.simpleRequest('http://ap... |
import _ from 'lodash' // eslint-disable-line
import moment from 'moment'
import Backbone from 'backbone'
import {smartSync} from 'fl-server-utils'
const dbUrl = process.env.DATABASE_URL
if (!dbUrl) console.log('Missing process.env.DATABASE_URL')
export default function createStripeCustomer(User) {
class StripeCust... |
import Ember from 'ember';
const { inject: { service } } = Ember;
const computed = Ember.computed;
const fieldTypes = [{type: 'email', purpose: 'Work'}, {type: 'phone_number', purpose: 'Work'},
{type: 'birthday', purpose: 'Birthday', limit: 1}, {type: 'address', purpose: 'Home'},
... |
const http = require("http");
const server = http.createServer((request, response) => {
// logs the requested URL
if (request.url == "/") {
response.writeHead(200, { "Content-Type": "application/json" });
response.write(JSON.stringify({ message: "Welcome to the main page" }));
response.end();
//cons... |
new Vue({
el: "#root",
data: {
n: 0,
uhel: 0
},
methods: {
prevedNaN() {
this.n = Math.floor(360 / (180 - this.uhel) * 1000) / 1000;
},
prevedNaUhel() {
this.uhel = 180 - (360 / this.n)
}
}
}); |
var router = require('express').Router();
const authController = require('../controllers/Auth');
const { signUp, signIn } = authController;
// sign up
router.post('/signup', signUp);
// sign in
router.post('/login', signIn);
module.exports = router;
|
#!/usr/bin/env node
require("../dist/restore");
|
import React, { useContext, useEffect } from "react";
import { Switch, Route } from "react-router-dom";
import UserContext from "../../context/user/userContext";
import CourseContext from "../../context/course/courseContext";
import Course from "./Course";
const Courses = () => {
const userContext = useContext(Use... |
/**
* @namespace
* @constructor
* @param {vonline.Canvas} canvas
* @param {object} data
*/
vonline.CreateCommand = function(canvas, data) {
this.canvas = canvas;
this.object = this.canvas.createObject(data);
}
vonline.CreateCommand.prototype.execute = function() {
this.canvas.add(this.object);
}
vonline.Creat... |
/**
* 继承3: 原型抄写, 通过原型链继承
*
*/
function Parent() {
}
Parent.prototype.x = 10;
function Child() {
}
for (const p in Parent.prototype) {
Child.prototype[p] = Parent.prototype[p];
}
Child.prototype.y = 2;
var childObj = new Child();
console.log(childObj.x);
|
describe('SingleNoteView', function() {
it('can be instantiated', function() {
var note = new Note("I'm very Hungary");
var singleNoteView = new SingleNoteView(note);
var html = singleNoteView.renderHTML();
expect(html).toEqual("<div>I'm very Hungary</div>")
})
})
|
const db = require("../Models");
const jwt = require('jwt-simple');
const config = require('../config');
function tokenForUser(user) {
const timestamp = new Date().getTime();
return jwt.encode({ sub: user.id, iat:timestamp }, config.secret);
};
exports.signup = function(req, res, next) {
const { username, email, ... |
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import moment from 'moment'
import * as Animatable from 'react-native-animatable'
import { TouchableOpacity, Image, Dimensions, View } from 'react-native'
import {
Button,
Text,
Left,
Body,
Right,... |
/* Toggle between adding and removing the "responsive" class to appLink when the user clicks on the icon */
function myFunction() {
document.getElementsByClassName("appLink")[0].classList.toggle("responsive");
} |
(function () {
'use strict';
var app = angular
.module('controllersModule')
.controller('EditCatController', CatCtrl);
CatCtrl.$inject = ['$location', '$window', '$rootScope', '$scope', '$timeout', '$modal', '$routeParams', '$log', 'FlashService', 'CatSrvc'];
function CatCtrl($locatio... |
function clear_field(field, email)
{
if(field.value === email)
{
field.value = '';
}
}
function field_blur(field, email)
{
if(field.value == '')
{
field.value = email;
}
} |
let cl = console.log
function showTime() {
let now = new Date().toString()
let left = /2017\s/,
right = /GMT/;
left.exec(now)
now = RegExp.rightContext;
right.exec(now)
cl(RegExp.leftContext)
}
showTime()
//自从用了正则表达式,普通的注释的常常失效。。
function telephoneCheck(str) {
var num = str.replace(/[^\d]/g,'');... |
'use strict';
// Author: ThemeREX.com
// user-forms-additional-inputs.html scripts
//
(function($) {
$(document).ready(function() {
"use strict";
// Init Select2
$(".select2-single").select2();
// Init Select2 Multiple
$(".select2-multiple").select2({
... |
function openTab(e) {
$(".tabcontent").each(function () {
$(this).css({
display: "none"
})
}), $(".mainContent__controls .tablink").on("click", function () {
$(this).addClass("btn-selected"), $(this).siblings().removeClass("btn-selected")
}), document.getElementById(e).st... |
var searchData=
[
['entitlementtostring_3a',['entitlementToString:',['../interface_c1_connector_options.html#abc11f115d168ec52ee6940a86f708268',1,'C1ConnectorOptions']]]
];
|
//Selectors (Pour selectionner une partie du store)
export const getTasks = store => store.tasksList
export const getCompletedTasks = store => store.tasksList.filter(task => task.isCompleted)
|
/* Plugin to change select option list in single call */
(function ($, window) {
$.fn.replaceOptions = function (options) {
var self, $option;
this.empty();
self = this;
$.each(options, function (index, option) {
$option = $("<option></option>")
.attr("v... |
import React from 'react';
import TestUtils from 'react-addons-test-utils';
import ReactDOM from 'react-dom';
import { Meteor } from 'meteor/meteor';
import { shallow, mount } from 'enzyme';
import { chai } from 'meteor/practicalmeteor:chai';
import { sinon } from 'meteor/practicalmeteor:sinon';
import { resetDatabase... |
"use strict";
module.exports = {
"chrome": require("./chrome-56"),
"chrome:54": require("./chrome-54"),
"chrome:55": require("./chrome-55"),
"chrome:56": require("./chrome-56"),
"edge": require("./edge-38"),
"edge:38": require("./edge-38"),
"firefox": require("./firefox-51"),
"firefox:50": require(".... |
function nextTest() {
if (env.autoProgress) {
log(env.itest + ' === ' + (_.sce.test.land.length - 1))
if (env.itest === _.sce.test.land.length - 1) {
_.sce.test.util.allTestsPassed()
}
trap('levelUp')
} else {
_.sce.test.util.testPassed()
}
}
|
exports.twitter = {
consumer_key: 'KjjusKBO5pVhdkQ00qOvOoIBK',
consumer_secret: '7mRchpPd4CjIdP9oTMxCyzU4i9JFIZujoQ7yBjvMtuVWwmqg5z',
access_token_key: '959120381394042880-aoJDeCQxNkV1pUkCl2P4Gg82UpdDoEK',
access_token_secret: '0LWftGYANYE9HKObqGe9QEXfHEnBmfYtNTNbS9jvvKbTe',
}
exports.spotify = {
id: 'b6447a8... |
import { useAuthState } from "react-firebase-hooks/auth";
import { auth, db } from '../firebase';
import getRecipientEmail from '../utils/getRecipientEmail';
import { useCollection } from 'react-firebase-hooks/firestore';
import { useRouter } from "next/router";
import Image from "next/image";
function Chat({ id, user... |
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import UnreadMessage from './components/UnreadMessage.jsx';
import MessageBox from './components/messageBox.jsx';
import Videopage from './components/videopage.jsx';
import Share from './components/share.jsx';
import injectTapEventPlugin from '... |
// Imports and configuration
var express = require('express');
var fs = require('fs');
var app = express.createServer();
var nowjs = require(__dirname + "/now/lib/now.js");
var dashboard = nowjs.initialize(app);
var port = process.ARGV[2] || 15000;
/**
* Initialize cache
*/
dashboard.cache = {};
/**
* Load plugins... |
const helper = require('../_helpers')
const passport = require('./passport')
module.exports = {
ensureAuthenticated: (req, res, next) => {
if (helper.ensureAuthenticated()) {
return next()
}
return passport.authenticate('jwt', { session: false })(req, res, next)
},
getUser: (req, res, next) => ... |
import React from "react";
function AboutPanel({ id, img, title, text }) {
return (
<div className="panel" id={id}>
<div className="imageBackground">
<img src={img} alt="icon" />
</div>
<h3>{title}</h3>
<p>{text}</p>
</div>
);
}
export default AboutPanel;
|
module.exports = function(grunt) {
grunt.loadTasks('./tasks');
grunt.loadNpmTasks('grunt-bg-shell');
grunt.loadNpmTasks('thorax-inspector');
grunt.initConfig({
// allows files to be opened when the
// Thorax Inspector Chrome extension
// is installed
thorax: {
inspector: {
backgro... |
var fun = function (canvas){
var w_body = $("body").width();
var h_body = $("body").height();
canvas.get(0).width = parseInt(w_body);
canvas.get(0).height = parseInt(h_body);
};
$(document).ready(function() {
// 绑定重力感应监听器
var Orient = {alpha: 0, beta: 0, gamma: 0};
var Arraw = {alpha: 0, beta: 0, gamm... |
import { Technology } from '../models/TechnologyModel';
import quadrocycle from '../assets/images/technology/quadrocycle.png';
import jet_ski from '../assets/images/technology/jet_ski.png';
import boat from '../assets/images/technology/boat.png';
import snowcat from '../assets/images/technology/snowcat.png';
import off... |
import { useEffect } from "react";
import styled, { keyframes } from "styled-components";
import { Container } from "components/shared/lib";
const TOAST_TIMEOUT = 3000;
const TOAST_FADE_IN = 500;
const TOAST_FADE_OUT = 500;
const TOAST_STAY = TOAST_TIMEOUT - TOAST_FADE_IN - TOAST_FADE_OUT;
const Toast = ({ type, text... |
import React, { Component } from 'react'
import { ethers } from 'ethers';
import { Input, Form, Button } from 'semantic-ui-react'
import './wrapstation.css'
class WrapStation extends Component {
constructor(props) {
super(props)
this.state = {
amount_wrap: '0',
ui_amount_wrap: '',
amount_u... |
// 需求描述: |
const expect = require('expect');
const calculus = require('./calculus');
it("Should return 3 as a number",()=>{
var res = calculus.add(1,2);
expect(res).toBe(3).toBeA('number');
});
it("Should return object with first name and last name", ()=>{
let user = {
'age' : 23
}
let full... |
import React, { Component } from 'react';
import './App.css';
class App extends Component {
constructor(props){
super(props);
this.state = {
score: 0
}
}
handleScore = (e) => {
let scoreAction = parseInt(e.target.value, 0);
this.setState({score: this.st... |
var expect = chai.expect;
describe('hAzzle -> util', function () {
it('hAzzle -> util', function () {
expect(hAzzle).to.be.a('function');
});
});
|
'use strict';
/**
* relation model
*/
export default class extends think.model.relation {
/**
* init
* @param {} args []
* @return {} []
*/
init(...args) {
super.init(...args);
}
/**
* 用户信息加评论查询
*/
async userCommentsQuery(para) {
this.relatio... |
import React, { useState } from 'react';
import Image from 'next/image'
import {
Carousel,
CarouselItem,
CarouselControl,
CarouselIndicators,
Button
} from 'reactstrap';
import carouselStyle from "../styles/Carousel.module.css"
const CarouselSlide = ({data}) => {
const getImg = data.result.map(res... |
'use strict';
angular.module('pageEditTransaction', [
'ngRoute',
])
|
import React from 'react';
import { NavLink, withRouter } from 'react-router-dom';
function Navbar(props) {
console.log(props)
return (
<nav>
<div className="nav-wrapper" style={{background: '#6200ee'}}>
<a href="#" className="brand-logo">Wish List</a>
<ul id... |
class Rectangle{
'use strict';
constructor(properties){
this.type = 'rectangle';
this.rectID = properties.rectID;
this.color = properties.color;
this.width = properties.width;
this.height = properties.height;
this.xLeft = properties.xLeft;
this.yTop = properties.yTop;
this.xRight = thi... |
import React, {Component} from 'react';
import {
Menu
} from 'semantic-ui-react';
import './Navigation.scss';
class Navigation extends Component {
state = {};
handleItemClick = (e, {name}) => {
this.setState({activeItem: name})
};
render() {
const {activeI... |
const Sentiment = require('sentiment');
const exec = require('child_process').exec;
const psList = require('ps-list');
const fs = require('fs');
let sentiment = new Sentiment();
// get card json file generated by charRNN
let data = JSON.parse(fs.readFileSync('./cards/rnn_cards.json'), 'json');
let sentimentTotal = 0;... |
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "b4b83a36af7e64c359b8b58ab8473516",
"url": "/index.html"
},
{
"revision": "25af8ecd97be55da0606",
"url": "/static/css/main.380af05e.chunk.css"
},
{
"revision": "42e1720493e7f894f66c",
"url": "/static/js/2.... |
import React,{Component} from 'react'
import{
View,
Image,
StyleSheet,
Text
} from 'react-native'
import {width,scale,statusBarHeight} from '@/utils/device'
export default class LogoHeader extends Component{
render(){
return(
<View style={styles.container}>
<View style={styles.header}>
... |
$.ajaxSetup({
beforeSend: (xhr, config) => {
if (config.url !== "/login" && config.url !== "/register") {
const token = localStorage.getItem("token");
if (token) {
xhr.setRequestHeader("authorization", token);
} else {
alert("You need to login!");
}
}
config.url = ... |
const express = require('express');
const router = express.Router();
var request = require('request');
var userController = require('../controllers/userController')
router.post('/addUser',userController.addUser)
router.get('/users',userController.getUsers)
router.get('/users/:userId',userController.getUserById)
... |
var chai = require('chai');
var assert = chai.assert;
var jsgraph = require('../index');
var DirectedGraph = require('../src/digraph');
describe("Module export tests", function() {
describe("Directed graph container API", function() {
it("module export 'jsgraph.directed' should be an object", function... |
import { Platform } from "react-native";
import React from 'react';
//Fonts to be imported from Google Fonts
const family = {
primary: "Lato-Regular",
bold: Platform.OS === "ios" ? "SFProText-Bold" : "SF-Pro-Text-Bold",
medium: Platform.OS === "ios" ? "SFProText-Medium" : "SF-Pro-Text-Medium",
light: Platform.... |
import decimalPlacesFormatter from './decimalPlacesFormatter'
function currencyFormatter(value, showValue = true, currency = 'BRL') {
if (typeof (value) == typeof (0)) {
switch (currency) {
case 'BRL':
return 'R$ ' + (showValue? decimalPlacesFormatter(value, 2).toString().replace... |
import _ from 'lodash'
export class Model {
static defaultProps = {
isFetching: false,
isReload: true,
data: {},
error: '',
}
/**
* Get Data With Key
* @param {*} state
* @param {string} key
* @return {typeof Model.defaultProps}
* @static
*/
static get(state, key) {
cons... |
(function($) {
var rules = {
required: {
selector: '.required',
rule: function($el) {
return ($el.attr('type') != 'checkbox' && $el.val().length > 0) || $el.attr('checked');
}
},
notdefault: {
selector: '.notdefault',
rule: function($el) {
... |
import React from "react";
class PlacedOrder extends React.Component {
render() {
return (
<li>
<span>{this.props.placed_orders[this.props.index][this.props.dish]} </span>
<span>{this.props.dishes[this.props.dish].name}</span>
<br/>
</li>
);
}
}
export d... |
// /public/example/example.client.routes.js
// Invoke 'strict' JavaScript mode
//'use strict';
/*
ngRoute module has several key entities to manage routes.
One of them is $routeProvider; this will provide methods
to define your AngularJS app routing behavior.
*/
// Configure the 'example' module routes
// confi... |
(function () {
'use strict';
/**
* @ngdoc object
* @name archiv2017.controller:Archiv2017Ctrl
*
* @description
*
*/
angular
.module('archiv2017')
.controller('Archiv2017Ctrl', Archiv2017Ctrl);
function Archiv2017Ctrl() {
var vm = this;
vm.ctrlName = 'Archiv2017Ctrl';
}
}())... |
$(document).ready(function(){
loadData();
$("#logout").click(function(){
$.ajax({
type: "GET",
contentType: "application/json",
url: "/logout",
dataType: "json",
success: function(){
window.location = "login.html";
... |
import React from 'react'
import RecentPosts from '../components/RecentPosts'
import { Page, SidebarArea, ContentArea } from '../styles/layout'
import Sidebar from '../components/Sidebar'
import { Blog } from '../styles/blog'
import { h1, linkWithNoStyles } from '../styles/elements'
import Helmet from 'react-helmet'
im... |
"use strict";
let myGrades = [100, 100, 90, 73, 78, 94, 86];
let myAverage = 0;
for (let i = 0; i <= myGrades.length - 1; i++) {
myAverage += myGrades[i];
}
myAverage = myAverage / myGrades.length;
console.log("My grade average is " + myAverage);
//myGrades and myAverage had not been properly defined, I saw this by... |
"use strict";
var p = 0;
var q = 1;
//let declaration
function nextFibo() {
var _ref = [q, p + q];
p = _ref[0];
q = _ref[1];
return q;
}
var fibs = [];
while (true) {
var n = nextFibo();
if (n > 10000) break;
fibs.push(n);
}
var fib1 = fibs[0];
var fib3 = fibs[2];
var therest = fibs.slice(... |
var image;
function preload(){
image = loadimage("https://github.com/Kfish247/Fisher_Kennedy_Art2210/blob/master/In_class_assignment/Oct2/Concentration%206%20COM.jpg")
}
function draw(){
}
function windowResized(){
resizeCanvas(windowWidth,windowHeight);
} |
import React, { useContext, useEffect } from 'react'
import Styled from 'styled-components'
import Spotify from 'spotify-web-api-js'
import { PlaybackContext } from '../contexts/PlaybackContext'
const PlayerControls = () => {
const {playback, dispatch} = useContext(PlaybackContext)
const spotifyApi = new Spotify(... |
const actionlistner = require('events').EventEmitter;
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
})
//var readline = require('readline');
function justify(rq){
req = JSON.parse(rq);
if(req.type == "ANIM"){
console.log(req.id+" is a anima... |
describe("Twixingboard", function() {
var twixingboard;
var twixnote;
beforeEach(function() {
twixingboard = new Twixingboard(1);
});
it "runs the test function", function() {
expect(test(1))toEqual(2);
}
it("searches for and saves twixnote", function() {
//searchTwixnote("#worldcup");
exp... |
export const MAPPING = [
{
label: '/',
description: 'Paced beat'
},
{
label: 'A',
description: 'Atrial premature beat'
},
{
label: 'N',
description: 'Normal beat'
},
{
label: 'V',
description: 'Premature ventricular contracti... |
var pets=['cat','dog','rat']
for(var index=0;index<pets.length;index++){
pets[index]=pets[index]+'s'
}
console.log(pets)
|
import React, {useState, useRef} from 'react'
import {motion} from "framer-motion"
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import "./Search.css"
import firebase from "../../../firebase";
import { useHistory } from 'react-router';
import axios from 'axios';
const patientVariant = {
hidden:... |
import React, {useState, useEffect, useCallback, useRef} from "react";
import { useSignUpForm } from "../customHooks/signUpHook";
import timezones from "../timezones/timezons";
import _ from "lodash";
import classNames from "classnames/bind";
import TextField from "../Сomponents/TextField";
import {useFetchData} from '... |
var tday=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
function startTime() {
var today = new Date();
var h = today.getHours();
var m = today.getMinutes();
var dy = today.getDay();
var mt = today.getMonth() + 1;
var dt = today.getDate();
m = checkTime(m);
h = ampm(h);
docum... |
var should = require('should'),
Deck = require('../lib/deck');
describe('Deck', function() {
it('should create a deck', function(done) {
var defaultDeck = new Deck();
defaultDeck.should.have.property('cards');
defaultDeck.cards.should.have.property('length').and.equal(0);
defau... |
'use strict'
const Ejercicio = require('../models/ejercicio');
const Estacion = require('../models/estacion');
function createEjercicio(req, res) {
const ejercicio = new Ejercicio({
nombre: req.body.nombre,
instrucciones: req.body.instrucciones,
tiempo: req.body.tiempo,
imagen: re... |
const axios = require('axios');
const { testEnvironment } = require('../jest.config');
test("Service returns 'howdy earth'", () => {
try {
const response = await axios.get(process.env.SERVICE_ENDPOINT, {});
expect(response.data).toBe();
} catch (e) {
console.error(e);
throw e;
... |
/*global define*/
define([
'jquery',
'underscore',
'backbone',
'templates',
'baseview'
], function ($, _, Backbone, JST) {
'use strict';
var MembersIndexView = Backbone.BaseView.extend({
template: JST['app/scripts/templates/members/index.hbs'],
tagName: 'div',
cla... |
import React from 'react';
const GrazingPlan = () => (
<h3>Grazing Plan</h3>
);
export default GrazingPlan;
|
getDeviceData = function()
{
return {
user_agent: window.navigator.userAgent,
plataform: window.navigator.platform,
browser: window.navigator.appCodeName,
vendor: window.navigator.vendor,
pixel_ratio: window.devicePixelRatio,
resolution: screen.height + 'x' + screen.... |
/**
* @license
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law ... |
//Ejercisios para entrevistas
/*
input: ty
output: tttyyy
input: 5567
output: 555555666777
*/
function threecompany(cadena){
var n = cadena.length;
var output = '';
for(var i=0; i<n ; i++){
var letra = cadena.charAt(i);
output = output + letra + letra + letra
}
return output;
};
... |
Ext.define('Assessmentapp.assessmentapp.web.com.controller.assessmentcontext.survey.AssessmentQuestionarieController', {
extend: 'Assessmentapp.view.fw.frameworkController.FrameworkViewController',
alias: 'controller.AssessmentQuestionarieController',
onassessmentQuestionarieafterrender: function(me, eOp... |
function CausesController(causes) {
var vm = this;
vm.causes = causes.data;
};
CausesController.$inject = ['causes'];
angular
.module('uponnyc')
.controller('CausesController', CausesController)
|
var getStrongest = function(arr, k) {
arr.sort((a,b) => a-b);
let m = arr[Math.ceil(arr.length/2)-1]
arr.sort((a,b) => {
let aval = Math.abs(a - m)
let bval = Math.abs(b-m)
// if (b === -7) console.log(bval, aval)
if (aval > bval) {
return -1;
} else if (a... |
/**
* @author guymoyo
* @name LoaderInterceptor
*/
'use strict';
angular.module('httpProgress',['ngProgress'])
.factory('httpProgressInterceptor',['$injector', function($injector){
return {
'request': function(config) {
var ngProg = $injector.get('ngProgress');
n... |
import React from "react";
import { TextField } from "@material-ui/core";
import { styles } from "../styles/searchStyle";
import withStyles from "@material-ui/core/styles/withStyles";
const Search = props => {
const { classes } = props;
return (
<div className={classes.root}>
<form onSubmit={pro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.