text stringlengths 7 3.69M |
|---|
const { Expo } = require('expo-server-sdk')
const Configuration = require('../models/configuration')
const User = require('../models/user')
const Product = require('../models/product')
const https = require('https')
const { createWriteStream } = require('fs')
const admin = require('firebase-admin')
const serviceAccoun... |
import React from 'react';
import SpotifyWebApi from "spotify-web-api-js";
import Nav from "./Nav";
import Search from "./Search";
import Login from './Login';
import './scss/layout/layout.scss';
const spotifyApi = new SpotifyWebApi();
class App extends React.Component {
constructor() {
super();
const pa... |
import TaskForm from './TaskForm'
export default {
title: 'component/TaskForm',
component: TaskForm
}
const Template = (args) => <TaskForm {...args} />;
export const normal = Template.bind({});
normal.args = {
formTasks: [
{labelName: 'activity', type: 'text'},
{labelName: 'date', type: 'date'},
... |
function getMovies() {
let promise = new Promise((resolve, reject) => {
let flag = false;
resolve(fetch("http://localhost:3000/movies")
.then(function (response) {
if (response.status == 200) {
return response.json();
}
else {
flag = true;
}
})
);
if (flag) {
reject(new Er... |
/**
* Gets the tasks from server
*/
import { take, call, put, select, cancel, takeLatest } from 'redux-saga/effects';
import { LOCATION_CHANGE } from 'react-router-redux';
import moment from 'moment';
import { makeSelectProjectId, makeSelectToken } from 'containers/App/selectors';
import request from 'utils/request'... |
const aspectRatios = {
"1.91:1": 1.91,
"16:9": 1.777,
"1:1": 1,
"4:5": 0.8,
"2:3": 0.666,
"9:16": 0.5625,
};
export var AspectRatiosLowToHigh = Object.values(aspectRatios).sort();
export var AspectRatios = aspectRatios;
export default aspectRatios;
|
//Um stacknavigator, mesma de Conversas.js, pq vai ter duas telas
import React, {Component} from 'react';
import {StackNavigator} from 'react-navigation';
//import { connect } from 'react-redux'; // para acessar o reducer
import ConversasList from './ConversasList';
import ConversaInterna from './ConversaInterna';
c... |
import React from "react";
import { bool, number, func } from "prop-types";
import locked from "../../assets/locked.png";
import unlocked from "../../assets/unlocked.png";
const ClickValueBonus = ({ active, value, onClick }) => (
<button disabled={active} onClick={onClick} className="btn btn-primary">
{active ? ... |
// jeopardy
function includeJs(jsFilePath) {
var js = document.createElement("script");
js.src = jsFilePath;
js.type = "text/javascript";
document.head.appendChild(js);
}
includeJs("variable.js");
//do not modify
//do not modify
var doubtop = Math.floor(Math.random() * 3);
var doubpoi = Math.floor(Math.... |
function Mostrar()
{
//tomo la edad
var edad;
edad=document.getElementById("edad").value;
if (edad<13 || edad>17) {alert("no es adolecente y su edad es" + edad);}
/*var laEdad;
laEdad=document.getElementById("edad").value;
if(laEdad>13 && laEdad<17){
alert("adolecente");
... |
import React, { Component } from 'react';
import { View, Text, StyleSheet, Image } from 'react-native';
import CardCodeComponent from '../../components/CardCodeComponent';
import Button from 'react-native-button';
import { PrimaryColor } from '../../values/Colors';
class InviteFriendScreen extends Component {
re... |
const Feed = require("./Feed");
const Podcast = require("./Podcast");
const FeedParser = require('feedparser');
const request = require('request');
class FeedDownloader {
// Use a promise rather than event emmiter
Download(feed) {
const prom = new Promise((resolve, reject) => {
const req ... |
'use strict';
var series = require('async/series');
var Testee = require('testee').Manager;
var localtunnel = require('localtunnel');
var webdriver = require('wd');
var SauceLabs = require('saucelabs');
var debug = require('debug')('test-ios-safari');
// Port Testee will run on
var serverPort = 3996;
// Testee serve... |
// How to run: *********** //
// npm install -g nodemon //
// nodemon <file-name> //
// *********************** //
// Edabit
// https://edabit.com/
// Challenges
// JavaScript
// Easy:
console.log(`
Challenges
JavaScript
Easy
`);
// Sort Numbers in Descending Order
// https://edabit.com/challenge/yaXQvCzAXJ... |
import React from 'react';
import {Route, Switch} from 'react-router-dom';
import Signup from './components/Signup';
import Signin from './components/SignIn';
import Layout from './components/Layout';
class App extends React.Component{
render(){
const routes = (
<Switch>
<Route... |
Views.LoginBoxView = Views.BaseLoginView.extend({
events : {
"click #login-form-submit-btn" : "submit",
"click #forgot-link" : "openForgotBox",
"click #signup-link" : "openSignUpBox"
},
initialize : function(){
this._super('initialize');
this.$el = $("#login-box-container");
this.loadTemplate('login-bo... |
import React from 'react'
import CircularProgress from '@material-ui/core/CircularProgress'
import styled from 'styled-components'
const Div = styled.div`
display: flex;
justify-content: center;
align-items: center;
height: 90vh;
width: 100%;
`
const LoaderCircle = () => (
<Div
alignItmes="center"
... |
import styled from "styled-components";
import Logo from "./Logo";
import Menu from "./menu/";
const Sidebar = styled.div`
background-color: #252c48;
width: 300px;
height: 100vh;
position: fixed;
left: 0;
top: 0;
@media (max-width: 992px) {
display: none;
}
`;
export default () => {
return (
... |
'use strict'
const remote = require('electron').remote;
const ipc = require('electron').ipcRenderer;
//let AppSettings = require('../AppSettings');
let _appSettings = null;
/**
* Fires after the config file is loaded and sets up the pannels with the config data
*/
function init() {
document.querySelector('#sett... |
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';
describe('App', () => {
test('check test env', () => {
expect(1+1).toBe(2);
});
test('render basic check', () => {
render(<App />);
expect(screen.getByRole('heading')).toHaveTextContent('Anki... |
import React, { Component } from "react";
import firebase from "../config/fbConfig";
class CollectionUrls extends Component {
state = {
requestUrl: this.props.urlArray
};
deleteRequest = (url, collectionId, index) => {
// console.log(collectionId);
firebase
.firestore()
.coll... |
import Background from './Background';
export default class Entertainer extends Background {
constructor() {
super('entertainer');
}
} |
(function () {
"use strict";
angular
.module('app.calendar')
.controller('CalendarController', CalendarController)
CalendarController.$inject = ["logger","$scope","$q", "dataservice"];
/* @ngInject */
function CalendarController(logger, $scope, $q, dataservice) {
v... |
var today, hours, minutes, seconds, todayDate, todayDay, todayYear, todayMonth;
var time = document.getElementById("time");
var date = document.getElementById("date");
var days = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
var month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul... |
/*
* Copyright 2014 Guy Bedford (http://guybedford.com)
*
* 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 requ... |
self.__precacheManifest = [
{
"revision": "72b3f7e774e12ca6797ce1020ec658a2",
"url": "/X-Flowchart-Vue/fonts/iconfont.72b3f7e7.eot"
},
{
"revision": "735ab4f94fbcd57074377afca324c813",
"url": "/X-Flowchart-Vue/robots.txt"
},
{
"revision": "af5ce3c0df97982c7a48e9a5680e44cb",
"url": "/X-... |
'use strict';
angular.module('reports')
.controller('ReportsAllCtrl', function() {
});
|
//@ts-check
import { T_UNDEFINED } from "reshow-constant";
import { useEffect, useRef, useMemo } from "react";
import callfunc from "call-func";
/**
* @callback RunType
* @param {function} func
* @param {number} [delay]
*/
/**
* @param {boolean} [interval]
* @returns {[RunType, function]}
*/
const useTimer = ... |
import React, {
Component,
} from 'react';
import {
StyleSheet,
Text,
View,
} from 'react-native';
import FCM from 'react-native-fcm';
import { Scene, Router, TabBar, Modal, Schema, Actions, Reducer, ActionConst } from 'react-native-router-flux'
import Launcher from './Launcher'
import SignUp from './SignupCom... |
import axios from "axios";
import qs from "qs";
//export const SERVER_URL = '/gpms/';
export const SERVER_URL = '/';
export function grRequestPromise(url, param) {
return new Promise((resolve, reject) => {
axios({
method: (param.method) ? param.method : "post",
url: SERVER_URL + url,
headers:... |
class NoExistFileError extends Error {
constructor(filePath) {
super(`No file: ${filePath}`);
}
}
module.exports = NoExistFileError;
|
/**
* Created by kdehbi on 15/04/2016.
*/
//we are going to need nodes files system (fs) object to read & write to disk
var fs = require('fs');
//GET method, function with request & response parameter
module.exports.get = function(req, res){
//read the file from disk with id from request parameters
//+json ... |
// extendObservable is like obj assign
import { observable, extendObservable } from 'mobx'
// same old api mmethod
import { getObjects, getObject, addObject } from 'cosmicjs'
// lodash
import _ from 'lodash'
// config
import config from '../config'
// all the ob data
export default class AppState {
// ob, all polls
... |
import OpenhabEvent from './OpenhabEvent';
import OpenhabTopic from './OpenhabTopic';
/**
* Receives realtime events from an Openhab server,
* formats the data into custom JHS event objects and
* dispatch them to listeners.
*
* See: https://www.openhab.org/docs/developer/utils/events.html
*
* Warning: Uses Event... |
import Card from "./components/Card";
const App = () => {
return (
<>
<Card />
<footer>
Created by{" "}
<a href="https://devchallenges.io/portfolio/SubHodH-K-N">SubHodH-K-N</a>{" "}
- devChallenges.io
</footer>
</>
);
};
export default App;
|
import React from "react";
import "./Hero.css";
const Hero = () => {
return (
<div className="jumbotron">
<div className="container-md">
<h1 className="display-4">
Health, made tasty.{" "}
</h1>
<p className="lead">
Welcome to Healthful Pantry
and start your journey to
health free... |
import React, { Component } from 'react';
import "./tour.scss";
import "../../index.scss";
export default class tour extends Component {
state={
showInfo:false
};
handleInfo=()=>{
this.setState({
showInfo: !this.state.showInfo
})
}
render() {
const { id,city,img,name, info}= this.props.t... |
$(document).ready(function(){
// Category Search Ajax Call to MongoDB
$('#bookCategory').on('change', function(e){
let bookCategory = $("#bookCategory").val();
$.ajax({
method: "POST",
url: "/catsearch",
data: {text: bookCategory},
success: functio... |
const { createContainer, asClass, asFunction, asValue } = require("awilix");
const { scopePerRequest } = require("awilix-express");
const config = require("../config");
const Application = require("./app/Application");
/**
* Operation
*/
const {
CreateUser,
GetAllUsers,
GetUser,
UpdateUser,
DeleteUser
} ... |
/* global io */
/* global noty */
/* global angular */
var app = angular.module('musicBattleApp', ['ngMessages']);
app.run(function($rootScope) {
//To Enable test options
$rootScope.debugMode = false;
});
|
'use strict'
const SwaggerRestify = require('swagger-restify-mw'),
mongoose = require('mongoose'),
restify = require('restify'),
config = require('config'),
app = restify.createServer()
const swaggerConfig = {
appRoot: __dirname // required config
},
dbConfig = config.get('mongo'),
... |
function validDecimal(obj){
if(isNaN(parseFloat(obj.value)))
obj.value='';
else
obj.value=parseFloat(obj.value).toFixed(2).replace('.00','');
}
function isNumberKey(evt){
var charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode != 13 && charCode != 46 && charCode > 31 && (charCode < 48 ||... |
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... |
import React from "react";
import './modal.css';
export default function Modal({show, onClose}) {
const localOnClose = e => {
onClose && onClose(e);
};
if (show) {
return (
<section className="modal-container" id="modal">
<div className="modal-content">
... |
// 此页面作为一个权限检测页面
import {
me,
xmini,
xPage,
} from '../../config/xmini';
import api from '../../api/index';
import mixins from '../../utils/mixins';
// import { limitUserInfo } from '../../utils/limitTip';
const app = getApp();
xPage({
...mixins,
data: {
// content: '正在登录中...',
// cantry: false,
... |
import React, {Component} from 'react';
import {
StyleSheet,
Text,
View,
FlatList,
H3,
TouchableNativeFeedback,
} from 'react-native';
import _ from 'lodash'
import BasePage from './BasePage'
import Line from '../Component/Line'
import { defaultFlatListStyle, colors } from '../styles'
import fpm... |
let a = new Set( [
123,
'12',
31
] );
// 遍历所有value
for( let i of a.values() ){
console.log( i );
} |
'use strict';
const bcrypt = require('bcrypt-nodejs');
const secret = require('../config/secret');
const jwt = require('jsonwebtoken');
const util = require('../config/secret');
module.exports = (sequelize, DataTypes) => {
var User = sequelize.define('User', {
id: {
allowNull: false,
autoIncrement: t... |
function sleep(millis) {
return new Promise(resolve => setTimeout(resolve, millis));
}
const testValue= ( () => {
return new Promise((resolve, reject) => {
setTimeout(() => {
message = Math.floor(Math.random()*2);
resolve(message);
}, 2000)
})
})
var test5 = (a... |
/* 🤖 this file was generated by svg-to-ts*/
export const EOSIconsArrowForwardIos = {
name: 'arrow_forward_ios',
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.88 4.12L13.76 12l-7.88 7.88L8 22l10-10L8 2z"/></svg>`
};
|
$(document).ready(function() {
$('.clicker').click(function(){
$(this).next().toggle(250, function () {
$(this).toggleClass('show');
// $(this).addClass('showing');
});
});
});
|
'use strict'
let env = (typeof process === "object" ? "node" : "browser");
let fs = (env == "node" ? require("fs") : undefined);
function sanitizePath(str){
if(str.charAt(0) == ".") return str.slice(1);
return str;
}
/**
* @namespace ElonaJS.Utils.File
*/
let file_util = {};
/**
* Asyncronously returns ... |
import React from 'react';
import clsx from 'clsx';
import {Link} from 'react-router-dom';
import * as PropTypes from "prop-types";
import { makeStyles, useTheme } from '@material-ui/core/styles';
import {AppBar, CssBaseline, Divider, Drawer, IconButton, Grid, Hidden,
List, ListItem, ListItemIcon, ListItemText, Sw... |
var getYear = new Date().getFullYear();
document.getElementById("dateSpan").textContent = "2015-"+getYear;
|
class Entry {
constructor() {
this.id = "";
this.title = "";
this.shortDescr = "";
this.longDescr = "";
this.files = [];
this.alive = true;
}
}
function readSingleFile(evt) {
//Retrieve the first (and only!) File from the FileList object
var f = evt.target.files[0];
if (f) {
var r = new FileReade... |
signIn.controller('TeachersCtrl', function TeachersCtrl($scope, TeachersFactory) {
$scope.teachers = TeachersFactory.teachers;
$scope.TeachersFactory = TeachersFactory;
});
|
var current1=document.querySelector('#email');
current1.addEventListener('focus', function(e) {
if (current1) current1.pause();
current1 = anime({
targets: 'path',
strokeDashoffset: {
value: 0,
duration: 700,
easing: 'easeOutQuart'
},
strokeDasharray: {
value: '240 1386',
... |
/*
Your goal is to implement the method meanVsMedian which accepts an odd-length array of integers and returns one of the following:
'mean' - in case mean value is larger than median value
'median' - in case median value is larger than mean value
'same' - in case both mean and median share the same value
Array will ... |
import React from 'react'
import moment from 'moment'
import {
MessageContainer,
Avatar,
MessageInfo,
Heading,
Content
} from './message.styles'
const timeFromNow = timestamp => {
if (timestamp) return moment(timestamp.toDate()).fromNow(true)
else return 'just now'
}
const Message = ({ message = {} }) ... |
let userScore=0;
let computerScore=0;
const userScore_span=document.getElementById("user-score");
const computerScore_span=document.getElementById("computer-score");
const scoreBoard_div=document.querySelector(".score");
const result_p=document.querySelector(".result > p");
const rock_div=document.getElementById(... |
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2017, OpenNebula Project, OpenNebula Systems */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may ... |
import React, {PropTypes, Component} from 'react';
import DatePicker from 'material-ui/DatePicker';
import Row from 'muicss/lib/react/row';
import Col from 'muicss/lib/react/col';
import FlatButton from 'material-ui/FlatButton';
import Dialog from 'material-ui/Dialog';
import SelectField from 'material-ui/SelectField';... |
import config from './config'
import http from 'http'
import mongoose from './mongoose'
import { catchErrors } from './helpers/errorHelpers'
import finalhandler from 'finalhandler'
import Router from 'router'
import APIError from './helpers/APIErrorHelper'
import httpStatus from 'http-status/lib/index'
import api from ... |
import {
SET_LAST_URL,
SET_LAST_URL_BEFORE_EXAM
} from "./actions"
const initialState = {
lastUrl: "/",
lastUrlBeforeExam: "/"
}
export default (state = initialState, action) => {
switch (action.type) {
case SET_LAST_URL:
return {
...state,
lastUrl: action.lastUrl
}
case SET_LAST... |
import Home from '../src/page/home'
import Projects from '../src/page/projects'
import ProjectSingle from '../src/page/single/project'
const routes = [
{
path: '/(en|zh)/',
exact: true,
component: [Home],
key:'homeData'
},
{
path: '/(en|zh)/projects/',
exact:... |
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'spacedesign.store@gmail.com',
pass: 'SDesign-135qw'
}
});
module.exports = (app)=> {
app.get("/api/slides", function(req, res){
const db = req.app.locals.slides;
db.list(fun... |
import React from 'react';
import { shallow } from 'enzyme';
import renderer from 'react-test-renderer';
import Footer from './Footer';
describe('Footer suite', () => {
it('should render the Footer component', () => {
const component = shallow(<Footer />);
const tree = renderer.create(<Footer />).toJSON();
... |
import React from 'react'
import FormControl from 'react-bootstrap/FormControl'
const Search = () => (
<section className='search'>
<h2 className='search__title'> ¿Qué quieres ver hoy? </h2>
<FormControl
placeholder='Buscar...'
type='text'
className='search__input'
/>
</section>
)
export default Sear... |
var test = require("tape"),
contains = require("../src/index");
function args() {
return arguments;
}
test("contains on array like objects", function(t) {
t.equal(contains([1, 2, 3], 3), true, "returns true when array contains item");
t.equal(contains(args(1, 2, 3), 3), true, "returns true when argum... |
// reducers配置文件
import { routerReducer } from 'react-router-redux';
import orderList from './orderList';
import counter from './counter';
// 保存当前正在执行的action type
const combineReducers = (reducers, loadingType) => {
return (state = {}, action) => {
return Object.keys(reducers).reduce((nextState, key) => {
... |
/**
* 电影榜单
* Created by cly on 16/12/26.
*/
import request from "../request";
/**
* 正在热映
* @returns {V}
*/
export let getHotList = ()=>{
return request().get(
"movie/in_theaters"
)
};
/**
* 即将上映
* @returns {V}
*/
export let getCommingList = ()=>{
return request().get(
"movie/co... |
const RecordType = require('./record');
const PersonType = require('./person');
const VehicleType = require('./vehicle');
const ParcelType = require('./parcel');
const OwnerType = require('./owner');
const GuardType = require('./guard');
module.exports = {
RecordType,
PersonType,
VehicleType,
ParcelTyp... |
// One simple funtion that detects the value passed and concats that value accordingly
function input(btn) {
if (btn === '') {
calculator.inputView.value = '';
} else {
calculator.inputView.value += btn;
}
} |
/**
* Created by yatree on 31/05/17.
*/
module.exports = {
// Stage API
getAllTasks: getAllTasks,
getTaskById: getTaskById,
createTask: createTask,
updateTask: updateTask,
removeTask: removeTask,
getTasksForStage: getTasksForStage,
}; |
// const a = { x: 1, y: 2};
// a = {}
// console.log(a)
// {
// const a = 1;
// }
// console.log(a)
// a = 2;
// let b = 2;
// {
// console.log(b)
// let a = 1;
// }
// console.log(a)
// let a = 1;
// a = 2;
// console.log(a)
// var jquery = function() {
// }
// (($) => {
// var a = 1;
// cons... |
import { CouponStatus } from "../../core/enum";
import { Coupon } from "../../model/coupon";
// pages/my-coupon/index.js
Page({
/**
* 页面的初始数据
*/
data: {
activeKey:CouponStatus.AVALIABLE,
Coupons:null,
status:CouponStatus.AVALIABLE,
showTag:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad... |
/**
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**
* A Cross Hatch effect filter.
*
* @class CrossHatchFilter
* @extends AbstractFilter
* @constructor
*/
PIXI.CrossHatchFilter = function()
{
PIXI.AbstractFilter.call( this );
this.passes = [this];
// set the uniforms
this.unifor... |
/**
* 给你两棵二叉树的根节点 p 和 q ,编写一个函数来检验这两棵树是否相同。
* 如果两个树在结构上相同,并且节点具有相同的值,则认为它们是相同的。
*/
var isSameTree = function (p, q) {
function traversal(root1, root2) {
// 左树或右树存在空值则不相同
if (root1 === null && root2 !== null) {
return false;
} else if (root1 !== null && root2 === null) {
return false;
}... |
'use strict';
angular.module('vegewroApp')
.factory('formatter', function() {
function parseWeb(web, splitter) {
var parsedWeb = web.split(splitter);
if (parsedWeb.length > 1) {
return parsedWeb[1];
}
return null;
}
return {
web : function(web) {
var fo... |
// description: after installing Puppeteer v1+, redoing the whole scraper. might be merged back later.
// largely based on the earhart fellows pattern, but using logic from udacity-employment.js as well
// also based on email-append-repec
// earhart fellows follows a stream pattern, this doesnt
// TODO: compare subsamp... |
const { shield, rule, and, or , not} = require( 'graphql-shield');
const isAuthenticated = rule()(
async (parent, args, ctx, info) => {
console.log(ctx.user);
return Boolean(ctx.user)
},
)
const isAdmin = rule({ cache: 'contextual' })(
async (parent, args, ctx, info) => {
re... |
'use strict';
angular.module('lmisChromeApp').config(function ($stateProvider) {
$stateProvider.state('appConfig', {
url: '/app-config',
templateUrl: '/views/app-config/configuration.html',
resolve: {
appConfig: function(appConfigService){
return appConfigService.load();
},
faci... |
const INITIAL_STATE = {
posts: [],
limit: 5,
};
const applySetMessages = (state, action) => ({
...state,
posts: action.post,
});
const applySetMessagesLimit = (state, action) => ({
...state,
limit: action.limit,
});
function postReducer(state = INITIAL_STATE, action) {
switch (action.type) {
case... |
// form
// http://expressjs.com/4x/api.html#req.params
var express = require('express');
var app = express();
var exphbs = require('express-handlebars');
app.engine('handlebars', exphbs());
app.set('view engine', 'handlebars');
// body-parser for POST para pasar datos desde handlebars
// https://github.com/expressjs... |
import React from "react";
export default class Body extends React.Component{
render() {
return (
<div className = 'body'> It is body header</div>
);
}
} |
import React, {Component} from 'react';
import ShipListBlock from "./ShipListBlock";
import shipParser from "./../objects/ShipParser";
import listStorage from "./../objects/ListStorage";
class ShipList extends Component {
constructor(props) {
super(props);
this.order = ["DE", "DD", "CL", "CLT", "CA... |
import React, { useState, useEffect } from 'react';
import './HomeCalendar.css';
import { useSelector, useDispatch } from 'react-redux';
export default function HomeCalendar(props) {
const dispatch = useDispatch();
const mood = useSelector(state => state.calendar);
const user = useSelector(state => state.user);... |
import React from 'react';
import {Text, TouchableOpacity, StyleSheet} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import Colors from '../../constants/Colors';
const FormButton = ({title, onPress, children}) => {
return (
<TouchableOpacity style={styles.button} onPress={onPres... |
Handlebars.registerHelper("prettifyDate", function(timestamp) {
return new Date(timestamp).toString('yyyy-MM-dd');
});
|
class Contact {
/*This constructor is used to initialize the Contact Variables
*@param which takes Array as an parameter
*/
constructor(contactArray) {
this.firstName = contactArray[0];
this.lastName = contactArray[1];
this.city = contactArray[2];
this.state = contactArr... |
import {install, template} from '../dist/index.js'
import assert from 'assert'
describe('mustache data binding', function () {
describe('template', function () {
before(function () {
document.body.innerHTML = `
<template data-name="simple"><p>{{ name }}</p></template>
<template data-name="c... |
/** @jsx React.DOM */
var React = require('react/addons');
var RepoInfo = require('./repo_info');
var Loading = require('./loading');
var PullRequestsList = React.createClass({
getInitialState: function() {
return {
pullRequestsByRepo: {},
repoInfoHash: this.props.repoInfoHash || {},
isLoading:... |
const geocode = require('./utils/geocode');
const forecast = require('./utils/forecast');
geocode('Austin', (error, { latitude, longitude, location }) => {
if (error) {
return console.log('error: ', error);
}
forecast(latitude, longitude, (error, _forecastData) => {
if (error) {
return console.log... |
const express = require("express")
const router = express.Router()
const Book = require("../models/Books")
// @route GET api/books
// @desc Get all books
// @access Public
router.get("/", async (req, res) => {
try {
const books = await Book.find({})
res.json(books)
} catch (err) {
console.log(err)
... |
var thumb148="TkSWZ9/CYkrrc5VP0dMeP2SepWcz3FM9jnH7+7ZWhToPsDPYfRBi14Gao1WdIZUsXwbw6JdzaJZnoclM/hlli5OWuN/lrFVhA3Bh4BtBY3uDc3LmD25UPqqVdKqRYIQtR5jTqgJbIaD72pyLQkfdZ7wmseMlFdDvrkd526MHIjcvcCDF+/tf9StNJlvhxncsFGuJ1HRQZU7742S+KwjaVXhh5FTXzkdFVJ2uXNybsFbzqmvc8LY+T0pmNT7b1zAHPCBUw4WtUq05aZR1Xq+K3943gHjKBe7R+P3Nqdz65BkPJLJQS... |
function Gather(gather) {
var _self = this
var _id = cSYS_ID()
/**
* Return ID
* @return ID
*/
this.getID = function(){
return _id
}
var _model = new GatherModel(_self, gather)
var _view = new GatherView(_self)
this.display = function() {
return _view.display(_model)
}
... |
import React from "react";
import { Timeline } from "antd";
const MessageList = ({ messages }) => (
<Timeline>
{messages.map((message, index) => <Timeline.Item key={index}>{message.text}</Timeline.Item>)}
</Timeline>
);
export default MessageList;
|
function Pessoa(nome) {
if (!nome) this.nome = "Fulano";
else this.nome = nome;
this.dizerOla = () => console.log(`${this.nome} diz: Olá!`);
}
let pessoaA = new Pessoa("Alberto");
Pessoa.digaOla = function () {
console.log(`Olá, meu nome é: ${this.nome}`);
};
let pessoaB = new Pessoa("Maria");
console.log(... |
'use strict'
const Futbolista = require('.././models/futbolista')
function getFutbolistas(req, res) {
Futbolista.find({}).sort('_id').exec((err, data) => {
if (err)
res.status(500).send({
alert: 'Error al guardar el fútbolista'
})
if (!data)
res.status(404).send({
alert... |
import { useState,useEffect } from "react";
const useFetch = (url) =>{
const [data, setData ] = useState(null);
const [isLoading, setIsPending] = useState(true);
const [error, setError] = useState(null);
useEffect(()=>{
const abortCont = new AbortController();
setTimeout(()=>{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.