text stringlengths 7 3.69M |
|---|
import React, { Component } from 'react';
import propTypes from 'prop-types';
import {
View,
Image,
StyleSheet,
Dimensions,
} from 'react-native';
import { Icon, Text } from 'react-native-elements';
import LinearGradient from 'react-native-linear-gradient';
import ScaleIcon from '../../../assets/icons/scaleIcon.pn... |
// /////////////////////////////////////////////////////////////////////////////
// flatten /////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
function flatten(array){
//declare for loop that loops through every index o... |
import React from 'react';
const Points = (props) => {
return(
<button>Pay 10 points to change {props.addend} to {props.addend + 1}</button>
)
}
export default Points; |
// Copy to Clipboard
(() => {
// Obtener el input text
const copyText = document.getElementById("copyText");
if (!copyText) return false;
copyText.value = "0x1282f8cec02b31cd607789ea165b7f1db5af75fa";
copyText.readOnly = true;
// Obtener el boton de copiar text
const copyBtn = document.getElementById("but... |
// const getUnique = (arr, comp) => {
// const unique = arr
// .map(e => e[comp])
// // store the keys of the unique objects
// .map((e, i, final) => final.indexOf(e) === i && i)
// // eliminate the dead keys & store unique objects
// .filter(e => arr[e])
// .map(e => arr[e]);
// return uni... |
const _ = require('lodash');
const imageRepository = require('../../images/imageRepository');
const { isPopulated } = require('../../../shared/util/mongooseUtils');
/**
* Prepare content object to be sent to client.
* @returns {Event}
*/
function deserialize(content) {
if (content.toObject) {
content = conte... |
module.exports = function(GuiaEstado) {
};
|
$(document).ready(function(){
var suits = ["clubs" , "diamonds" , "hearts" , "spades"];
var ranks = ["ace" , "2" , "3" , "4" , "5" , "6", "7" , "8" , "9" , "10" , "jack" , "queen" , "king"];
suits.forEach(function(suit){
ranks.forEach(function(rank){
var string = (rank + " of " + suit);
$("#list... |
import React, { useEffect, useState } from 'react';
import { axiosWithAuth } from '../utils/axiosWithAuth';
import { NavLink } from 'react-router-dom';
import {
TWITTER_TWEETS,
TWITTER_TIMELINE,
TWITTER_MENTIONS,
} from './Twitter_Tweets';
const Dashboard_Feed = (props) => {
const [feed, setFeed] = useState([]... |
const { ipcRenderer, remote } = require('electron')
const { writeJSON, readJson } = require("fs-extra");
const { homedir } = require("os");
window.remote = remote;
window.writeJSON = writeJSON;
window.readJson = readJson;
window.homedir = homedir;
window.isElectron = require('is-electron');
// Since we disabled nodeInt... |
// modules
var express = require('express');
var http = require('http');
var path = require('path');
var debug = require('debug')('core');
debug('running with debug messages');
var handlers = require('./lib/handlers')();
var app = express();
var config = require('./config');
config.applyConfiguration(app);
require(... |
$(document).ready(function(){
// BASIC SELECTORS
//$('p').css('border', '4px solid red');
//BASIC ANIMATION
$('.box:first').hide(500).show(500);
//INDEX FILTER
//$('p:lt(2)').css('border', '4px solid red');
//RELATIONSHIP FILTERS
//$('.box:empty').css('border', '4px solid red');
//ATTRIBUTE FILTE... |
module.exports = data => ({
color: ["#3889FF", "#33BF60", "#5B6ECF", "#EAC05D", "#35DDEB", "#A08BFE"],
tooltip: {
trigger: 'item',
formatter: "{b}: {c} ({d}%)"
},
series: [{
type: 'pie',
radius: ['0%', '65%'],
label: {
normal: {
formatt... |
var tokki = angular.module("directives").directive("adminProductNeto", ["tokkiApi",
function(tokkiApi){
return {
restrict: "E",
templateUrl: "pages/admin/productos/adminProduct/adminProductNeto.html",
controller: ["$scope", "$filter", "$state", function($scope, $filter, $... |
angular.module('Services', []);
require('./services/user.js');
require('./services/categories.js'); |
function confirmEnding(str, target) {
let test = [];
console.log(str[str.length-1]);
for(let i = (str.length-1);i >= (str.length-target.length); i --){
console.log(str[i])
test.unshift(str[i]);
}
let word = test.join('');
if (word==target){
return true
} else {
return false
}
}
console.... |
// app js
const express = require("express")
const app = express()
module.exports = app;
// bodyparser instantiation
const bodyParser = require("body-parser");
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({
extended: false
}));
// parse application/json
app.use(bodyParser.json());
// ... |
/*the small images for mid images*/
function changeImg(url,show, num) {
if(num == null ) num = 0;
var aa = show + "_a";
var ii = show + "_i";
$(ii).src = url;
var bigUrl = url.replace('/medium/','/large/');
$(show).href = bigUrl;;
}
function initBtn(btns,showimg){
var smallImgBtns = $(btns).getEle... |
const Person=require("./Person")
const Guardian=require("./Guardian")
const UniPerson=require("./UniPerson")
const Student=require("./Student")
const Employee=require('./Employee')
const Teacher=require('./Teacher')
const Stuff=require('./Stuff')
const Contact=require('../Contact/Contact')
const Address=require... |
import React from "react";
import { Link } from "react-router-dom";
import PropTypes from "prop-types";
import Icon from "../Icon";
import "./styles.scss";
const Header = ({
headerText,
leftIconProps,
rightIconProps,
leftLink,
rightLink
}) => (
<div className="Header">
{leftIconProps && (
<Link... |
import React from 'react';
import Layout from '../components/Layout';
import { observer } from 'mobx-react';
import store from '../common/store';
import { observable } from 'mobx';
import uuid from 'uuid/v4';
import firebase from '../common/firebase';
import db from '../common/firestore';
//import Link from 'next/link'... |
import {mapValues, pick} from 'lodash'
// local libs
import {PropTypes, assertPropTypes, plainProvedGet as g} from 'src/App/helpers'
import {pornstarInfoForTableModel} from 'src/App/Pornstar/models'
const
pornstarInfoModelProps = process.env.NODE_ENV === 'production' ? null : Object.freeze({
// these para... |
const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
return sequelize.define('Wishlist', {
wishlist_id: {
autoIncrement: true,
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
primaryKey: true,
comment: "Wishlist ID"
},
customer_id: {
... |
import React, { forwardRef } from 'react';
import { Root, IconPlus } from './styled';
const Button = forwardRef(({ variant, children, plusIcon, type, ...props }, ref) => (
<Root ref={ref} variant={variant} type={type} {...props}>
{plusIcon && <IconPlus variant={variant} />}
{children}
</Root>
));
Button.d... |
function Game() {
}
Game.prototype = {
walkDown: function () {
player.loadTexture('player', 0);
player.animations.stop();
player.animations.play('walkDown', 8, true);
},
walkUp: function () {
player.loadTexture('player2', 0);
player.animations.stop();
player.animations.play('walkUp', 8, true);
},
walkL... |
const socket = require('socket.io');
const {StrategyFinder, EventType} = require('../components/strategyfinder');
class Emitter {
constructor(io) {
this.strategyFinder = StrategyFinder.getInstance();
this.strategyFinder.addListener(EventType.NEW_TEST_POPULATION,
(strategy, data) => io.emit(EventTyp... |
import React, { Component } from 'react';
import { View } from 'react-native';
import YouTube from 'react-native-youtube'
import { youtubeApiKey } from '../../../../utils/constants'
class VideoPlayer extends Component {
render (){
return (
<View>
<YouTube
apiKey={youtubeApiKey}
... |
const eventBus = require('./event-bus')
module.exports = class Inventory {
products = new Map()
constructor() {
eventBus.on('payment succesful', (product) => {
this.removeProduct(product)
})
}
addProduct(product) {
if (!this.products.has(product)) {
this.products.set(product, 0)
}... |
import * as types from './actionTypes';
import RecipeApi from '../api/recipeApi';
import history from '../history'
import {getPotlucks} from './potlucksActions'
import PotluckRecipeApi from '../api/potluckRecipeApi'
import GuestApi from '../api/guestApi'
//TO REFACTOR:
// ~GUEST ACTIONS TO GUESTAPI
// ~REPLACE GET... |
const webpack = require("webpack")
const WebpackDevServer = require("webpack-dev-server")
const webpackConfigs = require('./webpack.config.js')
const project = +process.argv[2]
if (project && project>0) {
let config = webpackConfigs[project - 1]
config.entry.hot = 'webpack/hot/dev-server'
config.entry.inline= ... |
const person = {
name: 'Taylan',
lastname: 'YILDIZ',
age: 25,
add: () => { console.log('Hey') },
}
module.exports = { person }; |
var searchData=
[
['edge_5fconnection_5ft',['edge_connection_t',['../or_8h.html#ae0532aea96ffa5d1bdf9df8cc629b2ce',1,'or.h']]],
['entry_5fconnection_5ft',['entry_connection_t',['../or_8h.html#ac3ffa8a4018ca145a98b3254ab74bef3',1,'or.h']]],
['event_5fmask_5ft',['event_mask_t',['../control_8c.html#a2dcff8985975867d... |
let BaseMenu = require("./basemenu.js");
/**
* The race select menu.
* @name TextInput
* @type ElonaJS.UI.Menus.TextInput
* @memberOf ElonaJS.UI.Menus
*/
let TextInput = new BaseMenu();
TextInput.Customize({centered: true, size: {w: 220, h: 55}});
TextInput._OnLoad = function(){
this.active = true;
if(... |
const fs = require('fs');
const path = require('path');
const babylon = require('babylon');
const traverse = require('@babel/traverse').default;
const types = require('@babel/types');
const generator = require('@babel/generator').default;
const ejs = require('ejs');
// babylon 主要就是把源码 转换成ast
// @babel/traverse 遍历到对应的节点... |
import React from 'react';
import { StyleSheet, View, Image, ScrollView, TouchableOpacity, Text} from 'react-native';
import Video from "expo/src/av/Video.web";
export default class MassImage extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<View style={styles.con... |
var KendaniEak = require("./class.KendaniEak.js");
module.exports = class Sunk extends KendaniEak {
constructor(x, y) {
super(x, y);
this.multiply = 0
this.directions = [
[this.x - 1, this.y - 1],
[this.x, this.y - 1],
[this.x + 1, this.y - 1],
... |
var async = require('./async');
var fs = require('fs');
/*async.each(
['f1', 'f2', 'f3'],
function (file, whenDone) {
fs.readFile(file+'.txt', {'encoding' : 'utf-8'}, function(err, data) {
if(err) {
return whenDone(err);
}
console.log(data);
... |
import gql from "graphql-tag";
export const GET_ALL_MATCHES = gql`
subscription LiveMatches {
matches(order_by: { finished: asc, started_at: asc }) {
id
started_at
p1 {
id
name
}
p2 {
id
name
}
setts {
p1_score
p2_score
... |
import axios from 'axios'
const URL_API = 'http://localhost:3000/';
export const URL_SOCKET = 'http://localhost:3001/';
export const getChatrooms = () => {
return axios.get(URL_API+'chatrooms')
}
export const getChatroom = (id) => {
return axios.get(URL_API+'chatroom/'+ id)
}
export const addMessage = (id, use... |
let teams = [{"abbr":"atl", "logo":"../static/logos/atl.gif", "name":"Atlanta Falcons"},
{"abbr":"buf", "logo":"../static/logos/buf.gif", "name":"Buffalo Bills"},
{"abbr":"car", "logo":"../static/logos/car.gif", "name":"Carolina Panthers"},
{"abbr":"chi", "logo":"../static/logos/chi.gif", "name":"Chicago Bears"... |
$(document).ready(function() {
var funcion = "";
var tipo_usuario = $('#txtTipoUsuario').val();
var cargo = $('#id_cargo').val();
var id_sede = $('#txtId_sede').val();
buscar_avatar();
buscarNotas();
function buscar_avatar() {
var id = $('#id_usuario').val();
funcion = 'busc... |
Package.describe({
name: 'jagi:astronomy-simple-validators',
version: '1.0.3',
summary: 'Simple validators for Meteor Astronomy',
git: 'https://github.com/jagi/meteor-astronomy-simple-validators.git'
});
Package.onUse(function(api) {
api.versionsFrom('1.1.0.2');
api.use('jagi:astronomy-validators@1.0.4');... |
import React from 'react';
import ReactDOM from 'react-dom'
export default class RubricRow extends React.Component {
constructor(props) {
super(props);
}
render() {
return <tr>{this.props.children}</tr>
}
} |
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import Typography from '@material-ui/core/Typography';
import IconButton from '@material-ui/core/IconButto... |
module.exports = function check(string, bracketsConfig) {
let brackets = bracketsConfig.map(item => item.reduce((acc, cur) => acc + cur));
let str = string;
for (let i = str.length; i >= 0 ; i--) {
brackets.forEach(item => {
str = str.replace(item, '')
});
if(str.length === 0) return true;... |
const Augur = require("augurbot"),
u = require("../utils/utils");
function parseMission(str) {
let date = new RegExp("(" + [
"january", "jan",
"february", "feb",
"march", "mar",
"april", "apr",
"may",
"june", "jun",
"july", "jul",
"august", "aug",
"september", "sept", "sep",
... |
import CartActions from './cart.actionTypes';
import {addItemToCart,clearFromCart,removeItemFromCart} from './cart.utils';
const INITIAL_STATE = {
hidden:true,
cartItems:[]
};
const cartReducer = (state=INITIAL_STATE,action)=>{
switch(action.type){
case CartActions.TOGGLE_CART_DISPLAY:
... |
/*
* @lc app=leetcode.cn id=645 lang=javascript
*
* [645] 错误的集合
*/
// @lc code=start
/**
* @param {number[]} nums
* @return {number[]}
*/
var findErrorNums = function(nums) {
nums = nums.sort((a, b) => { return a - b})
var res = [];
let missing = 1;
for (var i = 0; i < nums.length; i++) {
... |
import React, { useState } from "react";
import styled from "styled-components";
export default function JsonEditor({ json }) {
return (
<div>
<h1>JSON</h1>
<ul>
{Object.entries(json).map(([name, value]) => (
<JsonItem name={name} value={value} />
))}
</ul>
</div>
... |
/**
* Module dependencies.
*/
var express = require('express');
var http = require('http');
var path = require('path');
var app = express();
var port = process.env.PORT || 10010;
app.configure(function(){
app.set('port', port);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.se... |
/*
Usage:
nodejs estimate-gas.js {ethServer} {codeBinary}
Returns:
Json object containing gasEstimate property
Example:
nodejs estimate-gas.js 'http://localhost:8545' 0x6060604052341561000c57fe5b{...}
Result:
{"gasEstimate":229411}
*/
if (process.argv.length <= 3) {
console.log("Usage: nodejs estimate-gas.js {{... |
angular.module('boosted')
.service('geoService', function($http, $q) {
var self = this;
this.searchMap = function(address) {
console.log('service', address);
var deferred = $q.defer();
$http({
method: 'GET',
url: 'https://maps.googleapis.com/maps/api/geocode/json?address=' + address.street +... |
function showResult(str,order)
{
if (str.length==0)
{
document.getElementById("livesearch").innerHTML="";
document.getElementById("livesearch").style.border="0px";
return;
}
if (window.XMLHttpRequest)
{// IE7+, Firefox, Chrome, Opera, Safari 浏览器执行
xmlhttp=new XMLHttp... |
let array = [1, 2, 3, 4, 'hello', 5, 6, 'yo'];
const evenOdd = (arr) => {
// Solution code here...
let arrayMap = [];
arr.map(a => {
if (typeof a === 'number') {
if (a % 2 === 0) {
arrayMap.push('even');
} else {
arrayMap.push('odd');
}
} else {
arrayMap.push('N/A... |
import React from 'react'
import { mount } from 'enzyme'
import { getSchema, getColumns } from 'Test/factories'
import Data from '../Data'
describe('<FormData/Data>', () => {
test('rendering', () => {
const schema = getSchema()
const columns = getColumns(schema)
const model = {
firstName: 'Dimitri'... |
//Código não executável
// Procedural
processamento(valor1, valor2)
// OO
objeto = {
valor1,
valor2,
processamento(){
//...
}
}
obejo.processamento() // Foco passou a ser o objeto
//Principios importantes
//1.Abstração
//2.Encapsulamento
//3.Herança (prototype)
//4.Polimorfismo |
import {materials, mesh} from "./materials";
const createPlayground = () => {
// Создаём землю
const ground = mesh.createGround({
width: 1000,
height: 1000,
material: materials['green'],
visible: true
});
ground.setPhysics({friction: 1});
// Создаём невидимые стены... |
'use strict';
module.exports = class {
persist(domainReservation) {
throw new Error('ERR_METHOD_NOT_IMPLEMENTED');
}
merge(domainReservation) {
throw new Error('ERR_METHOD_NOT_IMPLEMENTED');
}
get(reservationId) {
throw new Error('ERR_METHOD_NOT_IMPLEMENTED');
}
... |
(function(){
'use strict';
/**
* Customization Template
*/
angular.module('appJLA')
.controller('CtrlSettings', CtrlSettings)
.run(runJLA)
CtrlSettings.$inject = ['$translate', '$http']
function CtrlSettings($translate, $http){
var vmSettings = this;
// getFileConfig($... |
import { Map } from 'immutable';
import { combineReducers } from 'redux-immutablejs'
import { routerReducer } from 'react-router-redux'
import system from './model/system/reducer';
import list from './model/list/reducer';
import edit from './model/edit/reducer';
import detail from './model/detail/reducer';
const rootC... |
// Run with node js
var fs = require("fs"),
path = require("path");
var dir_name = "/media/d4insight/backup/sample/"
function depthfirstsearch(dir_name, visited = [], results = []){
fs.readdir(dir_name, (err, files) => {
files.forEach(file => {
new_dir = dir_name + file + '/';
// console.log... |
/**
*
* @class beModel
* @author Šimon Schierreich <simon+BitmapEditor@scheras.eu>
* @description Třída se stará o předání řízení správnému modulu.
* @since 0.5
*
*/
function beModel () {
/**
*
* @author Šimon Schierreich <simon+BitmapEditor@scheras.eu>
* @description Seznam dostupných ... |
require('./db')
const bodyParser = require('body-parser')
const express = require('express')
const path = require('path')
const BillingUnitRoutes = require('./controllers/BillingUnitController')
const app = express()
app.use(
bodyParser.urlencoded({
extended: true,
})
)
app.use(bodyParser.json())
app.use((re... |
import React from "react"
import Countdown from "react-countdown-now"
class CountDownC extends React.Component{
state = {
endTime: "0"
}
renderer = ({ hours, minutes, seconds }) => {
return <span style={{letterSpacing: "2px"}}>{addDigit(hours)}:{addDigit(minutes)}:{addDigit(seconds)}</span>
}
shou... |
class PhaseTracker {
constructor() {
this.phases = [];
this.stateUpdateEmittedCallback = null;
this.latestState = null;
}
AddPhase(phase) {
this.phases.push(phase);
}
ExecutePhases(state) {
this.phases.forEach((phase) => {
if (phase.IsReady() && !phase.IsComplete()) {
phase.SetPhaseCompletedCall... |
var router = require('express').Router();
router.use('/users', require(__dirname + '/users'));
router.use('/scores', require(__dirname + '/scores'));
module.exports = router;
|
const config = {
featureExtraction: {
color: {
// some color configs here
distance: 1,
}
}
}
module.exports = Object.freeze(config) |
document.body.addEventListener("keydown",(event)=>{
code.value = event.code;
key.value = event.key;
keyCode.value = event.keyCode;
welcome.classList.add("hidden");
output.classList.remove("hidden")
})
let btns = document.querySelectorAll(".btn");
btns.forEach(btn=>{
btn.addEventListener("click",(event)=>{
btn.... |
import * as React from 'react';
import Dialog from 'material-ui/Dialog';
import { List, ListItem } from 'material-ui/List';
import Subheader from 'material-ui/Subheader';
import ActionShowRecentImagery from './ActionShowRecentImagery.js';
import ActionShowActionFundProposals from './ActionShowActionFundProposals.js';
i... |
import React, {
AppRegistry,
Component,
ScrollView,
StyleSheet,
Text,
TouchableOpacity,
View,
} from 'react-native';
import CloudItem from './CloudItem';
import Physics from '../shit/Physics';
const CirclePosMap = [
{x: 10, y: 10, r: 100}, // burger
{x: 150, y: 50, r: 120}, // pizza
{x: 50, y: 16... |
import { createStackNavigator } from "react-navigation-stack";
import Ask from "../screens/askPage";
import Suceess from "../screens/success";
import ThongKe from "../screens/ThongKe";
import SelectChuDe from "../screens/SelectChuDe";
import SelectTemplate from "../screens/selectTemplate";
import Header from "../compon... |
import { Component } from '@angular/core';
@Component({
selector: 'nsa-footer',
template: `
<div class="container">
<span>Place sticky footer content here.</span>
</div>
`,
styles: [require('./footer.component.scss')]
})
export class FooterComponent {
}
|
function generateTableHead(table, data) {
let thead = table.createTHead();
let row = thead.insertRow();
for (let key of data) {
let th = document.createElement("th");
let text = document.createTextNode(key);
th.appendChild(text);
row.appendChild(th);
}
}
function gen... |
import React, { useState, useEffect } from 'react';
import axios from 'axios';
import {useSelector, useDispatch} from 'react-redux';
import { useHistory } from 'react-router-dom';
// This is one of our simplest components
// It doesn't have local state
// It doesn't dispatch any redux actions or display any part of r... |
//set comment.forItemId, present.forUser
db.users.find({}).forEach(function (user) {
if (user.comments) {
user.comments.forEach(function (commentId) {
db.comments.update({_id: commentId}, {$set: {forItemId: user._id}});
});
}
if (user.presents) {
user.presents.forEach(fun... |
const express=require('express');
const router= express.Router();
const { connection } = require('../../dbcon');
router.post("/nickNameCheck",function(req,res){
connection.connect();
const {body}=req;
const nickName = body.nickName;
const check_nickName=(email.replace(/(\s*)/g,""));
... |
angular.module('boosted')
.controller('communityCtrl', function($scope,service, $state, $http) {
service.getblogs().then(function(response){
$scope.blogs = response.data;
console.log($scope.blogs[0].blogid);
})
});
|
export default function APIAccess() {
return {
async getSearchTweets(q) {
if (!q) {
throw new Error('q parameter is required to fetch tweets');
}
return await fetch(`/api/tweets/?q=${q}`)
.then((response) => {
if (!resp... |
import React from 'react';
import { View,Text,Button,TouchableOpacity,TextInput,Alert} from 'react-native';
import { StackNavigator } from 'react-navigation';
import { Entypo } from '@expo/vector-icons';
import SoftWare from './SoftWare'
const {text,short} = details ;
class _1S extends React.Component {
// next li... |
$("#button").click(function(){
alert('Commit');
var name_form=$("#name").val();
var address_form=$("#address").val();
var phone_form =$("#phone").val();
var site_form=$("#site").val();
$.ajaxSetup({
success:function(data){
data=$.parseJSON(data);
alert(data['new-text']);
}
});
$.post(... |
import { CreatePostReducer } from '../Redux/Actions';
let count = 0;
export const CreatePost = (newPost) => (dispatch) => {
fetch('https://jsonplaceholder.typicode.com/posts', {
method: 'POST',
body: JSON.stringify({
title: newPost.title,
body: newPost.body,
}),
headers: { 'Content-type':... |
import React from "react";
import Button from "@paprika/button";
import Popover from "../../src";
export default function ButtonTrigger() {
return (
<Popover>
<Popover.Trigger>{handler => <Button onClick={handler}>More info</Button>}</Popover.Trigger>
<Popover.Content>
<Popover.Card>Lorem hip... |
export default function convertTZ(date, tzString) {
return new Date((typeof date === "string" ? new Date(date) : date).toLocaleString("en-US", {timeZone: tzString}));
} |
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import Grid from '@material-ui/core/Grid';
const useStyles = makeStyles({
root: {
background:"rgba(221, 221, 221,0.4)"
},
bull... |
import React from 'react';
function Search ({handleInput, search}) {
return (
<section className="searchebox-wrap">
<input
type="text"
placeholder="Find a movie"
className="searchbox"
onChange= {handleInput}
onK... |
define([], function() {
var enroll = "core/enroll/";
var register = "core/register/";
var master = "core/master/";
var role = "core/role/";
var menu = "core/config/";
var login = "core/login/"
var mygv = "https://api.mygov.in/";
var report = "core/report/";
var workflow = "workflow/task/";
var gallery="core/... |
import { DisplayObjectContainer } from "./DisplayObjectContainer.js";
import { Vector2 } from "../geom/Vector2.js";
export class Sprite extends DisplayObjectContainer {
constructor() {
super();
this.renderable = true;
this.anchor = new Vector2();
this.transformedVerts = new Float32Ar... |
/**
* 根据一棵树的中序遍历与后序遍历构造二叉树。
* 注意:
* 假设树中没有重复的元素。
*/
/**
* @param {number[]} inorder
* @param {number[]} postorder
* @return {TreeNode}
*/
var buildTree = function(inorder, postorder) {
if(!postorder.length) return null;
// 后序遍历的最后一项永远是Root
const node = new TreeNode(postorder[postorder.leng... |
"use strict";
function creditCardValidator(cardNumber = "") {
const arrayOfDigits = Array.from(String(cardNumber), Number);
if (typeof cardNumber !== "number" ||
arrayOfDigits.length !== 16 ||
arrayOfDigits.reduce((a, b) => a + b) < 16 ||
arrayOfDigits.pop() % 2 != 0 ||
al... |
import React from "react";
export default function Header() {
return (
<div className="header">
<h1>Lab 21</h1>
<h2>seattle-js-401n16</h2>
</div>
);
}
|
//-------------------------------------------------------------------------------------------------------
// ClearTypeFadeTo / ClearTypeFadeIn / ClearTypeFadeOut
//
// Custom fade in and fade out functions for jQuery that will work around
// IE's bug with bold text in elements that have opacity filters set when
//... |
const utils = { };
utils.palette = () => {
let colors = [
'#023fa5', '#7d87b9', '#bec1d4',
'#d6bcc0', '#bb7784', '#8e063b',
'#4a6fe3', '#8595e1', '#b5bbe3',
'#e6afb9', '#e07b91', '#d33f6a',
'#11c638', '#8dd593', '#c6dec7',
'#ead3c6', '#f0b98d'... |
var myApp = myApp || {};
let myApp.todoList = {
q: document.querySelector,
option: {
todoListContainer: '#todoList',
},
events: function () {
this.q('#clear').addEventListener('click', function(event) {
todoList = JSON.parse(localStorage.getItem('todo'));
if(todo... |
/**
* Created by xiaojiu on 2017/3/22.
*/
'use strict';
define(['../../../app', '../../../services/storage/storage-permissionManage/storageCarManageService'], function(app) {
var app = angular.module('app');
app.controller('storageCarManageCtrl', ['$scope', '$state', '$sce', 'storageCarManage', function($scop... |
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { schedule } from '@ember/runloop';
export default class ApplicationRoute extends Route {
@service kredits;
@service communityFunds;
beforeModel(/* transition */) {
return this.kredits.setup().then(() => {
... |
var slideIndex;
function startSlides() {
slideIndex = 1;
showSlideMedia(slideIndex);
}
function previousSlide() {
slideIndex -= 1;
showSlideMedia(slideIndex);
}
function nextSlide() {
slideIndex += 1;
showSlideMedia(slideIndex);
}
function showSlideMedia(indexNo) {
let sl... |
import { useState } from 'react'
import { Link } from '@reach/router'
import { useDispatch, useSelector } from 'react-redux'
import { Visibility, VisibilityOff, Facebook } from '@material-ui/icons'
import {
Button,
FormControl,
InputLabel,
TextField,
IconButton,
OutlinedInput,
InputAdornment,
} from '@mat... |
class Node {
constructor(data) {
this.data = data;
this.next=null;
this.prev = null;
}
}
class LinkedList{
constructor(data){
this.head = data!== undefined ? new Node(data) : null;
this.tail = this.head;
this.size = this.head ? 1 : 0;
}
appendToTail... |
//The Map with the array...
let list = ['asad is here', '', 12, function(){}, false]
const ourMap = new Map()
//The Setter method of map...
ourMap.set(list[0], 'The 1st Value')
ourMap.set(list[1], 'The 2nd Value')
ourMap.set(list[2], 'The 3rd Value')
ourMap.set(list[3], 'Our Funtion')
ourMap.set(list[... |
/*
Copyright 2016 The OmniDB Team
This file is part of OmniDB.
OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
OmniDB is distribute... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.