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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8a6d7eb6bafb7d5de13204f32d6df165133804ed | JavaScript | ArunPandey2000/NotesAgents | /add.js | UTF-8 | 1,881 | 3 | 3 | [] | no_license |
function AddQuote()
{
var name = document.getElementById("name").value;
var quote = document.getElementById("quote").value;
var d = new Date();
var ele = document.getElementsByName('gender');
for(i = 0; i < ele.length; i++) {
if(ele[i].checked)
... | true |
8ed72423b7f30c3fba6479e6527f886b123cb2d3 | JavaScript | eeedubs/web-js-palindromes | /lib/palindromes.js | UTF-8 | 235 | 3.421875 | 3 | [] | no_license | function isPalindrome(s) {
var x = s.split(" ").join("");
var stringReverse = x.split("").reverse().join("");
return x == stringReverse;
// return if the entered string equals the reverse string
}
module.exports = isPalindrome;
| true |
0f5a1e180dd0ca7c094fd2cbd6d11ac73f6559ba | JavaScript | rodoherty1/Nodeschool | /core-myprogram.js | UTF-8 | 133 | 3.15625 | 3 | [] | no_license | var args=process.argv;
var lenght=args.length;
var sum=0;
for(var i=2; i<lenght; i++) {
sum=sum+Number(args[i]);
}
console.log(sum);
| true |
dbf862e3723fea69becedb8d366bd32085d54fca | JavaScript | npolar/npdc-common | /src/components/formula/directives/tabdata/csvService.js | UTF-8 | 3,332 | 2.96875 | 3 | [
"MIT"
] | permissive | 'use strict';
let csvService = function() {
'ngInject';
const DEFAULT_DELIMITER = ",";
const NEWLINE = "\r\n";
let isBoolean = function (value) {
return ["true", "false"].indexOf(value.toLowerCase()) !== -1;
};
let parseValue = function(value) {
let num, parsed;
if (value === undefined) {
... | true |
954f81f0b2d51440983b627c3837cfe0e4f452cf | JavaScript | Lowari/lol-from-scratch | /assets/js/script.js | UTF-8 | 1,799 | 3.25 | 3 | [] | no_license | // Variable utile dans tous le js
const regexSymbol = /[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]/;
// Ajout autmatique de la class currentPage
const links = document.getElementsByTagName('a');
for (i = 0; i < links.length; i++) {
var link = links[i];
if (link.href.match(document.location.href)) {
this.link... | true |
93103dde8dc478659f4167c9da304e8fd0395fae | JavaScript | Skateside/jquery-aria | /src/global/toWords.js | UTF-8 | 727 | 3.609375 | 4 | [
"MIT"
] | permissive | /*global
interpretString,
identity
*/
/**
* Converts the given string into an array of the words. The <code>string</code>
* argument is converted into a string before being split - see
* {@link interpretString} for more information.
*
* @global
* @private
* @param {String} string
* String (o... | true |
d3a984d2eeeceeaaf21e7136cebc3c992d6ae964 | JavaScript | jonmase/chooser | /webroot/js/src/options/option-filter-form.jsx | UTF-8 | 5,764 | 2.578125 | 3 | [] | no_license | import React from 'react';
import Checkbox from '../elements/fields/checkbox.jsx';
import DateTime from '../elements/fields/datetime.jsx';
import Radio from '../elements/fields/radio.jsx';
import RangeSlider from '../elements/fields/range-slider.jsx';
function OptionFilterForm(props) {
//Adjust right padding on s... | true |
e5fa885e1997b38ccb888dc4634a7d8d65c8c546 | JavaScript | marin-nearsoft/javaschool-ui | /webapp/js/home.js | UTF-8 | 2,237 | 2.9375 | 3 | [] | no_license | $(document).ready(function(){
function _getCities(cities){
_fillSelect(cities, $('#originSelect'));
_fillSelect(cities, $('#destinationSelect'));
}
function _fillSelect(array, select){
if(select.find('option').length <= 1){
$(array).each(function(index, city){
... | true |
6a5ac93e27ebe70ff91d89746b0832d077293630 | JavaScript | lateralcreativity/reducer-todo | /reducer-todo/src/App.js | UTF-8 | 1,217 | 2.65625 | 3 | [] | no_license | import './App.css';
import {useReducer, useState} from 'react';
import { initialState, reducer } from './reducers/reducer';
import ToDoList from './components/ToDoList';
function App() {
const [newTask, setNewTask] = useState('');
const [state, dispatch] = useReducer(reducer, initialState);
const inputHandler =... | true |
f8fb4b8e861178fbb76eeb292e73c3cced06c582 | JavaScript | jukkhop/advent-of-code-2018 | /day6/part2.js | UTF-8 | 853 | 3.203125 | 3 | [] | no_license | const tmpl = require('reverse-string-template');
const _ = require('lodash');
const distance = (x1, y1, x2, y2) => Math.abs(x2 - x1) + Math.abs(y2 - y1);
const distanceSum = (areas, x, y) =>
areas.reduce((sum, area) => sum + distance(x, y, area.x, area.y), 0);
module.exports = data => {
const areas = data
.m... | true |
47d3b9a14d148c8330399cae289c48f612342976 | JavaScript | monsurriaz/nodejs-CURD | /controllers/shop.controller.js | UTF-8 | 1,942 | 2.546875 | 3 | [] | no_license | const shopService = require('../services/shop.service');
//async, await method
module.exports.create = async (req, res, next) => {
try {
const shop = await shopService.create(req.body);
return res.status(200).json(shop);
} catch (e) {
console.error(e);
return res.status(500).jso... | true |
fb18da112530bfbcfa2a4eeea2e29d011d757d1b | JavaScript | biadias99/congreven-api | /app/Controllers/Http/ActivityController.js | UTF-8 | 2,705 | 2.765625 | 3 | [] | no_license | 'use strict'
const ActivityBusiness = use('App/Business/ActivityBusiness')
class ActivityController {
constructor() {
this.activityBusiness = new ActivityBusiness();
}
async create({ request, response }) {
const data = request.all()
try {
await this.activityBusiness.create(data)
respon... | true |
0a062a6d7a8bf6a5b096105431d5a77f07159b98 | JavaScript | RichieChoo/handwritingjs | /prepare/2-algorithm/bytedance/👌46.全排列.js | UTF-8 | 656 | 2.796875 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=46 lang=javascript
*
* [46] 全排列
*/
// @lc code=start
/**
* @param {number[]} nums
* @return {number[][]}
*/
var permute = function (nums) {
let used = {};
let res = [];
function backtrack(cPath = []) {
if (cPath.length === nums.length) {
res.push(cPath.slice());
return;
... | true |
14dba04f9256d3b9c0e6b326440baeee764cb8ee | JavaScript | frontzhm/mlayer | /mlayer/mlayer.js | UTF-8 | 6,512 | 2.6875 | 3 | [
"MIT"
] | permissive | // import './layer.css'
/**
* 弹出层的类型:
* 1. toastOptions 简单的文字提示(包括加载层)
* 2. 单个按钮的提示
* 3. 两个按钮的提示
*
* 共同属性
* 1.是否有遮罩
* 2.点击遮罩能不能关闭弹出层
* 3.标题
* 4.内容
* 5.弹出层的层数
* 6.图标的加载
* 7.自动关闭的时间
*/
const body = document.body
const root = document.documentElement
const cssHref = Array.prototype.filter.call(document.scrip... | true |
4154972a19377517f2ef2043ae9b62500fd28aea | JavaScript | danrnascimento/javascript30 | /Day21/js/speed_compass.js | UTF-8 | 545 | 2.96875 | 3 | [] | no_license | const speed = document.querySelector('.speed');
const compass = document.querySelector('svg');
const compassFunction = (data) => {
speed.textContent = data.coords.speed;
compass.style.transform = `rotate(${data.coords.heading}deg)`;
if(data.coords.speed == null || data.coords.heading == null) {
al... | true |
a270927934dfb89feca7c8aacad8f162ea06e56b | JavaScript | JulieMolla/P6_game_OC | /assets/js/weapon.js | UTF-8 | 461 | 3.015625 | 3 | [] | no_license | // Creation de la class Weapon
export class Weapon {
constructor(name, picture, power) {
this.name = name
this.picture = picture;
this.power = power
}
setPosition(cell) { // on assigne la cellule comme position de l'arme
this.position = cell;
}
draw() { // voir exp... | true |
527e17c783fa9501694b311c6c60a51508f144e1 | JavaScript | codalife/leetCode | /string/strStr/strStr.js | UTF-8 | 2,456 | 4.125 | 4 | [] | no_license | /*
Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
*/
/**
* @param {string} haystack
* @param {string} needle
* @return {number}
*/
/**
* @param {string} haystack
* @param {string} needle
* @return {number}
*/
/******************* n... | true |
e51ab46f265a360cfaf36df810d5cf6a6505f73e | JavaScript | rachnatiwari/reddit_app | /reddit_app/src/nav.js | UTF-8 | 2,195 | 2.59375 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import './nav.css';
function Nav() {
const [user, setUser] = useState({});
const [errors, setErrors] = useState(null);
async function fetchData() {
const res = await fetch("https://www.reddit.com/user/Rachna... | true |
63370137bfebed07c31cb722a27dad81e461c828 | JavaScript | petertix/inferno-examples | /source/button/button.jsx | UTF-8 | 686 | 2.546875 | 3 | [
"MIT"
] | permissive | import React from 'react';
import ReactDom from 'react-dom';
export default class Button extends React.Component {
constructor() {
super();
this.state = { active: true };
}
handleClick() {
this.setState({
active: !this.state.active
});
}
render() {
const buttonSwitch = this.state.... | true |
5469126ba1233c7fb1941b30973e05e36e329fea | JavaScript | AleksanderDobek/cb-web | /weather/assets/js/main.js | UTF-8 | 2,752 | 3.046875 | 3 | [] | no_license | let loader = document.getElementsByClassName('loader')[0];
let apiURL = 'https://api.apixu.com/v1/forecast.json?key=3983b588d2f240aea4282620191004&days=7&q=';
let cityForm = document.getElementById('get-city');
//funkcja pokzująca kręciołoek
function showLoader() {
loader.classList.add('show');
}
//ukrywająca krę... | true |
cb5809e3a7ac5afdabb639f1e85f742e02c58acc | JavaScript | nkofl/cockpit-gauges | /gauges.js | UTF-8 | 14,884 | 3.21875 | 3 | [] | no_license | /*
* Call example:
*
* var gauge = new verticalGauge({
* x: 100,
* y: 100,
* red: [[0,10], [80, 100]],
* yellow: [[40,70]],
* green: [[15,30]],
* marker: 53,
* });
* gauge.setMarker(90);
*/
function verticalGauge(p)
{
var paper = Raphael(p.x, p.y, 50, 150);
var box = paper.path('M 16 0 L 0 0 L 0 10... | true |
845daed16058cf2a95e8e7d641acdd002eaeddaa | JavaScript | Fintopia2021/jslearn | /jsmodules/string.js | UTF-8 | 577 | 3.8125 | 4 | [] | no_license | let string1 = "Come on, Welcone to Fintopia";
//content()
console.log(string1.concat(", how are you."));
console.log(string1 += ", how are you.");
console.log(string1 + ", hav a nice day");
// charAt()
console.log('The character at index 2 is ' + string1.charAt(2));
// replace('','')
console.log(string1.replace('n', ... | true |
0cd3bb8586d5505db2e219d58db9e34aa16752ef | JavaScript | youngk313/youngk313.github.io | /COMP4537/labs/6/public/js/student.js | UTF-8 | 3,123 | 2.984375 | 3 | [
"MIT"
] | permissive |
window.onload=()=>{
var qNumber = 1;
var users_answers = [];
var correct;
const quizID = "#question-list";
const rowsQ = 5;
const colsQ = 75;
const rowsA = 1;
const colsA = 40;
function loadData() {
// TO DO
const xhttp = new XMLHttpRequest();
const url = "https://young-u6.azurewebsites.net/COMP4537/la... | true |
4ba71b3dc0f85eb106f18d8d5a1d61fb43201e6d | JavaScript | Eunicegenel/Eunicegenel.github.io | /batch6-activities/pigGame/pigChange.js | UTF-8 | 3,151 | 2.734375 | 3 | [] | no_license | function changeCharX() {
if (charX === 0) {
let newChar = charList[1];
document.getElementById("playerXChar").innerHTML = newChar;
charX = 1;
console.log(vsai);
} else if (charX === 1) {
let newChar = charList[0];
document.getElementById("playerXChar").innerHTML = newChar;
charX = 0;
console.log(vsai)... | true |
d3becbb8bcf5b6bcd9c85c6bb8a7fb0bc53bf164 | JavaScript | violet-violin/community53 | /src/main/resources/static/js/discuss.js | UTF-8 | 2,127 | 2.71875 | 3 | [] | no_license | $(function(){
$("#topBtn").click(setTop);
$("#wonderfulBtn").click(setWonderful);
$("#deleteBtn").click(setDelete);
});
// 点赞
function like(btn, entityType, entityId, entityUserId,postId) {
//向服务器提交异步请求
$.post(
CONTEXT_PATH + "/like",
{"entityType":entityType,"entityId":entityId, "e... | true |
5be11703d1fc79b9ef193a0abfcbaecd3398ce86 | JavaScript | pypypraful/Full_Stack_Open | /part2/Phonebook exercise-2d/src/components/App.js | UTF-8 | 2,095 | 2.78125 | 3 | [] | no_license | import React, {useState, useEffect} from 'react'
import PersonForm from './PersonForm'
import Filter from './Filter'
import phoneService from '../services/phonebook'
const Person = (props) => {
return(
<p>{props.name} {props.number}
<button onClick={()=> props.deleteContact(props.id, props.name)}>
Dele... | true |
f4d19003c4ffdc532106d3c5d9045850a7fa7cc0 | JavaScript | OSKyriienko/JS-Intro | /EASY/task1_1.js | UTF-8 | 189 | 3.28125 | 3 | [] | no_license | function pair(arr) {
var res = [];
for (var i = 0; i<arr.length; i++) {
if (!(arr[i] % 2)) {
res.push(arr[i]);
}
}
return res;
}
console.log(pair([1,5,23,4,2,5,6])); //[4,2,6] | true |
a91c40f3c175f462135ea7e6d92711ae5da9a22e | JavaScript | dlcoffee/practice-questions | /questions/rectangular_love/love.js | UTF-8 | 1,441 | 3.625 | 4 | [] | no_license | function isEmpty(obj) {
return Object.keys(obj).length === 0;
};
function findXOverlap(r1, r2) {
let maxRHS = Math.max((r1.leftX + r1.width), (r2.leftX + r2.width));
let minLHS = Math.min(r1.leftX, r2.leftX);
if ((maxRHS - minLHS) < (r1.width + r2.width)) {
let leftX = Math.max(r1.leftX, r2.leftX);
le... | true |
772fdd74476ae584faa462737aab87364a21ad3f | JavaScript | logicaleak/cassandra-ui | /src/js/components/controller/iterationselect/index.js | UTF-8 | 1,880 | 2.53125 | 3 | [] | no_license | var ReactBootstrap = require('react-bootstrap');
var Input = ReactBootstrap.Input;
var Row = ReactBootstrap.Row;
var ButtonInput = ReactBootstrap.ButtonInput;
var Col = ReactBootstrap.Col;
var React = require('react');
var DataStore = require('../../../stores/DataStore.js');
var ReactDom = require('react-dom');
var ... | true |
9a6ce1b183e732a2c09cd46a9843c8abd5dfa09c | JavaScript | julia-marta/guess-melody | /src/store/actions.test.js | UTF-8 | 1,983 | 2.609375 | 3 | [] | no_license | import {incrementStep, incrementMistakes, resetGame, ActionType} from "./actions";
import {questions} from "../test-data";
const mockQuestionArtist = questions[1];
const mockQuestionGenre = questions[0];
const mockCorrectAnswerArtist = mockQuestionArtist.answers[2];
const mockIncorrectAnswerArtist = mockQuestionArtist... | true |
f7de86e1e92e6648c5a70fba109e5431a0a1b326 | JavaScript | sapphire-al2o3/js-demo | /canvas/円形グラデーション/index.js | UTF-8 | 919 | 3.03125 | 3 | [] | no_license | var canvas = document.getElementById('world');
var ctx = canvas.getContext('2d');
ctx.fillStyle = '#000';
ctx.fillRect(0, 0, 400, 400);
function hsva(h,s,v,a){var f=h/60,i=f^0,m=v-v*s,k=v*s*(f-i),p=v-k,q=k+m;return 'rgba('+[[v,p,m,m,q,v][i]*255^0,[q,v,v,p,m,m][i]*255^0,[m,m,q,v,v,p][i]*255^0,a].join(',')+')';}
func... | true |
64515b51500d7fcb24e7a0f2d7ac9084c19f70a1 | JavaScript | MitchRivet/pizza_restaraunt | /js/scripts.js | UTF-8 | 2,603 | 3.96875 | 4 | [] | no_license | // quantity, toppings, and size
// properties of the pizza object? or separate objects?
// I think these are properties of the order object
// have a veggies property and a meat property
// you can shove items into the array from your form, count the items in the array, and multiple by veggie/meat price
function Ord... | true |
2330bf18ab764b665695d9c1d49b981086d03ad8 | JavaScript | bgoonz/UsefulResourceRepo2.0 | /MY_REPOS/web-dev-notes-resource-site/2-content/ciriculumn/week-15/W15D2/videoCode/00-fruit-stand-redux-with-react/src/components/FruitSeller.js | UTF-8 | 1,027 | 2.6875 | 3 | [
"MIT"
] | permissive | import React from 'react';
import store from '../store';
import { sellFruit, sellOut } from '../actions/fruitActions';
class FruitSeller extends React.Component {
sellFruitClick = (event) => {
const fruit = event.target.innerText;
store.dispatch(sellFruit(fruit));
}
sellOutClick = () => {
store.disp... | true |
3dc06854662c89bf8554940a7f66686f30f6c67e | JavaScript | IBAS0742/realtime-message-signature-nodejs | /signInHTML/realtimeMessage.js | UTF-8 | 2,728 | 2.6875 | 3 | [] | no_license | /**
* Created by Administrator on 2017/7/3.
*/
/**
* 这里负责编写关于实时聊天的所有消息内容,
* 1.消息及自定义消息的定义
* 2.各种消息的处理方式
* */
/**
* AV : AV 对象
* conv : convOP 对象
* messageTip : 默认继承自 conv 对象
* */
var messageObject = (function (AV,conv,messageTip) {
var messageIterator = null;
if (!messageTip) {
messageTip = ... | true |
90d431b21ace324d040a675e77814a9a261f8f93 | JavaScript | ComfyCraft/ComfyBot | /src/Events/ready.js | UTF-8 | 482 | 2.53125 | 3 | [] | no_license | class Ready {
constructor(client) {
this.enable = true;
this.client = client;
}
run() {
const client = this.client;
let Messages = client.config.Messages;
Messages.forEach(async (message) => {
let guild = client.guilds.cache.get(message.guild);
let channel = guild.channels.cache... | true |
a4839e910d92d320b6b06a62ed165b948170280e | JavaScript | stijn-aa/performance-matters-1819 | /app.js | UTF-8 | 1,569 | 2.53125 | 3 | [] | no_license | const express = require('express')
const app = express()
const fetch = require('node-fetch')
app.set('view engine', 'ejs');
app.use(express.static('public'))
app.get('/', function (req, res) {
res.render('pages/index');
console.log("mainpage")
});
app.get('/collection', function (req, res) {
res.r... | true |
b950ece651e13219a00d2197ddec1eb683389a3e | JavaScript | beeglebug/tiny-little-worlds | /src/editor/components/ValidatedIntegerInput.js | UTF-8 | 1,052 | 2.796875 | 3 | [] | no_license | import React, { useEffect, useState, useCallback } from 'react'
import Input from './Input'
/**
* a numeric input which only allows integers between min and max values
* changes are only emitted when valid
*/
export default function ValidatedIntegerInput ({ id, min, max, value, onChange }) {
const [ localValue, ... | true |
9226266cc39dd51e460f20d9f567d89c6adc4f3f | JavaScript | nickl72/Tic-Tac-Toe-Tic-Tac-Toe-Tic | /client/src/App.js | UTF-8 | 2,980 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import { w3cwebsocket as W3CWebSocket} from 'websocket';
import './App.css';
import Header from './components/Header';
import Footer from './components/Footer';
import Players from './components/Players';
import Game from './components/Game';
import SignIn from './components/S... | true |
510958aaef12870683aac4ff0150fc610d9970c3 | JavaScript | coderofsalvation/decaffeinate | /src/stages/main/patchers/ExpOpPatcher.js | UTF-8 | 808 | 2.921875 | 3 | [
"MIT"
] | permissive | import BinaryOpPatcher from './BinaryOpPatcher.js';
/**
* Handles exponentiation, i.e. `a ** b`.
*/
export default class ExpOpPatcher extends BinaryOpPatcher {
/**
* LEFT '**' RIGHT
*/
patchAsExpression() {
// `a ** b` → `Math.pow(a ** b`
// ^^^^^^^^^
this.insert(this.contentStart, ... | true |
37e5db4e6f61a69dda9d93edd5d2ad384ab2c8f7 | JavaScript | JesusAguileraM/itsa_tec | /database/crudToken.js | UTF-8 | 7,270 | 2.625 | 3 | [] | no_license | import AsyncStorage from '@react-native-async-storage/async-storage';
export const useGuardarToken= async(Token)=>{
try {
const T_T=JSON.stringify(Token)
await AsyncStorage.setItem('UToken',T_T);
} catch (e) {
console.log(e);
console.log('Hubu un... | true |
a00f350f19b96e639e787e02f23492713eecd89f | JavaScript | ChadDunnam/unit-4-game | /assets/javascript/game.js | UTF-8 | 1,845 | 3.859375 | 4 | [] | no_license | // Variables
var targetNumber = "";
var wins = 0;
var losses = 0;
var counter = 0;
var images = ["./assets/images/crystalcarson.jpg", "./assets/images/crystalrenn.jpg", "./assets/images/crystalreed.jpg", "./assets/images/crystalcox.jpg"];
// Functions
// Target number using Math.random to select a random number up to... | true |
eac59e26ff78e2d4f902a4d3df8b52308b8bae09 | JavaScript | rajan88lal88/TEST | /Lecture-5_27-Apr_promise_await/Promise_await/single/promise_single.js | UTF-8 | 343 | 3.015625 | 3 | [] | no_license | let fs = require("fs");
console.log("Before");
// console.log("start")
let fileWillBeReadPromise = fs.promises.readFile("files//f1.txt");
console.log(fileWillBeReadPromise)
fileWillBeReadPromise.then(function(content){
console.log("content has arrived")
console.log(content+ "");
})
console.log("After");
// console.... | true |
e4b3a4218e4d79b3786c8631be0975f2405a4c80 | JavaScript | krlzubiuk/krlzubiuk.github.io | /hw/hw4/script.js | UTF-8 | 1,172 | 3.796875 | 4 | [] | no_license | let arr = [55,
9,
3,
4,
222];
function finalValue(array){
let n = array.length;
let finalValue = array[(n - 1)];
console.log(`Значение последнего числа массиа = ${finalValue}`);
... | true |
c5547702f142c62dcd78f46eda474313167e3985 | JavaScript | MushfikHasanMahim/digit-counter | /main.js | UTF-8 | 168 | 2.9375 | 3 | [] | no_license | let i = 0
let btn = document.querySelector(".btn")
w = document.querySelector('.display')
btn.addEventListener("click", ()=>{
w.innerHTML = i;
i += 1
}) | true |
3a609a0204948bb5192a0ffe0b4b7c27277f37ea | JavaScript | alemart/tcc | /vm/src/runtimeEngine.js | UTF-8 | 3,574 | 2.71875 | 3 | [] | no_license | // _ __
// ____ _____ _____ ___ ___ _ __(_)___ ____ __________/ / __________
// / __ `/ __ `/ __ `__ \/ _ \ | /| / / /_ / / __ `/ ___/ __ / / ___/ ___/
// / /_/ / /_/ / / / / / / __/ |/ |/ / / / /_/ /_/ / / / /_/ /_/ /__/ /__
// ... | true |
22aca7b33e0aad11be39f31313d6ceb842e2d363 | JavaScript | tatyana144/JavaScript-Basic | /Tenth Lecture/Sum.js | UTF-8 | 348 | 3.90625 | 4 | [] | no_license | function sum(input) {
let number = Number(input.shift());
let sum = 0;
while (number != "Stop") {
sum += number;
number = Number(input.shift())
if(number ===number){
continue;
}else{
break;
}
}
console.log(sum);
}
sum(["1", "2", "... | true |
2c3dbc64d69bcc85890f6c4bb5291c150d7e9f8f | JavaScript | danieladler/stat-tracker | /app/assets/javascripts/index.js | UTF-8 | 1,642 | 2.578125 | 3 | [] | no_license | $(document).ready(function() {
// set up page on load
$(".submit-form-container").hide();
$("#table").tablesorter( {
headers: {
1: {sorter: false},
2: {sorter: false},
3: {sorter: false},
}
});
// edit toggler & cancel -> show/hide edit form via CSS class switching
$(".edit-toggl... | true |
a9e3fbf51823bd3da6edb912f9478b40e2643e01 | JavaScript | EfrenTM/javascriptConcepts | /operadores_aritmeticos.js | UTF-8 | 242 | 3.390625 | 3 | [] | no_license |
//var operadorUno;
//var operadorDos;
//operadorUno = prompt();
var suma = 4+5;
var resta = 4-5;
var divicion = 4/5;
var multiplicacion = 4*5;
console.log (suma);
console.log (resta);
console.log (divicion);
console.log (multiplicacion); | true |
2bc770f2cca8a612b992b516313c78e755c938b5 | JavaScript | wanshot/garbled-diff-test | /example-sjis.src | SHIFT_JIS | 341 | 3.078125 | 3 | [] | no_license | class User {
constructor (login) {
this.login = login;
}
greet (){
// example-sjis.src
console.log("݂Ȃɂ́B̃nhl[ " + this.login + " łB낵肢܂B");
}
}
const me = new User("lowply");
me.greet();
// vim: syntax=JavaScript
| true |
38144117e67680a5a89324e5a0e06699f7df5fc9 | JavaScript | linjackson78/chat-room | /main.js | UTF-8 | 4,350 | 2.625 | 3 | [] | no_license | var express = require("express")
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var uuid = require('node-uuid');
app.use("/static", express.static('static'));
app.use("/vendor", express.static("node_modules"));
http.listen(3000, function() {
console.log('listenin... | true |
aa5751e7c87084fee0e0871aece1d51a4b08ea1f | JavaScript | devin87/Q.js | /lib/Q.query.js | UTF-8 | 31,104 | 2.78125 | 3 | [] | no_license | /*
* Q.query.speedTest.js Q.query独立运行支持库
* author:devin87@qq.com
* update:2015/06/11 10:30
*/
(function () {
if (!String.prototype.trim) {
String.prototype.trim = function () {
//return this.replace(/^\s+|\s+$/g, "");
var str = "" + this,
str = str.replace(/^\s\s*/... | true |
bcad7e86fe5b3be279e2bcd2fc452f8d6e55fbea | JavaScript | inanfatih/Chatbot | /script.js | UTF-8 | 2,459 | 3.796875 | 4 | [] | no_license | //object containing inputs and outputs arrays
let chatInputsOutputs = [
{
inputs: ['Hello', 'Hi', 'Greetings'],
outputs: ['Hello', 'Hey', 'Greetings'],
},
{
inputs: [
'What is your favourite colour?',
'Who is your favourite HYF instructor?',
'Who is your role model?',
],
outp... | true |
0ae7f7ca2ef8ba85596ee4da9b837624733b1c79 | JavaScript | devanshk/devanshk.github.io | /AutoLobe/javascript/scripts.js | UTF-8 | 2,779 | 2.828125 | 3 | [] | no_license | var lastScrollTop = 0;
function toggleSidebar(){
var cur_height = $("header").css('height');
if (cur_height == '75px'){
$("header").css('height','300px');
$("#sidebar").css('display','block')
}
else if (cur_height == '300px'){
$("header").css('height','75px');
setTimeout... | true |
7a8f61ce93418ceca1bb346fd7cc1aa4b6887ad9 | JavaScript | andreiGolovkin/light_simulation_p5js | /Source.js | UTF-8 | 349 | 2.9375 | 3 | [] | no_license | class Source{
constructor(x, y){
this.pos = createVector(x, y);
this.rays = [];
for(let n = 0; n < 360; n++){
this.rays.push(new Ray(this.pos));
this.rays[n].turn(2 * PI * (n / 360));
}
}
draw(walls){
for(let ray of this.rays){
ray.check(walls);
ray.draw();
}
}
moveTo(x, y){
this.pos.x... | true |
64242ef0b463b65946ad425bb10b6910a5b3f06b | JavaScript | 1seestars/users-manager-back | /server.js | UTF-8 | 2,239 | 2.546875 | 3 | [] | no_license | import express from 'express'
import cors from 'cors'
import bodyParser from 'body-parser'
import {
dbGetAllUsers,
dbAddNewUser,
dbFindUser,
dbChangeUser,
dbRemoveUser,
dbRemoveAllUsers
} from 'utils/dbUtils'
const app = express()
app.use(cors())
app.use(bodyParser.json())
app.get('/users', async (req, r... | true |
c71c91cbf027eef606cf2b43ab28cc8f102cca85 | JavaScript | emetic-labs/salesface | /public/AdDisplayer.js | UTF-8 | 1,238 | 3.03125 | 3 | [
"MIT"
] | permissive | /*
Displays ads on a canvas
parameters:
- canvas: the canvas element where the ads will be displayed
- addId: the id of the div holding the add <script> tag
*/
function AdDisplayer(canvas, addId) {
var
HIDE_THRESHOLD = 7,
CANVAS = canvas,
AD_WRAPPER = document.getElementById(addId + '_wrapper... | true |
438e7f80ba78b41b1864c4a795fbd1a60945f177 | JavaScript | alexsbygaga/advanced-zeros | /src/index.js | UTF-8 | 430 | 3.0625 | 3 | [
"MIT"
] | permissive | module.exports = function getZerosCount(number, base) {
var baseNum = 0;
var res = 0;
if(base % 2 != 0){
baseNum = base;
}else{
while(base % 2 == 0 ){
base = base/2;
baseNum = base;
}
}
if (baseNum==1){
res=Math.floor(number/5);
}else{
... | true |
70a5118f6a9d4268f215f9fb9d5dea6aa100cbef | JavaScript | bluesound3/game | /Kirby.js | UTF-8 | 5,715 | 2.796875 | 3 | [] | no_license | $(document).ready(function() {
console.log("ji");
var canvas = document.createElement("canvas");
var context = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
document.body.appendChild(canvas);
document.onkeydown = function(key) {
touch(key.keyCode);
... | true |
d4fd931c0590f513726b8a7b95a6289f8da9b2f4 | JavaScript | kozervar/exap | /exap.web/src/main/webapp/resources/js/exam/helpers.js | UTF-8 | 1,561 | 2.515625 | 3 | [] | no_license | 'use strict';
/* Filters */
var exap = angular.module('exap-exam.helpers', []);
exap.factory('ExamFormFactory', ['$http', function ($http) {
var urlBase = 'rest/exam';
var dataFactory = {};
dataFactory.storePersonalData = function (personalData, success, error) {
return $http.post(urlBase + "/per... | true |
214e11bebcf222c994c845585c5106095724ef8d | JavaScript | gleissonassis/address-to-bytes32-chainlink-wrapper | /index.js | UTF-8 | 714 | 2.703125 | 3 | [
"MIT"
] | permissive | const express = require('express');
const axios = require('axios').default;
const app = express();
const port = process.env.PORT || 3000;
const endpoint = 'https://api.etherscan.io/api?module=proxy&action=eth_getTransactionByHash&txhash=';
app.get('/', async (req, res) => {
try {
res.setHeader('Content-... | true |
dc604d052b8595585914ffa626acf5add3a5dc0f | JavaScript | phamtu24/data-structure-algorithms | /nodejs/dynamic_programing/lcs.js | UTF-8 | 696 | 3.46875 | 3 | [] | no_license | const lcs = (str1, str2) => {
let len1 = str1.length;
let len2 = str2.length;
let A = Array.from(Array(len1 + 1), () => Array(len2 + 1));
for (let i = 0; i <= len1; i++) {
for (let j = 0; j <= len2; j++) {
if (i == 0 || j == 0) {
A[i][j] = 0;
} else if (... | true |
38d5b763d452476e6392d48d66a8fa2e7b2d6288 | JavaScript | KareemH/my-website | /script.js | UTF-8 | 1,510 | 3.375 | 3 | [] | no_license | // Caching a client's theme preferences using local storage
let theme = localStorage.getItem("theme");
if (theme == null) {
setTheme("light");
} else {
setTheme(theme);
}
// Query for the elements whose class="theme-dot"
// We are selecting for the customizabe themes
let themeDots = document.getElementsByClassNam... | true |
29bc526e9ad0b0f8380a34b14914060d5c0de078 | JavaScript | Redfearn-Justin/Word-Guess-Game | /assets/javascript/game.js | UTF-8 | 3,682 | 3.5625 | 4 | [] | no_license |
$(document).ready(function() {
//array of words for the computer to choose from (object/array)
var guessWords = [ "Nintendo", "Pong", "Atari", "Xbox", "Switch", "PlayStation", "Sega", "Sonic", "Mario", "Kratos", "Asteroids", "Forza", "Yoshi", "PC", "Warcraft", "Starcraft", "Halo", "Battlefield", "Pokemon", "... | true |
9a2dcf355bff1e2d004d44e1f7125a4b16a2737e | JavaScript | The-EmptyName/Pathfinding | /PF test/pathfinder.js | UTF-8 | 7,453 | 2.953125 | 3 | [] | no_license | var PF = {
make_grid: function(width, height, obstacles_to_add) {
/*
* Main file must contain an array named 'obstacles'
* 'obstacles' must store coordinates of each obstacle
* Each coordinate must be in a '_x_y' format
*/
this.obstacles_to_add = obst... | true |
1f5b97a2679c71c9c28752d8c16efc6b468ff7dd | JavaScript | karminer60/Sprint-Challenge-Lambda-Eats-starter | /src/App.js | UTF-8 | 3,626 | 2.71875 | 3 | [] | no_license |
import Form from './Form.js'
import formSchema from './formSchema.js'
import User from './User.js'
import {
useParams,
NavLink,
Route,
Switch,
useRouteMatch,
} from 'react-router-dom';
import React, { useState, useEffect } from 'react'
import * as yup from 'yup'
import axios from 'axios';
import {Link} from... | true |
bd0e0ac7ded556f280376afc6edfcd621901a9fb | JavaScript | allielibeer/midtermLibeer | /forms/bucketList/bucketList.js | UTF-8 | 270 | 3.546875 | 4 | [] | no_license |
let goOn = true
const bucketList = []
while (goOn == true) {
let newBucket = ''
newBucket = prompt("Enter an item for the bucket list")
bucketList.push(newBucket)
goOn = confirm("Click OK to continue. Click Cancel to stop.")
}
console.log(bucketList)
| true |
1d12592732314488bc239387b317b3875079d713 | JavaScript | gregmalcolm/wacky-wandas-wicked-weapons-frontend | /src/js/models/Collection.js | UTF-8 | 736 | 2.546875 | 3 | [] | no_license | import Model from './Model.js';
export default class Collection {
constructor(view, items) {
this.view = view || {};
this.items = items || [];
this.params = {};
}
notifyView(updateType, ...args) {
if (this.view) {
this.view.modelChanged(updateType, args);
... | true |
58ca6457a68b83dbb2319e0a084c9a5cd81d726f | JavaScript | hkansal27/node-learning | /tcp-server/one-time-connection-server.js | UTF-8 | 494 | 2.578125 | 3 | [] | no_license | var server = require('net').createServer();
server.on('connection', function(socket) {
socket.on('data', function(data) {
console.log(data.toString());
socket.write('Closing connection');
socket.end();
server.close();
})
})
server.on('error', function(err) {
console.log('some error occured', err.message);
... | true |
a484d05ed65054ecaba19f89102a8a1927d3bde4 | JavaScript | SDM-TIB/iasiskgdemo | /static/js/rdfmtviz.js | UTF-8 | 7,504 | 2.546875 | 3 | [
"MIT"
] | permissive | //everything in this block will be executed on pageload
$(document).ready(function() {
{
//list of subjects and objects for the DAG
var nodes = [];
//connection link between subject and object ->predicates
var links = [];
var j=0;
$.getJSON('../iasisrdfmts.json', function(data) {
for(var i in data... | true |
c2c6cf10e5c66a53dc6d83af43001538ab0ca99a | JavaScript | VanjaRadovanovic/Netflix-clone | /client/src/Components/Row.js | UTF-8 | 968 | 2.640625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import './Row.css';
const baseUrl = 'https://image.tmdb.org/t/p/original';
function Row({ title, data, first }){
const [movies, setMovies] = useState('');
useEffect(() => {
console.log(data, title)
let img;
if(data){
le... | true |
e179e6944419aa7d7f30d53c091f622a124744ec | JavaScript | carlaisabelpena/SCL013-data-lovers | /test/data.spec.js | UTF-8 | 4,610 | 2.703125 | 3 | [] | no_license | import {stringName, stringImg, stringNum, stringType, stringHeight, stringWeight, stringCandyCount, stringWaknesses, orderData} from '../src/data.js';
describe('stringName', () => {
test("debería ser una función", () => {
expect(typeof stringName).toBe('function');
});
test('stringName con weaknesses y Fairy... | true |
eeff4ff19c73436bd468d82c42d064669940b525 | JavaScript | tim-vu/botfarm | /WebUI/ClientApp/src/components/pages/overview/goldcard/GoldCard.js | UTF-8 | 821 | 2.75 | 3 | [] | no_license | import React from 'react';
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import './GoldCard.css';
class GoldCard extends React.Component {
render() {
return <Card className="card">
<CardContent className="cardContent">
<h4>{... | true |
dadf7c98aaaa1c077e709f5f0ad21a282a96b7b5 | JavaScript | Natalia318/TallerFrontEnd | /assets/js/parafiscales.js | UTF-8 | 507 | 3.421875 | 3 | [] | no_license | function calcular() {
//Obtienes el valor
var inputnumer10 = document.getElementById("inputnumer10").value; //numeroDigitado
//le descuentas el 8% y lo agregas al HTML
var descuentoS = parseInt(inputnumer10) * 12.5 / 100;
var descuentoP = parseInt(inputnumer10) * 16 / 100;
var descuentoR = pars... | true |
c585a53546c6d89f9692026b6e1b36eb92dfdf1f | JavaScript | Tomastaro/gbc_comp-9635_03 | /week_2/hammond-ryan/src/script.js | UTF-8 | 627 | 2.578125 | 3 | [] | no_license | "use strict";
google.maps.event.addDomListener(window, 'load', function(){
var position = {lat: 43.822854, lng: -79.024934};
var mapCanvas = document.getElementById("streetView");
//create new object
var myMap = new google.maps.Map(mapCanvas);
//Street View
var streetLook = new google.maps.StreetViewPa... | true |
b7fec1a2bbaee9599e7d910ce2cdeeb9bcaeebfd | JavaScript | rahulsumanraj/counter-app | /src/components/counter.jsx | UTF-8 | 1,631 | 2.984375 | 3 | [] | no_license | import React, { Component } from 'react';
class Counter extends Component {
//add a property and set an object
state = {
//count: 0
count: this.props.value
};
heading = {
h1: 'heading is here it came after click',
h2: ''
};
// adding a method in this class th ch... | true |
7afc90a9d1bdee38fa06f5ce65833e5c6e7c0ce8 | JavaScript | ChristianSalto/webs_html_css_js | /web_elfica/js/index.js | UTF-8 | 1,670 | 2.859375 | 3 | [] | no_license | let state = false;
const sections = ["p1", "p2", "p3", "p4", "p5"];
let search;
let show;
const handleMenuShow = (value) => {
let display;
let card_menu = document.getElementById("card_menu");
display = card_menu.style.display;
!value ?
card_menu.style.display = "none"
:
card_menu.style.display... | true |
9185e04d0b862af4c60d08dc22789e4f0821dd77 | JavaScript | Dianabors27/Coin-Gecko-Client | /src/services/api.js | UTF-8 | 1,661 | 2.578125 | 3 | [] | no_license | import axios from 'axios';
const instance = axios.create({
baseURL: 'https://api.coingecko.com/api/v3',
headers: {'Accept': 'application/json'}
});
const buildParams = (params) => {
if(params === undefined)return ''
const arr = [];
Object.keys(params).forEach(k => {
if(params[k] !== undefi... | true |
e4a93c32093e33726f5223872767daefb6946f8d | JavaScript | juanPabloCesarini/app-permisos | /public/js/main.js | UTF-8 | 670 | 2.625 | 3 | [] | no_license | function confirmar (id,nombre,apellido,tabla) {
switch (tabla){
case 'post':
if (confirm('ATENCION!! Estas seguro de eliminar el post con título: ' + nombre)){
window.location.href = '../eliminar_post/' + id;
}
break;
case 'resto':
if (confirm('ATENCION!! E... | true |
a84169d2b9eff009f39a2249068cf407b9c3ba30 | JavaScript | enquirer/enquirer | /examples/quiz/enquirer.js | UTF-8 | 544 | 2.890625 | 3 | [
"MIT",
"ISC"
] | permissive | 'use strict';
const { prompt } = require('enquirer');
prompt([
{
type: 'quiz',
name: 'Total number of countries',
message: 'How many countries are there in the world?',
choices: ['165', '175', '185', '195', '205'],
correctChoice: 3
},
{
type: 'quiz',
name: 'Second largest country',
... | true |
e1a78e85f53df48465a75ba08311933eb68b3636 | JavaScript | deniseli/StrunkAndWhiteLinter | /js/CFGParser.js | UTF-8 | 5,097 | 3.3125 | 3 | [] | no_license | "use strict";
var CFGRules = require("./CFGRules.js");
/**
* @constructor
* Builds a parse tree for a CFG (context free grammar) using the CKY algorithm
* @param {Array<Object>} sentence: list of word objects
*/
var CFGParser = function(sentence) {
this.chart = new Chart(sentence.length);
this.populateLea... | true |
ef1c49b351593bbaff87312bdac7e168609e380c | JavaScript | eduardusdkmg/eduardusdkmg.github.io | /src/components/List/TextAndForm.js | UTF-8 | 2,335 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react'
import { connect } from 'react-redux'
import { editTodo, deleteTodo } from '../../store/actions/todoAction.js'
class TextAndForm extends Component {
constructor(props){
super(props)
this.state = {
viewMode : 'show',
text : props.todo... | true |
2b43a36a869d991fa13b49388570fdbba8808e0e | JavaScript | shalinikathuria1/Alphabets-Boom-Game | /alphabet.js | UTF-8 | 3,400 | 3.25 | 3 | [] | no_license |
let score = 0;
let lives = 10;
let caseSensitive = true;
const center = {
x: canvas.width / 2,
y: canvas.height / 2,
radius: 20,
color: '#FF0000'
};
const letter = {
font: '20px Arial',
color: '#0095DD',
size: 30,
highestSpeed: 1.6,
lowestSpeed: 0.6,
probability: 0.02
};
let letters = [];
docum... | true |
140a64af2ef5c8706972e39fcd077ac040e3978e | JavaScript | the-teacher/reactSortableTree | /src/example_1/app.jsx | UTF-8 | 930 | 2.640625 | 3 | [] | no_license | import React from 'react'
import ReactDOM from 'react-dom'
import { log } from '../shared/helpers'
import SortableTree from './sortableTree'
class App extends React.Component {
constructor() {
super();
this.state = {
helloText: 'Hello from sortableTree',
amount: 3
}
// Bind handlers to... | true |
04c2af9bc53edf19042193a666488724396356fc | JavaScript | GuYun-D/GuYun-D.github.io | /lamb/js/add.js | UTF-8 | 374 | 2.65625 | 3 | [] | no_license | var category = getId('category')
var categoryMenu = getId('categoryMenu')
var buttons = categoryMenu.children[0].getElementsByTagName('button')
category.addEventListener('click', function(){
categoryMenu.style.display = 'flex'
})
for(var i = 0; i < buttons.length; i++){
buttons[i].addEventListener('click', func... | true |
599fd348c583f911d67a3c29363b8ac9e047addf | JavaScript | abhieshekumar/thoughttrain | /asset/script.js | UTF-8 | 3,440 | 2.671875 | 3 | [] | no_license | const modal = document.getElementById('share-modal');
const body = document.getElementsByTagName('body')[0];
modal.style.display = 'none';
modal.onclick = function(e) {
e.preventDefault();
modal.style.display = 'none';
body.style.overflow = 'scroll';
return false;
}
function shareModal(event,link) {
... | true |
e5521baff352008a44a31678df35e12eaf26e552 | JavaScript | sneakertack/suit | /lib/index.js | UTF-8 | 3,518 | 3 | 3 | [
"MIT"
] | permissive | var _ = require('lodash');
// Constraint loader function. Either pass in the name of a set included with suit, or pass in a constraint set directly. Later constraints override earlier constraints with the same name.
module.exports.constraints = function (array) {
var constraints = {};
array = array || ['basic-type... | true |
14b6fa6788cd23d9df1e33f5b351699625793704 | JavaScript | wivwiv/markdown-image-git | /lib/index.js | UTF-8 | 3,679 | 2.53125 | 3 | [] | no_license | const fs = require('fs')
const path = require('path')
const api = require('./api')
function init(_options = {}) {
const defaultOptions = {
basePath: process.cwd(),
doc: 'README.md',
token: '',
repos: '',
branch: 'master',
dir: '_images',
message: 'form mark... | true |
09657928202e69267ce7c8cfeb1d1e96fbce67ca | JavaScript | GAMS-Organization/GAMS-Repository | /packages/website/src/services/localStorage/localStorageService.js | UTF-8 | 286 | 2.515625 | 3 | [
"MIT"
] | permissive | import localStorage from 'localStorage';
class LocalStorageService {
get(key) {
return localStorage.getItem(key);
}
set(key, data) {
localStorage.setItem(key, data);
}
remove(key) {
localStorage.removeItem(key);
}
}
export default new LocalStorageService();
| true |
e18826d3ee41e895236382a68bb2c758ced87768 | JavaScript | 99062653/Lingo | /javascript/lingo.js | UTF-8 | 2,594 | 3.625 | 4 | [] | no_license | import { words } from "../javascript/lingo-nl.js"
var container = document.getElementById("SpeelVeld");
var knop = document.getElementById("knop");
knop.onclick = function() {
checkWoord(document.getElementById("Input").value);
}
var randomwoord;
var attempts = 5;
var attempt = 0;
var lettersinput = [];
var lette... | true |
b7a702c018c66a3b0d09c90ae21a04974b06d02f | JavaScript | Cbastian-Araque/Calculadora-b-sica-con-JavaScript-CSS-Grid | /app.js | UTF-8 | 2,541 | 3.890625 | 4 | [] | no_license | //Se declaran constantes para almacenar las teclas como numeros, signos de operación etc.
const teclaNumero = document.getElementsByName('numero');
const teclaSigno = document.getElementsByName('signo');
const teclaIgual = document.getElementsByName('igual')[0];
const teclaLimpiar = document.getElementsByName('limpiar... | true |
8d3d63426bfb62fda029b5d2420ba772c09f3d13 | JavaScript | BoMeeYoon/algorithmStudy | /20200803-basic/9_최대값.js | UTF-8 | 288 | 3.546875 | 4 | [] | no_license | const input = "10 9 8 7 6 20 4 3 2 1";
function getMaxNumber(input) {
const target = input.split(" ").map((n) => parseInt(n, 10));
target.sort((a, b) => a - b);
return console.log(target[target.length - 1]);
// console.log(Math.max.apply(null, target));
}
getMaxNumber(input);
| true |
09abfe655f96dc462beaf5ec12f85ad91f778cbd | JavaScript | nku087/CareerDevs-Hotel | /src/Components/NavBar.js | UTF-8 | 1,268 | 2.609375 | 3 | [] | no_license | import React from 'react'
// components
import Text from './Text'
import Button from './Button'
// contexts
import { useActionUpdate } from '../Contexts/ActionContext'
import { useRooms } from '../Contexts/RoomContext'
import { useMoney } from '../Contexts/UserMoneyContext'
export default function NavBar() {
const... | true |
79896da9f1fd1aba8f5451ce3a828b5cdc2ac699 | JavaScript | seintelligence/Polymorph | /bower_components/expandjs/lib/caster/toRegExp.js | UTF-8 | 1,745 | 2.859375 | 3 | [
"BSD-3-Clause"
] | permissive | /*jslint browser: true, devel: true, node: true, ass: true, nomen: true, unparam: true, indent: 4 */
/**
* @license
* Copyright (c) 2015 The ExpandJS authors. All rights reserved.
* This code may only be used under the BSD style license found at https://expandjs.github.io/LICENSE.txt
* The complete set of authors ... | true |
41842b02e0587a0965e15d313e1477ed5ea27f35 | JavaScript | YunzeNiu/INST377-Group-Project | /public/script.js | UTF-8 | 1,798 | 3.078125 | 3 | [] | no_license |
getData();
function buildAxis(data) {
const newData = data.reduce((collection, item, i) => {
const findCat = collection.find((findItem) => findItem.label === item['Payee Name']);
if (!findCat) {
collection.push({
label: item['Payee Name'],
y: parseFloat(item.Amount)
});
} e... | true |
38a974ac8a22795bda7b9119b6e5d9f1261cc8e6 | JavaScript | shuai-z/LeetCode | /109-convert-sorted-list-to-binary-search-tree.js | UTF-8 | 759 | 3.703125 | 4 | [] | no_license | /**
* Definition for singly-linked list.
* function ListNode(val) {
* this.val = val;
* this.next = null;
* }
*/
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {ListNode} head
* @return {TreeNode}
... | true |
2a21a51e94522760367f62943a030cb5f1b3bfb2 | JavaScript | neophytes08/mednefits_node_mobile_api | /server/components/fee/fee.controller.js | UTF-8 | 901 | 2.71875 | 3 | [
"MIT"
] | permissive | // async await handlers is express.js
require('express-async-errors');
const Fee = require('./fee.model');
const config = require('../../../config/config');
String.prototype.equals = function(that) {
return this === that;
}
/**
* Load fee and append to req.
*/
async function load(req, res, next, id) {
req.... | true |
2765f44e55c7ea792911ddea989af83694c9e05b | JavaScript | pranay2244/Node-Express-Snippets | /Firebase/show.js | UTF-8 | 659 | 2.703125 | 3 | [] | no_license | const query = new URLSearchParams(window.location.search);
var phone = query.get('phone');
var database = firebase.database().ref('users');
database.child(phone).on('value',(snapshot) => {
obj = snapshot.val()
if(obj!=null){
document.getElementById("name").innerHTML = obj['Name'];
document.getElementBy... | true |
061e67bf1c970c4d3e24fcae63dc046633136ff7 | JavaScript | daanmeoj/JavaScript-Exercises | /56.emptyingArray/index.js | UTF-8 | 310 | 3.765625 | 4 | [] | no_license | let numbers=[1,2,3,4]
let another=numbers;
//Solution 1
// numbers=[];
// console.log(numbers);
// console.log(another);
// //Solution 2
// numbers.length=0;
//Solution3
// numbers.splice(0,numbers.length)
//solution4
while(numbers.length>0)
numbers.pop();
console.log(numbers);
console.log(another);
| true |
f2b576439899cf564826a1f359098916554f8ef8 | JavaScript | NateSkiles/Coding-Challenges | /ROUNDTABLE_CODE/firstFactorial.js | UTF-8 | 403 | 4.8125 | 5 | [] | no_license | // Take the num parameter being passed and return the factorial of it.
// For example: if num = 4, then your program should return (4 * 3 * 2 * 1) = 24.
// n! = n * (n-1)!
function firstFactorial(num) {
if (num < 0) {
return -1;
}
else if (num === 0) {
return 1;
}
else {
... | true |
84eb463beb485b9acaf0bf34b50aaa66ec549e70 | JavaScript | benoitkoenig/coding-challenge-backend-c | /src/calculateScore.js | UTF-8 | 1,871 | 3.3125 | 3 | [] | no_license | // calculateScore is a pure function. The score of a suggestion does not depend on other suggestions, which allows for simpler logic
const calculateScore = (params, suggestion) => {
if (!params.latitude || !params.longitude) {
// If no position is specified, we'll first show the cities starting with the que... | true |