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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
024c663c7af764ff8d00b04a1edc718c8bd2fb27 | JavaScript | dshue20/interview-prep | /javascript/jumpGame.js | UTF-8 | 971 | 4.25 | 4 | [] | no_license | // Given an array of non-negative integers, you are initially positioned at the first
// index of the array.
// Each element in the array represents your maximum jump length at that position.
// Your goal is to reach the last index in the minimum number of jumps.
// Example:
// Input: [2,3,1,1,4]
// Outp... | true |
8bb4999b14f0f6b0ea306b122d8c89fe2c6933be | JavaScript | chiangshtaa/recursion-exercises-base | /dominator.js | UTF-8 | 1,037 | 2.75 | 3 | [] | no_license | const { flattenTreeToArray } = require('./dom-util');
const _ = require('underscore');
const getElementById = function(root, id) {
// Your code here
const elements = flattenTreeToArray(root);
let result;
elements.forEach((el) => {
if (el.id === id) {
result = el;
}
});
return result;
};
cons... | true |
f11d14e929d650d56e9e8639d8f856622e75cb59 | JavaScript | stefanjudis/cushion-cli | /lib/commands/generalCommands.js | UTF-8 | 6,314 | 2.671875 | 3 | [
"MIT"
] | permissive | 'use strict';
/*
* cushion-cli
* https://github.com/stefanjudis/cushion-cli
*
* Copyright (c) 2012 stefan judis
* Licensed under the MIT license.
*/
var generalCommands = module.exports = {},
cHelp = require('../help/help'),
clc = require('cli-color'),
connectionCallbacks = require('../callbacks/conn... | true |
236d8ba4192e4c0bdf60119c3f9b4e60debe5cf0 | JavaScript | Ozzipozzo/Spotify_React_Project | /spotify_react/src/All_artists.js | UTF-8 | 3,501 | 2.546875 | 3 | [] | no_license | import React from "react";
import { Link } from "react-router-dom";
class Artists extends React.Component {
constructor(props) {
super(props);
this.state = {
error: null,
isLoaded: false,
items: [],
page: 1,
limit: 30,
offset: 30,
maxLength: 0,
};
}
componen... | true |
dfe05435c7e586e223a89d8da32605f1145fa762 | JavaScript | codingwithshanti/build-a-pet | /app.js | UTF-8 | 1,168 | 3.25 | 3 | [] | no_license | window.onload = function (){
var form = document.getElementById("form");
var name = document.getElementById("name");
var type = document.getElementById("type");
var legs = document.getElementById("legs");
var abilitiyArray = document.getElementsByClassName ("abil");
var email = documen... | true |
fe6ef6b88af198200cdc4563a754dd91e246d151 | JavaScript | shiroinegai/tic-tac-toe | /main.js | UTF-8 | 3,567 | 3.28125 | 3 | [] | no_license | console.log("Tic Tac Toe is running.");
const game = (() => {
const boardState = Array(9).fill("");
let isRunning = false;
let winner;
let round = 1;
const board = document.querySelector("main");
board.addEventListener("click", handleBoardClick);
const form = document.querySelector("form");
form.addE... | true |
927f6c08cd8b9a0f38863c0d18adf652dc3ceb69 | JavaScript | VictorGuzman/algorithm-js-scripting | /scripts.js | UTF-8 | 5,300 | 3.9375 | 4 | [] | no_license | /* Reverse a string */
function reverseString(str) {
var str_arr = str.split("");
str_arr.reverse();
return str_arr.join("");
}
reverseString("hello");
/* Factorialize a Number */
function factorialize(num) {
var result = 1;
for (i = 1; i <= num ; i++) {
result *= i;
}
return result;
}
factoriali... | true |
3c760405e8d71b828c1aecd7aa2370ed139f305d | JavaScript | ikulity/fullstack-open | /part1/unicafe/src/App.js | UTF-8 | 1,598 | 2.953125 | 3 | [] | no_license | import React, { useState } from 'react'
const Button = ({ handleClick, text }) => {
return (
<button onClick={handleClick}>
{text}
</button >
)
}
const Statistics = ({ good, neutral, bad }) => {
if (good + neutral + bad === 0)
return (
<p>No feedback given</p>
)
return (
<div>
... | true |
c6b93fd036dfadfd54e278bf129d9a5ff628a846 | JavaScript | andreyshepilov/Andrey-Shepilov-react-test-task | /js/model/__tests__/NavModel.test.js | UTF-8 | 1,061 | 2.546875 | 3 | [] | no_license | var navModel = require('../NavModel'),
_ = require('underscore')
navModelMocks = require('../__mocks__/NavModel');
test('function returns alphabetically sorted array of items', function () {
var expectedOrder = [
'*a', '+a', '-a', '0a', '1a', '2a', 'AA', 'Aa', 'a', 'a1', 'a2', 'aA', 'aa', 'ab', 'ac... | true |
a357289a707d84e3c8f7d4080ed4879e77b7cb14 | JavaScript | rosenildofurtado/Web-Design | /js/M2Avaliacao3.js | UTF-8 | 362 | 3.171875 | 3 | [] | no_license | function getSaudacao() {
var data = new Date();
tempo = data.getHours();
if (tempo < 12) {
mensagem = "Bom diaa!! ";
} else {
mensagem = "Boa tarde! "
}
return mensagem;
}
function mostraMensagem() {
var nome = document.getElementById("entradaNome").value;
var saudacao = getSaudacao(... | true |
aadf3bfe2f254dad0086f16437ad402baa0a4380 | JavaScript | farhanacsebd/basic-javaScript | /seertomon.js | UTF-8 | 321 | 3.765625 | 4 | [] | no_license | // 1st problem & its solution
function seerToMon(seer) {
// return to negetive values.
if (seer < 0) {
return 'seer never give negative value';
}
// give a return value
let mon = seer / 40;
return mon;
}
let seer = -160;
let totalResult = seerToMon(seer);
console.log(totalResult);
... | true |
a375181ae8a5379bfdce26cbe48c38c3d8bd72ab | JavaScript | kevinknight09/SUDOKU_SOLVER-using-frontend-stack | /myscript.js | UTF-8 | 2,753 | 3.390625 | 3 | [] | no_license | console.log("connected to script");
// for checking
var table =$('table tr');
// Declaring the actual table variable which will be used as the main reference//
function modern()
{
for(var r=0;r<9;r++)
{
for(var c=0;c<9;c++)
{
table.eq(r).find('td').eq(c).find('input').val(" ");
console.log(tabl... | true |
7d0412ac48e0cb34c7de7cf7d9c3beff7d5e6a07 | JavaScript | marquirj/react-gifexpertapp | /src/hooks/useFechGifs.js | UTF-8 | 649 | 2.71875 | 3 | [] | no_license | import {useState, useEffect} from 'react';
import { getGifs } from '../helpers/getGifs';
export const useFechGifs = (category) => {
const [state, setState] = useState({
data: [],
loading: true
});
// eSte codigo Solo quiero que se ejecuta cuando el componente es renderizado por primera v... | true |
fc324c4daa47972197edeab7a4c79e9fd58c8fc1 | JavaScript | tekhaus/shopify-page-update | /index.js | UTF-8 | 2,361 | 3.15625 | 3 | [] | no_license | /*
This helper app watches the current directory for any changes to HTML files
On change, it will try to update a shopify store page whose handle matches the file name
--- Set store and access keys in .env ---
*/
require('dotenv').config({ path: __dirname + '/.env' })
const fs = require('fs').promises
const chokidar = ... | true |
78a53b148c2a0dffa75472143b56abbc96944562 | JavaScript | ryabykhms/gem-puzzle | /gem-puzzle/src/js/components/Panel.js | UTF-8 | 1,593 | 3.125 | 3 | [] | no_license | export default class Panel {
constructor() {
const { panel, time, moves, timeValue, movesValue } = this._createPanel();
this.panel = panel;
this.time = time;
this.moves = moves;
this.timeValue = timeValue;
this.movesValue = movesValue;
}
_createPanel() {
const panel = document.createE... | true |
258b156a52ac245f990a3acc18fdfc0f12275836 | JavaScript | dwwhalen/protractor-and-cucumber | /test/page-objects/home-page.js | UTF-8 | 487 | 2.5625 | 3 | [] | no_license | var HomepagePageObject = function () {
this.selectors = {
'START_BUTTON': '.e2e-start-button',
'RESULT': '.e2e-result'
};
this.startButton = browser.$(this.selectors.START_BUTTON);
this.result = browser.$(this.selectors.RESULT);
};
HomepagePageObject.prototype.clickStartButton = function () {
return... | true |
18577fa2bd5d6254915088263ed2afe0cc49da7a | JavaScript | thinkful-ei-gecko/smiti-ej-reactdrills | /src/state-drills/Accordion.js | UTF-8 | 1,046 | 2.625 | 3 | [] | no_license | import React, {Component} from 'react';
import cuid from 'cuid';
class Accordion extends Component{
static defaultProps = {
sections: [],
};
state = {
currentSection: 0
};
handleButtonClicked(index) {
this.setState({
currentSection: index
})
}
... | true |
ec2015da2d00469620dbe7e90e52458c66f18e39 | JavaScript | Luke-Mueller/path_api | /controllers/lists.js | UTF-8 | 4,856 | 2.765625 | 3 | [] | no_license | const ActiveList = require("../models/ActiveList");
const List = require("../models/List");
const User = require("../models/User");
exports.archiveList = async (req, res, next) => {
const listId = req.body.listId;
const userId = req.body.userId;
try {
const user = await User.findById(userId);
user.archi... | true |
ce7f8cff279da52e13ee0d3e27a5259b2f78a3cf | JavaScript | hoadoan99/projectBrainOS | /assets/js/main.js | UTF-8 | 2,277 | 2.953125 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", function() {
// declare Variable
var button = document.querySelectorAll('.button-slider ul li');
var itemSlide = document.querySelectorAll('.slide-items');
var intervalTime = setInterval(function() { autoslide() }, 4000);
for (let i = 0; i < button.lengt... | true |
4a715e08193c3de9971196ea26eedf5a3d189739 | JavaScript | emersonsiega/redux-introduction | /redux.js | UTF-8 | 976 | 3.375 | 3 | [] | no_license | /**
* The store should have four parts:
* 1. The state
* 2. Get the state
* 3. Listen to changes on the state
* 4. Update the state
*
* Rules:
* 1. Just an event can change the state
* 2. The function that returns the new state must be a pure function
*/
const createStore = (reducer) => {
let state... | true |
6fd30c155a7f6b563211651a5cc054401a887991 | JavaScript | LisaLoop/markdown-quotes | /markdown_quote.js | UTF-8 | 4,306 | 3.203125 | 3 | [] | no_license | let process = require('process');
var fs = require('fs');
// project title is #
// start date is *
// task groups phases are represented by ##
// tasks are represented by dashes
// tasks, may contain in any part of the line, the resource name
// start and end dates
// calculate the dates
// print out html report
// t... | true |
cfa68c45c38ac0b88a0bfd49f4f7bfe8fb2f87e0 | JavaScript | billybonkaa/first | /script3.js | UTF-8 | 540 | 2.8125 | 3 | [] | no_license | /*global createCanvas, bakground,
noStroke,fill,rect*/
function setup(){
createCanvas(800,500);
background(2,100,110);
fill(0,10,0);
rect(200,200,400,100);
//rect(x top L, y top L,width,height)
}
function mouseClicked(){
if (mouseX>200&& mouseX< 600&&mouseY>200&&mouseY<300){
background(255,13,300);
... | true |
3cd9ca87d2c55e5a7ce2f49b9bf68b66ab1e93e6 | JavaScript | liaoelton/duidui | /src/container/Score.jsx | UTF-8 | 877 | 2.578125 | 3 | [] | no_license | import React, {Component} from 'react';
import zero from '../img/number/0.png';
import one from '../img/number/1.png';
import two from '../img/number/2.png';
import three from '../img/number/3.png';
import four from '../img/number/4.png';
import five from '../img/number/5.png';
import six from '../img/number/6.png';
im... | true |
ead5a64c0e4edd86c7a36561445bd76f0fc8903c | JavaScript | margueriteblair/Javascript-Algorithms | /bubblesort.js | UTF-8 | 447 | 3.578125 | 4 | [] | no_license | function bubbleSort(array) {
for (var i = 0; i < array.length ; i++) {
for(var j = 0 ; j < array.length - i - 1; j++){
if (array[j] > array[j + 1]) {
// swap
var temp = array[j];
array[j] = array[j+1];
array[j + 1] = temp;
}
}
}
c... | true |
1ff5470259c84abfd180e40c7f9f4e630ce51683 | JavaScript | vilhelmfalkenmark/dashboard | /dev/js/app/sl.js | UTF-8 | 11,646 | 2.921875 | 3 | [] | no_license | /*###########################################
############################################
SECTION RESEPLANERARE
############################################
###########################################*/
var loop;
function writeDepartures(response) {
if(response.constructor === Array ) { // Om vi tar emot... | true |
74073684bdf5e06ef6ac50b0ce95f51eecf28986 | JavaScript | sunny-lan/mya-server | /src/myapp/myapp.js | UTF-8 | 3,239 | 2.53125 | 3 | [] | no_license | const os = require('os');
const util = require('util');
const fs = require('fs');
const ow = require('ow');
const path = require('path');
const uniqueFilename = require('unique-filename');
const decompress = require('decompress');
const uuid = require('uuid/v4');
const {MyaError} = require('../error');
const readFil... | true |
9d3b3ecd212d8e01a7cbaf8954bb781e8052317f | JavaScript | primerocomunico/smith-plot | /src/util/smithMath.js | UTF-8 | 5,373 | 2.78125 | 3 | [
"MIT"
] | permissive | import math from 'mathjs'
import * as d3 from 'd3'
/*
* First we include functions for computing arcs on Smith chart for going between
* gamma and normalized load impedance
*/
const zLoadNormalizedToGamma = zLoadNormalized => {
const numerator = math.subtract(zLoadNormalized, 1)
const denominator = math.add(zLo... | true |
47d5980fdfedb4c8e5daac100aa7ef50e73e64f0 | JavaScript | georgievayo/Telerik-Academy | /JavaScript-Fundamentals/OperatorsAndExpressions/Rectangles.js | UTF-8 | 178 | 3.078125 | 3 | [] | no_license | function solve(args)
{
var a = args[0];
var b = args[1];
var perimeter = 2*a+2*b;
var area = a*b;
console.log(area.toFixed(2) + ' ' + perimeter.toFixed(2));
} | true |
a84933deb1eae4c746e59c5cadea07263cff8630 | JavaScript | erend/nahuy_bot | /fuckyou.js | UTF-8 | 2,771 | 2.75 | 3 | [] | no_license | var fs = require('fs');
var TelegramBot = require('node-telegram-bot-api');
var bot_token = require('./token.js');
var bot = new TelegramBot(bot_token.token, {polling: true});
bot.on('message', function (msg) {
var chatId = msg.chat.id;
var messageText = msg.text;
console.log(msg);
var fuckYou = functi... | true |
671bc615af625c49200b1ee581c232e60355009c | JavaScript | davidabelman/GuardianVizFlask | /static/js/butterfly_graph.js | UTF-8 | 9,005 | 2.9375 | 3 | [] | no_license | COUNT = 0
ITERATION = 0
function make_nodes_hoverable(hoverout) {
// This is run at each iteration (i.e. when new nodes are added)
// This will ensure that when a node is hovered:
// --we display headline and story info in the panel
d3.selectAll('.node').on('mouseover',
function(d) {
... | true |
702e09b32c7248b576c90dd9b409e7ab3d7cdb56 | JavaScript | dw-ll/reactball | /src/reducers/addPlayerData.js | UTF-8 | 412 | 2.609375 | 3 | [] | no_license | const playerDataReducer = (state = {}, action) => {
// eslint-disable-next-line default-case
switch (action.type) {
case "SUCCESS":
var newData = {};
newData[action.name] = action.obj;
return Object.assign({}, state, newData);
// eslint-disable-next-line no-fallthrough
case "FAIL":
... | true |
4937487d3557b0e1448f6220b942ecbe04c95e85 | JavaScript | gskorchev/telerik-tasks | /Loops/1.not-divisible-numbers.js | UTF-8 | 181 | 3.046875 | 3 | [] | no_license | let num = +gets();
let result = 0;
for (let i = 1; i <= num; i++) {
if ((i % 3 == 0) || (i % 7 == 0)) {
} else {
result = result + i + " ";
}
}
print(result); | true |
c9837f995a5339cdfcb31e6843b9cf493f1e5f18 | JavaScript | sourcecontrol-exe/leetcode-Javascript | /204.count-primes.js | UTF-8 | 411 | 3.375 | 3 | [] | no_license | /*
* @lc app=leetcode id=204 lang=javascript
*
* [204] Count Primes
*/
// @lc code=start
/**
* @param {number} n
* @return {number}
*/
var countPrimes = function (n) {
let seen = new Uint8Array(n);
let ans = 0;
for (let i = 2; i < n; i++) {
if (seen[i]) continue;
ans++;
for (let j = i * i; j < n; j +=... | true |
63cd693878fc6b0c3a529cd145dfe862ddfe089c | JavaScript | hemangsrr/invento20_old | /invento18/static/js/canvas.js | UTF-8 | 2,262 | 3.359375 | 3 | [
"MIT"
] | permissive |
var canvas = document.querySelector('canvas');
canvas.height = window.innerHeight;
canvas.width = window.innerWidth;
var c = canvas.getContext('2d');
var x , y , r , g , b , a,dx,dy;
//for(var i=0; i<1000; i++)
//{x = Math.random()*window.innerWidth;
//y = Math.random()*window.innerHeight;
//
//r = Ma... | true |
25582e81020aeeb613d7356f5dae6010a1a8c3b9 | JavaScript | solgenomics/sgn | /js/source/legacy/solGS/linePlot.js | UTF-8 | 5,889 | 3 | 3 | [
"MIT"
] | permissive | /**
* draws any number of line plots; for now only for numeric x and y values.
* import solGS.linePlot and call it like solGS.linePlot(lineData);
* lineData argument has the ff structure
var lineData = {
'div_id': svgId,
'plot_title': title,
'x_axis_label': xLabel,
'y_axis_label': yLabel,
... | true |
31eae10cb27e1b608f8a145ed3c5ca57414f61c1 | JavaScript | HaTuanThuyet/QLNV | /QuanLyNhanVien/QuanLyNhanVien/js/Danhsachnv.js | UTF-8 | 1,470 | 2.890625 | 3 | [
"MIT"
] | permissive | function Danhsachnhanvien() {
this.mangsv = [];
// phương thức
this.themnhanvien = function (sv1) {
this.mangsv.push(sv1);
}
this.timViTri = function (tk) {
var viTri = -1;
this.mangsv.map(function (item, index) {
if (item.taikhoan == tk) {
... | true |
88357f8700b280da14348a2c5ca178afbd7ea7d6 | JavaScript | mooncinnamon/FlowerFight | /frontend/src/components/ButtonPanel.js | UTF-8 | 1,468 | 2.515625 | 3 | [] | no_license | import React, {Component} from 'react';
import FilterLink from '../containers/FilterLink'
import PropTypes from 'prop-types';
Object.size = function(obj) {
let size = 0, key;
for (key in obj) {
if (obj.hasOwnProperty(key)) size++;
}
return size;
};
export default class ButtonPanel extends Comp... | true |
bbf179dbd46cc73a40dac8e060a4bfa376a54739 | JavaScript | targdev/JavaScript | /main.js | UTF-8 | 2,810 | 3.6875 | 4 | [] | no_license | /* MouseEvent */
var mouseevent = document.querySelector(' .button')
mouseevent.addEventListener('click', clicar)
mouseevent.addEventListener('mouseenter', entrar)
mouseevent.addEventListener('mouseout', saiu)
function clicar() {
mouseevent.innerText = 'Clicou! =D'
mouseevent.style.background = 'black'
... | true |
748a6c4d51cbf033948310b60bd3dd4d9ab53e7b | JavaScript | FrancoNavarro20/Sidebar-cenope | /codigo javascript/Javascript/Indroduccion-js/js/13-ejercicio3.js | UTF-8 | 493 | 4.03125 | 4 | [] | no_license | 'use strict'
/*
Hacer un programa que muestre todos los numeros entre dos numero introducios por el usuario
*/
var numero1 = parseInt(prompt('Introduce el primer numero', 0));
var numero2 = parseInt(prompt('Introduce el segundo numero', 0));
// Bucle FOR
/*
1-Contador
2-condicion
3-aumentador
*/
document.write(`<... | true |
fe82f8cc2c713aecb55e1b77d2e1d46e5bb0490a | JavaScript | cofounders/legal | /scripts/definitions.js | UTF-8 | 7,329 | 3.15625 | 3 | [
"ISC",
"LicenseRef-scancode-public-domain"
] | permissive | /** Definition highlighting widget
**/
(function (window, undefined) {
// Find the defining term for a <dfn/> element
var getTerm = function (dfn) {
// Defining Term algorithm
// <http://www.w3.org/TR/html5/text-level-semantics.html#defining-term>
// "If the dfn element has a title attribute, then ... | true |
4f7ccbb80e617450f53f62b2d225deb1e32d0678 | JavaScript | mrpotatoes/computer-science-in-javascript | /src/functional-programming/algebra/laws/semigroupoid.js | UTF-8 | 363 | 2.6875 | 3 | [
"MIT"
] | permissive | 'use strict';
const {compose} = require('..');
/**
### Semigroupoid
1. `a.compose(b).compose(c)` is equivalent to `a.compose(b.compose(c))` (associativity)
**/
const associativity = f => g => h => eq => x => {
const a = f[compose](g)[compose](h)(x);
const b = f[compose](g[compose](h))(x);
return eq(a,... | true |
1f264dfa8aee36c40262a773f10e45b23bb61709 | JavaScript | jaradhosking/AutoSchedule | /CODE/util/buildSchedules2.js | UTF-8 | 1,166 | 2.578125 | 3 | [
"MIT"
] | permissive |
function handleClick() {
resp = ($('form').serializeArray())
semester = resp[0]["value"]
req = (resp[1]["value"]).split(",")
opt = (resp[2]["value"]).split(",")
ch_min = parseInt(resp[3]["value"],10)
ch_max = parseInt(resp[4]["value"],10)
event.preventDefault()
buildSchedule(semester,r... | true |
d7f9645c9d9e88cfb15c880c3d69d5a07b31e817 | JavaScript | eBay/modshot | /bin/modshot.es6 | UTF-8 | 3,435 | 2.578125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env node
'use strict';
const nopt = require('nopt'),
path = require('path'),
url = require('url'),
_ = require('lodash');
function exit(code) {
return process.exit(code);
}
function man() {
const USAGE = `
USAGE modshot [options]*
Options:
--in-dir | -i The input di... | true |
e67e6d4c82b0985e3a9c37b00e442465b28ae4e8 | JavaScript | swnhieian/webcam-recorder | /src/utils/qs.js | UTF-8 | 615 | 2.609375 | 3 | [] | no_license | // let qs = (function (a) {
// console.log("in qs:" + window.location.href)
// if (a === "") return {};
// var b = {};
// for (var i = 0; i < a.length; ++i) {
// var p = a[i].split('=', 2);
// if (p.length === 1)
// b[p[0]] = "";
// else
// b[p[0]] = decodeURIComponent(p[1].replace(/\+/g... | true |
8cfe55c7450f4cc6bbec3c6f23e10faefe10d9c2 | JavaScript | Rxiqi-Development/Reknown | /commands/moderation/unmute.js | UTF-8 | 1,327 | 2.59375 | 3 | [] | no_license | module.exports = async (Client, message, args) => {
if (!await Client.checkPerms('unmute', 'mod', message.member)) return message.reply(':x: Sorry, but you do not have the `mod.unmute` permission.');
const muteRole = message.guild.roles.find(r => r.name.toLowerCase() === 'muted');
if (!muteRole) return message.r... | true |
e567c118b403da3f86e9134e1cdbc039274caa4d | JavaScript | lalkmim/et4js | /LibETMessage.js | ISO-8859-1 | 1,103 | 2.515625 | 3 | [] | no_license | function ETMessage()
{
this.confirmaInclusao = function()
{
return confirm('Confirma a incluso?');
}
this.confirmaAlteracao = function()
{
return confirm('Confirma a alterao?');
}
this.confirmaExclusao = function()
{
return confirm('Confirma a excluso?');
}
this.cancelar = functio... | true |
2ef97efc5ecb550b6ec648a2c647a957220602ff | JavaScript | Sanskrati18/Hacktober-2020 | /random_password_generator/app.js | UTF-8 | 455 | 2.9375 | 3 | [] | no_license | $(document).ready(function(){
var input = $("#password");
$(".gen-pass-btn").click(function(){
var pattern = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*(){}[]:;"'<,>.?/";
var index = 0;
var password = "";
for(var i = 0;i<8;i++){
index = Mat... | true |
868370e9022cdc6fa2fa6d56b710b9604f6a4256 | JavaScript | ryanr1230/KingConverter | /option/options.js | UTF-8 | 4,317 | 2.84375 | 3 | [
"MIT"
] | permissive |
var listOfAdded = document.getElementById('listofadded');
var listOfCurrencyAdded = document.getElementById('listofcurrencyadded');
function relist () {
chrome.storage.sync.get(function(Items) {
listOfAdded.innerHTML = '';
listOfCurrencyAdded.innerHTML = '';
for(var q in Items.userConv) {
addRadioA... | true |
2ead81766bf5e1ee01b0b30e0aab89accf036792 | JavaScript | fozoholiver1/anime | /main.js | UTF-8 | 1,508 | 3.15625 | 3 | [] | no_license | //this is the long method that targets the verious elements and animate them
/*
anime({
targets: 'div.box.red',
translateY: [
{ value: 200, duration: 500, delay: 1000 },
{ value: 0, duration: 800 }
],
rotate: {
value: '1turn',
easing: 'easeOutSine',
delay: 1000
... | true |
12931ed484f6f536a5e86bf447b9472f4b0951d5 | JavaScript | chegele/ValheimManager | /src/commands/backupRestore.js | UTF-8 | 2,198 | 2.6875 | 3 | [] | no_license |
const Command = require('./command');
module.exports = class BackupRestore extends Command {
constructor(manager) {
super(manager);
this.name = "backup-restore";
this.example = "backup-restore <backup-name>";
this.description = "stops valheim, restores from a backup, and resta... | true |
014a26f0d7b71ff5e58b6c4691d52e9ce4dbe5e5 | JavaScript | dtaipov/watch-products-parser | /categories.js | UTF-8 | 1,041 | 2.75 | 3 | [] | no_license | const Excel = require('exceljs');
module.exports = {
readCategoriesFromFile: function(callback) {
const workbook = new Excel.Workbook();
workbook.xlsx.readFile("CategoriesAll.xlsx")
.then(function() {
const categoriesSheet = workbook.getWorksheet("Categories");
const categories = [];
... | true |
dec1f25ee2fcb29c8e37d4959cd5be74c28b0199 | JavaScript | NikGP83/JavaScript-basic---Exercises | /51-100/ex-54/index.js | UTF-8 | 266 | 3.859375 | 4 | [] | no_license | // Write a JavaScript program to count the number of vowels in a given string
let sentence = `однопоточный`;
const getVovelsCount = (str) => str.replace(/[бвгджзйклмнпрстфхцчшщ]/g, ``).length;
console.log(getVovelsCount(sentence)) | true |
3158c42c0305e86143556ca470a6bc8213bd6cff | JavaScript | aigarskadikis/catonrug | /entries-lld.js | UTF-8 | 763 | 2.703125 | 3 | [] | no_license | var req = new CurlHttpRequest();
var lld = [];
var url = "";
var resp = "";
// loop starts
for (var step = 1; step <= value ; step++) {
// define an empty roe
var row = {};
// define url to fetch
url = "https://catonrug.blogspot.com/feeds/posts/default/?atom.xml?redirect=false&start-index="+step+"&max-results=1"
v... | true |
4cd03b1fcd93b732309aa41664510bdfe3e0d220 | JavaScript | RobinWeitzel/onedrive-db | /onedrive-db.js | UTF-8 | 9,539 | 2.59375 | 3 | [] | no_license | (function(hello) {
hello.init({
aad: {
name: 'Azure Active Directory',
oauth: {
version: 2,
auth: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
grant: 'https://login.microsoftonline.com/common/oauth2/v2.0/token'
},
// Authorization scopes
scope: {
// you can a... | true |
3f1bf73726c365d0ec218f90a8fe9294b243d035 | JavaScript | navogel/ready-react-one | /src/components/animal/AnimalDetail.js | UTF-8 | 1,885 | 2.8125 | 3 | [] | no_license | import React, { Component } from 'react';
import AnimalManager from '../../modules/AnimalManager';
import './AnimalDetail.css';
import { firstLetterCase } from '../../modules/helpers';
import ButtonAppBar from '../nav/AnimalBar';
class AnimalDetail extends Component {
state = {
name: '',
breed: '',
loadingStatus... | true |
011df21bc75b39c79114b6e9c0ff3f45d6347f14 | JavaScript | Ces-D/Food-Engine | /public/javascripts/api.js | UTF-8 | 2,957 | 3.03125 | 3 | [] | no_license | async function spoonRequest(cuisine, diet) {
let randomNumber = Math.floor(Math.random() * 100) + 1;
let response = await fetch(process.env.COMPLEX_SEARCH, {
method: "GET",
headers: { "Content-Type": "application/json" },
body: {
number: 1,
addRecipeNutrition: tru... | true |
eeaf80d391c4a6ea1862c00f63f72fb1932a9686 | JavaScript | vikasl/MVCTest | /MvcApplication/Scripts/TestScript.js | UTF-8 | 2,639 | 2.546875 | 3 | [] | no_license | function testHandler() {
this.EmployeeList = null;
this.getData = function () {
this.showWaiting($('div#rulesContent'));
if (this.RuleRequest != null)
this.RuleRequest.abort();
this.RuleRequest = $.ajax({
async: true,
url: this.GetEmploy... | true |
d76262162fbe0d4e2b972139325bbad78e84d0fb | JavaScript | fulkules/codewars-js | /kata-6/data-reverse/index.js | UTF-8 | 1,250 | 3.953125 | 4 | [] | no_license | // A stream of data is received and needs to be reversed.
//
// Each segment is 8 bits long, meaning the order of these segments needs to be reversed, for example:
//
// 11111111 00000000 00001111 10101010
// (byte1) (byte2) (byte3) (byte4)
// should become:
//
// 10101010 00001111 00000000 11111111... | true |
d93989432e83f62636aa6904a8561f598d6c4eca | JavaScript | vinicius849/ADS_IFPI_2021.2_VINICIUS_GOMES_Atividade01_POO_19_de_Agosto_JS | /q2_cotacao_dolar.js | UTF-8 | 373 | 2.984375 | 3 | [] | no_license | const prompt = require('prompt-sync')()
// Entrada
const cotacao_dolar = Number(prompt('Digite aqui quanto vale o dólar: '))
const quant_dolar = Number(prompt('Diga aqui a quantidade de dólares para serem convertidos: '))
// Meio
const valor_real = cotacao_dolar * quant_dolar
// Fim
console.log('A cotação ... | true |
4a8c8a65e4758d2605d88f89273b588e404aabd6 | JavaScript | yukiosawa/ctfscore | /public/assets/js/ctfscore-overlay.js | UTF-8 | 2,510 | 2.515625 | 3 | [] | no_license | var overlayTimer;
var overlayTimer2;
var overlayTimer3;
// 問題回答時の画像表示
function showOverlay(data){
if (data.msg == '' && data.image_url == '') return;
clearTimeout(overlayTimer);
$('#overlayText').remove();
$('#overlayImg').remove();
var div = $('<div>').attr('id', 'overlayText').text(data.msg... | true |
6ff8fcd7913f1d5af7d657e778ceff50573be1bc | JavaScript | Atsaady/Investock | /server/controllers/tremController.js | UTF-8 | 2,871 | 2.9375 | 3 | [] | no_license | /* Manager/Supervisor - Controller Will Interact With The User and Handle Redirections:
- Manages the incoming work HTTP requests
- Decides which worker (service) should do the work
- Splits up the work into sizable units
- Does some checking/validation to figure out to which service(s) should the data ... | true |
bc78a72342a8133262201640d6542f22c5f88a1b | JavaScript | wrcdevil/js_homework | /try.js | UTF-8 | 695 | 3.265625 | 3 | [] | no_license |
///////task1
function t1() {
try{
console.log(document.querySelector('.input43').value);
}
catch (e) {
document.querySelector('.out1').innerHTML='1';
}
}
t1();
/////////////////task2
function t2() {
try{
console.log(document.querySelector('.input43').value);
}
catch... | true |
ea5c3a92fe00dcb667a959ff42d84c3f789c2856 | JavaScript | aroncey/javascript-first-class-functions-lab-web-0217 | /index.js | UTF-8 | 1,078 | 3.65625 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
function countdown(callback) {
setTimeout(function () { callback() }, 2000);
}
// function countdown(countdown) {
// return window.setTimeout(countdown, 2000);
//
// }
function createMultiplier(multiplyValue) {
return function multiply(num) {
return num * multiplyValue;
};
}
var doubler = createMultipl... | true |
77f4875a902236879816b325fe1364720c88029f | JavaScript | Praise-dev/DataStructures-Algos | /Algorithms/leetCode/twoSums.js | UTF-8 | 1,148 | 3.671875 | 4 | [] | no_license | <<<<<<< HEAD
//Given an array of integers, return indices of two elements that sum up to a target integers
//[1,2,3,4], 4
function twoSums(array, target){
const length = array.length;
if(typeof(array) === 'object' && target){
for(i=0; i<length; i++){
for(j=i+1; j<length; j++){
if(array[i] + array... | true |
9b3565005acac0673a9f318781442894ec3012a8 | JavaScript | yu-eric/Roast-Bot | /Commands/invite.js | UTF-8 | 1,257 | 2.515625 | 3 | [
"MIT"
] | permissive | /*
*
* Things to add to rb!invite:
* ----------------------------
*
*/
const Discord = require("discord.js");
const prefix_file = require("../Database/prefix.json");
exports.run = async (message) => {
if(message.content.toLowerCase() == prefix_file.prefix + "invite help"){
return message.channel.send... | true |
6d15c6c3e54d2283977c94cc3105186435baee65 | JavaScript | amandacorris/shopping-list-master | /index.js | UTF-8 | 1,530 | 3.34375 | 3 | [] | no_license | let state = {
groceryItems:[]
};
//add item
function addItem(state, item) {
state.groceryItems.push(item);
};
//render list
function renderList(state, element) {
let itemsHTML = state.groceryItems.map(function(item) {
return '<li id="'+ item +'"><span class="shopping-item">' + item + '</span><bu... | true |
b350456f95824b9e7ac919ba99454b91cae40a75 | JavaScript | jhdoak/jest-unit-testing | /code/matchers/1-equality.test.js | UTF-8 | 901 | 3.5625 | 4 | [
"MIT"
] | permissive | // Use .toBe() to check exact equality
test('Connect Tech should be awesome', () => {
const connectTech = 'awesome'
expect(connectTech).toBe('awesome');
});
test.skip('Connect Tech should not be bad', () => {
const connectTech = 'awesome'
expect(connectTech).not.toBe('bad');
});
// Use .toEqual() to check val... | true |
71ab4b48e0be9d52ebfb010d58cfab13cd1132a4 | JavaScript | canoe726/Algorithm | /2021년/카카오/Lv.1/다트_게임.js | UTF-8 | 1,155 | 3.375 | 3 | [] | no_license | function isDigit (ch) {
return ch.match(/[0-9]/);
}
function solution(dartResult) {
const scores = [];
let scoreIdx = 0;
let score = '';
let bouns = 0;
for (let i = 0; i < dartResult.length; i++) {
const ch = dartResult.charAt(i);
if (isDigit(ch)) {
score += ch;
... | true |
d300b7ca23ff5526992ffd2f2ee540b07408833c | JavaScript | zoan1503/ReviewBooks | /src/modules/auth/components/SignUp.jsx | UTF-8 | 4,062 | 2.5625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import Axios from 'axios';
import swal from 'sweetalert';
function SignUp() {
const [username, setusername] = useState('');
const [password, setpassword] = useState('');
const [fullname, setfullname] = useState('');
const [email, setemail] = useState... | true |
fed96fb78f7bbb847c6313cd663cbe143604dc10 | JavaScript | xoscar/photobook | /src/assets/js/app/components/deleteContact/index.js | UTF-8 | 1,139 | 2.578125 | 3 | [] | no_license | // template
import deleteContactTemplate from './deleteContactTemplate.hbs';
// lib
import rest from '../../lib/rest';
// components
import contactList from '../contactList';
/**
* Contact list component
*/
export default {
/**
* Deletes a selected contact
* @param {Number} contactId Contact identifier
... | true |
eeec27c6b60975ac7934d0844cbfd1f37697ec88 | JavaScript | shashank519/stacko-react | /src/reducers/questionsReducer.js | UTF-8 | 594 | 2.53125 | 3 | [] | no_license | import {
FETCHING_QUESTIONS,
FETCHING_QUESTIONS_SUCCESS,
FETCHING_QUESTIONS_ERROR
} from "Constants/questionsConstants";
const initState = {
name: "Shashank",
isFetching: false,
data: {}
};
export default (state = initState, action) => {
switch (action.type) {
case FETCHING_QUESTIONS:
return {... | true |
b4be5e284d355cbcd51652f2d8429b4456f255cd | JavaScript | CarolynSM/neon-ginger | /src/components/Navigation/index.js | UTF-8 | 1,572 | 2.84375 | 3 | [] | no_license | import React, {Component} from 'react'
import './index.css'
export default class MainNavigation extends Component {
state = {
navItems: []
}
componentDidMount() {
this.setState({navItems: this.mapNavItemsToState(this.props.navItems)})
}
mapNavItemsToState = navItems => {
c... | true |
38eb3ddc52a9dde41798238b269077ef40977fdd | JavaScript | zack-codaio/digital-monsters | /scraper.js | UTF-8 | 9,328 | 2.796875 | 3 | [] | no_license | 'use strict';
var page = require('webpage').create();
var _ = require('lodash');
var $ = require('jQuery');
page.onConsoleMessage = function(msg) {
console.log(msg);
};
var url = 'http://phantomjs.org/';
var urlName = 'phantomJs';
// var url = 'http://www.juxtapoz.com/news/erotica/look-who-s-coming-to-tea-the-wor... | true |
e5a9862147082602ca7e719c3f0344666f6581f2 | JavaScript | cj-taylor/allReady | /AllReadyApp/Mobile-App/scripts/bowerCopy.js | UTF-8 | 1,604 | 2.546875 | 3 | [
"MIT"
] | permissive | /*
* This hook copies into www/lib the actual contents of packages
* installed by Bower, since Bower installs some packages' entire
* source repositories.
*
* This results in about a 2x reduction in the size of www/lib.
*/
/* eslint-env node */
"use strict";
var fs = require("fs");
var fse = require("fs-ext... | true |
e8c1b8bc52890f009bc1d665338c1430e626e8a5 | JavaScript | met5678/meteor-desktop | /skeleton/modules/storageMigration/ioHelper.js | UTF-8 | 2,620 | 2.71875 | 3 | [
"MIT"
] | permissive | import fs from 'fs-plus';
import shelljs from 'shelljs';
import rimraf from 'rimraf';
import fsExtra from 'fs-extra';
/**
* Traverses the local storage directory looking for the last modified local storage file.
*
* @returns {{latestPort: number, files: Array}}
*/
export function findNewestFileOrDirectory(path, co... | true |
853555b1524f898b2b11cfe4e9652328321d0620 | JavaScript | singhakan2635/WebDevelopment | /work/basic-react/wordguess/src/clean-input.js | UTF-8 | 130 | 2.84375 | 3 | [] | no_license | export const cleanInput = ( userWord ) =>
{
const cleanedWord = userWord.replace(/[^A-Za-z]+/g, '');
return cleanedWord;
} | true |
f7092c9de70daf2bbda2912e058acc4bbc89d251 | JavaScript | zhenyarusskiy/MRBURGER | /source/js/components/api.google.js | UTF-8 | 1,252 | 2.75 | 3 | [] | no_license | require("babel-polyfill");
module.exports = class {
constructor() { }
init(el, config) {
this.map = new google.maps.Map(document.querySelector(el), config);
}
createPlacemark(coords, cb) {
const marker = new google.maps.Marker({
position: coords,
icon: window.i... | true |
6444f1259c4bb1d571fdcd47a40123c2ac9810f1 | JavaScript | Xerozzz/SCAssignment | /BackEnd/auth/verifyToken.js | UTF-8 | 765 | 2.53125 | 3 | [] | no_license |
var jwt = require('jsonwebtoken');
var config = require('../config');
function verifyToken(req, res, next){
var token = req.headers['authorization']; //retrieve authorization header's content
if(!token || !token.includes('Bearer')){
res.status(403);
return res.send({auth:'fa... | true |
32125b7b68da9b9f6cebce9dea1d67b41196d6fc | JavaScript | AfeefaDe/event-pad-api | /test/unit/event.test.js | UTF-8 | 3,324 | 2.53125 | 3 | [] | no_license | 'use strict'
var models = require('../../models')
var testHelper = require('../test_helper')
describe('event model', function () {
describe('create events', done => {
let eventCount
let checklistCount
beforeEach(done => {
Promise.all([
models.Event.count().then(count => {
eventC... | true |
dc59c522c53d7187bf2fc4fcfc1bc724d46d6a91 | JavaScript | udhayakumargururaj/simpleautosuggest | /common/AutoSuggest.js | UTF-8 | 1,889 | 2.671875 | 3 | [] | no_license | import React, {Component} from 'react';
import TextBoxStyles from './styles/TextBoxStyles.css'
class AutoSuggest extends Component{
constructor(props){
super(props);
this.onSuggestionClick = this.onSuggestionClick.bind(this);
this.displayTextValue = this.displayTextValue.bind(this);
this.getSelectedProduct = ... | true |
0454455f19aacaa7ad6e6ccf0aa2ca4b1c9afa33 | JavaScript | GrietM/Clases | /CLASE_3/Ejercicio6.js | UTF-8 | 542 | 4.125 | 4 | [] | no_license | console.log('EJERCICIO 2: Función que devuelva la multiplicacion de 2000*300 y lo escriba en la consola\n')
function calculadora ()
{
var calculo = 2000*300;
return calculo;
}
var resultado = calculadora();
console.log('El resultado del cálculo solicitado es: '+ resultado + '\n')
console.log('El resultado del c... | true |
f9cefdf8ffe9b673bee3a0300ae2c90f3ebac0be | JavaScript | lcaroselli/express-tutorial | /server.js | UTF-8 | 1,187 | 2.921875 | 3 | [] | no_license | const express = require('express');
const app = express();
const path = require('path');
app.use(express.static(path.join(__dirname, 'public')));
//use the static files from public
// app.use() configures your application to use a middleware function (we’ll get into middleware in the next section). At a high level, ap... | true |
bbc71e7c57644788092b4498941c60edf71e25ea | JavaScript | plaidev/simple-pusher | /packages/simple-pusher/lib/index.js | UTF-8 | 1,530 | 2.515625 | 3 | [
"MIT"
] | permissive | class SimplePusher {
constructor(server, socketIoOptions = {}) {
const _socketIoOptions = Object.assign(
{
serveClient: false,
},
socketIoOptions,
);
this.io = require('socket.io')(server, _socketIoOptions);
this.beforeJoinHook = (socket, data, cb) => {
return cb(null... | true |
1e3f8cc3598b873ffcf267f0d684c39e09280736 | JavaScript | Hookkid/bpblog | /public/js/index.js | UTF-8 | 3,177 | 2.65625 | 3 | [] | no_license |
$(document).ready(function (){
var closed=true;
$(".navbar-toggle").click(function (){
if(!closed){
$(".navbar-default").css("background-color", "rgba(255,255,255,0.5)");
closed = true;
}
else{
$(".navbar-default").css("background-color", "rgba(255,255,255,1)");
closed = false;
}
});
$(window)... | true |
37213f657f0fd8542792216725fb27deaa1d728b | JavaScript | gbemisoladorcas/sca_javascript_tasks | /week3_4/Todolist/todolist.js | UTF-8 | 1,178 | 3.5625 | 4 | [] | no_license | //close button
var MyList = document.getElementsByTagName('li');
var index;
for(index = 0; index < MyList.length; index++){
var aSpanTag = document.createElement("SPAN");
var someTxt = document.createTextNode("\u00D7");
aSpanTag.className = "close";
aSpanTag.appendChild(someTxt);
MyList[index].appendChild(aSp... | true |
04ffd9acf300eb7f455505840d29f3cc2cfec1b7 | JavaScript | Braineanear/Mafkoud | /NodeJS/src/services/user.service.js | UTF-8 | 6,702 | 2.6875 | 3 | [] | no_license | // Utils
import catchAsync from '../utils/catchAsync';
import APIFeatures from '../utils/apiFeatures';
import dataUri from '../utils/datauri';
import { uploadFile, destroyFile } from '../utils/cloudinary';
// Models
import { User } from '../models/index';
/**
* Create New User
* @param {Object} body
* @returns... | true |
2ba6f7171744501426cc822dd883a150841058c4 | JavaScript | lifengtc123/node_kit | /public/src/widget/loadingBox/src/loadingBox.js | UTF-8 | 2,038 | 2.546875 | 3 | [] | no_license | /**
* 强制等待弹窗组件
* 2013-11-20
* jizaiyi
*/
define( function( require, exports ){
require( './loadingBox.css' );
var slice = Array.prototype.slice;
var extend = function(obj) {
$.each( slice.call(arguments, 1), function( key, value ) {
if (value) {
for (var prop in value) ... | true |
7409989db906ebc896fa2fc2cad35f7c6690c5e8 | JavaScript | dungnguyentien0409/competitive-programming | /Javascript/456. 132 Pattern.js | UTF-8 | 815 | 3.328125 | 3 | [] | no_license | /**
* Link: https://leetcode.com/problems/132-pattern/solution/
* Author: Dung Nguyen Tien (Chris)
* @param {number[]} nums
* @return {boolean}
*/
var find132pattern = function(nums) {
if (nums.length < 3) return false;
var i = 1;
var s = 0;
var check = []
while(i < nums.length) {
... | true |
cd0a5938bed23f991541bcbfc714c5ff1a3af9fd | JavaScript | svvimming/flowfield-SOC | /js/differential.js | UTF-8 | 1,207 | 2.671875 | 3 | [] | no_license | var inc = 0.01;
var scl = 10;
var cols, rows;
var zoff = 0;
var fr;
var particles = [];
var flowfield = [];
function setup() {
createCanvas(500, 500);
cols = floor(width/scl);
rows = floor(height/scl);
fr = createP('');
//initialize field
flowfield = new Array(cols * rows);
for (var j = 0; j < rows; j++... | true |
b47b6b7def76fb706b6327d05daa2085046ce2ca | JavaScript | dadomin/fund_C | /public/js/origin.js | UTF-8 | 18,204 | 2.5625 | 3 | [] | no_license | class App {
constructor(r){
// 서명
this.drawed = false;
this.drawing = false;
this.prevX = null;
this.prevY = null;
this.signStatus = true;
this.fundlist = [];
this.highlist = [];
this.invlist = [];
r.forEach((e)=>{
this.fundlist.push(new Fund(e.number, e.name, e.endDate, e.total, e.current,... | true |
33b897ffb61e69915ac2f8f56b0c7b695a6a1c0e | JavaScript | sooarre/jamstack-cms | /createLocalConfig.js | UTF-8 | 1,491 | 2.609375 | 3 | [
"MIT"
] | permissive | const fs = require('fs')
const stripJsonComments = require('strip-json-comments')
const config = './src/aws-exports.js'
/*
* This function will take the base Amplify config, remove the API key reference, write the base
* config to jamstack-config.js, create a local reference to the API key for local development,
* an... | true |
dbeee84da55fb04d91fed73a06df3336c96c7533 | JavaScript | ishidas/data-structure | /reverse-array.js | UTF-8 | 531 | 3.59375 | 4 | [] | no_license | 'use strict';
const arr = ['g','f','e','d','c','b','a'];
const arr2 = [6,5,4,3,2,1,0];
const arr3 = ['f','o','o', 5 ,' ', '!'];
function reverse (arr){
let mid = Math.floor(arr.length/2);
let end = arr.length -1;
for (var i = 0; i < mid; i++) {
let val = arr[i];
arr[i] = arr[end - i];
arr[end - i] = ... | true |
d8ff5821b7f3260c235a0c6454f6fad0b89e72f3 | JavaScript | xianyinuma/UnchartedWaters | /code/wenjin/Bullet.js | UTF-8 | 952 | 2.984375 | 3 | [] | no_license | /**
* Created by Victor on 2017/4/25.
*/
class Bullet extends MovableObject {
constructor(playerID, damage, speed) {
super(playerID);
//this.boat = boat;//to do
this.damage = damage;
this.horizontalSpeed = speed;//to do
this.verticalSpeed = speed * 0.1;
this.gravit... | true |
8614479c59c868ed0ae12f56aad694a98b9c080f | JavaScript | haomYGH/Web20 | /011-Express/03-route/03-get-params.js | UTF-8 | 559 | 2.859375 | 3 | [] | no_license | /*
* @Author: Administrator
* @Date: 2020-07-13 09:27:14
* @Last Modified by: Administrator
* @Last Modified time: 2020-07-13 11:34:01
*/
const express = require('express')
const app = express()
const port = 3000
app.use('/static', express.static('public'))
app.get('/', (req,res) =>{
// /?name=tom&age=18
consol... | true |
6481d5b4292a7e20e776bbd81da9c9ecc875e7cf | JavaScript | luiznunes15/Atividade-7---JavaScript | /arraysPratica4.js | UTF-8 | 291 | 3.859375 | 4 | [] | no_license | const num = parseInt(prompt("Informe um número:"));
let palavras = [];
for (let i = 0; i < num; i++) {
palavras[i] = prompt("Digite palavras N vezes:");
}
for (let i = palavras.length-1; i >= 0; i--) {
const palavra = palavras[i];
console.log(`Palavra ${i + 1}: ${palavra}`);
} | true |
d15ce56f44fecaa868abbd1e3b4faec38d09255d | JavaScript | mschlege1838/html-table-wrapper | /src/ContextControl.js | UTF-8 | 12,566 | 2.828125 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | /*
* Copyright 2020 Martin F. Schlegel Jr. | MIT AND BSD-3-Clause
*/
// Virtual Events
/**
* Fired the first time a `ContextControl` is {@link ContextControl#open opened}. The `target` and `currentTarget`
* properties of the event are set to the `ContextControl` being opened. The control's backing element ... | true |
66d617aa83e5064b16605a7fdeec4ec81370d8db | JavaScript | seancheung/mockit | /cli.js | UTF-8 | 8,072 | 2.53125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*eslint no-console: off*/
const args = process.argv.slice(2);
if (args.some(arg => arg === '-h' || arg === '--help')) {
help();
} else {
start();
}
/**
* Allocate an unused port
* @param {number} port beginning port
* @param {string} host host
* @param {(err?: Error, port?: number)} cb callback
* @param... | true |
03f0c3b2dbc2a33814f1fa3f01eeb0158f183500 | JavaScript | ebriksmanish/myapp | /app.js | UTF-8 | 1,067 | 2.609375 | 3 | [] | no_license | const express = require('express');
const app = express();
// Requiring Mongoose
const mongoose = require('mongoose');
// Requiring Config
const config = require('./config/database');
// connect mongoose to database
mongoose.connect(config.database);
const db = mongoose.connection;
// checking if mongoose connected... | true |
0f293fa3ce61f6e3cd69fa2e9b151c3b1964ac50 | JavaScript | lucho-hernandez/quecomemos | /food.js | UTF-8 | 1,687 | 2.9375 | 3 | [] | no_license | (function() {
var quotes;
fetch(
"https://opensheet.vercel.app/1FItBw1ljvC1K09yK-Tmu5_hV0g7hI_XKCBN_ve5m3Sg/Food"
)
.then(function(response) {
return response.json();
})
.then(function(myJson) {
populateData(myJson);
});
var populateData = function(data) {
var randomQuoteInd... | true |
5ebd3a6883fb54d1bdd3ec726ae34c4755681f6d | JavaScript | Eshan1707/Project-24 | /Dustbin.js | UTF-8 | 810 | 2.921875 | 3 | [] | no_license | class Dustbin{
constructor(x,y){
var options = {isStatic:true}
this.left= Bodies.rectangle(x,y,20,100,options)
this.base= Bodies.rectangle(x+100,y+40,200,20,options)
this.right= Bodies.rectangle(x+200,y,20,100,options)
this.image=loadImage('dustbingreen.png')
W... | true |