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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f87a08c944f3e9b7f4cd7f31e88112487430357c | JavaScript | dbayham/albumReviewJs | /frontend-spa/src/js/displayAlbum.js | UTF-8 | 14,528 | 2.75 | 3 | [] | no_license | import {
displayHomeView
} from "./displayHomeView.js";
import {
secondsToHms
} from "./secondsToMinutesFormat.js";
const displaySingleAlbum = function(album, albums) {
const mainElement = document.querySelector(".main-content");
clearChildren(mainElement);
const sAlbumContainer = document.createE... | true |
966a642a40b374f34f17880f105d3ccfc508a88f | JavaScript | mpizzaca/lighthouse-js-fundamentals | /concat.js | UTF-8 | 177 | 3.1875 | 3 | [] | no_license | function concat(arr1, arr2) {
let result = [];
for(let index in arr1) { result.push(arr1[index]); }
for(let index in arr2) { result.push(arr2[index]); }
return result;
} | true |
9f6a4bb6ea0ac60ff3fc17d43d22aad05e3576a3 | JavaScript | wizardry/gitadoraSkillAnalyze | /src/js/view/ratelist/rateListTable.js | UTF-8 | 2,998 | 2.609375 | 3 | [] | no_license | var React = require('react');
// var $ = require('jquery');
module.exports = class RateListTable extends React.Component {
constructor(props){
super(props);
}
componentWillMount(){
// this.props.models.model.userModel.on()
}
componentDidMount(){
}
render(){
let lvMax = this.props.lvMax;
let lvMin = t... | true |
d625502bc093611587d96e56aba2549610a1bd4f | JavaScript | wheercool/just-test-it | /static/modules/books/main.js | UTF-8 | 1,805 | 2.578125 | 3 | [
"MIT"
] | permissive | define(function(require) {
'use strict';
var Controller = require('controller'),
BooksView = require('./books-view'),
BookView = require('./book-view'),
Collection = require('./collection'),
Model = require('./model'),
sinon = require('sinon'),
_ = require('underscore');
// C... | true |
c2d3131f9e46705098f7201e0a52d097f83565ae | JavaScript | timlaurijs/premier-client | /src/pages/Motivation.js | UTF-8 | 1,194 | 2.671875 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { API_URL_QUOTES } from "../constants/constants";
import axios from "axios";
import { Button, Box } from "@material-ui/core";
function getRandomNumber(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min))... | true |
f5e913efdf2858f694ac699deaf5b2cd596ed098 | JavaScript | hkobulov/currency | /js/main.js | UTF-8 | 2,749 | 2.953125 | 3 | [] | no_license | var elForm = document.querySelector('.form');
var elChooseCurrency = document.querySelector('.form__currency-choose');
var elUserMoney = document.querySelector('.user__value');
// Choose currency
var elChooseUZS = document.querySelector('.form_currency-type-uzs');
var elChooseRUBL = document.querySelector('.form_curr... | true |
3caa63078018f41e631bbe16954f2dd6b546dbcb | JavaScript | kluver/module-2-group-assignment-5-leaf-clover-1 | /app.ly/src/resumeTree.js | UTF-8 | 1,212 | 2.84375 | 3 | [] | no_license | export const resumeParser = {
resumeTree(obj, level) {
if (typeof obj == 'object' && obj !== null) {
let tmpResult = '';
for (var k in obj) {
tmpResult += this.makeElement(level, k) + this.resumeTree(obj[k],
level + 1);
}
return tmpResult;
} else {
return this.m... | true |
981cd6ff1470ffd34bc5b86a0f63ad425b2c2459 | JavaScript | S17cis526/gallery-part-1-ImRubic | /backup code/multipart.bk.js | UTF-8 | 2,000 | 3.1875 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | /**
* @module multipart
* A mobdule for processing multipart HTTP requests.
*/
"use strict;"
module.exports = multipart;
const DOUBLE_CRLF = Buffer.from([0x0D, 0x0A, 0x0D, 0x0A]);
/** @function multipart
* Takes a request and response object,
* parse the body of the multipart request
* and attaches its conte... | true |
61f44e042ade20b19616e183ed4c785678d4c47f | JavaScript | fabioper/tactical-table | /helpers/queryParser.js | UTF-8 | 698 | 2.734375 | 3 | [
"MIT"
] | permissive | const appendTo = function(obj, query, reverseValue = 0) {
let value = 1
if (query.startsWith('-')) {
query = query.slice(1)
value = reverseValue
}
return obj[query] = value
}
const queryParser = function(req, res, next) {
const { sort, fields, limit, skip } = req.query
const ... | true |
d59e4e58ed0038cad987f3bacd1ebc4eab2f86b4 | JavaScript | slava-t/server-provider | /tests/ut.js | UTF-8 | 867 | 2.734375 | 3 | [
"MIT"
] | permissive | import sleep from 'sleep-promise';
let nextId = 1;
function getNextId() {
return nextId++;
}
let nextIp = [192, 168, 2, 5];
function getNextIp() {
const ip = nextIp[0] + '.' + nextIp[1] + '.' + nextIp[2] + '.' + nextIp[3];
for(let i = 3; i >= 0; --i) {
const v = ++nextIp[i];
if(v < 256) {
return i... | true |
69c21440d67cef852baa9494a24f04040cbf41ab | JavaScript | jacobferragut/diskanet | /react-diskanet/src/Register.js | UTF-8 | 2,968 | 2.640625 | 3 | [] | no_license | import React from 'react';
import { Component } from 'react';
import axios from 'axios';
import { APIURL } from './apiurl.js';
class RegisterScreen extends Component {
constructor(props){
super(props)
this.state = {username : '', password:'', pass_or_text:'password', email:''};
this.textTyp... | true |
dfce914d67eef3e6df465e361b42ae70b4c4eee9 | JavaScript | Leonel090810/create-notes | /frontend/src/components/CreateUser.js | UTF-8 | 4,970 | 2.65625 | 3 | [] | no_license | import React, { Component } from 'react'
import axios from 'axios'
//import swal from 'sweetalert';
//import { useForm } from 'react-hook-form'
export default class CreateUser extends Component {
state = {
users: [],
useremail: '',
userpassword: '',
username: ''
}
... | true |
4268d2190ef3b3333eb4475ddfd9f3772934afec | JavaScript | asta-li/edgar | /client/src/QueryInput.js | UTF-8 | 1,671 | 2.53125 | 3 | [] | no_license | import axios from 'axios';
import React from 'react';
import TextField from '@material-ui/core/TextField';
const QueryInput = props => {
const handleKeyDown = (event) => {
if (event.key === "Enter") {
let query = event.target.value
props.setResponse("Asking Edgar...")
... | true |
f8c3d1c32413ad1519894231c0056c5274cc2415 | JavaScript | jakepino/algo-notebook | /binary-search/easy-questions/ParenthesesGroups.js | UTF-8 | 600 | 4.25 | 4 | [] | no_license | // Given a string s containing balanced parentheses "(" and ")",
// split them into the maximum number of balanced groups.
// Constraints
// n ≤ 100,000 where n is length of s.
// Example 1
// Input
// s = "()()(()())"
// Output
// ["()", "()", "(()())"]
function solve(s) {
let array = []
let temp = ''
... | true |
38f60e7c9ab1567b4a2769f266917bb14fc27f50 | JavaScript | seeren/liquify-js | /src/renderers/renderer.renderer.js | UTF-8 | 635 | 2.546875 | 3 | [
"MIT"
] | permissive | import { WebGLRenderer as ThreeWebGLRenderer } from 'three';
export class WebGLRenderer extends ThreeWebGLRenderer {
/**
* @param {HTMLElement} element
*/
constructor(element) {
super({
antialias: true,
alpha: true,
});
this.setClearColor(0x000000, 0);... | true |
fd9d6f362489c41f4a1a9bb09ac41f0c6c99d3db | JavaScript | Kimyeonggi/Kimyeonggi.github.io | /VanillaJS/과제3.js | UTF-8 | 1,438 | 3.53125 | 4 | [] | no_license | const clockContainer = document.querySelector(".js-clock"),
clockTitle = clockContainer.querySelector("h1");
const Months = [31,28,31,30,31,30,31,31,30,31,30,31];
function getTime() {
const xmasDay = new Date("2021-12-24:00:00:00+0900");
const dMonths = xmasDay.getMonth();
const dDays = xmasDay.getDate();
co... | true |
7907683cb4a09f944a50919f0f3563c4541a213f | JavaScript | BorisPerkovic/BiT-PP | /Variables/task14.js | UTF-8 | 486 | 3.59375 | 4 | [] | no_license | /*====================================================================================================
If the variable age stores the information about user’s age, how we can check whether it contains a correct value? Write expressions for checking:
-Is age negative value
-Is age greater than 120
===============... | true |
7eac44a742f891c5e1c5f93c3e84aefbfb2002da | JavaScript | 8wangjiaqi/rectangle- | /abc/rectangle.js | UTF-8 | 3,185 | 2.859375 | 3 | [
"MIT"
] | permissive | /* global Rectangle, validate, isLegalKey: true */
$(function(){
var $width = $('#width'),
$height = $('#height'),
$btnCal = $('#calculate'),
$perimeter = $('#perimeter'),
$area = $('#area'),
$widthValidate = $('#width-validate'),
$heightValidate = $('#height-validate'),
isPa... | true |
a168f56d858bb99eec7b47f0cdaf23ad9ff18a14 | JavaScript | nellessen/expensify-app | /src/playground/destructuring.js | UTF-8 | 557 | 4.0625 | 4 | [] | no_license | // Object Desctrucuring
const person = {
name: 'David',
age: 34,
location: {
city: 'Hamburg',
temp: 3,
}
}
const { name, age, notSet = 'Not Set' } = person;
const { city, temp: temperature } = person.location;
console.log(`${name} is from ${city} and ${age} years old where it has ${temperature} degrees... | true |
f5ef522afde0daea047b00cd8f234e9100c8535c | JavaScript | rufataliy/portfolioWebsite | /src/server/middleware/hashPassword.js | UTF-8 | 432 | 2.6875 | 3 | [] | no_license | const bcrypt = require("bcrypt");
const hashPassword = async(req, res, next) => {
const reg = /^(?=.*[a-zA-z])(?=.*\d).{8,10}$/;
console.log(reg.test(req.body.password));
if (reg.test(req.body.password)) {
const hashedPassword = await bcrypt.hash(req.body.password, 8);
req.body.password = h... | true |
4ec3a11d2d3c065f279f771c079e77b5d7f2f176 | JavaScript | jmadflo/node-db2-project | /api/cars/carsRouter.js | UTF-8 | 4,826 | 2.71875 | 3 | [] | no_license | const express = require('express')
const router = express.Router()
const carData = require('../../data/dbConfig.js')
// get all cars from database
router.get('/', (req, res) => {
carData('cars')
.then(cars => {
res.status(200).json(cars)
})
.catch (() => {
res.statu... | true |
a5aef7149d052638140c9ebca8d07f7ed7ff483c | JavaScript | filzilla/form-builder | /main.js | UTF-8 | 796 | 2.59375 | 3 | [] | no_license | var container = document.querySelector('#form-container');
for (i = 0; i < formData.length; i++){
var control = formData [i];
var inputElement = document.createElement('input');
inputElement.setAttribute('class', 'input');
inputElement.type = control.type;
inputElement.placeholder= control.l... | true |
c3d6258842f44c8b29b91e51fb289d78a8f8265f | JavaScript | Joe-Rinehart/jsFundamentals | /ClassRoomChallenges/Day 7/domFundamentals/index.js | UTF-8 | 1,861 | 4.03125 | 4 | [] | no_license | // getElementID() - Grabs ID'S from HTML, returns Element, single, Does not loop
const header = document.getElementById("header");
console.log(header);
header.style.color = "pink"
header.innerText = "Hello World"
// getElementsbyClassName() Grabs classes from HTML file, returns HTMLCollection, Multiple, Yes you ca... | true |
158d7c64d26c336ca0a097552cf41eb3cd1b9e01 | JavaScript | ImC6/Grab_maid | /resources/js/services/helper/utilities.js | UTF-8 | 1,929 | 2.6875 | 3 | [
"MIT"
] | permissive | import moment from 'moment'
import swal from 'sweetalert2'
export const capitalize = (str) => {
if (typeof str === 'string') {
return str.charAt(0).toUpperCase() + str.slice(1)
}
return ''
}
export const isEmpty = (arg) => {
if (isObject(arg)) {
return Object.keys(arg).length === 0 && arg.constructor ... | true |
bdd74bfb1ebbb08aa356f87f2098819c02cb277d | JavaScript | corri-golden/to-do-app | /assets/js/main.js | UTF-8 | 868 | 3.0625 | 3 | [] | no_license | console.log("yo")
//check off specific todos by clicking
//WHEN AN LI is click inside the function a UL run the code.
//on is needed for the event listener becasuse it adds listerner to new lis
$("ul").on("click", "li", function(){
$(this).toggleClass("completed");
});
//event listener for delete(x)
$("ul").on... | true |
80e805822f40e9ad06101af0c8820c418afcfcb7 | JavaScript | chrisamgad/task-manager-api | /tests/user.test.js | UTF-8 | 3,696 | 2.71875 | 3 | [] | no_license | const request = require('supertest') //allows testing requests to the server as if it is actually running and listenting to port(while it is actually not running)
const jwt=require('jsonwebtoken')
const mongoose=require('mongoose')//to create Objectid
const app=require('../src/app.js')
const User = require('../src/mode... | true |
9f88941dbe0ad144442f8204b649e2ec9f1363da | JavaScript | simsib/project-euler-solutions | /10.js | UTF-8 | 649 | 3.875 | 4 | [] | no_license | // task
/* The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below two million.
*/
console.time("script");
let array = [2,3];
let counter = 4;
let magic = 2000000;
while (array[array.length-1] < magic) {
if(counter % 2 != 0 && counter%3 != 0) {
let temp = 4;
whil... | true |
7d0c7e6ca1f9be806b452a2ea016d407f48b5843 | JavaScript | bmb330/chore-track-frontend | /app/reducers/categories.js | UTF-8 | 942 | 2.59375 | 3 | [] | no_license | import { ADD_CATEGORY, EDIT_CATEGORY, DELETE_CATEGORY } from '../actions/categories';
import { addCategory, editCategory, deleteCategory } from '../actions/categories';
const category = (state = {}, action) => {
switch (action.type) {
case ADD_CATEGORY:
return {
id: action.id,
name: action.... | true |
bbea4dbde7409bcdc1c669acebf2986e4f2bac6b | JavaScript | Noam-Bendelac/Course-Planner | /js/drag.js | UTF-8 | 2,970 | 2.65625 | 3 | [] | no_license |
var nsGlobal = nsGlobal || {};
nsGlobal.centerAndScale = function() {
// console.log(this);
scale = Math.min(
($('#canvas').height() - 2*25) / $('#page').height(), // I believe returns height before transform scaling
($('#canvas').width() - 2*25) / $('#page').width()
);
$('#page').css({
'top': ($('#canvas... | true |
673ae01487fabf66d7822195cbb1b32ee981ae74 | JavaScript | cem20903/Pudore-Cooperti | /js/objects.js | UTF-8 | 355 | 3.1875 | 3 | [] | no_license | function Object(x,y,width,height,img,ctx){
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.img = img;
this.ctx = ctx;
this.imgObject = new Image();
this.imgObject.src = "images/"+ img + ".png"
}
Object.prototype.draw = function(){
this.ctx.drawImage(this.imgObject,this.x,t... | true |
b2fb62279800b8ec8109c62e6abfd8df5cfd63ea | JavaScript | rangigo/cryptocurrency-visualization | /ReactJS/crypto-price/src/containers/Tickers/index.js | UTF-8 | 8,114 | 2.734375 | 3 | [] | no_license | import React, { Component } from 'react'
import classes from './index.css'
import Coin from '../../components/Coin'
import SortButton from '../../components/SortButton'
import Spinner from '../../components/Spinner/Spinner'
//Sort helper functions
const sortHelper = {
byRank: (a, b) => (a.rank > b.rank ? 1 : a.rank... | true |
20bd66e276e458b23d24ff68b8070d4183916262 | JavaScript | evanhackett/watchout | /watchout.js | UTF-8 | 5,370 | 3.078125 | 3 | [] | no_license | var h = 450,
w = 700,
container = d3.select('#board')
.attr({
width : w,
height : h
});
var playArea = {
width: w,
height: h,
// x : w * 0.1,
// y : h * 0.1,
x : 0,
y : 0,
rx : 20,
ry : 20,
};
// setup player area (pla... | true |
e73220ef9341dac7c23c74931ac8d4a9011b22f1 | JavaScript | mahdichantoufi/MonitoringSearchEngine | /backend/src/api/CheckableKeywords/CheckableKeywords.test.js | UTF-8 | 6,763 | 2.578125 | 3 | [] | no_license | const supertest = require('supertest');
const app = require('../../app');
// GET requests Tests
describe('GET api/v1/CheckableKeywords', () => {
it('should respond with an array of Checkable Keywords', async () => {
const response = await supertest(app)
.get('/api/v1/CheckableKeywords')
.expect('Con... | true |
608c8bda1655e4537ba6546dafa2f8a47f9d8b15 | JavaScript | JyothsnaBondada/JS-Assignment | /src/index.js | UTF-8 | 2,331 | 5 | 5 | [] | no_license | // 1. Add function code goes here
exports.add = function add(a, b) {
return a+b;
};
// 2. Multiply function code goes here
exports.multiply = function multiply(a, b) {
return a*b;
};
// 3. OddOrEven function code goes here
exports.oddOrEven = function oddOrEven(n) {
if(n%2 === 0){
return "even";
}
else{... | true |
198da2f4ee483fb1497e17a6d8bcb2b0a53bada5 | JavaScript | ZacharyGaston/lodown | /index.js | UTF-8 | 17,286 | 4.3125 | 4 | [
"MIT"
] | permissive | 'use strict';
// YOU KNOW WHAT TO DO //
/**
* each: Designed to loop over a collection, Array or Object, and applies the
* action Function to each value in the collection.
*
* @param {Array or Object} collection: The collection over which to iterate.
* @param {Function} action: The Function to be applied to ea... | true |
bdb34d32716945a3b89a142657787b7fbc2783f6 | JavaScript | vladotrocol/van-dyke | /Project/Assets/_Scripts/Player.js | UTF-8 | 1,468 | 3.296875 | 3 | [] | no_license | #pragma strict
class Player{
var state = 0; // 0 = Creator. 1 = Destroyer.
var position = 0; // 0 = Front. 1 = Back.
var vehicle = GameObject.Find("Vehicle");
function Player(s:int,p:int){
state = s;
position = p;
}
/* Takes an integer from the action enum and performs the appropriate action */
function Acti... | true |
1b709c0d4b4c33c03e0ddd7324b2a87ea6c61f86 | JavaScript | Blandaxt/Code_Wars | /squareSum/squaresum2.js | UTF-8 | 663 | 4.375 | 4 | [] | no_license |
// Second solution of the same problem
// 8 kyu
// Square(n) Sum
//
// Complete the squareSum/square_sum/SquareSum method so that it squares each number passed into it and then sums the results together.
//
// For example:
//
// squareSum([1, 2, 2]); // should return 9
// Solution:
function squareSum(numbers){
i... | true |
91ff887ea948e4b62e8f36a7fc10e1263d3fc02d | JavaScript | HermesPasser/todo | /src/components/NewItem.js | UTF-8 | 959 | 3.046875 | 3 | [] | no_license | import { useState } from 'react';
export default function NewItem({state, setState}) {
let [text, setText] = useState('')
let [done, setCompletion] = useState(false)
const handleChecked = (event) => setCompletion(event.target.checked)
const handleText = (event) => setText(event.target.value)
const addItem = (ke... | true |
170720445c67785bd2e208c854c3b7edc12147e4 | JavaScript | August-Johnson/August-Johnson.github.io | /03-javascript/psychic-game/assets/javascript/game.js | UTF-8 | 1,537 | 3.734375 | 4 | [] | no_license | var computerChoices = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
var myWinsElement = document.getElementById('myWins');
var myLossesElement = document.getElementById('myLosses');
var guessesLeftElement = document.getElementById('g... | true |
067a4fc1741a22198ce9e2f5ca9819c458a22b84 | JavaScript | tekkenking/QUESTIONNAIRE | /public/asset_vendors/bucketcodes/js/debugger.js | UTF-8 | 4,523 | 2.640625 | 3 | [
"MIT"
] | permissive | //Debuger
function _debug(msg){
"use strict";
if(window.console){
console.log(msg);
}else{
bootbox.alert(msg);
}
}
//This function is used to test " cast of a variable "
function typeString(o) {
if (typeof o != 'object')
return typeof o;
if (o === null)
return "null";
//object, array, fu... | true |
043ac98f9e7250525589976c40a29cf4c1ff57bf | JavaScript | akshaydohroo/todo-list | /src/MobileApp/UI/CategoryComponents/CategoryContent.js | UTF-8 | 3,584 | 2.515625 | 3 | [] | no_license | import React from "react";
import styles from "./CategoryContent.module.css";
import TodayTask from "./TodayTask";
export default function CategoryContent(props) {
let datetime = new Date();
datetime = (function (date) {
var tzo = -date.getTimezoneOffset(),
dif = tzo >= 0 ? "+" : "-",
pad = function... | true |
4882b8b4ed221f2b150b792bf74186cfdd8cad36 | JavaScript | Wimmind/weather_app | /src/store/actionCreators/CitiesActions.js | UTF-8 | 665 | 2.5625 | 3 | [] | no_license | import { ADD_CITY, DELETE_CITY } from "../reduсers/citiesReducers";
export const fetchCity = (city) => {
city = city.length ? city : "London";
return async (dispatch) => {
const url = `https://api.openweathermap.org/data/2.5//weather?q=${city}&appid=69b220222265f10cd300e1f1680f5938&units=metric`;
const res... | true |
abb472151644fbc0729062d2248a07f6ea753bd8 | JavaScript | rickmurdock/SoundCloud-Music-Search | /main.js | UTF-8 | 2,955 | 3.171875 | 3 | [] | no_license | /*
Here is a guide for the steps you could take:
*/
// (function () {
// 1. First select and store the elements you'll be working with
// 2. Create your `onSubmit` event for getting the user's search term
// 3. Create your `fetch` request that is called after a submission
// 4. Create a way to append the fetch result... | true |
eeb1681d3514a976fa5fa454c22e54a7b6776585 | JavaScript | syafacode/dasar_javascript | /return.js | UTF-8 | 394 | 3.640625 | 4 | [] | no_license | function nilai(){
//mengembalikan nilai string
return "Nilai 100"
}
console.log(nilai());
function angka(){
var bil = 100;
return bil;
}
console.log(angka());
function ambil(){
var lempar = "diterima";
//mengembalikan nilai yang diterima ke layar
return lempar;
}
//menyimp... | true |
12ced0c991c2a421df841d9e8cb852d2beb2e916 | JavaScript | LeonPatmore/spammer-v2 | /src/http/client.js | UTF-8 | 2,502 | 2.71875 | 3 | [] | no_license | const axios = require('axios');
axios.interceptors.request.use(
function(config) {
config.metadata = { startTime: new Date() };
return config;
},
function(error) {
return Promise.reject(error);
}
);
axios.interceptors.response.use(
function(response) {
response.conf... | true |
ff36b193c58b4e0e8e58f11c49b7b4df0d03c0e1 | JavaScript | kalinmarkov/SoftUni | /JS Core/JS Fundamentals/06. Lab - Arrays and Matrices/02. Even Position Elements.js | UTF-8 | 119 | 2.765625 | 3 | [
"MIT"
] | permissive | function main(arr) {
let oddElements = arr.filter((x, i) => i % 2 == 0);
console.log(oddElements.join(" "));
} | true |
cd05338c8c94d49b1b90f4dcf4a9dd5b8e6e53d5 | JavaScript | mastermalone/es6-work | /socks/index.js | UTF-8 | 367 | 2.921875 | 3 | [] | no_license | import { MatchingSocks } from "../socks/socks.js";
/**
* Given an array of integers, find the total number of matching pairs.
*/
const getPairs = () => {
let socksList = [20, 10, 10, 12, 14, 11, 17, 15, 20, 14, 10, 10, 11, 11, 20];
MatchingSocks.create(socksList);
document.querySelector("#results").innerHTML... | true |
fe48e8adb4668ad4430cbf762d0be00a969686ed | JavaScript | morganherlocker/geocolor | /js/site.js | UTF-8 | 12,411 | 2.625 | 3 | [
"MIT"
] | permissive | var geojson = {}
var fields = []
var styleOpts = ['fill', 'fill-opacity', 'stroke', 'stroke-opacity', 'marker-color', 'stroke-width', 'marker-size', 'marker-symbol']
$(function(){
// Setup codemirror
var textarea = $('#styles')[0]
var editor = CodeMirror.fromTextArea(textarea,{
mode: 'application/json',
... | true |
4735a43144c06a208c3ac3f9d0bcbcd1b0c82031 | JavaScript | BrianBeeler/techdegree5 | /js/scripts.js | UTF-8 | 4,790 | 3.046875 | 3 | [] | no_license | console.log("Linked to html, correctly.")
let createAndAppendTo = (htmlStr, parentTag) => {
searchContainer = document.querySelector(parentTag);
searchContainer.insertAdjacentHTML('beforeend', htmlStr)
}
// Create the search template
createAndAppendTo((
`<form action="#" method="get">
<input ty... | true |
798e027e3aa2a234ffc2b4aeb0f4ca73983c9dd1 | JavaScript | slothwerks-studio/chirpus-battle | /includes/battleScript.js | UTF-8 | 6,390 | 3.859375 | 4 | [] | no_license |
// When the awesome code below is complete, wrap it into a self-executing function for use on the website.
// Variable game parameters
var userHealthDefault = 40; // Total health for the game
var grantHealthDefault = 10; // This is health *per round*
var grantName = "the Almighty Grant"; // Change this to revise Gra... | true |
69ec19b85d4ee0a49c51636624431a915ca1dabb | JavaScript | danimatuko/dev-talks | /server/models/Post.js | UTF-8 | 1,555 | 3.078125 | 3 | [] | no_license | const getCurrentDate = require("../helpers/getCurrentDate");
const db = require("../database/db");
class Post {
constructor(post_id, user_id, title, body, date, author, imageUrl, likes = 0) {
this.post_id = post_id;
this.user_id = user_id;
this.title = title;
this.body = body;
this.date = date;
this.autho... | true |
2ccee18686a4e3c9c3362bc6237f3c1c5142f1c9 | JavaScript | m-m-m-m-m-m/m-m-m-m-m-m.github.io | /FE_7_L-13/js/compose.js | UTF-8 | 311 | 2.671875 | 3 | [] | no_license | function compose(...fn) {
return (...args) =>
fn.reduceRight((prev_output, func) =>
func.apply(null, toArray(prev_output)), args);
function toArray(val) {
return Array.isArray(val) ? val : [val];
}
}
if (typeof module !== "undefined") {
module.exports = compose;
}
| true |
743270625097304999f135679d50d2b40ccf151a | JavaScript | AgustinaLuz/ITMaster-nivel-1 | /Clase 19/Ejer-1/index.js | UTF-8 | 2,060 | 2.59375 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
const paises = [ {pais: "Argentina", capital: "Buenos Aires", continente: "América"},
{pais: "Alemania", capital: "Berlin", continente: "Europa"},
{pais: "Uruguay", capital: "Montevideo", conti... | true |
cf30cbd7fbc7278a0bffc2cab672596cb79dc9ae | JavaScript | julia-rudenko/IT-Step | /js/hw12_23_01/2.js | UTF-8 | 150 | 3.328125 | 3 | [] | no_license | function sequence (a,b) {
let arrayOfNumbers = [];
for (let i=a; i<=b; i++) {
arrayOfNumbers.push (i);
}
return(arrayOfNumbers);
}
sequence(2,4) | true |
100ce01f31db24ba1a46c70a25e18c47b5109177 | JavaScript | MikeAustin71/prof-frisby-functional-prog-jspm-systemjs-mocha | /016_Ch09_Exercises/01_Chap09Examples/src/tests/Ex02_tests.js | UTF-8 | 675 | 2.53125 | 3 | [] | no_license | /**
* Created by mike10 on 12/20/2015.
*/
export let __hotReload = true;
import {assert} from 'chai/lib/chai.js';
import {Maybe} from 'folktale/data';
import {monads} from 'folktale/control';
describe("Ex02 Join Exercises", function(){
describe("Ex01-1 - Join Example: mmo = Maybe.of(Maybe.of('numchucks'))"... | true |
17d6ec51459ac92c0da3f71bb808420b2f975864 | JavaScript | VanGog06/ReactJS-Fundamentals | /05. WorkShop/src/components/Books/EditBookPage.js | UTF-8 | 2,017 | 2.609375 | 3 | [] | no_license | import React, { Component } from 'react';
import toastr from 'toastr';
import BookForm from '../common/BookForm';
import BookStore from '../../stores/BookStore';
class EditBookPage extends Component {
constructor(props) {
super(props);
this.state = {
book: {
title: '',
description: ''... | true |
8d23a38b276d511281e3d9810f002e3b71e00f29 | JavaScript | gabe-campbell/Codeup2.dev | /js/set-attribute.js | UTF-8 | 502 | 3.984375 | 4 | [
"MIT"
] | permissive | var firstItem = document.getElementById('one'); // Get the first item
firstItem.className = 'complete'; // Change its class attribute
var fourthItem = document.getElementsByTagName('li').item[3]; // Get the fourth item
fourthItem.setAttribute('class', 'cool'); // Add an attribute to it
// This exercise first s... | true |
33522f2daa795ae3b902c87695be9d0d28ed8cd5 | JavaScript | GiorgiSheshaberidze/JavaScriptHomework | /Assign3/jQClone.js | UTF-8 | 8,767 | 2.8125 | 3 | [] | no_license | (function(window, document) {
var jQClone = function(selector, context) {
if (selector !== undefined) {
if (context === undefined)
context = document;
var elems = context.querySelectorAll(selector);
for(var i = 0; i < elems.length; i++)
th... | true |
372cc2c88f299b988d8e9ec6cf28bd6e63689993 | JavaScript | dominikaporzyczka/MVO-Cat-Clicker | /js/app.js | UTF-8 | 5,468 | 3.078125 | 3 | [] | no_license | (function () {
const model = {
currentCat: null,
cats: [
{ name: 'Cat', imgSrc: 'img/cat1.jpg', clickCount: 0 },
{ name: 'Fluffy', imgSrc: 'img/cat2.jpg', clickCount: 0 },
{ name: 'Purr', imgSrc: 'img/cat3.jpg', clickCount: 0 },
],
isAdminAreaHidd... | true |
c5675103da44c307aa1d3678310df90a326edc04 | JavaScript | Felixmp7/Master-JS | /POO_Typescript/js/07-decorators.js | UTF-8 | 2,883 | 2.71875 | 3 | [] | no_license | // Decoradores
// Agregan nuevos metodos a clases que no los poseen.
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
... | true |
8b5af4643b446886b6a29a14549120b033b9df69 | JavaScript | KitchenBomber/Server-side-calculator | /server/public/client.js | UTF-8 | 3,843 | 3.15625 | 3 | [] | no_license | console.log('JS');
$(document).ready(onReady);
function onReady() {
console.log('Jquery ready');
getCalculationData();
$("#valuesIn").on('click', objectPacker);
$('#clearValues').on('click', thePurge);
//may need to create a clearTheDom function to run at start
}
// let objectToSend = {};
funct... | true |
71f6919eba3f151bd56fee0d4a5945afd9a25a18 | JavaScript | meandavejustice/ubu | /public/index.js | UTF-8 | 2,039 | 2.796875 | 3 | [] | no_license | var playIndex = 0;
var info = document.querySelector('.info');
var tracklist = __JSON_GLOBALS_.tracklist;
var src;
var infoTmp = require('../templates/info');
play(tracklist[playIndex]);
[].slice.call(document.querySelectorAll('.mylist li a.track')).forEach(function(el, index) {
el.addEventListener('click', selectTr... | true |
2faccbc94d66a323ea501e473514db51ad8a05ac | JavaScript | toyluck/Learn_Javascript | /arrays.js | UTF-8 | 286 | 3.359375 | 3 | [] | no_license | var myArr=[];
console.log(myArr.length);
myArr[10000]=10000;
console.log(myArr.length);
(
function foo(){
var h_time;
return function(time){
h_time= "time = "+ time;
return h_time;
}
}
var foo=foo();
foo("time");
)
| true |
68f88f62c73060ce2e2d1c8a4f51d08e6841ac49 | JavaScript | paulshorey/FlySwatterTech | /src/inject.js | UTF-8 | 22,791 | 2.609375 | 3 | [] | no_license | (function() {
let DEBUG1 = false // which stuff to hide/show
let DEBUG2 = false // localStorage/indexDB
let DEBUG3 = false // buttons inside cookie banner
let DEBUG4 = false // buttons inside cookie banner - advanced
/*
* IS DISABLED ?
*/
if (DEBUG2) console.log("key", "flySwatterTech-" + window.loc... | true |
ed607a6176de27d5248f8b2754fd81718e9acb23 | JavaScript | jlangy/tweeter | /public/scripts/composer-char-counter.js | UTF-8 | 420 | 3.265625 | 3 | [] | no_license | //Handle text input into the tweet form, putting appropriate class on the counter
$(document).ready(function(){
$('#tweet-text').on('keyup', function(event){
const textArea = $(this);
const counter = $('#counter');
const textLength = MAX_TWEET_LENGTH - textArea.val().length;
counter.text(textLength);
... | true |
8ce32011a8540965379ac1a7be6918a154f42195 | JavaScript | karmiy/kealm-react-components | /packages/components/common/motion/utils/childrenUtils.jsx | UTF-8 | 3,030 | 2.75 | 3 | [] | no_license | import React from 'react';
import { isArray } from 'utils/common/base';
const defaultKey = `km_animate_${Date.now()}`;
/**
* Add key to a single of props.children
*/
export function completeChildrenKeys(children) {
if (React.isValidElement(children)) {
if (!children.key) {
return React.clone... | true |
530d07d740bd937ac0d368b3bf6742dba44a3be2 | JavaScript | Roman-K93/EpamFrontEndLab | /js/html.js | UTF-8 | 1,299 | 2.84375 | 3 | [] | no_license | var Html = {
getTaskFromModal: function(){
var task_name = document.getElementById("task_name").value;
var task_desc = document.getElementById("task_desc").value;
var task = {name: task_name,description: task_desc, status: "planned" };
var t_deadline = document.getElementById("t_dead... | true |
ff22088f794573edc659ef95ccd1702e09209bac | JavaScript | Ari-Tech/js-play | /app.js | UTF-8 | 1,467 | 3.625 | 4 | [] | no_license | const pipe = (...fns) => (x) => fns.reduce((v, f) => f(v), x);
const add2= (n)=>{
return n + 2;
}
const multi3 = (n)=>{
return n * 3;
}
const add10=(n)=>{
return n + 10;
}
const multi2=(n)=>{
return n *2;
}
console.log(multi2(add10(multi3(add2(5))))) // --> 62
console.log(
pipe(
add2,
... | true |
aab5885b16e3e84c56fbe7c3eec26f4e54524373 | JavaScript | mykhailo11/tab-operations | /js/selectable.js | UTF-8 | 786 | 2.515625 | 3 | [] | no_license | import { loads } from "./load.js";
import { wrapped } from "./wrapped.js";
export const SELECTABLE = "selectable";
export const selectables = () => wrapped.filter(isSelectable);
export function loadSelectables(){
selectables().map((element) => wrapSelectable(element));
}
export function isSelectable(element){
... | true |
a94fa878618f25912f811022ccf5756b8246fd83 | JavaScript | krmanik/Zhongwen-Buttons | /Zhongwen Buttons/scripts.js | UTF-8 | 1,745 | 2.859375 | 3 | [
"MIT"
] | permissive | var html = `
<div class="zh-buttons-bottom">
<div id="tts" class="zh-buttons btn4">TTS</div>
<div id="save_words" class="zh-buttons btn3">Save</div>
<div id="view_words" class="zh-buttons btn2">View</div>
</div>
`
var div = document.createElement("zhongwenbuttons")
div.innerHTML = html;
document.body.appen... | true |
cd27f022f831a2bc61c948e9afffbbaaad0ef3bd | JavaScript | John-Harris/htmlformselect-mrusorter-jq | /js/htmlformselect_mru_jq.js | UTF-8 | 6,583 | 2.78125 | 3 | [] | no_license | /**
* A jQuery plugin that can provide two value-add services to html form select controls
* first optional service is alphabetical sorting via the labels text
* second optional service is 'mru' most-recently-used
* the web page user's most recently selected choices from that select list can be made to appe... | true |
d21e6f95962f16bc5e4668870d18f13b501a1bb5 | JavaScript | mojs-contrib/mojs | /js/tween/tweener.babel.js | UTF-8 | 3,714 | 2.859375 | 3 | [
"MIT"
] | permissive | import '../polyfills/raf';
import '../polyfills/performance';
import h from '../h';
class Tweener {
constructor() {
this._vars();
this._listenVisibilityChange();
return this;
}
_vars () {
this.tweens = [];
this._savedTweens = [];
this._loop = this._loop.bind(this);
this._onVisibili... | true |
722c3ca40221061c9b22eff484e2194e818db4b8 | JavaScript | CaffeinatedCM/chai-jest-mocks | /test/utils/ensureMock.test.js | UTF-8 | 903 | 2.6875 | 3 | [
"MIT"
] | permissive | const { expect } = require('chai');
const {
matcherHint,
printReceived,
printWithType,
RECEIVED_COLOR
} = require('jest-matcher-utils');
const ensureMock = require('../../lib/utils/ensureMock');
describe('ensureMock', () => {
it('does not throw when a jest mock is passed in', () => {
expect(() => ensur... | true |
eec68c40bdb3bb22a121757329cef6c88b0b78b6 | JavaScript | bneiluj/React-Github-App-Demo | /app/utils/helpers.js | UTF-8 | 644 | 2.78125 | 3 | [] | no_license | import axios from 'axios';
/**
* Get repos
*/
function getRepos (username) {
return axios.get(`https://api.github.com/users/${username}/repos`);
}
/**
* Get user info
*/
function getUserInfo (username) {
//$ is to evaluate - part of es6
return axios.get(`https://api.github.com/users/${username}`);
}
expo... | true |
cf38a678da8f2244e330fb5a5871fbeb79cc984c | JavaScript | k0rteksz/javascript-az-alapoktol | /ajax/script.js | UTF-8 | 2,708 | 3.140625 | 3 | [] | no_license | /*
* AJAX kérések
* Asynchronous JavaScript and XML
*/
document.getElementById("login").onclick = function() {
var url = 'https://reqres.in/api/login';
var body = JSON.stringify({
email: 'eve.holt@reqres.in',
password: 'cityslicka'
})
/*
// callback hell / pyramid of doom
sendRequest(url, 'POST... | true |
ede8f51c4fd7d23fc604a75292be45310d680a0a | JavaScript | kunal121/evaluate-news-nlp | /src/tests/formhandler.test.js | UTF-8 | 1,390 | 2.984375 | 3 | [] | no_license | const handleSubmitMock = (event, Client, fetch) => {
event.preventDefault();
let formText = document.getElementById("name").value;
let resultsContainer = document.getElementsByClassName("show-results");
const errorHandler = document.getElementsByClassName("error")[0];
if (resultsContainer[0].innerHTML) {
... | true |
cb01f9381d4fa8bdf216de627d06099a2a18f40e | JavaScript | hpyjr/contact | /src/lib/Utility.js | UTF-8 | 303 | 2.953125 | 3 | [] | no_license | const filterItems = (arr, query) => {
return arr.filter(el => el.toLowerCase().indexOf(query.toLowerCase()) !== -1);
};
export default class Utility {
static hasWhiteSpace(s) {
console.log('value of s', s)
// return /\s/g.test(s);
return s.indexOf('+') >= 0;
}
}
| true |
a807b57c69706effcba257576ac3452946750e2a | JavaScript | syedalirazazaidi/async-library- | /my-api/src/App.js | UTF-8 | 1,078 | 2.765625 | 3 | [] | no_license | import React from 'react';
import './App.css';
import Async from 'react-async';
// We'll request user data from this API
const loadUsers = () =>
fetch("https://jsonplaceholder.typicode.com/users")
.then(res => (res.ok ? res : Promise.reject(res)))
.then(res => res.json())
// Our component
function App() {
ret... | true |
9993332956bd52c827a45406f0cefa18c7a4ad1d | JavaScript | aliahsan07/TAJS | /test-resources/src/micro/assumes.js | UTF-8 | 2,670 | 3.265625 | 3 | [
"Apache-2.0"
] | permissive | var a,b,c,t,i;
function init() {
a = {
d:42,
e: function() { return 0 },
f: {
g: -87,
h: function() { return 1 }
}
}
i = function (){ return true }
if (Math.random()) {
b = a
c = i
} else if (Math.random()) {
b = a.f
c = null
} else {
b = null
c = a
}
}... | true |
4abce380f8a46e91015c44e380c5a921a7b6aa4b | JavaScript | Brayan1013/git-test | /index.js | UTF-8 | 268 | 2.625 | 3 | [] | no_license | console.log('Hola mundo')
console.log("This is something I'm adding this is brayan");
const getCountries = () => {
console.log("This function basically retuns the countries");
}
const getAllClients = () => {
console.log('We are just adding something here');
}
| true |
14b8ed0c89889dfafdc9cb1171e1603cdd67752d | JavaScript | rishabhsxn/Codes | /javascript/JS_lco/Examples/forEach.js | UTF-8 | 371 | 3.671875 | 4 | [] | no_license | // trello is a ToDo application
// forEach loop
const days = ['Mon', 'Tue', 'Wed', 'Thr', 'Fri', 'Sat']
days.forEach(function(day,index){
console.log(`index = ${index} and value = ${day}`)
})
// we have defined a function inside forEach loop
// this function do not have a name
// 1st pa... | true |
ef8400b0736df53a265151f66f298c45a59cb808 | JavaScript | lindamxu/fend-classic-arcade-game | /js/app.js | UTF-8 | 3,930 | 3.8125 | 4 | [] | no_license | //Global variables
let modalElement = document.querySelector('#modal');
let modalRepeatBtn = document.querySelector('.modal_repeat');
// Enemies our player must avoid
var Enemy = function(x, y, speed) {
this.x = x;
this.y = y;
this.speed = speed;
// Variables applied to each of our instances go here,
... | true |
b4df07abc4d748a28deb88f55abd51628cff1290 | JavaScript | CSchnars13/SoundShare | /client/modules/User/ArtReducer.js | UTF-8 | 555 | 2.640625 | 3 | [
"MIT"
] | permissive | import {ADD_ALBUM_ART} from './ArtActions';
// Initial State
const initialState = { data: [] };
const ArtReducer = (state = initialState, action) => {
switch (action.type) {
case ADD_ALBUM_ART :
return {
data: [action.albumArt, ...state.data],
};
default:
return state;
}
};
/* S... | true |
03418865cd3400821540218eb2de60067da64ffb | JavaScript | leeTheGit/arta-frontend | /src/containers/Plants/Plantdataform.js | UTF-8 | 4,582 | 2.5625 | 3 | [] | no_license | import React, {Component} from 'react';
import axios from 'axios';
import qs from 'qs';
class Plantdataform extends Component {
state = {
conductivity: this.props.conductivity || "",
light_hours: this.props.light_hours || "",
temperature: this.p... | true |
77f620ad30bbfe80fb06b87675eaf96973917a96 | JavaScript | visualjazz-sbrunno/hugofy-white-label | /src/scripts/components/C16-ContactForm.js | UTF-8 | 4,410 | 2.875 | 3 | [] | no_license | import {Component} from "../modules";
/**
* UIKit Forms with custom javascript validation
*
* @class ContactForm
* @extends {Component}
*/
class ContactForm extends Component {
constructor() {
super("C16");
if (super.exists()) {
const self = this;
const form = document.getElementById("conta... | true |
4e1d38d945c7c5833d932ecbd82896a5e7c2aa54 | JavaScript | zaharich/JS_part_1 | /02/js_2_1_(2_2).js | UTF-8 | 1,459 | 3.84375 | 4 | [] | no_license | var a = 1, b = 1, c, d;
c = ++a; alert(c); // 2 префиксная форма записи поэтому сначала а=а+1, потом с=а (a уже равно 2)
d = b++; alert(d); // 1 постфиксная форма записи - поэтому сначала d=b (b все еще равно 1). Потом b=b+1
c = (2+ ++a); alert(c); // 5 a=2, префиксная форма a=a+1(а=3), далее 2+a=5 . Порядок оп... | true |
3ba4ee350db1753c1274f452ef5d52d882443f44 | JavaScript | Noroff-FEU-Assignments/project-exam-1-sustrQx | /scripts/about.js | UTF-8 | 670 | 2.59375 | 3 | [] | no_license | const nav = document.querySelector(".navdesktop");
const logo = document.querySelector(".logo");
const rightnav = document.querySelector(".Drightnav");
const leftnav = document.querySelector(".Dleftnav");
function handleScroll() {
const scrolledY = window.scrollY;
if (scrolledY > 10) {
nav.classList.add("scro... | true |
35d982a39e77c1feac46a12ce840a0afdacc56f2 | JavaScript | jamiepeck7/jamiepeck7.github.io | /lesson11/js/forecast.js | UTF-8 | 1,753 | 3.109375 | 3 | [] | no_license | const apiURL1 = "https://api.openweathermap.org/data/2.5/forecast?id=5604473&appid=0f67612171889e60e18b70cc5ea95cb2&units=imperial";
fetch(apiURL1)
.then((response) => response.json())
.then((jsObject) => {
console.log(jsObject);
const list = jsObject['list'];
const days = ["Sunday", "M... | true |
85ddd1126899106bc1a56067f52c10da8509a968 | JavaScript | chackop/codility-lessons | /L2_Arrays/CyclicRotation/CyclicRotation.js | UTF-8 | 1,127 | 4.0625 | 4 | [] | no_license | // you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
function solution(A, K) {
// write your code in JavaScript (Node.js 8.9.4)
// The first array of the last K items was created by preceding the value with ‘-’ sign. If an index is a negative integer, an array’s leng... | true |
2a0d177b860bc8848263b4cebc4452279eb455ce | JavaScript | astaruch/panco.staruch.sk | /web/controller.js | UTF-8 | 564 | 2.78125 | 3 | [
"MIT"
] | permissive | function toggleDarkMode(event, editUrl = true) {
document.querySelector('body').classList.toggle('darkmode');
if (editUrl) {
if (!window.location.href.includes('#darkmode')){
window.location.href = window.location.href + '#darkmode';
} else {
window.location.href = w... | true |
7c90179f75992f09a8048f20d1be9f53f1c748ed | JavaScript | DokiDokiMorning/Grupo-5-Proyecto-Software | /Entregable 2/navegador.js | UTF-8 | 862 | 3.109375 | 3 | [] | no_license | function openNav() {
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft = "0";
}
function driveNav() {
... | true |
2eaf07f4ac5ab7ce4f6c452dc79486db0e816d8a | JavaScript | Land-DAO/land-dao-floor-js | /index.js | UTF-8 | 1,780 | 2.515625 | 3 | [] | no_license | require('dotenv').config()
const axios = require('axios')
const { Client, Intents } = require('discord.js');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { DISCORD_TOKEN, REFRESH_TIMER } = process.env
const client = new Client({ intents: [Intents.FLAGS.GUILDS... | true |
b3079f79404d8aa36c674073037902173f6ccac8 | JavaScript | htong1/html5 | /LeetCode/integerBreak.js | UTF-8 | 319 | 3.703125 | 4 | [] | no_license | var integerBreak = function(n) {
if(n <= 3){
return (n-1);
}
if(n >= 4){
let div = (n-2)/3, num = Math.floor(div), exp = 3**num, prod = 3 * num, stuff = n - prod;
return exp * stuff;
}
};
var integerBreak = n => n <= 3? (n-1): 3**Math.floor((n-2)/3) * (n-3 *Math.floor((n-2)/3)); | true |
608c84d34bdaa51263c69c7910d5606244df5d7d | JavaScript | Awadhesh1994/ReactJS | /mail_box/src/components/data/usrdata.js | UTF-8 | 468 | 2.546875 | 3 | [
"MIT"
] | permissive | const User = {
peopleYou: [
{people: 1, image: 'panda.jpg', name: 'Rahul Bairwa'},
{people: 2, image: 'panda.jpg', name: 'Hemankur Mohar'},
{people: 3, image: 'panda.jpg', name: 'Sakshi Singla'},
{people: 4, image: 'ProfilePhoto.jpg', name: 'Awadhesh Kumar'}
],
all: function ... | true |
bb83bf7956c494e4a6aa593108c3df7026fd2e9c | JavaScript | SamanKeighobadi/password-generator-node | /index.js | UTF-8 | 772 | 2.703125 | 3 | [] | no_license | const chalk = require("chalk");
const { program } = require("commander");
const clipboard = require('clipboardy');
const { createPassword } = require("./utils/createPassword");
program.version("1.0.0").description("Simple Node.js Password Generator");
program
.option("-l,--length <number>", "Length of password", "9... | true |
fa643e815b66dd69768548a7ac2cc9f1c3b7981c | JavaScript | AnwarJones/CoderCampsLabs | /Labs/Day 5/Day 5/JS/app.js | UTF-8 | 827 | 3.578125 | 4 | [] | no_license | //let personArray = [];
//class Person {
// constructor(public name: string, public age: number) { }
//}
//function createPerson() {
// let name = $('#fullname').val();
// let age = $('#age').val();
// let newPerson = new Person(name, age)
//}
//sessionStorage.setItem("People", JSON.stringify(personArray));... | true |
98f5c992551a1fd07b365dd4e1c840d1d491f415 | JavaScript | Aarini123/Project-106-NEW | /main.js | UTF-8 | 2,067 | 2.71875 | 3 | [] | no_license | var p1="";
var p2="";
Webcam.set({
width:350,
height:330,
image_format:"png",
png_quality:90
});
camera=document.getElementById("camera");
Webcam.attach("#camera");
function take_snapshot(){
Webcam.snap(function(data_uri){
document.getElementById("snap").innerHTML="<img... | true |
264d6d0c39bde833ab199525b4f8db7f7c253963 | JavaScript | Golodhros/js-jumpstart | /es2015/modules.js | UTF-8 | 605 | 3.0625 | 3 | [] | no_license | // Modules
// Webpack, JSPM, Browserify
// Every module is a file, you can't have multiple modules per file
// Named Exports
// lib/math.js
let notExported = 'abc';
export function square(x) {
return x * x;
}
export const MY_CONSTANT = 123;
// main1.js
import {square, MY_CONSTANT} from 'lib/math';
console.log(sq... | true |
793aedb9f7ab1c3ae2ced1548c2c8899bd429510 | JavaScript | twoodard3344/jsdom-using-the-dom-activity-twoodard3344 | /code.js | UTF-8 | 3,386 | 3.671875 | 4 | [] | no_license | /* _______________________________________________________________
Part 1.) It's the UX bunch!
To reveal who is behind box 2, we'll need to use some
DOM methods and change the opacity back to 1.
We've assigned ID of "box-two" to the image.
Use getElementById to select the element, then assign that elem... | true |
a321ab44388503619eaa3b49343cdf16e98f548e | JavaScript | Childeryk/Tester_Automatyzuj-cy_zadanie_1 | /Tester_Zaliczenie/out/report.js | UTF-8 | 3,634 | 2.515625 | 3 | [] | no_license | $(document).ready(function() {var formatter = new CucumberHTML.DOMFormatter($('.cucumber-report'));formatter.uri("zadanie1.feature");
formatter.feature({
"line": 1,
"name": "Zadanie1",
"description": "",
"id": "zadanie1",
"keyword": "Feature"
});
formatter.scenarioOutline({
"line": 3,
"name": "dodawanie a... | true |