blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 132 | path stringlengths 3 236 | src_encoding stringclasses 29
values | length_bytes int64 8 7.94M | score float64 2.52 5.72 | int_score int64 3 5 | detected_licenses listlengths 0 142 | license_type stringclasses 2
values | text stringlengths 8 7.94M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
3ac30019a9bb3ef12bf7d9888262b0833c019fe8 | JavaScript | Conroyce/typeRacer | /spec/timer-spec.js | UTF-8 | 887 | 3.125 | 3 | [] | no_license | var Timer = require("../public/js/gameTimer.js");
var gameTimer = Timer.gameTimer;
beforeEach(function() {
jasmine.Clock.useMock();
})
describe("timeStamp", function() {
var timeFunc = gameTimer.timeStamp();
it("returns a function", function() {
expect(typeof(timeFunc)).toBe("function");
});
it("its... | true |
976f13885af530feecd9cf1a6ea3c4ecdaa5745c | JavaScript | hoops-doggit/log | /js/data.js | UTF-8 | 9,930 | 3.015625 | 3 | [
"MIT"
] | permissive | /**
* Log
* A log and time-tracking system
*
* Data functions
*
* @author Josh Avanier
* @version 0.1.1
* @license MIT
*/
Log = window.Log || {}
Log.data = {
parse(a = Log.log) {
let p = [],
lt = Log.time
for (let i = 0, l = a.length; i < l; i++) {
let e = a[i]
let es = lt.par... | true |
6bfea6c414523363c71aeae583c72e612b2a8349 | JavaScript | Tasleemkhan97/robofriendsnew | /src/reducer.js | UTF-8 | 894 | 2.625 | 3 | [] | no_license | import {CHANGE_SEARCHFIELD,REQUEST_ROBOTS_FAILED,REQUEST_ROBOTS_SUCCESS,REQUEST_ROBOTS_PENDING} from './Constants.js';
const initialStateSearch = {
searchField:''
}
export const searchRobots = (state=initialStateSearch,action={}) => {
console.log(action.payload);
switch(action.type){
case CHANGE_SEARCHFIELD:
... | true |
00d9d3c3295ca0a13a3f753bd687887123d9c611 | JavaScript | AwesomeDevTeam/FormLogic | /src/DropdownFormField.js | UTF-8 | 2,210 | 2.65625 | 3 | [
"MIT"
] | permissive | import immutableObject from "./immutableObject";
import FormField from "./FormField";
/**
* @param {Object} p Parameters object
* @param {Array.<DropdownFormFieldItem>} p.items
* @param {String} [p.label=""] Field label
* @param {String} p.name Field name
* @param {String} [p.value=undefined]
* @param {Boolean} ... | true |
9d59dd1005f011646ebaf73dfe8c2c2c6c484f67 | JavaScript | DavidDevOps2000/calcRn | /components/Visor.js | UTF-8 | 1,211 | 2.84375 | 3 | [] | no_license | /* eslint-disable prettier/prettier */
import React from 'react';
import {View, TextInput} from 'react-native';
export default props => (
<View>
<TextInput
style={estilos.visor}
placeholder='Resultado'
editable={false}
value={props.resultado}
/>
</View>
);
const estilos = {
visor... | true |
8b8d590a0651c661114b9b3bc869ee1417cf87ca | JavaScript | shashank89/maashaack | /chrome_plugins/timer_mail/contentscript.js | UTF-8 | 2,044 | 2.515625 | 3 | [] | no_license |
console.log("start");
// if has subject
//console.log(document.getElementById(":qi"));
//console.log(document.getElementById(":qc"));
//console.log(document.getElementById(":pz"));
function xpath(query, context){
return document.evaluate(context?(query.indexOf('.')==0?query:'.' + query):query, context || ... | true |
96980dc4ab3e92ed9112e22e682acde2cff9d7a2 | JavaScript | revers1/reactDZ | /src/Components/EditContact/EditContact.js | UTF-8 | 6,073 | 2.625 | 3 | [] | no_license | import React, { Fragment, Component } from "react";
import "./EditContact.css";
import {Redirect} from "react-router-dom"
import { timeout } from "q";
class EditContact extends Component {
state = {
id: this.props.currentContact.id,
name: this.props.currentContact.name,
email: this.props.c... | true |
669a6c118259284e9ee32b2d4758d741b7e3d7aa | JavaScript | JumpStartGeorgia/ReforMeter | /app/assets/javascripts/application/change_reform_page.js | UTF-8 | 3,521 | 2.515625 | 3 | [] | no_license | function initializeReformQuarterPairs() {
var exports = {};
var reforms_quarters = gon.linked_reforms_quarters;
exports.containsPair = function(reform, quarter) {
return reforms_quarters.filter(
function(reformQuarterPair) {
var reform_matches = reformQuarterPair.reform_slug === reform;
... | true |
befc54800d27697d1780dd70dd36f2b9760594ca | JavaScript | cleuber-andrade/curso-js | /arrays/foreach/foreach.js | UTF-8 | 209 | 4.0625 | 4 | [
"MIT"
] | permissive | //For Each só consegue interar dentro de arrays
const a1 = [1, 2, 3, 4, 5, 6, 7, 8];
let total = 0;
//**a1.forEach(function(valor,indice,array){});
a1.forEach(valor => total += valor);
console.log(total); | true |
c31e149a5a649ae223d57eb19a9e4bcd6e6fe2fc | JavaScript | Visiona/hello_world_app | /index.js | UTF-8 | 731 | 2.765625 | 3 | [] | no_license | const express = require('express')
const app = express()
const port = process.env.PORT || '3000'
//we have to tell Express which view engine we will be using
app.set('view engine', 'hbs')
app.use(function(req, res, next) {
console.log(req.url + " - " + new Date())
next()
})
app.get('/names/:name', function(requ... | true |
67ada5ca1684affdd87793029749f153e5628977 | JavaScript | ShubhamThakre/d3-charts | /src/components/bar-chart/bar-chart.js | UTF-8 | 3,259 | 2.875 | 3 | [] | no_license | import * as d3 from 'd3';
import React, { useEffect, useRef } from 'react';
const BarChart = ({height, width, chartData}) => {
// Variables / constants
const chartRef = useRef();
/**
* USE-EFFECT FUNCTION- to load the height/ width of the chart
*/
useEffect(() => {
const svg = d3.select(chartRef.current)
... | true |
6de232d685607bd3919ee63833ac9874f2086133 | JavaScript | ccshah298/Todo-app | /src/ToDoList.js | UTF-8 | 3,078 | 2.921875 | 3 | [] | no_license | import React, { useState,useEffect } from "react";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import { toDate } from "date-fns";
import TodoItem from "./TodoItem";
const apiUrl =
"https://gist.githubusercontent.com/benna100/391eee7a119b50bd2c5960ab51622532/raw";
f... | true |
e56a935b0436a2a74fed1ce18fa22327ea93b743 | JavaScript | Ruthlesswhims/Primed-Minds | /javascript/contact.js | UTF-8 | 1,523 | 3.109375 | 3 | [] | no_license | function validate()
{
document.getElementById('success').innerHTML = '';
var message = document.getElementById('message').value;
var messageMsg = document.getElementById('message-msg');
var messageRE = /^[-\w]+(?:\W+[-\w]+){0,99}\W*$/;
if(messageRE.test(message)){
messageMsg.innerHTML = '';
} else {
messa... | true |
979c3f5d3ca9b5253953bb39168efc4ed5762ada | JavaScript | nikhilketagani/js-bootcamp | /functions/undefined-null.js | UTF-8 | 610 | 4.5 | 4 | [] | no_license | let name ='gen'
//undefined for variable
let name1;
//let name1 ='gen'
//console.log(name);
console.log(name1);
if(name1 === undefined){
console.log('please provide a name');
}else{
console.log(name);
}
//undefined for function argument
//undefined as function return default value
let square = function(num){
... | true |
49848a99ffa172080e81d544b5b067cd6e789d74 | JavaScript | ginpie/handy-booking-app | /src/component/withFetch/withFetch.jsx | UTF-8 | 1,022 | 2.578125 | 3 | [] | no_license | import React from 'react';
const withFetch = (Component) => {
class Wrapper extends React.Component {
constructor(props) {
super(props);
this.state = {
error: null,
loading: false,
};
this.fetch = this.fetch.bind(this);
}
fetch(fetcher) {
this.setState({
... | true |
afb06b6c576b7dc49a93b9b6b7dc0877dc64bb45 | JavaScript | shybyte/exercism-ecmascript | /bowling/bowling.js | UTF-8 | 2,911 | 3.171875 | 3 | [] | no_license | /* eslint-disable no-mixed-operators,class-methods-use-this */
const MAX_PINS = 10;
const NORMAL_FRAMES_COUNT = 10;
class FrameOpen {
constructor(pins1, pins2) {
this.pins1 = pins1;
this.pins2 = pins2;
}
// eslint-disable-next-line no-unused-vars
needsMoreFillBalls(_fillBalls) {
return false;
}... | true |
53b28b29ced8ad5ded42d3fd87df838f1db3f1dd | JavaScript | MikiSayaka/javascriptCodeBase | /SayakaUtil.js | UTF-8 | 2,690 | 2.890625 | 3 | [] | no_license | (function ($) {
// Put json data into a select tag for options.
$.fn.genSelectFromJson = function (_value, _option, _objData) {
var _this = $(this);
_this.children().each(function (i) {
var _optionThis = $(this);
if (i != 0) {
_optionThis.remove();
}
});
if (/select/i.test... | true |
2ab6fe77f123e57463cdafc96004b0c53d177304 | JavaScript | alexeyds/enhanced-tape | /test/lib/enhanced_tape_test.js | UTF-8 | 2,723 | 2.515625 | 3 | [
"MIT"
] | permissive | import test from "enhanced_tape";
import assertTestFails from "test/support/assert_test_fails";
let beforeEachCalledTimes = 0;
test.beforeEach(() => {
beforeEachCalledTimes += 1;
});
let afterEachCalledTimes = 0;
test.afterEach(() => {
afterEachCalledTimes += 1;
});
test("tape", function(t) {
t.test("beforeEa... | true |
a52ef11bbd3822cc4ce784b2f79c034a1dd275da | JavaScript | Rahul-Roy-21/WhatsTheWeatherApp | /script.js | UTF-8 | 10,500 | 2.8125 | 3 | [] | no_license | const Results = document.querySelector("#weatherUpdates");
const notificationBar = document.querySelector("#notification");
const Logo = document.querySelector(".welcomeImg");
const searchInput = document.querySelector(".search input");
const submitButton = document.querySelector(".search button");
const cityName = do... | true |
823a2f5e3893dc93574581101304140627c92011 | JavaScript | RusbelthCV/ReactJS | /calculadora/src/Calculadora.js | UTF-8 | 2,737 | 2.859375 | 3 | [] | no_license | import React from 'react';
import './css/calculadora.css';
import Lista from './Lista';
class Calculadora extends React.Component {
constructor(props) {
super(props);
this.state = {
pantalla: "",
valor: "",
operador: "",
resultado: 0
};
... | true |
eb6d9f8403ea3f7f4b2455fbe53b5972c672051d | JavaScript | khlevnov/redux-tree-view | /src/reducers/node.js | UTF-8 | 1,739 | 3 | 3 | [] | no_license | const lastId = state => Math.max.apply(null, [
...Object.keys(state),
0
]);
const addChild = (state, parentId) => {
const createdId = lastId(state) + 1;
const childNode = {
id: createdId,
title: `Element ${createdId}`,
parentId: parentId,
nodes: []
};
let parentNode = {};
if (parentId) ... | true |
b6a3f8bb6777fd02eab1080699daee2d2160fb56 | JavaScript | absnormal/langrisser-combat-calculator | /old/data/skill.js | UTF-8 | 49,259 | 2.890625 | 3 | [] | no_license | /* 技能/基本資訊/倍率/克制/增傷/強弱化/無視防禦/戰前後固傷/敘述 */
var skill = [{
NAME: '普攻(物)', COST: 0,
TYPE: '物理傷害', CD: 0, RANGE: '?', AREA: '單體',
RATE: 1, COUNTER: ['無'],
DISC: '用攻擊普攻,造成1倍傷害。'
},{
NAME: '普攻(法)', COST: 0,
TYPE: '魔法傷害', CD: 0, RANGE: '?', AREA: '單體',
RATE: 1, COUNTER: ['無'],
DISC: '用智力普攻,造成1倍傷... | true |
728dbedb52702289909df940a18321447bcf1942 | JavaScript | tasola/sssb-scrape-be | /utils/log/log.js | UTF-8 | 2,931 | 2.765625 | 3 | [] | no_license | const doNotLog = process.env.NODE_ENV === 'test'
const separator = '----------------------------------'
const isThisANewRelease = (bool, prev, curr) => {
if (doNotLog) return
console.log(separator)
if (bool) {
console.log('The newly scraped object is identical to the previous one')
} else {
console.log... | true |
ac22f8b65f98aec71a9397593b4899613856636d | JavaScript | ChxGuillaume/ynov-expressworks | /json-me-edited.js | UTF-8 | 431 | 2.609375 | 3 | [] | no_license | const express = require('express');
const app = express();
const port = process.argv[2];
app.use(express.json());
app.get('/books', function (req, res) {
/* return with application/html content-type
res.send(JSON.stringify({
result: req.body.str.toUpperCase(),
})); */
// return with applicati... | true |
e9e544d871523b9b2d9b2498f8965476040b6934 | JavaScript | sameerg10/CIS3750-WireFrame | /wireframeJS/wireframeGoogleMap.js | UTF-8 | 3,033 | 2.765625 | 3 | [] | no_license |
var myCenter=new google.maps.LatLng(43.54829927320823,-80.23911952972412);
var mapProp={
center:myCenter,
zoom:15,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map =new google.maps.Map(document.getElementById("googleMap"),mapProp);
var infoString = "This is a possible route for your Team Capta... | true |
a8dbe01b9e68237760fba53c8106791386e272ce | JavaScript | mariyan250/SoftwareUniversity | /JS Fundamentals/08. Text Processing/04. substringSubstring.js | UTF-8 | 276 | 3.53125 | 4 | [] | no_license | function solve(word, sentence) {
let sentenceSequence = sentence.split(" ").map((el) => el.toLowerCase());
word = word.toLowerCase();
if (sentenceSequence.includes(word)) {
console.log(word);
} else {
console.log(`${word} not found!`);
}
} | true |
c7533cacad32bb80b915279ba9931f4e93314add | JavaScript | Raghav-Chaudhary/NodeJS-task-1 | /index.js | UTF-8 | 751 | 3 | 3 | [] | no_license | const express = require("express");
const fetch = require("node-fetch");
const app = express();
inputList = process.argv.slice(2);
fetch(`http://history.muffinlabs.com/date/${inputList[1]}/${inputList[0]}`)
.then((response) => response.json())
.then((data) => createOutput(data["data"]));
var output = "";
functi... | true |
3301d105767eb0df4dbcedd27437af53582df2cc | JavaScript | anlei-fu/code-generator | /src/generator/java-class-generator/builders/Method.js | UTF-8 | 3,174 | 3 | 3 | [] | no_license | class Method {
constructor () {
this.name = "";
this.accesity = "";
this.returnType = "";
this.args = "";
this.annotations = "";
this.final = ""; ... | true |
7e4120d31336005c2111c12db8d7d15229ac6e61 | JavaScript | saem/hairpiece | /frontend/src/home/MyMeetings.js | UTF-8 | 1,878 | 2.6875 | 3 | [
"MIT"
] | permissive | /* @flow */
import React from 'react';
import _ from 'lodash';
import {
Input
, ListGroup, ListGroupItem
, Glyphicon
} from 'react-bootstrap';
export const myMeetingsInit = () => {
return {
filter: '',
list: [
{id: 1, name: 'Andrew Weekly', person: 'andrew'}
, {id: 2, name: 'Saem Weekly', ... | true |
9c092275127be03e11d5a20214b72076bb10fe26 | JavaScript | MaxVanHoucke/esp-uantwerp | /src/static/js/contact.js | UTF-8 | 830 | 2.8125 | 3 | [
"MIT"
] | permissive | /**
* This function sends an email.
*/
$(window).ready(function () {
let status = $("#status");
document.getElementById("send-button").onclick = function () {
status.text("Sending message...");
data = {
"first-name": $("#first-name").val(),
"last-name": $("#last-nam... | true |
4b0ded0fe2c31e7757560ac5203f7d5d47fd036f | JavaScript | Adarsh14112008/toy | /sketch.js | UTF-8 | 781 | 2.734375 | 3 | [] | no_license |
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
var bob1,bob2,bob3,bob4,bob5,stand1,rope1;
function preload()
{
}
function setup() {
createCanvas(800, 700);
engine = Engine.create();
world = engine.world;
//Create the Bodies Here.
stand1=new... | true |
d9d34c20dbd338d75f917571bce478d869226338 | JavaScript | Sevinne/EstudoJs | /ExerciciosdeFunção/Exercicio02/main.js | UTF-8 | 821 | 3.125 | 3 | [] | no_license | function root() {
var hours = Number(prompt("Put the hours"));
var minutes = Number(prompt("Put the minutes"));
var seconds = Number(prompt("Put the seconds"));
VerificationBranch(minutes, seconds);
conversionBranch(hours, minutes, seconds);
}
function VerificationBranch(minutes, seconds) {
... | true |
7642ffac34ab0cbf982c7ef6b5d938a5d4d7c87a | JavaScript | alextricity25/AlexJavaScript | /Promises/setTimeout.js | UTF-8 | 120 | 2.859375 | 3 | [] | no_license | const delayedHello = () => {
console.log('Hi! This is an asynchronous greeting!');
};
setTimeout(delayedHello, 2000);
| true |
94ab94874f9485e7ccdc98115c54134783c6d7d4 | JavaScript | rahul162raj/react-shopping-app-starter-kit | /src/utils/paginate.jsx | UTF-8 | 194 | 2.75 | 3 | [] | no_license | export function paginate(Items, currentIndex, pageSize) {
const filteredItems = [...Items];
return filteredItems.slice(
(currentIndex - 1) * pageSize,
currentIndex * pageSize
);
}
| true |
da9d70705123e5508f6e9ac39703587b487eaed7 | JavaScript | jobybejoy/chicken-app | /src/store/actions/ordersActions.js | UTF-8 | 8,109 | 2.515625 | 3 | [] | no_license | const axios = require('axios');
// Admin Action
export const getAllOrders = () => {
return (dispatch, getState, { getFirebase, getFirestore }) => {
const docRef = getFirestore().collection("orders").orderBy("order_id", "desc")
docRef.onSnapshot((querySnapshot) => {
const orders = querySnapshot.docs.m... | true |
0a8a591d1157b87d559879975ed6fb15ef726508 | JavaScript | afrojasp/ejercicio4FuncionesJavascript | /ejercicio2/script.js | UTF-8 | 135 | 2.8125 | 3 | [
"MIT"
] | permissive | let numA = 144
let numB = 36
var mcd = (a,b) => { return (a === b) ? a: mcd((a > b)?b:a, Math.abs(a-b))}
console.log(mcd(numA, numB)) | true |
2dff93598a126515a84db210a0bc91d1ed259dd5 | JavaScript | PowerWeb5/tipranks | /lib/apis.js | UTF-8 | 11,572 | 2.578125 | 3 | [] | no_license | // ------------------------------------------------------------------------------------------------------------------------
// getData
//
// Description: Gets data for a specific stock symbol.
// API: https://www.tipranks.com/api/stocks/getData/<ticker>/?benchmark=<benchmark>&period=<period>
// Params: ... | true |
73132113ba1a8df229798287e12dfb1327e9678b | JavaScript | AndySushket/firstPracticeThree | /js/app.js | UTF-8 | 21,645 | 2.890625 | 3 | [] | no_license | var Colors = {
red: 0xf25346
, white: 0xd8d0d1
, brown: 0x59332e
, pink: 0xF5986E
, brownDark: 0x23190f
, blue: 0x68c3c0
};
window.addEventListener('load', init, false);
function init() {
createScene(); //set up camera and thr render
createLights(); //ad... | true |
cf223706476323fce4b4960aec2891dd1c48fed3 | JavaScript | mittulmandhan/restapi9 | /routes/api.js | UTF-8 | 2,384 | 3.28125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var HttpStatus = require('http-status-codes');
// we are creating a simple javascript array instead of requesting data from database for simplicity
// we will use this array to perform CRUD operations
let users = [{ id: 1, name: 'Mohan', address: 'Noida'... | true |
78b505588b33b8c89d0c9533642e2d823c030e7d | JavaScript | Vicky522/JavaScript | /s5_dom/s5_dom_todo_app/js/temp.js | UTF-8 | 2,763 | 3.78125 | 4 | [] | no_license | // ----------------
// TODO FORM
// ----------------
const getTodoFormValues = () => {
const todoForm = document.querySelector('#todoForm');
const formValue = {};
const formControlNameList = ['title'];
for (const controlName of formControlNameList) {
const controlElement = todoForm.querySelector(`[name=${c... | true |
68c55e0db4ddf3da160a7fd4600088e078f28d4d | JavaScript | website-scraper/node-website-scraper-phantom | /index.js | UTF-8 | 829 | 2.734375 | 3 | [
"MIT"
] | permissive | 'use strict';
const Promise = require('bluebird');
const getPhantomHtml = require('./src/get-phantom-html.js');
/**
* Makes phantom request if response contains html, returns original response body otherwise
* @param {Object} response - response object from `request` module
* @return {Promise} - resolved with body... | true |
885b13f4d6e2eb22242b2b9e5f014ae50064e638 | JavaScript | vedhamahesh/Rubiks-Cube | /cube.js | UTF-8 | 66,716 | 3 | 3 | [] | no_license | // Big Cube
class Cube {
constructor() {
this.cubies = [
[
[],
[],
[]
],
[
[],
[],
[]
],
[
[],
[],
[]
]
];
this.cubies[0][0].push(new Cubie(0, 0, 0, inColor, backColor, inColor, topColor, inColor... | true |
69ceef51302bf7597faf7390b7fb018aa8e1c09e | JavaScript | spf1314as/2020 | /js/array/unique.js | UTF-8 | 729 | 3.4375 | 3 | [] | no_license | // 不区分 数字 字符串
function objKeys (arr) {
let obj = {}
for (let item of arr) {
if (!obj[item]) obj[item] = true
}
return Object.keys(obj)
}
function useSet (arr) {
let set = new Set(arr)
return [...set]
}
// 不使用set
// 不使用map
// 处理NaN
function normalFun (arr) {
let newArray = []
let... | true |
0655d7311c9725da02cb93b4bafb99515edaf52b | JavaScript | orrgorenn/NodeChain | /Transaction.js | UTF-8 | 1,116 | 2.625 | 3 | [] | no_license | const sha256 = require("crypto-js/sha256");
const EC = require("elliptic").ec;
const ec = new EC("secp256k1");
class Transaction {
constructor(fromAddr, toAddr, amount) {
this.fromAddr = fromAddr;
this.toAddr = toAddr;
this.amount = amount;
this.timeStamp = Date.now();
this.... | true |
d1288853f1561bb1fcf5697b069457616c2f4317 | JavaScript | radiowarwick/modular-status | /src/components/TextInput.js | UTF-8 | 1,737 | 2.609375 | 3 | [] | no_license | import React from "react";
import styled from "styled-components";
import { useSpring, animated } from "react-spring";
import PropTypes from "prop-types";
/**
* TextInput.js - Returns a styled controlled text input component, with a placeholder of your choice.
*
* @param {string} value - The value of the text input... | true |
37e9b68188502bb6d8cb99356796562525ddd1cb | JavaScript | be-ndee/notes-app | /client/views/notes/notes.js | UTF-8 | 1,707 | 2.59375 | 3 | [
"MIT"
] | permissive | Session.set('noteName', '');
Session.set('category', null);
Meteor.autorun(function () {
Meteor.subscribe('notes', Session.get('noteName'), Session.get('category'));
});
Template.notes.created = function () {
};
Template.notes.helpers({
categories: function () {
return Categories.find();
},
n... | true |
6c10a26bc27cbb0c1c2f08142fcd3c2cc0397fc7 | JavaScript | ImyerDev/naikobot | /commands/aeval.js | UTF-8 | 1,497 | 2.625 | 3 | [
"MIT"
] | permissive | let bl = new (require("../utils/functions/bl.js"))()
module.exports = {
name: "aeval",
aliases: ["ae"],
category: "desarrolladores",
owners: true,
desc: "Prueba un codigo",
usage: "<prefix>aeval <code>",
execute: async(client, message, args) =>{
let Discord = require("discord.js")
try {
if(!args.join(" ")... | true |
43a080a39cb79608cf1804067702ce03fdcda1ac | JavaScript | yuzhenque/version | /Public/Js/Jquery/jquery.navSlide.js | UTF-8 | 4,626 | 2.640625 | 3 | [
"MIT"
] | permissive | /*
* 触屏标签左右拉动jquery插件 1.0
* 作者:ChaRmFree
QQ : 410232098
* 时间:2014.12.17
*/
(function($){
$.fn.navSlide=function(options){
var setting={
slideWrap:'slide_wrap',
slideNavLeft:0, //开始的left值
rebound:true, //是否有回弹效果
reboundSpeed:300, //回弹的速度
callback:function(index){
// alert(index);
}
};
i... | true |
ab802e679210164c57c342690eedb352aca27970 | JavaScript | pantifik/taskList | /scripts/taskList.js | UTF-8 | 2,907 | 3.1875 | 3 | [] | no_license | $(document).ready(function(){
taskManager();
function taskManager(){
//////////////// #TODO /////////////////////////////
// 1 Добавлять не только li, а полность весь менеджер//
// 2 Добавить сисек чтоб было красиво(bootstrap) //
///////////////////////////////////////////////////////
/* taskArray [0... | true |
6e4f7ba56e5ff62e21dc9547c827c26c0a1b45ff | JavaScript | DandelionLU/code-camp | /leetcode/split-linked-list-in-parts.js | UTF-8 | 1,310 | 3.25 | 3 | [
"Apache-2.0"
] | permissive | // Hi, I'm Yanzhan. I'm interested in all kinds of algorithmic problems. Also, I'm fascinated with javascript. If you want to learn more about programming problems and javascript, please visit my Youtube Channel (https://www.youtube.com/channel/UCDkz-__gl3frqLexukpG0DA?view_as=subscriber), Twitter Account (https://twit... | true |
47ca3a0abb5a20cb113e22580cf5b466870e0868 | JavaScript | TheOneNite/witf-react | /src/views/recipes/parseRecipe.test.js | UTF-8 | 1,446 | 3.421875 | 3 | [] | no_license | const parser = require("./parseRecipe.js");
it("should turn a string list of ingredients into an array of food item objects", () => {
const testInput = `20 g dried porcini mushrooms
5 beef cheeks , trimmed
olive oil
150 g piece of higher-welfare smoked pancetta
½ a celery heart
2 red onions
2 carrots
... | true |
910abc6b02e4c8d47cae2c0edfad3d73542eba0b | JavaScript | vickon16/vickon_ecommerce | /js/main.js | UTF-8 | 2,593 | 2.765625 | 3 | [] | no_license |
const navMenu = document.querySelector(".nav-menu");
const navigation = document.querySelector(".navigation");
const openBtn = document.querySelector(".hamburger");
const closeBtn = document.querySelector(".close");
const navLeft = navMenu.getBoundingClientRect().left;
openBtn.addEventListener("click", function(){
... | true |
96edd655ba51a2d6efb9216f2355e74b45ea7f0f | JavaScript | marleymarie/Train-Scheduler | /assets/javascript/app.js | UTF-8 | 1,644 | 2.59375 | 3 | [] | no_license |
// Created a new project in Firebase and here is my apiKey and info
var firebaseConfig = {
apiKey: "AIzaSyCNGiJdvUVUhIYHRSHfdeEFznzhggHPaWs",
authDomain: "homework7train-a2f5b.firebaseapp.com",
databaseURL: "https://homework7train-a2f5b.firebaseio.com",
projectId: "homework7train-a2f5b",
storageBu... | true |
daadfe5544082ad9e7bfcbd49007b9c6d3b51535 | JavaScript | peterhendrick/exchangeorderbook | /public/controller.js | UTF-8 | 3,219 | 2.515625 | 3 | [] | no_license | $(function () {
let socket = io();
let BTC_ETHOrderBook;
let BTC_BCHOrderBook;
let BTC_ETHTicker;
let BTC_BCHTicker;
let bidDT = _initializeDataTable('#bidTable', 'desc');
let askDT = _initializeDataTable('#askTable', 'asc');
$('#ticker').text('Waiting for Poloniex');
$('#BTC_ETH'... | true |
2a5a1a7dcb49cff71236f3f259fb11bda4b77484 | JavaScript | DEVILKXH/project | /src/main/resources/static/js/common.js | UTF-8 | 2,857 | 2.53125 | 3 | [] | no_license | /**
*
*/
$(function(){
initModal();
$(".form-select").change(function(){
var value = $(this).find("option:selected").text();
$(this).prev().val(value);
})
});
function getBaseDict(url, selectName){
$.ajax({
url: url,
success: function(res){
var select = $("select[name="+ selectName +... | true |
ad237cca790616beebcb91c085525ef2198cc3f0 | JavaScript | SomiaaMohamed/SomiaaMohamedArchitercture2020 | /MVCController/ouvrageControllerMVC.js | UTF-8 | 1,933 | 2.53125 | 3 | [] | no_license | var Ouvrage = require("../models/Ouvrage");
let listOuvrage = [];
let currentCat = '';
let ouvToUpdate = '';
exports.ouvrageRedirect = async function(req,res){
currentCat = req.params.idCat;
await Ouvrage.find({categorieID: req.params.idCat})
.then(ouv => {
listOuvrage = ouv
res.render('ou... | true |
01fd3bb5132c00b6a54e1024f2d54f04911cd7e8 | JavaScript | TRose2014/data-structures-and-algorithms | /Data-Structures/getEdge/get-edge.js | UTF-8 | 1,440 | 3.3125 | 3 | [
"MIT"
] | permissive | 'use strict';
function getEdge(graph, array){
if(!graph || !array){
return 'Info not provided';
}
let total = 0;
let startingLocation;
let vertexLocation = graph.getNodes();
for(let i = 0; i < vertexLocation.length; i++){
if(vertexLocation[i].value === array[0]){
startingLocation = vertexLoca... | true |
d85583b35e2dcc5356ea43ab6c0a800c6ea84e93 | JavaScript | ryan-mapa/twenty48 | /source/cell.js | UTF-8 | 875 | 3 | 3 | [] | no_license | class Cell {
constructor(pos) {
const el = document.createElement('div');
el.classList.add('cell');
el.setAttribute("data-pos", JSON.stringify(pos));
this.el = el;
this.tile = null;
}
pos() {
return JSON.parse(this.el.getAttribute("data-pos"));
}
ins... | true |
41f035519af15cd780860934fc2f854fc1ecb6fd | JavaScript | linwei5316/Kaohsiung-travel | /js/all.js | UTF-8 | 13,815 | 3 | 3 | [] | no_license |
//document生成完成後初始化
document.addEventListener('DOMContentLoaded',function(){
//全域變數區
//大螢幕尺寸:一排兩筆分五排共十筆
//小螢幕尺寸:一排一筆分五排共五筆
//大小斷點為寬度 960
//dividePage變數為一頁要顯示幾筆
let dividePage = document.body.clientWidth > 960 ? 10 : 5
//初始化下拉選單選項
function initSelect(){
const xhr = new XMLHttpRequest()
xhr.op... | true |
c37716c6616db03884dc706b5e48883516d4c46c | JavaScript | ReallyBasicGames/Supr_Playrs | /src/client/networking.js | UTF-8 | 2,061 | 2.703125 | 3 | [] | no_license | // Learn more about this file at:
// https://victorzhou.com/blog/build-an-io-game-part-1/#4-client-networking
import io from 'socket.io-client';
import { processGameUpdate } from './state';
// let networking handle making stuff visible
// import { setLeaderboardHidden } from './leaderboard';
// import { setUserHidden ... | true |
280eb283d74b3d32c0b1e1e6d107857a2166ddf7 | JavaScript | llukkah/algos | /JS Independent Algos/geometry-square.js | UTF-8 | 412 | 3.34375 | 3 | [] | no_license | /////////////////////////////////////////////////
////////// Shape - Define a Shape class.////////
///////It should have the number of sides and //
////////// a color associated with it. /////////
//Make the other classes Inherit from it.////////
/////////////////////////////////////////////////
length() {
var a = ... | true |
4bbffc3fa891e7fa413f22381f3a6a4e598bdfc6 | JavaScript | klayne1129/basil-app | /frontend/src/components/recipes/ListRecipesComponent.jsx | UTF-8 | 2,819 | 2.625 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react'
import AuthenticationService from './AuthenticationService.js'
import RecipeDataService from '../../api/recipes/RecipeDataService.js'
import { Card, ListGroup, CardColumns, Badge } from 'react-bootstrap';
import { Link } from 'react-router-dom'
import logo from "../../images/log... | true |
acb07c02dafe22e23ee3494da10a342a96cdeab3 | JavaScript | VovanSuper/ExpressMVC-dummy | /Controllers/BookController.js | UTF-8 | 2,944 | 2.671875 | 3 | [
"MIT"
] | permissive | var bookController = function(repo, errorHandler) {
var getId = function(req, resp) {
return resp.status(200).json(req.item);
};
var get = function(req, resp) {
if (req.query && req.query.genre) {
repo.getByGenre(req.query.genre, function(err, itemsByGenre) {
if (err) {
return er... | true |
93a791bb39d73b2c3c21d2a2815bcd4c750f6450 | JavaScript | ruiqi11/DOM | /Dom.js | UTF-8 | 7,220 | 3.5 | 4 | [] | no_license | window.dom = {
//create(){} == create:function(){}
// create(tagName) {
// return document.createElement(tagName);}
//1创建节点
create(string) {
const container = document.createElement("template"); //template 可以存放任意标签并显示,div不能显示<td>元素
container.innerHTML = string.trim(); //trim()可以去掉字符串两... | true |
2dcc0f432bf2c30564ddaffc7d8bdf19439173d4 | JavaScript | zhangfenglin-s/to-do-list | /任务列表.js | UTF-8 | 3,459 | 2.765625 | 3 | [] | no_license | let mission = document.getElementsByClassName("input-mission")[0];
let box = document.getElementsByClassName("to-do-list")[0];
let count = document.getElementsByClassName("count")[0];
let count1 = document.getElementsByClassName("count")[1];
let content = document.getElementsByClassName("content");
let content1 = docum... | true |
ab90fff1ae45e1fa0f4571ea4ccb23be20c1a308 | JavaScript | PO630/JS-Example | /Pro-Tips/consolelog.js | UTF-8 | 726 | 4.0625 | 4 | [] | no_license | // https://www.youtube.com/watch?v=Mus_vwhTCq0
// Suivre les variables dans le console
const foo = { name:'tom', age: 30 , nervous: false };
const bar = { name:'rick', age: 40 , nervous: false };
const baz = { name:'harry', age: 50 , nervous: true };
// Bad Code 💩
console.log('%c Nom de variable inconue','color:red... | true |
2849fc52655eee14db0556e78e821da225909aea | JavaScript | kilyan-s/Orio | /Jeu/narration.js | UTF-8 | 23,272 | 2.859375 | 3 | [] | no_license | var urlListeIntro;
//Choix pierre: 0 = garder; 1 = jeter
var choixpierre;
var sonFondNarration, pannerFondNarrationn, gainFondNarration;
var source1;
var Narration = function(){
};
Narration.prototype.init = function(){
window.addEventListener("keydown", function(event){
touche = String.fromCharCode(event.keyCode... | true |
9601e33e1a662b37ab82a8113cd5b28cffe888b9 | JavaScript | tfalvo/marionettejs-sample | /public/js/demo1.js | UTF-8 | 1,824 | 2.546875 | 3 | [] | no_license | var MyModel = Backbone.Model.extend({
defaults : {
},
initialize : function Doc() {
console.log('Doc Constructor');
},
});
var MyView = Marionette.ItemView.extend({
template: "#template1",
initialize: function() {
this.listenTo(this.model, 'change', this.render);
},
render: function() {
alert("We're... | true |
3d1df147005a5c4c23ace3a9ae2513f9e6e68434 | JavaScript | zyskowsk/zyskowsk.io | /public/js/minesweeper/tile.js | UTF-8 | 1,406 | 2.8125 | 3 | [] | no_license | (function (root) {
var Minesweeper = root.Minesweeper = (root.Minesweeper || {});
var Tile = Minesweeper.Tile = function (pos, board) {
this.pos = pos;
this.board = board;
this.neighborPositions = this.neighborPositions();
this.flag = false;
this.bomb = false;
this.hidden = true;
this.... | true |
1ceac98ddc3d880a4566c18db6099965e74203c8 | JavaScript | sp00x/json-optimize | /tests/test.js | UTF-8 | 3,515 | 2.625 | 3 | [
"MIT"
] | permissive | var isScript = (typeof require === 'function');
var JsonOptimize = isScript ? require('../src/json-optimize') : this.JsonOptimize;
var assert = isScript ? require('assert') : null;
// JSON.stringify(null) = "null"
// JSON.stringify(undefined) = undefined
// JSON.stringify([undefined]) = "[null]"
// JSON.stringify({a:... | true |
e585a0689ff768fefef711d65e1cade27f43503b | JavaScript | zlyzzy/node | /nodes/memory.js | UTF-8 | 301 | 2.890625 | 3 | [] | no_license | var showMen = function(){
var mem = process.memoryUsage();
console.log(mem)
var format = function(bytes){
return (bytes/1024/1024).toFixed(2)+'MB';
}
console.log('process:heapTotal:'+format(mem.heapTotal)+',headUsed:'+format(mem.heapUsed)+',rss:'+format(mem.rss))
}
showMen();
| true |
30aa1feed1791f71e6e7069516b7d15ff2d77c6b | JavaScript | AndresHB/Maze-Based-on-Graph-Theory | /public/js/MySwitch.js | UTF-8 | 655 | 3.21875 | 3 | [
"MIT"
] | permissive | /**
* @fileOverview Sustituto del switch convencional
* @author Andrés Hernández Bravo <andreshdezb@hotmail.com>
* @author Jose Joaquín Rojas Cortés <josejrojasc@hotmail.es>
* @author Alejandro Vega Lacayo <vega_alejandro8@hotmail.com>
* @author Javier Zamora Calvo <jazccr@hotmail.com>
*/
/** Objeto mySwitch */
... | true |
d8f12b35ed2243e2def1fbdb40cb0c147fe9fa52 | JavaScript | YeetMeLol101/Newtons-Cradle | /sketch.js | UTF-8 | 468 | 2.6875 | 3 | [] | no_license |
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
var log1;
var ball1;
var chain1;
function preload()
{
}
function setup() {
createCanvas(800, 700);
engine = Engine.create();
world = engine.world;
//Create the Bodies Here.
log1 = new Log (400... | true |
2eda8930456ba93d765279b8803e199dd64d1546 | JavaScript | vidarw/node-gameclock | /client.js | UTF-8 | 2,662 | 3.078125 | 3 | [
"MIT"
] | permissive | var display = '88:88';
var timerElement = document.getElementById('timer');
var quarterElement = document.getElementById('quarter');
var body = document.getElementById("body");
var socket = io();
socket.on('update', function (data) {
console.log(data);
timerElement.innerHTML = data.time;
quarterElement.innerHTM... | true |
3069172ecb11b5fd3df1dc3e64e39d4e01959439 | JavaScript | DanFessler/advent-of-code | /2020/06/index.js | UTF-8 | 1,219 | 3.625 | 4 | [] | no_license | // parse the input
function Parse(input) {
return input.split(/\n\n/).map(group => group.split(/\n/));
}
// Part 1
function Part1(input) {
return input
.map(group => new Set(group.join("").split("")).size)
.reduce((acc, val) => acc + val);
}
// Part 2
function Part2(input) {
let uniques = input.map(grou... | true |
433ee3175ef222955170f2b316f83c7f0a7985f0 | JavaScript | codewithirene567/leetcodesolutions | /richestcustomerwealth.js | UTF-8 | 437 | 3.109375 | 3 | [] | no_license | function(accounts) {
let result = []
for(let i = 0; i <accounts.length; i++){
result.push(accounts[i].reduce((accumulator, currentValue) => accumulator + currentValue))
}
return Math.max(...result)
};
//for this question I am given an account array where there are 3 accounts in an array... | true |
0657da0934f514cf4806e6d965a9ec8bf72d3fde | JavaScript | TeroGo/Hagaton2021 | /frontend/src/App.js | UTF-8 | 1,066 | 2.734375 | 3 | [] | no_license | import React from "react";
import "./App.css";
import Layout from "./Layout/Layout";
export const chartData = [
{ x: "Calories", y: 900 },
{ x: "Group Carb", y: 400 },
{ x: "Fat", y: 100 },
{ x: "Protein", y: 300 },
];
function App() {
const [foodData, setFoodData] = React.useState({});
const [isLoading, ... | true |
002c82b135334be232d24522e04faaae8316d212 | JavaScript | KevTheGame-Dev/http-api-project | /src/server.js | UTF-8 | 3,836 | 2.515625 | 3 | [] | no_license | const http = require('http');
const url = require('url');
const query = require('querystring');
const htmlHandler = require('./htmlResponses.js');
const jsonHandler = require('./jsonResponses.js');
const handleAuth = require('./handleAuth.js');
const port = process.env.PORT || process.env.NODE_PORT || 3000;
const ext... | true |
c0b4a2dcbf6e844d4dccc47af2512529c2c315ac | JavaScript | jvbbott/cliq | /user_data.js | UTF-8 | 2,059 | 3.046875 | 3 | [
"MIT"
] | permissive |
var data = require("./db/users.json");
/****************************************************
* User-data wrapper functions
****************************************************
/*
* This user system depends on every
* user's id being their index in the user list
*/
exports.get_all_other_users = function(curr_i... | true |
7749b35557314febfee54f421c90bbdc155e7f44 | JavaScript | amarabayor/exercises-js1 | /week-1/InClass/exercise-E.js | UTF-8 | 237 | 4.25 | 4 | [] | no_license | // Here is example using the String interpolation to concat strings
const greetingStart = "Hello";
const name = "Amara";
const greeting = `${greetingStart}, my name is ${name}`;
console.log(greeting); // Logs "Hello, my name is Daniel" | true |
5bfd1473a4dbd2ca3c52099c9a6772cb5fb5b09d | JavaScript | Lakshnys/Project-Example-code | /002. freeCodeCamp/001B.Functional_Programming/017. split Method/splitMethod.js | UTF-8 | 315 | 2.953125 | 3 | [] | no_license | console.log(123);
function splitify(str) {
// Only change code below this line
var bySpc = str.split(/\W/)
return bySpc;
// Only change code above this line
}
console.log(splitify("Hello World,I-am code"));
console.log(splitify("Earth-is-our home"));
console.log(splitify("This.is.a-sentence")); | true |
e5aca55a22b7e7372f5cf9bc1cc73121842322c2 | JavaScript | NachoMichalowicz/CursoIngresoJS | /9-Parciales/2020_1Cuatri_parcial_fuentes/uno.js | UTF-8 | 4,769 | 3.421875 | 3 | [] | no_license | /*
Michalowicz Ignacio
Enunciado:
Debemos realizar la carga de 5(cinco) productos de prevención de contagio,
de cada una debo obtener los siguientes datos:
el tipo (validar "barbijo" , "jabón" o "alcohol") ,
el precio (validar entre 100 y 300),
la cantidad de unidades (no puede ser 0 o negativo y no debe superar las... | true |
985d25f74b8a4e2d089c86b9939be9d880bdd3f8 | JavaScript | steinso/LAStore | /GitBroker.js | UTF-8 | 12,023 | 2.640625 | 3 | [] | no_license | "use strict";
var NodeGit= require("nodegit");
var timer = require("./Timer.js");
var exec = require('child_process').exec;
var fs = require('fs');
var Promise = require('es6-promise').Promise;
/*
*
* Object:
* [{ //commit
* time: ,
* files:[
* {
* name:
* fileContents:
* }]
* }]
*/
var Commit ... | true |
ff5e9a292f01e67708e49f19a12a916073e4d53b | JavaScript | hridyacp/kerala_tourism_ictka_assignment_phase2 | /main.js | UTF-8 | 4,407 | 2.59375 | 3 | [] | no_license | var desc1=document.getElementById("desc1");
var desc2=document.getElementById("desc2");
var desc3=document.getElementById("desc3");
var desc4=document.getElementById("desc4");
function myDescription(){
desc1.innerHTML="Parambikulam Tiger Reserve, which also includes the erstwhile Parambikulam Wildlife Sanctuary, is a 3... | true |
98faab7d30553ce8967a2ba6a9cf1452054b5635 | JavaScript | Roman-Yarinski/rslang | /src/components/Savanna/Game.js | UTF-8 | 5,652 | 3.0625 | 3 | [] | no_license | import Words from './Words';
import { getRandomInt, shuffleArray, playAudio } from './helpers';
import templatesHTML from './templatesHTML';
import Result from './Result';
import correctAudio from './audio/correct.mp3';
import errorAudio from './audio/error.mp3';
class Game extends Words {
constructor(group) {
s... | true |
46b44115f8e3a0b69e2a1e141a2acf8539f6ad70 | JavaScript | je7ov/node-course-chat-app | /server/utils/users.js | UTF-8 | 955 | 3.140625 | 3 | [] | no_license | class Users {
constructor () {
this.users = [];
}
/** @param {string} id
* @param {string} name
* @param {string} room
*/
addUser (id, name, room) {
const user = { id, name, room };
this.users.push(user);
return user;
}
/** @param {string} id */
removeUser (id) {
const use... | true |
63ceee3f3b57438dd63e0c22ce6ae3b47ed70445 | JavaScript | vlee13/basic-api | /frontend/src/pages/AllStudents.js | UTF-8 | 785 | 2.609375 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import axios from "axios";
import { Link } from "react-router-dom";
const AllStudents = () => {
const [info, setInfo] = useState([]);
useEffect(() => {
axios.get("http://localhost:3000/students").then((res) => {
setInfo(res.data);
});
}, []);
... | true |
e979532a501aff29d4b6b42313e8270e45becade | JavaScript | kinshotomoya/trello_to_do_bot | /trello.js | UTF-8 | 3,401 | 2.546875 | 3 | [] | no_license | const request = require('request')
const axios = require('axios');
require('dotenv').config();
const express = require('express');
const LineSender = require('./node_api_request');
const line_sender = new LineSender();
const app = express();
// TODO: 完全にハードコーディングになっているので、汎用的にリファクタする
const GET_BOARD_URL = `https://trel... | true |
925c90c75b0940b207f8e0cf0d29544dbc39afd3 | JavaScript | MaximDg/TVGuideUA | /public/js/script.js | UTF-8 | 518 | 2.671875 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | $(document).ready(function () { // Когда страница загрузится
$('.navbar-nav a').each(function () { // получаем все нужные нам ссылки
var location = window.location.href; // получаем адрес страницы
var link = this.href; // получаем адрес ссылки
if(location == link) { // при совпадении адреса ссылки и адреса окна
$(this)... | true |
018e041ea0365e0a59c4254f67fb234c531aa5a8 | JavaScript | Kony-CSE/kony-zxing-barcode-scanner | /ZxingScanner721/jssrc/android/nongenerated/File05949480bf77d41.js | UTF-8 | 328 | 2.53125 | 3 | [] | no_license | //Type your code here
function onBtnScanClick() {
//barcode.startZxing();
barcode.startZxing(
/**Function*/
myCallbackFunction);
}
function myCallbackFunction(result) {
//alert("My res"+result);
//kony.store.setItem("myResult", result);
if (result !== "") frmStartUp.lblData.text = r... | true |
dade9b447fffebf28e0eecf247adcd0070cc0588 | JavaScript | EdmarJr/DAAS | /trunk/codigo/java_legado/Desenvolvimento/saap/WebContent/js/util-data.js | ISO-8859-1 | 13,188 | 3.578125 | 4 | [] | no_license | /*******************************************************************************
* Autor: Adriano Pamplona
* Data de criao: 01/05/2007
* Verso: 1.0.0
*******************************************************************************
* Objetivo:
* Objeto para manipulao de data.
************************************... | true |
b8984b23deb5b854df0824b1ada36c3dbf57179d | JavaScript | Stegur/hj-homeworks | /websocket/chat/js/chat.js | UTF-8 | 1,203 | 2.71875 | 3 | [] | no_license | 'use strict';
const chat = document.querySelector('.chat');
const form = chat.querySelector('.message-box');
const input = chat.querySelector('.message-input');
const btn = chat.querySelector('.message-submit');
const msgs = chat.querySelector('.messages-content');
const loading = chat.querySelector('.loading');
cons... | true |
e8f8b997711b709f08968358a0c5384fa0124fb1 | JavaScript | vipnho1501/function1808 | /a.js | UTF-8 | 159 | 3.625 | 4 | [] | no_license | // function add(a, b = 10) {
// return a + b;
// }
const add = function(a, b) {
return a + b;
}
console.log(add(10, 1));
// arrow function
| true |
4884fcbe0160243994f7f2239c5bc8665a9f22bb | JavaScript | dsherret/swc | /tests/tsc-references/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3/input.ts/es2015.1.normal/output.js | UTF-8 | 1,246 | 2.6875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | // @target: ES5
var x;
var y;
class Base {
b(a) {
}
get c() {
return x;
}
set c(v) {
}
static s(a) {
}
static get t() {
return x;
}
static set t(v) {
}
constructor(a){
}
}
// Errors
// decrease visibility of all public members to protected
class De... | true |
9a6e54bded5f785f14606116bf914e0255820d78 | JavaScript | Khelil23/checkpoint-state | /src/App.js | UTF-8 | 1,676 | 2.875 | 3 | [] | no_license | import React from "react";
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
Person: {
fullName: 'Khelil Ben Sassi',
bio: "Master in mathematics.",
imgSrc: '/image.jpg',
profession: 'Futur developer'
},
bool: false,
... | true |
fb5d6e3e815350e5783ebb7a9f2bb97b336dc0d7 | JavaScript | r-b-s/quik_position | /js/upload.js | UTF-8 | 3,762 | 2.609375 | 3 | [] | no_license | async function parseReport(doc){
var data={
"user":{
"identity":sessionStorage.identity
,"uidHash":CryptoJS.MD5(sessionStorage.uid+sessionStorage.identity).toString()
}
,"portfolio":{}
,"positions":[]
};
console.log(doc.body);
var dateReg=/(\d{2})\.(\d{2})\.(\d{4})/;
var dt=doc.querySelec... | true |
6ae81f352019f902d6785d09154b2a3ea6408adf | JavaScript | rafaelthosi/webModernoJS | /1.fundamentos/03_numeros.js | UTF-8 | 662 | 3.90625 | 4 | [] | no_license | const peso1 = 1.0
const peso2 = Number('2.1') //convertendo uma string para number
console.log(peso1, peso2)
console.log(Number.isInteger(peso1)) //vendo de o valor de peso1 é um inteiro (int)
console.log(Number.isInteger(peso2))
const avaliacao1 = 9.798
const avaliacao2 = 6.659
const total = avaliacao1 * peso1 + av... | true |
b35de302f908d7def89a2d7a963aa495a16645b0 | JavaScript | kgorshkoff/advanced_js | /1/homework/src/components/basket.js | UTF-8 | 1,100 | 2.96875 | 3 | [] | no_license | const products = [
{id: 1, title: 'Notebook', price: 20000},
{id: 2, title: 'Mouse', price: 1500},
{id: 3, title: 'Keyboard', price: 5000},
{id: 4, title: 'Gamepad', price: 4500},
];
const renderProduct = (title, price, img = 'https://placehold.it/192x192') => {
return `<div class="product-item">
... | true |
902d133580f322cab5c36bd8d25d01de67be484f | JavaScript | PushupAnca/Udemy | /javascript/calculadora/calculadora.js | UTF-8 | 241 | 3.46875 | 3 | [] | no_license |
function suma(){
var num1 = parseFloat(document.getElementById('numero1').value);
var num2 = parseFloat(document.getElementById('numero2').value);
var result = num1 + num2;
document.getElementById('resultado').value = result;
}
| true |
2c4aa72a5711f49074973d6d08ebc725a3ae88dd | JavaScript | JioKim1012/SOFT130002_lab | /lab5/lab05.js | UTF-8 | 3,316 | 3.890625 | 4 | [] | no_license | //1. 获取url中名为name的参数。在URL输入框输入url,点击同行submit按钮后,其中的参数名为name的参数值需要出现在Argument value输入框内。
//如果没有名为name的参数,那么可以在Argument value输入框出现任何值。
//请仅在showWindowHref函数内写代码。
//提示:url指代 (若干字符串)?(参数名1)=(参数1值)&(参数2)=(参数2值)... 这样的字符串。具体可以上网查找。例如:hjsdghgbj?name=666666&group=876。
//url、url_submit、url_result指代对应id的三个对象,其中url和url_result可以通... | true |