text stringlengths 7 3.69M |
|---|
// ** React Imports
import { Link } from "react-router-dom"
import Swal from "sweetalert2"
import withReactContent from "sweetalert2-react-content"
import { getSSmallImageUser } from "@utils"
const MySwal = withReactContent(Swal)
// ** Custom Components
import Avatar from "@components/avatar"
// ** Store & Actions
i... |
import React, { useState } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux';
import { Tooltip } from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faInfoCircle, faTrash } from '@fortawesome/free-solid-svg-icons';
import { Modal, ModalHeade... |
var graph = {};
var utils = require('./utils');
var moment = require('moment');
var fs = require('fs');
var login = require('./login');
function checkSaveFile() {
if (graph.saveFile && graph.filename) {
console.log("Saving: %s", graph.fileName);
fs.writeFile(graph.fileName, JSON.stringify(graph), fu... |
function Pizza (size) {
this.size = size;
this.toppings = [];
this.totalPrice = 0;
};
Pizza.prototype.sizePrice = function () {
if (this.size === "small" ) {
this.totalPrice += 10
} else if (this.size === "medium") {
this.totalPrice += 15
} else {
this.totalPrice += 20
}
return this.totalPr... |
import React, { useState, useRef, useEffect } from 'react'
import TitleBar from './titleBar'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faBars, faSearch, faArrowLeft } from '@fortawesome/free-solid-svg-icons'
import styles from './appStatus.module.scss';
import Profile from '../../../shar... |
import React, { useState, useEffect } from 'react'
import '../../../style/CW_items.scss'
import '../../../style/Search.css'
import { Button } from 'react-bootstrap'
import { MdAddCircle, MdModeEdit, MdDelete } from 'react-icons/md'
import PaginacionTabla from '../PaginacionTabla'
import Container from 'react-bootstrap/... |
const srcPath = `${process.cwd()}/src`
const compPath = `${srcPath}/components`
const libPath = `${srcPath}/lib`
const { SITE_URL } = require('./gatsby/env')
module.exports = {
manifest: {
name: 'gatsby-starter-default',
short_name: 'starter',
lang: 'en',
description: 'A new gatsby site.',
start... |
const mail = require('@sendgrid/mail');
const pug = require('pug');
const path = require('path');
const config = require('config');
mail.setApiKey(config.SENDGRID_KEY);
/**
* Email poxy
*/
const emailService = {
send: async (to, subject, template, data, from = config.DEFAULT_INFO_EMAIL) => {
const jsonPath ... |
import React from 'react';
import styled from 'styled-components';
import palette from './../../lib/styles/palette';
const StyledButton = styled.button`
color:white;
background: ${palette.gray[8]};
&:hover {
background: ${palette.gray[6]};
}
`
const Button = (props) => {
return (
<S... |
const THREE = jest.genMockFromModule('three');
const fakeLoader = () => ({
load: jest.fn((asset, success) => {
setTimeout(success);
}),
});
THREE.TextureLoader = jest.fn(fakeLoader);
const _Mesh = THREE.Mesh;
THREE.Mesh = jest.fn(() => {
const mesh = new _Mesh();
mesh.rotation = { x: 0, y: 0, z: 0 };
re... |
$(document).ready(function(){
$('#primero').mouseover(function(){
$('#btn-primero').fadeIn();
})
$('#segundo').mouseover(function(){
$('#btn-segundo').fadeIn();
})
$('#segundo').mouseover(function(){
$('#btn-tercero').fadeIn();
})
$('#p... |
/**
* Created by hui.sun on 15/12/13.
*/
/**
* 4pl Grid thead配置
* check:true //使用checkbox 注(选中后对象中增加pl4GridCheckbox.checked:true)
* checkAll:true //使用全选功能
* field:’id’ //字段名(用于绑定)
* name:’序号’ //表头标题名
* link:{
* url:’/aaa/{id}’ //a标签跳转 {id}为参数 (与click只存在一个)
* click:’test’ //点击事件方法 参数test(index(当前索引)... |
exports.up = function(knex) {
return knex.schema.createTable('users', t => {
knex.raw('CREATE EXTENSION IF NOT EXISTS "uuid-ossp"')
t.uuid('id').primary().defaultTo(knex.raw('uuid_generate_v4()'))
t.string('sessionId')
t.string('roomCode')
t.timestamps(true, true);
})
};... |
import React from 'react'
import Header from './components/Header'
import Forecast from './components/Forecast'
import Places from './components/Places'
import Locations from './components/Locations'
import Weather from './components/Weather'
const App = () => {
return (
<div className="relative">
<Weathe... |
const { io } = require("../../source/node");
const {
handlers: { empty }
} = require("../../source");
const { run, runCapturing, runMain } = require("../utils");
function* main() {
yield io.writeLine("Hello, world");
}
runMain(async function() {
console.log("\n== Default IO");
await run(empty, main);
conso... |
define(['apps/system3/business/business'], function (app) {
app.module.directive('engineeringFilterView', function () {
return {
restrict: 'E',
templateUrl: 'apps/system3/business/engineering/view/engineering-filter.html',
link: function ($scope, element, $... |
function customersCtrl($scope, $uibModal, $rootScope, $compile, $state, customerService) {
$scope.customers = {};
$scope.customer = {};
$scope.submitted = null;
$scope.customerContent = {};
$scope.selectedcustomerGroupType = null;
$scope.selectedcustomerCountry = null;
init();
functio... |
import React from 'react'; // eslint-disable-line no-unused-vars
import classnames from 'classnames';
import { Fragment } from '@wordpress/element';
export const ButtonEditor = ({ blockClass, button }) => {
const {
title,
styleSize,
styleColor,
styleSizeWidth,
} = button;
const componentClass = ... |
/**
* Created by Liuchenling on 11/9/14.
*/
var cyxwMain = require('../cyxwNewsList/index').main;
var xwxxMain = require('../xwxxNewsList/index').main;
var version = '14.11.9';
var infoHash = {
'200': 'Success',
'-1': 'Inner Error',
'-10': 'Server Return Invaild Data',
'-20': 'Invaild param: page'
};... |
const fs=require('fs')
const path=require('path')
fs.writeFile(path.join(__dirname,'/ReadAndWriteFile/WriteMsg.txt'), "Hello, Parth! \r\nMy first write to file.", function(error){
if(error) return console.error(error)
console.log('Writing is Done!')
}) |
import React, { PropTypes } from 'react';
import ReactDOM from 'react-dom';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import {Button, Form, Row, Col, Icon} from 'antd';
import Control, {getTitle, makeString} from '../Control';
import s from './Search.less';
const FormItem = Form.Item;
const defa... |
const axios = require('axios')
const getAllCharacters = async () => {
const allCharacters = await axios.get('https://rickandmortyapi.com/api/character')
return allCharacters.data.results
}
const getByName = async (name) => {
const byName = await axios.get(`https://rickandmortyapi.com/api/character/?name=$... |
import React from 'react';
import logo from './logo.svg';
import './App.css';
import Encabezado from './Encabezado'
import AppCirculo from './AppCirculo'
import { render } from '@testing-library/react';
function App() {
return (
<div className="App">
<Encabezado >
</Encabezado>
</div>
);... |
import { SudokuSolver } from '@jlguenego/sudoku-generator';
onmessage = function(e) {
const solution = SudokuSolver.generate();
const masked = SudokuSolver.carve(solution, e.data);
postMessage({
solution: solution,
masked: masked
});
};
|
import * as types from './mutation-type'
import ArticleModal from '../../model/Article'
import api from '../../api/article'
// 获取文章列表
export const getArticleList = ({ commit, state, dispatch }) => {
return api.getArticleList().then((res) => {
commit(types.GET_ARTICLE_LIST, res)
})
}
// 获取指定文章内容
export const s... |
//gets the product id from the URL
function getProductIdFromURL() {
let url = new URL(window.location.href);
let search_param = new URLSearchParams(url.search);
if (search_param.has("id")) {
let foundId = search_param.get("id");
return foundId;
}
}
//dynamicly enters the produ... |
const Joi = require('joi');
module.exports = {
register (req, res, next) {
const schema = {
email: Joi.string().email().required(),
password: Joi.string().regex(/^[a-zA-Z0-9]{6,32}$/)
}
const { error, value } = Joi.validate(req.body, schema);
if (error) {
... |
/**
* Tasks: Compile Scripts
*
* Bundles JS
* Transpiles es6 to es2015
* Writes sourcemaps
*/
// Dependencies
const rollup = require('rollup')
const typescript = require('@rollup/plugin-typescript')
module.exports = (gulp, paths, environment) => async () => {
const bundle = await rollup.rollup({
input: `${paths.... |
var dir_8875bc8a0030e444cd192d3444b9956a =
[
[ "lang", "dir_b1a00269cd8589e42b04bebf033d0abb.html", "dir_b1a00269cd8589e42b04bebf033d0abb" ]
]; |
import React from 'react';
import {observable, computed, autorun, decorate, when} from 'mobx';
import { render } from 'react-dom';
import {observer, inject} from 'mobx-react';
import Brick from '../../business/Brick';
import {PIXELS_UNIT} from '../../business/Position';
import './CBrick.css';
@observer
class CBrick ex... |
import React, { Component } from "react";
import "../../assets/css/common.css";
import M from "materialize-css";
class Dropdown extends Component {
constructor(props) {
super(props);
this.state = {
selectClass: ""
};
}
componentDidMount() {
M.AutoInit();
}
componentWillMount() {
th... |
angular.module('starter.controllers', ['ionic'])
.controller('DashCtrl', function ($scope, $cordovaGeolocation) {
var posOptions = {timeout: 10000, enableHighAccuracy: false};
$cordovaGeolocation
.getCurrentPosition(posOptions)
.then(function (position) {
var lat = position.coords.latitude
... |
var etw = require(__dirname + '/build/Release/etw');
var util = require('util');
var methods = [ 'debug', 'log', 'info', 'warn', 'warning', 'error' ];
methods.forEach(function(method) {
exports[method] = function() {
var str = util.format.apply(null, arguments);
return etw[method](str);
};
}); |
const mongoose = require('mongoose');
exports.clientPromise = mongoose.connect('mongodb+srv://camille:DS6QDGANnpKJOFwH@cluster0.gvcwc.mongodb.net/chat?retryWrites=true&w=majority', {
useCreateIndex: true,
useNewUrlParser: true,
useUnifiedTopology: true,
})
.then(() => console.log('connexion db ok!'))
.catch( err... |
var express = require('express');
var Category = require('../models/category');
var router = express.Router();
router.post('/', function (req, res) {
var category = new Category({
typeId: req.body.typeId,
typeName: req.body.typeName,
myImage: req.body.myImage,
seller: req.body.selle... |
{
"attendees": ["John", "Michael", "Colin"],
"meetingLength": 30,
"possibleTimeSlots": 10,
"timeFrame": {
"start": "2015-06-22T08:00+02:00",
"end": "2015-06-26T16:00+02:00"
}
} |
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import WelcomeScreen from './Screens/Welcome';
import {createAppContainer,createSwitchNavigator} from 'react-navigation';
import { StudentNavigator } from './components/StudentNavigator';
impor... |
import React from 'react';
import { shallow } from 'enzyme';
import 'jest-enzyme';
import CheckBox from './CheckBox';
describe('CkeckBox', () => {
function setup() {
const props = {
name: "isPrivate", label: "some",
onSave: () => {},
onChange: () => {}
};
... |
import React from 'react';
import {Button, View, StyleSheet} from 'react-native';
import ContactsList from '../ContactsList';
import {Constants} from "expo"
import {connect} from 'react-redux'
class ContactListScreen extends React.Component {
static navigationOptions = ({navigation}) => ({
headerTitle: 'Co... |
import React from 'react';
import { Route, Redirect } from 'react-router-dom';
import { useAppContext } from '../AppContext';
function ProtectedRoute({ children, ...rest }) {
const { user } = useAppContext();
return (
<Route {...rest} render={({ location }) => {
return user
? children
: ... |
/*
* 文件名稱 :AppcategryLang.js
* 文件功能描述 :分類表管理語言包
* 版權宣告 :
* 開發人員 : 白明威
* 版本資訊 : 1.0
* 日期 : 2015.8.27
* 修改人員 :
* 版本資訊 :
* 日期 :
* 修改備註 :
*/
IMPORT_EXCEL = "匯入Excel";
PLEASE_IMPORT_EXCEL = "請匯入檔案";
IMPORT_TYPE_ERROR = "上傳文件類型不正確";
IMPORT_AFFIRM = "確定匯入";
IMPORT_RESULT_TRUE_MESSAGE = "成功匯入{0}條數據";
IMPORT_RESULT_TRUE_E... |
define(["knockout", "components"], function(ko, c) {
function Viewmodel(params) {
var self = this;
this.currentUser = params.currentUser || ko.observable();
this.ready = ko.observable(false);
this.message = params.message || ko.observable();
this.logout = function () { c.feathers.logout(); ... |
Array.prototype.peek = function() {
return this[this.length - 1];
};
const fish = (a, b) => {
const swimmers = [];
const threats = [];
while(a.length > 0 && b.length > 0) {
swimmers.push([a.pop(), b.pop()]);
};
let survivors = 0;
while(swimmers.length > 0) {
let s = swimmers.pop();
if(s[1] =... |
angular.module('virtoCommerce.catalogModule')
.controller('virtoCommerce.catalogModule.actionListController', [
'$scope',
'platformWebApp.bladeNavigationService',
'virtoCommerce.catalogModule.catalogBulkActionService',
'virtoCommerce.catalogBulkActionsModule.webApi',
function... |
export const positions = [{
id: 1,
name: "Менеджер"
},
{
id: 2,
name: "Пилот"
},
{
id: 3,
name: "Программист"
},
{
id: 4,
name: "Генеральный директор"
},
{
id: 5,
name: "Аналитик"
}
]
export const gender... |
const mongoose = require('mongoose')
const dotenv = require('dotenv');
dotenv.config()
const connectDB = () => {
mongoose.connect(process.env.mongoURI, {useNewUrlParser: true, useUnifiedTopology: true, useFindAndModify: false, })
.then(() => {console.log('MongoDB Connected')})
.catch(err => {console.log(err.me... |
const webpack = require('webpack')
const proxy = require('./proxy')
const historyFallback = require('./historyfallback')
module.exports = {
// devtool: 'eval', // js 调试 速度非常快
// devtool: 'source-map', // js 调试 线上
devtool: 'cheap-module-source-map', // js 调试 开发可选择 有点损耗开发性能(刚开始比较慢)
devServer: {
// inline: f... |
'use strict';
if (module.hot) {
module.hot.accept();
}
import 'babel-polyfill';
import '../styles/index.scss';
import '../images/index';
import 'jquery/dist/jquery';
import './backgrounds';
import './crossfade';
import './parallax';
import './scripts';
|
// Add your doToElementsInArray() function here:
function doToElementsInArray(array,callback){
array.forEach(callback);
};
// Add your changeCompletely() function here:
function changeCompletely(element, index, array){
array[index] = 'and now ${array[index]}';
}
|
// Den här filen behöver du inte bry dig om.
// Men tjuvkika gärna!
import { chooseParticleColor, bang } from '../confetti.js'
const addConfettiParticles = ({ groupName, particleAmount, xPosition, yPosition, xVelocity, yVelocity, xSpread, ySpread }) => {
let i = 0
while (i < particleAmount) {
const r = _.rand... |
var db = require('../../../config/db.config');
const Candidatebio = db.candidate_bio;
let profile_pic_name;
let videopath;
let idcard;
let resume;
let otherimg1;
let otherimg2;
let fieldname;
exports.create = (req, res) => {
if (!req.body.user_id) {
res.json({
success: false,
mess... |
var navtreeindex3____8js__8js_8js =
[
[ "navtreeindex3__8js_8js", "navtreeindex3____8js__8js_8js.html#a5efe11aa4694798cbf0398391b865fee", null ]
]; |
const { Nuxt } = require('nuxt')
const express = require('express')
const app = express()
const isProd = process.env.NODE_ENV === 'production'
// 用指定的配置对象实例化 Nuxt.js
const config = require('../nuxt.config.js')
config.dev = !isProd
const nuxt = new Nuxt(config)
app.use(express.static('../static'))
app.use('/api', req... |
import React from 'react';
import { Link, hashHistory } from 'react-router';
class SessionForm extends React.Component {
constructor(props) {
super(props);
this.state = {
username: "",
password: "",
userErrors: "",
passErrors: "",
credsErrors: ""
};
this.handl... |
import { createSelector } from "reselect";
const selectCart = state => state.cart;
export const selectCartItem = createSelector(
[selectCart],
cart => cart.cartItems
);
export const selectCartItemQuantity = createSelector(
[selectCartItem],
cartItems =>
cartItems.map(item => item.quantity).reduce((acc, c... |
var PenSigner_callback;
function Use_PenSigner(callback) {//打开手写板
PenSigner_callback = callback;
window.external.pensigner_use("Use_PenSigner_callback");
}
function Use_PenSigner_callback(receivedData) {
PenSigner_callback(receivedData);
}
//清空手写板内容
function Clean_PenSigner() {
wind... |
let select=document.getElementById('ul')
let selectBox=document.getElementById('btn')
selectBox.addEventListener('click',function(e){
let tag=select.lastElementChild.cloneNode()
tag.innerHTML='New Item'
select.appendChild(tag)
})
//--------Event Delegation Problem--------------
// let selectChildren=docum... |
var request = require('request');
const { database } = require('./database')
//Create App Service Plan
async function appServicePlanAPI(data,token){
return new Promise((resolve,reject)=>{
try{
var options = {
'method': 'PUT',
'url': `https://management.azure.com/... |
$(document).ready(function() {
var communityId = document.getElementById("communityId").value;
var type_id = document.getElementById("type_id").value;
var path_t = document.getElementById("path_t").value;
var u = navigator.userAgent,
isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1, //android终端或... |
'use strict';
function leftJoin(left, right) {
let result = [];
// console.log(left.map.length);
for (let i = 0; i < left.map.length; i++) {
let current = [];
if(left.map[i]){
if (right.contains(left.map[i].head.value.key)) {
// console.log(left.map[i].he... |
module.exports = function(sequelize, DataTypes) {
var Candidate = sequelize.define("Candidate", {
first_name: DataTypes.STRING,
last_name: DataTypes.STRING,
current_position: DataTypes.STRING,
party_name: DataTypes.STRING,
state_name: DataTypes.STRING,
curr_status: Da... |
import {
CognitoUserPool,
AuthenticationDetails,
CognitoUser
} from "amazon-cognito-identity-js"
import ApiBase from './ApiBase'
import appConfig from "./ApiConfig"
import Actions from '../flux/Actions'
class AuthenticationApi extends ApiBase {
getAppToken() {
return super.getAppToken();
}
login(username, pas... |
import firebase from 'firebase/app';
// import firebase from 'firebase';
import 'firebase/firestore';
import 'firebase/database';
import 'firebase/auth';
firebase.initializeApp({
apiKey: "AIzaSyCLA_dSSlsWUmaV6w7nJil8RiwdM2AD5uQ",
authDomain: "laborum-scl011.firebaseapp.com",
databaseURL: "https://laborum-... |
(function() {
'use strict';
angular
.module('webHipsterApp')
.config(stateConfig);
stateConfig.$inject = ['$stateProvider'];
function stateConfig($stateProvider) {
$stateProvider
.state('livro', {
parent: 'entity',
url: '/livro',
dat... |
module.exports = function (cacheSvr, keyGen) {
if (typeof keyGen !== 'function') {
keyGen = function (ctx) {
return ctx._matchedRouteName || 'yuumi';
}
}
return async function (ctx, next) {
let key = keyGen(ctx);
let val = await cacheSvr.get(key);
if (va... |
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
const http = require('http').Server(app)
const io = require('socket.io')(http)
const routes = require('./routes')
app.use(bodyParser.json())
app.get('/', function(req, res){
res.sendFile(process.cwd() + '/index.ht... |
'use strict';
let numberA = 4;
console.log(++numberA);
let weather = 'sunny';
if (weather === 'sunny') {
console.log('don\'t forget your sunglasses');
let skin = 'dark';
if (skin === 'light') {
console.log('do forget your sun blocker');
}
else {
console.log('Enjoy');
}
}
else {
console.log('stay at... |
var world =[
[2,2,2,2,2,2,2,2,2,2],
[2,1,1,2,1,1,1,1,1,2],
[2,1,1,2,1,2,2,2,1,2],
[2,1,1,2,1,2,1,2,1,2],
[2,1,1,2,1,2,1,2,1,2],
[2,1,1,2,2,2,1,2,1,2],
[2,1,1,1,1,1,1,2,1,2],
[2,1,1,1,1,1,1,1,1,2],
[2,2,2,2,2,2,2,2,2,2]
];
function displayWorld(){
var output="";
for(var i=0; ... |
const uuidv4 = require("uuid/v4");
const Job = require("../downloader/Job");
class Client {
constructor(ipc, args={
onCancel: () => {},
onTimeout: () => {},
onError: () => {},
}) {
this.ipc = ipc;
this.control = args;
}
/**
* List of all the feeds that we ... |
/*global PIFRAMES */
/* Written by ?? and Cliff Shaffer */
$(document).ready(function() {
"use strict";
var av_name = "RegEx2NFA1FS";
var av = new JSAV(av_name);
var Frames = PIFRAMES.init(av_name);
// Frame 1
av.umsg("<b>Part 1.</b> Recall that we define the term :term:`regular language` to mean the langu... |
/*jslint nomen: true, debug: true, evil: true, vars: true, browser: true,
devel: true */
/*global Backbone: true, _: true, $: true, FileReader: true */
var Afiliado = Backbone.Model.extend({
urlRoot: '/dashboard/afiliado/',
defaults: {
avatar: null,
name: "",
address: "",
phon... |
import React, { Component } from 'react'
import { Text, View, Image, StyleSheet, Dimensions } from 'react-native'
import { Progressline, Spinner } from '../../Common/'
import { Button } from 'native-base'
import { connect } from 'react-redux'
import { DeleteCart, getTotalAmount } from '../../Actions'
import { Actions }... |
$(document).ready(function () {
var modal = $('.modal'),
modalBtn = $('[data-toggle=modal]'),
closeBtn = $('.modal__close'),
modalThanks = $('.modal-thanks');
// Для модального окна
modalBtn.on('click', function () {
modal.addClass('modal--visible');
});
closeBtn.on('click', function () {
... |
const fs = require('fs')
const stdin = (process.platform === 'linux'
? fs.readFileSync('/dev/stdin').toString()
: `100`
)
const number = parseInt(stdin, 10)
function printScoreToGrades(number) {
let grades = "";
if (number >= 90) {
grades = "A";
} else if (number >= 80) {
g... |
"use strict";
/** @module DemoApp/DependEvent */
/**
* @class
* @classdesc an application demo with an event dependency
* @implements {EquivalentJS.Manager.Module.class}
* @typedef {Object} DemoApp.DependEvent
* @constructs
*/
DIC.define('DemoApp.DependEvent', new function () {
/**
* @description bind ... |
import React, { Component } from 'react';
import {
StyleSheet,
View,
Text,
ScrollView,
Dimensions,
StatusBar,
TextInput,
TouchableOpacity,
Image,
} from 'react-native';
var { height, width } = Dimensions.get('window');
const BACKICON = require('../img/btn_titel_back.png');
import Pub... |
import React from "react";
const NoMatch = () => {
return(
<div className="container">
<h1>Error: 404</h1>
<p>Page not found</p>
</div>
)
}
export default NoMatch; |
let tape = [];
let ptr = 0;
let buffer = [];
let bitsize, halfsize;
function decodeDSP(samples, fileSampleRate, lowtone, highttone, debug)
{
let samplerate = fileSampleRate;
const DOWNSAMPLE = false;
if(DOWNSAMPLE)
{
samplerate = highttone * 4;
console.log(`donwsampling from ${fileSampleRat... |
import React from 'react'
import PropTypes from 'prop-types'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import LoginScope from '../components/LoginScope'
import * as TodoActions from '../actions'
const Login = ({userInfo,actions,naviMetaData,location}) => (
<div>
<LoginScop... |
// Given a roman numeral, convert it to an integer.
//
// Input is guaranteed to be within the range from 1 to 3999.
/**
* @param {string} s
* @return {number}
*/
var romanToInt = function (s) {
if (s === null) return 0;
var romanTable = {
'I': 1,
'V': 5,
'X': 10,
'L': 50,
'C': 100,
'D':... |
import logo from "../../../assets/logo.svg";
import "./style.less";
export default function Logo() {
return (
<div className="logo-container">
<img src={logo} alt="My Admin" />
<span>My Admin</span>
</div>
);
}
|
import React, { Component } from 'react';
import {
ScrollView,
StyleSheet,
RefreshControl,
TouchableWithoutFeedback,
RecyclerViewBackedScrollView,
ListViewDataSource,
Text,
ListView,
View,
Picker
} from 'react-native';
import Loader from './Loader.js'
var movieReviewsFromAp... |
const successHandler = (res, status, message, Data) => {
return res.status(200).send({ status, message, Data })
}
module.exports = successHandler |
import Subnav from './Subnav/Subnav.js';
import TableView from './TableView/TableView.js';
import AddNew from './AddNew/AddNew.js';
import CardView from './CardView/CardView.js';
import RelateAPI from './RelateAPI/RelateAPI.js';
import Statistics from './Statistics/Statistics.js';
import IntentEditor from './IntentEdit... |
define([
'jquery',
'underscore',
'backbone',
'utils/domUtils',
'app/settings',
'app/globals',
'backbones/views/userHomeSections/userSettingsView',
'backbones/views/userHomeSections/accountSettingsView',
'text!templates/homeUser/homeUser... |
/*
* spa.shell.js
* Shell module for SPA
*/
/* jslint settings browser : true, continue : true,
devel : true, indent : 2, maxerr : 50,
newcap : true, nomen : true, plusplus : true,
regexp : true, sloppy : true, vars : true,
white : true
*/
/* global $, spa */
spa.shell = (function(){
/... |
define([
'jquery',
'./modules/cartStorage',
'./modules/checklogin',
'./modules/celan'
], function ($, { setCartStorage, getCartStorage },{checklogin},{hungBarMove}) {
checklogin()
let $cart = $('#cart')
let $cart_list = $cart.find('.cart_list')
let $cart_title_selectAll = $cart.find('.ca... |
import React from 'react'
import { Form, Icon, Input, Button,message } from 'antd';
import axios from 'axios'
const FormItem = Form.Item;
class NormalLoginForm extends React.Component {
constructor(props) {
super(props)
this.handleSubmit = this.handleSubmit.bind(this)
this.closeModal = thi... |
import React from "react";
import "../tailwind.css";
const Button = (props) => {
return (
<div className="border border-gray-400 rounded p-4 mx-2 my-6">
<span className="block text-2xl font-semibold text-black">
Hello Button
</span>
</div>
);
};
export default Button;
|
//soal 1
var angkaawal=2;
var angkaakhir=20;
console.log("LOOPING PERTAMA");
while(angkaawal<=20){
console.log(angkaawal+" - I love coding");
angkaawal+=2;
}
console.log("LOOPING KEDUA");
while(angkaakhir>=2){
console.log(angkaakhir+" - I will become a frontend developer");
angkaakhir-=2;
}
console.log(... |
import LogoSrc from 'Images/logo.svg';
import './Logo.css';
const Logo = (props) => {
return <img className={`Logo ${props.className}`} src={LogoSrc} alt="logo" />;
}
export const LogoSm = (props) => {
return <Logo className="small" />;
}
export default Logo; |
/*
Simplified all sensors example
This example reads all sensors on a sensorTag.
Rather than doing the sensor enable, configure, notify,
and listen functions as each other's callbacks, this example
simplifies the process by calling most of these asynchronously.
This example uses a timed readSensors() function rather
... |
import React from "react";
import { useDispatch, useSelector } from "react-redux";
import { getVidInfo } from "../Actions/DownloadAction";
import AppSearchBar from "../Componets/AppSearchBar";
import Loader from "../Componets/Loader";
import Message from "../Componets/Message";
import { ListGroup, Row, Col, Button, Con... |
const sendData = require("./utils/readerUtils");
exports.handler = async function (event, context) {
const body = JSON.parse(event.body);
const data = await sendData(body.site);
return {
statusCode: 200,
headers: {
"Access-Control-Allow-Origin": "*", // Allow from anywhere
},
body: JSON.str... |
const fs = require('fs');
//https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_revoke-sessions.html
function cleanAwsCredentialsCache({ isWindows }) {
if (!isWindows && fs.existsSync('~/.aws/cli/cache')) {
fs.rmdirSync('~/.aws/cli/cache', { recursive: true });
}
if (isWindows && fs.exist... |
import React from 'react';
import ShallowRenderer from 'react-test-renderer/shallow';
import Tile from './Tile';
test('Tile.jsx', () => {
const renderer = new ShallowRenderer();
const result = renderer.render(<Tile/>);
expect(result).toMatchSnapshot();
}); |
'use strict';
module.exports = function(grunt) {
var fs = require('fs');
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
var path = require('path');
var fs = require('fs');
var _ = require('underscore');
var url = require('url');
var httpProxy = require('http-proxy');
grunt.loadTasks(_... |
import React from 'react';
import AddCustomer from '../../components/AddCustomer';
import { mount, shallow } from 'enzyme';
import renderer from 'react-test-renderer'; // snapshot testing
describe('AddCustomer tests', () => {
// snapshot
test('renders snapshot', () => {
const app = renderer.create(<AddCustomer... |
(function ($) {
var blacklistModule = function (container) {
var self = this,
urlAuth = window.location.origin + "/oauth2/token",
url = window.location.origin + "/api/bot/commands/expressions-blacklist",
$commands = container,
$btnAdd = $commands.querySelecto... |
import { PATHNAME_TEMPLATE } from '../constants';
import { getPathname } from './getPathname';
describe(`${PATHNAME_TEMPLATE} getPathname`, () => {
const imageId = 'a1b2c3d4';
it('should return the right string', () => {
const actual = getPathname(imageId);
expect(actual).toBe(`/v2/websites/image/${imag... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.