text stringlengths 7 3.69M |
|---|
import Grid from '@material-ui/core/Grid'
import Typography from '@material-ui/core/Typography'
import {withTheme,withStyles} from '@material-ui/core/styles'
import classes from '../../../static/styles/styles'
import classNames from 'classnames'
let mockData = require('../../../static/mockDB/instaReview.json')
const H... |
import React from 'react'
import Button from '../../components/Button/Button'
export default function Navbar(props) {
return (
<div className="navbar">
<div>Navbar text</div>
<Button title="Sample button" />
</div>
)
}
|
import React from 'react';
import '../styles.css';
import ImageView from './imageView/imageView';
import ItemDetailsView from './itemDetailsView/itemDetailsView';
export default class App extends React.Component {
constructor() {
super();
this.state = {
product: {},
};
}
componentWillMount() {... |
$(document).ready(function(){
let CustomerData = JSON.parse(localStorage["CustomerData"]);
$("#first").text(CustomerData.first); //GETTING THE VALUE FROM THE DATA WERE ID IS FIRST
console.log(CustomerData);
$("#email").text(CustomerData.email);//GETTING THE VALUE FROM THE DATA WERE ID IS EMAIL
... |
/**
* @param {*} arr
* @return {Boolean}
*/
var isArray = module.exports.isArray = Array.isArray || function (arr) {
return Object.prototype.toString.call(arr) === '[object Array]';
};
/**
* @param {*} arr
* @return {Boolean}
*/
var isNonEmptyArray = module.exports.isNonEmptyArray = function (arr) {
retur... |
import React from 'react';
import PropTypes from 'prop-types';
import { View, StyleSheet } from 'react-native';
import { sizes, colors } from '../../../constants/theme';
import dropShadowStyle from '../../../utils/dropShadowStyle';
const handlePaddingAndMargin = (type, value) => {
const { horizontal, vertical, top, ... |
function do_refract(state) {
// state has n_in, n_out, v_in. Assumes ray hits surf at [0,0]
// returns v_out, Reff, Teff
let sin_theta_in = v2.sin(state.normal, state.v_in), // from normal to v_in
sin_theta_out = state.n_in*sin_theta_in/state.n_out,
theta_out,
v_out,
T, R
if (Math.abs(sin_thet... |
function checkpPrice(){
var pprice=$("input[name='pprice']").val();
var reg = /^[0-9]*$/;
if(pprice==""){
alert("商品价格不能为空");
// $("input[name='pprice']").focus();
return false;
}else if(!reg.test(pprice)){
alert("您输入的商品价格不符合要求,请重新输入");
// $("input[name='pprice']").focus();
return false;
}
... |
import { AdminPage } from '../../pages/admin/admin';
const admin = new AdminPage();
describe( 'Admin', () => {
beforeEach( () => {
admin.open();
admin.login();
} );
it( 'should login', () => {
cy.contains( 'Welcome' );
} );
it( 'should be able to edit a page', () => {
admin.openMostRecent... |
const assert = require("assert");
const { TonClient, signerNone, signerKeys, signerExternal, abiContract,
builderOpInteger, builderOpCell, builderOpCellBoc, builderOpBitString } = require("@tonclient/core");
const { Account } = require("@tonclient/appkit");
const { libNode } = require("@tonclient/lib-node");
const ... |
import React, {Fragment} from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
TouchableOpacity,
Image,
TextInput,
Modal,
} from 'react-native';
import {SvgXml} from 'react-native-svg';
import SVG from '../components/SvgComponent';
import LabelInput from '../components/... |
//1- Imprimir por consola un mensaje guardado en una variable usando la función console.log()
var hola = "Hola";
console.log(hola);
|
/**
*
* customOrbitControls.
*
* @project localhost_panoplayer
* @datetime 01:13 - 30/07/2015
* @author Thonatos.Yang <thonatos.yang@gmail.com>
* @copyright Thonatos.Yang <https://www.thonatos.com>
*
*/
exports.dragControls = function (object,domElement,mobile) {
this.object = object;
... |
import React,{Component} from 'react'
import PropTypes from 'prop-types';
import './index.css'
import AuthProvider from '../../../funStore/AuthProvider'
import promiseFile from '../../../funStore/UploadXHR'
import {API_PATH} from '../../../constants/OriginName'
import {sendEvent} from '../../../funStore/CommonFun'
exp... |
/*var x = 0;
while(x < 10){
document.write("Numero: " + x + "</br>");
x ++;
}
document.write("Finalizando o loop...");
for (x = 0; x < 10; x++) {
document.write("Numero: " + x +"</br>");
}
*/
function verificar(){
var n1 = document.getElementById("n1").innerHTML;
var n2 = document.getElementById("n2").value;
... |
import styles from "../styles/scoreboard.module.scss";
const Scoreboard = ({ score }) => {
return (
<div className={styles.scoreBoard}>
<div className={styles.title}>
<img src="./images/title.png" />
</div>
<div className={styles.score}>
<p>SCORE</p>
<h1 className="score... |
'use strict';
// Use application configuration module to register a new module
ApplicationConfiguration.registerModule('grid', ['ui.grid']);
|
import { createSelector } from 'reselect';
// Selector
const getBalance = state => state.balance;
// Reselect function
export const getBalanceState = createSelector(
[getBalance],
balance => balance
);
|
'use strict';
//Constantes de VIP.
const Attributes = require('../Classes/Attributes');
const Libraries = require('../Base/Libraries');
/**
* Función getLaunchRequestMessage: encargada de devolver el mensaje de bienvenida.
* @param {Attributes} attributes
* @returns {Attributes} attributes
*/
async function getL... |
//TODO - change functions to use args rather than list of params
var nodes = new Array();
var player = new Player();
var worldVars = [];
worldVars['mummy-asleep'] = true;
worldVars['daddy-asleep'] = true;
function init ()
{
goNode('start');
player.update();
console.log("OK");
}
function goNode (nodeId... |
import React, { useState, useEffect } from "react";
import { useParams } from "react-router-dom";
import Table from "react-bootstrap/Table";
import Card from "react-bootstrap/Card";
const Orders = () => {
const [orderData, setOrderData] = useState([]);
const { id } = useParams();
useEffect(() => {
fetch(`h... |
var errorFactory = require('error-factory');
var objectUtil = require('./object');
var resources = require('./resources');
var ModuleContextException = errorFactory('beyo.ModuleContextException', [ 'message', 'messageData' ]);
module.exports = createModuleContext;
/**
Create a module context
*/
function createMo... |
const exphbs = require('express-handlebars');
const path = require('path');
const helpers = {
ifeq: function(a, b, options) {
if (a === b) {
return options.fn(this);
}
return options.inverse(this);
},
};
const hbs = exphbs.create({
helpers,
extname: '.hbs',
partialsDir: path.resolve(__dirn... |
module.exports = function () {
// document用于测试浏览器端
let div = document.createElement('div')
div.innerHTML = 'Hello world'
document.body.appendChild(div)
return 'Hello World'
} |
module.exports = {
devServer: {
host: 'test-ssxl.speiyou.com',
port: 5555
}
} |
// Route Search
import React, { useState } from "react";
import Jumbotron from "../components/Jumbotron";
import { Col, Row, Container } from "../components/Grid";
import { Input, FormBtn, LogoutBtn } from "../components/Form";
import { Link } from "react-router-dom";
import Searches from "../components/Searched";
impo... |
import React from 'react'
const Specials = () => {
return(
<h3 className="specials-banner">
Friday Special -- 10% off ALL Miso Ramen
</h3>
)
}
export default Specials |
// a partir do useState é possível usar estados nos componentes
import React, { useState} from 'react';
import IndiretaFilho from './IndiretaFilho';
export default props => {
// useState gera um array com o valor passado como parametro e uma função
// para alterar o valor (que será chamada a partir de setNome... |
/*global syncRequest, Meteor */
var request = Meteor.npmRequire('request');
var makeErrorByStatus = function(statusCode, content) {
var MAX_LENGTH = 500; // if you change this, also change the appropriate test
var truncate = function(str, length) {
return str.length > length ? str.slice(0, length) + '...' : s... |
import React, {useState, useEffect, useContext} from "react";
//import { userContext } from "../../utils/Context.js";
//components
import Row from '../Row';
import Col from '../Col';
import { Thumbnail } from "./Thumbnail";
import { Snippet } from "./Snippet";
import { SaveBtn } from "./SaveBtn";
//style
import './styl... |
var node = new Node({ id:"start" });
node.addText("It's Saturday morning. <br /><br /> You wake up early and can hear lots of noise downstairs.");
node.addText("What do you do?");
node.addOption('Go back to sleep', "back-to-sleep");
node.addOption("Go into Mummy and Daddy's room", "mummy-and-daddy-room");
node.addOpt... |
let priceRanges = [
{ label: '$', tooltip: 'Inexpensive', minPerPerson: 0, maxPerPerson: 10},
{ label: '$$', tooltip: 'Moderate', minPerPerson: 10, maxPerPerson: 25},
{ label: '$$$', tooltip: 'expensive', minPerPerson: 25, maxPerPerson: 35}
];
let restaurants = [
{ averagePerPerson: 5 }
] |
(function(window,document,undefined) {
// only run this code if there is a google map component on the page
var gMapEl = document.querySelector('.js-google-map');
if(typeof gMapEl === 'undefined'){
return;
}
// after the api is loaded this function is called
window.initMap = function() {
... |
const db = require('../config/db');
Locations = new Object();
Locations.benson = [];
Locations.case_ = [];
Locations.engineering = [];
Locations.gemmill = [];
Locations.koelbel = [];
Locations.norlin = [];
Locations.wise = [];
Locations.bensonCount = 0;
Locations.case_Count = 0;
Locations.engineeri... |
define('main', ['application', 'blockUI','rd.controls.BasicSelector','rd.controls.Selector',
'rd.controls.FoldSelector','rd.containers.Accordion','rd.controls.Input','rd.controls.Table',
'rd.controls.TabSelect','rd.controls.ComboSelect','rd.controls.TabSelector','rd.controls.Graph',
'rd.containers.Tab','rd.contro... |
const TestCollectionsJson={
"collections": [
{
"extent": {
"vertical": {
"vrs": "VERTCS[\"WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PARAMETER[\"Vertical_Shift\",0.0],PARAMETER[\"Direction\",1.0],UNIT[\"Meter\",1.0]],AXIS[\"Up\",UP]",
"name": ... |
const URI = require('uri-js');
const getUrls = (content) => {
// get all urls in the content string
const host = content
.split('htt')
.filter(string => string[0] === 'p')
.map(element => {
const [string] = element.split(' ');
// just for case
if (!string) {
return null;
... |
// Arcanoid type game by kamilczerwinski22
/// VARIABLES
// Make canvas
const cvs = document.getElementById("arcanoid_canvas");
const cvs_ctx = cvs.getContext("2d");
cvs_ctx.lineWidth = 2;
// Ending screen div`s
const game_over = document.getElementById("game_over");
const game_win = document.getElementById("win");... |
/* eslint-disable new-cap, prefer-destructuring */
const router = require('express').Router({ strict: true });
const logger = require('winston').loggers.get('scheduler-logger');
// const TopicManager = require('../models/redis/topics-manager');
// const mysql = require('mysql');
const startConnection = require('../util... |
import mailgun from "mailgun-js";
const transporter = mailgun({
apiKey: process.env.MAILER_API_KEY,
domain: process.env.MAILER_DOMAIN
});
export default async (email, url) => {
const data = {
from: "<support@instagram-clone.ml>",
to: email,
subject: "Instagram-clone",
html: `<a href="${url}">${u... |
import React from "react";
import { withFirebase } from "../Firebase";
import { compose } from "recompose";
//import { withRouter } from "react-router-dom";
import { AuthUserContext } from "../Session";
//import "./searchbar.scss";
class Popover extends React.Component {
render() {
return (
<div className=... |
//Base
import React, { Component } from 'react';
//Component
import ContactForm from '../../../molecules/ContactForm';
class MapOrganism extends Component {
render() {
return (
<ContactForm
linktype="btn"
submitText="Submit"
headinglevel = "2"
ti... |
/* eslint-disable no-console */
import { call, put } from 'redux-saga/effects';
import { NotificationError, NotificationSuccess } from '../../utils/notification';
import api from '../../services/api';
import ToolsActions from '../ducks/tools';
export function* getToolsRequest({ searchText, searchTagOnly }) {
try ... |
const jwt = require('jsonwebtoken')
const User = require('../models/user')
const Address = require('../models/address')
const {module: config} = require('../config')
const Order = require('../models/order')
exports.addUser = async (newUser) =>
{
const user = new User(newUser)
try
{
return await... |
import React, { Component } from "react";
import mapboxgl from "mapbox-gl";
import "./Map.css";
import { MAPBOX_TOKEN } from "./config";
mapboxgl.accessToken = MAPBOX_TOKEN;
export class Map extends Component {
componentDidMount() {
new mapboxgl.Map({
container: this.mapContainer,
style: "mapbox://s... |
'use strict';
const { MongoClient } = require('mongodb');
// Uri for the Docker setup
//const mongoUri = `mongodb://mongodb:27017/novoresume`;
//console.log("entered db connection");
// Uri for the localhost setup
const mongoUri = `mongodb://localhost:27017/novoresume`;
//mongodb://localhost:27017/?readPreference=... |
// @flow
import { hylo } from "static-land-recursion-schemes/lib/schemes";
import type { ExprF, Expr } from "./expression-ast";
import {
Plus, Times, Paren, Num, exprFunctor, prj
} from "./expression-ast";
const evalAlg = expression => {
const ex = prj(expression);
return (
ex instanceof Plus ? ex.left ... |
/*
*
* SignUpForm
*
*/
import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { FormattedMessage } from 'react-intl';
import { createStructuredSelector } from 'reselect';
import { Field, reduxForm } from 'redux-form/immutable';
import { submitSignupUser } from 'containers/App/actio... |
var xSelector = function (selector) {
return {
selector: selector,
locateStrategy: "xpath",
};
};
module.exports = {
// can be string or function
url: "",
elements: {
// shorthand, specifies selector
playSpace: ".css-1842iib.e6jvphj1",
aboutSpace: ".css-5hcn... |
String.prototype.splice = function(idx, rem, str) {
return this.slice(0, idx) + str + this.slice(idx + Math.abs(rem));
};
$(document).ready(function(){
$('button.inputWordBtn').click(function(event){
event.preventDefault();
var inputWord = $('input.inputWord').val();
var word = inputWord;
var wordS... |
const removeDom = (e) => {
if (e) {
e.parentNode.removeChild(e);
}
}
module.exports = {
removeDom
}; |
import React from "react";
function Formacao({ obj }) {
return (
<div className="sidebar">
<h3>Educação</h3>
{obj.map((obj) => (
<div key={obj.id} className="lista-de-formacao">
<li >
<h4>{obj.instituicao}</h4>
<p>{obj.curso}</p>
<p>{o... |
module.exports = function(app, io) {
var chat = new Chat(io);
// io.on('connection', function(socket) {
// console.log('User ' + socket.id + ' has connected!');
//
// socket.on('disconnect', function() {
// console.log('user ' + socket.id + ' has disconnected!');
// });
//
// socket.on('m... |
/*!
* jQuery FitTitle Plugin
* Original author: Eric Wafford
*
* Licensed under the MIT license
*/
;(function ( $ ) {
$.fn.twFitTitle = function( options ) {
// Setup options
var pluginName = 'twFitTitle',
settings = $.extend(
{
'minFontSize' : Number.NEGATIVE_INFINITY,
... |
import React from "react";
import { Container, Jumbotron, Row } from "react-bootstrap";
const About = () => {
return (
<>
<div className="container">
<div className="divSpacing"></div>
<Row>
<Jumbotron>
<Container>
<div>
<p>
... |
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
Alert,
Button,
Platform,
StyleSheet,
Text,
View
} from 'react-native';
import MapView from './MapView.js';
import { NativeEventEmitter, NativeModules } from 'react-nat... |
function PlaySound(melody) {
var snd = new Audio(melody);
snd.play();
}
|
import React from 'react';
import {DataTable} from 'primereact/components/datatable/DataTable';
import {Column} from 'primereact/components/column/Column';
const PhoneBook = (props) => {
return(
<div>
<DataTable value={props.phoneBook}>
<Column field="name" header="Full Name" />
<Column fi... |
var singlePlayerPausedState = {
create: function(){
drawPatternBG("#000088", "#944d94");
buttonTint = 0xeeaffe;
music.stop();
var titleLabel = game.add.text(80, 80, getText("SinglePlayerPaused", 0),getStyle("title"));
var buttonStyle = getStyle("button_regular");
btnResume = game.add.button(game.world.wid... |
import React, { Component } from 'react'
import { Link } from 'react-router-dom'
class Support extends Component {
constructor (props) {
super(props)
this.state = {
first: '',
last: '',
email: '',
question: '',
}
this.handleChange = this.handleChange.bind(this)
this.handle... |
$(document).ready(function () {
function superhero() {
var queryURL = "https://superheroapi.com/api.php/10164273699360858/search/batman"
$.ajax({
url: queryURL,
method: "GET",
}).then(function (response) {
console.log(response)
console.log(re... |
const userSignup = document.getElementById('signup');
const signupBtn = document.getElementById('register');
const api = 'https://deferral-banka-app-1.herokuapp.com/api/v1/auth/signup';
const firstNameError = document.getElementById('firstNameError');
const lastNameError = document.getElementById('lastNameError');
con... |
import event from './event'
import map from 'ramda/src/map'
import toPairs from 'ramda/src/toPairs'
export const formEvent = (ev) => (el, values) => {
const mockEvent = {
target: map(([name, value]) => ({ value, name }), toPairs(values)),
preventDefault: () => {}
}
return event(ev, mockEvent)(el)
}
/**... |
import React, { useCallback, useEffect, useRef, useState } from "react"
import { LayoutChangeEvent, StyleSheet, View, TouchableWithoutFeedback, Animated, Text } from "react-native"
import Icon from "react-native-vector-icons/MaterialCommunityIcons"
import { colors } from "../theme"
export const PLAYER_HEIGHT = 50
const... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
var Jet = function(){
var _jetImageWidth = null;
var _jetImageHeight = null;
var _jetPositionX = null;
var _jetPositionY = null;
var _moveSpeed = null;
var _context = null;
var _ima... |
export const cards = [
{
image:
'https://vader.news/__export/1592538255681/sites/gadgets/img/2020/06/19/cabecera-breaking-bad.jpg_1889316708.jpg',
title: 'Seasons',
link: '/seasons',
},
{
image: 'https://i.blogs.es/16e585/breaking-bad/1366_2000.jpg',
title... |
import React from "react";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
const BasicExample = () => (
<Router>
<div>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/ListA">ListA</Link>
</li>
<li>
<Link... |
console.log("Hello from Javascript");
var dayjs = require('dayjs')
// //import dayjs from 'dayjs' // ES 2015
console.log(dayjs().format());
var equal = require('fast-deep-equal');
// Babel Input: ES2015 arrow function
console.log(equal({foo: 'pig'}, {foo: 'waffle'})); // true |
var log = function(s) {
document.getElementById('text').innerHTML = '' + s;
}
|
define('app/views/common/sitenav', [
'jquery',
'underscore',
'magix',
'app/util/index'
], function($, _, Magix, Util) {
return Magix.View.extend({tmpl:"<div class=sitenav> <div class=\"sitenav-bd wrap\" bx-name=\"components/sitenav\"></div> </div>", init: function() {
var me = this
me.observeL... |
export default async function handler(req, res) {
const { shapeId } = req.query;
let sql = `SELECT s.likes FROM tryshape.shapes s WHERE s.shape_id='${shapeId}'`;
const request = await fetch(process.env.NEXT_PUBLIC_DB_URL, {
method: "POST",
headers: {
"Content-Type": "applicatio... |
import { X_WINS, O_WINS, TIE } from '../helpers/actionTypes'
import { checkVictory } from '../helpers/resultHelper'
export function checkResult(board) {
if (checkVictory(board, 'X')) {
return {
type: X_WINS
}
} else if (checkVictory(board, 'O')) {
return {
type: O_WINS
}
} else {
... |
import React from "react";
import { Story } from "storybook/assets/styles/common.styles";
import Modal from "@paprika/modal";
import ProgressBar from "../../src";
export default function ProgressBarModal() {
return (
<Story>
<Modal isOpen>
<Modal.Content>
<ProgressBar
header="... |
import React from 'react'
import { Link, Redirect} from 'react-router-dom';
class SessionForm extends React.Component {
constructor(props) {
super(props);
this.state = {
username: "",
password: "",
};
this.handleSubmit = this.handleSubmit.bind(this)
}
update(field) {
return e => this.... |
import React, { Component } from 'react';
import {Map, Marker, GoogleApiWrapper} from 'google-maps-react';
import Modal from 'react-responsive-modal';
import ImagesAP from './ImagesAP.js';
const map_Key = "AIzaSyAD282YtNT5yIr79A9vtGC-qBC2c0WXUdk";
export class MapContainer extends React.Component {
state = {... |
var CameraViewer=CameraViewer||{};
var globalviewer = {};
var camera = [];
var leftClickHandler = null;
var leftDownHandler = null;
/**
* [init 地球容器ID]
* @param {[type]} earthId [description]
* @return {[type]} [description]
*/
CameraViewer.init=function(earthId,baseImageryProvider)
{
this.con... |
import { Grid } from '@material-ui/core';
import { Forward } from '@material-ui/icons';
import { Fragment } from 'react-is';
import { shallowEqual, useDispatch, useSelector } from "react-redux";
import { getQuery } from "../action/query";
import DailyCard from './DailyCard';
import { makeStyles } from '@material-ui/cor... |
import { GET_POSTS, UPDATE_DIMENSIONS, GET_POST_BY_ID, GET_COMMENTS_BY_POST_ID, TOGGLE_ADMIN_VIEW, TOGGLE_ADMIN_USER_VIEW, TOGGLE_FILTER, UPDATE_SEARCH,GET_USERS } from '../actions/types'
const initialState = {
posts: [],
users: [],
activePost: {
_id: '',
createur: {
_id: '',
... |
import { connect } from 'react-redux';
// TODO: Eventually this will get followed playlists as well
// it's currently gonna get playlists by current user id
|
'use strict';
const crypto = require('crypto'),
parseToken = /^[\w+/]{84}\|(\d+)/,
vowels = 'aeiouy'.split(''),
consonents = 'bcdfghjklmnpqrstvwxz'.split('');
function sanitizeAccount(item) {
item._writable = true;
item._username = item.__username;
delete item.__auth;
return item;
}
function generatePassword(len... |
function entropy(grid, p) {
return grid[p].length;
}
function getBest(grid) {
let best = [];
minEntropy = 1000;
for (let p = 0; p < grid.length; p++) {
const options = grid[p];
if (options.length == 1) {
continue;
}
const e = options.length;
if (e < m... |
/* eslint-disable linebreak-style */
const express = require('express');
const router = express.Router();
const Init = require('../../controllers/init');
router.get('/', Init.info);
router.post('/validate-rule', Init.ruleValidation);
module.exports = router; |
import BsNavLinkToComponent from 'ember-bootstrap/components/bs-nav/link-to';
import defaultValue from 'ember-bootstrap/utils/default-decorator';
/**
* Extended `{{link-to}}` component for use within Navbars.
*
* @class NavbarLinkTo
* @namespace Components
* @extends Components.NavLinkTo
* @public
*/
export def... |
import React from "react";
export class Search extends React.Component {
state = {
search: '',
type: 'all',
}
handleKey = (event) => {
if (event.key === 'Enter') {
this.props.searchMovies(this.state.search, this.state.type);
}
}
handleRadio = (event) =... |
import React, { Component } from 'react';
import Navigation from './Navigation';
import Header from './Header';
import Projects from './Projects';
import About from './About';
import Contact from './Contact';
import Footer from './Footer';
import '../style/main.css';
import content from '../content.json';
class Portfo... |
import {html} from '../../node_modules/lit-html/lit-html.js';
import {getArticles} from "../api/data.js";
const topicTemplate = (topic) => html`
<a class="article-preview" href="/details/${topic._id}">
<article>
<h3>Topic: <span>${topic.title}</span></h3>
<p>Category: <span>${topic... |
//账号名重复
$.extend($.fn.validatebox.defaults.rules, {
existAccount: {
validator: function (value, param) {
$.ajax({
url: param[0],
type: 'post',
data: {
"name": value
},
success: function (data) {... |
import Swal from "sweetalert2";
const GET_USER_LOGIN = "GET_USER_LOGIN";
const getUserLogin = (data) => {
return {
type: GET_USER_LOGIN,
data,
};
};
const loginAdmin = (formData, history) => async (dispatch) => {
try {
const url = `${process.env.REACT_APP_BACKEND_ENDPOINT}/api/adm... |
import React, { Component } from 'react';
class RoomList extends Component {
constructor(props) {
super(props);
this.setRoomName = this.setRoomName.bind(this);
this.createRoom = this.createRoom.bind(this);
this.state = {
room: {
name: null,
},
player: {
name: null,
... |
import React, {Component} from "react"
class Product extends Component {
render() {
let {name,price,img_url,id} = this.props
return (
<article className="product">
<img src={img_url} />
<h3>{name}</h3>
<h4>{price}</h4>
<button onClick={() => t... |
const express = require('express')
const app = express();
const bodyParser = require('body-parser');
const path = require('path')
const routes = require('./backend/config/routes')
const {Client} = require('pg')
const PORT = process.env.PORT || 1979
const log = (stuff) => console.log(stuff)
const client = new Client({... |
var keystone = require('keystone');
var Types = keystone.Field.Types;
/**
* Logo Model
* =============
*/
var Logo = new keystone.List('Logo', {
autokey: { from: 'name', path: 'key', unique: true },
track: true
});
Logo.add({
name: { type: String, required: true, index: true },
publishedDate: { type: Date, de... |
/*jshint globalstrict:false, strict:false, maxlen: 400 */
/*global fail, assertEqual, AQL_EXECUTE */
////////////////////////////////////////////////////////////////////////////////
/// @brief test failure scenarios
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2010-2012 triagens GmbH, Cologne, Germany
///
/// Li... |
#!/usr/bin/gjs
const Lang = imports.lang;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Gdk = imports.gi.Gdk;
const Gio = imports.gi.Gio;
const WebKit = imports.gi.WebKit;
const Soup = imports.gi.Soup;
// This folder should be created on app install. The expected files are
// cookies,txt and rdio-ic... |
import 'react-native-gesture-handler';
import React from 'react'
import styled from 'styled-components/native'
import { Restaurants } from './Pages/Restaurants'
import { Restaurant } from './Pages/Restaurant'
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-n... |
const settings = [
{ threshold: "207030ff", up: 1 },
{ threshold: "808077ff" },
{ threshold: "bb2277ff", up: 1, flip: 1 },
]
const boards = document.querySelectorAll("canvas")
Array.from(boards).forEach((canvas, i) => {
const target = canvas.getContext("2d")
const config = settings[i]
const a = config.up... |
import React, { useEffect } from "react";
import Message from "./Message";
import AcceptMessage from "./AcceptMessage";
import * as query from "api/queries";
export const MessagesContainer = ({ room, sender, fetchMore }) => {
const messagesEndRef = React.createRef();
useEffect(() => {
const scrollToBottom =... |
//header with button that "click" starts 5 second countdown
//and starts generating a math.random amount of circles between
//1 and 8
//container for the circles
//if buttons.forEach buttons.style.color === "green"
// && ${timer} === 0; display you win else if timer === 0 you lose
//function to set the button color c... |
import path from 'path';
import * as packageJson from '../package.json';
const config = {
entry: './app/index.js',
module: {
rules: [
{
exclude: /node_modules/,
test: /\.js?$/,
use: {
loader: 'babel-loader',
},
},
],
},
output: {
filename: 'bund... |
import React from 'react';
import lottie from 'lottie-web';
export default function useLottieAnimation(animationData, elementRef) {
const ref = React.useRef(null);
React.useEffect(() => {
return () => lottie.destroy();
}, []);
if (ref.current === null && elementRef.current !== null) {
ref.current = l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.