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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3932d910164181b0f6548dd5d01897cf50ae54a2 | JavaScript | TMacB/wtf | /functions/helloworld/helloworld.js | UTF-8 | 1,100 | 2.515625 | 3 | [] | no_license | // const chromium = require('chrome-aws-lambda');
exports.handler = async (event, context) => {
// const url = 'https://trafficscotland.org/bridgerestrictions/index.aspx';
// const browser = await chromium.puppeteer.launch({
// executablePath: await chromium.executablePath,
// args: chromium.args,
// ... | true |
b6233a50ec086f5fa690ef8692b149005a1c1c0f | JavaScript | re5pawn/learn | /jscourse.com/incapsulated-counter/solution-es2015.js | UTF-8 | 222 | 3.078125 | 3 | [] | no_license | function createSummator(initialValue = 0) {
return {
inc(num = 1) {
initialValue += num;
},
dec(num = 1) {
initialValue -= num;
},
get() {
return initialValue;
}
};
} | true |
8ff99a211318f4d840f4d285ba932f2cf374b6ca | JavaScript | ttillotson/TipTopTomes | /frontend/components/shelves/shelf_item_form.jsx | UTF-8 | 2,416 | 2.625 | 3 | [] | no_license | import React from 'react';
import merge from 'lodash/merge';
class ShelfItemForm extends React.Component {
constructor(props) {
super(props);
let defaultShelf = this.props.defaultShelf;
let filteredShelves;
if (this.props.inShelves) {
filteredShelves= Object.values(this.... | true |
a6c1d7b78812e15da378255efcaf99e4c9dc3868 | JavaScript | ldam77/todo-list | /js/scripts.js | UTF-8 | 1,352 | 3.046875 | 3 | [
"MIT"
] | permissive | // business logic
function ToDoList(task){
this.task = task;
this.toDoItems = [];
}
// user interface logic
$(document).ready(function(){
$('#add-list').click(function(){
$('#new-todo').append('<div class="new-todo remove-list">' +
'<div class="form-group">' +
... | true |
b7889aedd6fb2c5b6416d7d0df87e9824b7aeb1b | JavaScript | maksdk/reactjs_learning | /Js/pit/src/js/googleMap.js | UTF-8 | 2,407 | 2.65625 | 3 | [] | no_license | function initMap(){
var kyiv,
map,
marker,
marker_url = '../img/map/icon-location.png';
initialize();
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(positionReceived,positionNotReceived);
}
function ZoomControl(controlDiv, map) {
controlDiv.style.padding = '10px';
var zoomIn = d... | true |
e71be3b58ede8bdd90a1f99227a2bc38807fae51 | JavaScript | l-ChengYou-l/gpst-js-basic-collection-practice | /main/section-3/practice-4.js | UTF-8 | 1,039 | 3.0625 | 3 | [] | no_license | 'use strict';
module.exports = function createUpdatedCollection(collectionA, objectB) {
let collectionC = calculateAmount(collectionA)
return selectCommon(collectionC,objectB)
}
function calculateAmount(collection){
let result = []
let value = []
collection.map(ele => {
if(ele.match('-')){
... | true |
771fdff71010d42cc90e0d61c902555453d1a6ae | JavaScript | spencerlazzar/data-structures-and-algorithms | /javascript/repeatedWord/repeatedWord.js | UTF-8 | 381 | 3.28125 | 3 | [
"MIT"
] | permissive | const Hashtable = require('./hastTable');
module.exports = (string) => {
let wordArray = string.toLowerCase().split(/[\W]+/g);
const wordHash = new Hashtable(wordArray.length);
for (let word of wordArray) {
if (wordHash.contains(word)) {
return word;
}
else {
wordHash.add(word, word);
... | true |
471524b980dea93114dd4fee1d36ec7fdf5f27cf | JavaScript | rdf-esm/data-model | /test/literal.cjs | UTF-8 | 5,708 | 3.125 | 3 | [
"MIT"
] | permissive | const assert = require('assert')
const { describe, it } = require('mocha')
function runTests (DataFactory) {
describe('.literal', function () {
it('should be a static method', function () {
assert.strictEqual(typeof DataFactory.literal, 'function')
})
it('should create an object with a termType pr... | true |
b1284513142db7074395bbaef375acc8feac0569 | JavaScript | Saifsamirk/store-web-app | /src/components/Login.js | UTF-8 | 2,483 | 2.578125 | 3 | [] | no_license | import React, { Component } from "react";
import axios from 'axios'
export default class Login extends React.Component {
constructor(props) {
super(props)
this.state = {
email: "",
password: ""
}
this.handleEmailChange = this.handleEmailChange.bind(this);
... | true |
0301b61bf447bdbe248660cf10b478316161f689 | JavaScript | ammarsaeed-beejo/assignment10 | /largest/main.js | UTF-8 | 276 | 3.28125 | 3 | [] | no_license |
let number = [5, 8, 6, 74, -6, 95, -59, 55, 77, -30, 0, 3, 6, 54, -3, 98, -69, 95, 606, -80];
let thelargest = 0;
for (let a = 0; a < number.length; a++) {
if (thelargest < number[a]) {
thelargest = number[a];
}
}
alert("The largest number" + thelargest); | true |
3450459e0fd7eea5f2825f34e612f8c71bad80f9 | JavaScript | nanhosen/fuelStatusClient | /src/reducers/placeSelect_reducer.js | UTF-8 | 302 | 2.515625 | 3 | [] | no_license | import {
SELECT
} from '../actions/types'
const intitialState = { selected: null }
export default function(state = intitialState, action) {
switch(action.type) {
case SELECT:
console.log('selected:', action.selected)
return action.selected
default:
return state
}
}
| true |
d4fcde8703050faaee1d42ff3691f18f5e0ab117 | JavaScript | brickgao/WhoWakeUp | /models/getdate.js | UTF-8 | 350 | 3.078125 | 3 | [
"MIT"
] | permissive | var date = new Date();
function getdate() {
}
module.exports = getdate;
getdate.prototype.get = function get(day, month, callback) {
var now = new Date();
var check = {
day: now.getDate(),
month: now.getMonth()
}
if(day === now.getDate() && month === now.getMonth())
return callback(true);
else
... | true |
9d4a88cbb8238106ec0f657b11c0bf3235c239a8 | JavaScript | kervcode/Full-Stack-App | /api/routes.js | UTF-8 | 6,141 | 2.625 | 3 | [] | no_license | "use strict";
const express = require("express");
const { sequelize, User, Course } = require("./models");
const bcryptjs = require("bcryptjs");
const auth = require("basic-auth");
const router = express.Router();
// Adding async middleware
function asyncHandler(cb) {
return async (req, res, next) => {
try {
... | true |
da42a323189ffd70ed53fb12fb0a57b9bc62007e | JavaScript | LeanSeverino1022/Code-Playground | /Javascript/object-oriented JS/TH/playlist_proj/app.js | UTF-8 | 874 | 2.921875 | 3 | [] | no_license | var playlist = new Playlist();
var Buloy = new Song("Buloy", "Parokya", "3:00");
var Buloy2 = new Song("Buloy2", "Parokya2", "3:00");
var Movie_1 = new Movie("Movie 1", 2019, "2 hrs");
playlist.add(Buloy);
playlist.add(Buloy2);
playlist.add(Movie_1);
var playlistElement = document.getElementById('playlist');
play... | true |
a2855e943db9b8efe7cd7312f456365a23f2f402 | JavaScript | CodeJugalbandi/Paradigms | /session/marsrover_after_apl_realization.js | UTF-8 | 822 | 3.28125 | 3 | [] | no_license | function MarsRover(x, y, dirString) {
const directions = ['N', 'E', 'S', 'W'];
let dirIdx = Math.max(0, directions.indexOf(dirString));
let point = [x, y];
const movements = [[0,1], [1,0], [0,-1], [-1,0]];
const toIndex = directionValue => Math.abs(directionValue % 4)
const commands = {
'M': (point,... | true |
be238e4356b5e16ab0d7c701253c937eade039eb | JavaScript | anujmailbox/learn-reactive-programming-with-rxjs | /6-dnd/main.js | UTF-8 | 732 | 2.734375 | 3 | [
"BSD-2-Clause"
] | permissive | import Rx from 'rxjs/Rx';
const box = document.querySelector('#main');
const mouseDown = Rx.Observable.fromEvent(box, 'mousedown');
const mouseUp = Rx.Observable.fromEvent(box, 'mouseup');
const mouseMove = Rx.Observable.fromEvent(document, 'mousemove');
// 1) mouseDown, cursor offset from box
// 2) mouseMove, curso... | true |
b0e65166fd6f9064bffc055ce636d4b582d65d3c | JavaScript | somar07/Santander-Coders | /escada.js | UTF-8 | 153 | 2.71875 | 3 | [] | no_license | function escada(altura){
var arvore = [];
for(var i = 1; i <= altura; i++){
arvore.push(' '.repeat(altura-i)+'#'.repeat(i));
}
return arvore;
}
| true |
647359c82e8689167e2daee7b7d9767bfa129539 | JavaScript | HassanDevetron/BitVelocityAssignment | /http/getBTC.js | UTF-8 | 383 | 2.546875 | 3 | [] | no_license | const axios = require('axios');
const fs = require('fs');
module.exports.getBTC = async() => {
return await axios.get('https://api.binance.com/api/v3/avgPrice?symbol=BTCUSDT')
.then((response) => {
const writeStream = fs.createWriteStream('price.txt')
writeStream.write(response.data.price);
... | true |
561fd2d3a85b14e63fea7474441858c0a0630140 | JavaScript | DreamLab/cmp | /src/lib/helpers.js | UTF-8 | 540 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | export function fetch(url) {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.onload = () => {
if (xhr.readyState === xhr.DONE) {
if (xhr.status === 404) {
reject(new TypeError('Not found'));
}
}
resolve({
json: () => JSON.parse(xhr.responseText)
});
};... | true |
c0dc717c967c7ba2035051991a9766faa068260d | JavaScript | Weipengzhou/build-your-own-react | /.history/index_20201225185034.js | UTF-8 | 444 | 3.125 | 3 | [] | no_license | const helloWord = React.createElement('div', null, 'Hello World');
ReactDOM.render(helloWord, document.getElementById('root'));
function createElement(parentEle, props, childEle) {
let parentElement = document.createElement(parentEle);
parentElement.innerHTML = childEle;
return parentElement;
}
function render... | true |
f0eef25ec7b4e167e9c7aad51d10acdc5591d1f8 | JavaScript | okv/nevermind | /static/js/app/routes/router.js | UTF-8 | 2,371 | 2.640625 | 3 | [] | no_license | 'use strict';
/**
* Extends default backbone router
*/
define(['backbone', 'underscore'], function(backbone, _) {
var Router = {};
Router.initialize = function() {
this.routes = {};
};
var superRoute = backbone.Router.prototype.route;
Router.route = function(params, callback) {
params = params || {};
v... | true |
213e5dddc9ef4b3109424698d5fba20b55bbd3b9 | JavaScript | jmneutel/Giphy-API | /logic.js | UTF-8 | 3,028 | 3.328125 | 3 | [] | no_license | var nbaGifs = ["Kobe Bryant", "Lebron James", "Michael Jordan", "Kevin Durant"];
// Function for displaying gifs
function renderButtons() {
// Deleting the buttons prior to adding new button to avoid repeats
$("#buttons-view").empty();
// Looping through the array of terms
for (var i = 0; i < nbaGif... | true |
c3d9e292bbd40acecd6b05863ba5170512ddca38 | JavaScript | calebnance/web-starter-nse | /src/js/requireJS/modules/shared/prevent-default.js | UTF-8 | 460 | 3 | 3 | [
"MIT"
] | permissive | define([], function(){
// console.log('loaded :: js/modules/shared/prevent-default.js');
// click :: prevent default click on href that starts with a hash
// grab all hashs
var hashs = document.querySelectorAll('a[href^="#"]');
// loop through hashs
for(var i=0; i < hashs.length; i++) {
// add event ... | true |
5d7f733cab037daa8effcccff42953356163390a | JavaScript | wormyrocks/SafariSearchFocuser | /SearchFocuser Extension/script.js | UTF-8 | 593 | 2.71875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | document.addEventListener("DOMContentLoaded", function (event) {
function get_selection_url() {
sel = document.getSelection()
if (sel == null || sel.isCollapsed)
return
var fn = sel.focusNode
if (fn != null) {
var parentel = fn.parentElement
while ... | true |
54362b0c86d96900a3c8918ffd9b1a07781e68b5 | JavaScript | RickyRomero/shutup-extension-i18n | /tools/remove-descriptions.js | UTF-8 | 1,007 | 2.84375 | 3 | [
"MIT"
] | permissive | /*
* Removes descriptions to create smaller translation files for the end product.
*/
const fs = require('fs')
try {
fs.mkdirSync('../generated')
} catch (e) {}
recurse('../data')
function recurse (into) {
let contents = fs.readdirSync(into)
contents.forEach(item => {
let fullPath = into + '/' + item... | true |
d7f1c84acbf7189ee6df5cb22fc081a41eba8234 | JavaScript | JiWeiZ/FEMap | /codes/算法和数据结构/Sort/insertSort.js | UTF-8 | 332 | 3.65625 | 4 | [
"MIT"
] | permissive | var arr = [6, 7, 0, 4, 1, 5, 3, 2]
function insertSort(arr) {
var len = arr.length, j, current
for (var i = 1; i < len; i++) {
j = i
current = arr[i]
while (j > 0 && arr[j - 1] > current) {
arr[j] = arr[j - 1]
j--
}
if (j !== i) arr[j] = current
}
return arr
}
console.log(inser... | true |
36237fc607736145fcb71c58f775a75198af98f3 | JavaScript | jbro885/react-websql | /easy/js/id.js | UTF-8 | 6,351 | 2.75 | 3 | [] | no_license | /**
* Created by sora on 2017/8/23.
*/
//身份证校验
var checkIdcard = function(idcard) {
//var Errors=new Array("验证通过!","身份证号码位数不对!","身份证号码出生日期超出范围或含有非法字符!","身份证号码校验错误!","身份证地区非法!");
var Errors = new Array(true, false, false,false, false),
area = { 11: "北京", 12: "天津", 13: "河北", 14: "山西", 15: "内蒙古", 21: "辽宁... | true |
5b0ba9ba91ceec96d3dfa94159518f1eada4f8cc | JavaScript | a-rmz/pokebot | /src/controllers/recast.js | UTF-8 | 616 | 2.59375 | 3 | [
"MIT"
] | permissive |
const Recastai = require('recastai').request;
class RecastController {
constructor(token) {
this.client = new Recastai(token, 'es');
}
/**
* Process the messages coming from the NLP processor and return recasth
* the generic format
*
* @param {string} message: A message array coming from t... | true |
e655d4cd5b495d8876a3ce096e7c61e565e932ce | JavaScript | SyedMudassir/Bulb-Toggle | /src/App.js | UTF-8 | 413 | 2.53125 | 3 | [] | no_license | import {useState} from 'react';
import './App.css';
function App() {
const [bulbOnOff,setBulbOnOff] = useState(false)
return (
<div className="App">
{bulbOnOff?<img src='images/bulb-off.png' alt='bulb on'/>:<img src='images/bulb-on.png' alt='bulb off' />}
<br/>
<button onClick={()=>setBulbOnOff(!bu... | true |
fb27c3712c09173d585c2cb8959c1192fe7e6fa2 | JavaScript | arion/ai_learning | /flappy_bird/game.js | UTF-8 | 1,584 | 2.890625 | 3 | [] | no_license | (function () {
const Bird = class {
constructor(props) {
const initProps = {
x: 80,
y: 250,
width: 40,
height: 30,
alive: true,
gravity: 0,
velocity: 0.3,
jump: -6,
}
Object.assign(this, initProps)
Object.assign(this, props)... | true |
34ffa9ea5aba1d41b3e2c1c08b6fa5dc4508bc4e | JavaScript | ganorberg/algorithms-javascript | /math/project-euler/46.goldbachs-other-conjecture.js | UTF-8 | 3,127 | 4.5 | 4 | [
"MIT"
] | permissive | /*
It was proposed by Christian Goldbach that every odd
composite number can be written as the sum of a prime
and twice a square.
9 = 7 + 2×1^2
15 = 7 + 2×2^2
21 = 3 + 2×3^2
25 = 7 + 2×3^2
27 = 19 + 2×2^2
33 = 31 + 2×1^2
It turns out that the conjecture was false.
What is the smallest odd composite that cannot be ... | true |
63aedb24af1309dde19dcfae26c9f1cb98375372 | JavaScript | Schnilz/paperui-ng | /js/tutorial/util.js | UTF-8 | 3,445 | 3.0625 | 3 | [
"MIT"
] | permissive |
/**
*
* @category Tutorial
* @memberof module:tutorial.Tools
* @description
*
* Check if the current page corresponds to the given one.
* If not, change to that page by using the navigation headerbar link.
*
* @param {String} page The target page
* @returns Returns a promise that either resolves immediate... | true |
4a5e66fc606dcf8e2b84c42228f57e8df30eb4bf | JavaScript | bquangDinh/Guessing-Keyboard-Game | /Assets/Js/scoreboard.js | UTF-8 | 1,263 | 2.609375 | 3 | [] | no_license | const ScoreBoard = function(_rememberedKeysDOM, _missedKeysDOM){
var rememberedKeysDOM = _rememberedKeysDOM;
var missedKeysDOM = _missedKeysDOM;
var currentRememberedKeys = 0;
var currentMissedKeys = 0;
return {
Initialize: function(){
$(rememberedKeysDOM).text(currentRemembere... | true |
64645e55acb94435afe4e3a80b1a8af77cc96ca8 | JavaScript | Aniruddha-Tapas/GitCheck | /app.js | UTF-8 | 6,840 | 2.65625 | 3 | [] | no_license | const express = require('express');
const app = express();
// ******* GitHub API Requirements *******//
var request = require('request');
var path = require('path');
var githubHeaders = { 'User-Agent': 'request' };
const { spawnSync } = require('child_process');
// ******* Command Line Requirement *******//
var cmd = r... | true |
cea5f9364247b4b636f334b5f8b9ef6c516ae4fe | JavaScript | Brianturner3/Katas | /FindTheMIssingLetter/findMissingLetter.js | UTF-8 | 497 | 3.546875 | 4 | [] | no_license | function findMissingLetter(array)
{
let alphabet = 'abcdefghijklmnopqrstuvwxyz';
if(array[0] != array[0].toUpperCase()){
alphabet = alphabet.toUpperCase();
}
let start = alphabet.indexOf(array[0]);
let end = alphabet.indexOf(array[array.length-1]);
return diff = alphabet.substring(start,end+1).split('... | true |
30aad8fc8c1da13151ffb21fe01b010dbe1ee46e | JavaScript | haleyamandamiller/FinalProjectsAccumulator | /main.js | UTF-8 | 636 | 2.546875 | 3 | [] | no_license | $(document).ready(function() {
$('#submitBtn').on('click', function(){
$('#searchResults').empty();
let searchText = $('#searchBox').val();
let $query = $('textarea').keyup(function() {
var maxLength = $(this).attr('maxlength');
var length = $(this).val().length;
var length = maxLength-len... | true |
e9b3402259365c5f8e31f70af954e13fb03c6ef4 | JavaScript | marduke182/new-relic | /src/components/__tests__/host.js | UTF-8 | 978 | 2.875 | 3 | [] | no_license | import hostComponent from '../host';
const createApp = (apdex) => ({ name: `App${apdex}`, apdex: apdex, version: 1, contributors: [], host: [] })
const host1 = { name: '12345.host1.com' };
function createIntArray(start, end) {
const newArray = [];
while (start < end) {
newArray.push(start++);
}
return ... | true |
1b13160878760eb6ddfcf36725996c1fbf78f81b | JavaScript | TomislavIvanov/Bulls-Cows | /src/client/scripts/computer.guesses.logic.js | UTF-8 | 2,277 | 4.125 | 4 | [] | no_license |
/**
* Create new game - computer guesses player number
*/
function ComputerGuessesNumberGame() {
this.numbersSet = [];
this.currentNumber = undefined;;
}
/**
* Set new random number as computer choice
*/
ComputerGuessesNumberGame.prototype.start = function () {
var numbers = [];
var generatedNumb... | true |
546055fd0bd3a29526fc9753b0cd7f750d293670 | JavaScript | ulkoenig/node-client | /public/scripts/main.js | UTF-8 | 1,877 | 2.859375 | 3 | [] | no_license | const ssourl = document.querySelector('#ssourl');
const realm = document.querySelector('#realm');
const client = document.querySelector('#client');
const redirect = document.querySelector('#redirect');
const submitSetting = document.querySelector('#submitsetting');
const form = document.querySelector('form');
const log... | true |
820ad8de0d85f94330641b908935b4ff396b7de2 | JavaScript | qotsafan1/computer-graphics | /Worksheet 6/part2.js | UTF-8 | 5,250 | 2.640625 | 3 | [] | no_license | var gl;
var canvas;
var vBuffer;
var vertices = [
vec4(-4.0, -1.0, -1.0, 1.0),
vec4(4.0, -1.0, -1.0, 1.0),
vec4(4.0, -1.0, -21.0, 1.0),
vec4(-4.0, -1.0, -21.0, 1.0)
]
var size = 64;
var rows = 8;
var columns = 8;
var eye = vec3(0.0, 0.0, 0.0);
var at = vec3(0.0, 0.0, 0.0);
var up = vec3(0.0, 1.0, 0.... | true |
09753237f227899cc6eb4fb6cb6e16b061ba510a | JavaScript | BozPolinn/FD2-93-21 | /lesson1/dopDZoptimized.js | UTF-8 | 1,325 | 3.71875 | 4 | [] | no_license | // объявляем переменную
var user;
// запрашиваем строку у пользователя
do {
user = prompt('Введите строку', 'Ваша строка');
}
while (user === '' || user.trim() === '');
function cutEmpty(param) {
// определение длины строки и сохранение значения в переменную
var length = param.length;
... | true |
07f4b8ae1e02979a8fc8d37967d874a8574c04b2 | JavaScript | Kdub91712/javascript_cheatsheet | /src/App.js | UTF-8 | 11,214 | 3.65625 | 4 | [] | no_license | import React, {Component} from 'react';
import './App.css';
let parseString = (value) => {
return value.substring(1);
}
let reverseString = (value) => {
let stringArray = value.split("");
console.log(stringArray);
return stringArray.reverse().join("");
}
let findMostFrequentCharacter = (value) => {
le... | true |
d953e80e8b954bc37d6394986497e1bfd5309594 | JavaScript | hernanraso/hardreparaciones | /form.js | UTF-8 | 1,658 | 3.375 | 3 | [] | no_license | var inputs = document.getElementsByClassName('formulario_input');
for (var i = 0; i < inputs.length; i++) {
inputs[i].addEventListener('keyup', function(){
if(this.value.length >=1) {
this.nextElementSibling.classList.add('fijar');
} else {
this.nextElementSibl... | true |
00954fd91faaa5deba522238d5b60561283edb91 | JavaScript | itb-bhati/s1-akashjuneja | /Question 5/Example 1/index.js | UTF-8 | 193 | 3.359375 | 3 | [] | no_license | let f = (...a) => {
let x = 0;
for (let i = 0; i < a.length; i++) // length property of a.
x += a[i];
return x;
}
console.log(f(1, 2, 3, 4, 5, 6, 7, 8)); // Outputs 36
| true |
5c9c3da0eac2c646740e8b061a74146a4a2a18eb | JavaScript | brigada-mx/web | /src/tools/pluralize.js | UTF-8 | 1,405 | 3.21875 | 3 | [] | no_license | /* eslint-disable */
// https:// github.com/swestrich/pluralize-es
const pluralize = (str: string): string => {
if (!str) return ''
let plural
const last = str[str.length - 1] // Last letter of str
const lastTwo = str.slice(-2)
const lastThree = str.slice(-3)
if (last === 'x' || last === 's') {
plura... | true |
78d42c4e87891f5761c51bb091113640e7c020c3 | JavaScript | chafikamr/ajax-cat-facts-generator | /js/main.js | UTF-8 | 1,063 | 2.546875 | 3 | [] | no_license | // this code must be used with jquery
//ajax simple request using post method
$(function() {
$('#do').click(function() {
$.ajax({
cache: false,
method: 'GET',
url: 'https://catfact.ninja/fact',
beforeSend: function() {
$('body').css('overflo... | true |
97c6115b7835ed167544a06854478af87d3dda34 | JavaScript | MingZheng27/MyBlog | /WebRoot/dist/js/catlog.js | GB18030 | 919 | 2.5625 | 3 | [] | no_license | $(function(){
var num = 0;
//jsڲʲҪڲͨjqueryonclick
var next = function next(){
num = num + 1;
load(num);
};
var previous = function previous(){
if (num >= 1){
num = num - 1;
load(num);
}else{
load(0);
}
};
$('#previous').attr('onclick','').click(previous);
$('#next').attr('onclick','').click... | true |
cdcc1eb98e69b8d13539de6936cb9f4f179789da | JavaScript | orisailes/Appleseeds-Bootcamp | /javascript/test/index3.js | UTF-8 | 419 | 3.484375 | 3 | [] | no_license | function digital_root(n) {
n = n.toString().split('');
let helper = [];
let result = 0;
while (n.length !== 1) {
for (let i = 0; i < n.length; i++) {
result = result + Number(n[i]);
console.log(result)
}
helper.push(result)
n = helper.toString().sp... | true |
1bc52d7a522de2afec89404fc6775fc2a5a6b5f8 | JavaScript | hoangkhanh7030/storyflower | /src/main/resources/static/js/review.js | UTF-8 | 1,325 | 2.625 | 3 | [] | no_license | $(document).ready(
function () {
$('#add-review-button').click(function () {
postReview();
})
}
)
var listsize = $('#list-size').text();
var index = 0;
function postReview() {
$.ajax({
type: "POST",
url: "/api/review/" + getProductId(),
data: {
... | true |
09c19e81972cf2804c45b4e56f25995e1aa734b2 | JavaScript | tylerbodway/30-days-of-code | /10 – Binary Numbers/solution.js | UTF-8 | 581 | 3.671875 | 4 | [] | no_license | function main() {
const n = parseInt(readLine(), 10)
const binaryArr = [...n.toString(2)]
let currentCount = 0
let consecutiveOnes = 0
for(let i = 0; i <= binaryArr.length; i++) {
// if it's a 1, increment the count, otherwise reset it
if (binaryArr[i] === '1') {
curren... | true |
96f795748eac90fbb3d93c02b243749cf40ce64f | JavaScript | athanclark/purescript-pty | /src/System/Pty.js | UTF-8 | 539 | 2.515625 | 3 | [] | no_license | "use strict";
var pty = require('node-pty');
exports.spawnImpl = function spawnImpl (shell, args, params) {
return pty.spawn(shell, args, params);
};
exports.writeImpl = function writeImpl (process, x) {
process.write(x);
};
exports.onDataImpl = function onDataImpl (process, f) {
process.on('data', function o... | true |
987e31f981025ec2a4f9651fbe470592851af14a | JavaScript | seekwhencer/gamepad-browser-mqtt | /src/module/Gamepad/button.js | UTF-8 | 886 | 2.921875 | 3 | [] | no_license | import {EventEmitter} from 'events';
export default class {
constructor(name, controller, buttonNumber) {
this.event = new EventEmitter();
this.name = name;
this.number = buttonNumber;
this.controller = controller;
this.value = false;
this.mapValue();
this.... | true |
289ef8b8ac1abdc367f7d812340a525ea541f01a | JavaScript | octoccoper/trainingTasks | /chainAddingFunction.js | UTF-8 | 212 | 2.9375 | 3 | [] | no_license | function add(n){
var total = n;
function addingFunction(m) {
total += m;
return addingFunction;
}
addingFunction.toString = function() {
return total;
};
return addingFunction;
}
| true |
ef8582c10d9ed1eb05168d79619fdaaf0c7fdd50 | JavaScript | chryskrause/bu19 | /assignments/FSW-105/Week-7/ConsoleRPG/consoleRPG.js | UTF-8 | 3,499 | 2.953125 | 3 | [] | no_license | const readline = require('readline-sync');
const greeting = readline.question("Hello there! Welcome to Colossal Adventure! May I have your name?")
console.log("Hi, " + greeting + "!")
const action = readline.keyIn('We are ready to play. Press the letter w to walk forward and see what happens... ', {limit: 'w'});
fun... | true |
ee7606f6ee3c1e3f680ca40883e0f5b48e4fcb11 | JavaScript | Earle-Poole/fullstackopen | /part2/course-contents/src/courseinfo.js | UTF-8 | 1,766 | 3.34375 | 3 | [] | no_license | import React, {useState} from 'react';
import ReactDOM from 'react-dom';
const Header = (props) => {
return (
<>
<h1>{props.course}</h1>
</>
)
}
const Part = (props) => {
return (
<>
<p>
{props.part} {props.exercise}
</p>
</>
)
}
const Content = (props) => {
consol... | true |
3dc3b5820c5af3a1c7c56e8a7f074333a83dd7f7 | JavaScript | dan-mcm/react-course | /base-syntax--assignment-problem/src/App.js | UTF-8 | 848 | 2.734375 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import UserInput from './UserInput/UserInput';
import UserOutput from './UserOutput/UserOutput';
class App extends Component {
state = {
username: 'Bill'
}
changeUser = (event) => {
this.setState({
username: event.target.value
})
... | true |
1ec9aa69400e86143d10cd6bf2e8df6d7fd37ada | JavaScript | Yohansun/sun_web | /app/assets/javascripts/galleryC.js | UTF-8 | 4,482 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | function galleryC(config){
if( !( typeof config == 'object' && config != null && typeof config.images != 'undefined' && config.images instanceof Array && config.images.length ) ) {
return false;
}
var obj = {};
var defConfig = {
'wrapClass' : 'galleryC',
'imagePlayerClass' : 'big_image',
'timeSelectorClas... | true |
df066f2cadca5b39c54aa0471e3d1e14ab4c6ee8 | JavaScript | fobbytommy/Algorithm-Practice | /10_week_2/findVal.js | UTF-8 | 226 | 3.6875 | 4 | [] | no_license | var arr = [1, 'hello', 5, 'yo'];
function findVal(arr, val) {
for (var i = 0, j = arr.length; i < j; i++) {
if (arr[i] === val) {
return true;
}
}
return false;
}
var result = findVal(arr, 5);
console.log(result);
| true |
249893aac65d73ea13da10f087787208e4d13cd6 | JavaScript | geeeyeon/Algorithm | /프로그래머스/algo12924.js | UTF-8 | 467 | 4.0625 | 4 | [] | no_license | /**
* https://programmers.co.kr/learn/courses/30/lessons/12924
* 숫자의 표현
*/
function solution(n) {
let answer = 1;
for (let i = 1; i <= Math.ceil(n / 2); i++) {
let start = i;
let tmpSum = 0;
for (let j = start; j <= Math.ceil(n / 2); j++) {
tmpSum += j;
if (tmpSum === n) {
answ... | true |
ff55fbe4bb2ef9634c698b07b48710319f402f27 | JavaScript | rgardner/chintastic | /main.js | UTF-8 | 11,259 | 2.5625 | 3 | [
"MIT"
] | permissive | window.onload = function() {
StartBackground();
CameraInit();
};
var mediaConstraints = { video: true };
var index = 1;
var mediaRecorder;
var video;
var stream;
function CameraInit() {
navigator.getUserMedia(mediaConstraints, onMediaInit, onMediaError);
}
function startRecording() {
var videosContainer = do... | true |
753e99352f00e9a275f88a30c5c46021e748a3bc | JavaScript | gayathri3636/codingtest-amex | /src/index.js | UTF-8 | 1,085 | 2.859375 | 3 | [] | no_license | import React, {useState, Fragment} from 'react'
import ReactDOM from 'react-dom'
import Hello from './Hello'
function App() {
const [names, updateNames] = useState([])
const [currentName, updateCurrentName] = useState('')
const increment = () => {
updateNames([...names, currentName])
}
const decrement =... | true |
243d265b6176212940eee6c267688fdfb95a3e4a | JavaScript | esimms311/redux-1 | /src/redux/users.js | UTF-8 | 500 | 2.84375 | 3 | [] | no_license | const LOGIN_USER ='users/LOGIN_USER';
const initialState = {
user: ''
}
//reducer makes redux redux, it takes in a new state, takes the action and then returns it to the state
//it looks at the action
export default function reducer(state=initialState, action) {
switch(action.type) {
case LOGIN_USER:
re... | true |
57a38deb99c7f6291629f324364e5f38adddd2db | JavaScript | thangbk111/book_swapping | /public/js/profile.js | UTF-8 | 953 | 2.703125 | 3 | [
"MIT"
] | permissive | $('#change_avatar').click(function() {
$('input[name="change_avatar"]').click();
});
$('#change_cover').click(function() {
$('input[name="change_cover"]').click();
});
// show image to preview before upload
$(document).ready(function() {
function readURL(input, flag) {
if (input.files && input.fil... | true |
c0f14433435dce0fce097aefe3805d5441b3908e | JavaScript | classroom-angel/labs11_prop_mngmt-BE | /db/dataHelpers/index.js | UTF-8 | 1,134 | 2.703125 | 3 | [
"MIT"
] | permissive | /* GENERAL HELPERS */
const fs = require('fs');
const path = require('path');
const forEachFile = (dirname, pathway, callback) => {
fs.readdir(path.resolve(dirname, pathway), (err, files) => {
if (err) console.error(err);
files.forEach(callback);
});
};
const camelToSnakeCase = str =>
str.replace(/[A-Z]/... | true |
24fa31bbf038b7f31f1a550608d996804e901ee8 | JavaScript | jgladch/jgd3 | /src/bars.js | UTF-8 | 1,837 | 3.484375 | 3 | [] | no_license | var height = 200;
var width = 1000;
var name = ['partybook'];
var canvas = d3.select('body').append('svg')
.attr('class','canvas')
.attr('width', width)
.attr('height', height)
//D3 update function
var update = function(data) {
//Data join - select rectangles in the svg canvas
var rects = canvas.selectAll... | true |
410f3491387ff7fb1b818f50f0f550fe4a9e8d78 | JavaScript | kikuomax/ochimikan | /src/Difficulty.js | UTF-8 | 4,257 | 3.4375 | 3 | [
"MIT"
] | permissive | /**
* The interface which controls the difficulty of the game.
*
* The `Difficulty` will update the score of `statistics` when mikans are
* erased, and increment the level of `statistics` when a certain number of
* mikans are erased.
*
* Throws an exception if `statistics` is not a `Statistics`.
*
* @class Dif... | true |
17cb4279c9e0ba5b472a144d9fb3ff2e537387ab | JavaScript | chenEdgar/data-structures-and-algorithms-with-javascript | /dictionary/dictionary.js | UTF-8 | 1,126 | 3.859375 | 4 | [] | no_license | function Dictionary() {
this.datastore = []
this.add = add
this.remove = remove
this.showAll = showAll
this.count = count
this.clear = clear
}
function add(key, value) {
this.datastore[key] = value
}
function find(key) {
return this.datastore[key]
}
function remove(key) {
delete this.datastore[key]
}
... | true |
c487740a3fc0ca1fd4e7fae282a3fe9919c920bd | JavaScript | melvinwi/EDWCI | /staging/tests/test_build.js | UTF-8 | 7,610 | 2.515625 | 3 | [] | no_license | var logger = require('./lib/logger.js');
var should = require('should');
var fs = require('fs');
var db = require('./lib/db.js');
function test_build(artefactName, object, schema, design) // Constructor
{
// dbType
dbType = db.dbType();
// RUN TESTS
logger.info(artefactName, 'running BUILD tests');... | true |
63d84ec3e90ab1de66dc61821ae8875ccf07f9c8 | JavaScript | fccJashCoda/authrefresh | /client/src/components/NoteComponent.js | UTF-8 | 1,198 | 2.53125 | 3 | [] | no_license | import { useState } from 'react';
import ReactMarkdown from 'react-markdown';
import axios from 'axios';
function NoteComponent(props) {
const [showing, setShowing] = useState(true);
const note = props.note;
const deleteNote = async () => {
try {
const response = await axios.delete(`/api/v2/notes/${no... | true |
d9c894f3d8cd35a16de95e0f31b04e0d6213b4a8 | JavaScript | Deni189-ch/app_react_testov | /Social_react_app_testovoe/src/redux/profile-reducer-test.js | UTF-8 | 1,234 | 3.015625 | 3 | [] | no_license | import profileReducer, {addPostActionCreator, deletePost} from "./profile-reducer";
let state = {
posts: [
{id: 1, message: 'Hi, how are you?', likesCount: 12},
{id: 2, message: 'It\'s my first post', likesCount: 11},
{id: 3, message: 'Blabla', likesCount: 11},
{id: 4, message: 'Dad... | true |
9b549507050abdeafd7db5433b305d8954d1d114 | JavaScript | t33ll3n/PublicTransportSystem | /routes/predlog_popravkov_linija.js | UTF-8 | 2,572 | 2.796875 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const connection = require('../mysqlConnection');
//Read
router.get('/:id', (req, res) => {
let popravek_id = req.params.id;
let sql = 'SELECT * FROM predlogi_popravkov_linija WHERE popravek_id = ' + popravek_id;
connection.query(sql, (err, rows... | true |
4918da5f10808428a168826dfb7692a47f868bfe | JavaScript | viknedus/netflix-clone-2 | /src/api.js | UTF-8 | 6,751 | 3 | 3 | [] | no_license | import axios from "axios";
// axios가 가지고 있는 create()함수를 이용해서 함수 내부에 객체형태로 axios의 초기설정을 해줄 수 있다.
// baseURL에는 API를 요청하는 기본 URL을, params에는 URL에 들어가는 api_key와 language에 대한 정보를 객체형태로 적어준다.
// params 객체 안에 입력한 값들은 baseURL의 URL주소 뒤에 붙어서 들어간다.
// (ex: https://api.themoviedb.org/3/tv/popular?api_key=d20d691c4dcca268fa8e0c655d... | true |
c898dc0646e650a14dbdb683c1335718c8860b8e | JavaScript | audinue/monkey | /src/DOMMatrixReadOnly.js | UTF-8 | 290 | 2.59375 | 3 | [] | no_license |
DOMMatrixReadOnly.prototype.transformPoints = function (points) {
return points.map(function (point) {
this.transformPoint(point)
}, this)
}
DOMMatrixReadOnly.prototype.transformRect = function (rect) {
return DOMRectReadOnly.fromPoints(this.transformPoints(rect.toPoints()))
}
| true |
4e4fc1d6720eae946dac5b39d1baaa394abe3def | JavaScript | nsisodiya/Demo-Scalable-App | /choona.js/choona.js | UTF-8 | 7,099 | 2.6875 | 3 | [
"MIT"
] | permissive | /* choona.js 1.3
(c) 2011-2013 Narendra Sisodiya, narendra@narendrasisodiya.com
choona.js is distributed under the MIT license.
For all details and documentation:
https://github.com/nsisodiya/choona.js
For demos using Choona.js
http://nsisodiya.github.com/Demo-Scalable-App... | true |
55f85702e92269a63bae081a778cb2f457e43064 | JavaScript | tnishida-class/p5works-24-cat | /practice/practice2-2.js | UTF-8 | 340 | 3.296875 | 3 | [] | no_license | function setup(){
createCanvas(400, 400);
kobeCity(50, 50, 40);
}
function kobeCity(x, y, wh){ // whはw と hの意味
push();
noFill();
strokeWeight(wh * 0.5);
ellipseMode(RADIUS);
strokeCap(SQUARE);
arc(x, y, wh, wh, PI + PI / 4, PI / 4 + TWO_PI);
arc(x + wh * 1.25, y, wh, wh, PI * 3 / 4, PI * 3 / 4 + PI);
... | true |
e00a64799033610ba6bea3a27a95bba968178632 | JavaScript | SenpaiDesu/todo-with-auth | /services/auth.service.js | UTF-8 | 1,849 | 2.546875 | 3 | [] | no_license | const jwt = require('jsonwebtoken');
const UserModel = require('../user-module/user.model');
const { JWT_SECRET_KEY } = require('../config');
const loginWithEmailAndPassword = async (req, res) => {
try {
const { email, password } = req.body;
if (!email || !password)
return res.status(401).json({ messag... | true |
5c960ad29689e5b4dcc6b0e9cfc188f6490f38e8 | JavaScript | JackieYe27/javascript-algorithms-practice | /defang-ip-address.js | UTF-8 | 999 | 4.40625 | 4 | [] | no_license | // Given a valid (IPv4) IP address, return a defanged version of that IP address.
// A defanged IP address replaces every period "." with "[.]".
// Example 1:
// Input: address = "1.1.1.1"
// Output: "1[.]1[.]1[.]1"
// Example 2:
// Input: address = "255.100.50.0"
// Output: "255[.]100[.]50[.]0"
// takes in a strin... | true |
dccf61277f17420518950b906242f28043bfbf06 | JavaScript | tiagocouto17/ESMAD_PW1_2021 | /F03EX01/vueInstance.js | UTF-8 | 896 | 2.9375 | 3 | [] | no_license | const vm = new Vue({
el: '#app',
data: {
person: {firstName: 'Rui', lastName: 'Silva', age: 23}
},
methods: {
dataPerson() {
console.log(`METHOD--> NOME: ${this.person.firstName} e IDADE: ${this.person.age}`);
}
},
computed: {
dataPersonComputed() {
... | true |
0cd973dd87f556821fa8ccd5f9add91c3a1e1057 | JavaScript | ycllz/skynet-sproto-js | /assets/test-skynet-sproto-js/Script/NetWebSocket.js | UTF-8 | 6,492 | 2.625 | 3 | [] | no_license | /**
* Created by Administrator on 2016/12/2.
*/
const PROTOCAL_CORE = require('PROTOCAL_CORE');
var WebSocket = WebSocket || window.WebSocket || window.MozWebSocket;
//arraybuff 转化成 string
function Utf8ArrayToStr(array) {
var out, i, len, c;
var char2, char3,char4;
out = "";
len = array.length;
... | true |
4ce05310ddec58dba7cfdfc9f99d8e9c08ab5e29 | JavaScript | jrskerritt/gatsby-v2-test | /src/api/WordPressAPI.js | UTF-8 | 1,063 | 2.59375 | 3 | [
"MIT"
] | permissive | import axios from 'axios';
function getBlogPostInfo(blogCategory, url, maxCards) {
const cards = [];
return axios
.get(url)
.then(response => response.data)
.then(data => {
const promises = [];
for (let i = 0; i < maxCards; i++) {
const card = {};
const wpContent = data... | true |
f462bb4af26a2b75203e9f07581295591c1ad7f2 | JavaScript | sdk-group/iris-application-core | /src/classes/access-objects/History.js | UTF-8 | 716 | 2.5625 | 3 | [] | no_license | 'use strict';
let store = [];
class History {
constructor() {
this.on = true;
}
warn(args) {
let message = args.join(' ');
let type = 'warn';
return this.addHistoryRecord(type, message);
}
error(args) {
let message = args.join(' ');
let type = 'error';
return this.addHistoryRecord(type, message);
... | true |
731e1f0332ac7373a9a71f9a456a603d4adb5802 | JavaScript | iulianSta/country-info-API | /src/components/Country.js | UTF-8 | 823 | 2.796875 | 3 | [] | no_license | // Import React from "react"
import React from "react";
// Country function
const Country = ({ results }) => {
const lands = results.map((obj, i) => {
console.log(obj);
const {
name,
nativeName,
flag,
capital,
population,
alpha2Code,
area,
region,
subregi... | true |
0c33dcb38b42bb42062d9b994045c83636b5a868 | JavaScript | Bay1227/071921-Phase2-Practice-Challenge-Sushi | /src/components/App.js | UTF-8 | 1,610 | 3.359375 | 3 | [] | no_license | // we can use sushi.slice(0, 4) for displaying 4 sushi at time
// setEaten is for removing the sushi from plate
// also we can do eaten ? '' instead of null
// <Table plates ={sushis.filter(sushi => sushi.eaten) } /> bring a table to empty plates after we eat the sushi
// !peice.eaten is helping if we click the alre... | true |
eba3365b6c1c2d3e967841f35ab4ee92376ddef3 | JavaScript | gilbertVirgo/snake | /backend/body.js | UTF-8 | 608 | 3.28125 | 3 | [] | no_license | function Body({color, x, y, width, height, weight}) {
this.color = color;
this.x = x;
this.y = y;
this.dx = x + width;
this.dy = y + height;
this.width = width;
this.height = height;
this.weight = weight;
this.intersects = function(body) {
const x = (
(this.dx > ... | true |
87398c8006f8b5873554a48fcb46746afab7fe3e | JavaScript | Iwark/epubPostSumple | /http_test.js | UTF-8 | 439 | 2.78125 | 3 | [] | no_license | var http_test = {};
(function(){
"use strict";
var req = new XMLHttpRequest();
http_test.request = function(path,method){
alert("??");
var url = "http://localhost:3000/" + path + ".json";
alert(url);
req.onreadystatechange = function(){
//通信が完了したら、受信したテキストを表示
if(req.readyState == 4){
alert(req.re... | true |
7d98e36beb43428581b2a432cd41bc5e595411ca | JavaScript | dyangua/redux-todo | /src/actions/index.js | UTF-8 | 916 | 2.546875 | 3 | [] | no_license | import axios from "axios";
export const FETCH_MOVIES_BEGIN = "FETCH_MOVIES_BEGIN";
export const FETCH_MOVIES_SUCCESS = "FETCH_MOVIES_SUCCESS";
export const FETCH_MOVIES_FAILURE = "FETCH_MOVIES_FAILURE";
export const addMovie = movie => ({
type: "ADD_MOVIE",
id: movie.id,
title: movie.title,
description: movie... | true |
d727b3b4214ad1c8f37d395f29fb95c0b40cd0c0 | JavaScript | FateOce/JavaScript-Basics | /Functions/index.js | UTF-8 | 165 | 3.1875 | 3 | [] | no_license | function sayHello(myName, myAge){
console.log("Hello",myName);
console.log("You are",myAge,"years old")
};
var myName = "Christine";
sayHello("Christine Dee",30); | true |
883a963845b3ded644892f0d185992970a5ef617 | JavaScript | dlivingston866/homework-5 | /myscripts.js | UTF-8 | 654 | 2.78125 | 3 | [] | no_license | $(document).ready(function() {
function displayDate() {
document.getElementById("currentDay").innerHTML = moment().format("dddd, MMMM Do YYYY, h:mm A");
console.log(moment().format());
}
displayDate();
function getLocalStorage(key) {
let value = localStorage.getItem(key);
... | true |
c4c2adcd8a8ec48717a68509bc7d8c7bd30dfa42 | JavaScript | wwwK/vue.jsx | /samples/vue-sample.jsx | UTF-8 | 2,509 | 2.921875 | 3 | [
"LicenseRef-scancode-public-domain",
"Unlicense"
] | permissive | import "console.jsx";
import "vue.jsx";
class _Main {
static function main(argv : string[]) : void
{
Vue.directive('demo', {
bind: (context : VueContext) -> {
context.el.style.color = '#fff';
context.el.style.backgroundColor = context.arg as string;
... | true |
99f5cc5a15a6374a7d4ae5eaced7f17163841f6a | JavaScript | Gorbataras/IT-Connect | /js/login.js | UTF-8 | 877 | 2.71875 | 3 | [
"MIT"
] | permissive | /**
* The function that handles the submit from the login form
*/
// $("#login-button").on("click", function() {
//
// let email = $("#user-email").val();
// let password = $("#user-password").val();
// // if((username.length) === 0){
// // $('#email_err').show();
// // return;
// // }... | true |
857ef4f191f653e60bfa03edc2f09b8be8c9bbb1 | JavaScript | PixelGarage/xyFrontend | /store/user.js | UTF-8 | 2,125 | 2.75 | 3 | [] | no_license | //
// Defines the user module in the vuex store.
//
import { PxlApi, AuthenticationError } from '~/api/PxlApi.js'
export const state = () => ({
authenticating: false,
user: false,
authErrorCode: 0,
authErrorMessage: '',
});
export const getters = {
loggedIn: (state) => {
return state.user;
},
auth... | true |
1345c3904770f5999ee7eda2dd6cd2df719e5f51 | JavaScript | userJerald/ReactJS_TrainingAtCDI | /tut7.js | UTF-8 | 1,765 | 4.34375 | 4 | [] | no_license | let arr1 = [1, 2];
let arr2 = [3, 4];
// OR *arr1.push.apply(arr1, arr2);*
// the above METHODS make ARRAY ELEMENT be part of another ARRAY ELEMENT,
// but if you decided to specify the expression as *arr1.push(arr2);*, without ELIPSIS(...),
// this will make the ARRAY name arr2, which is an ARRAY OBJECT, be the... | true |
c55672d8c62ff62926d50c7c1b0a00ce859a461a | JavaScript | Avartos/rateyourstufffrontendwebapp | /src/components/mediaDetails/tabBar.jsx | UTF-8 | 2,709 | 2.578125 | 3 | [
"MIT"
] | permissive | import Tabs from "@material-ui/core/Tabs";
import Tab from "@material-ui/core/Tab";
import TabPanel from "./tabPanel";
import React, { useEffect, useState } from "react";
import RatingList from "./ratingsList";
import CommentList from "./commentList";
const TabBar = ({
ratingCount,
commentCount,
medium,
medium... | true |
e4eaa22758ede00f08ca7acd670d180e3ac73129 | JavaScript | Cretis/resources_management | /src/UI/Inpute/Input.js | UTF-8 | 1,642 | 2.5625 | 3 | [] | no_license | import React from "react";
import './Input.css'
const Input = (props)=>{
let inputElement = null;
const inputClasses = ['InputElement'];
const inputSpan=['hides'];
if(!props.valid&&props.touched){
inputClasses.pop();
inputClasses.push('invalid');
inputSpan.pop();
input... | true |
c4e4180c37e1771f770d57ce78c9b36f195d6956 | JavaScript | Mathilde-J/lu-architecturelogicielle-math | /Appliquer/Projet3/projet3.js | UTF-8 | 1,899 | 3.5625 | 4 | [] | no_license | //Model
class Model {//construction de la classe avec le constructeur
constructor(nom, mdp){
this.nom = nom;
this.mdp = mdp;
}
//functions qu'on va utiliser pour remplacer le mot de passe, retourner le mot de passe et le nom de la personne
RemplaceMDP(newMdp){
this.mdp ... | true |
b9510bcd60361b38ca5541bf534284b1942eb35f | JavaScript | arnekaulfuss/Project-Cars-DS-LiveApp | /assets/js/bestlap.js | UTF-8 | 2,434 | 2.546875 | 3 | [] | no_license | (function($){
var $template = $('#bst_row').html();
Mustache.parse($template);
$('#bst_row').remove();
var $trackInfo = $('#track_infos').html();
Mustache.parse($trackInfo);
$('#track_infos').remove();
$('#getBst').click(function(e){
e.preventDefault();
var $track;
... | true |
0ecfbb79a300a092d229d4395dd952ffe6c18be0 | JavaScript | helloword10086/disanzou | /webpack/test/src/index.js | UTF-8 | 60 | 2.671875 | 3 | [] | no_license | const a = 1,
b=2;
const c = a+b;
console.log(c); | true |
99cc9a656a27d43536e29195cc1ffe8b5f2c37a0 | JavaScript | Baatarvan/chatapp2 | /js/login.js | UTF-8 | 735 | 2.796875 | 3 | [] | no_license | document.querySelector(".signIn").onclick = () => {
let email = document.querySelector(".email").value;
let password = document.querySelector(".password").value;
firebase.auth().signInWithEmailAndPassword(email, password)
.then((userCredential) => {
// Signed in
var user = userCredentia... | true |
1d67b44f6dbf308b45e6b7c8a98c1354d69a443e | JavaScript | FabioRosado/100DaysOfCode | /Part I/day-82/the-odin-project-functions.js | UTF-8 | 851 | 5.09375 | 5 | [] | no_license | // Write a function called add7 that takes one number and returns that number + 7.
// Write a function called multiply that takes 2 numbers and returns their product.
// Write a function called capitalize that takes a string and returns that string with only the first letter capitalized. Make sure that it can take stri... | true |
ca7a309106534237299b07f88566dfb710355111 | JavaScript | lukaszkania/DeployOfSpaceTravels | /src/components/tourists/Tourists.js | UTF-8 | 3,035 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react'
import './Tourists.scss';
import axios from 'axios'
import { TOURISTS_API_URL } from '../../constants/API_URLS';
import NavBar from '../homepage/NavBar';
import { Link } from 'react-router-dom/cjs/react-router-dom';
class Tourists extends Component {
state = {
touri... | true |