text stringlengths 7 3.69M |
|---|
// Función de inicialización de la vista
function detalleProyectosInicializar() {
var crearWidgets = function () {
$("#jqxButtonGroup_SNI").jqxButtonGroup({ mode: 'RadioButtons', theme: 'energyblue' });
var jqxDateTimeInputConfig = {
width: '140px',
theme: 'energyblue',
allowNullDate: true,
culture:... |
let videos = require('./videos.json');
let video = require('./video.json');
//can possibly choose PORT to set
const PORT = process.env.PORT || 8080;
const express = require('express');
const bodyParser = require('body-parser');
const uuid = require('uuid/v4');
const app = express();
//app.use(bodyParser.urlencoded(... |
'use strict';
function Songs($resource) {
return $resource( '/api/songs/:query', { query: '@_query' } );
}
Songs.$inject = ['$resource'];
angular.module('openmycApp').service('Songs', Songs);
|
import React from 'react';
import FormControlReadonly from './FormControlReadonly';
export default {
component: FormControlReadonly,
title: 'Form Control: Readonly input',
excludeStories: /.*Data$/,
};
export const Default = () => <FormControlReadonly />; |
import React from 'react';
import Contact from '../Component/Perfil/Contact';
import OtherProfiles from '../Component/Perfil/OtherProfiles';
import Preferences from '../Component/Perfil/Preferences';
import ButtonsTwo from '../Component/Perfil/ButtonsTwo';
const ProfileTwo = () => {
return (
<div>
<div>
... |
var md5 = require('md5');
var reqp = require('request-promise');
var qs = require('querystring');
const API_DOMAIN = 'http://gateway.marvel.com';
const API_VERSION = 'v1';
let fields = require('./fields');
let resources = {
characters: ['comics', 'events', 'series', 'stories'],
comics: ['characters', 'creators',... |
import { NavigationExperimental } from 'react-native';
import { PUSH_ROUTE, POP_ROUTE } from '../constants/actionTypes';
import strings from '../res/strings';
const {
StateUtils: NavigationStateUtils
} = NavigationExperimental
const navReducer = (state, action) => {
if (!state) {
return {
index: 0,
... |
import React, { Component } from 'react';
import { Modal, Form, InputNumber, Button, Row, Col, message } from 'antd';
import axios from 'axios';
import showError from '../utils/ShowError';
import YearSelect from '../common/YearSelect';
import MonthSelect from '../common/MonthSelect';
import SmwgTypeSelect from './SmwgT... |
function GrainFeedService(Http)
{
this.http = Http;
this.getGrains = function()
{
return this.http.get('http://api.granular.dev/grains/feed');
};
}
|
var interval;
var pianyi;
var kd1=document.getElementById('picScroll1');
var kd2=document.getElementById('picScroll2');
function gundong() {
interval= window.setInterval(yidong,10);
}
function yidong(){
if(picScroll.scrollLeft>=picScroll1.offsetWidth)
{picScroll.scrollLeft=picScroll.scrollLeft-picScroll1.offsetW... |
/**
* @parent jschat
* @class Jschat.Jid
*
* Abstraction for XMPP JID.
*
* ### Instabnce public attributes
* * fullJid
* * bareJid - generated with Strophe.getBareJidFromJid
* * name - nickname in roster
*
*/
$.Class.extend('Jschat.Jid',
/* @Static */{
},
/* @Prototype */
{
/**
* @class Jid
* @cons... |
import { Mongo } from 'meteor/mongo';
export const Iform = new Mongo.Collection('iforms');
// export const IformFields = new Mongo.Collection('iformsFields');
if (Meteor.isClient) {
Meteor.methods({
addForm: function(formsData) {
var formID = Iform.insert(formsData);
console.log('hello');
return fo... |
'use strict';
const { expect } = require('chai');
const { stub } = require('sinon');
const { errors } = require('../../../src/lib/constants');
const repoStub = {
delete: stub()
};
const mw = require('../../../src/services/delete-service-provider/src/delete-provider-mw')(
repoStub
);
const req = {
params: {
... |
/*
*
* This script handles embedding of videos
*
*/
/*
* Inject iframes into the video containers.
* These iframes hold urls to the videos hosted on YouTube.
*/
function initialiseVideoEmbed ( domElement, videoId ) {
var $iframe = $( "<iframe>" );
var videoId = videoId || domElement.dataset.src;
var attrib... |
import Children from './children'
import didMount from './didMount'
import didUpdate from './didUpdate'
import didUnmount from './didUnmount'
import Key from './key'
import overload from '@kuba/overload'
import paint from './paint'
import reflow from './reflow'
import render from './render'
import repaint from './repai... |
// Custom KeyFrameBall class
SB.Examples.KeyFrameBall = function()
{
SB.Entity.call(this);
this.transform = new SB.Transform();
this.picker = new SB.Picker({ overCursor : 'pointer' });
var avParams = {};
avParams.radiusTop = 1;
avParams.radiusBottom = 1;
avParams.height = 1.667;
avPa... |
import React, { PropTypes } from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles'
import s from './SuperToolbar.less';
import {Button, Popconfirm, Icon, Dropdown, Menu} from 'antd';
const MenuItem = Menu.Item;
const SubMenu = Menu.SubMenu;
/**
* key: 用于标识菜单项
* title: 菜单项上的文字
* subMenu: [可选],... |
const assert = require('assert');
const User = require('../app/user.js');
describe('User', function() {
describe('#create', function () {
it('should create a user with only an id', function () {
user = new User(5)
assert.equal(5, user.userId);
});
it('should create a user with all parameters'... |
import React from 'react';
import PropTypes from 'prop-types';
const FilterItem = ({ filter, text, handleToggle, type }) => (
<li className="filter-item">
<input type={type} name={type} id={filter} value={text} onChange={handleToggle} />
<label htmlFor={filter} className="filter-item">{text}</label>
</li>
... |
Ext.define('WASApp.model.UsersViewModel', {
extend: 'Ext.app.ViewModel',
alias: 'viewmodel.users',
requires: [
'WASApp.store.UsersStore',
'WASApp.store.AccessLevelsStore'
],
stores: {
users: {
type: 'usersStore',
storeId: 'users'
},
... |
import Apify from 'apify';
import { inspect } from 'util';
import { handleFailedRequest } from './lib/handleFailedRequest.js';
import { handlePage } from './lib/handlePage.js';
import { convertDetailedOutputToSimplified } from './lib/utils.js';
const { log } = Apify.utils;
const env = Apify.getEnv();
Apify.main(async... |
const dbTables = {
title: {
'electricity': 'Електроенергія',
'garbage_removal': 'Вивіз сміття',
'gas': 'Газ',
'heating': 'Опалення',
'lift': 'Ліфт',
'rent': 'Квартплата',
'water_supply': 'Водопостачання',
'0test': '0test'
}
}... |
var gulp = require("gulp");
var watch = require("gulp-watch");
var path = require("path");
gulp.task("watch", function() {
let tasks = [
{
path: path.join(
CONFIG.root.src,
CONFIG.tasks.scripts.src,
"/**/*." + CONFIG.tasks.scripts.extensions.join(",")
),
name: "scripts"
... |
const Koa = require("koa");
const socketIO = require("socket.io");
const passport = require("koa-passport"); //реализация passport для Koa
const mongoose = require("mongoose");
mongoose.set("debug", true);
mongoose.connect(
`mongodb://${process.env.DBLOGIN}:${process.env.DBPASSWORD}@ds042459.mlab.com:42459/chat-test... |
import React, { PureComponent } from "react";
import ReactDOM from "react-dom";
import { BrowserRouter as Router, Route } from "react-router-dom";
import { Provider } from "react-redux";
import store from "./store/index";
import NewsFeed from "./pages/NewsFeed";
import CurrentFeed from "./pages/CurrentFeed";
class Ap... |
const colors = {
lightWhite: '#ecf0f1',
white: '#fff',
black: '#000',
lightGreen: '#26de81',
green: '#20bf6b',
lightYellow: '#fed330',
yellow: '#f7b731',
lightOrange: '#fd9644',
orange: '#fa8231',
lightRed: '#fc5c65',
red: '#eb3b5a',
lightGrey: '#d1d8e0',
grey: '#a5b1... |
const funcs = []
for(let i = 0; i < 10; i ++){
//push adiciona elementos no array
funcs.push(function(){
console.log(i)
})
}
//Let tem escopo de bloco e mostrará os valores das variavel
funcs[2]()
funcs[8]()
|
import React from 'react'
import styled from 'styled-components'
import { Link } from 'gatsby'
import { useSiteMDX } from '../hooks/use-site-mdx'
const ParentStyledUL = styled.ul`
margin: 0;
padding: 1rem;
`
const ParentStyledLI = styled.li`
list-style: none;
display: block;
margin-bottom: 1rem;
`
const ... |
/**
*
*/
goog.provide('SB.View');
goog.require('SB.PubSub');
SB.View = function(param)
{
SB.PubSub.call(this);
this.id = (param && param.id) ? param.id : "";
this.closebox = (param && param.closebox) ? param.closebox : "";
var style = (param && param.style) ? param.style : "";
var elt = $('<div class="view ' ... |
"use strict";
exports.__esModule = true;
var express = require("express");
var cat_1 = require("./controllers/cat");
var user_1 = require("./controllers/user");
function setRoutes(app) {
var router = express.Router();
var catCtrl = new cat_1["default"]();
var userCtrl = new user_1["default"]();
// Cats
... |
({
deleteShift : function(cmp, hourId) {
const action = cmp.get('c.deleteShift');
const volunteer = cmp.get('v.volunteer');
cmp.set('v.showSpinner', true);
action.setParams({
'volunteerId' : volunteer.id,
'hourId' : hourId
}... |
/**
*
* Author : Sepehr Aliakbary
* A component that Holds Dice Information in GameBoard Component ...
*
* @component Dice
*/
const Dice = React.createClass({
/**
* handle click button to throw the dice
* @method handleClick
*/
handleClick: function () {
this.props.throwDice();
... |
exports.seed = function(knex) {
// Deletes ALL existing entries
return knex('ingredients').del()
.then(function () {
// Inserts seed entries
return knex('ingredients').insert([
{id:1, ingredient_name: 'soup stuff'},
{id:2, ingredient_name: 'fish or somethin'},
{id:3, ingredi... |
var isHistory = false,
// searchUrl = 'https://dev-api.otosaas.com/menpiao/v1/scenics',
searchUrl = locationUrl + '/menpiao/v1/scenics',
searchStr = null,
myScroll,
Str = '',
count=1,
searchData='',
queryTextStr='',
inputText='';
var cityName=decodeURI(window.location.href).split("cityName=")[1];console.log(cit... |
import React from 'react';
import { Link } from "react-router-dom";
import ReactMapGL from 'react-map-gl';
import Map from './Map'
const TOKEN = 'pk.eyJ1IjoidmluY2VudGRqaWUiLCJhIjoiY2p4ZXo1NTVzMHVkMTN5bnhobHZpamdueCJ9.SVkMVxpKo8jqJ4iAuAGBoQ'
class Results extends React.Component {
constructor(props) {
super(prop... |
import React, { useEffect } from "react";
import SwiperCore, { Navigation, Pagination, Scrollbar, A11y,Autoplay } from "swiper";
import { Swiper, SwiperSlide } from "swiper/react";
// Import Swiper styles
import "swiper/swiper.scss";
import "swiper/components/navigation/navigation.scss";
import "swiper/components/pag... |
// *https://bezkoder.com/mongoose-one-to-many-relationship/ refactor for example
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const ChatSchema = mongoose.Schema(
{
users: [
{
type: Schema.Types.ObjectId,
ref: "User",
},
],
messages: [
{
t... |
module.exports = {
"PORT": 3000,
"DB_URL": 'mongodb://localhost/do_an',
"numberOfDataDisplay": 20,
"SERVER_URL": 'localhost:8000',
"SECRET_KEY": 'somethingscrete',
"DATE_FORMAT": /^\d{4}-\d{2}-\d{2}$/
}
|
var classde_1_1telekom_1_1pde_1_1codelibrary_1_1ui_1_1components_1_1notification_1_1_p_d_e_tool_tip =
[
[ "PDEToolTip", "classde_1_1telekom_1_1pde_1_1codelibrary_1_1ui_1_1components_1_1notification_1_1_p_d_e_tool_tip.html#a273a04fe272d9be92093cc03c463f549", null ],
[ "PDEToolTip", "classde_1_1telekom_1_1pde_1_1... |
const fs = require("fs");
const path = require("path");
const logger = require("./logger");
function getConfig() {
let project_folder, configFile;
if (process.pkg) {
project_folder = path.dirname(process.execPath);
configFile = path.join(project_folder, "./config/config.json");
} else {
project_folde... |
function filter(tabNumber, word) {
// Your code here
const newTab = [];
for (let i = 0 ; i<tabNumber.length; i++) {
if (tabNumber [i] % 2 == 0) & (word = "even")
tabNumber.push([i]);
return console.log(newTab[i] + word );
}
else {
tabNumber.push([i]);
return co... |
import { render, screen } from "@testing-library/react"
import ListTitle from "./ListTitle"
test("renders a list title", () => {
render(<ListTitle title="my title" count={13} />)
const titleElement = screen.getByText(/my title/i)
expect(titleElement).toBeInTheDocument()
expect(titleElement).toHaveClass("list-... |
export default class DetailModal {
constructor({$target}) {
this.isVisible = false;
this.data = null;
this.modalWrapper = document.createElement('div');
this.modalWrapper.className = 'modal-wrapper';
this.modalWrapper.classList.add('hidden');
$target.appendChild(this... |
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import DropFile from './DropFile'
require("../node_modules/react-dropzone-component/styles/filepicker.css");
require("../node_modules/dropzone/dist/min/dropzone.min.css");
class App extends Component {
render() {
ret... |
var trades = [];
var alltrades = [];
var powers = null;
var pages = null;
var type = 'list';
var currentPage = 1;
function writeTrade(trade, tType)
{
powers = document.getElementById('powers');
pages = document.getElementById('pages');
alltrades = trade;
trades = trade;
type = tType;
setPages();
loadPage(1);
... |
export default ({
url, method = 'POST', data,
}) => new Promise((resolve, reject) => {
wx.request({
method,
url,
data,
success: (res) => {
// 返回的数据
const rsp = res.data;
if (rsp.status === 200) {
resolve(rsp);
} else {
wx.showModal({
content: rsp.me... |
var Zia;
(function (Zia) {
function throwOnGLError(err, funcName, args) {
throw WebGLDebugUtils.glEnumToString(err) + " was caused by call to: " + funcName;
}
function validateNoneOfTheArgsAreUndefined(functionName, args) {
for (var ii = 0; ii < args.length; ++ii) {
if (args[ii] ... |
exports.run = async (client, message, args, level) => {
try {
if (!args[0]) return message.reply('You need to give the message ID!');
let msg = messages.get(args[0]);
if (!message.channel.fetchMessage(args[0])) message.reply('That message does not exist!');
msg.pin().catch(() => {
... |
import React, { Component } from 'react';
import Flickity from 'flickity';
import 'flickity/dist/flickity.min.css';
import '../css/events.css';
import '../css/carrousel.css';
import '../css/carrouselb.css';
// Images
import Webinars from '../images/thumbnails/Webinars@2x.png';
import Thumbnail from '../images/thumbnai... |
import Image from "next/image";
export default function cartaDePrincipios() {
return (
<div>
<div className=" shadow-md w-full h-[300px] relative">
<Image
src="/carta-de-pincipios/carta-principios.jpg"
alt="carta-principios"
layout="fill"
objectFit="fill"
... |
// Ex5.7-shortest_words
// Simple, given a string of words, return the length of the shortest word(s).
// String will never be empty and you do not need to account for different data types.
const shortestWordLength = (str) => {
const regex = /\w+/g;
const wordsArray = str.match(regex);
const compareWords... |
import React from 'react';
const Event = (props) => {
return (
<div>
{props.event.date.indexOf('/') === -1 ? `Occurred in ${props.event.date}` : `Occurred on ${props.event.date}`} <br />
What Happened? -
<div style={{paddingLeft: '50px'}}>
{props.event.description}
</div>
<b... |
const URL = 'http://localhost:8081';
let entries = [];
let categories = [];
let jobs = [];
const dateAndTimeToDate = (dateString, timeString) => {
return new Date(`${dateString}T${timeString}`).toISOString();
};
const createEntry = (e) => {
e.preventDefault();
const formData = new FormData(e.target);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.