text stringlengths 7 3.69M |
|---|
const electron = require('electron');
const vibrancy = require('ewc');
electron.app.on('ready', () => {
let windows = [];
let mainWindow = new electron.BrowserWindow({
width: 1300,
height: 800,
minHeight: 600,
minWidth: 800,
resizable: true,
transparent: true,
... |
import React, {Component} from 'react';
import {
View,
Text,
TouchableOpacity,
Image} from 'react-native';
import {Icon} from '../common'
import {RATIO} from '../../styles/constants';
const Item = ({onPress, imageSrc, children}) => {
return (
<TouchableOpacity
onPress={onPress}... |
import React from 'react';
// Para chamar o parâmetro de Header (props) devemos colocar entre {}, indicando a utilização de JavaScript
function Header (props) {
// Acessamos a props.title passada em App.js
return <h1>{props.title}</h1>
}
export default Header; |
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import Login from './Login';
import Comment from './Comment';
import AddComment from './AddComment';
import Upload from './Upload';
import '../App.css';
class Timeline extends Component {
// initializing the state
state = {
... |
/*
Created by eoswebnetbp1
*/
var mongoose = require('mongoose');
mongoose.Promise = global.Promise;
var MODEL_NAME = 'Stats';
var TABLE_NAME = 'Stats';
var MODEL;
var mapSchema = new mongoose.Schema({
name: {
type: String,
default: 'Unknow'
},
idx: {
type: Number,
default: 0
}
});
var st... |
import * as constants from '~/constants'
import * as errors from '~/errors'
import * as utils from '~/utils'
export default function load(api) {
const { registerCommand: register, permissions, guildSettings } = api
permissions.registerPermission(constants.PERM_CHANNELS, 'Allows using all the commands related to c... |
import React, { Component } from 'react';
import css from './styles.scss';
import {string} from 'prop-types';
//My Component
import Card from 'components/Card';
import sliderImg from 'assets/img/slider.jpg';
class Slide extends Component {
static propTypes = {
title: string,
content: string
}
render() ... |
/*
* Copyright (c) 2011-2016 Pivotal Software 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
*
* Unles... |
const camelCase = (string) => {
if (!string || typeof string != "string" || !string.trim())
throw "string must be a non-empty string";
return string
.trim()
.split(" ")
.map((word, ind) => {
if (ind === 0) return word.toLowerCase();
return word[0].toUpperCase() + word.slice(1).toLowerCas... |
var mutations={
updataUserInfo(state,obj){
// console.log(obj);
state.userInfo=obj
}
}
export default mutations
|
const mongoose = require('mongoose');
const { Schema } = mongoose;
const task = new Schema({
uuid: { type: String, unique: true },
title: String,
completed: { type: Boolean, default: false },
});
module.exports = mongoose.model('Task', task);
|
// This depends on the metapng module – https://github.com/brianlovesdata/metapng.js
var metapng = require('metapng');
var KEYWORD = 'openbadges';
// Creates a new buffer with `data` written as a tEXt chunk under the
// `KEYWORD` keyword. It's important that only one of these exists – it
// doesn't make sense for a si... |
const express = require("express");
const db = require("../../models/index");
const bcrypt = require("bcrypt");
const router = express.Router();
const passport = require("passport");
const jwt = require("jsonwebtoken");
const { User } = db;
const saltRounds = 10;
// Register API
router.post("/register", (req, res) =>... |
import React from 'react'
import './WeatherDisplay.scss'
import WeatherRow from '../WeatherRow/WeatherRow'
const WeatherDisplay = (props) => {
return (
<section className="weather-display">
<h1 name={props.searchCity}>{props.searchCity}</h1>
<WeatherRow
weatherData={props.weatherCurrentData}
... |
import createSelectorProps from '../SelectorProps'
import { getSchema } from 'Test/factories'
describe('SelectorProps', () => {
const selectorDS = getSchema().dataSource.getSelectorDataSource()
test('default props', () => {
const props = createSelectorProps({
dataSource: selectorDS
})
expect(pr... |
import React from "react";
import { Box, makeStyles } from "@material-ui/core";
import Accordion from "../accordion";
const useStyles = makeStyles({
bgImage: {
backgroundColor: "#ffffff",
display: "flex",
},
boxShadow: {
color: "black",
boxShadow:
"rgb(0 0 0 / 20%) 0px 3px 3px -2px, rgb(0 0... |
$(function () {
// 画像選択時のプレビュー
$('#icon-img').on('change', function (e) {
let reader = new FileReader();
reader.onload = function (e) {
$('#preview-icon-img').attr('src', e.target.result);
}
reader.readAsDataURL(e.target.files[0]);
});
// 検索フォームに入力したら、メンバー検索処理
$('#member-check-form').on('input', func... |
import React, { Component } from "react";
import { v4 as uuidv4 } from "uuid";
import style from "../PhoneBook/PhoneBook.module.css";
class Form extends Component {
state = {
name: "",
phone: "",
};
inputHandler = ({ target }) => {
const { value, name } = target;
this.setState({
[name]: va... |
function searchHikeByName() {
//get the first name
var hike_name_search_string = document.getElementById('hike_name_search_string').value
//construct the URL and redirect to it
window.location = '/search/' + encodeURI(hike_name_search_string)
}
|
/**
* Created by Jay on 2017/11/13.
*/
const dbpool=require('../config/dbpoolConfig');
const roleModel=require("../dao/roleDAO");
const rolecontroller={
pageCount:6,
getRole(req,resp){
//console.log(req.params.page);
let params=[];
params.push((req.params.page-1)*rolecontroller.pageCo... |
class Tree {
constructor() {
this.root = null;
}
/**
* Gets a random node from the tree.
* @returns {TreeNode} Random node selected.
*/
getRandomNode() {
if (!this.root) {
return null
};
const random = Math.random() * 10 + this.size();
... |
import React, { useEffect, useState } from 'react';
import axios from 'axios';
import styled from 'styled-components';
import moment from 'moment';
import {
BrowserRouter as Router,
Switch,
Route,
} from "react-router-dom";
import ReactHtmlParser from 'react-html-parser';
import ShowResponse from "../../uti... |
import spellTwoDigitNumber from './spell-two-digit-number'
describe('spellTwoDigitNumber', () => {
test('should exist', () => {
expect(spellTwoDigitNumber).toBeDefined()
})
test('should return', () => {
expect(spellTwoDigitNumber(42)).toEqual('forty-two')
expect(spellTwoDigitNumber(2)).toEqual('two'... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildBlogCategory = exports.removeBlogCategory = exports.findBlogCategoryByName = exports.findBlogCategory = exports.addBlogCategory = exports.categoryRepo = void 0;
const useCases_1 = require("./useCases/");
const BlogCategoryReposito... |
app.controller('ProfileController', ["$http", "UserFactory", "IdFactory", "$location", "$mdDialog", function($http, UserFactory, IdFactory, $location, $mdDialog) {
var self = this;
self.checkbox = true;
self.clients = [];
self.survey = {};
self.showCompany = false;
self.showUpdateButton = true;
self.show... |
import React from "react";
import ChatHeader from "../ChatHeader/ChatHeader";
import ChatInput from "../ChatInput/ChatInput";
import MessageList from "../MessageList/MessageList";
const Chat = () => {
return (
<section className="Chat">
<header className="Chat__header">
<ChatHeader />
</heade... |
import React, { useState, useEffect } from 'react'
const EditObjectiveForm = () => {
return <form></form>
}
|
#!/usr/bin/env node
const fs = require('fs');
const readChunk = require('read-chunk');
const imageType = require('image-type');
const execFile = require('child_process').execFile;
const cwebp = require('cwebp-bin');
const program = require('commander');
const chalk = require('chalk');
var fileList = [];
function list... |
console.log('This is common.js');
/**
* Removes a module from the cache
*/
require.uncache = function (_module) {
//Run over the cache looking for the files
//loaded by the specified module name
require.searchcache(_module, function (module) {
delete require.cache[module.id];
});
//Remove cached paths to the... |
const Traveler = require("./Traveler");
class Doctor extends Traveler{
// constructor(name){
// super(name);
// this._food = 1;
// this.isHealthy = true;
// }
constructor(name, value, number){
super(name, value, '1')
}
heal(traveler){
return traveler.isHea... |
require("../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/packageB/interactive_msg/main", "components/views/loading" ], {
"084a": function(e, t, n) {
(function(e) {
function t(e) {
return e && e.__esModule ? e : {
defaul... |
import React from 'react'
const debugMode = false;
export const printLog = (...args) => {
if(true == debugMode) {
console.log(args.join(' '));
}
} |
import React from 'react'
import chai from 'chai'
import chaiEnzyme from 'chai-enzyme'
import { expect, assert, should } from 'chai';
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });
import { shallow, mount, render } from 'enzyme';
import { Memory... |
Template.chartPdf.rendered = function() {
var data = Router.current() && Router.current().data();
if (data) {
var width, height;
var magicW = app_settings.print.magic.width,
magicH = app_settings.print.magic.height;
if (data.print.mode === 'millimetres') {
width = data.print.width * mag... |
import React from "react";
import { AppBar, Grid, Typography, Toolbar } from "@material-ui/core";
import SearchIcon from "@material-ui/icons/Search";
import { withRouter } from "react-router-dom";
function Component(props) {
const { classes } = props;
return (
<React.Fragment>
<AppBar position="static" ... |
// for DFP - Audience pixel
(function () {
// dmp: prepare and insert dmp tag - advance tag with ldap w
var zhead=document.getElementsByTagName('head')[0];
var zscript1 = document.createElement('script');
zscript1.src="https://tags.crwdcntrl.net/c/4339/cc.js?ns=_cc4339";
zscript1.id="LOTCC_4339";
zhead... |
/*
* Programming Quiz: Menu Items
* Copyright Udacity
Directions:
Create a breakfast object to represent the following menu item:
The Lumberjack - $9.95
eggs, sausage, toast, hashbrowns, pancakes
The object should contain properties for the name, price, and ingredients.
*/
// Answer
var breakfast = {
name: ... |
/*
Your 3 Users will be the following.
0) Tyler, tylermcginnis33@gmail.com, 'iLoveJS'
1) Cahlan, cahlan@devmounta.in, 'iLoveHashtags'
2) Lenny, lenny@theLenster.com, 'iLoveLentilSoup'
*/
var User = function(name, email, pw){
this.name = name;
this.email = email;
this.pw = pw;
};
//Create an Array... |
require('dotenv').config();
const express = require('express');
const cors = require('cors');
const mongoose = require('mongoose');
const bodyParser = require('body-parser');
const rateLimit = require('express-rate-limit');
const createNewReference = require('./services/uniqueReference');
const database = require('./s... |
import React from 'react';
import Quizs from './components/quiz_components/Quizs';
import Quiz from './components/quiz_components/Quiz';
import CreateQuiz from './components/quiz_components/CreateQuiz';
import SignUp from './components/user_components/SignUp';
import SignIn from './components/user_components/SignIn';
i... |
$('.goTo-METHODNAME').on('click', function(e) {
e.preventDefault();
if (!$(this).hasClass('active') || ($(this).hasClass('active') && $(this).hasClass('allow'))) {
if (isPublished) {
com.veeva.clm.gotoSlide('FILENAME.zip', '');
} else {
doc... |
import React, { Component } from 'react';
import Kakao from 'kakaojs';
import Amplify, { Auth } from 'aws-amplify';
import axios from 'axios';
import {InputGroup, FormControl, Button, Form, Card, Container, CardGroup} from 'react-bootstrap';
import config from '../configuration/config';
import Select from 'react-select... |
const removeFromArray = function(...args) {
const a = args[0]
let res = []
a.forEach((item) => {
if (!args.includes(item)) {
res.push(item)
}
});
return res
}
module.exports = removeFromArray
|
const express = require('express');
const user = require('./routes/user');
const flash = require("connect-flash");
const mongoose = require('mongoose');
const passport = require('./tools/Passport');
const session = require('express-session');
const bodyparser = require('body-parser');
const app = express();
m... |
const { expect } = require("chai");
const FS = require("fs");
const { init, getNpxCmd, getPkgName, npxPath } = require("../init");
describe("Test yonpx", () => {
it("test getNpxCmd", () => {
const actual = getNpxCmd(["", "", "reshow"]);
if (actual.p) {
expect(actual.p).to.deep.equal(["yo@latest", "gene... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Button from './shared/Button/Button';
export default class Heroe extends Component {
static propTypes = {
id: PropTypes.string,
name: PropTypes.string,
strength: PropTypes.number,
intelligence: Prop... |
import React from 'react';
import { StyleSheet, Text, View, FlatList, Dimensions } from 'react-native';
const listItem = props => (
<View style={styles.items}>
<Text style={styles.Orders}>Order Id : {props.c_id}</Text>
<Text style={styles.Details}>
{props.City}
</Text>
... |
// 处理 json 中空格的思路:在字符串和键中的空格保留,其余空格跳过
let json = '{"a":{"aa":11111,"bb":1}, "b1":true,"b2": false,"q":null,"n1":-1 , "n2":2.1,"arr" :[1,2,4],"str":"ssss","exp":/^hello/}'
let i = 0 // 指针
function parseValue(){
console.log(json[i])
if (json[i] == "{") {
return parseObject()
} else if (json[i] == "[")... |
import Vue from 'vue';
const ActionGroup = Vue.extend({
props: {
actions: {
type: Array,
default: () => ([]),
},
checkedAction: {
type: Object,
default: null,
},
enabled: {
type: Boolean,
default: false,
},
exclusive: {
type: Boolean,
defaul... |
import React from "react"
import { StyleSheet, Text, View } from "react-native"
import SIZES from "../constants/Sizes"
import COLORS from "../constants/Colors"
const SelectorComponent = props => {
const { title, active, onPressCallback } = props
return (
<View style={[styles.parentView, active ? styles.paren... |
var Tacit = Tacit || {};
Tacit.BlackCircle = function(gameState, position, group, properties) {
"use strict";
Phaser.Graphics.call(this, gameState.game, position.x, position.y);
this.gameState = gameState;
if(group) {
this.gameState.groups[group].add(this);
}
this.anchor.setTo(0.5, 0.5);
this.lineSt... |
//SOAL 1
console.log("----SOAL 1----");
const luaslingkaran=(r,phi=3.14)=>{
return phi*r*r;
}
const kelilinglingkaran=(r,phi=3.14)=>{
return 2*phi*r;
}
const jari2=7;
let luas=luaslingkaran(jari2);
let keliling=kelilinglingkaran(jari2);
console.log("Luas Lingkaran: "+luas);
console.log("Keliling Lingkaran: "+ke... |
const express = require('express');
const path = require('path');
const cookieParser = require('cookie-parser');
const app = express();
const PORT = 3000;
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.get('/', (req, res) => {
return res
.status(200)
.sendFile(path.resolve(__... |
/// <reference types="Cypress" />
describe('WS_Base', () => {
before(() => {
cy.visit('http://automationpractice.com/index.php')
})
it('Capture the button state before and on hover', () => {
// define the button first
const dsbutton = cy.get('#block_top_menu > ul > li:nth-child(2) ... |
/*
* プロファイル編集表示
*
**/
var allPhoto = 7;
var setPhoto = 0;
var dispPhoto = 0;
var maxHeight = 0;
var allW1;
var allWidth;
/* プロファイル編集表示
*
@param プロファイル情報
@return -
*/
function editProfItemSet(profVals) {
var str;
//var setWorkDay;
//var setRestDay;
//var workRestStr;
var setCB;
var showPhoto;
setCB = se... |
import React, {Component} from 'react';
import Menu from "../../components/MenuComponent";
export default class HomeComponent extends Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<Menu/>
HOME
{/* TODO... |
import React from 'react';
import PropTypes from 'prop-types';
import { View } from 'react-native';
import { defaultAvatar } from 'kitsu/constants/app';
import { StyledProgressiveImage } from 'kitsu/screens/Feed/components/StyledProgressiveImage';
import { styles } from './styles';
const avatarSizes = {
large: 62,
... |
import DataType from 'sequelize';
import Model from '../../sequelize';
import { initialize as initializeTokenType } from '../utils';
const TokenType = Model.define('TokenType', {
id: {
type: DataType.INTEGER(11),
allowNull: false,
primaryKey: true,
autoIncrement: true,
},
name: {
type: DataTy... |
import React from 'react';
import {
StyleSheet,
Text,
TouchableOpacity,
View,
FlatList,
ScrollView,
Image,
} from 'react-native';
import {
widthPercentageToDP as wp,
heightPercentageToDP as hp,
} from 'react-native-responsive-screen';
import Emoji from 'react-native-emoji';
import {... |
import firebase from 'firebase'
import { firebaseApp, usersRef, rolesRef } from '../../firebaseApp'
export default {
state: {
oldRoute: null,
users: null,
user: null
},
mutations: {
setOldRoute (state, payload) {
state.oldRoute = payload
},
setUser (state, payload) {
state.us... |
import React from 'react';
import ReactDOM from 'react-dom';
import './index.scss';
function Square(props) {
const checkXorY = (val) => {
if (val === 'X') { return ' X' }
if (val === 'Y') { return ' Y' }
return ''
}
return (
<button
onClick={props.onClick}
clas... |
console.log("login_view");
LoginPageView = Backbone.View.extend({
parentElement: '#login-page-wrap',
events: {'submit .form-signin': 'check'},
initialize: function() {
this.render();
},
render: function (){
var html = $.tmpl("loginPageTemplate");
var view = $(this.el).html(html);
$(this.par... |
/*作用域
* --作用域指一个变量的作用范围
*
*/
//JS中有两种作用域
//1.全局作用域
// -直接编写在script标签中的JS代码,都在全局作用域
// -全局作用域在页面打开时创建,在页面关闭时销毁
// -在全局作用域中有一个全局对象window,我们可以直接使用
// -window对象代表一个浏览器的窗口,它由浏览器创建,我们可以直接使用
// -在全局作用域中,
// 创建的变量都会作为window的属性保存
// 创建的函数都会作为window对象的方法保存
// -全... |
import Typewriter from 'typewriter-effect';
const NameTypewriter = () => {
return (
<div className="typewriter-div">
<Typewriter
id="name-typewriter"
onInit={(tw) => {
tw.start().changeDelay(100).typeString("Hello, I'm Carlos Santiago");
}}
/>
</div>
);
};
exp... |
const { round } = require('./common');
const {
makeIn,
makeOut,
makeBoth,
} = require('./ease');
describe('ease', () => {
describe('makeIn', () => {
it('should make quadratic function', () => {
const easeFn = makeIn(2);
expect(easeFn(0)).toEqual(0);
expect(round(easeFn(0.1), -10)).toEqual(0.01);
expe... |
'use strict';
var gulp = require('gulp');
var replace = require('gulp-replace');
var packageJson = require('./package.json');
gulp.task('update-version', function(){
gulp.src(['Cargo.toml'])
.pipe(replace(/version = ".*"/, `version = "${packageJson.version}"`))
.pipe(replace(/FileVersion = ".*"/, `FileVers... |
console.log('My Hello World from Node.js'); |
/** @format */
const mongoose = require('mongoose');
const CommentsSchema = mongoose.Schema({
text: { type: String, required: true },
userName: { type: String, required: true },
userId: { type: String, required: true },
carId: { type: String, required: true },
});
module.exports = mongoose.model('Comments', Comm... |
var control = false;
var intervalId = 0;
var deneme = false;
var deneme2 = false;
function baslat() {
if (deneme == false && deneme2 == false) {
var counter = 0;
var saniye = 0;
var dakika = 0;
var saat = 0;
deneme = true;
deneme2 = true;
funct... |
var http = require("http");
var fs = require("fs");
var path = require("path");
// cron-style scheduling
var schedule = require("node-schedule");
var URL =
"http://www2.ville.montreal.qc.ca/services_citoyens/pdf_transfert/L29_PATINOIRE.xml";
var scheduler = function() {
schedule.scheduleJob("03 * * * *", function... |
export default 'exports from script-via-import.js'
|
const tanah = document.querySelectorAll('.tanah');
const tikus = document.querySelectorAll('.tikus');
const start = document.querySelector('.start');
const span = document.querySelector('span');
let tanahSebelumnya;
let selesai;
let nilai;
start.addEventListener('click', function () {
selesai = false;
nilai = ... |
import React from 'react';
import { ConfigProvider } from 'antd';
import * as Sentry from '@sentry/react';
import dayjs from 'dayjs';
import intl from 'react-intl-universal';
import zh_CN from 'antd/lib/locale-provider/zh_CN';
import en_US from 'antd/lib/locale-provider/en_US';
import { Provider } from 'react-redux';
i... |
import React from 'react';
import Header from './components/Header';
import Home from '../Home/Home';
import Footer from './components/Footer'
export class Layout extends React.Component {
render() {
return (
<div>
<Header></Header>
<section className="">
<Home></Home>
... |
import React from 'react';
// Given two integer arrays a, b, both of length >= 1, create a program that returns true if the sum of the squares of each element in a is strictly greater than the sum of the cubes of each element in b.
const CodewarsTask05 = () => {
function arrayMadness(a, b) {
if (
... |
import React, {AppRegistry, Navigator} from 'react-native';
import Root from './views/Root';
import Routes from './Routes';
import DataFetcher from './shit/DataFetcher';
const stuff = React.createClass({
componentWillMount: function() {
DataFetcher.fetch();
},
render: function() {
return (
<Naviga... |
import React, { PureComponent } from 'react';
import './ordercard.css'
class Ordercaed extends PureComponent {
state = { }
render() {
const {bgp,bgptext,url}=this.props;
const{ handleonclick}=this.props;
return (
<div className="order-icon" onClick={()=>{handleonclick(url)}... |
import React from 'react'
import ProjectItem from './ProjectItem';
class Projects extends React.Component {
state = {
projects: []
}
componentDidMount() {
fetch("http://localhost:8080/api/v1/projects")
.then(rsp => rsp.json())
.then(data => {
this.s... |
function bigNum(arr){
for(var index=0; index < arr.length; index++) {
if(arr[index] > 0){
arr[index] = 'big'
}
}
return arr
}
function printLowReturnHigh(arr) {
var high = arr[0];
var low = arr[0];
for(var index=0; index<arr.length; index++){
if(arr[index] >... |
import { argTypes, createMilestones } from './milestones';
import data from './assets/milestones.json';
export default {
title: 'd3-milestones',
argTypes,
};
const Template = (args) =>
createMilestones(
'Version Milestones',
`The chart is responsive, try resizing the browser window. Use the storybook's ... |
import React from "react";
import $ from 'jquery';
import List from "./List";
import Search from "./Search";
import User from "./User";
export default class Page extends React.Component{
constructor() {
super();
this.state = {
data: {
'total_count': '',
'items':[]
},
user:{
'avatar_url': ... |
import React from "react";
import Layout from "../components/Layout";
const Home = () => {
return (
<Layout>
<img src="/logo.png" alt="logo-javascript-py" className="image" />
<h1>🚀 Despega Tu Desarrollo En React Con Next.js</h1>
<img
className="shield"
src="https://img.shield... |
/*
* Copyright (c) 2015 Colin Eberhardt
* Licensed under the MIT license.
*/
'use strict';
var path = require('path');
var async = require('async');
var spellFile = require('markdown-spellcheck').spellFile;
var spellcheck = require('markdown-spellcheck').spellcheck;
var generateSummaryReport = require('markdown-sp... |
import React, { Component } from 'react';
// import './styles.css';
import { connect } from 'react-redux';
import {
domainWords,
addDomainWord,
editDomainWord,
deleteDomainWord,
searchDomainWord,
searchDomainWordTag,
domainCategory,
searchFirstChar,
viewWord
} from '../../Func/actions/Domain';
imp... |
import {fromJS, List, Map} from 'immutable'
// local libs
import {plainProvedGet as g, provedHandleActions} from 'src/App/helpers'
import {model} from 'src/App/Home/models'
import actions from 'src/App/Home/actions'
export default
provedHandleActions(model, {
[g(actions, 'loadPageRequest')]: (state, {payl... |
"use strict";
var emptySpot = 16;
function init() {
var puzzlearea = document.getElementById("puzzlearea");
var boxes = puzzlearea.children;
var i = 0;
for (; i < boxes.length; i++) {
boxes.item(i).className = "box";
boxes.item(i).id = "pos" + (i + 1);
boxes.item(i).style.backgr... |
import Router from './router';
export default function() {
var r = new Router();
Backbone.history.start();
}
|
import React from 'react';
import cropA from '../images/cropB.svg';
import TextTranslator from '../components/TextTranslator';
function Story() {
return (
<div >
<div className="margin-top">
<section className="ui centered stackable grid">
<div className="row">
<div className=... |
System.register(["react", "react-dom"], function (exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var react_1, react_dom_1;
return {
setters: [
function (react_1_1) {
react_1 = react_1_1;
},
function (react_d... |
import fetchMock from 'fetch-mock';
import xhrMock from 'xhr-mock';
import apiUrls from 'constants/api-urls';
import {prepareUrl} from 'AppUtils/url-functions';
import {getAllMedia, getMedia, getShowMedia, uploadMedia, deleteEpisode, uploadProgress} from './episode.service';
const dummyEpisode = {
uid: 0,
name: '... |
/*
Parity bits are used as a very simple checksum to ensure that binary data isn't corrupted during transit. Here's how they work:
If a binary string has an odd number of 1's, the parity bit is a 1.
If a binary string has an even number of 1's, the parity bit is a 0.
The parity bit is appended to the end of the binary... |
const fs = require('fs');
const Express = require('express');
const app = Express();
app.use('/d3', Express.static(__dirname + '/d3'));
app.set('view engine', 'ejs');
app.set('views', './views')
app.get('/', (req, res) => {
res.render('index');
});
app.get('/FTSE.csv', (req, res) => {
fs.readFile('./vi... |
const animals = ['hippo', 'tiger', 'lion', 'seal', 'cheetah', 'monkey', 'salamander', 'elephant'];
const foundAnimal = animals.findIndex(animal => {
return animal === 'elephant'; // this looks for the word "elephant" in the array.
})
console.log(foundAnimal) // this displays "7" because the word "elephant" is the i... |
define('app/exts/fixedtool/fixedtool', [
'jquery',
'underscore',
'brix/base',
'css!app/exts/fixedtool/fixedtool.css'
], function ($, _, Brick) {
var timer = 0
return Brick.extend({
render: function() {
var me = this
setTimeout(function() {
me.adjust()
}, 100)
},
adjust... |
import store from '../store.js';
import AppConstants from '../constants/AppConstants';
const add = (type, content, duration = 3000) => {
const _id = Date.now();
const toast = { _id, type, content };
store.dispatch({
type : AppConstants.APP_TOAST_ADD,
toast,
});
setTimeout(() =>... |
import { Button, Typography } from '@material-ui/core';
import Box from '@material-ui/core/Box';
import Accordion from '@material-ui/core/Accordion';
import AccordionSummary from '@material-ui/core/AccordionSummary'
import AccordionDetails from '@material-ui/core/AccordionDetails'
import Grid from '@material-ui/core/Gr... |
import { promisic } from "../../miniprogram_npm/lin-ui/utils/util"
import { AuthorizedStatus } from "../../core/enum"
import { Address } from "../../model/address"
// components/adderss/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
lifetimes:{
attached(){
const address = Address.ge... |
var redis_util = require('../');
var cluster = [{port: 6379}];
exports.sync_queue = function (test) {
test.expect(3);
var client = new redis_util.RedisQueue('sync_queue', cluster);
var worker = new redis_util.RedisQueue('sync_queue', cluster);
var on_error = function (message) {
console.log(mes... |
class Paper{
constructor(x,y){
var options={
isStatic:false,
restitution:0.3,
friction:0.5,
density:0.09
}
this.body=Bodies.circle(x,y,70,options);
this.radius=70;
World.add(world,this.body);
this.image=loadImage("sprites/paper.png");
}
d... |
//$ = global.$ = require('jquery');
import $ from 'jquery';
import './style/base.scss';
import './style/theme/default.scss';
import main from './script/main.js';
$(function(){
main.init($);
console.log("bootstrap");
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.