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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f7df755ad180b8b3a6ebf9b9cda82ab2e14b0a57 | JavaScript | awaghadsangita/node | /test/TypescriptCommercialDataProcessingTestCases.js | UTF-8 | 5,066 | 2.90625 | 3 | [] | no_license | const assert= require('chai').assert;
const utility=require('../TypeScript/CommercialDataProcessing/Operationutility')
describe("test cases for buy operation of commercial data processing ",function(){
let obj=new utility.OperationUtility();
it("stock symbol should not be null",function(){
let tc1=obj.... | true |
6287e7d638f9516e58a3148f7a16a04fa988c0f9 | JavaScript | UdipRai0909/Java-Web-App-School-Management-System | /WebContent/resources/js/myscript.js | UTF-8 | 8,017 | 2.609375 | 3 | [] | no_license | function togglePassword() {
var newType = $element.prop('type') == 'password' ? 'text' : 'password';
$element.prop('type', newType);
}
// Change active navbar header color
let current_url = document.location;
document.querySelectorAll("ul.navbar-nav li.nav-item a.nav-link").forEach(function(e) {
if (e.href == curre... | true |
09209ce9d0a43d55027dcdd72bfb07d0ef2c451a | JavaScript | ghjhhyuyuy/F-final-quiz | /src/App/GroupList/GroupList.js | UTF-8 | 1,772 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import Team from '../Team/Team';
import './GroupList.css';
import request from '../request';
class GroupList extends Component {
constructor(props) {
super(props);
this.state = {
groups: [],
showGroup: true,
};
}
componentDidMount() {
request... | true |
5552464362ce27ff85f2a050bf8cc3644b988a0f | JavaScript | david2999999/Javascript-Algorithm | /Learning Javascript Data Structures and Algorithms PDF/Chapter 1 - Javascript - A Quick Overview/Basics/OOP/basics.js | UTF-8 | 1,505 | 4.4375 | 4 | [] | no_license | // Simple collections of name-value pairs
var obj = new Object();
var obj2 = {};
obj = {
name: {
first: 'Gandalf',
last: 'the Grey'
},
address: 'Middle Earth'
};
// To declare a JS object, [key, value] pairs are used, where the key can be considered
// an attribute of the object and the v... | true |
ecb0f3e67627847b6577bb031d5050ea3f4c01af | JavaScript | MidEverly/endlesspages | /js/profile.js | UTF-8 | 844 | 2.859375 | 3 | [] | no_license | var username = [];
username.push('EndlesslyMidnight');
console.log(username);
var bio = [];
bio.push('Welcome to EndlessPages!');
console.log(bio);
var email = [];
email.push('victoriquecrawford@gmail.com');
function enterInfo() {
for (i =0; i < username.length; i++) {
document.getElementById('user... | true |
ba0da91c650cc3557c7e2581282169644a8bb3a2 | JavaScript | reggieTheCoder/DOM-II | /js/index.js | UTF-8 | 2,240 | 3.359375 | 3 | [] | no_license | // Your code goes here
// references
const mouse = document.querySelector('.logo-heading');
const links = document.querySelectorAll('.nav-link');
const headerImg = document.querySelector('.intro img');
const containerHeader = document.querySelector('.intro h2');
const textHeaders = document.querySelectorAll('.text-c... | true |
2bbdb9ef22163bac039cd8eaf710391fe48aeaaa | JavaScript | theodore-faye/wordly | /config/orm.js | UTF-8 | 2,796 | 3.03125 | 3 | [] | no_license | var connection = require('./connection.js');
// print correct number of question marks for INSERT INTO
function printQuestionMarks(num) {
var values = [];
for (var i = 0; i < num; i++) {
values.push('?');
}
return values.toString();
}
// take object and change to SET syntax
function objToSql(object) {
var se... | true |
516baf6e64fa63c63efcada782673e9f06269329 | JavaScript | bluebrid/base-knowledge | /javascript/base/Es6/4.Proxy/demo.3.js | UTF-8 | 546 | 3.078125 | 3 | [] | no_license | /**
* https://zcfy.cc/article/6-compelling-use-cases-for-es6-proxies-888.html
*/
let numericDataStore = {
count: 0,
amount: 1234,
total: 14
};
numericDataStore = new Proxy(numericDataStore, {
set(target, key, value, proxy) {
if (typeof value !== 'number') {
throw Error("Properties... | true |
48a5e802d09f9107a57e1cdf8df9c5a71999aeba | JavaScript | stefanosoprana/javascript-ex-2 | /15:1/main.js | UTF-8 | 1,035 | 3.234375 | 3 | [] | no_license | // chiedi all'utente la Email
// controlla che sia nella lista di chi puo accedere
// stampa un messaggio appropriato
var email_utente = prompt('inserisci la mail');
console.log(email_utente);
var frase_accesso = "email corretta";
var email_corrette = ['mario@gmail.com', 'paolo@gmail.com', 'carlo@yahoo.com']
conso... | true |
6ac5f07cbb481bd5fec6ce0c3848f8b6d8e5be60 | JavaScript | MartinezAlexis97/CursoIngresoJS | /8-TPs/jsFerretePinturas.js | UTF-8 | 805 | 4.0625 | 4 | [] | no_license | /*3. Para el departamento de Pinturas:
A. Al ingresar una temperatura en Fahrenheit debemos mostrar la temperatura en Centígrados con un mensaje concatenado (ej.: " 32 Fahrenheit son 0 centígrados").
B. Al ingresar una temperatura en Centígrados debemos mostrar la temperatura en Fahrenheit (ej.: "0 centígrados son 32 ... | true |
f8e10abb5920193faea5c91cce9060c6a8b7b9e4 | JavaScript | aicute221/MyLeetCode | /字符串/最长特殊序列.js | UTF-8 | 508 | 3.203125 | 3 | [] | no_license | /**
* @param {string} a
* @param {string} b
* @return {number}
*/
var findLUSlength = function(a, b) {
// if(a==b){
// return -1;
// }
// var min,max;
// if(a.length>b.length){
// min = b;
// max = a;
// }else{
// min = a;
// max = b;
// }
// if(ma... | true |
5a1596fe75c7ef40c1d168d63e047e750033be6c | JavaScript | Holmes-zf/ZeroGIS | /ZeroGIS/js/Object3D/Line.js | UTF-8 | 989 | 3.0625 | 3 | [
"MIT"
] | permissive | /**
* 线
*/
ZeroGIS.Line = function (position, direction) {
if (!(position instanceof ZeroGIS.Vertice)) {
throw "invalid position";
}
if (!(direction instanceof ZeroGIS.Vector)) {
throw "invalid direction";
}
this.vertice = position.getCopy();
this.vector = direction.getCopy();
... | true |
b35fc41e5a291a53a0a6195f3673410adaa7a904 | JavaScript | IamSoPrada/emphasoft_ta | /src/services/usersService.js | UTF-8 | 821 | 2.84375 | 3 | [] | no_license |
export default class UsersService {
baseURL = 'https://emphasoft-test-assignment.herokuapp.com/'
getResource = async (url) => {
const AUTH_TOKEN = localStorage.getItem('token')
const conf = {
headers: {
"Authorization": `Token ${AUTH_TOKEN}`,
}
... | true |
fa16c70ac18895f94360af3902bbea587df014e6 | JavaScript | Valik2304/Perpetio-Project | /js/formValidate.js | UTF-8 | 4,635 | 2.703125 | 3 | [] | no_license |
var form = document.querySelector('.div_2 .js-form-validation');
var fields = form.querySelectorAll('.inputValidate');
var uniqueButton = form.querySelector('.uniqueButton');
console.log(uniqueButton);
// var name = form.querySelector('.name');
// var email = form.querySelector('.email');
... | true |
04fe12594a7260031ce43529d1cfd28a21b19efe | JavaScript | mamucha/javascript-basic-projects | /Project1 - ColorFlipper/js/app.js | UTF-8 | 1,374 | 3.75 | 4 | [] | no_license | const simpleColor = document.getElementById("simple");
const hexColor = document.getElementById("hex");
const btn = document.querySelector(".main__button");
const mainColor = document.querySelector(".main__color");
const simpleColorArr = [
"red",
"yellow",
"green",
"orange",
"rgb(102, 128, 109)",
"rgb(39, 30, 94... | true |
5c6aaf8d009258a55f1aa4d5ecc332b79490ef80 | JavaScript | MiguDeveloper/test-gha | /suma.test.js | UTF-8 | 1,634 | 3.4375 | 3 | [] | no_license | // BDD: behavior-driven development (desarrollo guiado por comportamiento)
const { maxNumPro } = require('./arrays');
const {
add,
substract,
isVowel,
countVowel,
countVowelFast,
} = require('./suma');
describe('Sumar', () => {
test('1 + 2 = 3', () => {
expect(add(1, 2)).toBe(3);
});
test('a + 5 =... | true |
0be3d94a3205330a88685026d73667b4f0f6db2a | JavaScript | Markusyk/starwars | /src/reducers/helper.js | UTF-8 | 550 | 2.53125 | 3 | [] | no_license | import map from 'lodash/fp/map';
// related entity comes as endpoint not as ID, so it's better to have ID's in
// the reducer
export const mapUrlToId = (el) => {
const splittedString = el.split('/');
return splittedString[splittedString.length - 2];
};
// TODO: redo this function, so it can be reused in red... | true |
6e8188f99865825ad0623179490a3ddced5839a1 | JavaScript | thisistaimur/Course | /02-Programming-Basics/2020-11-03-Objects-Classes/exercises/01_solution.js | UTF-8 | 2,593 | 3.875 | 4 | [] | no_license | //Q1
/* class Person{
constructor(name,age){
this.Name = name;
this.Age = age;
this.describe = function(){
return this.Name + " ," + this.Age + " years old"
}
}
}
var person1 = new Person("Jon",19);
console.log(person1.describe()); */
// Q2
/* class Volume{
co... | true |
4e55a49aa6053975973bf6c33b9cd595c20aeb5e | JavaScript | jaydenthomson1999/Web-Programming | /week6/server/sockets.js | UTF-8 | 529 | 2.65625 | 3 | [] | no_license | module.exports = {
connect: function(io, PORT) {
io.on('connect', (socket) => {
//when a connection request comes in output to the server console
console.log(`user connection on port ${PORT} : ${socket.id}`);
//when a message comes in, emit it back to all sockets with th... | true |
2326f5f8640ed04bdc25d9f14e75f0d2512b5818 | JavaScript | suzyng83209/Hello-World-React-Native | /index.android.js | UTF-8 | 993 | 2.796875 | 3 | [] | no_license | /**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from "react";
import { AppRegistry, StyleSheet, Text, View } from "react-native";
async function getMoviesFromApi() {
try {
let response = await fetch(
"https://facebook.github.io/react-nati... | true |
a00c4a2d0bc614f185c5411935893172d2d033fb | JavaScript | jbakse/site_builder | /content/shaders/sketches/static.js | UTF-8 | 563 | 3.109375 | 3 | [] | no_license | // require https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.14/p5.js
function setup() {
pixelDensity(2);
createCanvas(300, 300);
ellipseMode(CENTER);
fill(200, 50, 100);
noStroke();
}
function draw() {
loadPixels();
for (let y = 0; y < height * pixelDensity(); y++) {
for (let x = 0; x < width * pixe... | true |
47f1c4730c8ef40d0830df16a0273748a7a9dc19 | JavaScript | akerele180/CURRENCY-CALCULATOR | /script.js | UTF-8 | 1,337 | 3.171875 | 3 | [] | no_license | const baseCurr = document.getElementById('base');
const quoteCurr = document.getElementById('quote');
const baseCurrInput = document.getElementById('base-input');
const quoteCurrInput = document.getElementById('quote-input');
const btnSwap = document.getElementById('btn');
const convInfo = document.getElementById('con... | true |
c0d41376f1047f56b0c95b48f598a3ec930b87fc | JavaScript | Catanna82/programmingBasic | /SoftUni 6 Exp/trainTheTrainers.js | UTF-8 | 901 | 3.296875 | 3 | [] | no_license | function solution (input) {
let totalJuriCount = Number (input[0]);
let index = 1;
let totalAverageResult = 0;
let totalPreentation = 0;
let presentation = input[index];
while (presentation !== "Finish") {
let totalJuriResult = 0;
for (let juri = 1; juri <= totalJuriCount; juri++) {
ind... | true |
52a3dde744b6ca882f074378795480c5f2ad3c1f | JavaScript | taliwalt/jsEssentials | /src/arrays/sort/sort.js | UTF-8 | 1,038 | 3.609375 | 4 | [
"MIT"
] | permissive | /**
* Sorts an array of primitive values.
* @NOTE: For legacy browsers use the Array.prototype.map polyfill.
* @param {array} arr The array to sort.
* @param {boolean} [ascending] Defines the sort order. Default is true (ascending).
* @return {array} The sorted array.
*/
function sort(arr, ascending) {
'use s... | true |
39b208006286003a20cbcc8167a44b3ce63aeb9a | JavaScript | saul365/tenemosTransparencia | /js/countMoney.js | UTF-8 | 743 | 2.953125 | 3 | [] | no_license | firebase.database().ref().on("value", function(snapshot) {
let todos = Object.keys(snapshot.val());
let count = 0;
todos.forEach(element => {
count = count + parseInt(snapshot.val()[element].Monto);
})
let percentage=(count*100)/456013740;
var prim=count%1000000000;
var sec=prim%1000000;
var child=c... | true |
021177f35bd9d98a8e65d19717fde3d072d02bad | JavaScript | Cabana/FormValidator | /lib/range_validation.js | UTF-8 | 975 | 2.71875 | 3 | [
"MIT"
] | permissive | var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
this.RangeValidation = (function() {
function RangeValidation(length, min, max) {
this.length = length;
this.min = min;
this.max = max;
}
RangeVa... | true |
b47068054bd6d31b40b84a6d2416e2cea63de80c | JavaScript | Jessica1120/WeekendChallenge2 | /server.js | UTF-8 | 756 | 2.578125 | 3 | [] | no_license | //requires
var bodyParser = require('body-parser');
var express = require('express');
var path = require('path');
//var moduleName if needed
var indexRouter = require('./Routes/index'); //server requires index module
var listRouter = require('./Routes/listofpeople');
//variables
var app = express();
var port = 3000
ap... | true |
be9650afd11a950b03ab46ba05b16f51a0d5870f | JavaScript | ruviniruvi/Assignment-4 | /question3.js | UTF-8 | 470 | 3.046875 | 3 | [] | no_license |
let submit = document.querySelector('#submit')
let formheader = document.querySelector('.formheader')
function checkForm()
{
let passWord = document.getElementById('password');
let pass =12345678;
if(passWord.value.match(pass)) {
alert('Your password is correct');
}
else {... | true |
c18212b7526984c07f84be204cdc05e190ab8f79 | JavaScript | ujjwalpuri29/ProjectEuler100 | /018.js | UTF-8 | 671 | 4.125 | 4 | [
"MIT"
] | permissive | //Problem 18: Maximum path sum I
//Moving from bottom to top and adding the max of the two adjacent elements to each element
//Returning the topmost element since it has the maximum sum of the elements underneath
function maximumPathSumI(triangle) {
for (let i = triangle.length - 2; i >= 0; i--)
for (let j ... | true |
83bd7af5e886661d1d1b218b7802ecde0492580b | JavaScript | haneulee/react-hooks | /useConfirm&usePreventLeave/index.js | UTF-8 | 754 | 2.53125 | 3 | [] | no_license | import React, { useState } from "react";
import ReactDOM from "react-dom";
import "./styles.css";
import { useConfirm, usePreventLeave } from "./useConfirm.js";
const App = () => {
const deleteWorld = () => console.log("delete the world");
const abort = () => console.log("aborted...");
const confirmDelete = use... | true |
d137228bb739d0629cff856c72a8dbac49c42836 | JavaScript | Darkwolf/node-telegram-bot | /mjs/lib/types/EncryptedCredentials.mjs | UTF-8 | 962 | 2.59375 | 3 | [
"MIT"
] | permissive | export default class EncryptedCredentials {
static from(data, context) {
return new EncryptedCredentials(data, context)
}
static fromParams(params = {}, context) {
return new EncryptedCredentials({
data: params.data,
hash: params.hash,
secret: params.secret
}, context)
}
constr... | true |
ce3b313031c427c9c74ae55c971cfcd899a4965d | JavaScript | devanshbatra/geniusLoginClient | /src/Components/Register.js | UTF-8 | 3,684 | 2.609375 | 3 | [] | no_license | import React, {useState} from 'react';
import { Redirect, Link } from 'react-router-dom';
const Register = (props)=>{
const [name, setName] = useState("");
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [password2, setPassword2] = useState("");
const [e... | true |
1ceb2d48686fbc9ea3979a48ac27126e59f3b511 | JavaScript | Necheva/web | /main.js | UTF-8 | 1,427 | 2.578125 | 3 | [] | no_license | console.clear();
//ввод и результат, который передаем в document.body
var $input = $('<input type="search" />').appendTo(document.body),
$results = $('<div class="results" />').appendTo(document.body);
$input.val('sia');
function fetch(term)
{
//формируем ajax запрос
$.ajax(
{
url: 'https://itunes.apple... | true |
971627f232b755ec1edb91de33a0fc167e640bed | JavaScript | Antti-Alho/kpdb | /client/src/reducers/costCenterReducer.js | UTF-8 | 2,296 | 2.75 | 3 | [] | no_license | import ccService from '../services/costCenterService'
import { stringToNumber, centsToEuro } from '../util/currencyConverter'
const reducer = (state = [], action) => {
switch (action.type) {
case 'UPDATE_CC':
let indexToUpdate = state.findIndex(cc => cc.id === action.data.id)
state[indexToUpdate] = a... | true |
9d11dbefc8a8b60fade488b5106b9ebcb70c9591 | JavaScript | lisalinlizhe/Leetcode | /BitManipulation/Easy/476_NumberComplement.js | UTF-8 | 234 | 3.046875 | 3 | [] | no_license | /**
* Created by lizhelin on 18/6/18.
*/
// Find out how many bits are there for a number: use mask(11111111) & num
var findComplement = function(num) {
var mask = ~0;
while(num & mask) mask = mask << 1;
return ~mask ^ num;
}; | true |
586ace90626ed4a1d2ab1cd5851aa6e8257ea551 | JavaScript | romasereda/Projects | /OJJO/js/script.js | UTF-8 | 5,377 | 2.5625 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", () => {
// header, modal-menu
const modalMenu = document.querySelector(".modal-menu"),
modalMenuBtnShow = document.querySelector(".hamburgers-show"),
modalMenuBtnHide = document.querySelector(".hamburgers-close");
modalMenuBtnShow.addEventList... | true |
a937f67c6392ee1c4aa29cc77ddc8f3877863019 | JavaScript | daehanchoe/tiripsoda_psytest | /src/QuestionContext.js | UTF-8 | 2,656 | 2.640625 | 3 | [] | no_license | import React, { createContext, useContext, useState } from "react";
const ResultContext = createContext([]);
const SetResultContext = createContext(() => {});
const TotalCountContext = createContext(1);
const SetTotalCountContext = createContext(() => {});
const QuestionCountContext = createContext(1);
const SetQuestio... | true |
3ec4f2740e347675bd3951654179ca37f3538817 | JavaScript | Kiikurage/zikantarinai | /js/script.js | UTF-8 | 1,148 | 3 | 3 | [] | no_license | $(function() {
$balls = $('.ball');
width = $(window).innerWidth() - 80;
height = $(window).innerHeight() - 80;
init();
});
var $balls,
width,
height,
mx, my,
G = 0.6;
function init() {
randomize();
calc();
}
function randomize() {
$balls.each(function(i, ball) {
var $ball = $(ball),
x = Math.random(... | true |
ab6e3590f9fef21b3fedae255c98d6ac7372fdd9 | JavaScript | nalcaraz/where-can-i-go | /src/components/Map.js | UTF-8 | 1,146 | 2.546875 | 3 | [] | no_license | import React from 'react';
class Map extends React.Component {
googleMapRef = React.createRef()
componentDidMount() {
const googleScript = document.createElement('script')
googleScript.src = `https://maps.googleapis.com/maps/api/js?key=${process.env.REACT_APP_GOOGLE_API_KEY}&libraries=plac... | true |
be761193d6fc3b0e3bf07b96b7c3d3825ac9b5d8 | JavaScript | jesusaviladev/giphy-api | /middlewares/auth.js | UTF-8 | 618 | 2.625 | 3 | [] | no_license | const jwt = require('jsonwebtoken')
const auth = (request,response, next) => {
const authorization = request.get('authorization')
let token = ''
if(authorization && authorization.toLowerCase().startsWith('bearer')){
token = authorization.substring(7)
} else {
return response.status(401).json({
error: 'Not ... | true |
d40c1419f902221d49b81954c81ed14bc3f59b47 | JavaScript | BoneManMack/EvanMackeyBoneManMack | /src/components/maindisplay/contact/contact.js | UTF-8 | 3,025 | 2.515625 | 3 | [] | no_license | import React, { useState } from 'react';
import './contact.css';
function BMMcontact() {
const [ status, setStatus ] = useState("Submit");
const contactFormSubmit = async (e) => {
e.preventDefault();
setStatus("Sending...");
const { name, email, subject, message, subscribe } = e.target... | true |
eb86a0c456d9200060024fb34163ab6de546b1de | JavaScript | LeiLang-147/2011_task | /雷浪/练习/04.path/path.js | UTF-8 | 715 | 2.671875 | 3 | [] | no_license | const { dirname } = require('path');
const path = require('path');
// console.log(path.join(__filename)); // D:\VSCode_work\Node\node\2011_task\雷浪\练习\04.path\02.path.js
// console.log(path.join(__dirname)); // D:\VSCode_work\Node\node\2011_task\雷浪\练习\04.path
// 目录名
// console.log(path.dirname(__filename)); // D:\VSCo... | true |
83721a4b14fb22bf3f8ea8ce590444e317d5792c | JavaScript | rendfall/challenge-game-01-pong | /src/main.js | UTF-8 | 1,538 | 2.921875 | 3 | [] | no_license | import Queue from 'queue';
import { APP_CONFIG } from './app/config';
import { Game } from './app/game';
class Bootloader {
storage = new Map();
taskQueue = Queue({ concurrency: 1 });
constructor(name, elementId) {
this.taskQueue.push(this.setupCanvas.bind(this, name, elementId));
this.t... | true |
12f64ac14acfe0ac0490e20115bc57ed8e807afd | JavaScript | DialBird/BirdAlbum365 | /BirdAlbum365/public/src/es6/mainPage/components/preloadData.es6 | UTF-8 | 3,642 | 2.640625 | 3 | [] | no_license |
//------------------------------------------------------
//画像をプリロードする
//------------------------------------------------------
const Promise = require('es6-promise').Promise;
const $ = require('jquery');
const createjs = require('createjs');
module.exports = (NameSpace)=>{
return new Promise((resolve)=>{
... | true |
14c0611d0173d955053d4a9e39d63674e90a730d | JavaScript | xiaoyeren/zj_macaca_project | /mocha-test/demo02_should.test.js | UTF-8 | 2,321 | 2.84375 | 3 | [] | no_license | /**
* Should api documents:
* https://shouldjs.github.io/
*
*/
var should = require('should');
var assert = require('assert');
describe('test/demo_02_should.test.js', function () {
it('Should demo 01, equal', function () {
(10).should.be.eql(10);
(10).should.be.eql(11, 'verify number equal.'... | true |
8679ed039f1b1f4abe987fc1e472a5ea5eea1998 | JavaScript | jamil2gomes/projetoProgExtrema | /Ata de Defesa e Relatórios_arquivos/fill_inputs.js | UTF-8 | 2,409 | 2.875 | 3 | [] | no_license | function getApi() {
let filtro = document.getElementById("buscaMono").value
console.log(filtro)
myRequest("http://localhost:8080/mono/" + filtro)
.then(function(response) {
var objects = JSON.parse(response);
document.getElementById("dia").value = objects.dataDefesa.substr... | true |
ad917bb538a781489bdfed9fad35f5d21a51db07 | JavaScript | Wappsto/rn-wappsto-networks | /scripts/translation/json2csv.js | UTF-8 | 1,642 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | const Path = require('path');
const Files = require('./files');
const {parse} = require('json2csv');
const paths = process.argv.slice(2);
const projectNameSplitter = Files.projectNameSplitter;
const result = {};
paths.forEach((path) => {
let projectName = '';
if (paths.length > 1) {
projectName = path.replace(... | true |
fafddf56c1908a4aae777e2ed6a920a9de164902 | JavaScript | shelacek/preact-render-spy | /src/is-where.js | UTF-8 | 3,272 | 3.3125 | 3 | [
"ISC"
] | permissive | const entries = require('object.entries');
const ATTRIBUTE_PRESENT = {exists: true};
/**
* _isWhere matching checks
* `where` should be an object with keys you wish to match against a `target` object
*
* { attr: ATTRIBUTE_PRESENT } - If the value of a key is the ATTRIBUTE_PRESENT constant
* ... | true |
3d8886e6412f4fc8a2ae1013ccb40343aeb3f462 | JavaScript | QYY159357/CANYIN | /src/main/webapp/html/assets/js/common.js | UTF-8 | 806 | 2.75 | 3 | [
"MIT"
] | permissive | var baseUrl = "https://www.hopfun.com.cn";
// var baseUrl = "http://localhost:8080";
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0]... | true |
7fb44f9513672867120db305e15aea184ea4eccc | JavaScript | sto17001/sto17001.github.io | /lesson9/js/windchill.js | UTF-8 | 428 | 3.71875 | 4 | [] | no_license | let temp = parseFloat(document.getElementById("highTemp").textContent);
let speed = parseFloat(document.getElementById("windSpeed").textContent);
let result = windChill(temp, speed)
document.getElementById("windChillOutput").innerHTML = result;
function windChill(t, s) {
let equation = 35.74 + (0.6215 * t) - 35.7... | true |
b9e2a4e854c3d03e14a6b47c26213471bef28a71 | JavaScript | sameoldmadness/html-imports | /js/import.js | UTF-8 | 575 | 2.578125 | 3 | [] | no_license | var links = document.querySelectorAll('link[rel="import"]');
var imports = Array.from(links).reduce((acc, link) => {
const name = link.getAttribute('href');
acc[name] = link.import.body;
return acc;
}, {});
var placeholders = document.querySelectorAll('[data-import]');
Array.from(placeholders).forEach(placeholder =... | true |
24d8d04d8aef2bd21b84accb550224b8579c600e | JavaScript | ericie/Interactive-Sketches | /projects/g_spiders/src/lab/tdl/Mesh.js | UTF-8 | 6,824 | 2.5625 | 3 | [] | no_license | /** @namespace LAB.tdl */
LAB.tdl = LAB.tdl || {};
/** @constructor */
LAB.tdl.Mesh = function () {
this.indices,
this.vertices = null,
this.normals = null,
this.texCoords = null,
this.colors = null;
this.posBuffer,
this.normBuffer = null,
this.texCoordBuffer = null,
this.colorBuffer... | true |
1a58bd1b037e58d97cf082537d5f08af3e2769ef | JavaScript | w-schwier/find_my_past | /testing_library/assert.js | UTF-8 | 2,738 | 3.671875 | 4 | [] | no_license | var assert = {
isTrue: function(assertionToCheck, message) {
if (!assertionToCheck) {
console.error("Assertion failed: " + assertionToCheck + " is not truthy");
} else {
console.log("Truthy PASSED: " + message);
}
},
isFalse: function(assertionToCheck, message) {
if( assertionToCheck ... | true |
7f3dc5e6f76252a50c5a8cfc568cd7a3c4631547 | JavaScript | karol95c/University | /WEPPO/Lab3/weppo305.js | UTF-8 | 186 | 3.390625 | 3 | [] | no_license | function sum(...theArgs) {
return theArgs.reduce((previous, current) => {
return previous + current;
});
}
console.log(sum(1,2,3));
// 6
console.log(sum(1,2,3,4,5));
// 15 | true |
037b0882fdb5874e4a835c0428463d0e8a102597 | JavaScript | nodriza-io/nodriza | /src/api/ConfigApi.js | UTF-8 | 1,978 | 2.515625 | 3 | [] | no_license | 'use strict'
/* eslint-disable no-unused-vars */
import { Request } from '../request'
import queryString from 'query-string'
import _ from 'lodash'
const model = 'config'
export class Config extends Request {
constructor (params) {
params.model = model
super(params)
}
/**
* GET /v1/config/getFactorySe... | true |
119cc679a7f30f5a4ae6e5b8ac20d927641ef882 | JavaScript | meghansmorris/clickyMonsters | /src/App.js | UTF-8 | 2,837 | 3.0625 | 3 | [] | no_license | import React from "react";
import MonsterImage from "./components/MonsterImages/MonsterImages";
import Wrapper from "./components/Wrapper/Wrapper";
import monsters from "./monsters.json";
import "./App.css";
import NavBar from "./components/NavBar/NavBar";
import Header from "./components/Header/Header";
import Footer ... | true |
15ab4bb910c55cae34d824c60c5d12f0fda0439b | JavaScript | mkdirgraf/fulls-sep-21-workshop | /02-functions/02-default-greet/default-greet.js | UTF-8 | 115 | 2.671875 | 3 | [] | no_license | // YOUR CODE BELOW
function defaultGreet(firstName, lastName = 'Doe') {
return `Hi ${firstName} ${lastName}`;
} | true |
adc1b86cbce302e5c5dc4efa0e720e2fbc312acb | JavaScript | michaeleconomy/gamerankr | /app/assets/javascripts/one_offs/edit_ranking.js | UTF-8 | 1,594 | 2.546875 | 3 | [] | no_license | $(document).ready(function(){
function star_click(event){
var e = $(this)
var ranking_num = e.attr("ranking")
persist_stars_click(e)
$('#ranking_ranking').val(ranking_num)
}
$(".shelves > .add")
.mouseover(function(){
$(this).find('.chooseShelves').show()
})
.mouseout(function... | true |
fe4bee190c6b5ef52e9f809d6d71b0cd8757604b | JavaScript | Bsofian1/cv-project | /src/components/ListInfoComponent.js | UTF-8 | 2,202 | 2.578125 | 3 | [] | no_license | import React from "react";
import uniqid from "uniqid";
import Checkbox from "@material-ui/core/Checkbox";
import ButtonComponent from "./ButtonComponent";
class ListInfoComponent extends React.Component {
constructor() {
super();
this.state = {
informations: [
{
title: "Name",
... | true |
2deaefb33aa0f57cefcbf06ff116327b1c91aa59 | JavaScript | minishreya/mongoDb_resturant | /mongoCommand.js | UTF-8 | 8,908 | 3.03125 | 3 | [] | no_license | // import data
//mongoimport --db resturantDB --collection resturant --drop --file restaurants.json --jsonArray
//1. Write a MongoDB query to display all the documents in the collection restaurants.
db.resturant.find()
// 2. Write a MongoDB query to display the fields restaurant_id, name, borough and cuisine for
/... | true |
bffdab810f6116bac284baf45b17e9d935ddb3b7 | JavaScript | galya-mironenko/Clever | /js/main.js | UTF-8 | 1,952 | 2.75 | 3 | [] | no_license | window.addEventListener('DOMContentLoaded', function() {
//Header
const selectSingle = document.querySelector('.__select');
const selectSingle_title = selectSingle.querySelector('.__select__title');
const selectSingle_labels = selectSingle.querySelectorAll('.__select__label');
const inputs = docum... | true |
b54b3b53ec15f6eb73d1b94dd7d7ed9c9c227229 | JavaScript | shmula1308/JS-Input-Validation | /js/script.js | UTF-8 | 2,368 | 3.109375 | 3 | [] | no_license |
const FormValidation = (function() {
const username = document.querySelector('.username');
const email = document.querySelector('.email');
const password = document.querySelector('.password');
const submit = document.querySelector('.btn');
const form = document.querySelector('form');
... | true |
bef615c57c8c8d4c01c4d6eb6ff8bb8bbb967048 | JavaScript | davidlewallen/recipe-app-backend | /src/controllers/websiteRules/geniuskitchen.js | UTF-8 | 2,194 | 2.703125 | 3 | [] | no_license | const formatTime = require('../../utils/formatTime');
const stripIngredients = (dom) => {
const containingUl = (
dom
.window
.document
.getElementsByClassName('ingredient-list')[0]
);
const listOfContainingLi = containingUl.children;
const listOfIngredients = [];
for (const li of listOfConta... | true |
091a13ae01955c2e9be7468a4f5738eb49db40e3 | JavaScript | samnevers/WDi18-Homework | /samantha_ki/week_07/day_02/js/people.js | UTF-8 | 573 | 2.75 | 3 | [] | no_license | var basePeopleURL = "http://api.open-notify.org/astros.json";
// Display Function
var displayPeople = function (data) {
var numberPeople = data.number;
var $spacepeople = $("p#space-people");
$spacepeople.text(numberPeople + " people in space right now!");
};
var getPeopleInformation = function () {
console.... | true |
60351be610e3d9fb0d0963c3fcd5abb81344e856 | JavaScript | ingibitors/class-work-examples | /fe14/advanced_javascript/classwork/02.06.2020-fetch-axios-async-await/exercises/js/functions/handeClick.js | UTF-8 | 359 | 2.625 | 3 | [
"MIT"
] | permissive | function handleClick (e) {
e.preventDefault();
if (e.target.classList.contains('btn-delete')){
deleterBook(e.target)
}
else if (e.target.matches('.btn-edit') || e.target.matches('.fa-edit')){
editBook(e.target);
} else if (e.target.matches(`.btn-update`)){
updateBook(e.targe... | true |
4ff5a92eb9b1ddca7dddc1a73a1f58e99c923de5 | JavaScript | NightHunter97/Django | /lifeline-backend-master/apps/patients/static/patients/js/patient-search.js | UTF-8 | 2,449 | 2.53125 | 3 | [] | no_license | $( document ).ready(function () {
$(searchIdBar).keypress(function(e) {
if (e.keyCode == 13) {
const urlParams = new URLSearchParams(window.location.search);
if (e.target.value) {
var params = {'patient_id': e.target.value};
for (var p of urlParams.en... | true |
3a3819de1eb3abccdf5bd2b3f1ba565a1777b630 | JavaScript | hisham-p/bititude-training | /MySQL/ToDo/server.js | UTF-8 | 1,733 | 2.6875 | 3 | [] | no_license | const express = require('express');
const app = express();
const bodyParser = require("body-parser");
const knex = require('knex')({
client: 'mysql',
debug: true,
connection: {
host: 'localhost',
user: 'root',
password: 'password',
database: 'test'
}
});
const bookshelf =... | true |
8e87a22aead701b20b05ca687087bc4144517cc6 | JavaScript | Hadryan/spotify-suggester | /app/src/routes/refresh.js | UTF-8 | 2,146 | 2.609375 | 3 | [] | no_license | "use strict";
const db = require('../persistence');
const sync = require('../helpers/sync');
module.exports = async (req, res) => {
const userID = req.params.userID;
const accessToken = req.session.accessToken;
if (!(await db.userIDExists(userID))) {
res.send(`User "${userID}" does not exist`);
re... | true |
298f67a2f912aec3c928f26d8281d078def243e3 | JavaScript | satyambnsal/nodejs-handson-b7 | /ex1.js | UTF-8 | 1,813 | 3.015625 | 3 | [] | no_license | #!/usr/bin/env node
'use strict';
/**
*
*
*
*/
// STDIO
// STDIN = 0, STDOUT =1 , STDERR = 2
// Goal is to get access of command line parameters
const minimist = require('minimist');
const getStdin = require('get-stdin');
const fs = require('fs');
const path = require('path');
const args = minimist(process.arg... | true |
4fed5e0f0c1ef92a9861ce508258f720d5bf2354 | JavaScript | gr101944/cdk-code | /lambdaCode2/validations/validateTime.js | UTF-8 | 1,559 | 3.09375 | 3 | [] | no_license | 'use strict';
module.exports.validateTime = function (dateValue, timeValue,offset, timeDiff) {
var now = new Date();
var adjTimeDiff = parseInt(timeDiff)-5 // 5 min for execution of lambda - max
now.setHours(now.getHours() + offset)
var currDate = now.toISOString().substring(0,10)
var currTime = now.toI... | true |
82b047502f7ff747cecb1a121677940c2fffa45f | JavaScript | nikolay-is/BlogSystem-Node | /server/models/User.js | UTF-8 | 2,872 | 2.578125 | 3 | [
"MIT"
] | permissive | const mongoose = require('mongoose')
// const Role = mongoose.model('Role')
const Role = require('./Role')
const encryption = require('../utilities/encryption')
const REQUIRED_VALIDATION_MESSAGE = '{PATH} is required'
let userSchema = mongoose.Schema({
username: { type: String, required: REQUIRED_VALIDATION_MESSAGE... | true |
0ce460206f58bf568da239e5e9c8231e3b56e3e6 | JavaScript | panniru/manthan_erp | /app/assets/javascripts/location.js | UTF-8 | 1,389 | 2.609375 | 3 | [] | no_license | // $(document).ready(function(){
// initialize();
// var placeSearch, autocomplete;
// var component_form = {
// 'txtPickupUnitNumber': 'subpremise',
// 'txtPickupStreetNumber': 'street_number',
// 'txtPickupStreetName': 'route',
// 'txtPickupSuburb': 'locality',
// 'txtPickupPC': 'postal_code',
// 't... | true |
779d2b4aa37ebe213365d1556f20060cb76c2ee7 | JavaScript | simoesSamael/-management-system-for-ONGS | /OngGenios/WebContent/privado/js/categoria.js | UTF-8 | 6,337 | 2.625 | 3 | [
"MIT"
] | permissive |
ONG.gerenciar = new Object();
ONG.categoria = {};
$(document).ready(function(){
ONG.gerenciar.membro=function(){
var cfg={
type: "GET",
url: ONG.contextPath+"/rest/membroLogado/buscar",
success: function(msg) {
ONG.gerenciar.retorno(msg);
},
... | true |
c6141b5b3bb451106333cb1531cf8060485da18a | JavaScript | 357AMG/357-quizs | /cloud/app.js | UTF-8 | 666 | 2.859375 | 3 | [
"MIT"
] | permissive | // 在 Cloud code 里初始化 Express 框架
var express = require('express');
var app = express();
// App 全局配置
app.set('views','cloud/views'); // 设置模板目录
app.set('view engine', 'ejs'); // 设置 template 引擎
app.use(express.bodyParser()); // 读取请求 body 的中间件
// 使用 Express 路由 API 服务 /hello 的 HTTP GET 请求
app.get('/hello', function... | true |
79f20a454185873ea2388fcab2b61ab3294fabb3 | JavaScript | singhal29797/tm-webtech-examples | /Session 9/operators.js | UTF-8 | 1,172 | 3.40625 | 3 | [] | no_license | console.log("////////////////operators.js///////////////");
console.log(5 + 5);
console.log(5 - 5);
console.log(5 * 5);
console.log(5 / 5);
console.log(5 % 5);
console.log(5 ** 5);
var x = 5;
console.log(x, x++, x);
console.log(x, ++x, x);
console.log(x, x--, x);
console.log(x, --x, x);
var y = 7;
var z = y;
console... | true |
1dba3fe7e790feda3a271c107e21c854b80bac0e | JavaScript | PushpanjaliMP/es6 | /src/class.js | UTF-8 | 920 | 3.96875 | 4 | [] | no_license | class Person {
greet() {}
}
//classes are not hoisted
let p = new Person();
document.write("type of class "+typeof Person+" ");
document.write("<br>"+"methods added same as prototype functions in class ---");
document.write(p.greet === Person.prototype.greet);
class Person1 {
constructor(name){
this.name = ... | true |
387e7f067ab4542c8c56f5a0e1a9661a6a7ef48a | JavaScript | victorfernand/Exercicios-Web | /exercicios-js/120node/133escreverArquivoNode.js | UTF-8 | 622 | 3.28125 | 3 | [] | no_license | //// aprender a escrever arquivos no Node
const fs = require('fs') /// fs ==filesystem
const pruduto = {
nome:'celular',
preco: 1675,
desconto: 0.15
}
///obs: esse objeto vai ser transformado em um texto usando o JSON.STRINGFILE.((OU SEJA PEGA UM OBJETO E TRANSFORMA PARA UM JSON))
fs.writeFile(__dirname + '... | true |
3b835d2312ccffbb3e00475ae7900d5243796a8d | JavaScript | RachaelSmethills/Restauraunt | /database/databaseLoader.js | UTF-8 | 945 | 2.9375 | 3 | [] | no_license | const sqlite3 = require('sqlite3');
class DatabaseLoader {
constructor() {
this.db = new sqlite3.Database('./db.sqlite');
}
generateInsertQuery(table, dataObject) {
const dataKeys = Object.keys(dataObject); // Get all keys of provided object
const dataKeysNonObjects = dataKeys.fil... | true |
69c276ba0382962dc4824aec90c20aebff5c543b | JavaScript | EmonHossainDiza/SchoolManagementSystem | /module/admin/JS/newTeacherValidation.js | UTF-8 | 2,209 | 2.75 | 3 | [] | no_license | function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
//if (charCode > 31 && (charCode < 48 || charCode > 57))
if (charCode > 31 && (charCode != 46 &&(charCode < 48 || charCode > 57)))
{alert("only number is allowed");return false;}
return true;
}
var teaGender = '';
fun... | true |
b63090da55d433ea7a24cc5eff430586c3378451 | JavaScript | antonycourtney/FavIconTest | /iconic_history.js | UTF-8 | 1,771 | 3.109375 | 3 | [] | no_license | 'use strict';
function genFaviconDiv(){
var faviconDiv = document.createElement('div');
faviconDiv.className = "faviconDiv";
return faviconDiv;
}
function addFaviconImg(item) {
var faviconUrl;
// create div for each favicon
faviconUrl = 'chrome://favicon/' + item.url;
var faviconDiv = genFaviconDiv... | true |
85835d08ba1b0fca0d46f3bae5e176a35f155f51 | JavaScript | simgeatlhn/ReactProjects | /ReactProjects/moviebox_TMDB/src/Components/SearchBar.js | UTF-8 | 912 | 2.578125 | 3 | [] | no_license | import React from "react";
class SearchBar extends React.Component {
//onSubmit için event handler
handleFormSubmit = (event) => {
event.preventDefault(); //event in varsayılan davranışını durdurur
}
render() {
//***searchMovieProp App.js deki searchMovieProp u çalıştırır //searchM... | true |
18e0d9f56dbc3800bb98608f083e9f55e20878c1 | JavaScript | lamansky/filter-iter | /test.js | UTF-8 | 1,444 | 3.09375 | 3 | [
"MIT"
] | permissive | 'use strict'
const assert = require('assert')
const filterIterable = require('.')
describe('filterIterable()', function () {
it('should return an iterator', function () {
assert.strictEqual(typeof filterIterable([], v => v).next, 'function')
})
it('should only yield those items for which the callback retur... | true |
641e415bb095d0adb98247f24b74f9391e003127 | JavaScript | xiumingxu/web-component-play | /webpack/packages/chapter-04/02-tapable/synchook.js | UTF-8 | 1,564 | 3.3125 | 3 | [] | no_license | const {SyncHook} = require('tapable');
// 所有的构造函数都接收一个可选的参数,这个参数是一个字符串的数组
// 这里array的字符串随便填写,但是array的长度必须与实际要接受参数个数保持一致
// 后面类型都是这个规则,不再做过多说明
const hook0 = new SyncHook(['name']);
// 添加监听
hook0.tap('1', (arg0, arg1) => {
// tap 的第一个参数是用来标识`call`传入的参数
// 因为new的时候只的array长度为1
// 所以这里只得到了`call`传入的第一个参数,即Webpa... | true |
bc7ff65df2c83984e1ff22525e4684db6b78c794 | JavaScript | BassForecast/Solunar_IFRAME | /src/components/Date.js | UTF-8 | 702 | 2.578125 | 3 | [] | no_license | import React from "react";
const Date = (props) => {
const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
return(
<div className={`date ${props.active ? "active" : ""}`} index={props.index}... | true |
02062a1165552698c71eb6ade1bae4a12dd8c51f | JavaScript | fufelok/lecturesHTML-JS-CSS | /week8_html5_apis/day2_appCache_geolocation/code/geolocation/exercise-completed/js/geowiki_simple.js | UTF-8 | 2,522 | 2.984375 | 3 | [] | no_license | // Info:
// http://www.mediawiki.org/wiki/API
// http://www.mediawiki.org/wiki/API:Query_-_Meta
// http://www.mediawiki.org/wiki/API:Query_-_Lists
// http://wikilocation.org/documentation/
// Tom's slimmed down crazy Jsonp loader,
// takes parameters, url and callback. Optional you can provide a callback parameter n... | true |
ecdc484533ee9b5fd258d88aebd6eb933cda9075 | JavaScript | jardeldantas/bootcamp-gostack | /desafio01/index.js | UTF-8 | 2,037 | 3.03125 | 3 | [] | no_license | const express = require('express');
const server = express();
server.use(express.json());
let numberOfRequests = 0;
const projects = [];
server.use((req, res, next) => {
console.log(`Quantidade de Requisições: ${numberOfRequests = numberOfRequests + 1};`);
next();
});
/**
* Funcao para verificar se o projeto ... | true |
75200109654ac31c99dad96977791ba17789e76e | JavaScript | Sridevi2014/nucampreact | /ReactWeek1Assignment.js | UTF-8 | 1,420 | 3.171875 | 3 | [] | no_license | class Student {
//Student constructor
constructor(name, email, community) {
this.name = name;
this.email = email;
this.community = community;
}
}
class Bootcamp {
// Bootcamp Constructor
constructor(name, level, students = []) {
this.name = name;
... | true |
1533e1e5c0433020c1d87ab8e6693b5ba9385c79 | JavaScript | DavidkBurchett/exercise.javascript_day-3-exercises | /js/slide23.js | UTF-8 | 680 | 3.875 | 4 | [] | no_license | function smallerNumber(num1, num2){
if(num1 > num2){
return num1 + " is greater than " + num2
} else {
return num2 + " is greater than " + num1
}
};
do{
userInput1 = prompt("please enter a number");
} while(!(-Infinity < userInput1 && userInput1 < Infinity)) //NaN didn't work for some r... | true |
1e0091050ec2149b3be43a2130e67199f221eab1 | JavaScript | dea27/praxis-academy | /novice/01-05/kasus/kasus2.js | UTF-8 | 547 | 3.03125 | 3 | [] | no_license | function kamusbahasa(){
var kata = new Map([
['çucumbar', 500],
['onion', 350],
['grape', "anggur"]
]);
console.log(kata);
let a = prompt("masukan");
let b = prompt("masukan");
console.log(a,b);
kata.set(a,b);
console.log(kata.get(a));
console.log(kata);
... | true |
ea6e05cda53d7215dadcae2c75292784b516eba2 | JavaScript | zqxul/football | /src/main/resources/static/custom/js/login.js | UTF-8 | 2,496 | 2.53125 | 3 | [] | no_license | $('#submitBtn').on('click', function () {
var options = {
type: 'POST',
url: '/user/login',
data: $('#loginForm').serialize(),
success: function (data, status) {
if (status == "success") {
if (data.code == 3006) {
$('.help-tip').text(da... | true |
a5d540ff1b51476c679abd3744e6997980da2f61 | JavaScript | DZieba/My-first-website | /js/script.js | UTF-8 | 1,362 | 2.921875 | 3 | [] | no_license | $(document).ready(function () {
/* For the sticky navigation */
$('.services').waypoint(function (direction) {
if (direction == "down") {
$('nav').addClass('sticky');
}
else {
$('nav').removeClass('sticky');
}
}, {
offset: '150px;'
}... | true |
baad6fd5b574467655e1f95e429f860d52c2fff6 | JavaScript | yuhijackman/algorithms | /JS/heapreview.js | UTF-8 | 941 | 3.78125 | 4 | [] | no_license | class MaxBinaryHeap {
constructor() {
this.values = [41,39,33,18,27,12];
}
insert(element) {
this.values.push(element);
this.bubbleUp();
return this.values;
}
bubbleUp() {
let targetIdx = this.values.length - 1;
let parentIdx = this.getParentIndex(ta... | true |
a63e02d48017004a511d8a04ca549056506cfc73 | JavaScript | mouad-sellak/covid19-static-website | /script.js | UTF-8 | 621 | 2.90625 | 3 | [] | no_license | var countImage=1;
var totalImage=11;
function slider(x){
var image=document.getElementById('img');
countImage+=x;
image.src='images/'+countImage+'.jpg';
if(countImage>=totalImage){
countImage=1;
}
if(countImage<1){
countImage=totalImage;
}
}
function sli... | true |
7e34007ba269083deac5d04700af611f144d09bf | JavaScript | enterstudio/webglass | /parts/p_psyk.js | UTF-8 | 3,615 | 2.75 | 3 | [] | no_license | // psykedelic...
// #include "almosteverything.h"
// #include "images.h"
// #include <stdlib.h>
// #define M_PI 3.14159265358979323846f
// #define M_PI2 3.14159265358979323846f*2
var CYL_RADIUS = 15.0;
var CYL_SEGMENTS = 9;
var CYL_LENGTH = 25.0;
// #define PSYK_LIST 71
// #define PSYK_TEXTURE 72
// #define PSYK_SYMBO... | true |
dc3efeb2e308175e9dbd7c5ed94b2367ec95b4d4 | JavaScript | priih/Site-f-sica | /script.js | UTF-8 | 2,902 | 2.953125 | 3 | [] | no_license | function calcular(){
var consumo_produto = 0.0
var produto = document.getElementById('equipamento').value
var tempo_ligado = parseFloat(document.getElementById('tempo').value);
if(produto == "Aquecedor de ambiente"){
consumo_produto = 1
}else if(produto == "Aspirador de pó"){
consum... | true |
4a01a36446305a4dc47a0e326d3f00baf88d9723 | JavaScript | phuchieuct93abc/LunarNote | /src/logics/index.js | UTF-8 | 1,999 | 2.90625 | 3 | [
"MIT"
] | permissive | import update from 'immutability-helper';
let arrays = Array.from(Array(10).keys())
let isValid = (table, x, y, checkValue) => {
let result = true;
//check same row
arrays.forEach((item) => {
if (item != x) {
if (table[item][y] == checkValue) {
result = false;
... | true |
91d354084b989878dea3ae7745724b1149f5530b | JavaScript | WebHare/designfiles | /wh.layout.autofit/wh.layout.autofit.js | UTF-8 | 9,579 | 2.578125 | 3 | [
"MIT"
] | permissive | /* generated from Designfiles Public by generate_data_designfles */
require ('frameworks.mootools.core');
/*! LOAD: frameworks.mootools.core
!*/
/*
B-Lex 2013-2015
How to use:
- wrap the text content in a container
- the text container must have display: inline; or display: inline-block;.
This way it'll wordwrap w... | true |
aeb6f1063f3a3493ae2f41aa4010fc69f97e6580 | JavaScript | Reddy470/UST-16SEP19-REDDYSEKHAR | /javascript/arraymethods/array.js | UTF-8 | 1,869 | 3.5625 | 4 | [] | no_license | console.log('Array method1')
const hobbies = ['Sleeping','Cricket','Eating','Coding','Roaming']
const isArrayOrNot = Array.isArray(hobbies)
console.log('Hobbies array or not',isArrayOrNot);
console.log('Array method2')
const hasCricket = hobbies.includes('Cricket');
console.log('using includes method',hasCricket);
co... | true |
1434e18cdf019045bada3afb925802058a488b79 | JavaScript | jenmei/wheel.js | /lib/wheel/view.js | UTF-8 | 2,328 | 2.515625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | Wheel.View = Wheel.Class({
initialize: function(dom, opts) {
this.initializeDom(dom, opts);
this.init();
this.listen();
},
initializeDom: function(dom, opts) {
if ( dom && (dom.addClass || dom instanceof HTMLElement || dom.toString() === dom ) ) {
this.optionize(opts);
this.$ = this.w... | true |
9734c2bf5f2744071100e0b53ecda302befef723 | JavaScript | ihollander/bookliker-practice-challenge-nyc-web-100818 | /book.js | UTF-8 | 1,986 | 3.375 | 3 | [] | no_license | class Book {
constructor({ id, title, description, img_url }) {
this.id = id
this.title = title
this.description = description
this.img_url = img_url
Book.all.push(this)
}
// custom getter
get users() {
const bookUsers = BookUser.filterByBookId(this.id)
const users = bookUsers.map(b... | true |