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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
98bf3ce088180693d5b561522d31a64e1989872b | JavaScript | Tanner132/Edabit-Questions | /app.js | UTF-8 | 386 | 3.4375 | 3 | [] | no_license |
// question 1.
function largestSwap(num) {
let reverseN = num.toString().split("").reverse().join("")
if (reverseN > num){
return false;
} else if (reverseN <= num){
return true;
}
}
//question 2
const isSpecialArray = a => a.every((v, i) => v%2 == i%2);
//qu... | true |
6addd23dd733625eef239a89f928900889903c93 | JavaScript | TenHiderovich/backend-project-lvl1 | /src/games/prime.js | UTF-8 | 688 | 3.3125 | 3 | [] | no_license | import gameEngine from '..';
import getRandomValue from '../getRandomValue';
const isPrime = (num) => {
if (num < 2) {
return false;
}
if (num === 2) {
return true;
}
let i = 2;
const limit = Math.sqrt(num);
while (i <= limit) {
if (num % i === 0) {
return false;
}
i += 1;
... | true |
d450ae0d8b81c0f473a1fe4d370a29a687a9a403 | JavaScript | Gloryofthe80s/Backbone_task.js | /app/scripts/main.js | UTF-8 | 814 | 2.84375 | 3 | [] | no_license | $(document).ready(function() {
//initialize Parse
Parse.initialize("wyONZpwmaFf4u7zRyXDHgeY0A332GZC3DMuSZvjk", "vmQqYkifJtvCWkMuhZ4gS720S1ytSmb1G7jtCRD2");
//create the task collection
window.tasksCollection = new TasksCollection();
// event binder for adding tasks
$('#create-new-task-input').... | true |
97606347b9dc6630a130541fd11eeaa480872672 | JavaScript | NickzzDev/discord-avatar-command | /v12.js | UTF-8 | 690 | 2.53125 | 3 | [] | no_license | const Discord = require('discord.js');
exports.run = async(client, message, args) => {
const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.member;
const embed = new Discord.MessageEmbed()
.setFooter(`PFP requested by ${message.author.tag}`)
.... | true |
132c63dcaa2f7ebea11ba6bf3890cd9e831429d4 | JavaScript | rbodell/chevalier_rebecca_sdi | /GoToTrainingWeek2/Chevalier_Rebecca_Expressions_Assignment/js/script.js | UTF-8 | 3,973 | 3.71875 | 4 | [] | no_license |
/*
Rebecca Chevalier
SDI Section #1
Expressions Assignment
09/10/2015
*/
// Letting the user know what to do
alert("Hi there! I am trying to figure out how much money you have left from your paycheck after you pay your cable bill! ");
//Asking the user what cable company they use
var cablecompany = prompt("Wha... | true |
e27b182b5df7978c69395725f763b200737c632a | JavaScript | Anntex/workshop_interactive_media | /dns_lookup/dns_lookup.js | UTF-8 | 785 | 3.15625 | 3 | [] | no_license | /**
* This file describes the functionality to lookup an web url using the
* dns module of the node.js API.
*
* @author dennis grewe [dg060@hdm-stuttgart.de]
* @see http://nodejs.org/api/dns.html
*/
var dns = require('dns');
/* the lookup method resolves a domain into the IPv4 or IPv6 record.*/
dns... | true |
ff51a6ed88a0b518437b7108ab1611fb30714018 | JavaScript | BryantCabrera/leetCode | /325_maximumSizeSubarraySumEqualsK.js | UTF-8 | 776 | 4 | 4 | [] | no_license | // Maximum Size Subarray Sum Equals K
// https://leetcode.com/problems/maximum-size-subarray-sum-equals-k/
// 325. Maximum Size Subarray Sum Equals k
// Medium
// 1152
// 37
// Add to List
// Share
// Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't on... | true |
ab72522b862ecc6f9b5b8b27794d1012e6d155d1 | JavaScript | D-Y-A-G/DA_CODE_QUIZ_TIME_WEEK4 | /script.js | UTF-8 | 4,791 | 4.28125 | 4 | [] | no_license | // CREATING QUIZ start by setting variables and start with click button and timer function
// User is presented with a Start button and a title of Quiz - work on style of button
// When user clicks start quiz the timer starts and user is presented with a multiple choice question
var countDown = document.querySelecto... | true |
46c510aee19799af75f3dc44354c1eb8a0689e78 | JavaScript | share/sharedb-mongo | /test/test_op_link_validator.js | UTF-8 | 4,363 | 2.515625 | 3 | [
"MIT"
] | permissive | var OpLinkValidator = require('../op-link-validator');
var expect = require('chai').expect;
describe('OpLinkValidator', function() {
it('starts with no unique op', function() {
var validator = new OpLinkValidator();
var opWithUniqueVersion = validator.opWithUniqueVersion();
expect(opWithUniqueVersion).to... | true |
438fc567253ca2705ed10e0785bc90ce8b7f2157 | JavaScript | Samanta-ctrl/JavaScript | /JS Arrays/arrays.js | UTF-8 | 1,199 | 4.5 | 4 | [] | no_license | //Initialize new array
var names = ['Soumen','Arindam','Mark','James'];
var years = new Array(1990,1963,1995,1998); //calling array function using new keyword
console.log(names[0]);
console.log(names[1]);
console.log(names[2]);
console.log(names);
console.log(names.length); //array length
//Mutate array... | true |
60233b5740f4c00912d57ea2379c000853d5566f | JavaScript | smk1628/webpack | /src/js/module3.js | UTF-8 | 319 | 2.640625 | 3 | [] | no_license | //使用默认暴露计算乘除的2个函数
export default {
//函数简写方式
mul(a,b){
return a*b
},
div(a,b){
return a/b
}
//未简写
// mul:function(a,b){
// return a*b
// },
// div:function(a,b){
// return a/b
// }
} | true |
2548c1c5b6fecc167d1ff71052351055972920e8 | JavaScript | chipzco/ang | /js/services/curry.js | UTF-8 | 2,169 | 3.03125 | 3 | [] | no_license | myApp.factory('curryService', function ($log) {
var curryfns = {};
// this is doing binding and partial function application,
// so I thought bind was a more appropriate name
// The goal is that when you execute the returned wrapped version of fn, its this will be scope
curryfns.bind=function(f... | true |
86e919bdf515c69d55e0eb56e32621d476266a4f | JavaScript | estelora/nodeTutorial | /src/hello.js | UTF-8 | 1,440 | 3.8125 | 4 | [
"MIT"
] | permissive | // node.js Hello World
// syntax to require modules
var http = require('http');
// createServer has 2 parameters
// callback with 'request' & 'response'
http.createServer(function (request, response) { //request event here
// Status code in the header for response
response.writeHead(200);
// Response body
... | true |
21657028cb5476c6261e3fc908a9cc9d1c8be06c | JavaScript | caffeine-dependency/ProductTechnicalSpecs | /server/controllers.js | UTF-8 | 2,072 | 2.625 | 3 | [] | no_license | const {
getTechSpecById,
addTechSpec,
deleteTechSpec,
addImg,
addQuestion
} = require('../database/dbhelpers')
// Tech Spec Controllers
const getTechSpec = (req, res) => {
let {id} = req.params;
getTechSpecById(id)
.then((data) => {
res.status(200).send(data.rows);
})
... | true |
5cb09a8f6c5389395155b9428beaa3dcca310999 | JavaScript | takuya-motoshima/codeigniter-extension | /sample/client/src/theme/js/custom/apps/projects/users/users.js | UTF-8 | 1,505 | 2.6875 | 3 | [
"MIT"
] | permissive | "use strict";
// Class definition
var KTProjectUsers = function () {
var initTable = function () {
// Set date data order
const table = document.getElementById('kt_project_users_table');
if (!table) {
return;
}
const tableRows = table.quer... | true |
8e4a8fb2bfffb4c77af246d3c6a0dd4f79bebdcb | JavaScript | mohammadid52/react-calendar | /src/lib/datetime/hijri_calendar.js | UTF-8 | 852 | 2.703125 | 3 | [] | no_license | /* eslint-disable */
const HijriCalendar = (function () {
const MIN_CALENDAR_YEAR = 1000
const MAX_CALENDAR_YEAR = 3000
// return array of weeks for this month and year
// return array of days from beginning of week until start of this month and year
// return array of days from end of this month and year... | true |
2d1eca0f0cee62141b300e5bdc6ee57ad2d2f2bb | JavaScript | Zooeeee/TWS1-1 | /practices/superposition_operation/own_elements_operation/subscript_is_even/single_element.js | UTF-8 | 908 | 2.859375 | 3 | [] | no_license | 'use strict';
var single_element = function(collection){
var element = new Array;
var count = new Array;
var i ;
var a = new Array;
for(i=0;i<collection.length;i++){
if (i%2!=0)
a.push(collection[i]);}
collection = a ;
var n = collection[0];
element[0] = n;
for(i=0;i<... | true |
306aaf9ec505a4af7f26e56c26dd5b4185600e01 | JavaScript | googledaniel/art-zine | /src/pages/Submission.js | UTF-8 | 1,698 | 2.703125 | 3 | [] | no_license | import React, { useState, useEffect, useRef } from 'react';
import { Link } from 'react-router-dom';
export default function Submission(props) {
const [articles, setArticles] = useState([]);
const titleInput = useRef(null);
const bodyInput = useRef(null);
const summaryInput = useRef(null);
useEffect(() => {
//... | true |
8a9fd6d49ffa489df97d39fb241dded0fc0c8877 | JavaScript | helloyongwei/storageManage-Nzy-Yw | /back-end/sql/storehouse.js | UTF-8 | 2,874 | 2.875 | 3 | [] | no_license | /**
* @module 仓库处理sql
*/
const sequelize = require('./sequelize')
const errMsg = require('../static/errMsg')
const consoleUtil = require('../util/console')
const selectSql = 'SELECT * FROM storehouse LIMIT :offset, :limit'
const defaultOffset = 0
const defaultLength = 5
const selectByIdSql = 'SELECT * FROM storehou... | true |
ff1864d1df1e965aab1097dd08851e0afb28df5b | JavaScript | AnuPoudyal/cs301_workspace | /computeOperand.js | UTF-8 | 316 | 3.796875 | 4 | [] | no_license | //Write a function compute, that takes three parameters. First parameter is a call back function
//that does the actual operation, second and third are the operands
function display(result){
console.log("result");
}
function compute(mycallback,a,b){
let sum=a+b;
mycallback(sum);
}
compute(display,5,5);
| true |
3b085c9aef58f055a2542bf057a3c5603633be6c | JavaScript | kausgang/world_at_a_glance | /public/javascripts/render_map.js | UTF-8 | 3,897 | 2.609375 | 3 | [] | no_license | function render_map(){
var width = 860,
height = 500,
rotate = 0, // so that [-60, 0] becomes initial center of projection
maxlat = 83; // clip northern and southern poles (infinite in mercator)
var projection = d3.geo.mercator()
.rotate([rotate,0])
.scale(1) // we'... | true |
7f5b09f522609b21ab921dd695f1fe654d081052 | JavaScript | nickscaglione/web-js-oo-task-list-web-0916 | /js/controllers/lists.controller.js | UTF-8 | 717 | 2.703125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | 'use strict';
// Lists Controller
function ListsController() {
this.$addListForm = $('#add_list'),
this.$listTitleInput = $('#list_title'),
this.$selectListMenu = $('#select_list'),
this.$addTaskForm = $('#add_task')
this.$wrapper = $('#wrapper')
}
ListsController.prototype.init = function() {
this.$addTa... | true |
87e709fb3348dc1b25e7e46ff09924509b4615b7 | JavaScript | davidabutler92/07_one-to-many | /__tests__/app.test.js | UTF-8 | 5,186 | 2.84375 | 3 | [] | no_license | const fs = require('fs');
const request = require('supertest');
const app = require('../lib/app');
const pool = require('../lib/utils/pool');
const Book = require('../lib/models/Book');
const Page = require('../lib/models/Page');
describe('app endpoints', () => {
beforeEach(() => {
return pool.query(fs.readFile... | true |
dce7155475b2ca1804067a5f3bdbf1da65d9d865 | JavaScript | willvitorino/GCharts | /js/modal.js | UTF-8 | 666 | 3.03125 | 3 | [] | no_license | // Get the modal
let modal = document.getElementById('myModal');
// Get the <span> element that closes the modal
let span = document.getElementsByClassName("clsModal");
// When the user clicks on the button, open the modal
for (btn of document.getElementsByClassName("openModal")) {
btn.onclick = function () {
... | true |
cec16fac44922be923523299be86fc786a8c0330 | JavaScript | petarcmarinov97/SoftUni-JavaScript | /JS-Fundamentals/Objects/traveltime.js | UTF-8 | 1,430 | 3.546875 | 4 | [] | no_license | function travelTime(arr) {
let result = {};
for (let line of arr) {
let [state, town, price] = line.split(" > ").map(x=>x.trim());
town = town.charAt(0).toUpperCase() + town.slice(1);
if (!result.hasOwnProperty(state)) {
result[state] = {};
}
if (!re... | true |
7a716054b30d02474e32359f0b2c27f2b2d61f73 | JavaScript | nipunwijetunge/Ceylon-Travel-Guide-Website | /ProductPage/MainJS.js | UTF-8 | 8,651 | 2.96875 | 3 | [
"MIT"
] | permissive | /* PRODUCTS DATA */
// Load products
var products = {
1: {
name: "PULP ELEPHANT",
desc: "Hand made pulp elephant statue.",
img: "pulp-elephant.jpg",
price: 842
},
2: {
name: "WOODEN ELEPHANT",
desc: "An elephant made with \"KALUWARA\".",
img: "wo... | true |
a4d712bd8d8d927826a81130a4040351f31ca4ab | JavaScript | shakuu/Exams | /JSFundamentals/03-task3.js | UTF-8 | 3,831 | 3.109375 | 3 | [
"MIT"
] | permissive | function solve(args) {
let selectors = [];
let property = {
'weight': 0,
'value': ''
};
// Weight:
// new selectors
// new property
// Regex
let matchWeight = /@(\d+)/,
matchSelector = /(([a-z|0-9])+) ?\{ ?(@\d+)?/im,
matchProperty = /(([a-z|0-9|-])+): ... | true |
0d5330d30da6f5be7a26b248e7e1ef5af759438a | JavaScript | MaxHutchings/actual | /shopping.js | UTF-8 | 1,635 | 2.53125 | 3 | [] | no_license | 'use strict';
const sqlite = require('sqlite');
async function init() {
const db = await sqlite.open('./database.sqlite', { verbose: true });
await db.migrate({ migrationsPath: './migrations-sqlite' });
return db;
}
const dbPromise = init();
fuckYou();
async function fuckYou() {
const db = await dbPromise;... | true |
c37010cabe76a9eb74469cc48dd4ddeeb441a113 | JavaScript | PI-KA-CHU/homework_refactor_1 | /test/statementTest.js | UTF-8 | 2,591 | 2.71875 | 3 | [] | no_license | const test = require('ava');
const {statement} = require('../src/statement');
// test('Sample test', t => {
// t.true(true);
// t.is(1, 1);
// t.deepEqual({a: 1}, {a: 1});
// });
test('test 1', t => {
const invoice = {
'customer': 'BigCo',
'performances': [
{
'playID': 'hamlet',
... | true |
94f6a3d071c46d226054c96b3fa801febefa8906 | JavaScript | wang-yuhao/multimedia | /Node.js/buffer_class.js | UTF-8 | 605 | 3.671875 | 4 | [] | no_license | //create a Buffer with a length of 10 and padding with 0.
const buf1 = Buffer.alloc(10);
//create a buffer with a length of 10 and padding with 0x1.
const buf2 = Buffer.alloc(10,1);
//create a buffer with a length of 10 and uninitialized
//this methode is more quickly than Buffer.alloc()
//but the returned Buffer ins... | true |
ae31e40bd0e280e8a8fde28ae55959c5f9f9e91d | JavaScript | wangyi96/MyHobby | /pc端轮播图(js原生代码)/js/page-index.js | UTF-8 | 3,286 | 3.09375 | 3 | [] | no_license | /**
* Created by Supreme on 2017/8/16.
*/
window.onload = function(){
/*获取imgList*/
var imfList = document.getElementById("imgList");
/*获取img*/
var imgArr = document.getElementsByTagName("img");
/*设置imgList的整体宽度*/
imgList.style.width = 520*imgArr.length + "px";
/*获取导航navDiv*/
var navD... | true |
6c062c19cbad1b663b13979dc95cb99f3b612332 | JavaScript | juncn/acc | /sample_code/createIterator.js | UTF-8 | 458 | 3.46875 | 3 | [] | no_license | const createIterator = () => {
let x = 0;
return {
next: () => {
if (x > 3) {
return {value: undefined, done: false}
} else {
const currentValue = x;
x += 1;
return {value: currentValue, done: true}
}
}
}
};
const iterator = createIterator();
console.log... | true |
771b57dfe68d3a8635beccfb73839ecbd5abc33e | JavaScript | souh03/javascript-module-1 | /week-1/Homework/K-functions-parameters/exercise3.js | UTF-8 | 240 | 3.640625 | 4 | [] | no_license | // Write your function here
function greeting(Daniel,createGreeting){
var create =Daniel + createGreeting ;
return create;
}
var createGreeting =
var greeting =
console.log(greeting("Hello,"," my name is Daniel "));
| true |
379353fcdd492758f8c4f2a802f5b91adb3b0a37 | JavaScript | shpp-syakovenko/it-social | /src/redux/usersReducer.js | UTF-8 | 4,677 | 2.546875 | 3 | [] | no_license | import {usersAPI} from "../api/api";
import {updateObjectInArray} from "../utils/objectHelper";
const FOLLOW = 'FOLLOW';
const UNFOLLOW = 'UNFOLLOW';
const SET_USERS = 'SET_USERS';
const SET_CURRENT_PAGE = 'SET_CURRENT_PAGE';
const TOTAL_USERS_COUNT = 'TOTAL_USERS_COUNT';
const TOGGLE_LOADER = 'TOGGLE_LOADER';
const F... | true |
d7fde6496dfdef82dfb0a3e6bbe13899da29218c | JavaScript | PrestonPhelan/RabbitsVsWolves | /predator.js | UTF-8 | 2,305 | 2.90625 | 3 | [] | no_license | const Animal = require("./animal");
const Util = require('./util');
class Predator extends Animal {
constructor(options = {}) {
super(options);
this.speed = 5;
this.radius = 10;
this.color = "#ff0000";
this.prevMove = [0, 0];
this.destination = null;
}
eating() {
}
getMove(prey, p... | true |
8af7238fa798245380f0c9f9bcbc54a6c3474182 | JavaScript | Kolyannik/JsonClassSerializer | /src/serializer.js | UTF-8 | 10,656 | 3.171875 | 3 | [] | no_license | var uuid = 0; // уникальный идентификтор объекта
/**
* проверить, что переменная является объектом
* @param {any} value переменная
* @returns {boolean} результат проверки
*/
function isObject(value) {
return value !== null && typeof value === 'object';
}
/**
* проверить, ч... | true |
b0b98d4ef5dde11cda1231008e572e902fac83bd | JavaScript | Abhishekdabas/Nagarro_WebTraining_2018_April | /Day4/NodeJSBasics/sample_package/server_middlewares.js | UTF-8 | 914 | 2.9375 | 3 | [] | no_license | const express = require('express')
const app = express()
app.use(function (req, res, next) {
console.log("I always run")
next()
})
app.use('/b', (req, res, next) => {
console.log("I run whenever you ask for /b")
next()
})
app.use('/a', (req, res, next) => {
console.log("I run whenever you ask for ... | true |
80e2144ad860dd56f8e166dd6b02455a887f3893 | JavaScript | VA-HCA2/Week1 | /Week1/Mod2/MyWork/SimpleMathScripts/netWorth.js | UTF-8 | 124 | 2.703125 | 3 | [] | no_license | "use strict";
var assets=6000;
var debts=3000;
var netWorth=assets-debts;
console.log("Your net worth is " +netWorth); | true |
c6db7500f9d4fad82a57b1ac9756bf327831a3de | JavaScript | rhyolight/chess-moves | /war/js/chess.js | UTF-8 | 2,633 | 2.609375 | 3 | [] | no_license | var CHESS = {
dropMove: function($piece, $from, $to, msg) {
$('td.cell').removeClass('highlight');
if (msg.indexOf('SUCCESS') > -1) {
$from.empty();
$to.empty();
$to.append($piece);
$piece.attr('style', 'position: relative')
.addClass... | true |
ec3ec026427769653debe89c24347b27d85f2ddc | JavaScript | dstroot/react-storybook-lib | /src/components/CookieMessageRTL/index.test.js | UTF-8 | 4,738 | 2.8125 | 3 | [] | no_license | import React from 'react';
/**
* The react-testing-library is a very lightweight solution for testing React components.
* It provides light utility functions on top of react-dom and react-dom/test-utils,
* in a way that encourages better testing practices.
*/
// React test library
import { render, fireEvent, clea... | true |
6fee2e134b485b8a593f2276ab5efdf12041290d | JavaScript | qwerty6016/asteroids-harvesters | /public/game-loop.js | UTF-8 | 3,480 | 3 | 3 | [
"MIT"
] | permissive | const statCanvas = document.getElementById('staticCanvas');
const statCtx = statCanvas.getContext("2d");
const statWidth = statCanvas.width;
const statHeight = statCanvas.height;
const dynCanvas = document.getElementById('dynamicCanvas');
const dynCtx = dynCanvas.getContext("2d");
const dynWidth = dynCanvas.... | true |
a135d2b7b1df81c13af53ed33b10d447ada613bf | JavaScript | gabrielflorit/enter-view | /enter-view.js | UTF-8 | 3,290 | 2.71875 | 3 | [
"MIT"
] | permissive | /*
* enter-view.js is library
*/
(function(factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = factory();
} else {
window.enterView = factory.call(this);
}
})(function() {
... | true |
cb0553c3b5b05ac8cf2234ca56a333ce3953ea75 | JavaScript | gmeluski/quartet | /src/js/answerStore.js | UTF-8 | 663 | 3.078125 | 3 | [] | no_license | class answerStore {
constructor() {
this.answerData = Array(9).fill(0)
this.hello = this.hello
}
/*
* getter for answers
*
* @return {Array}
*/
get answers() {
return this.answerData
}
/**
* getter for the total
*
* @return {Number}
*/
get total() {
return this.an... | true |
790a565d7a1febdacdbbe93da169f58edd2dc13b | JavaScript | yuda-lyu/w-restapi | /src/routesToAPI.mjs | UTF-8 | 4,844 | 2.671875 | 3 | [
"MIT"
] | permissive | import each from 'lodash/each'
import genPm from 'wsemi/src/genPm.mjs'
import isstr from 'wsemi/src/isstr.mjs'
/**
* 由Routes陣列資料轉hapi的API資料陣列
*
* @param {Array} [routes=[]] 輸入需自動產製的routes資料陣列,每個元素需有'apiName'欄位,其值給予表名字串,'props'欄位,其值給予欄位物件,預設[]
* @param {String} [apiParent='api'] 輸入api上層路徑字串,預設'api'
* @param {Func... | true |
040e20be45ac29b39a77ed018b094c47b16f400b | JavaScript | Shanker-Suryakumar/ReactNativeLearning | /js-demos/jsdemos/demo10-functions.js | UTF-8 | 537 | 4.15625 | 4 | [] | no_license |
function plus(x,y){ //plus is available in global context
return x+y;
}
let sum=plus; //sum is another name added global context
console.log('plus(10,20)',plus(10,20));
console.log('sum(10,20)',sum(10,20));
//if minus is not accessible, do I need this word?
// we can create anonymous functions
//ANONYMO... | true |
0a0d3a4d18d4b1a68630f35e058fbe9bca098638 | JavaScript | wguilherme/uri-javascript-exercicios-resolvidos | /INICIANTE/1011.js | UTF-8 | 656 | 4.125 | 4 | [
"MIT"
] | permissive | /* Faça um programa que calcule e mostre o volume de uma esfera sendo fornecido o valor de seu raio (R).
A fórmula para calcular o volume é: (4/3) * pi * R3. Considere (atribua) para pi o valor 3.14159.
Dica: Ao utilizar a fórmula, procure usar (4/3.0) ou (4.0/3), pois algumas linguagens (dentre elas o C++),
assumem qu... | true |
9f5817ef0d1580390a777aebbb7f155569c2c54c | JavaScript | ReaganBruce/JStoTSConversions | /console-resume-ts/app.js | UTF-8 | 1,667 | 3.421875 | 3 | [] | no_license | "use strict";
var myName = "Reagan";
var myCareer = "Software Dev";
var myDescription = "I like to code and problem solve!";
console.log("Name: " + myName.toUpperCase());
console.log("Career: " + myCareer);
console.log("Description: " + myDescription);
console.log('');
console.log("My name is " + myName.toUpperCase() +... | true |
f58e03b767a882a467e169776ae9418831167ded | JavaScript | Lokesh-tkri/fullstackopen | /part2/App.js | UTF-8 | 1,006 | 2.890625 | 3 | [
"MIT"
] | permissive | const Header = ({name}) => {
return (
<h2>{name}</h2>
)
}
const Total = ({ parts }) => {
let exer = parts.map((part)=>part.exercises)
const sum = exer.reduce((s,p) => s+p)
return(
<h2><p>Number of exercises {sum}</p></h2>
)
}
const Part = ({part}) => {
return (... | true |
6780f522feb23e442322c30a80d6993dcf5830b5 | JavaScript | Anjola85/simple-martplace-backend-api | /src/utils/helper.js | UTF-8 | 2,230 | 2.796875 | 3 | [] | no_license | import config from 'config';
import NodeGeocoder from 'node-geocoder';
import slugify from 'slugify';
import {User} from "../rest/v1/user/user.model";
/**
* @param {Number} size Hour count
* @return {Date} The date
* */
export const addHourToDate = (size) => {
const date = new Date();
let hours = date.getH... | true |
3ead5fd5ddfb48bc4cd34c8b11b2e0e6ad6e0211 | JavaScript | CourtneyBrothers/group-project-company-site-lucky-tundra-mimes | /main.js | UTF-8 | 1,420 | 3.03125 | 3 | [] | no_license | kayakList = [
{
name:"Mamba",
price:"$879",
description:"Our lightest playboat",
url:"kayak1.jpg"
},
{
name :"Zen",
price:"$579",
description:"Great for beginners",
url:"kayak2.jpg"
},
{
name : "Angler",
price : "$779",
description: "For the seasoned sportsman",
... | true |
2ca83e788b2352e1e7209e777bf94821c6982831 | JavaScript | Maxim-Pekov/modal-Window | /script.js | UTF-8 | 891 | 2.703125 | 3 | [] | no_license | let btnModal = document.querySelector('.modalBtn'),
overlay = document.querySelector('.modal')
close = document.querySelector('.modal-close');
btnModal.addEventListener('click', function(){
//overlay.style.display ='block';
overlay.classList.remove('hidden');
overlay.classList.add('open');
document... | true |
43072c4af56ed642bcc4d6f1496e2f80d51a5c49 | JavaScript | echandler/ExamplesByMesh | /HTML5/EaselJS/PixelFlow/scripts/main.js | UTF-8 | 25,314 | 2.703125 | 3 | [
"MIT"
] | permissive | /*
The MIT License
Copyright (c) 2011 Mike Chambers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | true |
a638352717ae2644357b48feeec021a28cb1a711 | JavaScript | maghoff/tagged-console-target | /index.js | UTF-8 | 1,925 | 2.5625 | 3 | [] | no_license | var util = require('util');
var winston = require('winston');
var moment = require('moment');
require('colors');
function TaggedConsoleTarget(options) {
options = options || {};
winston.Transport.call(this, {
name: 'taggedConsoleLogger',
level: options.level,
handleExceptions: options.handleExceptions,
exc... | true |
4fbd61a0abe570983bd137c92eae35e3f02e6455 | JavaScript | WerlingM/ndbc_latest | /js/randUtils.js | UTF-8 | 791 | 3.5 | 4 | [] | no_license |
let randUtils = {
getRandomInt: function(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
},
//Floating point number, two decimal places
getRandomFloat: function(min, max) {
var number = Math.random() * (max ... | true |
b404ce70408b567af36ab284a0cb0b7f4eb309cc | JavaScript | kialam/tower-analytics-frontend | /src/SmartComponents/SamplePage/BarChart.js | UTF-8 | 8,040 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | /* eslint-disable */
import React, { Component } from 'react';
import * as d3 from 'd3';
import PropTypes from 'prop-types';
import ReactDOM from 'react-dom';
class BarChart extends Component {
constructor(props) {
super(props);
this.server = process.env.REACT_APP_SERVER_ADDRESS ? process.env.REAC... | true |
a72bfa349b3f5cdd0185470b23674f2cfb85860b | JavaScript | SnehaNeupane/Swagger-ui | /lib/command_execute.js | UTF-8 | 807 | 2.96875 | 3 | [] | no_license | 'use strict';
var childproc = require('child_process');
exports.exec = function(cmds, aftercommand=null){
var next;
next = function(){
var cmd;
if (cmds.length > 0) {
cmd = cmds.shift();
console.log("Running command: " + cmd);
return childproc.exec(cmd, function(err, stdout, stderr){
... | true |
1bab88b8a175d89c53e7471509934fdc350202d1 | JavaScript | reydelo/api-practice | /main2.js | UTF-8 | 781 | 2.859375 | 3 | [] | no_license | // var myFunction = function() {
// console.log('hello');
// }
//
// var myVar = console.log('goodbye');
var products = {
// properties of var product: source, template, request
source: function() {
return $("#api-template").html()
},
template: function() {
return Handlebars.compile(products.source()... | true |
484706fc9f78c1cc2f35bef29aa2b22e1a03b4f1 | JavaScript | naylapaixao/traineeprominas-ncsp-view-sandbox-JS | /script-get-student.js | UTF-8 | 1,981 | 3.03125 | 3 | [
"MIT"
] | permissive | const app = document.getElementById('root');
const container = document.createElement('table');
container.setAttribute('class', 'table');
const table = document.createElement('table');
container.setAttribute('class', 'table');
//app.appendChild(logo);
app.appendChild(container);
app.appendChild(table);
var request ... | true |
7b6d8384397faf50b909569ca80391fb16710843 | JavaScript | juliswer/Cursos | /Frontend/Javascript/Codigo_facilito/clase4.js | UTF-8 | 1,245 | 3.921875 | 4 | [] | no_license | if(true){
console.log("La condición fue verdadera");
}
else if(false){
console.log("La condición fue falsa");
}
var numero_uno = 23;
var numero_dos = 30;
if(numero_uno > numero_dos){
console.log("Entre al bloque");
}
else{
console.log("No podés entrar");
}
if(nume... | true |
e52490f5d2b1516991cb79642defe80e936dbe39 | JavaScript | dmshanin/javascript-online-3 | /lesson-7/3.js | UTF-8 | 1,994 | 4.40625 | 4 | [] | no_license | /**
* Задача 3.
*
* Напишите функцию `createArray`, которая будет создавать массив с заданными значениями.
* Первым параметром функция принимает значение, которым заполнять массив.
* А вторым — количество элементов, которое должно быть в массиве.
*
* Генерировать ошибки, если:
* - При вызове функции не было пер... | true |
23fde62def24fd16ba76688363efce2af3b13113 | JavaScript | Cedrichuzhiguo/StockBarn | /Skill Code/lambda/index.js | UTF-8 | 21,077 | 2.625 | 3 | [] | no_license | /* eslint-disable func-names */
/* eslint-disable no-console */
/* eslint-disable no-restricted-syntax */
// IMPORTANT: Please note that this template uses Dispay Directives,
// Display Interface for your skill should be enabled through the Amazon developer console
// See this screenshot - https://alexa.design/enab... | true |
2bee746e93f851405a9887ea9adb10cbc61f354f | JavaScript | siastar/TVP | /_stuff/backup/backup1/routes/VinylsRoute.js | UTF-8 | 2,774 | 2.6875 | 3 | [] | no_license | console.log('...opening /routes/VinylsRoute')
const express = require('express');
const vinylRouter = express.Router();
const VinylSchema = require('../model/VinylSchema.js');
// C R U D: Create - Read - Update - Delete
//mongoose methods are implicitally used without importing mongoose itself because it
//comes al... | true |
c55f56a1fcbbb34977c0531df8662fcfc78d3367 | JavaScript | luomuxie/ts-screeps | /src_sec.js/main.js | UTF-8 | 3,769 | 3.609375 | 4 | [] | no_license | /*
1、创建一个creeps
Your spawn creates new units called "creeps" by its method spawnCreep.
Usage of this method is described in the documentation.
Each creep has a name and certain body parts that give it various skills.
You can address your spawn by its name the following way: Game.spawns['Spawn1'].
Create a worker c... | true |
48065ec218b691fe94a063ad0f3b51d5b0ff5e4c | JavaScript | node-pinus/pinus | /tools/pinus-robot/dist/lib/console/js/ui/graph.js | UTF-8 | 4,778 | 2.546875 | 3 | [
"MIT"
] | permissive | var graphs = {};
function updateGraph(chart,targetName) {
var main = document.getElementById(targetName);
if (!main) {
var tname = targetName+'div';
var _dom = $("#avg_template").clone().attr('id',tname).find('.screen-label').html(targetName+' Response Time Graph').end().find('.cgraphdiv').attr('id',targetName).... | true |
b15378ae87b3f480cf746bdeb2d67222f6b96aa6 | JavaScript | saisaira/webDesignusingReactJs-05-10-2020- | /js/practice.js | UTF-8 | 2,293 | 4 | 4 | [] | no_license | // creating object
var details={
name:"Apssdc",
year:2015,
courses:["webdesign using react","python","ml","PWA"]
}
// for loop syntax and functionality of working
// for(var i=0;i<details.courses.length;i++){
// document.write(details.courses[i]+"<br>");
// }
// for-in(object,Array)
// for(var i in details.cou... | true |
cc37cbe387219b94050c0b1504be612fc108370f | JavaScript | gitgeorgec/keepalive | /src/components/KeepAlive/index.js | UTF-8 | 1,154 | 2.65625 | 3 | [] | no_license | import React, { createRef, useEffect, useRef, useState } from 'react';
const AliveContext = React.createContext({});
export const AliveScope = props => {
const [state, setState] = useState({});
const nodes = createRef({});
nodes.current = {}
function keep(id, children) {
setState({
...state,
[id]: { id, ... | true |
8e80142092c172f77a28ac3bf9313e25b9003fe5 | JavaScript | Gleb-1/ItGid-courses__JS2.0 | /UNIT 3. OPERATOR IF, ELSE, SWITCH CASE - SELECTION IN JAVASCRIPT/js/unit_03.js | UTF-8 | 11,495 | 4.0625 | 4 | [] | no_license | // Task 1
// При нажатии кнопки b-1 срабатывает функция f1. Функция должна прочитать содержимое i-1 и сравнить его с числом 4 (сравнение ==). Результат сравнения - true или false выведите в out-1.
document.querySelector('.i-1');
let a2 = document.querySelector('.out-1');
document.querySelector('.b-1').onclick = funct... | true |
fad47b348f791a2035df1833cca0578ef86cbc9f | JavaScript | kozuchowski/React-zadania | /2_Snippety/7_fetch/js/1_SimpleFetch/App.js | UTF-8 | 530 | 2.9375 | 3 | [] | no_license | import ReactDOM from "react-dom";
import React, { useState, useEffect } from "react";
const FetchExample = () => {
const [data, setData] = useState(false);
useEffect(() => {
fetch("https://api.ipify.org")
.then(response => response.text())
.then(ip => {
setData(ip);
});
});
if (... | true |
2c75f41e1f48ad2f0f26f87c868a2be968a1f099 | JavaScript | mariavar/urban | /js/router.js | UTF-8 | 2,682 | 2.625 | 3 | [] | no_license | const app = {
init: function() {
app.pages = document.querySelectorAll('.page');
document.querySelectorAll('.menubtn').forEach((link)=>{
link.addEventListener('click', app.nav);
});
document.querySelectorAll('.dashboardbtn').forEach((link)=>{
link.addEventLis... | true |
441a64fbe8e10cf2757bbd68a1532a7dfb031e31 | JavaScript | Stobles/Uniform | /js/modal.js | UTF-8 | 1,383 | 2.8125 | 3 | [] | no_license | let modal = document.querySelector('.modal')
let news = document.querySelectorAll('.news__body')
let modalTitle = document.querySelector('.modal__title')
let modalDate = document.querySelector('.modal__date--body')
let modalTime = document.querySelector('.modal__date--time')
let modalText = document.querySelector(... | true |
2f5394c374500fa854aa9551578c46eafb901b43 | JavaScript | richardhodgson/lian | /lib/mock/monk.js | UTF-8 | 4,134 | 2.609375 | 3 | [] | no_license | var Promise = require('monk/lib/promise');
function copy (ob) {
var dataSet = {};
for (key in ob) {
dataSet[key] = ob[key];
}
return dataSet;
}
function Db () {
this._collections = {};
}
Db.prototype.get = function (collectionName) {
if (! this._collections[collectionName]) {
... | true |
0b8b7a8b874f2f63b7d73ba6a28ca46560b531d9 | JavaScript | vmx/xml2dom | /modjewel-require.js | UTF-8 | 9,443 | 2.921875 | 3 | [
"MIT"
] | permissive | //----------------------------------------------------------------------------
// The MIT License
//
// Copyright (c) 2009, 2010 Patrick Mueller
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the... | true |
e8c6593516a96f76959c2c324e49c1f7ac723e98 | JavaScript | BuildFire/focusGamePlugin | /widget/js/gameUI.js | UTF-8 | 4,794 | 2.734375 | 3 | [
"MIT"
] | permissive | //by danielhindi on 1/10/18.
var gameUI= {
init:function(user,scoreboard){
this.user=user;
this.scoreboard=scoreboard;
this.focusSection = document.getElementById("focusSection");
this.shapesSection = document.getElementById("shapesSection");
this.actionBar = document.getEle... | true |
3ce39e43c17203998985f15c50c3c8b24157888c | JavaScript | agu3rra/mynotes | /Programming/JavaScript/PS-PracticalDesignPatterns/creational/factory/task.js | UTF-8 | 391 | 3.125 | 3 | [] | no_license | // as of ES6 you can use class
var Repo = require('./taskRepo.js')
class Task {
constructor(name) {
this.name = name
this.completed = false
}
complete() {
console.log(`completing task: ${this.name}`)
this.completed = true
}
save() {
console.log(`saving task: ... | true |
2997b75e60c9848c875eac9dfcdcd51c9723ee3a | JavaScript | mikelane/colorfade | /colorfade.js | UTF-8 | 2,456 | 3.1875 | 3 | [] | no_license | var c = function() {
return({
log: function(msg) {
consoleDiv = document.getElementById('console');
para = document.createElement('p');
text = document.createTextNode(msg);
para.appendChild(text);
consoleDiv.appendChild(para);
}
});
}();
function toRGB(H, S, V) {
S /= 100;
... | true |
1d736656a26518c6b8a4220cfe5e7e41e2ed6e98 | JavaScript | leozheng08/QuickFood | /WEB-INF/classes/map.js | UTF-8 | 1,377 | 2.828125 | 3 | [] | no_license | var map;
var directionsService;
var directionsRenderer;
var start;
function initMap(){
directionsService = new google.maps.DirectionsService();
directionsRenderer = new google.maps.DirectionsRenderer();
var chicago = new google.maps.LatLng(41.850033, -87.6500523);
var mapOptions = {
zoom:7,
... | true |
baff94cd8d99eb9d8f10a8f2831e2c0e103ebe05 | JavaScript | dewil-official/node-quiz-server | /client/scripts/quiz.js | UTF-8 | 5,200 | 2.65625 | 3 | [
"MIT"
] | permissive | // Imports
var socket = io();
var quiz = {};
var user = {};
var users = [];
socket.on("connect", function() {
if (!sessionStorage.sessionToken) window.location = "/";
if (sessionStorage.sessionToken)
socket.emit("validateToken", sessionStorage.sessionToken);
});
socket.on("validationSuccess", function(isMaste... | true |
c393e1c9ae6c0ea2591a8b19ae761c4fb2de9b00 | JavaScript | watchcity/karma-angular | /scraps.js | UTF-8 | 713 | 3.109375 | 3 | [] | no_license |
// var d1 = [], d2 = [], d3 = [];
// //for (var i = 0; i<data.length;i++) {
// var today = new Date();
// today.setHours(0,0,0,0);
// //Get time of last 5 years
// var last5Years = new Date(today.setFullYear(today.getFullYear() + 5)).getTime();
// //Get time of last 10 years
// var last10Years ... | true |
7b421ae7ea8c5165f6566d5074f5b7bb341eeee4 | JavaScript | meatbags/galleria | /js/glsl/fragments/waves_shader.js | UTF-8 | 517 | 2.921875 | 3 | [
"MIT"
] | permissive | /** Waves shader */
const WavesShader = `
vec3 p = position;
float f = time * 0.2;
float noise = perlinNoise(vec2(f + p.y, f + p.x));
float t = 0.0;
float tMin = 2.5;
float tMax = 6.5;
if (p.y < tMax && p.y > tMin) {
t = sin((tMax - p.y) / (tMax - tMin) * 3.14159) * 0.12;
}
float x = t * noise;
... | true |
f8277461ec8eb6b01490e5eb315c45a117603d38 | JavaScript | J3eff/curso-web-javascript | /fundamentos/unarios.js | UTF-8 | 299 | 3.546875 | 4 | [] | no_license | let num1 = 1
let num2 = 2
num1++ //pósfixada | Acrecenta uma unidade ao valor da variavel
console.log(num1)
--num1 //pre fixada -> tem precedencia maior do que a pósfixada | Subtrai uma uniadade ao valor da variavel
console.log(num1)
console.log(++num1 === num2--)
console.log(num1 === num2)
| true |
ab01e633a57c12a10b347041e8eb0397405d990a | JavaScript | bbdouglas/hnindex | /html/main.js | UTF-8 | 2,753 | 2.609375 | 3 | [] | no_license | (function() {
function searchError(jqXHR, textStatus, errorThrown) {
$("#results").text("Error: " + textStatus + ", " + errorThrown);
}
function search() {
function searchSuccess(data, textStatus, jqXHR) {
var results = $("#results");
results.empty();
var prev = $("<a>").addClass("nav-... | true |
a90faa1c10d3e7f3a7fa6f8d6a1fbca8c38fadf1 | JavaScript | gitgrimbo/cache-flow-problems | /src/shared/dumb-assign.js | UTF-8 | 349 | 2.96875 | 3 | [
"MIT"
] | permissive | /**
* Use when you don't want Object.assign semantics.
*
* I.e. you don't want to "copy the values of all enumerable own properties".
*/
function assign(dest, src1, src2, etc) {
for (var i = 1; i < arguments.length; i++) {
for (var k in arguments[i]) {
dest[k] = arguments[i][k];
}
}
return dest;... | true |
efedc0011cc4858d47c56638d62a43b5ee8f1e0a | JavaScript | ectky/JSProjects | /01. Increment-Counter/incrementCounter.js | UTF-8 | 600 | 2.75 | 3 | [] | no_license | function increment(selector) {
$(selector)
.append($('<textarea class="counter" value="0" disabled>0</textarea>'))
.append($('<button class="btn" id="incrementBtn">Increment</button>'))
.append($('<button class="btn" id="addBtn">Add</button>'))
.append($('<ul class="results"></u... | true |
89ba9f0c42e813a6e42f0cd74a986315dfbba18d | JavaScript | MEECAH/watercolors-generative | /watercolor.js | UTF-8 | 5,268 | 3.046875 | 3 | [] | no_license | //some global variables
var seed,
sides,
r,
recurrences = 0,
mpVariance,
angleVariance,
magVariance,
numDesiredPaintLayers,
numPaintLayersDrawn,
numDeformationLayers,
vertices = [],
ogPolygon = [],
baseDeformedPolygon = [],
tmp = [],
m = 1,
sd = 1,
imageScale = 1,
frameCount = 1, //set... | true |
5c1e0d705a46f260df60e07bd8d3cc409ccc14a5 | JavaScript | parkerproject/github-search-repo | /src/utils.js | UTF-8 | 874 | 2.703125 | 3 | [] | no_license | export function encodeQuery(obj) {
const ret = [];
for (let d in obj) {
if (obj.hasOwnProperty(d) && obj[d]) {
ret.push(encodeURIComponent(d) + ":" + encodeURIComponent(obj[d]));
}
}
return ret.join(" ");
}
export function parseQueryStr(str) {
const queries = decodeURIComponent(str);
const ... | true |
7b61c53677133d8164918af85f38f0a46365bf32 | JavaScript | DeckHunter/UI_Mobalytics | /Backgrounds.js | UTF-8 | 704 | 2.859375 | 3 | [] | no_license |
var imgFundo = window.document.body
var h1 = document.getElementById('js-h1')
function background(id){
console.log('funcao Chamda '+id)
if(id === 0) {
imgFundo.style.backgroundImage= "url('img/Background.png')"
h1.innerHTML = 'start your legend'
}
if(id === 1){
imgFundo.style.b... | true |
4fe17eb03fb4bf922606f5d740b25720b8e6563d | JavaScript | jairuzu/solarStrike | /src/game/collisionService.js | UTF-8 | 2,632 | 2.578125 | 3 | [] | no_license | angular.module('Solar Strike').service('collisionService', function(utilityService) {
this.checkCollision = function(objA, objB) {
if (objA.collisionObjNamesToDetect.indexOf(objB.name) !== -1 || objB.collisionObjNamesToDetect.indexOf(objA.name) !== -1) {
var xDiff = objA.center... | true |
fb6f2877e22068db821b8ae3be3464af78e75211 | JavaScript | ywoo-park/computer-graphics-final | /computer-graphics-final-client/script.js | UTF-8 | 14,371 | 2.84375 | 3 | [] | no_license |
var PointerLockControls = function (camera, cannonBody) {
var velocityFactor = 0.2;
var jumpVelocity = 20;
var scope = this;
var pitchObject = new THREE.Object3D();
pitchObject.add(camera);
var yawObject = new THREE.Object3D();
yawObject.position.y = 2;
yawObject.add(pitchObject);
... | true |
761e7271c36f2d46c7300241bd845bb483df0b1b | JavaScript | gktaj/practice_new | /practice jq/js_weird_parts-master/js_weird_parts/old/03/L25/app.js | UTF-8 | 113 | 3.390625 | 3 | [
"MIT"
] | permissive | var a = 0;
var b = false;
if (a !== b) {
console.log('They are not equal!');
} else {
console.log("Equal.");
} | true |
8fbf03f637a920014bff5ed75ff3e8e79ee02ba2 | JavaScript | NammCode/web-udemy-javascript | /5. oopJs/constructor.js | UTF-8 | 921 | 4.46875 | 4 | [] | no_license | // Construction
function Person(name, dob) {
this.name = name;
this.birthday = new Date(dob);
this.calculateAge = function(){
const diff = Date.now() - this.birthday.getTime();
const ageDate = new Date(diff);
return Math.abs(ageDate.getUTCFullYear() - 1970);
}
}
const nam = new Person('Nam', '04-06... | true |
c9c72e4304977a3175e6da7c150d13f2705475f3 | JavaScript | jleupp/NutriTracClient | /routes/users.js | UTF-8 | 5,918 | 2.796875 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
/* GET users listing. */
// router.get('/', function(req, res, next) {
// res.send('respond with a resource');
// });
// -- USERS login redirect to JAVA API controller
// var credentials = require('./credentials.js');
// var session = requi... | true |
83e17f102c4188a18f05bbf9b9f4fc7918d65d22 | JavaScript | bshaley25/LetsMakeAGame | /MouseDodge/game.js | UTF-8 | 1,835 | 3.6875 | 4 | [] | no_license | const canvas = document.createElement('canvas')
document.body.appendChild(canvas)
canvas.width = window.innerWidth - 500
canvas.height = window.innerHeight - 300
const ctx = canvas.getContext('2d')
class Circle {
constructor(x,y,r,dx,dy) {
this.x = x
this.y = y
this.r = r
this.dx = ... | true |
778c708849228ba3c5b08f7ff73807140fe381d2 | JavaScript | mikoval/nodeProject | /Connect4Utility.js | UTF-8 | 14,077 | 2.953125 | 3 | [] | no_license |
module.exports = {
complete: function(grid){
var width = grid.length;
var height = grid[0].length;
//check player 1
//vertical check for win
for (var i=0;i<grid.length;i++)
{
var count = 0
for (var j=0;j<grid[0].length;j++)
... | true |
ab6993d98a1a642b7a4982d8911cc10eb29b569f | JavaScript | alanrahi/massageWebsite | /reserve.js | UTF-8 | 544 | 2.859375 | 3 | [
"MIT"
] | permissive | $('button').click(function(){
$('.calendar').toggle();
});
/*$('button').click(function(){
alert("Calendar");
})*/
/*var inter;
$(document).ready(function(){
inter = setInterval(function(){
$('.calendar').append('<img src="images/calendar"onclick="myFunction(this)">');
},1000);
});
var co... | true |
adaa53fa4127f828c03427d7b0ef03b9a397760d | JavaScript | LordDarkula/Kookipali | /scripts/Cookie2.js | UTF-8 | 1,781 | 3 | 3 | [
"MIT"
] | permissive |
function changefunc() {
document.getElementById("5 star").selected = "true";
}
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
function starwarslight()
{
var x=prompt("Good Job! You Joined the Light Side!Have you joined the light side on google","Type Yes or No");
x=x.toLowe... | true |
ded5cd03e7561327873c892573942c75c01a4ab8 | JavaScript | LaurensGiesen/Make-a-Meal | /assets/js/infoMeals.js | UTF-8 | 2,038 | 2.6875 | 3 | [] | no_license | "use strict";
function popUpDishes(e) {
e.preventDefault();
if (e.target.tagName === "IMG") {
let meals = JSON.parse(localStorage.getItem(`localMeals`));
if (e.target.tagName !== "A") {
document.querySelector(`#popup`).classList.remove(`hidden`);
}
let selectedMealI... | true |
ec3c728c16db35188f364ce8990ff70f09fac072 | JavaScript | 54x1/USN | /backend/routes/auth.js | UTF-8 | 5,866 | 2.546875 | 3 | [] | no_license | const router = require('express').Router()
const User = require('../models/User')
const bcrypt = require('bcrypt')
const jwt = require('jsonwebtoken')
const verify = require('./verify')
router.post('/register', async (req, res) => {
try {
if (
!req.body.username ||
!req.body.email ||
!req.body.... | true |
6de52d64b6a13ee883696bf7162d4d8dcfddaeb5 | JavaScript | IgorSh12/VR | /VR/form.js | UTF-8 | 1,084 | 2.84375 | 3 | [] | no_license |
let inputs = document.querySelectorAll('.input');
inputs[5].addEventListener('click', (e) =>{
e.preventDefault();
document.querySelector('.fail').style.color = 'red'
console.log(inputs[4].value )
if(inputs[0].value == ''){
document.querySelector('.fail').inner... | true |
2267b9f32e5a5bf666d9a5a61a3cafb805ae2a22 | JavaScript | michalWSEI/wsei-javascript-zadania | /1_Zadania/obowiązkowe/8_DOM_Wyszukiwanie_elementow/js/app.js | UTF-8 | 1,474 | 3.21875 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", function () {
/*
Poniżej napisz kod rozwiązujący zadania. Odpowiedzi oddzielaj komentarzami.
exc 0
*/
let titleElement = document.querySelector('.title');
let dataAnimation = getDataAnimation(titleElement);
// exc 1
let homeElementQuerySelector =... | true |
f2ba13c02ce2a61e5f660b7bef254a6f56625469 | JavaScript | laura-gomez-c/flutter_test_app | /assets/microapp4/scripts.js | UTF-8 | 163 | 2.65625 | 3 | [] | no_license | function showContent() {
var temp = document.getElementsByTagName("template")[0];
var clon = temp.content.cloneNode(true);
document.body.appendChild(clon);
} | true |