text stringlengths 7 3.69M |
|---|
// Code for the right hand side panel
var Panel = ReactBootstrap.Panel;
/*
var RightPanelBody = React.createClass({
render: function() {
// Style the div to 500px height because the canvas otherwise won't
// look like it is inside the panel
return (
<div className="panel-body" style={{height:'500px'}}>
... |
var fs = require('fs');
// npm i mmap-io
var mmap = require('mmap-io');
// open /dev/mem with read write permission
fs.open('/dev/mem', 'r+', function (status, fd) {
if (status) {
console.error(status.message);
return;
}
// physical address
const offset = 0x41200000;
// number of byt... |
$('.rule__btn').on('click', function() {
$('.rule__select').toggleClass('closed');
});
$('.rule__select-item').on('click', function() {
$('.rule__select-item').removeClass('selected');
$(this).addClass('selected');
let newText = $(this).text();
$('.rule__btn span').text(newText);
$('.rule__sele... |
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('contact-input', 'Integration | Component | contact input', {
integration: true
});
test('class name applied', function(assert) {
this.render(hbs`{{contact-input fieldName='foo'}}`);
assert.... |
import { createSlice } from '@reduxjs/toolkit'
import { SERVER_URL } from '../Constants/api';
import dialogContent from '../Constants/dialog';
const initialState = {
user: JSON.parse(localStorage.getItem('user')),
conversations: null,
messages: {},
isLoadingConversation: true,
dialog: {
sho... |
let red = 100;
let green = 100;
let blue = 100;
document.body.style.backgroundColor = `rgb(${red}, ${green}, ${blue})`;
const changeColor = (e) => {
console.log(e.keyCode, e.which) //key down 40, keyup 38
//IF
// if (e.keyCode === 40 && red > 0) {
// red--
// green--
// blue--
... |
/*
David Jensen
SDI Section #3
for Loops
2015/01/26
*/
//alert("Testing to see if the JS file is attached to the HTML.");
//while loops
console.log("--------------------Loops--------------------");
//while loops
var b = 10; //sets up the index
while (b > 0){ ... |
import React from 'react'
const getEntries = obj => Object.entries(obj)
const Section = ({ name, data = {} }) => {
const entries = getEntries(data)
return <section id={name}>
<h2>{name}</h2>
<table>
<tbody>
{entries.map((entry, i) => <tr key={i}>
... |
import React from "react";
import Feeds from "./Feeds";
import Post from "./Post";
const PostFeeds = () => {
return (
<div>
<Post />
<Feeds />
</div>
);
};
export default PostFeeds;
|
import { changeProfile } from './Twiter';
describe('Testing Twitter actions', () => {
it('When no profile should change profile to Trump', () => {
expect(changeProfile()).toEqual({
name: 'Donald Trump',
profile: 'realDonaldTrump',
});
});
it('When Trump should change profile to Hilary', () =>... |
var Utils = function(){};
var utils = {
constructor:Utils,
load:function(){
Object.prototype.isEmpty = this.__isEmpty;
},
__isEmpty:function() {
for(var key in this) {
if(this.hasOwnProperty(key))
return false;
}
return true;
},
}; |
describe('Sample Test:', () => {
it('check game rules', () => {
cy.visit('index.html');
cy.get('.cell[data-cell-index="0"]').click();
cy.get('.cell[data-cell-index="1"]').click();
cy.get('.cell[data-cell-index="3"]').click();
cy.get('.cell[data-cell-index="4"]').click();
cy.get('.cell[data-cel... |
/**
* Created by lys on 2017/2/24.
*/
$(function () {
var fullPages=document.getElementById("fullpage");
var menu=document.getElementById("menu");
$("#menu>li").on("mouseover", function () {
$(this).addClass('animated tada');
})
$("#menu>li").on("mouseout", function () {
$(this).re... |
import coinApi from "../apis/coinApi";
export const fetchCoins = (page) => async dispatch => {
const response = await coinApi.get(`/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=25&page=${page}&sparkline=false`);
dispatch({
type: 'FETCH_COINS',
payload: response.data
});
}... |
import React, { Component } from "react";
import { Row, Col } from "react-bootstrap";
import Logo from "../../components/common/Logo";
// import "./style.css";
//Components
import ResetPass from "../../components/ResetPass/index";
import Footer from "../../components/common/Footer/Footer"
class Reset extends Componen... |
const normalPerson = {
firstName : 'Rahim',
lastName : 'Uddin',
salary : 15000,
getFullName : function(){
console.log(this.firstName,this.lastName);
},
chargeBill: function(amount,tax,tips){
this.salary = this.salary - amount - tips - tax;
return this.salary;
}};
... |
import { useEffect } from 'react';
import { connect } from 'react-redux';
import EditTaskView from './EditTaskView';
import TaskView from './TaskView';
import { loadTasksThunk } from '../actions/taskThunkActions';
const TaskList = ({ tasks, loadData }) => {
useEffect(loadData,[]);
return (
<div class... |
/*
A module that gives that heartbook database
*/
const HeartBookModule = (function () {
//Variabler
let maleProfiles;
let femaleProfiles;
let allPersons;
const profiles = {
personJson: [
{
"firstName": "Arne",
"age": 30,
"sex": "... |
import React from "react";
import { addDecorator, storiesOf } from "@storybook/react";
import { withKnobs, select } from "@storybook/addon-knobs";
import Logo, { logoSizes, assets } from ".";
const stories = storiesOf("01 - Atom/Logo", module);
addDecorator(withKnobs);
stories
.add("Small", () => {
const size... |
import { UPDATE_PAGE } from '../actions/my-app-action.js';
import { ROUTERDEFAULT } from '../components/routes-setting'
const app = (state =
{
page: ROUTERDEFAULT,
params: {}
}, action) => {
switch (action.type) {
case UPDATE_PAGE:
return {
...sta... |
const User = require('../Model/user');
async function checkUser(email) {
try {
let sql = `SELECT * FROM user WHERE email = ? `
const [{ password }] = await User.getUser(sql, email);
return password;
} catch (error) {
throw 'can not get the user';
}
}
async function create... |
import { sm } from '../util'
import Point from './point'
/**
* Place: a Point subclass representing a 'place' that can be rendered on the
* map. A place is a point *other* than a transit stop/station, e.g. a home/work
* location, a point of interest, etc.
*/
export default class Place extends Point {
/**
... |
export default class Game{
constructor(id,name,unitPrice,type){
this.id=id;
this.name=name;
this.unitPrice;
this.type=type;
}
} |
function walk(numSteps, length, speed){
var pathToSchool = numSteps*length;
pathToSchool/=1000;
var time = (pathToSchool/speed);
time=time*3600;
var hours = Math.floor(time/3600);
time = time - hours*3600;
var minutes = Math.floor(time/60);
minutes+=Math.floor(pathToSchool/0.5);
var... |
var myDataRef = new Firebase('https://mrclutch.firebaseio.com/test');
myDataRef.on('child_added', function(snapshot) {
var message = snapshot.val();
displayChatMessage(message.name, message.text);
$('#messagesDiv').fadeTo(1000, 1);
});
function displayChatMessage(name, text) {
... |
'use strict';
// Configuring the Articles module
angular.module('lens').run(['Menus',
function(Menus) {
// Set top bar menu items
Menus.addMenuItem('topbar', 'Lenses', 'lens', 'dropdown', '/lens(/create)?');
Menus.addSubMenuItem('topbar', 'lens', 'List Lenses', 'lens');
Menus.addSubMenuItem('topbar', 'lens', ... |
input.onPinPressed(TouchPin.P1, () => {
basic.setLedColor(Colors.Green)
})
input.onPinPressed(TouchPin.P2, () => {
basic.setLedColor(Colors.Red)
})
input.onPinPressed(TouchPin.P3, () => {
basic.setLedColor(Colors.Yellow)
})
input.onPinPressed(TouchPin.P0, () => {
basic.setLedColor(Colors.Blue)
}) |
var searchData=
[
['keysearch',['KEYSEARCH',['../CNanoVDB_8h.html#a36a572ad0b95a45dc62afe7b53dd63eb',1,'CNanoVDB.h']]],
['keysize',['KEYSIZE',['../CNanoVDB_8h.html#a4b0feb025bc871150dd979b04b527dfd',1,'CNanoVDB.h']]]
];
|
/*
* @lc app=leetcode id=48 lang=javascript
*
* [48] Rotate Image
*/
/**
* @param {number[][]} matrix
* @return {void} Do not return anything, modify matrix in-place instead.
*/
var rotate = function(matrix) {
const n = ~~(matrix.length / 2);
const a = matrix;
let temp;
for (let i = 0; i < n; i++... |
import { Record } from 'immutable';
export default Record({
id: null,
host: null,
organization: null,
repository: null,
repositoryId: null,
branch: null,
active: null,
createdTimestamp: null,
updatedTimestamp: null
});
|
// "Write a function that sorts a list of integers by how far they are to 12,
// and if they are the same distance, by their values. For example,
// if we have a list of integers 0, 3, 5, 13, 19, then the result after sorting the list is 13, 5, 19, 3, 0."
const fromTwelve = (arr) => {
// Code here
}
module.exports ... |
import { EventHandler } from '../../core/event-handler.js';
import { platform } from '../../core/platform.js';
import { XrAnchor } from './xr-anchor.js';
/**
* Callback used by {@link XrAnchors#create}.
*
* @callback XrAnchorCreate
* @param {Error|null} err - The Error object if failed to create an anchor or null.... |
var app = angular.module('acquireApp', [])
class BoardSpace {
#row;
#col;
#label;
title = '';
occupied = false;
company = -1;
constructor(row, col) {
this.#row = row;
this.#col = col;
this.#label = (this.#row + 1).toString() + String.fromCharCode('A'.charCodeAt() ... |
/**
*
* @author Maurício Generoso
*/
(() => {
'use strict';
describe('Test Factory: MsgFactory', () => {
beforeEach(angular.mock.module('radarApp'))
var _MsgFactory;
beforeEach(inject((MsgFactory) => {
_MsgFactory = MsgFactory;
}));
it('Test if MsgFactory is defined', () => {
... |
import { StyleSheet, Dimensions, Platform } from 'react-native';
const window = Dimensions.get('window');
import Constants from 'expo-constants';
import colors from '../../assets/colors';
import theme from '../../assets/theme';
export default styles = StyleSheet.create({
container: {
flex: 1,
padding: 0,
... |
var canvas;
var context;
var pacman = {};
var bill;
var binky;
var pinky;
var inky;
var board;
var score;
var pac_color;
var start_time;
var time_elapsed;
var interval;
var loaded = false;
var direction = 0;
var food_put = 0;
var interval_num = 0;
var score2win = 50;
var timeClock;
var extraTimeDelta = 10;
var showingM... |
#!/usr/bin/env node
const inquirer = require("inquirer")
const chalk = require("chalk")
const fs = require("fs")
const temObj = require(`${__dirname}/../template`)
const options = {
encoding:"utf-8",
flag:"w"
}
const questionList = [
{
type:"input",
name:"temName",
message:"Template ... |
'use strict';
class Point {
constructor(x, y) {
this.x = x;
this.y = y;
}
}
class Rectangle {
constructor(x, y, width, height, label) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.label = label;
}
/**
* Return... |
angular.module('main').controller('newsurveyCtrl', function ($scope, $http, $timeout) {
$scope.abc = "newsurveyCtrl"
$scope.newpoll = function () {
$http.post("http://poll.theguywithideas.com/api/surveys/create", {
"instructions": $scope.surinstructions,
"surveySubtitle": $scope.surname,
"surveyTitle": $scope.... |
var city;
function preload() {
var url = 'http://api.openweathermap.org/data/2.5/weather?q=New York,NY'+
'&APPID=f02124924447c73bc1d1626b1bee5f45';
city = loadJSON(url);
}
function setup() {
createCanvas(400,400);
}
function draw() {
} |
const chalk = require('chalk')
const geocode = require('./utils/geocode')
const forecast = require('./utils/forecast')
const log = console.log
// const readline = require('readline');
// const rl = readline.createInterface({
// input: process.stdin,
// output: process.stdout,
// prompt: `For which city would you... |
import { USER_ORDER_REQUEST, USER_ORDER_FAIL, USER_ORDER_RESET, USER_ORDER_SUCCESS, CREATE_ORDER_FAIL, CREATE_ORDER_REQUEST, CREATE_ORDER_SUCCESS, GET_ORDER_FAIL, GET_ORDER_REQUEST, GET_ORDER_SUCCESS } from "../actions/constants"
export const createOrder = (state = {}, action) => {
const { type, payload } = action... |
// import React, { useReducer } from 'react';
// function TestReducer(){
// const [number,]=useReducer
// return(
// );
// } |
/**
* Created by Tomasz Gabrysiak on 2016-03-12.
*/
var app = angular.module("myRestApp", []);
app.controller("MyRestAppCtrl", ['$scope', 'myRestAppApiService', function ($scope, myRestAppApiService) {
$scope.books = ["Loading..."];
$scope.authors = ["Loading"];
$scope.newAuthor = {
first_name: '',
... |
import React, { Component } from "react";
import Grid from "@material-ui/core/Grid";
import Button from "@material-ui/core/Button";
class Filter extends Component {
render() {
const { filter } = this.props;
return (
<div className="container f-grid">
<Grid container justify="center">
... |
import React, { Component } from 'react';
import styled from 'styled-components';
import { Image } from 'react-bootstrap';
const ProfileImage = styled(Image)`
height: ${props => (props.size === 'lg' ? '90px' : '32px')};
`;
class Avatar extends Component {
render(){
const { user, size } = this.props;
retu... |
let Mock = require('mockjs');
let result = Mock.mock({
code: 0,
message: 'success',
"data|5": [{
"id": "@id",
"ip": "@ip",
"name": "@cname",
"userId": "@id",
"stars|2": ["※"],
"avatar": "@image('200*100', 'indianred', '#fff', 'mockjs')",
"createAt": "@... |
'use strict';
import { combineReducers } from 'redux';
import Menu from './MenuReducer';
import SelectProjects from './SelectProjectsReducer';
const rootReducer = combineReducers({
Menu: Menu,
SelectProjects: SelectProjects,
});
export default rootReducer; |
const {
ChoiceFactory,
ChoicePrompt,
ComponentDialog,
NumberPrompt,
TextPrompt,
WaterfallDialog,
DateTimePrompt
} = require('botbuilder-dialogs');
const { ClientProfile } = require('../class/ClientProfile');
const fetch = require("node-fetch");
const CHOICE_PROMPT = 'CHOICE_PROMPT';... |
import React from 'react';
import AppBar from '../_base/AppBar';
import Navigation from '../Navigation';
function handleTouchTap() {
// TODO: investigate how to navigate with router 4
console.log('NAVIGATE HOME'); // eslint-disable-line
}
const RightElement = (
<Navigation>
<Navigation.Item
... |
import { extend } from '../../core/utils/extend';
import { isString } from '../../core/utils/type';
import messageLocalization from '../../localization/message';
export class FileManagerCommandManager {
constructor(permissions) {
this._actions = {};
this._permissions = permissions || {};
this._initComman... |
let express = require('express');
let app = express();
let config = require('./config/config');
let port = config.dev.port;
require('./config/express.config')(app);
app.listen(process.env.PORT || 3000, () => {
console.log('review list RESTful API server started on: ' + port);
});
module.exports = app; |
/////// DEPENDENCIES //////////////////////////////
var express = require('express');
var http = require('http');
var app = express();
var path = require('path');
var mongoose = require('mongoose');
var fs = require('fs');
var port = process.env.PORT || 3000;
////// APP META_INF ////////////////////////////////
/*... |
const { describe, it } = require('mocha')
const assert = require('assert')
const { camelCase } = require('..')
describe('Camel Case', () => {
it('With empty string', () => {
assert.equal(camelCase('', ''), '')
})
it('With string', () => {
assert.equal(camelCase('Foo Bar'), 'fooBar')
assert.equal(ca... |
const crypto = require('../src/index');
require('webcrypto-test-suite')({
crypto
});
|
import React, {PropTypes} from 'react';
const SectionHeader = ({children}) => (
<h3 className="section-header">
{children}
</h3>
);
SectionHeader.propTypes = {
children: PropTypes.node
};
export default SectionHeader;
|
var GameSceneUI = cc.Layer.extend({
_lifeText : null,
_distanceText : null,
_scoreText : null,
volume : 0.3,
ctor : function(){
this._super();
var size = cc.winSize;
var lifeLabel = new cc.LabelBMFont("L I V E S", res.Font);
this.addChild(lifeLabel);
lifeLabel.x = 360;
lifeLabel.y =... |
'use strict';
var fs = require('fs'),
path = require('path');
var flaschenpost = require('flaschenpost');
var Peer = require('p2p');
var logger = flaschenpost.getLogger(),
peer;
/*eslint-disable no-process-env*/
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
/*eslint-enable no-process-env*/
peer = new Pe... |
const express = require('express'),
app = express(),
bodyParser = require('body-parser'),
backendRouter = require('./config/routes.js'),
cookieParser = require('cookie-parser'),
expressValidator = require('express-validator'),
passport = require('passport'),
session = require('... |
import React from 'react';
const Paginator = (props) => {
/**
* Render the list of all pages
* @returns {*[]}
* @private
*/
const _showPages = () => {
if(props.meta) {
let pages = [];
for(let index = 0; index < props.meta.last_page; index++) {
... |
var app = angular.module('myApp', []);
app.directive('ngBindHtmlUnsafe', function () {
return {
restrict: 'A',
scope: {
ngBindHtmlUnsafe: '='
},
link: function( scope , element , attributes ){
element[0].innerHTML = scope.ng... |
/**
* @param {number[]} data The array data set
* @param {number} q The q-quantile order
*
* @returns {number[number[]]} Array of q-quantile groups (partitions)
*/
const quantileGroups = (data, q) => {
const groupIndexes = []
const groups = []
// create memo of the last index of each quanti... |
const _ = require('lodash');
const { getPostObjects, mergePostData } = require('utilities/helpers/postHelper');
const { Post, Comment } = require('models');
const { postsUtil } = require('utilities/steemApi');
/**
* Return single post/comment of steem blockchain (if it exist).
* Return merged data of "steem" post/co... |
const fetch = require("node-fetch");
exports.help={
name: "corona",
description: "Check corona statistics for the specified country",
usage: "corona <country / \"countries\">",
type: "fun"
};
exports.run = async (client, message, args) => {
const Discord = require("discord.js")
const fs... |
/**
* Gestion des préférences de l'application.
*
* @module app
* @submodule app-prefs
* @main App
*/
window.App = window.App || {}
App.Prefs = {
/**
* Indique si le panneau des préférences est prêt à être affiché (construit)
* @property prepared
* @default false
*/
prepar... |
import React from 'react';
import {
Route,
Redirect,
Switch
} from 'react-router-dom';
const RouterView = ({routes = []})=>{
if(!routes.length) return null;
let redirectViews = routes.filter(item=>item.redirect).map((item,key)=><Redirect from={item.path} to={item.redirect} key={key} />);
routes... |
// import { createAppContainer, createSwitchNavigator } from 'react-navigation';
import React from 'react';
import Home from 'app/screens/Home';
import Country from 'app/screens/Country';
import { useSelector, useDispatch } from 'react-redux';
import ignoreWarnings from 'react-native-ignore-warnings';
import { Transit... |
const path = require("path");
const webpack = require("webpack");
const webpackMerge = require("webpack-merge");
const glob = require("glob");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const VIEWS_SRC = "web/src/views/";
const webpack... |
import styled from 'styled-components'
export const FormControl = styled.label`
line-height: 2;
text-align: left;
display: block;
margin-bottom: 15px;
margin-top: 20px;
color: #1e2027;
font-size: 12px;
font-weight: 500;
text-transform: uppercase;
`
|
import React from 'react';
import './index.css';
import Router from '../../router';
import NavBar from '../../components/navbar';
import Info from './info';
import Strip from '../../components/strip';
import { LeftOutlined } from '@ant-design/icons';
import { connect } from 'react-redux';
class Mine extends React.Co... |
import React, { useContext} from 'react';
import ExpenseItem from './ExpenseItem';
import { Context } from '../Context/Context';
const ExpensesList = () => {
const {expenses }= useContext(Context);
return(
<ul>
{expenses.map((expense)=>(
<ExpenseItem
id={expe... |
// CREATION DE L'OBJET CANVAS
var Canvas = {
// INITIALISATION DU CANVAS
initCanvas: function (canvas) {
context = canvas.getContext("2d");
context.fillText("Signez ici", 20, 20);
painting = false;
},
// FONCTIONS CONCERNANT LA SIGNATURE A LA SOURIS
startDraw: function () {
context.beginPath();
context.m... |
import Confidence from 'confidence'
import path from 'path'
var criteria = {
nodeEnv: process.env.NODE_ENV,
universalEnv: __CLIENT__ ? 'client' : 'server'
};
var config = {
$meta: {
name: 'React Redux Example Development'
},
isProduction: {
$filter: 'nodeEnv',
production: true,
$defaul... |
import callouts from './callouts';
export { callouts };
export * from './theme.css';
export * as header from './Header.css';
export * as benefits from './Benefits.css';
export * as callToAction from './CallToAction.css';
export * as banner from './Banner.css';
export * as captureMessage from './CaptureMessage.css';
|
import * as types from "./types";
// import indexApi from '../api/indexApi'
const state = {
selectMenuUrl: '',
userInfo1: {},
voteMessage: false,
systemMessage: false,
commentMessage: false,
billMessage: false
}
const mutations = {
[types.USER_INFO](state, value) {
state.userInfo1 = value
console.log(stat... |
var assert = require('assert');
module.exports = function(ostore) {
this.transHooks = [];
this.init = function(ctx, className, args) {
return ostore.init(ctx, className, args);
}
this.trans = function(ctx, v1, p) {
var pair = ostore.trans(ctx, v1, p);
if(ctx.error) return pair;
for(var i = 0; i ... |
import React from "react";
import useStyles from "../stylesheets/useStyles";
import Todo from "./Todo";
const TodoList = (props) => {
const classes = useStyles();
console.log("Received props from TodoList", props);
console.log(classes);
return (
<div className='d-flex flex-column justify-content-start'>
... |
const db = require('./../database');
const passportHelper = require('./passport-helper');
module.exports = {
setup(app) {
require('./session-setup').setup(app);
passportHelper.setup(app); // log in logic is in here
},
// login and register could maybe possibly idontknow combined :P ?
login(req, res, next) {
... |
module.exports = {
part1: (data) => {
const [card, door] = data.split("\n").map(Number);
let key = 1;
let target = 1;
while (target !== door) {
target = (target * 7) % 20201227;
key = (key * card) % 20201227;
}
return key;
},
part2: () => 0,
};
|
import {
UPDATE_FIELD_ARTICLE_EDITOR,
SUBMIT_ARTICLE,
ASYNC_START,
CLEAN_ERROR,
ARTICLE_EDITOR_PAGE_UNLOADED,
ARTICLE_EDITOR_PAGE_LOADED
} from '../constants'
const defaultState = {
id: null,
title: '',
body: '',
image: ''
}
export default (state=defaultState, action) => {
switch(action.type){
... |
var todos = require('./lib/todos')
, fs = require('fs')
var text = '\n'
, todo
for (var category in todos) {
text += '## ' + category + '\n\n'
for (var type in todos[category]) {
todo = todos[category][type]
text += '### ' + type + '\n\n'
text += '- **Title:** ' + todo.title + '\n'
if (todo.h... |
const os = require("os");
const { readFile, existsSync } = require("fs");
// imports
window.xlsToJson = require("convert-excel-to-json");
window.process = require("child_process");
window.fs = require("file-system");
window.path = require("path");
window.electron = require("electron");
window.csvToJson = require("csvj... |
import Taro, { Component } from '@tarojs/taro'
import { Picker,View, Text } from '@tarojs/components'
import { AtIcon } from 'taro-ui'
import dayjs from 'dayjs'
import PropTypes from 'prop-types'
import './index.scss';
class DatePicker extends Component {
static propTypes = {
dateStart: PropTypes.string,
dat... |
/* global LOOP_OBJ, define */
window.GATE_INNER_TEMPLATE = new Template("{{TYPE}}<br> < {{IN}}<br> > {{OUT}}");
function Template(html) {
this.html = html;
}
Template.prototype.apply = function(values) {
let html = this.html;
// Apply all values
LOOP_OBJ(values).forEach((k, v) =>... |
var SetStateInDepthMixin = {
setStateInDepth: function(updatePath) {
this.setState(React.addons.update(this.state, updatePath));
}
}; |
import Vue from 'vue'
import VueRouter from 'vue-router'
import BaseComponent from '../components/admin/BaseComponent.vue'
import UserTableComponent from '../components/admin/pages/UserTableComponent.vue'
import CreateUser from '../components/admin/pages/CreateUser.vue'
import EditUser from '../components/admin/pages/... |
const express = require('express');
const bodyParser = require('body-parser');
// MongoDB connect
const connectDB = require('./config/db')
connectDB()
///helpers
const {demoLogger} = require('./helpers');
// active version
const ACTIVE_VERSION = "/api/v1"
//models/
const HttpError = require(`.${ACTIVE_VERSION}/mode... |
const axios = require('axios');
const _ = require('lodash');
const sleep = require('./sleep');
const HOUR = 1000 * 60 * 60;
const TIMEOUT = 24 * 6;
const RATE_LIMIT_RESERVE = 5;
const TRY_LIMIT = 3;
const URL_RATE_LIMIT = 'https://api.github.com/rate_limit';
/* eslint-disable prefer-promise-reject-errors, no-throw-... |
$(document).ready(function () {
changeFluid();
});
$(window).resize(function () {
changeFluid();
});
$('.collapse').on('show.bs.collapse', function () {
$('.collapse').collapse('hide');
});
$('.btn-left[type="button"]').click(function () {
let has = $(this).hasClass('active');
$('.btn-left').removeClass('... |
import React from "react";
import Chatkit from "@pusher/chatkit";
import HoverableText from "./HoverableText";
const instanceLocator = "v1:us1:5f6f671c-5638-4ab3-b928-0c0f97c6b872";
const secretKey =
"5b4b74c3-2ebc-480c-94cd-fb5f87e5d4ff:3oKYoWtbJDl8tesyCVqtPt6nGJ7ITnHhUvcIM0uQWuA=";
const testToken =
"https://us1... |
const ERRORS = {
USERS: {
USER_NOT_FOUND: {
text: 'USER_NOT_FOUND_ERROR',
message: 'User not found!'
},
USER_ALREADY_EXISTS: {
text: 'USER_ALREADY_EXISTS_ERROR',
message: 'User already exists!'
},
USER_INPUT... |
import React, { Component } from 'react';
import NumKey from './NumKey';
export default class Numpad extends Component {
render() {
return (
<div className="numpad">
<div>
<NumKey name="AC" onClick={name => this.props.onClick(name)} />
<NumKey name="%" onClick={name => this.props.onClick(name)} />... |
import "../App.css"
import {useState} from "react"
function Field(){
const [title, setTitle] = useState('')
const [title2, setTitle2] = useState('')
function BMI(){
let Bmi= (title2/((title/100)*(title/100)))
let low = Math.floor(18*(title/100)*(title/100));
let high= Math.floor(2... |
import ReactCodeInput from 'react-code-input';
import React from 'react';
class Input2FA extends React.Component {
constructor(props){
super(props);
this.state = {};
}
onChange = (e) => {
if (e.length === 6) {
this.props.confirm({token : e});
}
}
rende... |
/*! Bulma integration for DataTables' Buttons
* © SpryMedia Ltd - datatables.net/license
*/
$.extend(true, DataTable.Buttons.defaults, {
dom: {
container: {
className: 'dt-buttons field is-grouped'
},
button: {
className: 'button is-light',
active: 'is-active',
disabled: 'is-disabled'
},
colle... |
import Api from '../js/api';
import folders from '../stubs/folders';
import messages from '../stubs/messages';
import palette from '../js/palette';
var _folders = [];
/**
* Init stubs, settings message's folderId, color.
* @param {Array} folders to init
*/
var initStubs = (folders) => {
for (let folder of fold... |
import React, { useState, useEffect } from "react";
//--------------------------------- What was used from material ui core -------------------------------------
import {
TextField,
withStyles,
Grid,
Typography,
Radio,
} from "@material-ui/core";
//------------------------------------------------------------... |
$("#target-id").click( function (event) {
output = "User clicked on " + event.pageX + "/" + event.pageY;
$("#display").text(output);
} ) |
const HBORDER = 5
const VBORDER = 5
const TSTEP = 5
const SSTEP = 4
const VSTEP = 3
class Table {
constructor(st) {
this.table = {
'': ['units', 'survived', 'kills'],
red: [101, 101, 101],
blue: [101, 101, 101],
green: [101, 101, 101],
yellow: [... |
var express = require('express');
var router = express.Router();
// middleware that is specific to this router
router.use(function timeLog(req, res, next) {
console.log('Time: ', Date.now());
next();
});
// define the home page route
// handler for the /user/:id path, which sends a special response
router.get(['/'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.