text stringlengths 7 3.69M |
|---|
import { Scene } from 'phaser';
import styles from '../utils/styles';
const labelStyle = {
fontSize: '64px',
fontFamily: 'Acme',
color: '#ffffff',
align: 'center',
backgroundColor: '#2DAA58'
};
const labelConfig = {
x: 600,
y: 0,
origin: { x: 0.5, y: 0 },
padding: 20,
text: 'Lo... |
!function () {
function ContractCustomerController($scope, dataService) {
$scope.customer = dataService.customer
.get({ id: $scope.contract.customerId }).$promise;
}
angular.module('DNNT')
.controller('controller.contract.customer', ContractCustomerController);
... |
import React from 'react';
let Language = props => (
<div className='col-12'>
<div className="card">
<div className="card-header">
<h4>
<span className='fas fa-list-alt'></span> Languages <span className='badge badge-secondary float-right'>{props.count}</span... |
class Validator {
constructor(req, res) {
this.res = res;
this.req = req;
this.numericPattern = /^([0-9])*$/;
this.stringPattern = /^[a-z]*$/;
this.addressPattern = /^[a-zA-Z0-9.]*$/;
this.passwordPattern = /((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20})/;
this.emailPattern = /^([a-zA... |
import React from "react"
const PhotosList = props => (
<ul>
{props.photos.map(({ id, title, thumbnailUrl }, index) =>
<div key={index}>
<div>ID: {id}</div>
<div>TITLE: {title}</div>
<div>THUMB: {thumbnailUrl}</div>
<br/>
</div>
)}
</ul>
)
export default PhotosList
|
import React, { useState, useEffect } from "react";
import Link from "next/link";
import axios from "axios";
import { Button, Checkbox, Form, Input } from "antd";
import { MailOutlined, LockOutlined, UserOutlined } from "@ant-design/icons";
import { useDispatch } from "react-redux";
import styled from "styled-component... |
import * as React from 'react'
import matchMediaPolyfill from 'mq-polyfill'
import {render, screen} from '@testing-library/react'
function WindowSize() {
return (
<div>
<label id="inner-width">Inner Width</label>
<div aria-labelledby="inner-width">{window.innerWidth}</div>
<label id="inner-heig... |
import clone from 'clone';
import types from '../actionTypes';
import { requestCourses } from '../../services/courseService';
export function updateCourses(courses) {
const newCourses = clone(courses);
return {
type: types.UPDATE_COURSES_ARRAY,
courses: newCourses,
};
}
export function ge... |
import { WINS_CHART, ATTACK_POINTS } from 'consts';
export default function getAttackEffects(gandalfAttack, sauronAttack) {
const gandalfWins = WINS_CHART[gandalfAttack].includes(sauronAttack);
return {
gandalf: (gandalfWins ? 1 : -1) * ATTACK_POINTS[sauronAttack],
sauron: (gandalfWins ? -1 : 1) * ATTACK_... |
import React, {Component} from 'react';
import Button from 'react-bootstrap/Button'
class Misson extends Component{
constructor(){
super()
this.state = {
red: true
}
}
changeColor(){
this.state.red? this.setState({isClicked: this.state.red = false}) : this.setState({isClicked: this.state.red = tru... |
define(['constants'
, 'gameFSM'
, 'dirtTile'
, 'scoreText'
, 'storeText']
, function(constants
, GameFSM
, DirtTile
, ScoreText
, StoreText) {
var GameState = function(game) {
};
GameState.... |
import React from 'react';
import '../country.css';
const CountryFlag = (props) => {
return(
<div className='country-logo-wrapper'>
<img className='country-logo' src={props.country.imageUrl} alt='country-pix' />
<h3>{props.country.name}</h3>
</div>
)
};
export default CountryFlag; |
/**
* @type {String}
*
* @properties={typeid:35,uuid:"6B930AD2-2D0F-4D63-A475-DA4E800BC53F"}
*/
var vCodiceAzienda = '';
/**
* @type {String}
*
* @properties={typeid:35,uuid:"C57442D1-8087-462A-81D6-D38FB381D174"}
*/
var vUsername = '';
/**
* @type {String}
*
* @properties={typeid:35,uuid:"4C7EAEBC-2ACA-4B... |
const router = require("express").Router();
const noti = require("../../models/collegesmetadata");
router.get('/', async (req, res) => {
try {
var data = await noti.find({ clgid: req.query.clgid }, {
noti: 1
});
console.log(data+"kajdakjdlkajsldkja;ldk");
if (data.length... |
import React from 'react';
import 'normalize.css';
import './sidebar.css';
import './App.css';
import Helmet from 'react-helmet';
import {
BrowserRouter as Router,
Switch,
Route,
Link,
Redirect
} from "react-router-dom";
import { SidebarState, useSidebarState } from './state/sidebar-state';
import { elastic... |
const express = require('express')
const router = require('./routers')
const path = require('path')
const bodyParser = require('body-parser')
const session = require('express-session')
const app = express()
// 配置静态访问路径
app.use('/public',express.static(path.join(__dirname,'./public')))
app.use('/static',express.static... |
import { faCookieBite } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import React, {Component} from 'react';
import OrderRow from './order-row';
class AllOrders extends Component {
render() {
let allOrderData = [...this.props.allOrders];
... |
document.addEventListener('DOMContentLoaded', () => {
var calendarEl = document.getElementById('calendar');
var Next_year = document.getElementById('Year_array_next');
var Prev_Year = document.getElementById('Year_array_prev');
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: ... |
const moult = require("moult");
const http = require('http')
const Auth = require('./auth')
const utils = require('./utils')
const Crypto = require('./utils');
const fs = require('fs');
const app = moult.app("sketch-admin");
//const Auth = require('./auth');
//const key = fs.readFileSync('utils/secrets.json');
//co... |
brown_1_interval_name = ["新營","茄苳腳","鹽水","後寮","番子寮","孫厝寮","羊稠厝","頂洲","紅茄萣","新芳里","紅茄里","北紅茄萣","新渡子頭","渡子頭","南鯤鯓","北門","北門國中","雙春","雙春濱海<br />遊憩區"];
brown_1_interval_stop = [ // 2017.12.08 checked
["新營站","中營興業里","第一市場","中山路","圓環(第一銀行)","新營醫院","齊普","新營魚市場","太子路口","統聯客運"], // 新營
["茄苳腳","新營工業區","明達中學"], // 茄苳腳
["竹圍尾","橋南里"... |
export const PRODUCT_REQUEST = 'PRODUCT_REQUEST'
export const PRODUCT_SUCCESS = 'PRODUCT_SUCCESS'
export const PRODUCT_FAIL = 'PRODUCT_FAIL' |
import React, { Fragment } from "react";
import AdminMenu from "../AdminMenu/AdminMenu";
const AdminLayout = ({
title = "Title",
description = "Description",
className,
children,
}) => (
<div>
<AdminMenu />
<div className="jumbotron">
<h2>{title}</h2>
<p className="lead">{description}</p... |
$(document).ready(function() {
// ----- PROTOTYPE
function addPrototypeDamages(container, name, index) {
container.append($(container.attr('data-prototype')
.replace(/__name__label__/g, name + ' n°' + (index+1) + ' :')
.replace(/dndrules_weapon_weapon_edit_damages___name__/g, "dn... |
define(function () {
var obr = window.obr || {};
obr.app = obr.app || {};
return obr;
}); |
angular.module('encore.ui.rxPermission', ['encore.ui.rxSession'])
/**
*
* @ngdoc service
* @name encore.ui.rxPermission:Permission
* @description
* Simple service for accessing roles and permissions for a user.
* @requires encore.ui.rxSession:Session
*
* @example
* <pre>
* Pe... |
// init router
const router = require('express').Router({ caseSensitive: true });
// custom routes
const article = require('./routes/article');
const user = require('./routes/user');
module.exports = () => {
const app = router;
// routes added here
article(app);
user(app);
return app;
} |
// Attendre le chargement du DOM
$(document).ready(function(){
/*JAUGES DE COMPETENCE */
// Créer une fonction pour les jauges de compétences (animation)
function mySkills( paramEq, paramWidth ){
// Animation des balises p des skills
$('h3 + ul').children('li').eq(paramEq).find('p').anim... |
app.directive('loginPage', function() {
return {
restrict: 'E',
transclude: true,
templateUrl: '../views/partials/login-template.html',
scope: false
};
}); |
'use strict';
const Service = require('egg').Service;
const md5 = require('md5');
var svgCaptcha = require('svg-captcha');
class ToolsService extends Service {
code() {
const captcha = svgCaptcha.create({
size: 4,
fontSize: 50,
width: 100,
height: 40,
background: '#cc9966'
});
... |
import { put, call, takeEvery } from 'redux-saga/effects';
import {GET_INFO_REQUEST, getInfoSuccess, getInfoError } from '../actions/user.actions';
import {UPDATE_INFO_REQUEST, updateInfoSuccess, updateInfoError } from '../actions/user.actions';
import { getCurrentUserInfoRequest, updateCurrentUserInfoRequest } from '.... |
// @flow
import type { ApiServiceInterface } from "shared/services/ApiServiceInterface";
export class AuthService {
api: ApiServiceInterface;
constructor(apiService: ApiServiceInterface) {
this.api = apiService;
}
isUniqueScript(query: Object) {
return this.api.get("/script/uniqueness", query);
}
... |
let express = require('express');
let router = express.Router();
let mongoose = require('mongoose');
let MovieList = require('../models/movieModel');
router.get('/', function(req, res, next){
console.log(req.query, 'url params');
let filters = { ...req.query };
console.log(filters, 'filter');
let query = ... |
var Sequelize = require("sequelize");
var db = require("../models");
var moment = require("moment");
var Op = Sequelize.Op;
module.exports = function(app) {
app.get("/", function(req, res) {
db.User.findAll({}).then(function(dbExamples) {
res.render("index", {
user: dbExamples
});
});
});
a... |
"use strict";
var Personas;
(function (Personas) {
var eSexo;
(function (eSexo) {
eSexo["Masculino"] = "Masculino";
eSexo["Femenino"] = "Femenino";
})(eSexo = Personas.eSexo || (Personas.eSexo = {}));
})(Personas || (Personas = {}));
|
import React from 'react';
import Request from 'superagent';
import CronList from './CronList.jsx';
import Actions from '../actions/Actions.jsx';
import CronStore from '../stores/CronStore.jsx';
class CronManager extends React.Component {
constructor() {
super();
this.state = {
data: {
jobs ... |
export default /* glsl */`
#ifdef MAPFLOAT
uniform float material_sheenGloss;
#endif
void getSheenGlossiness() {
float sheenGlossiness = 1.0;
#ifdef MAPFLOAT
sheenGlossiness *= material_sheenGloss;
#endif
#ifdef MAPTEXTURE
sheenGlossiness *= texture2DBias($SAMPLER, $UV, textureBias).$CH;
... |
import * as allActions from './allActions';
export function receiveMatrices(data) {
return { type: allActions.RECEIVE_MATRICES, matrices: data };
}
export function fetchMatrices() {
return (dispatch) => {
fetch('https://api.myjson.com/bins/w34x0')
.then(response =>
response.json().then(data => (... |
(function() {
'use strict';
angular
.module('newlotApp')
.controller('RecommendationDialogController', RecommendationDialogController);
RecommendationDialogController.$inject = ['$timeout', '$scope', '$stateParams', '$uibModalInstance', 'entity', 'Recommendation', 'User'];
function Re... |
function logMiddleware(req, res, next) {
console.info('request made to:');
console.info(' ', req.originalUrl);
next();
}
module.exports = logMiddleware;
|
import React, { useState } from "react";
import { useSelector, useDispatch } from "react-redux";
import { useHistory } from "react-router-dom";
import { makeStyles } from "@material-ui/styles";
//MaterialUI
import TextField from "@material-ui/core/TextField";
import Autocomplete from "@material-ui/lab/Autocomplete";
... |
import chai from 'chai'
import chaiString from 'chai-string'
import chaiAsPromised from 'chai-as-promised'
import commands from './commands'
module.exports = {
host: process.env.HUB_PORT_4444_TCP_ADDR,
port: process.env.HUB_PORT_4444_TCP_PORT,
path: '/wd/hub',
specs: [
'test/spec/**',
],
maxInstances: ... |
import * as R from 'ramda'
import { createSelector } from 'reselect'
const getState = R.prop("router")
export const getLocation = createSelector(getState, R.prop('location'))
export const getPathname = createSelector(getLocation, R.prop('pathname'))
export const compareLocations = (path) => createSelector(getPathn... |
/* An attempt to change Single Journals to Publisher Site to make the experience for end user better */
$(document).ready(function() {
console.log("work, you bastard");
$('a.results-dbRef').each(function () {
var DbArr = $(this).text().split(',');
var DbType = DbArr[0].replace(/[\s\n]... |
const mus = [ "John Lennon", "Paul McCartney", "George Harrison", "Ringo Starr"];
const instr = ["Vocals", "Bass", "Guitar", "Drums"];
const factos = [
"He was the last Beatle to learn to drive",
"He was never a vegetarian",
"He was a choir boy and boy scout",
"He hated the sound of his own voice"
];
var theBe... |
var express = require('express');
var router = express.Router();
const adminHelpers = require('../helpers/admin-helpers');
/* GET users listing. */
router.get('/', function (req, res) {
if (req.session.loggedIn) {
res.redirect('admin/tabview')
} else {
res.render('admin/adminLogin', { 'loginErr': req.sess... |
const { existsSync, readdirSync, readFileSync } = require('fs')
const { promisify } = require('util')
const execFile = promisify(require('child_process').execFile)
const path = require('path')
const yargs = exports.args = require('yargs')
const { task, parallel, series, watch } = require('gulp')
const pkgJson = requi... |
/**
* Created by mac on 12/1/16.
*/
const sjcl = require('sjcl');
//takes recipient's diffie-hellman keys(to decrypt secret) and decrypts message
function Decrypt(dhkeys, message) {
var cipher = message[0]; //TEMP: message components are stored in array
var pubKEM = message[3];
... |
export const log = (...args) => __DEBUG__ ? console.log(...args) : undefined
export const logError = (...args) => __DEBUG__ ? console.error(...args) : undefined
export const renderIf = (test, component) => test ? component : undefined
export const classToggler = options => Object.keys(options).filter(key => !!options[k... |
export const SetSender = (item) =>{
return(dispatch) => {
dispatch({
type:"SET_SENDER",
payload:item
})
}
}
export const SetTaker = (item) =>{
return(dispatch) => {
dispatch({
type:"SET_TAKER",
payload:item
})
}
} ... |
export default [{
path: '/Chat/:userId/:groupId',
component: require('../components/about.vue')
},
{
path: '/language/',
component: require('../components/language.vue')
},
{
path: '/feedback/',
component: require('../components/feedback.vue')
},
{... |
import React, { useContext, useEffect, useState } from 'react';
import { UserContext } from '../../App';
import Products from '../Products/Products';
const Home = () => {
const [product, setProduct] = useState([]);
const [buyProduct, setBuyProduct] = useState([]);
const [loggedInUser, setLoggedInUser] = u... |
import { EDIT_TODO, REMOVE_TODO, ADD_TODO, LOAD_TODO, UPDATE_FILTER } from './typeTodo'
import { saveItem, removeTodoInStorage, getTodos } from '../database/index'
export const editTodo = item => {
saveItem( item )
return {
type: EDIT_TODO,
payload: item
}
}
export const loadTodos = _ => d... |
export class Elements {
constructor(element) {
this.elementsStorage = document.querySelectorAll(element);
}
addClass(classNames) {
let classNamesArr = classNames.split(" ");
for (let element of this.elementsStorage) {
for (let className of classNamesArr) {
element.classList.add(classNam... |
const Menu = require('../../Models/menu')
function list(){
return {
async index(req,res){
const thalis = await Menu.find()
return res.render('items', { Wepons: thalis})
// Menu.find().then(function(max) {
// console.log(max)
// return res.re... |
// Bridge server to manage peer connections, blockchain data, and signatures.
const externalIp = require('externalIp');
const net = require('net');
const fs = require('fs');
const config = require('../config.js');
const sync = require('./util/sync.js');
const bridges = require('./util/bridges.js');
const merkle = requi... |
if(user_has_api_token() && user_has_completed_passcode_verification()){
redirect_to_next_page(admin_web_dashboard_page_url, false);
} |
import React, { Component } from 'react';
import Revelation from './Game/Revelation'
import Recognition from './Game/Recognition'
import Recall from './Game/Recall'
import Revision from './Game/Revision'
import GoldList from './Game/GoldList'
import l10n from '../../../lib/l10n'
export default class Ga... |
let fun = ["single", "not", "single"];
document.write(fun.indexOf("single") + "<br>");
document.write(fun.lastIndexOf("single")); |
import styled from 'styled-components';
const ToggleSwitch = styled.div`
display: inline-block;
min-width: 58px;
background: ${(props) => (props.toggled ? 'var(--success)' : '#ccc')};
border-radius: 100px;
transition: background 200ms ease, padding 200ms ease;
text-align: left;
padding: ${(props) => (pro... |
//api urls
export const API_KEY = 'api_key=07fa2cb44a9888f1a8ab8c9b1170d593';
export const API_URL = 'https://api.themoviedb.org/3'
export const URL_MOVIE = 'https://www.themoviedb.org/movie';
export const URL_SEARCH = API_URL + '/search/movie?query=';
export const URL_NP = API_URL + '/movie/now_playing?' + API_KEY;
ex... |
var express = require("express");
var router = express.Router();
var mongo = require("../../connection");
router.post("/", async function(req, res) {
console.log(req.body);
const db1 = mongo.get().collection("srs_form");
var srsform = {
_id: req.body._id,
introduction: req.body.introduction... |
import QrCode from 'qrcode-reader';
var qr = new QrCode();
var properties = {
FORMAT: {
value: "qr_code",
writeable: false
}
};
// delete the function you would like to override
delete qr.grayscale;
// add new functional with the same name as deleted function
qr.grayscale = function (imageDa... |
import TodoListActions from './TodoListActions';
class TodoListActionsDispatcher extends TodoListActions {
constructor(dispatch = (action)=>action) {
super();
this.reduxDispatch = (action) => dispatch(action);
}
dispatch(action) {
this.reduxDispatch(action)
return action;
}
/**
* Categor... |
import { useState, useEffect, useRef } from "react";
import { useInView } from 'react-intersection-observer';
import { TweenMax, TimelineLite } from 'gsap';
import asset from "plugins/assets/asset";
export default function EffectItemSmall({
text="B6",
srcImage=asset("/images/effect-small-item-b6.png"),
time... |
var age = [19, 20, 21, 22, 23, 24];
Array.length = age;
var is_subscribed = [true ,false ,true, false ,true, true];
var counter = 0;
while (counter < Array.length){
console.log(age, is_subscribed)
counter ++;
}
|
import React, { Component } from 'react';
import { api } from '../../services/ApiConfig';
import PodForm from '../shared/PodForm';
import '../../styles/AddPod.css'
class AddPod extends Component {
constructor(props) {
super(props)
this.state = {
name: '',
type: '',
... |
export const request = (state, payload, initialState) => {
return {
...state,
isCreatingFarm: true,
createFarmSuccess: false,
createFarmFailure: false,
error: { ...initialState.error },
};
};
export const success = (state, payload, initialState) => {
return {
...state,
isCreatingFarm:... |
var ANIMATION_DURATION = 200;
var ACTIVE_HEIGHT = 93;
var DE_ACTIVE_HEIGHT = 20;
var $currentActiveMenuItem;
var $menuItems;
var $menu;
var $selectMenuItem;
$(document).ready(function () {
initMenu();
initEventListener();
function initMenu() {
$menuItems = $(".menu_item");
$menuItems.each(f... |
var ipQuery = require('./lib/ip');
var qqwry = require('./lib/qqwry');
var wryip = qqwry.init() //初始化IP库解析器
wryip.speed(); //启用急速模式 比不开启效率率快非常多 但多占10M左右内存;
var convertIp = function(ip) {
if(!ip) {
return '';
}
var iparray = ip.split('.');
if (iparray[0] === 10 || iparray[0] === 127 |... |
import test from 'ava';
import Fifo from '../src/fifo.js';
import LocalStorage from '../src/localStorage.js';
test('#checkLocalStorage: accepts a shim for localStorage', (t) => {
const LS = new LocalStorage();
const collection = new Fifo({ shim: LS });
t.false(collection.noLS);
t.is(collection.LS, LS);
});
te... |
import React from 'react';
const ImagePopup = ({card, isOpen, onClose}) => {
let popupIsVisible = isOpen ? 'popup_opened' : '';
return (
<div className={`popup popup_type_image ${popupIsVisible}`}>
<div className="popup__image-container">
<img className="popup__image" src=... |
const { ObjectID } = require('mongodb');
const { mongoose } = require('./../server/db/mongoose');
const { Todo } = require('./../server/models/todo');
//Todo.remove({}) // will remove all the documents
//won;t get doc back
Todo.remove({
}).then((result)=>{
console.log(result);
});
// wiill get docs ... |
import React, { Component } from 'react';
import Navbar from './Navbar.js';
import "./Main.css";
import ContactForm from './ContactForm.js';
class Main extends Component {
constructor(props) {
super(props) //we're invoking the Base clas constructor
}
state = {}
render() {
return (
... |
// функция скрытия модального окна
function closeModal(modalSelector) {
const modal = document.querySelector(modalSelector);
modal.classList.add("hide");
modal.classList.remove("show");
// либо вариант с toggle - но тогда назначить класс в верстке
// восстановление значения overflow по умолчанию
document.b... |
let product;
let orderAmount;
product = "Hanging Planter";
orderAmount = 35;
console.log("Thank you for ordering the " + product + ".");
if (orderAmount >= 30) {
console.log(
"It's your lucky day! There is no shipping charge for orders over $30.00."
);
} else {
console.log("There will be a $5.00 shipping cha... |
module.exports = {
t: 'total',
c: 'commitment',
f: 'freedom',
p: 'privacy'
};
|
export default {
only:({topLeft = 0, topRight = 0, bottomLeft = 0, bottomRight = 0})=>({topLeft, topRight, bottomLeft, bottomRight}),
all:(value = 0)=>({all: value}),
horizontal:({left = 0, right = 0})=>({topLeft: left, topRight: right, bottomLeft : left, bottomRight : right}),
vertical:({ top = 0, bottom = 0})... |
import { END } from 'redux-saga'
import { createActions } from '../common/actions'
const prefix = 'APP'
const actions = [
'SET_API_CONFIG',
'SET_CSRF_TOKEN',
'SET_COOKIES',
'SET_LOCALE',
'NOTIFY',
'SHOW_MODAL',
'HIDE_MODAL',
'LOAD_LISTS',
'SET_LISTS_OPTIONS',
'SET_FETCHING_ACTIONS',
'SET_RENDE... |
'use strict'
const Joi = require('joi')
module.exports = {
className: 'row',
id: '',
formMethod: 'POST',
formAction: '/user',
fields: [
{
fieldType: 'inputText',
className: 'form-group',
fieldClass: 'form-control',
fieldName: 'name',
id: 'user-name',
required: false,
... |
/**
* User: kimh
* Date: 27/11/13
* Time: 12:21 PM
*/
'use strict';
// --------------------------- INITIALISATION ------------------------------- //
var elements = {
root: document.find('#main-container'),
loader: document.find('#loader'),
header: document.find('#header'),
scrollBox: document.find('#scroll-bo... |
import React, { Component } from "react";
export default class Encounter extends React.Component {
constructor(props) {
super(props);
this.encounter = Math.floor(Math.random * 3);
}
render() {
return (
<>
<button
onClick={() => {
if (this.encounter === 1){
... |
import types from "./actionTypes";
import kidsnParty from "../apis/kidsnParty";
import { history } from "../history";
export const fetchShop = location_id => {
return async function(dispatch) {
const response = await kidsnParty.get(`/locations/${location_id}`);
dispatch({
type: types.fetchSingleShop,
... |
function calculatePercentageOfValue(value, percentage) {
return (value * percentage) / 100;
}
function calculatePercentageOfTotalValue(subValue, totalValue) {
return (subValue / totalValue) * 100;
}
function calculateValueAfterPercentageChange(initialValue, percentageChange) {
return initialValue ... |
//分别定义两个数组
//unsel:存所有未选中的国家(左边)
var unsel=null;
//sel:存所有选中的国家(右边)
var sel=null;
window.$=function(selector){
return document.querySelectorAll(selector);
}
//当页面加载后
window.onload=function(){
/*将左侧select元素中所有option元素的文本
提取并保存到unsel数组中
*/
unsel=$("#unsel")[0].innerHTML.trim().slice(8,-9).split(/<\/option>\s*<opti... |
import React, { Component } from 'react';
import { Link, Redirect } from 'react-router-dom';
import LoginContext from '../contexts/LoginContext'
import './styles.css'
class Home extends Component {
render() {
return (
<LoginContext.Consumer>
{value => value.loggedIn ?
(
<div... |
let qualquer ='legal'
console.log(qualquer)
console.log(typeof qualquer)
qualquer =3.14159
console.log(qualquer)
console.log(typeof qualquer) |
import { useState ,useEffect } from 'react';
import axios from 'axios/index';
import {URL} from './apis';
const useResources = resource => {
const [lang, setLanguage] = useState({});
useEffect(
() => {
(async resource => {
const response = await axios.get(`${URL}${resource}`... |
/**
* Created by Terris
* https://github.com/qinglingzhiyu
*
* @date: 2019-01-10
* @flow
*
* description: 绑定手机页面的逻辑
*
*/
import {
jumpToPromisify,
showToastPromisify
} from '../../api/promisify.js'
import regeneratorRuntime from '../../api/regeneratorRuntime.js'
import {
sleep
} from '../../common/commo... |
var userScore = 0
var compScore = 0
console.log("Javascript working");
$(document).ready( function (){
//--------------------------------------
$('.rock').click(function() {
gameLogic("rock", compy());
});
$('.scissors').click(function() {
gameLogic("scissors", compy());
});
$('.paper').click(function() {
gam... |
define(['jquery'], function($) {
var constants = {
tile_size: 32
, exile_x: -100
, exile_y: -100
, win_score: 150000
// , win_score: 500
, top_pipe: 1
, right_pipe: 2
, bottom_pipe: 4
, left_pipe: 8
, layer_1_min: 100
, layer... |
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
var sequelize = queryInterface.sequelize;
return sequelize.transaction(function (t) {
return queryInterface.addColumn('Users', 'since_id', Sequelize.STRING, {transaction: t})
})
},
down: (queryInterface, Sequeliz... |
export default {
addLog(state, msg) {
state.logs.unshift({
msg,
date: Date.now()
})
}
} |
/*
* Copyright 2018 Cognitive Scale, Inc. All Rights Reserved.
*
* 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 b... |
import React from "react";
import './message-send-box.css';
class MessageSendBox extends React.Component {
constructor(props) {
super(props);
this.state = { chatInput: '' };
// React ES6 does not bind 'this' to event handlers by default
this.submitHandler = this.submitHandler.... |
import gql from "graphql-tag";
const PROCESS_QUERY = gql`
query Process {
process {
title {
en
hun
}
step1 {
en
hun
}
step2 {
en
hun
}
step3 {
en
hun
}... |
import React from 'react';
import Header from '../src/components/Header';
import Footer from '../src/components/Footer';
import '../src/scss/styles.scss';
import styled from 'styled-components';
import { Provider } from 'react-redux';
import { store } from './components/store/store';
import AppRouters from './componen... |
const Stream = require('../src/Stream');
let makePromise = () => {
let res, rej;
let promise = new Promise((resolve, reject) => {
res = resolve;
rej = reject;
});
promise.resolve = res;
promise.reject = rej;
return promise;
};
let p = makePromise();
p.then(() => {
throw 'e... |
// Entry Point
// Module Imports
const logger = require('./logger');
const Scientific = require('./scientific');
const fs = require('fs');
const os = require('os');
const path = require('path');
const EventEmitter = require('events');
const http = require('http');
const mongoose = require('mongoose')
const db = requir... |
import db from '../models';
import { logger } from '../config';
export function get(req, res, next) {
db.sequelize
.authenticate()
.then(error => {
if (error) {
logger.error('Healthcheck Failed', error);
res.sendStatus(500);
} else {
res.sendStatus(200);
}
})
... |
var requirejs = require('requirejs');
var path = require('path');
var View = requirejs('common/views/visualisations/availability');
var templatePath = path.resolve(__dirname, '../../templates/modules/availability.html');
var templater = require('../../mixins/templater');
module.exports = View.extend(templater).extend... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.