text stringlengths 7 3.69M |
|---|
module.exports = Object.freeze({
single: 'single',
teams: 'teams',
});
|
import React, { useState, useEffect } from "react";
import "./App.css";
import { FiLoader } from "react-icons/fi";
function App() {
const [search, setSearch] = useState(null);
const [topic, setTopic] = useState("react");
const [information, setInformation] = useState();
const [page, setPage] = useState(1);
c... |
import { Map } from 'immutable'
import { saveTweet, fetchTweet } from 'helpers/api'
import { closeModal } from './modal'
import { addSingleUsersTweet } from './usersTweets'
const FETCHING_TWEET = 'FETCHING_TWEET'
const FETCHING_TWEET_ERROR = 'FETCHING_TWEET_ERROR'
const FETCHING_TWEET_SUCCESS = 'FETCHING_TWEET_SUCCESS... |
TEMP['initAir'] = function(air){
var PublicRander = function(){
// 设置主题css
this.setStyle(air.Options.themePath+'style.css',"theme-"+air.Options.theme+"-style");
// 获取UI模块
var ui = air.require('UI');
// 获取icons信息
var icons = air.require('icons');
// 清除图标节点里面的内容... |
config({
'editor/plugin/fore-color/cmd': {requires: ['editor/plugin/color/cmd']}
});
|
const fs = require('fs');
const path = require('path');
const ext = '.' + process.argv[3];
fs.readdir(process.argv[2], function(err, list) {
if (err) {
console.log(err);
return;
}
const filterdList = list.filter(function(name) {
return path.extname(name) === ext;
});
filterdL... |
self.__precacheManifest = [
{
"revision": "7fabae31eb077768646a",
"url": "/static/js/main.f363061d.chunk.js"
},
{
"revision": "fdfcfda2d9b1bf31db52",
"url": "/static/js/runtime~main.c5541365.js"
},
{
"revision": "120486d5ea3d110ed94e",
"url": "/static/js/2.a45a557d.chunk.js"
},
{
... |
import Vue from 'vue'
import Vuex from 'vuex'
import { Toast } from 'vant';
Vue.use(Toast);
Vue.use(Vuex)
export default new Vuex.Store({
state: {
arr:[],
userArr:[],
Hotel:[],
//邮箱验证
emailRules: [{
required: true,
message: '手机号不能为空',
trigger: 'onBlur'
}, {
// 自定义校验规则
validato... |
const fs = require('fs')
const fsp = require('fs').promises
const which = require('which')
const {spawn, spawnSync} = require('child_process')
const path = require('path')
const tar = require('tar')
const defaultSpawnOptions = {
shell: true,
stdio: ['ignore', 'inherit', 'inherit']
}
const defaultSpawnOptionsWithIn... |
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var autoprefixer = require('autoprefixer');
function getBabelPresets(defaultPresets) {
var presets = defaultPresets;
if(!process.env.NODE_ENV) {
presets.push('react-hmre')
}
return presets;
}
function g... |
$(document).ready(function () {
var index = 0; //used to determine which question we are on
var right = 0;
var wrong = 0;
var guessed;
var correctAnswer= "";
var hasGuessed= false;
var timer= 10;
//all correct answers are in index 0, we use a shuffle function to randomize where they appear
var questionSet = [
... |
'use strict';
const angular = require('angular');
const ngAdventure = angular.module('ngAdventure');
//map service is injected into player service
//$q is promises for angular
ngAdventure.factory('playerService', ['$q', '$log', 'mapService', playerService]);
function playerService($q, $log, mapService) {
$log.debu... |
/*
# ------------------ BEGIN LICENSE BLOCK ------------------
#
# This file is part of SIGesTH
#
# Copyright (c) 2009 - 2015 Cyril MAGUIRE, <contact(at)ecyseo.net>
# Licensed under the CeCILL v2.1 license.
# See http://www.cecill.info/licences.fr.html
#
# ------------------- END LICENSE BLOCK -------------------
*/
/... |
import axios from "axios";
import { API_URL } from '../constants';
import authHeader from './auth-header';
class PostService{
postMessage(content,file){
let formData = new FormData();
formData.append('image', file);
formData.append('content', content);
return axios.post(API_URL +... |
/** @jsx React.DOM */
var React = require('react'),
Router = require('react-router');
var Util = require('../../../util'),
Actions = require('../../../actions');
var Header = require('../header'),
//Inlude the tabs
Company = require('./company');
... |
import React, { Component } from 'react';
import { Input } from 'antd';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
const Search = Input.Search;
class SearchBar extends Component {
constructor(props) {
super(props);
}
onSearch = (keyword) => {
if (keyword !== '... |
import React from 'react';
import ReactDOM from 'react-dom';
import Pomodoro from './components/pomodoro';
const pomodoro = <Pomodoro></Pomodoro>;
ReactDOM.render(pomodoro, document.querySelector('.app'));
// Making a change from pomKing |
import React, { Component } from 'react'
import styled from 'styled-components'
import { Label, Input, CheckboxInput, Textarea } from '../../mia-ui/forms'
// import {Row, Column} from '../../mia-ui/layout'
import { Button } from '../../mia-ui/buttons'
// import Snackbar from '../../mia-ui/Snackbar'
import { Spinner, Lo... |
import React from "react";
import ActualDate from "./ActualDate";
import WeatherIcon from "./WeatherIcon";
import WeatherTemperature from "./WeatherTemperature";
import "./App.css";
export default function WeatherInfo(props) {
return (
<div className="WeatherInfo">
{/* Main : city, day, descri... |
import axios from 'axios';
import fetchPosts from './fetchPosts';
const baseURL="https://kavya-lambdagram.herokuapp.com";
function addComment(newComment,postId,setPosts){
console.log('newcomment in addcomment=',newComment)
axios.post(`${baseURL}/api/posts/${postId}/comments`,newComment)
.then((res)=>{
console.... |
//Remove Button, removes all current notes;
d3.select('.remove')
.on('click', function() {
d3.selectAll('.note')
.remove();
});
//Surprise Me Button
d3.select('.lucky')
.on('click', function(){
d3.selectAll('.note')
.style('color', randomRGB)
.style('background-color', r... |
'use strict';
describe('Filters:hostNameFromUrl', function(){
var filter;
beforeEach(module('angularTestApp'));
beforeEach(inject(function($filter){
filter = $filter('hostNameFromUrl');
}));
it('should return hostname from url', function(){
var result = filter('http://www.yandex.ru/... |
import React, { Component } from "react";
export default class Carousel extends Component {
constructor() {
super();
this.state = {};
}
render() {
return (
<div id="carouselBlk">
<div id="myCarousel" className="carousel slide">
<div className="carousel-inner">
... |
// Libraries
import React from 'react';
// Components | Utils
import UserAccount from '../UserAccount';
import getSounds from '../../../utils/soundUtils';
// Assets
import * as Styled from './styles';
import WindowsXPShutdown from '../../../assets/images/winxp-shutdown.webp';
import WindowsXPLogo2 from '../../../assets... |
import thunkMiddleware from 'redux-thunk';
import { configureStore, getDefaultMiddleware } from '@reduxjs/toolkit';
import { createWrapper } from 'next-redux-wrapper';
import { deviceRegistryApi } from './services/deviceRegistry';
import selectedCollocateDevicesReducer from './services/collocation/selectedCollocateDevi... |
$(function () {
tradeRefreshTypeahead(true);
});
//*******************************
// COMPARE COUNTRY
//*******************************
$(function () {
$('#chartCompareModal').on('show.bs.modal', function (e) {
if (typeof e.relatedTarget !== 'undefined') {
var chart = $(e.relatedTarget).p... |
const deepClone = (x) => {
if (typeof x !== 'object') return x;
let k; let tmp; const str = Object.prototype.toString.call(x);
if (str === '[object Object]') {
tmp = {};
Object.keys(x).forEach((key) => {
if (key === '__proto__') {
Object.defineProperty(tmp, key,... |
/**
* 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 or agreed to... |
let R = parseFloat(process.argv[2]);
let RATE_1 = parseFloat(process.argv[3]);
let RATE_2 = (RATE_1 * (1 + R)) / (1 - R);
console.log(RATE_2);
|
// Create a Ninja class
// add an attribute: name
// add an attribute: health
// add a attribute: speed - give a default value of 3
// add a attribute: strength - give a default value of 3
// add a method: sayName() - This should log that Ninja's name to the console
// add a method: showStats() - This should sho... |
/**
* Created by Paweł on 18.04.2017.
*/
var connArray = [];
var resetAllLabels;
jsPlumb.ready(function() {
var p01 = jsPlumb.connect({
source:'p0',
target:'p1',
connector:"Straight",
paintStyle: {
strokeStyle: "#5b9ada",
lineWidth: 3
},
over... |
import React from 'react'
import './Infobox.css';
import CountUp from 'react-countup';
function Infobox({title, number, total, active, ...props}) {
if(number === undefined) {
return 'Loading...';
}
return (
<div onClick={props.onClick} className={`infobox ${active && "infobox--selected"}`}>... |
$(document).ready(function () {
loadBoats();
});
function loadBoats() {
$.getJSON("/boats.json", function (data) {
let boat_data = "";
$.each(data, function (key, value) {
let id = value.id
boat_data += '<tr>';
boat_data += '<td>' + value.name + '</td>';
boat_data ... |
const dr = __dirname;
console.log(`'${dr}'`)
const logCount = 10;
const fs = require('fs');
createLogFiles = () =>{
fs.readdir(dr, (err, files) => {
for(let i = 0; i<logCount; i++){
let logName = `log${i}.txt`;
console.log(`${logName}`);
if(!files.includes(logName)){
... |
import React from 'react';
import { Link } from 'react-router-dom';
const MobileNavLinks = () => {
return (
<div className='mobile-nav-links'>
<div className='close-mobile-nav-links'>
<Link to='/'>X</Link>
</div>
<ul>
<li>
<Link to='/'>Home</Link>
</li>
... |
module.exports = (fn) => {
return (req, res, next) => {//this way, catchAsync will return a function that takes req,res,next as params and executes the controller function with these params. If there is any error it is caught and passed to the global error handler function using catch(async)
console.log("inside ca... |
X.define('modules.request.sourcingRequest', ["model.productsModel", "modules.common.global", "modules.user.login", "modules.user.regist", "adapter.searchValidate","modules.common.multipleFiles","modules.common.checkIsIE", "modules.common.suspensionBox","modules.common.cookies","model.userModel","modules.common.commonRe... |
/**
* Created by Alan on 2016/9/7.
*/
/*----------------------------------------调仓图表弹窗---------------------------------------------*/
var selectOptionsUrl = "/api/selectOptions";
var xData, yData;
var chart;
var gammaList = {};
var VAR, gamma;
var slider;
var selected = false;
var idList = [];
$('.close_alert').clic... |
exports.seed = function(knex) {
return knex("organizations").insert([
{
name: "Alloy Technology Solutions",
phone: "8008008000"
},
{
name: "Test Organization 1",
phone: "5005005000"
}
]);
};
|
import Vue from 'vue'
import { generateAbsoluteURL } from '../../helpers/generate-absolute-url'
import { generateCategoryString } from './helpers/productHelpers'
const YEAR_IN_MILLISECONDS = 365 * 24 * 60 * 60 * 1000
export default function generateProductSchema (product) {
const isOffer = product.offer_type || (pro... |
import React, { PropTypes, PureComponent } from 'react';
import { App, Navbar } from 'containers';
export class MainLayout extends PureComponent {
static propTypes = {
children: PropTypes.oneOfType([PropTypes.array, PropTypes.object])
};
render () {
const { children } = this.props;
return (
... |
$(function(){
let second = $(window).width();
if (second < 1600)
{
$('.acceuil').css({left:'0.5%'});
};
$(window).resize(function(){
let first = $(window).width();
if (first < 1600)
{
$('.acceuil').css({left:'-20%'});
... |
var breads = [
"aish merahrah",
"ajdov kruchabeld",
"anadama bread",
"anpan",
"appam",
"arepa",
"babka",
"bagel",
"baguette",
"balep korkun",
"bammy",
"banana bread",
"bannock",
"bara brith",
"barbari bread",
"barmbrack",
"bastone",
"bazlama",
"beer bread",
"bhakri",
"bhatoora",
"bing",
"biscuit"... |
import { delay } from 'dva-react2/saga';
export default {
namespace: 'example',
state: {
count: 1,
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
dispatch({ type: 'watch' });
},
},
effects: {
*fetch({ payload }, { call, put }) { // eslint-disable-lin... |
import React from 'react';
import './style.css';
import { Link } from 'react-router-dom';
class DetalhesUsuario extends React.Component {
state = {
posts: [],
pessoa: {},
deuErro: false
}
componentDidMount() {
fetch('https://jsonplaceholder.typicode.com/users/' + this.props.mat... |
window.project = true;
// Project Shader Store
// Browser Window Services
//////////////////////////////////////////////
// Babylon Toolkit - Browser Window Services
//////////////////////////////////////////////
/** Firelight Audio Shims */
window.firelightAudio = 0;
window.firelightDebug = false;
i... |
(function ($) {
'use strict';
$(function () {
$('#show').avgrund({
height: 500,
holderClass: 'custom',
showClose: true,
showCloseText: 'x',
onBlurContainer: '.container-scroller',
template: '<p>برای وارد شدن به حساب توییتر یا فیسبوک ما روی دکمه مورد نظر کلیک کرده و برای بسته ... |
import { combineReducers } from 'redux';
import authentication from './authentication';
import cliente from './cliente';
import { routerReducer as routing } from 'react-router-redux';
export default combineReducers({
authentication,
cliente,
routing
});
|
'use strict';
const dotenv = require('dotenv');
// Travis doesn't see the .env file; it has the token/domain as env variables already
const fs = require('fs');
if (fs.existsSync('./.env')) {
dotenv.load();
}
const ACCT1_AUTH0_ID = process.env.ACCT1_AUTH0_ID;
const ACCT2_AUTH0_ID = process.env.ACCT2_AUTH0_ID;
const A... |
//** Merge Sort **//
// It's a combination of two things - merging and sorting!
// Exploits the fact that arrays of 0 or 1 elements are always sorted.
// Works by decomposing an array into smaller arrays of 0 or 1 elements, then building newly sorted arrays.
//** Merging Arrays **//
// In order to implement merge so... |
import axios from 'axios';
const initialState = {
data: [],
item: {},
isLoading: false,
hasMore: false
}
const photoReducer = (state = initialState, action) => {
switch (action.type) {
case 'GET_PHOTOS':
return {
...state,
data: Object.values([...state.data, ...action.data].reduce(... |
import React from 'react';
import Preloader from '../../components/preloader';
import ErrorIndicator from '../../components/error-indicator';
import CosmeticsList from '../../components/cosmetics-list';
import CartTable from '../../components/cart-table';
import cosmeticsModel from '../../common/models/cosmeticsModel'... |
/**
* @flow
*/
import * as JSON5 from 'json5';
import * as fs from './lib/fs';
import * as path from './lib/path';
import invariant from 'invariant';
import {resolve as resolveNodeModule} from './util';
import type {PackageManifest} from './types';
const MANIFEST_NAME_LIST = ['esy.json', 'package.json'];
type Man... |
'use strict';
angular
.module('sbAdminApp')
.directive('validator', function(ThirdPartyService) {
return {
require: 'ngModel',
link: function(scope, element, attr, mCtrl) {
function myValidation(value) {
if( ThirdPartyService.validateCI(value)... |
let assert = require("assert");
let fromWhere = require("../fromWhere");
describe('The fromWhere function',function(){
it('should return what town a registration number is from',function(){
assert.strictEqual(fromWhere('CA 123 456'),'Cape Town');
});
it('should return what town a registration number... |
import HyDeliveryOrderService from '@/services/hy/deliveryorder';
import { notification } from 'antd'
export default {
namespace: 'hydeliveryorder',
state: {
list: [],
modalDeliveryOrderList: [],
},
effects: {
*getModalList({ payload, callback }, { call, put }) {
const response = yield call... |
define([
'client/views/graph/graph'
],
function (Graph) {
var VolumetricsGraph = Graph.extend({
minYDomainExtent: 1,
numYTicks: 3,
components: function () {
var values = {};
values = {
xaxis: { view: this.sharedComponents.xaxis },
yaxis: { view: this.sharedComponents.yaxis ... |
import React from 'react';
import store from 'store';
import { getLikes, getWhiskey, getSearches, changeFavorite } from 'api/data';
import Suggestions from 'ui/suggestions';
import UserSearches from 'ui/userSearches';
import SearchInput from 'ui/searchInput';
import { Link } from 'react-router';
import StarRating from ... |
import React from 'react';
import {
Breadcrumb,
Button,
DatePicker,
Select,
Input,
Row,
Col,
Table,
Modal,
Tooltip,
Form,
Icon,
InputNumber,
Card,
Popconfirm,
message,
Spin,
Tabs,
ConfigProvider,
} from 'antd';
import { connect } from 'dva';
import CurrencySearchBar from '@/compone... |
class MissingPage {
constructor() {
this.createSection()
}
createSection() {
const div = document.createElement('div')
div.innerText = 'Kunde inte hitta kontakten du sökte efter :('
const main = document.querySelector('main')
main.append(div)
}
} |
var orderCode = ""+ddsc.getUrlParam("orderCode");
$(function(){
obj.queryList()
})
let obj = {
queryList() {
queryOrderinfos()
}
}
//查询
function queryOrderinfos(){
console.log(orderCode)
let obj = {
orderCode
}
myAjax.request({
url: basepath + "/orderinfo/queryOrd... |
'use strict';
/**
* @ngdoc overview
* @name vitacademicsForWebApp
* @description
* # vitacademicsForWebApp
*
* Main module of the application.
*/
angular
.module('vitacademicsForWebApp', [
'ngAnimate',
'ngAria',
'ngCookies',
'ngResource',
'ngRoute',
'ngSanitiz... |
const numeral = require('numeral')
module.exports.uptime = uptime => {
let unit = 'second'
if (uptime > 60) {
uptime = uptime / 60
unit = 'minute'
}
if (uptime > 60) {
uptime = uptime / 60
unit = 'hour'
}
if (uptime != 1) {
unit = unit + 's'
}
... |
AFRAME.registerComponent('mobile-move', {
schema: {
target: {type: 'string'},
height: {type: 'string', default: 2}
},
init: function () {
var el = this.el;
var target = document.getElementById(this.data.target);
var pos = el.getAttribute("position");
var heig... |
const expect = require('expect.js');
const int = require('./int');
describe('Day 09', () => {
it('Should support relative base instructions and print itself', () => {
expect(int([109, 1, 204, -1, 1001, 100, 1, 100, 1008, 100, 16, 101, 1006, 101, 0, 99])).to.eql([109, 1, 204, -1, 1001, 100, 1, 100, 1008, 100, 16,... |
(function(){
var MatchFactory = function($http){
var service="match";
var factory={};
var matchForUpdate =[];
factory.getDataForAddMatch = function(){
var req={
method:'GET',
url:'app/match',
params:{service:service,operation:'getaddmatch'}
}
return $http(req);
}
factory.addNewMatch ... |
import React from 'react'
import Section from './Section.jsx'
class Cta extends React.Component {
render () {
return (
<Section>
<h2>Get Started</h2>
<pre>npm i rgx</pre>
<p>
Read the docs on GitHub to learn more.
</p>
<a href='//github.com/jxnblk/rgx'
... |
// Creating a dummy state in App.js, and passing it to Todos via props as
// <Todos todos={ this.state.todos }/>
import React, { Component } from 'react';
import Todos from './Todos';
import AddTodo from './AddTodo';
class App extends Component {
// Dummy data
state = {
todos: [
{id: 1, content: 'buy s... |
// Items are things that exist inside a game tile and can be collected by
// and used by a player
function Item(settings) {
this.id = settings.id;
this.type = settings.type || '';
this.createdAt = settings.createdAt || new Date().getTime();
this.position = settings.position;
this.position.z = 0;
}
Item.proto... |
import test from 'ava'
import PetList from '../../src/js/views/pet-list'
test('should render component', function (t) {
const vnode = PetList.view()
t.is(vnode.children.length, 2)
t.is(vnode.children[0].tag, 'h2')
t.is(vnode.children[0].text, 'Adoptable Pets')
t.pass()
})
|
import React, { Component } from 'react';
import { MDBBtn } from "mdbreact";
import {connect} from 'react-redux'
class Header extends Component {
constructor(props)
{
super(props)
this.state=({
value:""
})
}
handlechange=(event)=>
{
this.setState({
... |
module.exports = {
preset: 'ts-jest',
moduleFileExtensions: ['ts', 'tsx', 'js'],
moduleNameMapper: {
'@/(.*)': ['<rootDir>/$1'],
},
testMatch: ['<rootDir>/**/*.spec.(ts|tsx)'],
watchPathIgnorePatterns: ['node_modules'],
watchman: false,
};
|
import { parse } from '../parse';
describe('parse', () => {
it('regular', () => {
const out = parse(
{
display: 'value',
button: {
border: '0'
},
'&.nested': {
foo: '1px',
... |
import socket from './socket'
(function() {
// let id = $('#id').data('id')
// if(!id)
// return;
let channel = socket.channel("report:get", {});
channel.on("update_report", event =>{
console.log("update report");
})
channel.join()
.receive("ok", resp => { console.log... |
const fs = require("fs");
function FileSystemWrapper(){
function read({filePath}){
return new Promise((resolve, reject) => {
fs.readFile(filePath, {encoding: "utf-8"}, (error, data) => {
if(!error) {
resolve(data);
} else {
... |
/**
* 一款小巧的jQuery拾色器组件v0.2.29.04.2014
* @version 0.2.29.04.2014
*
* @author Levi
* @url http://levi.cg.am/archives/3467
*/
;(function ($) {
$(function () {
$(document).bind('click', function() {
if ($iColor.is(':visible')) {
$iColor.fadeOut('fast')[0].tar = null;
... |
const errorText = "Невозможно определить координаты точки!<br>Укажите R!";
const blue = "#45688E";
const red = "red";
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext("2d");
const width = canvas.getAttribute("width");
const height = canvas.getAttribute("height");
const form = document.get... |
import 'whatwg-fetch';
// Node:fs is only available server-side, so in this case load the fs functions.
let readFileSync = null;
let fileExists = null;
if (import.meta.env.SSR) {
import('node:fs').then(
({ readFileSync: readFileSyncFunc, existsSync }) =>
{
readFileSync = readFileSyncFunc;
fileExi... |
import React from 'react'
import { WebView } from 'react-native-webview';
import { View, Text } from 'react-native'
export default class WebContainer extends React.Component {
static navigationOptions = {
title: '电子通行证',
};
render() {
const { navigation } = this.props;
const url = navigation.getPara... |
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {Link} from "react-router-dom";
import 'antd/dist/antd.css';
import { Card, Col, Row } from 'antd';
import { Icon } from 'antd';
import BannerAnim from 'rc-banner-anim';
import TweenOne, { TweenOneGroup } from 'rc-tween-one';
const { Ele... |
{
function beer_findAll(doc, meta) {
if (/^BEER/.test(meta.id)) {
emit(meta.id, null);
}
if (doc.type && doc.type == "beer") {
//emit(doc.id,null);
emit(doc.name, doc.id)
}
}
function brewery_findAll(doc, meta) {
if (/^BREWERY/.tes... |
import React, { useState, useEffect } from "react";
import { useParams } from "react-router-dom";
const CardInfoFull = () => {
const id = useParams().id;
const category = useParams().category;
const [infoId, setInfoId] = useState([]);
useEffect(() => {
const fetchApi = async () => {
// Fijate que co... |
import VueSocketIO from 'vue-socket.io'
export default async ({ Vue }) => {
Vue.use(new VueSocketIO({
debug: true,
// connection: `ws://${Vue.prototype.$config.server.base_url.replace(/http:\/\//, '')}`
connection: Vue.prototype.$config.server.base_url
// vuex: {
// store,
// actionPrefix... |
self.__precacheManifest = [
{
"revision": "5d9e4f5cc7cb20abea5b",
"url": "/react-image-gallery/static/js/runtime~main.5d9e4f5c.js"
},
{
"revision": "392b24d14ed8ba6b3ca8",
"url": "/react-image-gallery/static/js/main.392b24d1.chunk.js"
},
{
"revision": "1023a73806f1337a3dc0",
"url": "/r... |
import { useEffect, useContext } from "react";
import { AuthData } from "../../data/authData";
import { useHistory } from "react-router";
const SignInCallBack = () => {
const { signInRedirectCallback } = useContext(AuthData)
const history = useHistory();
useEffect(() => {
signInRedirectCallba... |
import $ from 'jquery';
export const hideContext = () => {
$(".react-contextmenu").css('display', 'none');
}
export const unhideContext = () => {
$(".react-contextmenu").css('display', 'block');
} |
import React from 'react';
function MainMenuCategry({img, text}){
const handleOnMouseEnter = (e) => {
e.preventDefault();
e.currentTarget.style.webkitFilter = 'grayscale(0%)';
e.currentTarget.querySelector('a').style.maxHeight = '5rem';
}
const handleOnMouseLeave = (e) => {... |
import React, { useEffect, useState } from "react";
import "./checkout.css";
import {
saveProduct,
getProductById,
deleteProduct
} from "../../../api/productApi";
export default function Checkout(props) {
console.log(props.match.params.id);
const [singleProduct, setSingleProduct] = useState({});
// fetc... |
var DEGREE_TO_RAD = Math.PI / 180;
// Order of the groups in the XML document.
var INITIALS_INDEX = 0;
var ILLUMINATION_INDEX = 1;
var LIGHTS_INDEX = 2;
var TEXTURES_INDEX = 3;
var MATERIALS_INDEX = 4;
var ANIMATIONS_INDEX = 5;
var NODES_INDEX = 6;
var GAMEVISUALS_INDEX = 7;
var STOP = false;
/**
* MySceneGraph cla... |
import React, { Component, Fragment } from "react";
import SearchBox from "./SearchBox";
import DataTable from "datatables.net-bs4";
const queryString = require("query-string");
import "datatables.net-buttons";
// import 'datatables.net-buttons-bs4'
// import 'datatables.net-buttons/js/buttons.colVis.min'
// import 'd... |
var str = 'some text';
function displayVariable(str) {
return str;
}
console.log(str);
|
import { useState, useEffect } from 'react';
import axios from 'axios';
import styles from '../../styles/Blog.module.css';
import Link from 'next/link';
import { useTransition, animated, config } from 'react-spring';
const BlogPost = ({ props: { post } }) => {
return (
<div className='blogpost'>
<Link href... |
/*
* Author: Abdullah A Almsaeed
* Date: 4 Jan 2014
* Description:
* This is a demo file used only for the main dashboard (index.html)
**/
/* global moment:false, Chart:false, Sparkline:false */
$(function () {
'use strict'
// Get context with jQuery - using jQuery's .get() method.
//var areaChartC... |
(function() {
function Message($firebaseArray) {
var ref = firebase.database().ref().child("messages");
var messages = $firebaseArray(ref);
return {
getByRoomId: function(roomId) {
var list;
ref.orderByChild('roomId').equalTo(roomId).on('value', function(d){
l... |
var TypeConverter = function(){
}
module.exports = TypeConverter;
TypeConverter.convert = function(value, type, defaultVal){
if (value == null) return defaultVal;
valStr = value.toString();
if (type == "integer")
return parseInt(valStr);
else if (type == "string")
return valStr;
else if (type == "nu... |
const test = require("ava");
const nock = require("nock");
const request = require("supertest");
const expressApp = require("./testApp")();
test("first request has correct context", t => {
t.plan(1);
const NUMBER = 6;
const REQUEST_ID = "abc-456";
nock("http://mytestdomain.com")
.get("/number")
.rep... |
module.exports.items=[1,2,3,4]
person={'name':'bob',
'age':20,}
module.exports.singlePerson=person |
import transactionSelector from 'selectors/transaction'
describe('selectors - transaction', () => {
it('returns the transaction item for the given id and null otherwise', () => {
const state = {
transactions: {
items: {
transactionA: { id: 'transactionA' }
}
}
}
exp... |
export const drawCard = (G, ctx, player, amount = 1) => {
for (let i = 0; i < amount; i++) {
if (G.players[player].deck.length != 0) {
let card = G.players[player].deck.pop();
G.players[player].hand.push(card);
}
}
};
|
import React from 'react';
import PropTypes from 'prop-types';
const MIN_SCALE = 0.25;
const MAX_SCALE = 8;
const SETTLE_RANGE = 0.1;
const ADDITIONAL_LIMIT = 0.2;
const DOUBLE_TAP_THRESHOLD = 300;
const ANIMATION_SPEED = 0.4;
const RESET_ANIMATION_SPEED = 0.8;
const INITIAL_X = 0;
const INITIAL_Y = 0;
const INITIAL_S... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.