text stringlengths 7 3.69M |
|---|
function getFoods() {
return {
orange: 12,
pizza: 10,
kimchi: 1
}
}
console.log(getFoods()); |
#!/usr/bin/env node
const diffy = require('diffy')({fullscreen: true})
const keypress = require('keypress')
const init = require('./init.js')
const update = require('./update.js')
const render = require('./render.js')
function settings () {
return {
numSnakes: 2,
height: diffy.height,
width: Math.floor(d... |
"use strict";
class Board {
constructor() {
this.grid = [...Array(9).keys()];
}
getBoard() {
return this.grid;
}
}
module.exports = Board;
|
import React from 'react';
import ReactDOM from 'react-dom';
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.bundle.min.js'
import AppRouters from './routers/AppRouters'
ReactDOM.render(
<React.StrictMode>
<AppRouters />
</React.StrictMode>,
document.getElementById('root')... |
import React, { useEffect } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { getPokemon } from '../redux/pokemonSlice'
function List() {
const dispatch = useDispatch()
const pokemon = useSelector(state => state.pokemon)
useEffect(() => {
dispatch(getPokemon())
}, [d... |
import React from 'react';
import styles from './footer.module.css';
const Footer = (props) => (
<footer className={styles.footer}>Make Whatever you want! © All rights reserved</footer>
);
export default Footer; |
export {
orderFromHm,
removeOneHm,
removeAllHm,
checkoutFromHm,
fetchHmData
} from './HM'
export {
orderFromMediaMarket,
removeOneMediaMarket,
removeAllMediaMarket,
checkoutFromMediaMarket,
fetchMediaMarketData
} from './MediaMarket'
|
import '@expo/browser-polyfill';
import * as filters from 'pixi-filters';
import * as PixiInstance from 'pixi.js';
import { Platform } from 'react-native';
import { resolveAsync } from 'expo-asset-utils';
global.PIXI = global.PIXI || PixiInstance;
let PIXI = global.PIXI;
PIXI.filters = { ...(PIXI.filters || {}), ...f... |
import axios from 'axios'
import React, {Component} from 'react'
export default class Home extends Component{
state = {};
componentDidMount(){
axios.get('users').then(
res => {
console.log("Res",res);
this.setState({
users:res.dat... |
import React from 'react';
import PropTypes from 'prop-types';
import './ProductsList.css';
import ProductItem from '../ProductItem/ProductItem';
import ProductItemNull from '../ProductItem/ProductItemNull';
import Loader from './Loader/Loader';
function ProductsList({products, loading, pageItemsNum, pagePagination... |
let iniState = {
signupErr:'',
signinErr:''
}
export default function authReducer(state = iniState, action){
switch(action.type){
case 'AuthSuccess':
return state
case 'AuthErr_SU':
return {
signupErr:action.err
}
case 'AuthErr_SI'... |
var dells = [
{id: "H",
name: "Hades",
price: 6,
open: ["Monday", "Wednesday", "Friday"],
limit: true
},
{id: "Z",
name: "Zeus",
price: 5,
open: ["Tuesday", "Thursday"],
limit: true
},
{id: "P",
name: "Pegasus",
price: 2,
open: ["Saturday", "Sunday"],
... |
import React, { useState, useContext } from 'react';
import { useHistory } from 'react-router-dom';
import { PostContext } from '../Providers/PostProvider';
import { Button, Form, FormGroup, Label, Input } from 'reactstrap';
export const PostForm = () => {
const { addPost } = useContext(PostContext);
const [us... |
import React from 'react';
import { Image } from 'react-native';
import HomeDefault from '~/Assets/Images/Tabs/home.png';
import HomeFocused from '~/Assets/Images/Tabs/home_focused.png';
import SearchDefault from '~/Assets/Images/Tabs/search.png';
import SearchFocused from '~/Assets/Images/Tabs/search_focused.png';
imp... |
require("../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/chat_list/chat/_msg_building_card" ], {
"10e2": function(n, e, t) {
t.r(e);
var i = t("e98e"), a = t("c010");
for (var c in a) [ "default" ].indexOf(c) < 0 && function(n) {
t.d(e, n,... |
let createRadialTree = function (input) {
let height = 600;
let width = 600;
let svg = d3.select('body')
.append('svg')
.attr('width', width)
.attr('height', height);
let diameter = height * 0.75;
let radius = diameter / 2;
let tree = d3.tree()
.size([2*Math.P... |
const { check, validationResult } = require('express-validator/check');
const gravatar = require('gravatar');
const bcrypt = require('bcryptjs');
const jwt = require('jsonwebtoken');
const User = require('../models/User');
exports.userController = async function(req, res) {
//validation handling
const errors = val... |
const {Picklist} = require('../models');
module.exports = {
async getPicklist (req, res) {
try {
let search = req.query.delimeter;
var picklist = await Picklist.findAll({
where: {
delimeter: {
$like: `%${search}%`
... |
let config = require('../config/config');
let jwt = require('jsonwebtoken');
class utils {
static validateToken (token) {
let validStatus;
jwt.verify(token, config.jwt.secret, function (err, decoded) {
if (err) {
validStatus = false;
}
else {
validStatus = true;
}
... |
import React from 'react';
import ListMovies from '../components/listMovies';
import Search from '../components/search';
const Home = () => {
return(
<div className="page">
<div className="welcome-message">
<h2>Welcome to the Lattice Movie Finder</h2>
<p>Browse ... |
(function () {
'use strict';
angular
.module('Mobidul')
.directive('mblBlueTooth', BlueTooth);
BlueTooth.$inject = [
'$log', '$translate', '$rootScope', 'ActivityService', 'BluetoothBeaconService'
];
function BlueTooth (
$log, $translate, $rootScope, ActivityService, BluetoothBeaconService
) {
return {
... |
(function() {
// 这些变量和函数的说明,请参考 rdk/app/example/web/scripts/main.js 的注释
var imports = [
'rd.controls.BasicSelector'
];
var extraModules = [ ];
var controllerDefination = ['$scope','EventService','EventTypes', main];
function main(scope,EventService,EventTypes ) {
scope.in... |
import Routes from "../src/routes";
import GlobalStyles from "./styles/GlobalStyles";
import { BrowserRouter, Redirect, Route, Switch } from "react-router-dom";
import Modal from 'react-modal';
import { ToastContainer } from 'react-toastify'
import { store } from "./store";
import { Provider } from "react-redux";
Mo... |
jQuery(document).ready(function($){
localStorage.USUARIO
window.tabla_registros = $("#tabla-registros").DataTable(
{
"oLanguage": {
"sLengthMenu": "Mostrando _MENU_ filas",
"sSearch": "",
"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar _M... |
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
import React from 'react';
import { SliderStyle } from '../style/silder';
import Slider from "react-slick";
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
import { Col, Row } from "reactstra... |
import { combineReducers } from "redux";
import boardReducer from "./boardReducer";
import listReducer from "./listReducer";
export default combineReducers({
boards: boardReducer,
lists: listReducer
});
|
/**
* Created by JonIC on 2016-12-10.
*/
url = require('url');
exports.dislike = function(req, res) {
console.log(req);
var sendfacebookid ='fb12345';// req.body.sendfacebookid;
var sendname = 'abhi';//req.body.sendname;
var sendprofilephoto = 'dfdfdfd';//req.body.sendprofil... |
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import { click, currentURL, visit } from "@ember/test-helpers";
import { test } from "qunit";
acceptance("Restricted Replies Category Edit", function (needs) {
needs.user();
test(... |
import Scroller from '@/components/base/scroller/scroller'
import { computed, h, mergeProps, nextTick, ref, renderSlot, watch, withCtx } from 'vue'
import { useStore } from 'vuex'
export default {
name: 'wrap-scroller',
props: Scroller.props,
emits: Scroller.emits,
render (ctx) {
return h(Scroller, mergePr... |
const onClickSavedPost = async (user_id) => {
try {
const options = {
url: '/profile/mypage/bookmark/portfolio/',
method: 'POST',
data: {
user_id: user_id,
}
}
const response = await axios(options)
const responseOK = res... |
import React, { Component } from 'react';
import { View, StyleSheet, TextInput } from 'react-native';
import { connect } from 'react-redux';
import SaveButton from './PasteResumeSceneComp/SaveButton';
import styles from './styles/allStyles';
import strings from '../res/strings';
import { onPasteResumeTextChanged } fro... |
function mudouOpcao(objeto)
{
console.log("Selecionou: "+objeto.value);
}
function focou()
{
console.log("Caixa de texto recebeu foco");
}
function desfocou()
{
console.log("Caixa de texto perdeu foco");
}
function validar()
{
var campo = document.getElementById('nome').value;
if(campo.length > 0... |
const express = require('express');
const fs = require('fs');
const bodyParser = require('body-parser');
const compression = require('compression');
const helmet = require('helmet');
const indexRouter = require('./routes/index');
const topicRouter = require('./routes/topic');
const app = express();
app.use(helmet()); ... |
exports.run = function(client, message, args) {
message.channel.sendMessage('BABY DON\'T HURT ME.');
}
|
/*
* rank/unity
*
*/
import React from 'react'
import {
Col
}from 'reactstrap'
import Bulk from './bulk'
import Idcode from './idcode'
import Sprice from './sprice'
import Mprice from './mprice'
import Store from './store'
import Weight from './weight'
import Uppic from './uppic'
const Unity =()=> (
<Col xs={12... |
module.exports = function(config) {
return {
// just lint the source dir
source: {
files: {
src: ['Gruntfile.js', '<%= srcDir %>/app/**/*.js']
}
},
options: {
jshintrc: '<%= baseDir %>/.jshintrc',
ignores: [
'node_modules/*',
'dist/*',
'sample/*'... |
import React from 'react'
import StandardArticle from '../standardarticle/StandardArticle'
import './BlockArticle.css'
// const url = "https://static01.nyt.com/images/2021/07/25/multimedia/00xp-moses2-02/00xp-moses2-02-threeByTwoSmallAt2X.jpg?format=pjpg&quality=75&auto=webp&disable=upscale";
class BlockArticle exten... |
import React from 'react';
import SignInForm from '../../components/sign-in-form/sign-in-form.component';
import SignUpForm from '../../components/sign-up-form/sign-up-form.component';
import { SignInContainer } from './sign-in.styles';
const SignInPage = () => {
return (
<SignInContainer>
<SignInForm />... |
module.exports = new Array(30 + 1).join('.').split('').map(a=>Math.round(Math.random() * 1000)) |
import doAuth from "./doAuth";
import getData from "./getData";
import addData from "./addData";
import editData from "./editData";
import removeData from "./removeData";
export {
doAuth,
getData,
addData,
editData,
removeData
};
|
/**
* POST test
* @param {*} req
* @param {*} res
*/
var User = require('../db/model/user');
var Card = require('../db/model/card');
var randomstring = require('randomstring');
var mongoose = require('mongoose');
module.exports = (req, res) => {
// var mainUser = new User({
// _id : req.body.mainId
// });
... |
import { useState } from 'react';
const useNotification = () => {
const [load, setLoad] = useState('');
const [error, setError] = useState('');
const [success, setSuccess] = useState('');
return {
load,
setLoad,
error,
setError,
success,
setSuccess,
};
};
export default useNotificati... |
const oddCount = n => {
let counter = 0;
for (let i =0; i < n; i++){
if (i%2 != 0) {
counter++
}
}
return counter
}
//simplified way to think about it
const oddCount = n => Math.floor(n/2) ;
console.log(oddCount(15023))
|
//create buffer
var buf = Buffer.alloc(10); //长度为10, 初始值为0x0
buf = Buffer.alloc(10, 1); //初始值为0x1
buf = Buffer.from([1,2,3]); 长度为3的buffer,初始值为 0x01, 0x02, 0x03
buf = Buffer.from('this is a tést'); // 默认采用utf8
console.log(buf.toString());//默认采用utf8, 如使用编码与buffer不符, 会返回乱码
buff = Buffer.from('buffer');
buff2 = Buffer.... |
import React, { Component } from 'react';
import style from './PartnerCompanies.less'
import companyJsonData from './partner-companies.json'
class PartnerCompanies extends Component {
constructor() {
super();
this.state = {
companyData: companyJsonData
}
}
componentDi... |
let target = {}
let proxy = new Proxy(target, {})
proxy.test = 5
console.log(target)
console.log(proxy)
for (let key in proxy) console.log(key)
let numbers = [0, 1, 2]
numbers = new Proxy(numbers, {
get(target, prop) {
if (prop in target) {
return target[prop]
} else {
re... |
var tokki = angular.module("directives").directive("nuevaDireccion", ["tokkiApi", "$modal",
function(tokkiApi, $modal){
return {
restrict: "E",
templateUrl: "components/nuevaDireccion/nuevaDireccion.html",
scope: {sm: "=", lg: "=", block: "=", cliente: "="},
l... |
let btnMenu = document.querySelector('.btn-menu');
let menu = document.querySelector('.list-container');
let containerMenu = document.querySelector('.menu');
let enlaces = document.querySelectorAll('.lists li a');
let goTop = document.querySelector('.btn-go-top');
let activador ... |
// Construct weapons via the makeWeapon factory.
// Takes 4 args: type, args, mods, itemLevel (args and mods can be null if empty, itemLevel = 0 for default)
// type is a string, usually the class name from the python version, eg "LightLaser", "GatlingGun"
// args are additional arguments passed to the weapon construct... |
'use strict'
//A hello world stomp test
var Stomp = require('stomp-client')
let client = new Stomp('127.0.0.1', 61613, 'admin', 'admin')
client.connect(function(sessionId){
console.log(`STOMP client connected, session Id is ${sessionId}. Press CTRL-C to exit any time`)
//Consumer
client.subscribe('/queue/queu... |
/* 得点表 */
import { Grid, Hidden, makeStyles, Paper, Typography } from "@material-ui/core";
import IconButton from '@material-ui/core/IconButton';
import SearchIcon from '@material-ui/icons/Search';
import InputBase from '@material-ui/core/InputBase';
import { Tournament } from "../organisms/Tournament";
import { Rou... |
import React, { Component } from 'react'
export default class LabeledInput extends Component {
render() {
const { props: { label }} = this
return (
<div>
<label className="Form-label">{label}</label>
<input className="Form-input" {...this.props} />
</div>
)
}
}
|
import React from 'react';
import '../../styles/dashboard.css';
import Header from '../nav/DashboardHeader';
import Footer from '../nav/DashboardFooter';
import SideBar from '../nav/DashboardSidebar';
const Office = () => {
return (
<div>
<Header />
<SideBar />
<div clas... |
'use strict';
const ajax = function(method, endpoint, data, callback) {
var x = new XMLHttpRequest();
x.open(method, 'http://localhost:8080'+ endpoint);
x.setRequestHeader('Content-Type', 'application/json');
x.onload = function() {
var data = JSON.parse(x.responseText);
console.log(data)
callbac... |
/* treeWalker
arguments:
options,
or container, name, options
** Note: container should be the top "ul" element in the list structure
Options:
- root: root node,
- open: called when a node is opened with node as argument;
- close: called when a node is closed, with node as an argument
- beforeOpen: called ... |
<script type ="text/javascript">
var money; //use var as key word
var name; //variable initialization - storing a value in a variable (don't need to specify based on data type)
</script>
<script type ="text/javascript">
var money, name;
<script>
<script type = "text/javascript">
var name = "Alli";
var mon... |
const { mockRepo, when } = require('../../helper');
const mockUser = mockRepo();
const mockIncident = mockRepo();
jest.mock('../../models', () => ({
User: mockUser, Incident: mockIncident
}));
const { INCIDENT_AVAILABEL_VALUES, INCIDENT_DEFAULT } = require('../../const');
const { raiseIncidentToEngineerUser } = requ... |
import React from "react";
import PropTypes from 'prop-types';
const ListGroup = props => {
const {
textProperty,
valueProperty,
genres,
selectedGenre,
selectGenre
} = props;
return (
<div className="col-12 col-md-3 mb-3" data-test="ListGroupComponent">
<ul className=... |
let app = angular.module('cart', []);
app.controller('cartsController', ['$scope', 'cartFactory', function($scope, cartFactory) {
$scope.titles = ["名称", "单价", "数量", "总计", "操作"];
$scope.flag = true;
cartFactory.getCartList().then(function(res){
$scope.cartData = res.data;
init();
});
function init(){
... |
import React from 'react'
import {
View,Text,TouchableOpacity
}from 'react-native'
import s from './style.js'
const Module = ({title})=>(
<View style={s.ctn}>
<Text style={s.t}>{title}</Text>
<View style={{height:'75%',backgroundColor:'grey'}} />
<View style={s.btnw}>
<TouchableOpacity style={s.tt}><Text styl... |
module.exports = {
bdd:{
user:"admin",
mdp:"admindb1",
},
cloudinary:{
cloud_name:"dlvsghwah",
api_key:"951766311478258",
api_secret:"voomYZV8Kz6ngpT9uo93y1eA9_8"
}
} |
Module.register("tide-times", {
// Default module config.
defaults: {
URL: 'https://www.worldtides.info/api/v2?extremes&date=2020-05-16&lat=52.21741419350124&lon=-7.267169941702946&key=1d7c3619-91f4-463c-aeb1-416547cddd1a'
},
start: function () {
var self = this;
setInterval(function () {
var xmlhttp = n... |
export { default } from "./StationPage";
|
(function () {
"use strict";
let accList = [];
/**
* getElementById
* @param {*} id element id
*@returns {HTMLElement} HTML element
*/
function $(id) {
return document.getElementById(id);
}
/**
* Module for creating new account
* @param {*} name account nam... |
import styled from "styled-components";
import tokens from "@paprika/tokens";
import stylers from "@paprika/stylers";
export const Content = styled.div`
margin-left: -${tokens.spaceLg};
margin-right: -${tokens.spaceLg};
[role="menuitem"] {
${stylers.lineHeight(-1)}
}
`;
|
/**
* MAPLE Lab Graphs
* Highcharts.js
*
* created by Kyle Gauder
*/
$(document).ready(function () {
$('#Manning13-exp2').highcharts({
chart: {
type: 'line',
},
title: {
text: 'Manning 2013 Experiment 2'
},
xAxis: {
title: {
text: 'Probe Tone Offset (% of... |
#!/usr/bin/env node
"use strict";
var tokenizer = require("../lib/tokenizer.js"),
argv = require('yargs')
.usage('Usage: $0 [--debug] [--no-json] [-v] files')
.demand(1)
.boolean("debug")
.default("debug", false)
.boolean("json")
.default("json", true)
.boolean("v")
.default("v", fals... |
const assertEqual = require('chai').assert;
describe('#assertEqual', () => {
it('should passed/failed depending on the elements comparison (===)', () => {
assertEqual.strictEqual("Lighthouse Labs", "Bootcamp");
});
it('should passed/failed depending on the elements comparison (===)', () => {
assertEqual.... |
//ES5
var soma = function (a, b) {
if (a === undefined) a = 1;
if (b === undefined) b = 1;
return a + b;
};
console.log(soma());
//ES6
let soma2 = (a = 1, b = 1) => a + b;
console.log(soma2());
//REST
function soma3(...valores) {
return valores.reduce((anterior, atual) => {
return anterior + atual;
});
... |
/* eslint-disable no-unused-vars */
import { useState, useContext } from 'react';
import {
Box,
Button,
Card,
CardContent,
CardHeader,
Divider,
Grid,
TextField
} from '@material-ui/core';
import { useNavigate } from 'react-router';
import { ProContext } from 'src/App';
const AddProductDetails = (props)... |
import React, { useState } from 'react';
import './App.css';
import {
BrowserRouter as Router,
Switch,
Route,
Redirect,
useLocation,
useHistory
} from "react-router-dom";
import Login from './components/Login';
import RoomList from './components/RoomList';
import AddRoom from './components/AddRoom';
import ... |
import React, {useCallback} from 'react';
const Picker = ({
value,
onChange,
options,
}) => {
const onSelectChange = useCallback(e => {
onChange(e.target.value);
}, [onChange]);
return (
<span>
<h1>{value}</h1>
<select onChange={onSelectChange} value={value}>
{options.map(option... |
export const deploymentProdFrequency= (filteredData) => {
let data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (let i = 0; i < filteredData.length; i++) {
data[Number(filteredData[i].month - 1)] = filteredData[i].deploymentProdFrequency;
}
return data;
}
export const openDefects= (filteredDa... |
const createFoodComponent = (food) => {
return `
<section class="foodList__item">
<h3>${food.name}</h3>
<ul class="foodList__list">
<li class="foodList__item--nopadding">${food.category}</li>
<li class="foodList__item--nopadding">${food.ethnicity}</li>... |
function render()
{
gl.clear(gl.COLOR_BUFFER_BIT || gl.DEPTH_BUFFER_BIT)
if(mode == 0)
{
terrainView = "Dots"
if (toggleShading == 0.0)
{
gl.drawArrays(gl.POINTS, flatVert.length, gl.FLOAT, 0)
}
else
{
gl.drawElements(gl.POINTS, terrainFa... |
const router = require("express").Router();
const Food = require('./../models/Food.model')
const MenuPurchase = require('./../models/MenuPurchase.model')
const Wallet = require('./../models/Wallet.model')
const { checkLoggedUser } = require('./../middleware')
const { removeBalance, repay, totalTokens } = require('./../... |
fillColor = "#2b602b";
yValidated = false;
$(document).ready(function () {
var buttons = $(".x_button");
y_inp = $(".y-input");
let inp_form = $(".inp-form");
r_inp = $(".r-select");
x_val = null;
drawCanvas(1);
buttons.click(function () {
resetButtons();
x... |
'use strict';
var alchemyApp = angular.module('alchemyApp', [
'ngRoute',
'alchemyControllers',
'alchemyFilters'
]);
alchemyApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'assets/partials/analize-web-page.html',
controller: 'AnalizeWe... |
import React from 'react';
import '../assets/css/Footer.css'
const Footer = () => {
return (
<footer class="blue darken-3 page-footer">
<div class="container">
<div class="row">
<div class="col l3 s12 contact-container">
<h5 class="wh... |
import './Counter.css';
import React from 'react';
import CounterClass from './CounterClass'
const Counter = (props) => {
let text = (props.myText == undefined) ? 'Domyślny text' : props.myText;
return (
<div className="counter">
<h1>{text}</h1>
<CounterClass/>
<Coun... |
function soma (a, b) {
return a + b
}
console.log(soma(3, 4)) |
// @flow
import * as React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import _ from 'lodash';
import setStatic from 'recompose/setStatic';
import shallowEqual from 'rsuite-utils/lib/utils/shallowEqual';
import NavItem from './NavItem';
import { prefix, getUnhandledProps, de... |
const expect = require('chai').expect;
const model = require('../../server/model/jt-blog');
describe('jakub-troy-project-model', () => {
it('saves users username and password', (done) => {
model.savesUserDetails('supertom', 'mypasswordtestT1', (err, usernamePassword) => {
expect(usernamePassword).to.equal(... |
import React from 'react';
import BoardContainer from './components/BoardContainer';
export default function App() {
return <BoardContainer />;
}
|
/**
* Reload the component multiple time, the second suspense will sometime load first
* @module Experiences/Experience3
*/
import React, { Suspense } from 'react'
import Children1 from '@pages/Experience3/Children1'
import Children2 from '@pages/Experience3/Children2'
/**
* @function Experience
* Reload the com... |
import React from 'react'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { Alert } from 'react-native'
import { resetForm, askToContinuePayment, returnToPayment } from '../store/reducer/sendMoney'
import { hideModal } from '../store/reducer/navigation'
class ContinuePaymentAle... |
/* eslint-disable */
import React from 'react';
import axios from 'axios';
import { Route, Switch, Redirect } from 'react-router';
import Register from "./Register/Register"
import Profile from "./Profile/Profile";
import CreateConcept from './SingleConcept/CreateConcept';
import Concept from './SingleConcept/SingleCon... |
var express = require('express');
var router = express.Router();
//var mongodb = require('mongodb');
var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;
//var User = require('../models/user');
var Graduations = require('../models/graduation');
//alif alamin
function... |
const fs = require('fs')
const path = require('path')
const settings = JSON.parse(fs.readFileSync(path.resolve(__dirname, './consts/user-settings.json'), 'utf8'))
const user = {
getProperty(id){
if(settings[id]){
return settings[id]
}
else{
return {}
}
}... |
import Taro, { Component } from '@tarojs/taro';
import { View, Text, Image } from '@tarojs/components';
import cls from 'classnames';
import Header from '../../components/header/header';
import './home.scss';
import global from '../../global';
import parentsAvatar from '../../images/avatar/[email protected]';
import ch... |
import React from 'react';
import { Link } from 'react-router-dom';
import Panel from 'component/panel/index.jsx';
import BaseUtil from 'util/base-util.jsx';
import Lottery from 'service/lottery-service.jsx';
const _baseUtil = new BaseUtil();
const _lottery = new Lottery();
class LotterySave extends React.Component{... |
import React from "react";
import { useSelector, useDispatch } from "react-redux";
import { logout } from "../../../../store/actions/auth";
import "./Header.scss";
const Header = props => {
const dispatch = useDispatch();
const user = useSelector(state => state.auth.user);
return(
<section cla... |
$(document).ready(function() {
alert("Yahoo");
$( "#test" ).click(function() {
alert("Test button clicked");
});
}); |
import commonjs from '@rollup/plugin-commonjs'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
import html from 'rollup-plugin-html2'
import livereload from 'rollup-plugin-livereload'
import resolve from '@rollup/plugin-node-resolve'
import serve from 'rollup-plugin-serve'
import sve... |
import React, { Component } from 'react';
import { Button, Form, FormGroup, Label, Input, FormText } from 'reactstrap';
import { connect } from 'react-redux';
//import api from '../../services/api';
import { registerRequest } from '../../redux/actions/auth';
import Layout from '../../components/Layout';
class signup... |
angular.module("VideoModule").controller("VideoUploaderCtrl",function($scope,VideoServices){
$scope.myFile;
$scope.uploading=false;
$scope.message;
$scope.showMessage=false;
console.log("hello from VideoUploaderCtrl")
$scope.upload=function(){
$scope.uploading=true;
VideoServices.saveVideo($scope.... |
'use strict';
const _schemaHelper = require('wysknd-args').schemaHelper;
const _schema = require('../schema/greeting-schema');
const _checkSchema = _schemaHelper.buildSchemaChecker(_schema);
const _greetingPrefixes = {
'english': 'Hello',
'french': 'Bonjour'
};
/**
* Sample AWS Lambda function handler retu... |
import { get } from "./adapter.xhr"
export async function listBusiness ({ status, type}) {
try {
const res = await get(
'/customers/9c87b02c-d917-49c2-bc28-5dcb1e12f062/businesses',
{ status, type }
);
return res;
} catch (err) {
throw new Error("somethin... |
jQuery(function(){
jQuery('button#select_all').click(function(){
jQuery("div.study_subject input[type='checkbox']").attr('checked','checked');
});
jQuery('button#deselect_all').click(function(){
jQuery("div.study_subject input[type='checkbox']").attr('checked','');
});
});
|
const myArray = [3, 44, 38, 5, 47, 15, 36, 26, 27, 2, 46, 4, 19, 50, 48];
const my = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const binarySearch = (arr, elem) => {
let start = 0;
let end = arr.length - 1;
let middle = Math.floor((start + end) / 2);
while (arr[middle] !== elem && start <= end) {
if (arr[middle] < ele... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.