text stringlengths 7 3.69M |
|---|
"use strict";
//var requirejs = require('requirejs');
//
//requirejs.define('', ['./hello'], function(myModule) {
// console.log(myModule);
//});
//'use strict';
{
console.log(a);
var a = 1;
}
|
import React from "react";
import { render, screen } from "@testing-library/react";
import Planets from "./Planets";
describe("Planets components", () => {
test("Checks if planet data is requested and loads into select tags", () => {
render(<Planets />);
const listBoxElements = screen.getAllByRole("combobox"... |
#!/usr/bin/env node
'use strict';
const moduleName = 'server';
const root = require('shrew')();
const xServer = require('../server.js')(root, root);
const xLog = require('xcraft-core-log')(moduleName, null);
xServer.start(err => {
if (err) {
xLog.err(err);
}
});
|
import { ConfigProvider } from 'antd';
import AppLocale from 'lngProvider';
import React, { Component } from 'react';
import { IntlProvider } from 'react-intl';
import { connect, useSelector } from 'react-redux';
import { Redirect, Route, Switch } from 'react-router-dom';
import {
changeLayoutType,
changeNavStyle,... |
/** When your routing table is too long, you can split it into small modules */
import Layout from '@/views/layout/TheLayout.vue';
const componentsRouter = [
{
path: '/components',
component: Layout,
redirect: '/components/tinymce',
name: 'ComponentDemo',
meta: {
title: 'route.components',
icon: 'mdi... |
import game from './game';
describe('bowling game', () => {
let myGame;
describe('game', () => {
beforeEach(() => {
myGame = game();
});
it('should have roll and score method', () => {
expect(typeof myGame.roll).toBe('function');
expect(typeof myGame.score).toBe('function');
... |
import Taro, { Component } from '@tarojs/taro'
import { View, Text, ScrollView } from '@tarojs/components'
import './shop.scss'
export default class Shop extends Component {
config = {
navigationBarTitleText: '商品'
}
render () {
return (
<View className='index'>
<ScrollView scrollX scrollY... |
var apiUrl = 'http://huobi.xia666.top/api';
function __args() {
// console.log(uni);
// console.log(uni.globalData);
var setting = {};
if (arguments.length === 1 && typeof arguments[0] !== 'string') {
setting = arguments[0];
} else {
setting.url = arguments[0];
if (typeof arguments[1] === 'object') {
sett... |
var searchData=
[
['dessin',['dessin',['../class_forme2_d.html#a08e1387f770d371278bd2fe03695ec38',1,'Forme2D']]],
['dessiner',['Dessiner',['../class_dessiner.html',1,'']]],
['dessiner_2eh',['Dessiner.h',['../_dessiner_8h.html',1,'']]],
['dessinj',['DessinJ',['../class_dessin_j.html',1,'DessinJ'],['../class_dess... |
module.exports = (sequelize, Sequelize) => {
const FAQ = sequelize.define('faq', {
title: {
type: Sequelize.STRING,
},
category: {
type: Sequelize.STRING,
}, category: {
type: Sequelize.STRING,
},
question: {
type: Sequelize.STRING,
},
description: {
type... |
const exp = module.exports = {}
const hasGroup = exp.hasGroup = function (user, group) {
const groups = user && user.groups
return (groups && groups.indexOf(group) >= 0) ? true : false
}
exp.isAdmin = function (user) {
return hasGroup(user, "admin")
} |
const { watch } = require("fs");
const { join } = require("path");
const { spawn } = require("child_process");
const { stdout } = require("process");
const DIR = "./doc";
function flush() {
for (let i = 0; i < stdout.rows; i++) {
stdout.cursorTo(0, i);
stdout.clearLine();
}
stdout.cursorTo(0, 0);
cons... |
import React from 'react';
const Neptune = ()=> {
return (
<div className="container-fluid">
<div className="img">
<img src="https://militaryarms.ru/wp-content/uploads/2018/03/neptun-vo-vsej-svoej-krase.jpg" width="100%" alt=""/>
<div className="text">
... |
const db = require('./../../config');
const mongoose = require('mongoose');
mongoose.connect(db.url);
const saltSchema = new mongoose.Schema(
{
user_name : String,
salt_value : String
}
);
module.exports = mongoose.model('salt',saltSchema); |
import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'
import { useState, useEffect } from 'react';
import styled from '@emotion/styled'
import { useRouter } from 'next/router'
import { ScrollMenu, VisibilityContext } from "react-horizontal-scrolling-menu";
import { C... |
// JavaScript Document
// JavaScript Document
function convert()
{
var oprt = document.getElementById("operators").value;
var slct = document.getElementById("selectors").value;
if(slct==="g")
{ var g= parseFloat(document.getElementById("inpt").value);
if(oprt ==="g")
{
document.getElementById... |
import p5 from 'p5';
export const chapter3 = () => {
const sketch = (p) => {
var centX;
var centY;
let step = 10;
let lastX = -999;
let lastY = -999;
let y = 200;
let yNoise = p.random(100);
p.setup = () => {
p.createCanvas(p.windowWidth, p.windowHeight);
for(let x... |
angular.module('betService', [])
.factory('Bet', function($http) {
return {
get : function() {
return $http.get('laravel/public/api/bet');
},
// save a bet
save : function(matchId, teamId) {
var data = { 'matchId': matchId, 'tea... |
/* eslint-disable */
export const user = {
login: 'SaraVieira',
id: 1051509,
avatar_url: 'https://avatars0.githubusercontent.com/u/1051509?v=4',
gravatar_id: '',
url: 'https://api.github.com/users/SaraVieira',
html_url: 'https://github.com/SaraVieira',
followers_url: 'https://api.github.com/users/SaraViei... |
const lib = require("./lib-frameworkless.js")
require('http').createServer(server).listen(7777)
function server(req, res) {
ROUTE_REDIRECT = {
// req.url : target's parent directory
'/favicon.ico' : './Public/Comp/',
}
lib.Init({
'res' : res,
'req' : req,
'viewdir' : './Public',
'compdir' : './Pub... |
jQuery(document).ready(function(){
"use strict";
$(".responsive-contact a").on("click",function(){
$(this).siblings().removeClass("active");
$(this).addClass("active");
if($(this).hasClass("phone-btn")){
$(".responsive-phone").slideDown();
$(".responsive-mail").slideUp();
}else{
... |
/**
* Created by hasee on 2017/12/26.
*/
Ext.define('Admin.model.hero.Hero', {
extend: 'Admin.model.Base',
idProperty: 'id',
fields: [
{name: 'id', type: 'int'},
{name: 'name', type: 'string'},
{name: 'localizedName', type: 'string'},
{name: 'headpotraitPath', type: 'string... |
"use strict";
const gulp = require('gulp');
const connect = require('gulp-connect');
const open = require('gulp-open');
const browserify = require('browserify');
const source = require('vinyl-source-stream');
const sass = require('gulp-sass');
const postcss = require('gulp-postcss');
const sourcemaps = require('gulp-s... |
var grobalUrl = "http://localhost:8080";
function hidenHelpButton() {
document.getElementById("addHelp").setAttribute("style",
"float:right;visibility:hidden;");
}
function showHelpButton() {
document.getElementById("addHelp").setAttribute("style",
"float:right;visibility:visible;");
}
function delHelpItem() {
... |
var MINUTES_PER_HOUR = 60;
var HOURS_PER_DAY = 24;
var MINUTES_PER_DAY = HOURS_PER_DAY * MINUTES_PER_HOUR;
function afterMidnight(timeStr) {
let timeStamp = new Date('1/1/2000 ' + timeStr)
let hours = timeStamp.getHours();
let minutes = timeStamp.getMinutes();
return hours * MINUTES_PER_HOUR + minutes;
}
func... |
import http from 'k6/http';
export default function () {
const res = http.get('https://k6.io');
console.log(JSON.stringify(res.headers));
}
|
import axios from 'axios'
import { Message } from '../components/TMessage/TMessage.js'
import store from '@/store'
import router from '@/router'
axios.defaults.baseURL = process.env.VUE_APP_SERVER_API_PATH
axios.interceptors.request.use(configs => {
// try{
// let data = JSON.parse(localStorage.getItem('user'))... |
import React, { useRef, useState } from 'react'
import { Alert, Button, Card, Container, Form } from 'react-bootstrap'
import Axios from 'axios'
export default function FormTrain() {
const modelRef = useRef()
const seatsRef = useRef()
const ownerRef = useRef()
const [error, setError] = useState("")
... |
const assert = require('assert')
const flow = require('./_flow')
let schema = '//atom/email'
describe(`schema:${schema}`, () => {
it('an email', () => {
let data = 'some-one@some-where.some-country'
let e = flow.verify(schema, data)
assert.equal(e, undefined)
})
it('without divi... |
angular.module("mobileControllers")
.controller("HomeController", function ($ionicSlideBoxDelegate, $ionicPopup, Popup, $ionicViewSwitcher, $state, $ionicScrollDelegate, $rootScope, $location, Platform, Domain, $scope, $ionicLoading, $timeout, $ionicSlideBoxDelegate, Popup, MobileService) {
$rootScope.currentPage... |
"use strict";
angular.module('workshop.home', [
'workshop.colorpicker',
'workshop.clock',
'workshop.my-click',
'workshop.knob'
])
.component('home', {
templateUrl: 'components/home/home.html',
controller: function($timeout, $parse, $scope) {
this.blue = 200;
this.changeColor = function()... |
import {combineReducers} from 'redux'
import {routerReducer} from 'react-router-redux'
import app from './App.ducks'
import create from './_Create/Create.ducks'
import view from './_View/View.ducks'
export default combineReducers({
app,
create,
view,
router: routerReducer,
})
|
/**
* @module limitTo
*
* Creates a new array or string containing only a specified number of elements.
* The elements are taken from either the beginning or the end of the source array
* or string, as specified by the value and sign (positive or negative) of limit.
*
* Same behavior as AngularJS limitTo filter:... |
// Global variables
var gl;
var loopID;
var program, vao;
var positionAttributeLocation;
var normalAttributeLocation;
var projectionMatrixUniformLocation;
var viewMatrixUniformLocation;
var transformationMatrixUniformLocation;
var lightPositionUniformLocation;
var lightColorUniformLocation;
var entity = {
'posit... |
import React, {Fragment, PureComponent} from 'react';
import {StyleSheet, View, Text, TouchableOpacity, Image} from 'react-native';
import {SvgXml} from 'react-native-svg';
const TALK = [
{
img: '../images/1.jpeg',
title: '사랑의 불시착',
content: `사랑의 불시착 와 내일 한다 드디어!!! 내일 주말이니까 하루종일
침대에 누워서 넷플릭스 봐야지 ㅇㅎㅎ`... |
// Dependencies
const exp = require('constants');
const express = require('express');
const path = require('path');
const fs = require("fs");
const { v4: uuidv4 } = require('uuid');
// Sets up the Express App
const app = express();
const PORT = process.env.PORT || 3000;
// Sets up the Express app to handle data parsi... |
import { Platform } from 'react-native';
import { Navigation } from 'react-native-navigation';
// screen related book keeping
import { registerScreens } from './screens';
registerScreens();
const createTabs = () => {
const tabs = [
{
label: 'ProfileScreen',
screen: 'ProfileScreen',
icon: requi... |
const puppeteer = require("puppeteer");
const { get } = require("request");
const express = require("express");
const app = express();
app.get("/", function (req, res) {
res.send("E O TREM BALAAAA");
});
app.get("/alt", function (res, res) {
res.send("Pagina dos ALT");
});
app.listen(8081, function () {
consol... |
require("../../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/packageA/sec_hand_m/new_house_trend/main" ], {
1697: function(e, n, t) {
var o = t("e336");
t.n(o).a;
},
"8c82": function(e, n, t) {
t.r(n);
var o = t("95b48"), r = t("96cb");... |
const inquirer = require("inquirer");
const mysql = require("mysql");
//set up a connection to mysql
var connection = mysql.createConnection({
host:"localhost",
user:"root",
password: "7%#ll3R#R@nF#90^T&!e",
database: "employee_tracker_DB"
})
connection.connect(function(err){
if(err) throw err
})... |
import React from 'react';
import Coin from './Coin'
import Styles from './CoinList.module.scss';
const CoinList = (props) => {
return (
<div className={Styles.coinsContainer}>
<div className={Styles.coinList}>
{
props.coins && props.coins.map((value, index) ... |
const { postTransfers, putTransfers } = require('./client')
const { ApiErrorCodes } = require('../models/errors')
const post = 'postTransfers'
const put = 'putTransfers'
const createParty = async (ctx) => {
if (!Object.prototype.hasOwnProperty.call(ctx.request.body, 'idValue')) {
ctx.response.body = ApiErrorCod... |
(function(){
'use strict';
angular
.module('app')
.controller('mainController', mainController)
.config(function ($httpProvider) {
$httpProvider.defaults.headers.common = {};
$httpProvider.defaults.headers.post = {};
$httpProvider.defaults.headers.put = {};
$httpP... |
import React from 'react';
import { connect } from 'react-redux';
import store from '../../config/store';
class MovieForm extends React.Component {
componentWillMount() {
if(this.props.type === "new_movie") {
store.dispatch({
type: 'formData',
payload: {
... |
import React, { useState } from "react";
import '../App.css';
function Home(){
const [submitted , setSubmitted] = useState(false);
const[valid, setValid] = useState(false);
const [values , setValues] = useState({
firstName:"",
lastName:"",
email:""
});
// const [firs... |
//import { dupa } from "./add"; // babel; instalacja paczki, pozniej rozdziel plioki na klasy++
DOMStrings = {
fields: document.querySelectorAll(".field"),
newGameBtn: document.querySelector(".btn"),
circle: '<i class="ion-android-radio-button-off"></i>',
cross: '<i class="ion-close-round"></i>',
symb... |
//MAICO
//START VARIABLES
//var -- it can be updated and also can be re-declared || var keyword two types of scope global and function not block level scope
//let -- it can be updated and also cannot be re-declared || let keyword support function and block level scope
//const -- it cannot be updated and also cannot be ... |
({
doInit : function(component, event, helper) {
var action = component.get("c.getUnits");
action.setCallback(this, function(results){
var State = results.getState();
console.log('State: '+State);
if(State == 'SUCCESS'){
component.set("v.u... |
require('newrelic')
const mongoose = require('mongoose');
const db = require('../database/index.js');
module.exports = {
getAll: function(callback) {
console.log('getAll Model');
db.imageInfo.find({}).exec(callback);
},
getByPlace: function(params, callback) {
console.log('get image by plac... |
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import {Helmet} from "react-helmet";
import VcitaPic from "../assests/vCita-new-clients.gif"
import AddClientsPic from "../assests/add-clients.png"
import NewClientsPic from "../assests/new-clie... |
var sliders = function () {
$(".range_01").ionRangeSlider({
min: 1,
max: 12,
});
};
var autoScroll = function () {
$(".home-menu-item").on("click", function (e) {
e.preventDefault();
var link = "#" + $(this).find("div").text().toLowerCase();
$("html,body").animate(
{
scrollTop: ... |
var brightRow = [];
var setBrightRow = [];
var darkRow = [];
var setDarkRow = [];
var bgDefault = [];
var txtDefault = [];
var profiles = [];
//name element for saving
var profName;
var profilesCombo;
function Profile(brightColors, normalColors, bg, text ){
this.NormalColors = normalColors;
this.BrightColors = bri... |
const gulp = require('gulp');
gulp.task('css', function() {
gulp.src('build/static/css/*.css')
.pipe(gulp.dest('./css'));
});
gulp.task('js', function() {
gulp.src('build/static/js/*.js')
.pipe(gulp.dest('./js'));
});
gulp.task('ico', function() {
gulp.src('build/favicon.ico')
.pi... |
class HelloWorld {
constructor(message) {
this.message = message;
}
getMessage() {
return this.message;
}
}
let helloWorld = new HelloWorld('ES6 can compile');
document.querySelector('.es6').innerHTML = helloWorld.getMessage();
|
import React, { useContext } from "react";
import {
Text,
View,
StyleSheet,
Image,
TouchableOpacity
} from "react-native";
// Contexts
import { UserContext } from 'contexts/UserContext';
export default function Setting({
icon,
text,
textColor,
onPress,
windowWidth,
windowHeight,
}) {
c... |
import React from "react"
import styled from "styled-components"
import { useStaticQuery, graphql, navigate } from "gatsby"
import Headline3 from "../Headlines/Headline3"
import TransformationResultCard from "../Cards/TransformationResultCard"
import BaseButton from "../Shared/Buttons/BaseButton"
import { above } from... |
const ApiRoutes = {
'all': 'http://localhost:8000/api/notes/all/',
'regular': 'http://localhost:8000/api/notes/regular/',
'image': 'http://localhost:8000/api/notes/image/',
'url': 'http://localhost:8000/api/notes/url/',
'link': 'http://localhost:8000/api/notes/url/',
'trash': 'http://localhost:8... |
import gql from "graphql-tag";
export default gql`
query GetUserPosts ($nextToken: String) {
getUserPosts(limit:10, nextToken:$nextToken) {
items {
id
username
profilePic {
bucket
region
key
}
captio... |
const express = require('express')
const app = express()
app.use(express.json())
const projects = []
app.use((req, res, next) => {
console.count("Quantidade Requisições")
next()
})
//Middleware que checa se o projeto existe
function checkProjectExists(req, res, next){
const { id } = req.params
const project ... |
'use strict';
const availability = stampit().init(function() {
var $open = false; // private
this.open = function open() {
$open = true;
return this;
};
this.close = function close() {
$open = false;
return this;
};
this.isOpen = function isOpen() {
return $open;
};
});
const members... |
import React from "react";
export class UserItem extends React.Component {
render() {
return (
<React.Fragment>
<div className="userPanel">
<div className="userPanelDetails">
<div className="leftContentSection">
{this.props.object.image ? (
<img
... |
import React from "react"
import "@shopify/polaris/styles.css"
import { Page, Card, TextStyle, TextContainer } from "@shopify/polaris"
export default ({ data }) => {
return (
<Page
title="Markdown blog with Gatsby and Shopify Polaris"
singleColumn={true}
>
<TextContainer spacing="tight">
... |
import React from 'react';
import { ImageBackground, TouchableWithoutFeedback, Keyboard, View, TextInput } from 'react-native';
import Logo from './Logo';
import Form from './Form';
import bgSrc from './images/wallpaper.png';
// eslint-disable-next-line
class Login extends React.Component {
render() {
ret... |
import * as actionTypes from '../constants';
import {valueReducer} from './common';
import PowersList from '../lib/powers';
const initialState = {};
for (const c of ['mage', 'rogue', 'warrior']) {
for (const p of PowersList[c]) {
initialState[`${c} ${p.level}`] = false;
}
}
export const classPowers = valueRed... |
const faqList = [
{
id: 1,
title: '如何加入',
url: 'https://txcdn.emodor.com/h5/20180711/index.html',
// url: 'https://mp.weixin.qq.com/s?__biz=MzUyODgzMTkyMA==&mid=100001063&idx=4&sn=08ac5981800be9949c6af5040a3d8197&scene=19#wechat_redirect',
},
{
id: 2,
title: '权限说明',
url: 'https://mp.we... |
//
// Code adapted from https://github.com/HeroicEric/ember-group-by (MIT licensed)
//
import { A } from '@ember/array';
import { module, test } from 'qunit';
import groupBy from 'kredits-web/utils/group-by';
module('Unit | Utils | group-by', function () {
let car1 = { name: 'Carrera', color: 'red' };
let car2 = {... |
import styled from 'styled-components';
export const CatsListStyles = styled.ul`
padding: 0;
margin: 0;
list-style: none;
display: grid;
grid-gap: 2rem;
${props => props.theme.media.md} {
grid-template-columns: 1fr 1fr;
}
${props => props.theme.media.lg} {
grid-template-columns: 1fr 1fr 1fr;
... |
import React from 'react';
import {connect} from 'react-redux';
import {withRouter} from 'react-router-dom';
import Modal from 'react-modal';
import { Result, Button } from 'antd';
import {closeModal} from '../actions/modal';
const customStyles = {
content : {
height : '400px',
width ... |
import React, { useState } from "react";
import { Grid, Chip } from "@material-ui/core";
import { connect } from "react-redux";
const DATA = [
{
step: 1,
description: 'Answer three questions so we can better help you with finding the right grants for your entity',
question: '1. What industry below best d... |
$(document).ready(function(){
/* $(".delete").click(function(){
var tr = $(this).closest('tr'),
del_id = $(this).attr('id');//del_id
$.ajax({
url: "deleteUser.php",
method:"post",
dataType:"text",
success:function(result){
if($result == true ){
tr.css("background-color" , "tomato");
t... |
/*
* @Author: your name
* @Date: 2020-11-04 13:23:54
* @LastEditTime: 2020-11-12 12:33:05
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \vue-admain\src\http\userList.js
*/
import request from "./index";
/**
* get 获取用户数据
*/
export function getUserList() {
return re... |
var timer;
var sound;
var otpExpireSound;
chrome.storage.local.get(null, beginScript);
function beginScript(datas) {
sound = new Audio("https://dm0qx8t0i9gc9.cloudfront.net/previews/audio/BsTwCwBHBjzwub4i4/alarm-clock-buzzer-beeps_MyERv24__NWM.mp3");
otpExpireSound=new Audio('https://mp3.fastupload.co/d... |
const url = "https://makra-stenkloev.no/thebean/wp-json/wp/v2/posts?_embed";
const carouselContainer = document.querySelector("#posts-carousel");
const rightArrow = document.querySelector("#right-carousel-button");
const leftArrow = document.querySelector("#left-carousel-button");
const indicator1 = document.querySele... |
import {FILL_FORM, GET_FORM, SEND_FORM_ERROR, SEND_FORM_GOOD, SEND_FORM_IN, FORM_NOT_VALID} from "../constants";
const initialState = {
isLoaded: false,
isSent: null,
notValid: null,
name: {
name: "name",
value: "",
isError: null,
validation: "NAME",
},
surname: {
name: "surname",
v... |
import React from "react";
import _JSXStyle from "styled-jsx/style";
const Instruction = ({ title, subtitle }) => {
return (
<div className="instruction">
<h2>{title}</h2>
{!!subtitle && <h3>{subtitle}</h3>}
<_JSXStyle id="Instruction">{`
.instruction {
display: grid;
... |
const resume = JSON.parse(localStorage.getItem('resume_playback')) || {};
class SavedPosition {
constructor(stream) {
this.ids = stream.hash.split(',');
if (stream.offsets) {
this.offsets = stream.offsets.split(',').map((t) => +t);
} else if (stream.offset) {
this.offsets = [stream.offset];
... |
var mongoose = require('mongoose');
var WeatherSchema = new mongoose.Schema({
location: String,
temperature: String,
wind: String,
humidity: String,
rainfall: String,
updated_date: { type: Date, default: Date.now },
});
module.exports = mongoose.model('Weather', WeatherSchema);
|
function isInvalidNumber(n) {
let num = Number(n);
if (!(num >= 100 && num <= 200) && num != 0) {
console.log('invalid')
}
}
isInvalidNumber(220) |
import React from "react";
import { withRouter, Link } from "react-router-dom";
import { LazyLoadImage } from "react-lazy-load-image-component";
import "react-lazy-load-image-component/src/effects/blur.css";
class PersonCard extends React.Component {
constructor(props) {
super(props);
this.state = {
i... |
import React, { lazy } from 'react';
import ReactDom from 'react-dom';
import Switch, { Screen } from '../../dist/index';
import Button from './Button';
const Home = lazy(() => import(/* webpackChunkName: "Home" */ './Home/index'));
export default ReactDom.render(
<Switch
notFoundView={_ => <div>404 no found</d... |
/**
* This class contains functions {sequenceOfExecution} and {onClickSequenceOfExecution}.
* @function {sequenceOfExecution} executes when user clicks submit in th UI.
* @function {onClickSequenceOfExecution} executes when user enters mass shift
* on any amino acid and click "OK" button.
*/
let backGroundColorLi... |
var myCenter = new google.maps.LatLng(44.831395, 19.212974);
function initialize() {
var mapProp = {
center: myCenter,
zoom: 10,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
var marker = new google.ma... |
var o=require("os");console.log(o.platform());
|
document.addEventListener("DOMContentLoaded", () => {
// your code here
//let button = document.getElementById('ourbutton')
let button = document.getElementsByTagName('input')[1]
let form = document.getElementById('create-task-form')
let selectbox = document.getElementById('priority-select')
form.addEvent... |
angular.module('boosted')
.controller('storeCtrl', function($scope, service, $state, $http, $location, $anchorScroll) {
service.getItems(2).then(function(response){
$scope.Items2 = response.data;
console.log($scope.Items2);
})
service.getItems(1).then(function(results){
$scope.Items1 = results.... |
/**
* Helper function to check if there is more space to explore in a graph when performing double BFS
* It compares the current sizes of maps vs previous sizes of the same maps.
* In case one of the maps has the same size as previous, then this method returns false.
* True otherwise
*
* @param {*} previousStar... |
import { useState } from "react";
const useKeyboard = () => {
const [selectedNotes, setSelectedNotes] = useState([]);
return {
setSelectedNotes,
selectedNotes
};
};
export default useKeyboard;
|
const initDb = require('./initDb')
const queries = require('./queries')
var db
beforeEach((done) => {
initDb((dbInstance) => {
db = dbInstance
done()
})
})
afterEach((done) => {
db.end(() => done())
})
describe('matchUserCreds', () => {
test('it should return a user id', (done) => {
const para... |
(function() {
'use strict';
angular.module('cyber', [
//angular modules
'ngAnimate',
'ngResource',
'ngMessages',
//3rd party modules
'ui.router',
'smoothScroll',
'ui.bootstrap',
//custom modules
'cyber.config',
'cyber.co... |
// @flow
import { curry2, curry3 } from "./curry";
function pureSet<A>(a: A) : Set<A> {
return new Set().add(a);
}
function apSet<A, B>(fnSet: Set<A => B>, aSet: Set<A>) : Set<B> {
const result = new Set();
for (const fn of fnSet) {
for (const a of aSet) {
result.add(fn(a));
}
}
return resul... |
const handleRepository = (oGen) => {
const { payload } = oGen;
if (!payload.repositoryName) {
payload.repositoryName = payload.mainName;
}
const url = `https://github.com/${
payload.repositoryOrgName ? payload.repositoryOrgName + "/" : ""
}${payload.repositoryName}`;
payload.repository = {
type:... |
/**
* Created by giufus on 23/06/16.
*/
var logger= require('morgan')
var a = process.argv[2];
var aPromise_A = new Promise((resolve, reject) => {
if (a <= 0) {
console.error('aPromise_A reject', a)
a++;
reject(a)
}
else {
console.log('aPromise_A resolve', a)
reso... |
var myApp = angular.module("MyApp",[]);
myApp.controller('phoneListControl', ['$scope', '$http',
function ($scope, $http) {
$http.get('phones/phones.json').success(function(data) {
$scope.phones = data;
}).error(function() {
console.log("error");
});
$scope.orderProperty = 'age';
}]);
|
import {EbayLoading} from "./EbayLoading";
export const LoadingComponent = {
template: `
<div class="LoadingComponent">
<ebay-loading-component></ebay-loading-component>
</div>
`,
components: {
'ebay-loading-component': EbayLoading,
}
}; |
const convict = require('convict');
const config = convict({
http: {
port: {
doc: 'The port to listen on',
default: 3000,
env: 'PORT'
}
},
authentication: {
google: {
"clientId": {
"doc": "The Client ID from Google to u... |
/*global ODSA */
// Written by Jun Yang and Cliff Shaffer
// Astack pop method
$(document).ready(function() {
"use strict";
var av_name = "astackPopCON";
// Load the config object with interpreter and code created by odsaUtils.js
var config = ODSA.UTILS.loadConfig({av_name: av_name}),
interpret = config.i... |
//promises example by Joost Faber https://codepen.io/joostf/pen/OQxpxx
const loadInsults = new Promise(function(resolve, reject) {
const request = new XMLHttpRequest()
const link = 'https://api.whatdoestrumpthink.com/api/v1/quotes'
request.open('GET', link, true)
request.onload = () => {
if (request.status... |
import React, { Component } from "react";
import axios from "./axios";
class UploaderCover extends Component {
constructor(props) {
super(props);
this.imageSelected = this.imageSelected.bind(this);
this.upload = this.upload.bind(this);
}
imageSelected(e) {
this.setState({
... |
export const width = 40;
export const height = 30;
export const mines = 100;
|
import { weekDayJson, MONTH_NAME } from "./variable"
import isObject, { deepClone } from './isObject'
export const add0 = function (m) {
return m < 10 ? '0' + m : m
}
//**时间转换
export const reDate = function (date){
var date = date ? new Date(date) : new Date(),
year = date.getFullYear(),
mon = date.getMon... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.