text stringlengths 7 3.69M |
|---|
<!DOCTYPE html>
<html>
<!-- Clicking on the button will change the font, font size, and color of the paragraph <p>. -->
<head>
<meta charset=utf-8 />
<title>JS DOM paragraph style</title>
</head>
<body>
<p id ='text'>JavaScript Exercises - w3resource</p>
<div>
<button id="jsstyle"
onclick="js_... |
// Only load when document is ready
$(document).ready(function () {
// Creates amenity object
let amenityObj = {};
// Binds a click event to input tag
$('input').bind('click', function () {
// Grabs attribute value from the input tag
let id = $(this).attr('data-id');
let name = $(this).attr('data-n... |
var createTicketCtrl = angular.module('createTicketCtrl', ['ui.router', 'ngAnimate','ngMaterial','md.data.table']);
dashboard.controller("createTicketCtrl", ['$rootScope', '$scope', '$state', '$location', '$localStorage', 'dashboardService', 'Flash','createTicketService','categoryService',
function ($rootScope, $scop... |
'use strict';
define(['wdn', 'require', 'plugins/body-scroll-lock', 'mustard/inert-polyfill'], function (WDN, require, bodyScrollLock) {
var disableBodyScroll = bodyScrollLock.disableBodyScroll;
var enableBodyScroll = bodyScrollLock.enableBodyScroll;
var autoSearchDebounceDelay = 1000;
var searchEmbedVersion = '5.... |
import ColumnHeader from '../components/ColumnHeader';
export default function transformPassengerData(data) {
const { result } = data;
const columns = result.attributes.map((attr) => {
const title = attr.name;
const colKey = title.toLowerCase().split(' ').slice(0, 3).join('_');
return {
title: ... |
lyb.parse();
//微信签名授权
lyb.wxSign(['checkJsApi', 'hideMenuItems', 'showMenuItems', 'onMenuShareAppMessage', 'onMenuShareTimeline', 'onMenuShareQQ', 'openLocation'], function () {
wx.hideMenuItems({
menuList: ["menuItem:copyUrl", "menuItem:share:weiboApp", "menuItem:favorite", "menuItem:share:facebook", "men... |
import ace from './ace.js';
export default ace;
|
function AITrack( track ){
this.corners = [];
if( track !== undefined ){
track.corners.forEach( (corner)=>{
this.corners.push( new AICorner(corner) );
});
}
this.draw = function(){
this.corners.forEach( (corner)=>{ corner.draw() });
}
this.drawSegment = f... |
// @flow
/**
* Most of this was stolen from https://github.com/ianstormtaylor/slate/blob/460498b5ddfcecee7439eafe4f4d31cacde69f41/examples/markdown-preview/index.js
*/
import React from 'react';
import getDecorator from './decorator';
import {
Title,
Bold,
Italic,
Punctuation,
Code,
List,
Hr,
Url,
} f... |
(function() {
'use strict';
angular
.module('newlotApp')
.config(stateConfig);
stateConfig.$inject = ['$stateProvider'];
function stateConfig($stateProvider) {
$stateProvider
.state('lottery', {
parent: 'entity',
url: '/lottery',
dat... |
class KillQuest {
constructor() {
this.text = 'Kill 2 enemies';
this.completed = false;
this.kills = 0;
this.killsToComplete = 2;
this.xp = 15;
}
finished() {
this.completed = true;
this.text = 'Completed';
}
};
export default KillQuest;
|
export default /* glsl */`
vec3 addAlbedoDetail(vec3 albedo) {
#ifdef MAPTEXTURE
vec3 albedoDetail = $DECODE(texture2DBias($SAMPLER, $UV, textureBias)).$CH;
return detailMode_$DETAILMODE(albedo, albedoDetail);
#else
return albedo;
#endif
}
`;
|
// ==UserScript==
// @name Autoroll Inserts
// @namespace autoroll_inserts
// @match https://peerbet.org/dice/*
// @description Inserts autoroll links to peerbet.org's dice page
// ==/UserScript==
// This inserts links to:
// jquery.js -- version held on peerbet.org
// autoroll.css -- held on github
/... |
var structfsml_1_1AstMachine =
[
[ "states", "structfsml_1_1AstMachine.html#a007b560f2e500f7f51c570f0316843e2", null ]
]; |
function charToInt(char){
switch(char){
case 'a' : return 0;
case 'b' : return 1;
case 'c' : return 2;
case 'd' : return 3;
case 'e' : return 4;
case 'f' : return 5;
case 'g' : return 6;
case 'h' : return 7;
case 'i' : return 8;
case 'j... |
'use-strict';
var util = require('util');
var format = util.format;
var entityException = function(type,error,operation) {
this.type = type;
this.code = '-8000';
this.operation = operation;
this.exception = error.message;
this.stack = error.stack;
this.errorTyp... |
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||... |
$(window).scroll(function(){
var doc=$(document).scrollTop();
//console.log(doc);
if(doc>195){
$('#fixd').addClass('fixd');
}else{
$('#fixd').removeClass('fixd');
}
});
|
const {DefaultLogger} = require("@dracul/logger-backend")
|
import React, {Fragment} from 'react';
import BusinessCard from '../component/BusinessCard';
import MyProfile from './MyProfile'
export default function BusinessCardContainer(props) {
return (
<div className='ui cards'>
{props.restaurants.map((b) => (
<BusinessCard classNam... |
import test from "tape"
import { throttle } from ".."
test("throttle", t => {
/**
* Throttle with defaults
*/
let defaultCounter = 0
const defaultInc = throttle(() => {
defaultCounter++
})
for (let i = 0; i < 100; i++) {
defaultInc()
}
setTimeout(() => {
t.equal(
defaultCounter,... |
'use strict';
/**
* @ngdoc service
* @name laoshiListApp.username
* @description
* # username
* Factory in the laoshiListApp.
*/
angular.module('laoshiListApp')
.factory('username', ['firebasePath', function (firebasePath) {
// takes a string (i.e. user's first name), assuming it's already been validated ... |
import React from 'react'
import { Button, Form, Grid, Message } from 'semantic-ui-react'
const AuthForm = ({ headerMessage, actionName, onSubmit, error, children }) => (
<div className='AuthForm'>
<Grid centered style={{ height: '100%' }} verticalAlign='middle'>
<Grid.Column style={{ maxWidth: 450 }}>
... |
//三位數的整數中,153可以滿足1^3+5^3+3^3=153,這樣的數字稱之阿姆斯壯數,試著用程式找出所有三位數的阿姆斯壯數
let result = [];
for (let i = 100; i <= 999; i++) {
let arr = i.toString().split("");
if ((Math.pow(arr[0], 3) + Math.pow(arr[1], 3) + Math.pow(arr[2], 3)) === i) {
result.push(i);
}
}
console.log(result);
|
/*
let myAnimals = ["dog", "cat", "horse", "meerkat"]
let userChoice = prompt("Please enter the name of an animal")
userLower = userChoice.toLowerCase()
myAnimals.push(userLower)
console.log(`The last animal is a/an ${myAnimals[myAnimals.length - 1]}`)
*/
|
var Qkey="";
/**
* 定义一个easyui的下拉框需要的对象模型
* id: 下拉框的值
* text:下拉框的显示的文本
* selected:是否被选中
* @returns
*/
function EasyUISelect(id, text, selected){
this.id = id;
this.text = text;
if(!selected){
selected = false;
}
this.selected = selected;
}
/**
* 轮播图对应的实体类
* @param imgUrl 显示的图片地址
* @p... |
$(document).ready(function() {
function resizeElement(inizial,type) {
// apabila element layout bertipe leftBox
if(type == 'stripBox') {
$( "div[type=stripBox]" ).draggable({
axis: "y"
});
$(inizial).resiz... |
import { combineReducers } from "redux";
import currencyReducer from "./currency-reducer";
import userReducer from "./user-reducer";
const rootReducer = combineReducers({
currency: currencyReducer,
userSession: userReducer,
});
export default rootReducer;
|
import styled from '@emotion/styled';
import { css } from '@emotion/core';
/**
*
회: #868686
흰: #F8FAFF
보: #6055CD
핑: #CBA6C3
남: #353866
노: #FBD14B
*/
//변수명 어케 바꾸지...
export const basicStyle = css`
width: 100%;
height: 35px;
max-width: 600px;
min-width: 270px;
border-radius: 5px;
`;
export const b... |
let jwt = require('jsonwebtoken');
require('dotenv').config();
let secretKey = process.env.SECRET_KEY;
const generateToken=(payload)=>{
return jwt.sign(payload,secretKey,{expiresIn:'24h'});
};
const checkToken = (req,res,next) => {
let token=req.headers['x-access-token'] || req.headers['authorization'];
... |
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/Hexatech',{ useNewUrlParser: true },(err)=>{
if(!err){
console.log('MongoDB connection established.');
}else{
console.log('Error in Connection: '+JSON.stringify(err,undefined,2));
}
});
module.exports=mongoose... |
var playlist = { abba: 'hot garbage'};
function updatePlaylist(list, name, title) {
return Object.assign({}, list, { [name]: title});
}
function removeFromPlaylist(list, name) {
delete list[name];
return list;
}
|
var app = (function(){
"use strict";
var markers = {};
var map;
var initialize = function() {
var ny = new google.maps.LatLng(40.721659, -73.997250);
var mapOptions = {
zoom: 13,
center: ny,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getE... |
import React from "react";
import Link from "next/link";
class AdminNavbar extends React.Component {
render() {
const links = [
{ href: "/auth/login", label: "ログイン" }
].map((link) => {
link.key = `nav-link-${link.href}-${link.label}`;
return link;
});
return (
<>
<n... |
import React from 'react'
import '../styles.css';
const Commentary = ({commentary,deleteCommentary,updateCommentary}) => {
const post = commentary.username === localStorage.getItem("username") ?
<div>
<div className="card">
<div className="card-body">
<button className=" btn btn-outli... |
app.controller('paymentsSummaryCtrl', ['CustomerService', '$scope', '$rootScope', '$timeout', '$uibModalInstance',
function (CustomerService, $scope, $rootScope, $timeout, $uibModalInstance) {
$scope.buffer = {};
$scope.customers = [];
$timeout(function () {
CustomerService.fin... |
const Fetch = require("node-fetch"), crypto = require("crypto");
/**
* Return A Awooify Image
* @param {object} options Check Docs For Options.
* @returns {Data}
*/
async function Awooify(options = {}) {
if (!options.Image) throw new Error(`No Image`);
const res = await Fetch(`https://nekobot.... |
import React from 'react';
import Form from 'react-bootstrap/Form';
import Button from 'react-bootstrap/Button';
// import Alert from 'react-bootstrap/Alert';
class ExploreButton extends React.Component{
render(){
return(
<Form onSubmit={(event) => this.props.getCity(event)} >
<Fo... |
import React from 'react';
import AppBar from 'material-ui/AppBar';
import SearchBarContainer from '../../containers/SearchBarContainer';
import FlatButton from 'material-ui/FlatButton';
const styles = {
background: '#288AE2'
}
const Navigation = ({ onHandleToggle }) => {
return (
<AppBar
onLeftIconButtonTouc... |
import should from 'should/as-function';
import Promise from 'bluebird';
Promise.longStackTraces();
const { describe, it, before, after } = global;
import T, { typecheck, takes, returns } from '../';
describe('T', () => {
it('T.any()', () => {
should(() => T.any()(42)).not.throw();
should(() => T.any()(void... |
Ext.define('InvoiceApp.view.SupplierBuyer',{
extend:'Ext.List',
xtype:'supplier_buyer',
requires:[
'InvoiceApp.store.SupplierBuyerStore',
'InvoiceApp.controller.Main'
],
config:{
items:[
{
xtype:'toolbar',
docked:'top',
... |
window.addEventListener("load", function(){
var app = new Vue({
el: '#mvc',
data: {
x:0,
y:0,
sum:0,
list:
[
{id:1, title:'hello'} //model
, {id:2, title:'hi'}
]
},
methods:{
... |
var roleRemoteTransfer = {
/** @param {Creep} creep **/
run: function(creep, village) {
if (BASE_CREEP.run(creep, village) == -1){
return;
}
// move to mySource, find the nearest container. // TODO resources on the ground
// pick up, then move to nearest FROM link... |
// eslint-disable-next-line no-restricted-imports
import jQuery from 'jquery';
import config from '../../core/config';
var useJQuery = config().useJQuery;
if (jQuery && useJQuery !== false) {
config({
useJQuery: true
});
}
export default function () {
return jQuery && config().useJQuery;
} |
function findById (req, res) {
let itemToShow = req.params.id;
res.json(arrayOfTips[itemToShow]);
}
export { findById }
|
///////////////////////////////
// 调用原生接口 //
///////////////////////////////
;(function($) {
"use strict"//使用严格模式
function native(params) {
params = params||{};
if (params==="undefind")return;
if (params.action==="undefind")return;
//固定的三个属性和native端一样,否则native端和解析出错
var Senddata={
... |
let Game = require('./game');
let uuid = require('uuid');
/**
* Объект игровой очереди для поиска и создания игр
*/
class GamesManager{
constructor(){
// очередь игроков для вступления в игру (обычно здесь должен быть только один)
this.queue = [];
// объект с текущими играми
this.... |
import React from 'react'
// import { View, Text } from 'react-native'
import {
View,
Text,
TouchableOpacity,
Dimensions,
StyleSheet,
StatusBar,
Image,
TextInput,Button,ScrollView
} from 'react-native';
import Sample from '../sample'
import { useNavigation } from '@react-navigation/n... |
import React from 'react';
function Info(){
const InfoStyle = {
textDecoration: 'none',
color: 'black'
};
return (
<div>
<h1>Kegger Taproom was created in 2019</h1>
<h2>We showcase different beers from The Growler Guys to demonstrate site-buiding with React.</h2>
<h4>For more info... |
var root;
FintUI.initFunctions.reports=function() {
$('#reports').tabs($.extend(FintUI.tabSettings,{active:1}))
}
FintUI.activateFunctions.reports=function() {
// console.log('activate reports');
}
FintUI.initFunctions.personalsummary=function(settings) {
console.log('init personalsummary');
//select tags.rowid ... |
import firebase from '../db/firebase'
const auth = firebase.auth()
import { useAuthState } from 'react-firebase-hooks/auth'
import Login from '../components/Admin/Login'
import AdminArea from '../components/Admin/AdminArea'
import { setBackgroundImage } from '../components/Admin/AdminArea/Global/setBackgroundImage'
imp... |
import fetch from 'node-fetch';
export async function getGBIFIDFromQuery(q) {
const urlEncodedQuery = encodeURIComponent(q);
const response = await fetch('https://api.gbif.org/v1/species/suggest?q=' + urlEncodedQuery);
const json = await response.json();
const isSpecies = item => item.rank === 'SPECIES';
co... |
/**
* Copyright 2021
* @license Apache-2.0, see License.md for full text.
*/
import { LitElement, html, css } from "lit-element/lit-element.js";
import "@lrnwebcomponents/es-global-bridge/es-global-bridge.js";
//import { BrowserQRCodeReader } from '@zxing/browser';
/**
* `barcode-reader`
* `Reads barcodes`
* @de... |
/**
* App入口
*/
import { Route, Switch, Redirect } from 'react-router';
import React, { lazy, Suspense } from 'react';
import { Layout } from 'antd';
import PageLoading from 'appRoot/common/PageLoading';
import loadable from 'loadable-components';
// import UpdateReduxContainers from 'containers/UpdateReduxContainers... |
import React from 'react';
// Semantic UI
import { Container, Grid } from 'semantic-ui-react';
import 'semantic-ui-css/semantic.min.css';
// Components
import Filter from './Filter';
import Videos from './Videos';
class App extends React.Component {
render() {
return (
<Container fluid >
<Grid co... |
import React from "react";
import PropTypes from "prop-types";
import withStyles from "@material-ui/core/styles/withStyles";
import ExpansionPanel from "@material-ui/core/ExpansionPanel";
import ExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails";
import ExpansionPanelSummary from "@material-ui/core/Ex... |
var utils = require('./utils')
var config = require('./config')
var srcMap = config.cssSourceMap;
module.exports = {
loaders: utils.cssLoaders({
sourceMap: srcMap,
extract: !srcMap
})
}
|
/**
* YAWIK
*
* @filesource
* @copyright (c) 2013-2015 Cross Solution (http://cross-solution.de)
* @license MIT
*/
;
(function ($) {
function initializeCompanyNameSelectField() {
var selectedValue = null;
var organizations = new Bloodhound({
name: 'organizations',
re... |
import React from "react";
let Detail = (props) =>{
return <div className="article-detail">
<h1 className="detail-title">{props.detail.title}<small className="sub-title">{props.detail.subTitle}</small></h1>
<div className="about-detail">
<span>发表时间:{props.detail.updateTime}</span><span>作者:{prop... |
class Dustbin{
constructor(){
var options={
isStatic:true
}
this.bodyc = Bodies.rectangle(width/2,670,800,20,options)
World.add(world,this.bodyc)
}
display(){
rectMode(CENTER)
rect(this.bodyc.position.x,this.bodyc.position.y,800,20)
}
} |
import React from 'react';
const InputWidget = (props) => {
return (
<input placeholder={props.placeholder} onClick={props.click} onChange={props.onChange} type={props.type} value={props.val}/>
)
}
export default InputWidget; |
import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import TextField from '@material-ui/core/TextField'
import { withRouter } from "react-router-dom";
import DropDownMenu from '../DropDownMenu/DropDownMenu';
// styles
import styles from '../../assets/jss/SearchBarStyle';
import { Button... |
import crypto from "crypto";
import jwt from "jsonwebtoken";
export const UserTypes = {
NONE: "NONE", WRITER: "WRITER", ADMIN: "ADMIN"
};
export function setPassword(user, password) {
user.salt = crypto.randomBytes(16).toString('hex');
user.password = crypto.pbkdf2Sync(password, user.salt, 10000, 512, 'sh... |
import React, { useState, useEffect, useCallback, useMemo } from "react";
import { Button, Modal, Tabs, Row, Col, Card } from "antd";
import { connect } from "react-redux";
import { Scrollbar } from "~components";
import { SchemaRender, AxureParser } from "~renderer";
import fetcher from "~materials/hoc";
import subSch... |
// public/chat/chat.client.module.js
// Invoke 'strict' JavaScript mode
//'use strict';
// Create the 'chat' module
angular.module('chat', []);
|
db.students.insert([
{
name: 'Christian',
lastName: 'Tituaña',
career: 'Desarollo de Software',
read: false
},
{
name: 'Christian',
lastName: 'Tituaña',
career: 'Desarollo de Software',
read: false
},
{
name: 'Christian',
... |
const validateUserTransaction = require("./validateUserTransaction");
describe("validateUserTransaction test pass", () => {
let res;
let req;
let next;
beforeEach(() => {
req = {
body: {
longitude: 1,
latitude: 2,
merchant: "Bank",
amountInCents: 2,
},
};
... |
/**
* Exports the screens used by App.js
* @namespace screens
*/
export {default as LoginScreen} from './LoginScreen/LoginScreen';
export {default as HomeScreen} from './HomeScreen/HomeScreen';
export {default as RegistrationScreen} from './RegistrationScreen/RegistrationScreen';
export {default as SelectScreen} fro... |
import { Timeline, Animation } from './animation.js'
import { ease } from './ease.js'
let tl = new Timeline()
tl.start()
tl.add(
new Animation(
document.getElementById('el').style,
'transform',
0,
500,
2000,
0,
ease,
(x) => `translateX(${x}px)`
)
)
document.querySelector('#btn-paus... |
import React from 'react';
import _ from 'lodash';
import { StyledListItem, StyledLink } from './styles';
import { ExpandableMenuItem } from '../ExpandableMenuItem';
import { Box, Inline } from '@sparkpost/matchbox';
function Section(props) {
const { value, navItems } = props;
const section = navItems.filter(({ ... |
foo('OK')
|
const fs = require('fs');
const path = require('path');
const Webpack = require('webpack');
// const SVGO = require('svgo');
// const filepath = 'src/coat.svg';
// const svgo = new SVGO({
// plugins: [
// {
// cleanupAttrs: true
// },
// {
// removeDoctype: true
// },
// {
// re... |
import styles from '../styles/Home.module.scss'
// The following import prevents a Font Awesome icon server-side rendering bug,
// where the icons flash from a very large icon down to a properly sized one:
import '@fortawesome/fontawesome-svg-core/styles.css';
// Prevent fontawesome from adding its CSS since we did it ... |
import React from 'react';
import {Link} from 'react-router-dom';
import Pagination from 'react-bootstrap/Pagination'
const Paginationp =({postsPerPage,totalPosts,paginate})=>{
const pagenumbers=[];
for(let i=1;i<=Math.ceil(totalPosts/postsPerPage);i++){
pagenumbers.push(i);
}
return(
<nav>
... |
jQuery(document).ready(function() {
var totalRegionsSelected, totalCategoriesSelected;
var totalRegionsSelectedStr, totalCategoriesSelectedStr;
var $searchContainer = $(".search-form-container");
var $searchForm = $searchContainer.find("form");
$searchForm.find("input[name='regions[]']").ch... |
import ContainerTitle from "components/website/titles/containerTitle";
import LargeTitle from "components/website/titles/LargeTitle";
import SmallTitle from "components/website/titles/SmallTitle";
export default function TitleStyle1({
textLine1="Our",
textLine2="Differentiation",
textLine3="3 Cans"
... |
import React, {Component} from 'react';
import {View} from 'react-native';
import Header from './src/components/common/Header';
import firebase from 'firebase';
import LoginForm from './src/components/LoginForm';
class App extends Component {
componentWillMount() {
var firebaseConfig = {
apiKey: 'AIzaSyDhc... |
import {
GET_QUESTIONS_REQUEST,
GET_QUESTIONS_SUCCESS,
GET_QUESTIONS_FAIL,
CREATE_QUESTION_SUCCESS,
CREATE_QUESTION_FAILURE,
SET_QUESTION_COUNT,
RESET_QUESTIONS,
} from "./questions.types";
import axios from "axios";
import { push } from "connected-react-router";
import { setAlert } from "../alert/alert.a... |
import React from "react";
import {BrowserRouter as Router} from "react-router-dom"
import Routerview from "router/index"
import Header from "comp/header";
import Layout from "comp/layout";
import Nav from "comp/nav/index"
class App extends React.Component {
render() {
return <div className="wraper">
... |
/**
*
* @param {Object} obj
* @example
* getObject({n:[{a:'fly'}]},"n.1.a")
* @param {Array | string} path
* @return undefined || {*}
*/
export default function(obj,path){
path = Array.isArray(path) ? path : path.split(".");
const length = path.length;
let num = 0;
while(num < length){
... |
import React, { Component } from 'react';
import './App.css';
import { ProductDetails } from './component/ProductDetails';
class App extends Component {
constructor() {
super();
this.state = {
color: '1',
text: 'ADD TO CART',
message: ''
}
this.changeText = this.changeText.bind(t... |
import React from 'react'
import { StyleSheet } from 'quantum'
const styles = StyleSheet.create({
self: {
transition: 'color 0.3s',
color: '#ffffff',
fontSize: '12px',
},
yellow: {
color: '#fdd835',
},
decorated: {
borderBottom: '1px dotted',
},
middle: {
display: 'inline-flex',
... |
#6 Count words
Count each of these words: aku, ingin and dapat.
// Right answer
const lyrics = `Aku ingin begini
Aku ingin begitu
Ingin ini itu banyak sekali
Semua semua semua
Dapat dikabulkan
Dapat dikabulkan
Dengan kantong ajaib
Aku ingin terbang bebas
Di angkasa
Hei… baling baling bambu
La... la... la...
Aku s... |
function almostIncreasingSequence(sequence) {
let seq_false = 0;
for (let i=0; i<sequence.length-1; i++) {
if (sequence[i] >= sequence[i+1]){
seq_false++;
if (seq_false === 2) {
return false
} else if (sequence.length - (i+1) >= 2 && sequence[i-1] >= sequence[i+1] && sequ... |
"use strict";
exports.__id = "shellfish/mid";
const mods = [
__dirname + "/mid/tools.js",
__dirname + "/mid/box.js",
__dirname + "/mid/busypopup.js",
__dirname + "/mid/button.js",
__dirname + "/mid/dialog.js",
__dirname + "/mid/document.js",
__dirname + "/mid/gap.js",
__dirname + "/mid... |
import React from "react";
import Grid from "@material-ui/core/Grid";
import InputAdornment from "@material-ui/core/InputAdornment";
import GridItem from "../../../components/Grid/GridItem";
import Card from "../../../components/Card/Card";
import CardBody from "../../../components/Card/CardBody";
import CardHeader fr... |
import React, { useState } from 'react'
import * as yup from 'yup'
import { yupResolver } from '@hookform/resolvers/yup'
import { useForm } from 'react-hook-form'
import { format } from 'date-fns'
import { Button, Col, Modal, Radio, Row, Select } from 'Components/UI-Library'
import InputField from 'Components/Form-con... |
/* global process */
var blessed = require("blessed");
var quitKeys = ["C-q"];
var quitHandler = function(ch, key) {
return process.exit(0);
};
function ChatScreen(testbed) {
this.screen = blessed.screen();
var screen = this.screen;
this.screen.key(quitKeys, quitHandler);
var inputFormHeight = 3;
var ... |
const assert = require('assert');
const {LRUMap} = require('lru_map');
const parseUAPost = require('./parseUAPost');
const parseUAStr = require('./parseUAStr');
const APP_RULES = require('./key-parsers/rules/app');
const BROWSER_RULES = require('./key-parsers/rules/browser');
const DEVICE_RULES = require('./re-parsers/... |
class UI{
constructor(){
this.mainSearch = document.querySelector('.main-search');
}
minimizeSearchArea(){
this.mainSearch.classList.add('height-transition')
}
updateResultHeading(type, searchTerm){
if(type === 'error'){
resultHeading.innerHTML = `<h2 class=... |
/**
* updater.js
*
* Please use manual update only when it is really required, otherwise please use recommended non-intrusive auto update.
*
* Import steps:
* 1. create `updater.js` for the code snippet
* 2. require `updater.js` for menu implementation, and set `checkForUpdates` callback from `updater` for the c... |
import Stage from "./Stage";
export default Stage;
const name = "the-stage";
if (!window.customElements.get(name)) {
window.customElements.define(name, Stage);
}
|
class Drops{
constructor(x,y){
var options ={
friction : 0.1
}
this.x = x
this.y = y;
this.r = 5;
this.rain = Bodies.circle(x, y, 5, options);
World.add(world, this.rain);
}
display(){
transla... |
import React from "react";
import RightArrowIcon from "../../app/icons/right-arrow.svg";
import { Div, FormDiv, Head } from './LoginStyle'
import Compose from "../../utils/Compose";
import { signIn, signInWithEcp } from "./LoginAction";
import InputField from "../../components/form/InputField";
import Form from "../../... |
import { combineReducers } from 'redux';
import activeRequestsReducers from 'rdx/modules/active-requests/reducers';
import apiReducers from 'rdx/modules/api/reducers';
import appReducers from 'rdx/modules/app/reducers';
import authReducers from 'rdx/modules/auth/reducers';
import localeReducers from 'rdx/modules/locale... |
import gamePlay from '..';
import getRandom from '../lib/rand';
const isBalance = arr => Math.max(...arr) - Math.min(...arr) <= 1;
const alignment = (arr) => {
const newArr = [...arr];
newArr[0] = arr[0] + 1;
newArr[newArr.length - 1] = arr[arr.length - 1] - 1;
return newArr.sort((a, b) => a - b);
};
const b... |
import { createElement as $ } from 'react';
const Contact = () => $('div', null, 'Contact');
export default Contact;
|
const initState = {}
const movieReducer = (state = initState, action) => {
switch (action.type) {
case "CREATE_MOVIE":
console.log('added movie to list', action.movie)
return state
case 'CREATE_MOVIE_ERROR':
console.log('create movie error', action.err)
return state
default:... |
import React, { Component } from 'react';
import {
BrowserRouter as Router,
Route,
Link
} from 'react-router-dom'
import RatingFiveStars from '../../Helpers/RatingFiveStars'
class Summary extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
}
render() {
retur... |
/**
* 递归标记 _webComponentTemp
* @param el
* @param reverse 反转标记
*/
import ReactDOM from "react-dom";
import {childrenAttrTag, childrenAttrValue} from "../identifiers";
export const markTemp = (el, reverse = false) => {
if (el) {
el._webComponentTemp = !reverse;
// if (el.children && el.children.length) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.