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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
cd729df8ade2f96f60b606cd3dec234b57a4e5e0 | JavaScript | myweb-hub/KgSchoolHomeTask | /home-task-3/task4.js | UTF-8 | 298 | 3.359375 | 3 | [] | no_license | function flatten(){
array.forEach(flatten)
if(typeof Array.isArray()){
var merged = array.concat.apply([], array);
console.log(merged)
}
else{
return ;
}
}
const array = [1, 3, 6, [11, 12],[15,[19,23]]];
flatten(array);//[1, 3, 6, 11, 12, 15, [19,23]];
| true |
f9ed1088fc77c3947a092c3229f87dd35b0ba03e | JavaScript | WinterDawn/PostBoard | /helper/src/components/HomePage.js | UTF-8 | 1,233 | 2.625 | 3 | [] | no_license | import React, {Component} from 'react';
import PostQuestion from './PostQuestion'
import QuestionList from './QuestionList';
/*
create website home page
handle post questions
*/
class HomePage extends Component {
constructor () {
super()
this.state = {
questions: []
}
}
/*
get questio... | true |
810a33b6983f7b2662f951310da59a5f378379b8 | JavaScript | Balla21/finalProject | /public/viewpage/admin_feedbacks_page.js | UTF-8 | 6,676 | 2.578125 | 3 | [] | no_license | import * as Element from "./element.js";
import * as Routes from "../controller/routes.js";
import * as Auth from "../controller/auth.js";
import * as Util from "./util.js";
import * as FirebaseController from "../controller/firebase_controller.js";
import * as Constant from "../model/constant.js";
export function add... | true |
05b274abadbb4dcfb12bceee153dfe32c34f7ac3 | JavaScript | mattb555/xst_google_events | /source/gcal.js | UTF-8 | 3,159 | 2.765625 | 3 | [
"MIT"
] | permissive | import request from 'superagent'
const CURRENT_TIME = new Date(Date.now()).toISOString();
import {CALENDAR_ID, API_KEY} from './config';
const GOOGLE_CAL_URL = `https://www.googleapis.com/calendar/v3/calendars/${CALENDAR_ID}/events?key=${API_KEY}&timeMin=${CURRENT_TIME}`;
// For Demo-Page show ALL Enties in the Calen... | true |
7af6c56a4a201f3bee7938a7684a95bd85eaed64 | JavaScript | Wisedemic/tristannavarrete.com | /src/containers/SortingExamples/SortingExamples.js | UTF-8 | 11,524 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react'
import { withSize } from 'react-sizeme'
import Styled from 'styled-components'
import randomColor from 'randomcolor'
import sleep from '../../utils/sleep'
import { Tabs, Divider, Typography } from 'antd'
import CardPanel from '../../components/CardPanel'
const { TabPane } = Tabs... | true |
9786be2b467218fcdb77d2d813cf74e13a69ebd3 | JavaScript | dotcommarket/dot-com-v765 | /Sough/Sough/Scripts/edit/edit-car.js | UTF-8 | 5,452 | 2.765625 | 3 | [] | no_license | function toggleCarShape(type, x) {
var car1 = document.getElementById("vic1");
var car2 = document.getElementById("vic2");
var car3 = document.getElementById("vic3");
var car4 = document.getElementById("vic4");
var carShape = document.getElementById("car_shape");
if (carShape.value === x)... | true |
8fa0fdee2dc5c8999f555d10d3bffa7e908fec92 | JavaScript | rahuljain983/Basic_Learning | /FactoryPattern/script.js | UTF-8 | 228 | 2.765625 | 3 | [] | no_license | $( document ).ready(function() {
class Dog {
constructor() {
this.sound = 'woof';
}
talk() {
console.log(this.sound);
}
}
const sniffles = new Dog();
$('#mybtn').click(function() {
sniffles.talk();
});
}); | true |
4e16813c1e7c54c65c1f4e3394afb3b61fc4dda3 | JavaScript | gustavogte/master-g-en-code-g2 | /3_Kata_Computer_Science/13_Peticiones_HTTP/client.js | UTF-8 | 488 | 3.03125 | 3 | [] | no_license | const request = require('request'); // Solo se necesita poner una vez arriba
const getAuthorByBookName = (bookName) => {
const URL_OPEN_LIBRARY = `https://pokeapi.co/api/v2/pokemon/${bookName}`;
request.get(URL_OPEN_LIBRARY, (error, response, body) => {
if (response.statusCode == 200) {
const json = JSON... | true |
1579b53ef317f3892e984fd24c73181ce09af04f | JavaScript | CodeCoreYVR/lab_solutions_may_2021 | /js_promises/contrived_math_functions/solution.js | UTF-8 | 1,304 | 3.484375 | 3 | [] | no_license | function add(a, b) {
return new Promise((resolve, reject) => {
setTimeout(() => {
if (isNaN(a) || isNaN(b)) {
reject('All the arguments should be numbers');
}
resolve(a + b);
})
})
}
function mult(a, b) {
return new Promise((resolve, reject... | true |
9326b3608c0c471896aa02e3612d1b223bec5626 | JavaScript | njohnson7/launch-school-courses | /launch_school_210/lesson4_arrays/arrays_exercises.js | UTF-8 | 1,782 | 3.78125 | 4 | [] | no_license | /*----------------- 1 -------------------*/ console.log('-------- 1 ---------');
function lastInArray(arr) {
return arr[arr.length - 1];
}
console.log(lastInArray([1, 2, 3]));
console.log(lastInArray(['a', 'b', 'c', 'd']));
console.log(lastInArray(['a', 'b', 'c', 'd', 5, 6]));
/*---------------- 2 ----------... | true |
8fadae0860e9538d64d4dc15e0734fc3275efa7b | JavaScript | marlos-tacio/Cursos | /Javascript/curso 6/js/index.js | UTF-8 | 432 | 3.46875 | 3 | [] | no_license | var exp = /(\d\d)(\w)/g;
var resultado;
var alvo = '11a22b33c';
//console.log(exp.test(alvo));
while(resultado = exp.exec(alvo)) {
console.log(resultado);
}
exp = /-/g;
var anoMesDia = '2007-12-31';
console.log(anoMesDia.replace(exp, '/'));
exp = /[,;-]/;
var arquivo = '100,200-150,200;20';
console.log(arqu... | true |
704e90ec9a4dedba738adb26fa0bfccfdccede83 | JavaScript | yowlonglee/leetcode | /219.contains-duplicate-ii.js | UTF-8 | 655 | 3.28125 | 3 | [] | no_license | /*
* @lc app=leetcode id=219 lang=javascript
*
* [219] Contains Duplicate II
*/
// @lc code=start
/**
* @param {number[]} nums
* @param {number} k
* @return {boolean}
*/
var containsNearbyDuplicate = function(nums, k) {
// Return false on conditions when i and j are the same
if (nums.length === 1 || k === ... | true |
0bb99c540b492e6d8d5fb34cdd3a83355ebb4ce8 | JavaScript | ronaldnwilliams/StockTrader-frontend | /src/App.js | UTF-8 | 18,694 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import SiteNav from './components/SiteNav';
import IndicesBar from './components/IndicesBar';
import Login from './components/Login';
import Signup from './components/Signup';
import Account from './components/Account';
import Quote from './components/Quote';
import './App.css'... | true |
10ea5cae3577af7abf3d2c1f57060386ba6ddcda | JavaScript | cleydyr/bayes-snct-2017 | /index.js | UTF-8 | 968 | 2.6875 | 3 | [] | no_license | 'use strict';
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const training = require('./service/training.js');
const classifying = require('./service/classifying.js');
app.use(express.static('static'));
app.get('/treinar', function (req, res) {
res.redirect('... | true |
95ed4f7de919aa004ba0a41171352a94e6410b0c | JavaScript | Malaokia/book3 | /build/week13/individual/analysis.js | UTF-8 | 8,385 | 3 | 3 | [] | no_license | function analyze(){
//
// Getting To Know the Data
//
heading('Examples')
ask('how many measurements were included in this dataset?', example1)
ask('how many samples does each measurement contain?', example2)
ask('at the 10-th measurement, what are valid sample values (> 0)?', example3)
... | true |
df16e2fe1255b115fa13b5621ff8a1cf2f410d5e | JavaScript | alcampbell86/RogueLike | /actions.js | UTF-8 | 1,386 | 3.0625 | 3 | [] | no_license | var keyUp = 87;
var keyDown = 83;
var keyLeft = 65;
var keyRight = 68;
$(document).on("keyup", function(e) {
var code = e.which;
var mapAdjustment = [0,0];
if(code == keyUp) { //up
mapAdjustment = [0,-1];
} else if (code == keyDown) { //down
mapAdjustment = [0,1];
} else if (code == keyLeft) { //left
... | true |
abf2247c45c0f6369ef8fcca84aa430089ff4f82 | JavaScript | hli1295/wap | /classinheritance/test.js | UTF-8 | 4,445 | 3.015625 | 3 | [] | no_license |
// Account Testing
describe("Deposite", function () {
let account;
before(function(){
account = new Account(1);
account.deposit(100);
});
it("deposites money to account",
function () {
assert.equal(100, account.getBalance());
});
});
describe("Withdraw", fun... | true |
0b07d88b01aa56de819295a3c33b91c8c008fbbd | JavaScript | taxonrath/pyramid-slide | /WebContent/pyramid-slide.js | UTF-8 | 1,194 | 3.765625 | 4 | [] | no_license | var sliderVal = document.getElementById('slider');
var sliderLabel = document.getElementById('slider_label');
var symbolVal = document.getElementById('symbol');
var brickType = setBrickType();
function setBrickType() {
brickType = symbolVal.value;
drawPyramid(sliderVal.value, brickType);
return brickType;
}
func... | true |
d534aa0ff9d1eb7da170725fe2f26e3ac6e2da1a | JavaScript | petterhj/django-norloc | /norloc/static/js/main.js | UTF-8 | 4,673 | 2.78125 | 3 | [
"MIT"
] | permissive | // String format
if (!String.prototype.format) {
String.prototype.format = function() {
var args = arguments;
return this.replace(/{(\d+)}/g, function(match, number) {
return typeof args[number] != 'undefined' ? args[number] : match;
});
};
}
// Get URL paramete... | true |
bd5adf444d7d325c1a727aa4bd49d3548783949c | JavaScript | Aniket965/algo-world | /src/MergeSort.js | UTF-8 | 1,162 | 2.671875 | 3 | [
"MIT"
] | permissive | exports.Sort={
Merge:function (array,left,right,middle){
n1 = middle - left +1;
n2 = right - middle;
var L = [];
var R = [];
for(var i =0;i<n1;i++){
L[i] = array[left + i ];
}
for(var j=0;j<n2;j++){
R[j]=array[middle+j+1];
}
i = 0;
j = 0 ; ... | true |
b390a7a5116fa2c89a3f21f78c4780ae56124d69 | JavaScript | mbrz-0101/Train-Scheduler | /app.js | UTF-8 | 2,641 | 2.796875 | 3 | [] | no_license | function replaceString(string, index, replacement) {
return string.substr(0, index) + replacement + string.substr(index + replacement.length);
}
console.log(moment().format());
var config = {
apiKey: "AIzaSyDVCJJXeaRGHfIB5NjHXc2ErOLmUmloDLw",
authDomain: "first-firebase-... | true |
ee530edc6aff13ca8277100b5f9532ac50b09a5a | JavaScript | prakhadkash/sum-pair | /index.js | UTF-8 | 1,235 | 3.546875 | 4 | [] | no_license | const getRandomInt = max => {
return Math.floor(Math.random() * Math.floor(max));
}
const randomArray = []
const min = 1;
const max = 1000;
const sum = 999;
for (i = 1; i <= max; i++) {
randomArray.push(i)
}
const getPairOfSum = (data, sum) => {
const start = performance.now()
// Sorting.
data.sor... | true |
36afd8356e1bcc1525c6ce8ef437506117baf03c | JavaScript | tomas-hartman/wp-simple-calendar | /src/js/helpersAdmin.js | UTF-8 | 5,057 | 3.5625 | 4 | [] | no_license | import { validateEventDate } from './adminValidation/validateEventDate';
import { validateEventEnd } from './adminValidation/validateEventEnd';
import { validateEventLength } from './adminValidation/validateEventLength';
import { validateEventTime } from './adminValidation/validateEventTime';
import { validateTitle } f... | true |
33348949a5f5f4b1872a4bfbcc0b25e9be0ee341 | JavaScript | PriyaGupta29/first_react_apps | /src/Addition.js | UTF-8 | 1,541 | 3.140625 | 3 | [] | no_license | import React,{Component} from 'react';
import './Addition.css';
class Addition extends Component{
constructor(props){
super(props);
this.state = {
num1 :'',
num2 :'',
sum : '',
}
this.calculateSum = this.calculateSum.bind(this);
}
calcula... | true |
63f2d20309d5f2277f633337b5b31de7f8d4d53c | JavaScript | srinihal007/Coding-Class-C9 | /sketch.js | UTF-8 | 389 | 2.828125 | 3 | [] | no_license | var Nihal
function setup() {
createCanvas(400,400);
Nihal = createSprite(200,200,100,100);
Nihal.shapeColor = "Green"
}
function draw() {
background(30);
if (keyDown (RIGHT_ARROW)) {
Nihal.position.x +=5
}
if (keyDown(LEFT_ARROW)) {
Nihal.position.x -=5
}
if (keyDown(UP_ARROW)) {
Nihal.position.y -=5
}
if (ke... | true |
7162baa0b292a787ed228fb60e44c37f8a052f3f | JavaScript | a25salas/8BIT | /8bitCompiler_demo/output/call_salute.8bit.out.js | UTF-8 | 74 | 2.578125 | 3 | [] | no_license | function salute(s){printString(s);};function main(){salute("Hello 666!")}; | true |
deddf7f1d7a619ce03f7a75fa41e636610bf0897 | JavaScript | facugaich/proposal-temporal | /polyfill/test/Calendar/prototype/fields/non-string-element-throws.js | UTF-8 | 631 | 2.671875 | 3 | [
"ISC",
"BSD-3-Clause"
] | permissive | // Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.calendar.prototype.fields
info: |
sec-temporal.calendar.prototype.fields step 5:
5. For each element _fieldName_ of _fieldNames_, do
a. If Type(_fiel... | true |
7404c365c50563b0f2ea1c825a52b4bb7bb73548 | JavaScript | AdamPBell/mungedb-aggregate | /lib/pipeline/expressions/MultiplyExpression.js | UTF-8 | 1,324 | 2.828125 | 3 | [] | no_license | "use strict";
/**
* A $multiply pipeline expression.
* @see evaluate
* @class MultiplyExpression
* @namespace mungedb-aggregate.pipeline.expressions
* @module mungedb-aggregate
* @constructor
**/
var MultiplyExpression = module.exports = function MultiplyExpression(){
if (arguments.length !== 0) throw new E... | true |
be554613d6813431ceaa966dc2604abeedfe3cbd | JavaScript | AntonioRubioMenchero/videoPlayer | /src/controller/responceController.js | UTF-8 | 1,399 | 2.546875 | 3 | [] | no_license | const sqlite3 = require('sqlite3').verbose();
const Promise = require('bluebird');
const responce = require('../responceObject')
module.exports = class responceController{
constructor(){
let db = new sqlite3.Database("./db/multimedia.db");
this.db = db;
}
insert (responce){
... | true |
dcc6be630e7f7200a5426714cd1729f6b2d2c07f | JavaScript | donno/ardfmap | /server/js/ardfmap.login.js | UTF-8 | 1,992 | 2.859375 | 3 | [
"MIT"
] | permissive | /* A leaflet plugin for providing a login/logout button.
Copyright (c) 2013, Sean Donnellan
*/
function LoginCommand() {
//alert("the user wants to login.");
var data = {
'username': L.DomUtil.get('username').value,
'password': L.DomUtil.get('password').value,
};
var req = new XMLHttpRequest();
... | true |
6ce6d48381aa6574154bde6a76c87ed2dc475988 | JavaScript | kimstars/again | /DOM/get_element_methods/main.js | UTF-8 | 709 | 3.328125 | 3 | [] | no_license | // var headingNode = document.getElementsByClassName('heading');
// // console.log(typeof headingNode);
// var tagName = document.getElementsByTagName('p');
// // console.log(tagName);
// var cssSelector = document.querySelector(".heading:nth-child(3)"); // nth-child
// console.log(cssSelector);
// var cssAll =... | true |
81bfefc55036ab2260770087d46fddb2a3e34cc0 | JavaScript | NatalyaDol/lesson_1_js_level_2_goods_list | /script/goods_list.js | UTF-8 | 2,798 | 3.140625 | 3 | [] | no_license | var btnBasket = document.getElementById('basket-btn');
var btnBasketEs5 = document.getElementById('basket-btn-es5');
var goodsListSection = document.getElementById('goods-list-section');
const goods = [
{ title : 'Товар', price : 'Цена', src : 'image/products_photo/zefir_photo/zefir_7.jpg' },
{ title : 'Зефир',... | true |
6e653324fee03c999a9c23accccec941dab1f31b | JavaScript | Juliafin/random_projects | /full_stack_react/frontend/full_stack/src/components/Notes.js | UTF-8 | 396 | 2.640625 | 3 | [] | no_license | import React from 'react';
const Notes = (props) => {
let notesToRender
if (props.notes.length !== 0) {
notesToRender = props.notes.map((note, index) => {
return (
<li key={index} >{note}</li>
);
});
}
return (
<div>
<h2>Notes</h2>
<ol>
{not... | true |
b87e217eeed4715032a0619192d6909f82e24f60 | JavaScript | MarkExecution/test_execution | /js/parameterDisplay.js | UTF-8 | 1,584 | 2.59375 | 3 | [] | no_license | import {setElementVisibility} from './setElementVisibility.js';
export function parameterDisplay(quantity, page, sorting) {
setElementVisibility('iconExit', true);
setElementVisibility('messageOffice', true);
setElementVisibility('iconAuthorization', false);
const arrSorting = ['по имени пользователя п... | true |
3e65664b216a15054487accd40ba9f72f40f3cf4 | JavaScript | luweslen/study-scripts | /script-git-commands/src/createBranch.js | UTF-8 | 504 | 2.65625 | 3 | [] | no_license | require('dotenv').config()
const util = require('util')
const exec = util.promisify(require('child_process').exec)
async function main() {
try {
const [, , folderPath, nameBranch] = process.argv
await exec(`git checkout -b ${nameBranch}`, { cwd: `${folderPath}`})
const { stdout: outGitStatus } = await... | true |
2b97f983652db13b7363790f7d83c88ef1efca74 | JavaScript | kostova/mobileTesting | /samples/Android/specs/interactiveImageSwipeGestureSpec.js | UTF-8 | 1,523 | 2.625 | 3 | [] | no_license | spec(function() {
var queries = {
dragZoomRotateButton: { 'class': 'android.widget.Button', 'properties': { 'text': 'Drag, Zoom and Rotate' } },
interactiveImage: { 'class': 'com.telerik.demoapplication.InteractiveImage' },
layout: { 'class': 'android.widget.LinearLayout' }
};
var stepRepository = {
'Give... | true |
9bd659a4e3490a63a556277a127a58d59c32b16a | JavaScript | Obsidiano/leftovers-again | /src/reporters/matchstatus.js | UTF-8 | 2,981 | 2.84375 | 3 | [] | no_license | const chalk = require('chalk');
const HP_BAR_LENGTH = 10;
const EXTRA_MON_ICON = 'O';
const DEAD_MON_ICON = 'X';
const UNKNOWN_MON_ICON = '?';
// const MY_BACKGROUND = chalk.bgYellow;
// const YOUR_BACKGROUND = chalk.bgCyan;
const MY_TEXT = chalk.bold.black;
const YOUR_TEXT = chalk.bold.black;
const EMPTY = ' ... | true |
f3bbf162b33634cd6f02648c891fc4d661cbb72e | JavaScript | sjha2048/CompModelMatch | /app/assets/javascripts/creators.js | UTF-8 | 2,473 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | function updateCreatorSettings() {
var html = '';
var creators_arr = [];
for(var i = 0; i < creators.length; i++) {
var creator = creators[i];
html += HandlebarsTemplates['creator']({ creator: creator, prefix: resourceType });
creators_arr.push([creator.name, creator.id]);
}
... | true |
55c271d2eac2553400e8d329af163767a3d00278 | JavaScript | AbodyAmer/pairProgramming | /src/index.js | UTF-8 | 1,490 | 2.703125 | 3 | [] | no_license | const express = require("express");
const mongoose = require("mongoose");
const bodyParser = require("body-parser");
const crypto = require("crypto");
const User = require("./users");
mongoose
.connect("mongodb://ds047955.mlab.com:47955/pairprogramming", {
useNewUrlParser: true,
user: "abody",
pass: "hWT... | true |
abc4742417fb1d449764f45c2328385933b70751 | JavaScript | BobChao87/eslint-history | /src/eslint/read_file.js | UTF-8 | 829 | 3.109375 | 3 | [] | no_license | const readFileSync = require('fs').readFileSync;
/**
* @function readFile
*
* @description
*
* Takes a file object and opens and parses the file to extract information
* about the issues that are associated with this file.
*
* @param {Object} file Singular file instances from `parse`.
* @return {Object} Updat... | true |
dfd143cdbcf4c1cc697bfd2a34b80ef17d4a1daf | JavaScript | udartapkom/movies-explorer-frontend | /src/components/Validation/Validation.js | UTF-8 | 790 | 2.546875 | 3 | [] | no_license | import { useState } from 'react';
export const useFormWithValidation = () => {
const [values, setValues] = useState({});
const [errors, setErrors] = useState({});
const [isValidForm, setIsValidForm] = useState(false);
const handleInputChange = ({ target }) => {
const { name, value } = target;
setValu... | true |
4f55a5811f9abeb2d2d2111ab9bffc80e5b39592 | JavaScript | Victorrrocha/e-shopping-project | /src/pages/Home.js | UTF-8 | 1,113 | 2.5625 | 3 | [] | no_license | import CategoryContainer from "../components/CategoryContainer"
// import { getCategories } from "../api/fakestore_api"
// import useProducts from "../hooks/use-products"
import { Grid } from "@mui/material"
const categories = ['electronics', 'jewelery', "men's clothing", "women's clothing"]
const Home = () => {
... | true |
9a25a6c1a30312b271bc2729e35ddcdbe31786e5 | JavaScript | rpt24saltysnack/somebirdsColorAndSizeSelection | /test/api_endpoints.test.js | UTF-8 | 1,512 | 2.78125 | 3 | [
"MIT"
] | permissive | import { expect } from 'chai';
const shoes = require('../model');
const exampleData = require('./exampleData/endpoint_responses.js');
const [shoeID, colorID] = [1, 1];
describe('API Endpoints', () => {
it('GET request to /shoes/:shoeId/colors should return data that matches example data', () => {
return shoes.g... | true |
780ab726f05ac34b969c2e471edd04c4480225dc | JavaScript | HHH1994/NodePractice | /koa/logger.js | UTF-8 | 1,114 | 2.59375 | 3 | [] | no_license | /**
* Created by HHH on 2018/11/11.
*/
const logger = require("koa-logger");
const file = require("fs");
const logMidWare = logger(function(str,args){
/* let logMsg ="";
if(args.length>3){
logMsg+="========>Request";
logMsg+= " 请求类型: "+args[1];
logMsg+= " 接口名: "+args[2];
logMsg... | true |
cfb9e08b1a4d816e72366f0bd2caa5e0d62a6a4a | JavaScript | elmsln/lrnwebcomponents | /elements/moment-element/lib/moment/src/lib/moment/start-end-of.js | UTF-8 | 1,322 | 3.34375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | import { normalizeUnits } from "../units/aliases";
export function startOf(units) {
units = normalizeUnits(units);
// the following switch intentionally omits break keywords
// to utilize falling through the cases.
switch (units) {
case "year":
this.month(0);
/* falls through */
case "quarter... | true |
6d6213566cbc0404b0b88b3eb8cd3c55a8ea2f03 | JavaScript | Aashna15/C-34 | /sketch.js | UTF-8 | 1,607 | 2.71875 | 3 | [] | no_license | const Engine = Matter.Engine;
const World= Matter.World;
const Bodies = Matter.Bodies;
const Constraint = Matter.Constraint;
var engine, world;
var box1 , box2, box3 , box4 , box5 , box6,box7,box8,box9,box10,box11,box12 , box13 , box14 , box15;
var ground;
var ball;
var rope;
function setup(){
var... | true |
75a8adef6e572172e52b5e773ed8c8fc2daad80f | JavaScript | samcomma/Data_Structures | /Sorting/Sorting Algorithms Study.js | UTF-8 | 8,640 | 4.21875 | 4 | [] | no_license | // SORTING ALGORITHMS:
// --------------------------------------------
/*
A sorting algorithm is an algorithm that puts elements of a list in a certain order.
Efficient sorting is important for optimizing the use of other algorithms
(such as search and merge algorithms) which require input data to be in sorted... | true |
6947f4ab47439355b12cc90ad4cd1c47ef729c13 | JavaScript | Sirrine-Jonathan/plain-canvas-game | /Object.js | UTF-8 | 268 | 2.609375 | 3 | [] | no_license | class Object {
constructor(position, velocity){
this.update = this.update.bind(this);
this.draw = this.draw.bind(this);
this.position = position || new Point();
this.velocity = velocity || new Velocity();
this.view = null;
}
update(){
}
draw(){
}
} | true |
f253e0ffe8090f1620b3acfb3bd1cc32d819ef12 | JavaScript | fiqus/lqchatex | /assets/js/app.js | UTF-8 | 2,091 | 2.6875 | 3 | [
"MIT"
] | permissive | // We need to import the CSS so that webpack will load it.
// The MiniCssExtractPlugin is used to separate it out into
// its own CSS file.
import css from "../css/app.css"
// webpack automatically bundles all modules in your
// entry points. Those entry points can be configured
// in "webpack.config.js".
//
// Import... | true |
f6e582b855196b1567287921f38bd18e2a2607ae | JavaScript | lalojuarez10/SE-Class-Project- | /client/src/actions/itemActions.js | UTF-8 | 2,067 | 3.03125 | 3 | [] | no_license | // make our requests to our backend
import { GET_ITEMS, ADD_ITEM, DELETE_ITEM, ITEMS_LOADING } from './types';
import axios from 'axios';
import { tokenConfig } from './authActions'; // Gets token from local storage
import { returnErrors } from './errorActions';
// each returns an action object with a type (and pay... | true |
ed6143e552f0b488ca956a868f50335c89a4dbf8 | JavaScript | wooki/insyssim | /public/javascripts/app.js | UTF-8 | 3,218 | 3.015625 | 3 | [] | no_license | var insyssim = {
bodies: false,
create_body: function(data, layer) {
var radius = data.radius;
if (radius < 100) {
radius = 50 + (radius * 5);
}
var circle = new Kinetic.Circle({
x: data.x,
y: data.y,
radius: radius,
f... | true |
285feed517e1e03d225b21c361e918abc0a9a124 | JavaScript | tmzks/practice_ljh | /2020_02_27/lecture3.js | UTF-8 | 2,260 | 4.21875 | 4 | [] | no_license | //객체는 데이터와 기능을 논리적으로 묶어 놓은것이다.
//객체는 메서드라는 녀석과 프로퍼티라는 녀석을 가지고 있다.
//객체의 메서드는 어떤 객체가 수행할 수 있는 기능이며, 프로퍼티는
//이 객체가 가지고 있는 정보입니다.
//물질적 정신적인 것, 추상적인 것들을 표현 할 수 있다.
//사람의 몸은
//상체
// 가슴, 머리 , 목 , 팔 , 복부
//하체
// 엉덩이, 허벅지, 종아리, 발목,발
//사람의 기능
//소리치는 것(머리에서 목으로 명령을 전달하여 소리를 내는 것 )
//팔을 움직이다. (머리에서 상체로 팔로 명령을 전달해서 ... | true |
203cc732ce2cbf178aa82f2bd67cd7422df23b5a | JavaScript | raousamabinsohail/Mystery-Shopping-Web-Client | /src/Dashboard/combobox.jsx | UTF-8 | 1,949 | 2.625 | 3 | [] | no_license | import React, { Component } from "react";
import $ from "jquery";
import Auth from "../auth";
// import { Helmet } from "react-helmet";
class ComboBox extends Component {
state = {
tableNames: [],
selectName: "Table Name",
address: []
};
componentDidMount() {
fetch("https://mysteryshopper1.azurew... | true |
d77589bdb76576604f58d82401ea89e9d42068cb | JavaScript | mmstarz/js_algorithms_data_structures | /jsHelpFunctions/objects/object1.js | UTF-8 | 4,051 | 4.15625 | 4 | [] | no_license | /*
var x1 = {}; // new object
var x2 = ""; // new primitive string
var x3 = 0; // new primitive number
var x4 = false; // new primitive boolean
var x5 = []; // new array object
var x6 = /()/ // new regexp object
var x7 = function(){}; // new function objec... | true |
a11b3c01e9f90353c789eb46c0902e224887b1be | JavaScript | ian-kevin126/JavaScript-Knowledges | /src/3_Data_Structures_and_Algorithms/Data_and_Algorithms_1/algorithms_1/es/durstenfeldShuffle.js | UTF-8 | 443 | 3.203125 | 3 | [] | no_license | /*
A JavaScript module which performs a Durstenfeld shuffle on a given array.
*/
'use strict'
const durstenfeldShuffle = (input = null) => {
if (input === null) return null
let index = input.length
while (index !== 0) {
let shuffleIndex = Math.floor(Math.random() * index--)
let swap = input[index]
... | true |
fa355d66fa95f8c81ee858117ac78137b5099b6a | JavaScript | abhisheksharma78/jsexercie | /intermediate/myObjects.js | UTF-8 | 82 | 2.625 | 3 | [] | no_license | var inter = {
title: "object",
name:"abhishek"
}
console.log(inter.title) | true |
a4511bf81a1113bc747d25f16947a0c154f96493 | JavaScript | marijnbent/liskvoter | /src/views/VoteFieldsPools.js | UTF-8 | 1,989 | 2.640625 | 3 | [] | no_license | import {View} from 'backbone';
import _ from 'underscore';
/**
* Object representing the pools in the VoteFields
*
* @constructor
*/
const VoteFieldsPools = View.extend({
templateVotes: '',
templateError: '',
events: {
'click button': 'submitHandler'
},
initialize: function ()
{
... | true |
64c0b07b04950a3511768dde3217bc8e95832b4b | JavaScript | edwardbrowncross/cyf-homework-arrays-prototype | /index.js | UTF-8 | 3,253 | 3.359375 | 3 | [] | no_license | // ❌ You do not need to modify this code.
// ❕ This code is not a good example of what a modern web app should look like.
(function closure () {
const TODO_LIST_SELECTOR = '#todos';
const ERROR_SELECTOR = '#error';
const NEW_TODO_VALUE_SELECTOR = '#new-todo input[type=text]';
const TODO_FORM_SELECTOR = 'form';
... | true |
81b100ffbc9177967914b8212a054c220e9e5af4 | JavaScript | storresc15/lightningComponentsRep | /force-app/main/default/aura/Example_ShowProgressBar/Example_ShowProgressBarController.js | UTF-8 | 1,212 | 2.625 | 3 | [] | no_license | ({
showStep1 : function(component,event,helper){
component.set("v.questionNumber", "One");
},
showStep2 : function(component,event,helper){
component.set("v.questionNumber", "Two");
},
showStep3 : function(component,event,helper){
component.set("v.... | true |
4909123a9dd070a7961673f63e29bafc28a1e811 | JavaScript | kimini507/Coursor | /spring-security-hibernate-annotation/src/main/webapp/resources/js/um/um.js | UTF-8 | 910 | 2.546875 | 3 | [] | no_license | $(document).ready(function() {
bindUserTabEvents();
searchUser();
});
function bindUserTabEvents(){
$("#SEARCH_USER").click(searchUser);
}
function searchUser(e){
var json = {id: "2"}
showLoadingCover($("#USER_LIST"));
doAjaxRequest('get/user/list', {}, showUserList);
}
function showUserList(userList... | true |
6237b917a26fc312366f6c0d2157154af5af51da | JavaScript | ArtemS83/goit-js-hw-11-color-switch | /src/index.js | UTF-8 | 2,306 | 2.9375 | 3 | [] | no_license | import './styles.css';
const colors = [
'#FFFFFF',
'#2196F3',
'#4CAF50',
'#FF9800',
'#009688',
'#795548',
];
function randomColor(arr) {
return arr[randomIntegerFromInterval(arr.length - 1)];
}
function randomIntegerFromInterval(max, min = 0) {
return Math.floor(Math.random() * (max - min + 1) + min);... | true |
933938f0ddd53ab36ad522753ccdceae688861df | JavaScript | orangemug/isorouter | /example/elements/layout.js | UTF-8 | 698 | 2.53125 | 3 | [] | no_license | var React = require("react");
class Layout extends React.Component {
constructor(props) {
super(props);
this.state = {}
}
componentWillReceiveProps() {
this.setState({
navigating: false
});
}
componentDidMount() {
var self = this;
var router = require("../routes");
route... | true |
f6996539ef12f3f9d8059e6e6a1231ab4fefca5a | JavaScript | alicin/introduction-to-functional-programming | /src/sections/filter-map-reduce/examples/chain-methods.js | UTF-8 | 563 | 3.390625 | 3 | [] | no_license | const pets = [
{ type: 'rock', age: 10000, name: 'Sylvester' },
{ type: 'dog', age: 10, name: 'Duke' },
{ type: 'cat', age: 4, name: 'Eggnog' },
{ type: 'dog', age: 2, name: 'Buddy' },
{ type: 'dog', age: 6, name: 'Optimus' },
{ type: 'rat', age: 2, name: 'Scabbers' },
];
const totalAgeInDogYears = pets
... | true |
db9983665130ae98d5a148879c6a09c7d566624f | JavaScript | Ariza97/Proyecto_WAD | /EnglishSchoolWAD/build/web/js/createHW1.js | UTF-8 | 1,489 | 2.890625 | 3 | [] | no_license | var id;
var imgpath;
var canvas = new fabric.Canvas('lienzo');
canvas.setHeight(500);
canvas.setWidth(825);
function permitirDrop(event){
event.preventDefault();
}
function dragStart(event){
id = event.target.id;
}
function drop_lienzo(event){
imgpath = document.getElementById(id).src;
i... | true |
8e63e300d7ec42e9f242b31641cd06ecc1b1d407 | JavaScript | atrinik11/hangman | /assets/javascript/game.js | UTF-8 | 6,397 | 3.28125 | 3 | [] | no_license | //Create an array of the words
var superHeroNames = [
"supergirl",
"wonderwoman",
"batgirl",
"bumblebee",
"harleyquinn",
"katana",
"poisonivy"
];
var blankedInput;
var wins = 0;
var losses = 0;
var guessLeft = 9;
var letterAlreadyGuessed = [];
var computerSelectedName;
var wordLength;
var wordImage;
var ... | true |
ba56aea4d4e4a6616ee6d2d600425143a7e9ff99 | JavaScript | sthasub/Visualiser | /seed/seedData.js | UTF-8 | 4,886 | 2.671875 | 3 | [
"MIT"
] | permissive | const mongoose = require("mongoose");
const db = require("../models");
// This file empties the Books collection and inserts the books below
mongoose.connect(
process.env.MONGODB_URI ||
"mongodb://localhost/healthVisualiser", {
useNewUrlParser: true,
useFindAndModify: false,
useUnifiedTopology: tr... | true |
0560caffbb53e4f865c47e643246f7a83f33a95b | JavaScript | shekhar94/coding | /google/graph/count-sub-islands.js | UTF-8 | 1,122 | 3.1875 | 3 | [] | no_license | var countSubIslands = function (grid1, grid2) {
const [R, C] = [grid1.length, grid1[0].length];
const visit = new Array(R).fill(false).map(() => new Array(C).fill(false));
const directions = [[1, 0], [-1, 0], [0, 1], [0, -1]];
function dfs(r, c) {
if (r === R || c === C || r < 0 || c < 0 || gri... | true |
2522881e46bb8fca285baccdfb428bcbad1f01f5 | JavaScript | Darui666/alibaixiu | /public/assets/js/add-post.js | UTF-8 | 1,953 | 2.59375 | 3 | [] | no_license | // 向服务器发送请求,获取文章分类数据
$.ajax({
type:'get',//get或post
url:'/categories',//请求的地址
data:{},//如果不需要传,则注释掉 请求的参数,a=1&b=2或{a:1,b:2}或者jq中的serialize方法,或者formData收集
dataType:'json',
success:function(result){//成功的回调函数
console.log(result)
var html = template('categoryTPL',{data:result});
$('#category').html(ht... | true |
e8ab1c59c66e73a40525c417680c6d0fc5dcaf77 | JavaScript | shenjinxi/alcojs | /src/functions/isValidUid.js | UTF-8 | 135 | 2.578125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | const uidRegexp = /^\d{10,25}$/;
export default function isValidUid(uid) {
if (!uid) return false;
return uidRegexp.test(uid);
};
| true |
eea51a72ebee344bd17a6a19727134d83ce7ce37 | JavaScript | sullypierce/reactive-nutshell | /src/components/message/MessageCard.js | UTF-8 | 1,659 | 2.640625 | 3 | [] | no_license | /* author: James Chapman | purpose: This will create the cards that messageList uses to populate the message board */
import React, { Component } from 'react'
import "../Nutshell.css"
const getUserId = () => JSON.parse(localStorage.getItem("credentials")).userId
class MessageCard extends Component {
render... | true |
ef5061a1411dc2b2647b6f55175c4a4b9fc074fb | JavaScript | YYYYMao/LeetCode | /257. Binary Tree Paths/257.js | UTF-8 | 797 | 3.40625 | 3 | [] | no_license | Given a binary tree, return all root-to-leaf paths.
Note: A leaf is a node with no children.
Example:
Input:
1
/ \
2 3
\
5
Output: ["1->2->5", "1->3"]
Explanation: All root-to-leaf paths are: 1->2->5, 1->3
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
... | true |
e3b6db6481446861b293f5730f520b6398582112 | JavaScript | giscafer/weapp-quatedaily | /src/utils/ImageZoom.js | UTF-8 | 1,735 | 2.984375 | 3 | [
"MIT"
] | permissive | /**
* @author: giscafer ,https://github.com/giscafer
* @date: 2018-12-11 15:09:06
* @description: 图片缩放类
*/
export default class ImageZoom {
/**
* @param {number} width 图片宽度
* @param {number} height 图片高度
* @param {number} maxWidth 图片最大宽度
* @param {number} maxHeight 图片最大高度
*/
constructor(width, he... | true |
6fa8ea6186ecbac8c00b5edb5523b99bae7c7928 | JavaScript | Pliman/practising | /web-practise/js/testJS/ext/JavaScript凌厉开发Ext详解与实践源代码/第04章 事件教程/JavaScript源码清单4-3-19.js | UTF-8 | 178 | 2.78125 | 3 | [] | no_license | //假设已有一个名为'my-object'的Ext组件,我们用Ext.getCmp返回该对象
Ext.util.Observable.capture(Ext.getCmp('my-object'), function(e){
console.info(e);
});
| true |
d2da401f6f39829f039e5eb67572b2a4fa5d50e4 | JavaScript | kleva-j/iReporter | /UI/js/getRecords.js | UTF-8 | 4,363 | 2.609375 | 3 | [
"MIT"
] | permissive | /* eslint-disable consistent-return */
/* eslint-disable array-callback-return */
const { log } = console;
const Fetch = async (url, method, data) => {
const headers = new Headers();
headers.append('authorization', `Bearer ${localStorage.getItem('BEARER_TOKEN')}`);
const request = new Request(url, {
headers,... | true |
de3d63134d5b10c90f88179a1158d84e0b5a2348 | JavaScript | benobee/scrollmap | /dist/scrollmap.js | UTF-8 | 13,942 | 2.515625 | 3 | [] | no_license | "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.proto... | true |
346efa7c7f996f30e708b64315c8e52d95773d16 | JavaScript | abraxaswisz/arthistorian | /src/helpers.js | UTF-8 | 372 | 3.375 | 3 | [] | no_license | export function randomNumber(array) {
return Math.floor(Math.random() * array.length);
}
export function mixArray(array) {
let newArray = [];
let ble;
while (array.length > 0) {
ble = array.splice(randomNumber(array), 1);
newArray.push(ble.toString());
}
newArray.map(key => {
return array.push(... | true |
f36cd59f2aad20340925f2771bd818edac8530f6 | JavaScript | Daniel95/Endless | /scripts/EnemyStandard.js | UTF-8 | 1,794 | 2.703125 | 3 | [] | no_license | //SubClass
/*
function EnemyStandard(parent) {
//var parent = this
self.color = "#04B431";
parent.jumpSpeed = 0;
parent.speed += parent.speed * Math.random() - self.speed / 2;
parent.size.x += parent.speed;
parent.size.y += parent.speed;
console.log("NOTJUMPER");
... | true |
fb411b5fcc85149c445035c73d43f7e6afc187af | JavaScript | yangxin1994/farvekonfigurator | /color-modular/color721.js | UTF-8 | 119 | 2.515625 | 3 | [] | no_license | (function() {
// Make the color #721
HTMLElement.prototype.color721 = function() { this.style.color = '#721' }
})() | true |
b9797b6a97c08850ccfbcbc3bbc9726dd3ba0531 | JavaScript | lvivduncan/levus-shop | /js/levus-shop.js | UTF-8 | 7,763 | 3.171875 | 3 | [] | no_license | // 20-06-2020
// назва сховища
const BASKET = 'basket';
// клас, що відповідає за кошик на сторінці -- загальна ціна, кількість товарів, товари тощо
class Basket {
static getQuantity() {
return document.querySelector('#basket-quantity');
}
static getSum() {
return document.querySelector('#basket-sum');
}
... | true |
ecef313c5db643a3ef9faffefb3d033a320fd2fe | JavaScript | cfjedimaster/Serverless-Examples | /activationpoll/public/app.js | UTF-8 | 1,119 | 2.53125 | 3 | [] | no_license | // https://forum.vuejs.org/t/how-to-format-date-for-display/3586/5
Vue.filter('formatDate', function(value) {
if (value) {
return moment(value).format('MM/DD/YYYY [at] h:mma');
}
});
const app = new Vue({
el:'#app',
data() {
return {
activations:[],
last:0,
activation:null
}
},... | true |
91ef38ff41ecf8c9e23366b87f96949b25b58c88 | JavaScript | immune-js/immune | /src/types/collection/index.js | UTF-8 | 14,579 | 2.609375 | 3 | [
"MIT"
] | permissive | import
{ IAssociative
, IKeyed
, IIndexed
, IMonoid
, IFunctor
, IBind
, ICollection
, IShow
} from '../../protocols'
import
{ Maybe
, maybe
, getOrElse
} from "../maybe"
import
{ caseOf
} from '../../utils/union'
import
{ augments
} from '../../utils/protocol'
/*
* assocIn(coll: ... | true |
221b45c766249c2be71a9aac4487c2a14dec31ca | JavaScript | Kiahbear/objectsCar | /public_html/carObjectJS.js | UTF-8 | 704 | 3.515625 | 4 | [] | no_license |
function Car(modelYear, make, speed){
this.modelYear = modelYear;
this.make = make;
this.speed = 0;
this.getModelYear = function() {return this.modelYear;};
this.getMake = function() {return this.make;};
this.getSpeed = function() {return this.speed;};
this.accerlerate = function() {return this.speed + 5;};... | true |
8f66c8dc7f0f189121102915bb9b5fcf171265f7 | JavaScript | emzhofb/sisasisahacktiv8 | /coding/live-code-week5/002.js | UTF-8 | 2,417 | 4.375 | 4 | [] | no_license | /*
======================
Highest Global Minimum
======================
[INSTRUCTIONS]
highestGlobalMinimum adalah sebuah function yang menerima dua parameter,
dan keduanya merupakan array of number.
Function akan mendapatkan angka minimum dari masing-masing array yang diinput sebagai parameter,
kemudian ... | true |
e977ec27b95591c13f8808d89220d88fc87cc105 | JavaScript | looprandom/js-algorithm | /src/回溯/复原IP地址.js | UTF-8 | 675 | 2.875 | 3 | [
"MIT"
] | permissive | var restoreIpAddresses = function(s) {
let res = []
let tmp = []
dfs(0)
return res
function dfs(start) {
if (tmp.length === 4 && start === s.length) {
res.push(tmp.join('.'))
return
}
if (tmp.length === 4 && start < s.length)
return
... | true |
36b699d78126538cf0591d23f58e7b0e677b0805 | JavaScript | homeboyshabby/mernstackfrontend | /src/admin/helper/adminapicall.js | UTF-8 | 2,649 | 2.65625 | 3 | [] | no_license | import { API } from "../../backend";
//category based calls
export const createCategory = (userId, token, categoryName) => {
return fetch(`${API}category/create/${userId}`, {
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Authorization: `Bearer ${... | true |
13ac9a4046d869f387f04c10b0683c2848caa62e | JavaScript | nacaceres/Lockers-app | /routes/lockers.js | UTF-8 | 1,401 | 2.515625 | 3 | [
"MIT"
] | permissive | var express = require('express');
var router = express.Router();
function connect(callback) {
var MongoClient = require("mongodb").MongoClient;
var url = "mongodb+srv://dfnino10:<password>@cluster0-xlopf.mongodb.net/test?retryWrites=true&w=majority"
var client = new MongoClient(url);
client.connect(functi... | true |
ab471f733090d69e64c50403b934b05faa3d4d43 | JavaScript | clonex10100/hackmud | /clonex10100/scripts/auto.js | UTF-8 | 2,483 | 2.609375 | 3 | [] | no_license | function(context, args)
{
//Checks if lock is solved
function c(){
try{
return !run.includes("not the correct");
}
catch(err){
//out.msg += tar + " Loc failed\n";
notSolved = false;
}
};
//Runs target
function r(){
run = args[tar].call(d);
}
//Checks specified lock with each value
function... | true |
4e950c2ef59c7aa6fb716c462c682ecc0ad4e76c | JavaScript | devcronberg/undervisning-js-opgaver | /002variabler/app.js | UTF-8 | 259 | 3.734375 | 4 | [] | no_license | "use strict";
let tal = 10;
tal++;
tal += 1;
tal = tal + 1;
console.log(tal);
let tekst = "test";
console.log(tekst);
let tekst2 = tekst.toUpperCase();
console.log(tekst2);
let antal = 10;
let template = `Der er ialt ${antal} styk`;
console.log(template);
| true |
c954f53feb19ec703046ebcdf28a620bba5b514c | JavaScript | trohde13/redux-feedback-loop | /src/components/ReviewPage/ReviewPage.jsx | UTF-8 | 1,228 | 2.53125 | 3 | [] | no_license | import {useSelector} from 'react-redux';
import { useHistory } from 'react-router-dom';
import axios from 'axios';
function ReviewPage() {
const feedbackReducer = useSelector(state => state.feedbackReducer);
const history = useHistory();
console.log('in the ReviewPage');
const handleSubmit = () => ... | true |
9ddd21cd818ca86337b2718ed5c388c014f6a7cf | JavaScript | ideal-life-generator/carcase | /carcase.js | UTF-8 | 3,387 | 2.625 | 3 | [] | no_license | (function() {
var Carcase, Controller, Model, Module, Tool, View, carcase,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype... | true |
4b122ba6cde8203792c77e8566d1fbfc90f69bc5 | JavaScript | mouse-reeve/cormorant | /cormorant.js | UTF-8 | 4,414 | 3 | 3 | [] | no_license | class Cormorant {
constructor() {
// spine length is the reference for all other bird dimensions
this.spine_length = 200
this.default_spine_theta = (3 * PI) / 4
this.default_head_theta = PI
this.default_wing_stretch = 0.8
// fixed point where it is standing
t... | true |
0be0d070d4301998dc8dd1d5094dbf1dd8c76c85 | JavaScript | RossMci/DNDCommityPHP | /js/dnd.js | UTF-8 | 1,465 | 2.75 | 3 | [] | no_license | function openNav() {
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft = "0";
}
var slideIndex = 1;
showSlides(sl... | true |
35dd41394ed81ee06f217c73c993cfdaf2e5b89d | JavaScript | step-batch-7/todo-nooranasrin | /public/js/responseHandler.js | UTF-8 | 3,091 | 2.84375 | 3 | [] | no_license | const generateDiveWithElements = function(html) {
const tempDiv = document.createElement('div');
tempDiv.innerHTML = html;
return tempDiv.firstChild;
};
const formatTodoItems = function(tasks, patternDiv) {
const taskDiv = generateDiveWithElements('<div class="task"></div>');
patternDiv.appendChild(taskDiv);... | true |
473b2669fce68e6881c42781411ca4e886f17d82 | JavaScript | jackyk/Class101 | /P5SJ/Work1/bounce.js | UTF-8 | 367 | 3.234375 | 3 | [] | no_license | x = 300;
y = 200;
speedInX = 5;
speedInY = 5;
width = 500;
height= 500;
function setup(){
createCanvas(width,height);
bg = loadImage("images/Screenshot.png");
}
function draw(){
//clear();
background(bg);
x =x+speedInX;
y =y+speedInY;
ellipse(x,y,40,40);
if (y > height-10 || y < 0+10){
y =speedInY*-1;
}
if (x > ... | true |
9fc4e23abdb4d024ae9a7c9999c8cf474d721956 | JavaScript | BossMan144/Class-20-Project-Astronaut-Docking-and-Undocking | /sketch.js | UTF-8 | 5,984 | 2.65625 | 3 | [] | no_license | var sea,sub,mine,shark,squid,coins,chest;
var seaImg,subImg,sub_collidedImg,mineImg,sharkImg,squidImg,coinsImg,chestImg;
var minesG,sharksG,squidsG,coinsG,chestsG;
var treasureCollection = 0;
var score
var gameOverImg,restartImg;
var subSound,sharkSound;
//Game States
var PLAY=1;
var END=0;
var gameState=PLAY;
func... | true |
bf390732eff7dc57bd854e3b200e5a8eab446b42 | JavaScript | LagutinT/Test_task | /task.js | UTF-8 | 5,493 | 3.1875 | 3 | [] | no_license | function statement(invoice) { // Убрал лишний аргумент функции 'plays', т.к. он является лишним и программа в нем не нуждается.
let totalAmount = 0; // общая сумма.
let volumeCredits = 0; // сумма бонусов.
let result = `Счет для ${invoice.customer}\n`; // изменил одинарные кавычки на обратные для отображени... | true |
26686cfbf1efe04184929ff4f9c5c03563f9a20b | JavaScript | daidaidashixiong258/z2 | /dist/5.js | UTF-8 | 802 | 4 | 4 | [] | no_license | "use strict";
// 多态
class Animal {
constructor(name) {
this.type = '';
this.kk = 'kk'; // private成员不能被子类重写
this.name = name;
}
eat() { }
}
/* class Dog extends Animal {
protected type: string = 'dog' // 子类重写父类属性时必须要和父类成员的修饰符和类型一样
private kk: string = '5' // private成员不能被子类重写
... | true |
5cae7ad91cec65f3c4d5cddf676d0928aa86d3c5 | JavaScript | Nakaharen/imersao-dev | /aula-1/index.js | UTF-8 | 407 | 3.3125 | 3 | [] | no_license | let valorEmDolarTexto = prompt("Qual o valor em dolar que você quer converter?");
let valorEmDolarNumero = parseFloat(valorEmDolarTexto);
let valorEmReal = valorEmDolarNumero * 5.50;
let valorEmRealFixado = valorEmReal.toFixed(2);
alert(valorEmRealFixado);
/*
Revisão
variáveis var int - float - strin... | true |
2d82081ee17f9a3ad936669f1a626397c9ed24b8 | JavaScript | dittyQu/RouteOptimizer | /CustomervisitApp/WebContent/js/visitList.js | UTF-8 | 12,825 | 2.8125 | 3 | [
"MIT"
] | permissive | var visitList = {
drag : function(event){
//お客様ID
var row = jQuery(event.currentTarget).closest('tr');
//お客様番号
var customerId = jQuery(row).find('td.customerId').text();
console.log(event.currentTarget.id);
// jQuery(row).data('event',{
// title:customerId +'先へ訪問',
// stick:true
// });
// jQuer... | true |
53a96893a4aebd4ec0f065938abf8b4e677fd0f5 | JavaScript | eliudjgomezg/ejercicios-con-array | /ejercicio5.js | UTF-8 | 210 | 3.71875 | 4 | [] | no_license | //Mostrar cada elemento del array recorriendolo
let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday']
for(let i=1; i<=myArray.length; i++){
console.log(myArray[i - 1])
}
| true |