text stringlengths 7 3.69M |
|---|
// find the index of the id item in the array
export function getIndexOfId(array, id) {
for (var j=0; j < array.length; j++) {
if (array[j].match(id)) return j;
}
return -1;
}
export function splitElement(array, index) {
//splits element into an array of 3 items [<tag>, inner content, </tag>]
// FO... |
/*
*
*/
var contextPath = function(){
var root = window.location.href;
root = root.replace("http://", "").replace("https://", "").replace("//", "/");
var first = root.indexOf("/");
root = root.substr(first, root.indexOf("/", first + 1) - first);
return "";
}();
/*
*... |
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Lint = require("tslint");
/*
* TSLint forma... |
import React, {Component} from "react";
import {KeyboardAvoidingView, ScrollView} from "react-native";
import {ENDPOINT_REGISTER, makeAPIRequest} from "../../app/services/apiService";
import {simpleAlert} from "../../app/services/alertService";
import {
Container,
Header,
Title,
Content,
Footer,
... |
import React, {useEffect, useState} from 'react';
import {makeStyles} from '@material-ui/core/styles';
import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';
import {DataGrid} from '@material-ui/data-grid';
import purchaseRequestServices from '../../../services/purchaseReque... |
var slide_position = 1;
function showSlide() {
console.log(slide_position);
$("#slideshow img").hide();
$("#slideshow img:nth-child(" + slide_position + ")").show();
}
function moveSlidePosition(move) {
slide_position += move;
if (slide_position < 1) {
slide_position = $("#slideshow img").length + slide_positi... |
import Mixin from '@ember/object/mixin';
import { isBlank } from '@ember/utils';
export default Mixin.create({
extractErrors(store, typeClass, payload /*, id */) {
if (!payload || typeof payload !== 'object' || !payload.errors) {
return payload;
}
let defaultsErrors = this._super(arguments) || {};... |
import { isObject } from 'lodash-es';
/**
* @returns {Promise<Response>}
*/
export async function fetch(url = '', options = {}) {
if (isObject(url)) {
options = url;
url = options.url;
}
options = { ...options };
options.credentials = options.credentials || 'same-origin';
options... |
import React, { useState } from 'react'
import PropTypes from 'prop-types';
import { connect, useDispatch } from 'react-redux';
import { fetchRestaurants } from '../../actions/fetchActions';
import { makeStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';
import InputBase from '@ma... |
const express = require("express");
const router = express.Router();
const pool = require("../database");
router.get("/add", (req, res) => {
const consults = async () => {
try {
const promisePool = pool.promise();
let [restaurantes, fieldsRestaurantes] = await promisePool.query(
"SEL... |
/*
Configuração do plugin Enjoyhint
*/
//Inicializa a instancia Enjoyhint
var enjoyhint_instance = new EnjoyHint({});
//declara array de passos,definindo as mensagens e eventos.
var enjoyhint_script_steps = [
{
selector: '#help-tab1',
event: 'click',
description: 'Clique nesta aba para ca... |
const test = require('tape');
const F = require('../lib/function');
test('curry1 test', (assert) => {
assert.plan(1);
const adder = F.curry((a, b) => a + b);
const add1 = adder(1);
assert.equal(add1(1), 2);
});
test('curry4 test', (assert) => {
assert.plan(1);
const adder = F.curry((a, b, c, d... |
import React from 'react'
export default function SignedIn() {
return (
<div>
</div>
)
}
|
/*
The number 198 has the property that 198 = 11 + 99 + 88, i.e., if each of its digits is concatenated twice and then summed, the result will be the original number. It turns out that 198 is the only number with this property. However, the property can be generalized so that each digit is concatenated n times and the... |
// @flow
import {
type Node,
isExpressionStatement,
isThisExpression,
isAssignmentExpression,
isClassProperty,
isClassMethod,
} from "@babel/types";
import type {Doc, PropertyDoc} from "@webdoc/types";
import {createDoc} from "@webdoc/model";
// Parse this.member/Object.member = 'value' properties.
functio... |
import { renderString } from '../../src/index';
describe(`Returns a full URL to the specified tag's listing page for the specified blog`, () => {
it(`unnamed case 0`, () => {
const html = renderString(`{{ blog_tag_url('default', 'culture') }}`);
});
}); |
/**
* @author v.lugovksy
* created on 15.12.2015
*/
(function () {
'use strict';
angular.module('ROA.theme')
.run(themeRun);
/** @ngInject */
function themeRun($rootScope, layoutSizes, $q, $state, SubdomainService, RestApi, envService, $cookies) {
// Let's inject the state to catch it on the index... |
/**
* Copyright (c) Benjamin Ansbach - all rights reserved.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
const PublicKey = require('@pascalcoin-sbx/common').Coding.Pascal.Keys.PublicKey;
const BytesWithLength = require('@pascalco... |
// Strip text from files
module.exports = {
sitemap: {
src: [
'<%= config.dist %>/sitemap.xml',
'<%= config.dist %>/robots.txt'
],
dest: '<%= config.dist %>/',
replacements: [{
from: 'dist/',
to: ''
},{
from: 'app/',
to: ''
}]
}
};
|
/**
* 화면 초기화 - 화면 로드시 자동 호출 됨
*/
function _Initialize() {
// 단위화면에서 사용될 일반 전역 변수 정의
// $NC.setGlobalVar({ });
$NC.setValue("#chkSunDay", "Y");
// 버튼 클릭 이벤트 연결
$("#btnOk").click(onWorkDateCreate);
$("#btnCancel").click(onCancel);
}
/**
* 등록팝업 Open 시 호출 됨
*/
function _OnPopupOpen() {... |
import React from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Image,
Button,
ScrollView,
TextInput,
KeyboardAvoidingView,
Picker,
TouchableOpacity,
Dimensions,
} from 'react-native';
import {connect} from 'react-redux';
import {bindActionCreators } from 'redux... |
'use strict';
const response = require('../res');
const connection = require('../conn');
const datetime = new Date().toLocaleString();
exports.listKegiatan = function(req, res) {
datetime.params
connection.query('SELECT * FROM v_kegiatan', function (error, rows, fields){
if(error){
consol... |
var inputElement = document.getElementById('file');
function handleFiles()
{
var file = document.getElementById('file').files[0];
var reader = new FileReader();
reader.readAsText(file);
reader.onload = loadFile;
}
function loadFile(e)
{
var mainSection = document.getElementById('contentSection');
var inp... |
//--------------------------------------------------------------------------------;
// LOG;
//--------------------------------------------------------------------------------;
/*
Reset = "\x1b[0m"
Bright = "\x1b[1m"
Dim = "\x1b[2m"
Underscore = "\x1b[4m"
Blink = "\x1b[5m"
Reverse = "\x1b[7m"
... |
import React, { useRef } from 'react';
import Img from '../../../components/HtmlTags/Img';
const ShowImg = ({ productImg, productAlt }) => {
const imageContRef = useRef(); // Whole image ref
// Zoom on hover
const imageZoom = (e) => {
const productImg = e.target.getBoundingClientRect();
const mouseX = ... |
import React from "react";
import Context from "../context";
import { findNote } from "../helper-functions";
import "./NoteContent.css";
import PropTypes from "prop-types";
export default class NoteContent extends React.Component {
static contextType = Context;
render() {
const note = findNote(this.context.not... |
import React from 'react';
import { useHistory } from 'react-router-dom';
import './Team.css'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faLongArrowAltRight } from '@fortawesome/free-solid-svg-icons'
const Team = (props) => {
const {strTeamBadge,strTeam,strStadiumLocation,idTeam} = ... |
exports.getResponse=(status,payload,developerMessage)=>{
return {status,payload,developerMessage}
} |
mposApp.directive('dateP', function () {
return {
restrict: 'A',
require: 'ngModel',
link: function (scope, element, attr, ngModel) {
element.datepicker({
format: 'yyyy/mm/dd',
todayBtn: true,
todayBtn: true,
... |
const mongoose = require('mongoose')
const autopopulate = require('mongoose-autopopulate')
const VacancySchema = new mongoose.Schema({
title: {
type: String,
required: true
},
company: {
type: mongoose.Schema.Types.ObjectId,
ref: 'company',
required: true,
au... |
(function ($) {
Drupal.behaviors.Livedemo = {
attach: function (context, settings) {
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
ret... |
SleepyApp.controller('tagsController', [
'$scope',
'special_tags',
'tagsFactory',
function ($scope, special_tags, tagsFactory) {
tagsFactory.getAll().then(
function (tags) {
$scope.tags_list = {};
$scope.ntags = 0;
angular.forEach(tags.... |
import styled from "styled-components";
const Row = styled.div`
display: flex;
flex-direction: row;
`;
export const Column = styled.div`
display: flex;
flex-direction: column;
`;
const BorderBottom = styled.div`
border-bottom: 1px solid #ebebeb;
`;
export const Page = styled(Row)`
height: 100%;
`;
expo... |
$(function() {
var key = getCookie('key');
if (!key) {
window.location.href = WapSiteUrl+'/tmpl/member/login.html';
return;
}
$.ajax({
type:'get',
url:ApiUrl+"/index.php?act=member_account&op=get_mobile_info",
data:{key:key},
dataType:'json',
... |
import Page from 'abstract/page.js';
import Tpl from 'templates/notfound.art';
class NotFound extends Page {
constructor(props) {
super(props);
this.template = Tpl;
}
}
export default NotFound;
|
/*
* Implement an application that simulates an auditor listening to music being played.
* The music played is a UDP signal that is multicasted.
* The application has to identify the musician and the instrument played.
* The application provides the information of the active musicians via a TCP connection.
*/... |
// Hooks
import { useState } from 'react'
import { useTranslation } from 'next-i18next'
import { useBackend } from 'site/hooks/useBackend.mjs'
import { useToast } from 'site/hooks/useToast.mjs'
// Components
import { BackToAccountButton, Choice } from './shared.mjs'
// Config
import { freeSewingConfig as conf } from 's... |
/* eslint-disable strict */
module.exports.foo = function (value) {
return value + 1;
};
module.exports.foo = function (value) {
return value + 1;
};
|
const categoriaController = require('../controllers/categorias.controller');
module.exports = app => {
app
.route('/categorias')
.get(categoriaController.list)
.post(categoriaController.add)
app
.route('/categorias/:id')
.get(categoriaController.listById)
.put(... |
const program = require('commander');
program
.version('0.0.1')
.option('-e, --env [name]', 'Build environment')
.option('-a, --analysis', 'Open analysis')
.parse(process.argv);
const { name, analysis } = program;
process.env.NODE_ENV = name;
process.analysis = analysis;
process.env.devMode = name !== 'produc... |
import "../static/css/bootstrap.min.css";
import "../static/css/style.css";
import Layout from '../components/Layout';
const Terms = () => (
<Layout title="Home">
<div className="franchise-section-title pp">
<h1 className="text-center">Terms and Conditions</h1>
</div>
<div clas... |
/*
* Core
*/
var C = {};
C.Extension = {};
C.Extension.UI = {};
C.Geo = {};
C.Geo.Feature = {};
C.Geometry = {};
C.Helpers = {};
C.Helpers.CoordinatesHelper = {};
C.Helpers.IntersectionHelper = {};
C.Helpers.ProjectionsHelper = {};
C.Helpers.ResolutionHelper = {};
C.Helpers.RendererHelper = {};
C.Layer = {};
C.Laye... |
Board.SIZE = 8;
Board.prototype.holding = null;
Board.prototype.holdingSavedPosition = null;
Board.prototype.lastHolding = null;
Board.prototype.currentTurn = team.BLACK;
Board.prototype.multipleJumps = false;
Board.prototype.legalCircles = [];
Board.prototype.haveKing = false;
Board.prototype.tileAt = function... |
WebApp.Views.Admin = Backbone.Marionette.View.extend({
className: 'admin',
template: 'admin',
initialize: function () {
this.render();
},
render: function () {
App.renderTemplate(this.template, {}, App._bind(function (html) {
App.layouts.content
.empty()
.append(this.$el.html(html));
}, this));
... |
const router = require('express').Router();
// Site model
const { Site } = require('../../models/site');
// Middlewares
const { auth } = require('../../middleware/auth');
const { admin } = require ('../../middleware/admin');
// ============================================================
// SIT... |
const express = require("express");
const router = express.Router();
const multer = require("multer");
const Products = require("../models/productModel");
const storage = multer.diskStorage({
destination: function(req, file, cb) {
cb(null, "./uploads/");
},
filename: function(req, file, cb) {
cb(null, ne... |
/*************************************/
/* DECLARACIÓN DE VARIABLES GLOBALES */
/*************************************/
var clikado = false;
//var posicionesCasilla = new Array();
//var turno = 0;
var tieneTurno = false;
var bote = 0;
var casillas = new Array();
var eventos = new Array(); // Aída -> array para guardar ... |
export { default } from './lang'
export { default as hub } from './hub'
|
let arr = new Array();
for (let i = 0; i <= 100; i++) {
arr.push(i);
}
let brr = new Array();
for (let j = 0; j < arr.length; j++) {
if (arr[j] % 11 == 0) {
brr.push(j);
}
}
console.log(brr); |
/**
* Created by az on 2017/7/28.
*/
import QbCard from './QbCard';
export {QbCard};
|
import React from 'react';
import { Link } from 'react-router-dom';
import { boards, graphColor } from "./availableBoards";
import {
divStyle,
imgStyle,
titleStyle,
logoStyle,
formStyle,
displayerLogoStyle,
displayerDescription,
displayerBarContainer,
displayerTitleStyle,
displayerBarTitle,
displa... |
/** global _ */
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import utils from 'common/utils';
// import Cookie from 'common/cookie';
import { NavLink, Link } from 'react-router-dom';
import { Dropdown, Menu, message } from 'antd';
/* import { observable, action, toJS } from 'mobx';*/
i... |
function Bullet(xloc, yloc) {
var x = xloc;
var y = yloc;
this.display = function() {
if (mouseIsPressed){ //if the mouse is pressed the the bullet will be where the mouse is
//it will also be in the middle of the ner gun scope
x = mouseX;
y = mouseY;
}else{
... |
window.onload = ()=> {
let list = document.querySelector("#li");
list.innerHTML = insert (getChild(null));
};
let arr=[
{id: 2, name: "Организация", parent_id: null},
{id: 3, name: "Бухгалтерия", parent_id: 2},
{id: 6, name: " Отдел охраны", parent_id: 2},
{id: 7, name: "Караульная служба", parent_id: 6},
{i... |
import React,{useState} from 'react'
import BuyPage from './components/BuyPage'
import Cart from './components/Cart'
import HeaderNav from '../src/Header/HeaderNav'
import { toast, ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import {Container,Col,Row} from 'reactstrap'
func... |
var React = require('react');
var ReactRouter = require('react-router');
var PropTypes = React.PropTypes;
var Link = ReactRouter.Link
var AddressTable = require('../components/AddressTable.jsx');
var AddressTableData = require('../components/AddressTableData.jsx');
function Confirm(props) {
return props.isLoading ... |
import { Divider } from "antd";
export default function ProductGuaranteed() {
return (
<div className="product-detail-guaranteed">
<Divider>Guaranteed Safe Checkout</Divider>
<img
src={
process.env.PUBLIC_URL +
"/assets/images/shop/shop-detail/guaranteed.png"
... |
import apiGateway from "../src/index";
import corsMiddleware from "./cors-middleware";
import express from "express";
const appBehindApiGateway = express();
appBehindApiGateway.get("/test", function(req, res) {
res.json({
ts: new Date(),
xApiGateway: req.get("X-Api-Gateway")
});
});
appBehindAp... |
import { safeDefine, $ } from "../router/utils.js";
export class MatNotify extends HTMLElement {
createTemplate() {
const style = `.action{cursor:pointer}.__div{font-weight:bold}.action,.bxcs{background-color:#fff}input{width:90%;border-radius:20px;border:2px solid #e3e3e3;padding:4px;outline:0}.bxcs{position:fi... |
const Graph = require('../graph');
class Node {
constructor(value) {
this.value = value;
}
}
function depthFirst(graph, start){
let visited ={};
let result = [];
let list = graph.hash;
let _walk = (vertex)=>{
if(!vertex){return null;}
visited[vertex]=true;
re... |
"use strict";
/* ***************库*************** */
//@ts-ignore
const fs = require('fire-fs');
//@ts-ignore
const electron = require('electron');
/* ***************自定义*************** */
//@ts-ignore
const name_s = "proto-generate";
//@ts-ignore
const storage = require(`${Editor.Project.path}/packages/${name_s}/js/${na... |
// Using template strings
const assertEqual = (actual, expected) => {
if (actual === expected) {
console.log(`Assertion ✅: ${actual} === ${expected}`);
} else {
console.log(`Assertion ❌: ${actual} !== ${expected}`);
}
};
// Exporting functionality
module.exports = assertEqual; |
// This code should store "codewa.rs" as a variable called name but it's not working. Can you figure out why?
// let a == "code";
// let b == "wa.rs";
// let name == a + b;
//if there is value assignment we only use one "="
// let a = "code";
// let b = "wa.rs";
// let name = a + b;
//because we are using multiple... |
var walker;
var stepSize = 2;
function Walker(){
this.x;
this.y;
this.x = 5;
this.y = height/2;
this.walk = function(){
var choice = random(1);
if (choice < 0.4) {
this.x += stepSize;
}else if (choice < 0.6) {
this.y -= stepSize;
}else if (choice < 0.8) {
this.y += stepSize;
}else {
this.x... |
import React from "react";
const LocationImage = () => (
<div className="location-sign">
<img
src="https://www.freeiconspng.com/uploads/location-icon-png-21.png"
aria-hidden
alt="Location Image"
width="11"
/>
</div>
);
export default LocationImage;
|
import React, { useState } from "react";
import { useDispatch } from "react-redux";
import { Button, Checkbox, Form, TextInput } from "carbon-components-react";
import { ArrowRight16 } from "@carbon/icons-react";
import { loginUser } from "../../reducers/authenticatedUserReducer";
/*
Import and utilise service whe... |
import mongoose from "mongoose";
const candidateSchema = new mongoose.Schema({
name: String,
lastName: String,
company: String,
currentRole: String,
yearsOfExperience: Number
});
export default candidateSchema; |
'use strict'
const jwt = require('./jwt')
const redis = requireRoot('services/db/redis')
const redisClient = redis.getClient()
const exception = requireRoot('services/customExceptions')
const User = requireRoot('./appManager').models.User
module.exports = {
async validate (req, res, next) {
const token =... |
import Request from 'request'
// const url = 'https://simple.wikipedia.org/wiki/Baghlan_Province'
// const url = 'https://en.wikipedia.org/w/api.php?action=query&list=random&rnlimit=5'
const url = 'https://simple.wikipedia.org/w/api.php?action=query&list=random&rnlimit=500&format=json&origin=*'
const badTitles = ['Ta... |
import styled from "styled-components";
export const Container = styled.section`
grid-area: main;
justify-self: center;
align-self: center;
width: 95%;
height: 90%;
display: grid;
padding: 3rem 3rem 5rem 3rem;
grid-template-columns: repeat(2, 1fr);
grid-gap: 1.5rem;
grid-template-areas:
"title ... |
$(() => {
$('#boton').on('click', function () {
var curso = document.getElementsByTagName("input")[0].value;
console.log(curso);
$('#boton').off();
$.get("servidor.php")
.done( function (datos) {
var curso = ($('input').val()).toUpperCase();
... |
$(document).ready(function() {
$('.responsive').slick({
dots: true,
arrows: true,
infinite: true,
speed: 500,
slidesToShow: 5,
slidesToScroll: 5,
autoplay: true,
autoplaySpeed: 8000,
responsive: [
{
breakpoint: 1440,
settings: {
slidesToShow: 4,
slidesToScroll: 4,
},
},
... |
angular.module('info')
.component('info', {
templateUrl: 'app/components/info/info.html'
}); |
function getLHttp(url, divi){
loaded=false;
var httpObject = getLHTTPObject();
if (httpObject != null) {
httpObject.open("GET", url, true);
httpObject.send(null);
httpObject.onreadystatechange = function (){
if(httpObject.readyState == 4){
if(httpObject.responseText==""){
// setTimeout(getLHttp(url, divi), 1000);
// ge... |
//// Config
//var x = 0;
//var y = 0;
//var _speed = 80; // In miliseconds - the lowest, the fastest
//var _x = [7, 6, 5, 4, 3];
//var _y = [2, 2, 2, 2, 2];
///* is the objective on the screen? */
//var _objectiveOnScreen = false;
//var _objective_x = null;
//var _objective_y = null;
///* to which direction am I... |
$(document).ready(function() {
$("#signUp").click(function(){
$("#signIn").fadeOut(0).hide(1000);
$("#register").fadeIn(1500);
});
$("#backArrow1").click(function(){
$("#register").fadeOut(1500).hide();
$("#signIn").fadeIn(1500);
});
$("#email").change(validate).keyup... |
const router = require('express').Router();
const Data = require('../models/data').Data;
router.get('/profile', (req, res)=>{
if (req.session.keys_data) {
let usrname = req.session.keys_data['username'];
let matricule = req.session.keys_data['matricule'];
return res.render('profile', {faile... |
var express = require("express"),
url = require("url"),
router = express.Router();
var Cpu = require("../models/cpu.js"),
CpuCooler = require("../models/cpu-cooler.js"),
Motherboard = require("../models/motherboard.js"),
Memory = require("../models/memory.js"),
VideoCard = require("../mod... |
const { expect } = require('chai');
const knex = require('knex');
const app = require('../src/app');
const { makeBookmarks } = require('../src/fixture');
describe('Bookmarks Endpoints', function() {
let db;
before('make knex instance', () => {
db = knex({
client: 'pg',
connection: process.env.TEST... |
import Component from '../component'
describe('standard.h.component', () => {
let nodeName
beforeEach(() => {
nodeName = jest.fn()
})
test('Retorna truthy quando o nodeName for uma function', () => {
expect(Component.is(nodeName)).toBeTruthy()
})
test('Executa o nodeNme passando o attrs e childr... |
/**
* Alexander McCaleb
* CMPS 179 - Summer 2013
* Prototype2 - Thumper
*
* GridCell.js
*
* Represents a generic cell of a grid that can have several applications
*
* Used as the dance floor in Thumper
*
* Based on code from Shift Escape
*
*/
var GridCell = function(position, beat) {
//// A GridCell is a... |
export default {
primaryColor: 'rgba(124, 152, 186, 1)',
accentColor: '#62B1F6'
};
|
import { Data, newCharacter, newSkill, newSkillEffect, newDamageSkill, newSingleTargetDamageSkill, newBasicSingleTargetDamageSkill } from '../CharacterDataStructure'
Data.characters.push(newCharacter('Flandre Scarlet', 'https://en.touhouwiki.net/images/b/bd/Th06Flandre.png', 25, 140, 75, [
newBasicSingleTargetDamage... |
import React from 'react';
import '../App.css';
function Section({name, total}){
return(
<div>
<h3>{name}</h3>
<h3>{total}</h3>
</div>
)
}
export default Section; |
import React from "react"
import {
LinkedinShareButton,
TwitterShareButton,
TwitterIcon,
LinkedinIcon,
} from "react-share"
import "./index.css"
const Card = ({ img, title, description, href }) => {
return (
<div className="blogCard">
<div>
<img src={img} alt={title} />
</div>
<... |
(function() {
var inputText = document.querySelectorAll('input[type="text"]');
inputText.style.border = 20;
})();
|
const contractNames = require("./contracts.json");
const abis = require("./abi");
const getAdaptedContract = ({ address, abi, ethers }) => {
const { Contract } = require("@ethersproject/contracts");
let providerOrSigner = ethers;
try {
providerOrSigner = ethers.getSigner();
} catch (e) {
... |
import * as firebase from "firebase";
import firestore from "firebase/firestore";
const settings = { timestampsInSnapshots: true };
//Some of these values are located in android/app/google-services.json downloaded from FB
const config = {
apiKey: "AIzaSyABXjosnakuQ7lQj0u-JnHtDmvMu9GwvOw",
authDomain: "barcodes-5b... |
import { Fragment } from 'react'
import Link from 'next/link'
import { FreeSewingIcon } from 'shared/components/icons.mjs'
export const Breadcrumbs = ({ crumbs = [] }) =>
crumbs ? (
<ul className="flex flex-row flex-wrap gap-2 font-bold">
<li>
<Link href="/" title="FreeSewing" className="text-base-... |
const DEFAULT_OPTIONS = {
headers: { "Content-Type": "application/json" },
}
async function request(path, options) {
try {
const res = await fetch(path, { ...DEFAULT_OPTIONS, ...options })
const data = await res.json()
if (!res.ok) {
const error = {
message: (data && data.message) || "un... |
jQuery(function ($) {
$(".pay_bz").on('click', function () {
//alert('dd');
$(".bz_note").show();
$(".payonline").hide();
//css('display', 'block');
//saveTime($(this), $(this).val(), null);
});
$(".pay_nl").on('click', function () {
//alert('dd');
... |
const React = require('react');
const Link = require('react-router').Link;
const UserStore = require('../../stores/user_store');
const SessionStore = require('../../stores/session_store');
const UserActions = require('../../actions/user_actions');
const FriendActions = require('../../actions/friend_actions');
const F... |
/*****************************
* CODING CHALLENGE 2
*/
/*
John and Mike both play basketball in different teams. In the latest 3 games, John's team scored 89, 120 and 103 points, while Mike's team scored 116, 94 and 123 points.
1. Calculate the average score for each team
2. Decide which teams wins in average (highes... |
const Card = ({card}) => {
return card.map((card, i) => {
return <div key={i} style={{background: "#333", color: "white", padding: "10px", margin: "10px"}}>
<h3>{card.name.first+" "+card.name.last}</h3>
<img src={card.picture.large} alt="selam" />
</div>
})
}
export defau... |
jQuery(document).ready(function(){
fetch_gists(1, 100);
});
function fetch_gists(page, per_page){
jQuery.getJSON(
'https://api.github.com/users/chrisguitarguy/gists?callback=?',
{
'per_page': per_page,
'page': page
},
function(resp) {
var data... |
// export default 'http://5c6b00dc.ngrok.io'
export default ''
|
;(function(window, document) {
'use strict';
// throw an error if required functions not defined
if (typeof validateFields === "undefined") {
throw new Error("validateFields() is required and is not defined");
}
if (typeof showNotification === "undefined") {
throw new Error("showNotification() is req... |
// JavaScript episode N15
// challenge N19 => (Shifter words) - 7Kyu
// By ALGORITHM ACADEMY
/*
We will call a word "shifter" if it consists only of letters "H", "I", "N", "O", "S", "X", "Z", "M" and "W"
*/
// SOS IN THE HOME
const letters = ["H", "I", "N", "O", "S", "X", "Z", "M", "W"];
const shifter = (s) => {... |
import React from react
const Auth = () => {
return (
<>
</>
)
}
|
import React, {Component} from 'react';
export default class AddForm extends Component{
constructor(props){
super(props);
this.state = {
time : ""
};
}
add = (e) => {
e.preventDefault();
this.props.add(this.state.time, this.task.value, this.props.id);
}
time = (e) => {
let pattern = /^(([0-1]?... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.