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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8220e1c7d8341016a13cc50ad9fb3f67a4305566 | JavaScript | Anguyen89/AdventureSeeker_CapStone | /frontend/components/user/user_signup.jsx | UTF-8 | 1,198 | 2.515625 | 3 | [] | no_license | var React = require('react');
var ClientActions = require('../../actions/user/user_client_actions');
var UserStore = require('../../stores/user_store');
var UserSignUp = React.createClass({
getInitialState: function(){
return({ username: "", password: ""});
},
handleSubmit: function(event){
event.preven... | true |
b6303c1c6caa81c53b52b6ea44ec64429f61a9fd | JavaScript | tatamartinsg/CURSO-HTML-CSS-e-JAVASCRIPT | /197-AreaRetângulo/197.js | UTF-8 | 216 | 3.125 | 3 | [] | no_license | function pedirnumero(){
var num1 = Number(window.prompt("Digite a largura"))
var num2 = Number(window.prompt("Digite a altura"))
}
function calcular_area(num1,num2){
alert(`A área é = ${num1*num2}`)
} | true |
6dbb5bbf91c03017f0a5eab6f294f87a7185c2f4 | JavaScript | boyur/Expressive-JavaScript | /task7.js | UTF-8 | 2,036 | 4.65625 | 5 | [] | no_license | /*
Сумма диапазона
Во введении был упомянут удобный способ подсчёта сумм диапазонов чисел:
console.log(sum(range(1, 10)));
Напишите функцию range, принимающую два аргумента – начало и конец диапазона – и возвращающую массив, который содержит
все числа из него, включая начальное и конечное.
Затем напишите функцию... | true |
502a47d1e7e6adbb74ac03bcd6e40a93e2ff6c8c | JavaScript | spencerv86/dynamic-day-planner | /script.js | UTF-8 | 1,704 | 3 | 3 | [
"MIT"
] | permissive | var thisDate = $("#current-date");
var plannerBox = document.getElementById("planner-box")
thisDate.text(moment().format("dddd, MMMM, Do YYYY"));
var currentHour = moment().format('H');
console.log(currentHour);
var timeOfDay = ["9", "10", "11", "12", "13", "14", "15", "16", "17"];
for (var i = 0; i < timeOfDay.... | true |
d74a40372528d2502583f5812d3582f20391c66d | JavaScript | nickbalestra/palette.js | /src/formatBase.js | UTF-8 | 875 | 3.234375 | 3 | [] | no_license | 'use strict';
/**
* Decorate the base color by adding all RGB, HSV, and HSL formats
* to the initial Hexadecimila color
* adapted from http://en.wikipedia.org/wiki/HSV_color_space.
* Assumes R, G, and B are contained in the set [0, 255] and
* returns H, S, and V in the set [0, 1].
*
* @param Number R T... | true |
230d4416aee47b7d02b6a12bad02bd350e083314 | JavaScript | Simpts/react-example | /server/routes/api.js | UTF-8 | 1,594 | 2.71875 | 3 | [
"MIT"
] | permissive | import { Router } from "express";
import { getExpenses, addExpense } from "../services/expenseTracker";
const CODES = {
SERVER_ERROR: 500,
BAD_REQUEST: 400,
};
export default app => {
const route = Router();
route.get("/expenses", async (_, res) => {
const [error, rows] = await to(getExpenses());
if... | true |
0ce00c8e6ce89d1c404a5653d65e3bc907b0e9df | JavaScript | xuxiaowei007/xdk | /xdk.widget.riapanel/static/js/ui/widget/jquery.checkboxselector.js | UTF-8 | 1,109 | 2.84375 | 3 | [] | no_license | /**
* $.checkboxSelector - checkbox选择操作,包括全选,反选,取消选择,以及获取选中值等接口
* By Jacky.Wei
*/
;(function($){
var checkboxSelector = function(boxWraperSelector){
this.jq_boxWraper = $(boxWraperSelector);
};
checkboxSelector.prototype = {
getBox : function(){
return this.jq_boxWraper.find("input[type=c... | true |
8ca8751f43e44a99bad5f7b0694dc4138d58efea | JavaScript | rbgx/GerMedUSA | /RadControls/Editor/xOriginalScripts/radEditor_CommandsManager.js | UTF-8 | 3,888 | 2.84375 | 3 | [] | no_license | /************************************************
*
* RadCommandsManager class
*
************************************************/
RadEditorNamespace.RadCommandsManager =
{
New: function (eventDispatcher/*, bUndoEnabled*/)
{
var obj = {};
RadEditorNamespace.Utils.ExtendObject(obj, this);//Assign pr... | true |
33c16fd949299b43d375f430af76f4bef90745d0 | JavaScript | nyvasilev11/hacker-rank | /Apple-and-Orange.js | UTF-8 | 1,418 | 4.0625 | 4 | [
"MIT"
] | permissive | // Sam's house has an apple tree and an orange tree that yield an abundance of fruit. In the diagram below, the red region denotes his house, where is the start point, and is the endpoint. The apple tree is to the left of his house, and the orange tree is to its right. You can assume the trees are located on a single... | true |
008464c9337cbb2863db1995a2f95cbef7c71da4 | JavaScript | ArudoPE/curso_fundamentos_javascript | /lessons/6DoWhile.js | UTF-8 | 502 | 4.0625 | 4 | [] | no_license | var contador = 0;
const llueve = () => Math.random() < 0.25;
do {
contador++;
} while(!llueve())
if(contador===1) {
console.log(`Fui a ver si llovía ${contador} vez.`)
} else {
console.log(`Fui a ver si llovía ${contador} veces.`)
}
//var verdad = 0;
//var falso = 0;
// for (let i=0; i<100; i++) {
// ... | true |
a93c8e4d46799f0fa0b65b849bdd5e74298873f3 | JavaScript | nextup/nextup | /cronBatchInsert.js | UTF-8 | 11,641 | 2.640625 | 3 | [] | no_license | /*
// **
// * _____ _
// * | __ \| |
// * | |__) | | __ _ _ __
// * | ___/| |/ _` | '_ \
// * | | | | (_| | | | |
// * |_| |_|\__,_|_| |_|
// *
// *
TL;DR
-----------------------
0. ALL functions to be executed (except global/dependencies) or exported are at the bottom of th... | true |
49f14f66426e80e4230319da77381072e0dc3b64 | JavaScript | maxbildner/dupont-visualization | /src/api.js | UTF-8 | 1,970 | 2.734375 | 3 | [] | no_license | // import axios from 'axios';
// import "babel-polyfill";
// require("babel-core/register");
// require("babel-polyfill");
// import "@babel/polyfill";
// query example == https://www.quandl.com/api/v3/datatables/SHARADAR/SF1.json?ticker=AAPL&api_key=-JuketAYn-cNXiDioYKb
// query syntax == https://www.quandl.com/api/... | true |
068183b00bafa8fc6f190ec8f491ac91929693be | JavaScript | justinwu1/Assignment-0 | /04-countOfAllBooleans/countOfAllBooleans.js | UTF-8 | 244 | 3.4375 | 3 | [] | no_license | function countOfAllBooleans(arr) {
let counter = 0;
for(let i = 0; i < arr.length; i++){
if(typeof arr[i] === "boolean"){
counter +=1
}
}
return counter;
}
// Do not edit this line;
module.exports = countOfAllBooleans; | true |
6ea2573303e5465fc9a5958c7f985f0a7faf008e | JavaScript | weixiaofei123/jianshu | /src/container/login/store/reducer.js | UTF-8 | 922 | 2.828125 | 3 | [] | no_license | const stateDefault={
loginData:{},
loginState:false,
userName:"",
password:""
}
export default (state=stateDefault,action)=>{
if (action.type=="loginData") {
const newState=JSON.parse(JSON.stringify(state));
newState.loginData=action.loginData;
return newState;
}
if (action.type=="loginState") {
cons... | true |
8223cb281cff674d8ecd4867b88f743192756320 | JavaScript | joemccourt/project-euler | /prob286.js | UTF-8 | 1,738 | 3.703125 | 4 | [] | no_license | // Joe McCourt
// 3/17/2014
// Project Euler problem 286
// Scoring probabilities
// Barbara is a mathematician and a basketball player.
// She has found that the probability of scoring a point
// when shooting from a distance x is exactly (1 - x/q),
// where q is a real constant greater than 50.
// During each pract... | true |
118f6f2ad269ca8fdab4bb9f03ada516097f6cb3 | JavaScript | TiagoPaz2000/pokedex | /src/reducers/pokemons.js | UTF-8 | 327 | 2.546875 | 3 | [] | no_license | import { SET_POKEMONS } from '../action';
const INITIAL_STATE = {
pokemons: [],
}
const pokemons = (state = INITIAL_STATE, action) => {
switch(action.type) {
case SET_POKEMONS:
return {
...state,
pokemons: action.pokemons,
}
default:
return state;
}
}
export default po... | true |
7b9b8438c2686f5639f741d5312ec1f75e56420f | JavaScript | 012345789/Stand-Alone-Programs | /factors.js | UTF-8 | 1,230 | 4.15625 | 4 | [] | no_license | function breakIntoFactors(n) {
var returnObj = {};
var counter = 1;
while (counter <= Math.sqrt(n)) {
if (n%counter === 0) {
var divisor = n / counter;
if (returnObj[counter] == null) {
returnObj[counter] = 1;
} else {
... | true |
5a38b1a7af21d11372d90ac62548570abbd69fd9 | JavaScript | manhmayman/JS_CodersX | /Bài 36.js | UTF-8 | 445 | 3.3125 | 3 | [] | no_license | /**
* Sử dụng switch case và map để chuyển đổi array các chữ thành các số tương ứng theo quy tắc:
* 'A' hoặc 'a' -> 1
* 'B' hoặc 'b' -> 2
* còn lại -> 0
*/
function transform(arr) {
// your code here
return arr.map(function(x){
switch(x){
case 'A':
return 1;
break;
case 'a':
return 1;
break;
case 'B':
... | true |
9188ea5dd1eb3096e6c18918ca0f3f9d61b249c2 | JavaScript | xLeDocteurx/REACT---Black-Beat | /front/src/redux/reducers/currentUser.js | UTF-8 | 425 | 2.65625 | 3 | [] | no_license | import axios from 'axios'
let initialState = {
username: 'empty',
email: 'empty',
avatar: 'empty'
}
export default function currentUser(state = initialState, action) {
switch(action.type) {
case 'SET_CURRENT_USER': {
const user = action.user
state.username = user.username
state.email = u... | true |
c10aadfc7fa4380bbbb4006df2a1b5df149d1eab | JavaScript | vanecpz/playing_around | /src/components/item/item.js | UTF-8 | 2,242 | 2.90625 | 3 | [] | no_license | import React from 'react';
export class Item extends React.Component {
constructor (props) {
super(props);
this.inputRef = React.createRef();
this.state = {
product: props.product
}
}
setQty = (value) => {
if ( value < 0) return
const updatedPr... | true |
2d5d8eeed9b2452ca4b0c67514cc7aea64032c58 | JavaScript | dalalalalala/jsonTool | /esjson/js/json/jsontool.js | UTF-8 | 24,664 | 2.515625 | 3 | [] | no_license | var jsonTool = {
/**
* 设置文本框的值
* @param idSelector id选择器
* @param value 值
*/
resetTextAreaValue: function (objId, value) {
$('#'+objId).val(value);
$('#'+objId).trigger("focus");
},
jsonFormat: function(){
var text = document.getElementById("sourceText").valu... | true |
6d683056bb15a4ae91995ca4ebc5e2994b9fe086 | JavaScript | nachoweb/mbf-dev | /js/app/ui/popup.js | UTF-8 | 10,270 | 2.546875 | 3 | [] | no_license | /* PopUp */
$(document).ready(function(){
var current_item;
$('.container-item-img').live('click', function(){
current_item = $(this).parent('.item');
innerContent(current_item);
loadPopup();
});
$('#shadow').click(function(){
closePopup();
});
... | true |
2bc5bc6993243cdedf822195cd5f67c41a2e307a | JavaScript | momentum-team-4/react-trivia-game-harrisonballard | /trivia-game/src/App.js | UTF-8 | 1,035 | 2.875 | 3 | [] | no_license | import React, { useState } from 'react'
import './App.css'
import axios from 'axios'
function App () {
const [triviaCategories, setTriviaCategories] = useState([])
const fetchData = async () => {
const response = await axios.get('https://opentdb.com/api_category.php')
setTriviaCategories(response.data.triv... | true |
6263d831bea8b7c5f109922a64d4943cbd27ed8f | JavaScript | castaneai/base-converter.js | /src/BaseConverter.js | UTF-8 | 1,895 | 2.8125 | 3 | [] | no_license | // Generated by CoffeeScript 1.3.1
var BaseConverter;
BaseConverter = (function() {
BaseConverter.name = 'BaseConverter';
function BaseConverter() {}
BaseConverter.getRangedChars = function(beginChar, endChar) {
var asc;
return (function() {
var _i, _ref, _ref1, _results;
_results = [];
... | true |
ee2cae38efd3f3eb0f4676b3ccb826d086961ea6 | JavaScript | phanductrong34/C4E-JS-Class-1--Trong.pd | /Session2/bai9.js | UTF-8 | 683 | 3.0625 | 3 | [] | no_license | while (true){
alert('Hello, this is BMI caculator');
let userMass = Number(prompt('Your weight in kg ?'));
let userHeightCm = Number(prompt('Your height in cm ?'));
let userHeightM = userHeightCm / 100;
let OutPut = userMass / (Math.pow(userHeightM,2)) ;
let OutputRound = OutPut.toFixed();
... | true |
1fe39c8efe2801cecc47c49a5496a7df586ed3ef | JavaScript | tombb/chrome-notifier-extension-starter | /app-notifier.js | UTF-8 | 1,251 | 2.515625 | 3 | [] | no_license | //
// Export
//
var AppNotifier;
YUI().use('base-notifier', function (Y) {
/**
* @constructor
*/
AppNotifier = function () {
arguments.callee.superclass.constructor.apply(this, arguments);
};
AppNotifier.NAME = "AppNotifier";
//
// Attributes
//
AppNotifier.ATTRS = {
/**
* Title of the extensio... | true |
0c207b737e600738fdd668b553d984d256a70ed8 | JavaScript | iClusterDev/JS-Buffer | /client/src/scripts/components/library/Actor.js | UTF-8 | 2,168 | 3.015625 | 3 | [
"MIT"
] | permissive | import Buffer from './Buffer';
class Actor {
constructor(config = {}) {
const {
positionX = 0,
positionY = 0,
velocityX = 0,
velocityY = 0,
friction = 0,
weight = 0,
solid = false,
image = null,
name = 'actor',
update = null,
background = 'transpa... | true |
498f6d7787d369cbffbd5c0783cff0738f227229 | JavaScript | ZeusWPI/zeus.ugent.be | /content/assets/scripts/datavis/blog.js | UTF-8 | 6,410 | 2.734375 | 3 | [
"MIT"
] | permissive | // BUBBLEMAP
(function () {
let dayFilter = new Set();
function applyFilter(data) {
if (dayFilter.size > 0) {
return _.filter(data, e => dayFilter.has(moment(e.starttime).day()))
}
return data;
}
function filterData(data, beginTime, endTime) {
data = applyFilter(data);
return _(data... | true |
51a1954ac362c462d4e8e86cad53c303ce76af9c | JavaScript | Freddiiy/BTSChatServer | /frontend/javascript/main.js | UTF-8 | 833 | 3.140625 | 3 | [] | no_license | const socket = new WebSocket("ws://localhost:8285");
//const socket = new WebSocket('ws://83.94.37.212:6969');
console.log("started");
socket.onopen = () => {
console.log("connection estaplished")
}
socket.onclose = () => {
console.log("connection lost")
}
// Connection opened
socket.addEventListener('open', ... | true |
0bb70d9abd37553a3f2a4e44f2e97abfdcc6b483 | JavaScript | Iltwats/Competitive-Programming-SolvedProblems | /HackerRank/Problem Solving/Birthday_Cake_Candles.js | UTF-8 | 882 | 4.0625 | 4 | [
"MIT"
] | permissive | //You are in charge of the cake for your niece's birthday and have decided the cake will have one candle for each year of her total age.
//When she blows out the candles, she’ll only be able to blow out the tallest ones.
//Your task is to find out how many candles she can successfully blow out.
/*For example, if your... | true |
2c640503ec0c4d7c4947c64e316f1d721368a766 | JavaScript | gamkedo-la/flipperball | /js/GameObjects/BananaObject.js | UTF-8 | 575 | 2.71875 | 3 | [] | no_license | class BananaObject extends GameObject {
constructor(...props) {
super(...props);
this.currFrame = 0;
this.isInReverse = false;
this.isAnimating = true;
this.timeAlive = 10000;
this.timeCounter = 0;
}
update (deltaTime) {
super.update(deltaTime);
... | true |
18352fcddcd531c0f3e8681c981f3a3cdf7db432 | JavaScript | st3207/marketplace-entegrationRESTApi | /ecommerce/n11/Example/get-decision-order-item.js | UTF-8 | 3,131 | 2.53125 | 3 | [] | no_license | const axios = require("axios");
const xml2js = require("xml2js");
const parser = xml2js.Parser({ explicitArray: false });
module.exports = async function (payload) {
const { decision } = payload;
console.log(payload);
console.log(decision);
if (decision == "accept") {
const acceptedOrderItems =... | true |
234fac78430e6cabac8c9e86442af17db16a5c74 | JavaScript | HalilFocic/Blog-MERN | /frontend/src/Post.js | UTF-8 | 3,392 | 2.546875 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import axios from "axios";
const Post = () => {
const { id } = useParams();
const [loading, setLoading] = useState(true);
const [post, setPost] = useState({});
const [commentText, setCommentText] = useState("");
... | true |
6cf110827ef1dba1e0e2f625526d54d470c511bb | JavaScript | yanjai/cd102g1 | /js/cuDrag.js | UTF-8 | 2,516 | 2.734375 | 3 | [
"MIT"
] | permissive | var degree = 0;
var size = 1;
function doFirst(){
//先跟HTML畫面產生關聯
largeButton = document.getElementById('culargeButton');
smallButton = document.getElementById('cusmallButton');
turnrightButton = document.getElementById('cuturnrightButton');
turnleftButton = document.getElementById('cuturnleftButton');
deleteBu... | true |
506b9356776699bacf416b52851c11710810d1c0 | JavaScript | ashwani-luhaniwal/javascript-problems | /JavaScript Advanced Concepts/how-to-communicate-between-components.js | UTF-8 | 27,308 | 3.875 | 4 | [] | no_license | /**
* ---------------------------------------
* How to communicate between Components
* ---------------------------------------
*
* Components are a tool for splitting the page in smaller pieces that are easier to manage and
* reuse. By breaking the page into smaller parts, we make their implementation simpler.... | true |
90b407d25daf0983924da022bc72d7c6ebf85b6e | JavaScript | oukirche/react-class-demo | /src/components/Form.js | UTF-8 | 1,817 | 2.84375 | 3 | [] | no_license | import React, {Component} from 'react';
class Form extends Component {
constructor(props) {
super(props);
this.state={
username:"",
comment:"",
skills:""
}
}
handleUsernameChange = (event)=>{
this.setState({
username:event.targ... | true |
9925c66a4453abc41dc6c430be62856300673950 | JavaScript | akshit8282/CourseShopp-Complete | /client/src/pages/Register/Register.js | UTF-8 | 1,993 | 2.546875 | 3 | [] | no_license | import React from 'react'
import './register.css';
import {useState} from 'react'
import axios from 'axios';
export default function Register() {
const [username,setusername]=useState("");
const [email,setemail]=useState("");
const [password,setpassword]=useState("");
const [error,seterror]=useState("");
const handles... | true |
b47200a9e9611df3985f75f1e22e62ce44122f2d | JavaScript | achuthrajula/react-native-mlkit | /components/MeanPlanner/1.js | UTF-8 | 5,717 | 2.5625 | 3 | [] | no_license | import React, { useState } from 'react';
import {
SafeAreaView,
Text,
View,
Image,
TouchableOpacity,
StyleSheet,
} from 'react-native';
import { Button } from 'react-native-material-ui';
import Tooltip from 'react-native-walkthrough-tooltip';
import AsyncStorage from '@react-native-community/async-storage';... | true |
cefd6a4aa670c5a9e874883880e9cc03bf0b1d2b | JavaScript | lasernite/6fop | /lab_9/ui/ui.js | UTF-8 | 2,756 | 2.84375 | 3 | [] | no_license | "use strict";
// RPC wrapper
function invoke_rpc(method, args, timeout, on_done){
$("#crash").hide();
$("#timeout").hide();
$("#rpc_spinner").show();
//send RPC with whatever data is appropriate. Display an error message on crash or timeout
var xhr = new XMLHttpRequest();
xhr.open("POST", method, true);
... | true |
0c5d1287eb77b24c3dc037a879283566885a7870 | JavaScript | packersblogger/packersblogger.github.io | /assets/js/difference.js | UTF-8 | 369 | 3.53125 | 4 | [] | no_license |
$('h2').each(function(){
const scores = $(this).text()
var strArray = scores.match(/(\d+)/g);
const difference = parseInt(strArray[0])-parseInt(strArray[1]);
if (typeof(difference) ==="number"){
console.log(difference);
$(this).after($('<h4></h4>').text(`Actual Differ... | true |
b4e3d83e20bfbb16c9094d36684a63de712f7c8f | JavaScript | Juliafin/random_projects | /full_stack_react/frontend/full_stack/src/App.js | UTF-8 | 1,660 | 2.78125 | 3 | [] | no_license | import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import NoteInput from './components/NoteInput';
import Notes from './components/Notes';
class App extends Component {
constructor(props) {
super(props);
this.state = {
input: '',
notes: []
}
thi... | true |
c983ce028183117aeea71e9151c967fc9014aeb1 | JavaScript | rob-tech/form-fe | /src/reducers/experiences.js | UTF-8 | 427 | 2.609375 | 3 | [] | no_license | export default function (state = {}, action) {
switch (action.type) {
case "EXPERIENCES":
return {
...state,
allExperiences: state.allExperiences.concat(action.payload)
};
case "ADD_EXPERIENCE":
return {
...state,
... | true |
3a4a3897f950b5e2e7b307b87e043627e5d4595d | JavaScript | iTrinitron/LoT | /js/form.js | UTF-8 | 12,242 | 2.734375 | 3 | [] | no_license | //Documentation: http://malsup.com/jquery/form/
// Prepare everything here after the DOM loads
$(document).ready(function() {
//Validate the form: check if all of the fields are
//$('#register_form').ajaxForm( { beforeSubmit: validate } );
var type = "post";
var options = {
//targe... | true |
32187b7a631397b623c0c8306a1c8c0ca185d2ca | JavaScript | moonandsix/traverse-nodes | /task24.js | UTF-8 | 3,882 | 2.921875 | 3 | [] | no_license | var btns=document.getElementsByTagName("button"),
depthTr=btns[0],spanTr=btns[1],depthSea=btns[2],spanSea=btns[3];
var input=document.getElementsByTagName("input")[0];
var c1=document.getElementsByClassName("c1")[0];
var c2=document.getElementsByClassName("c2")[1];
var c3=document.getElementsByClassName("c3")[1];
var s... | true |
3fbd418ba0bbbd0960436d44528a05993c2138ad | JavaScript | dineshkummarc/webkit-speechbot | /js/mylibs/speechBrowser.js | UTF-8 | 7,076 | 2.71875 | 3 | [] | no_license | var speechBrowser = function(){
var speech, submitBtn, supported;
return{
init: function(){
speech = $('#speechQuery'),
submitBtn = $('#speechSubmit');
supported = this.speechTest();
if(!supported){
alert('Unfortunately your browser does not support the Speech API as yet');
}
this.attach... | true |
7ba33b4fb92196a82a0e15b9ecc905403a86f3bd | JavaScript | ucshadow/FCC-single-page-WebApps | /Image Search/main.js | UTF-8 | 1,394 | 2.578125 | 3 | [] | no_license | const express = require('express');
const app = express();
const mongoose = require('mongoose');
const db = mongoose.connection;
const urlSchema = new mongoose.Schema({term: String, date: String});
const URL = mongoose.model('URL', urlSchema);
const Crawler = require('./scripts/crawler');
mongoose.connect('mongodb://h... | true |
b6f4aaeef2e035f2c9f9481a8000b7542029a0ee | JavaScript | VladislavBrykov/-NodeJS-Curs_Udemy | /nodemon/index.js | UTF-8 | 415 | 2.703125 | 3 | [] | no_license | const http = require('http')
const server = http.createServer((req, res) => {
console.log(req.url)
res.write('<h1>Hello from NodeJS</h1>')
res.write('<h2>Hello from NodeJS</h2>')
res.write('<h3>Hello from NodeJS</h3>')
res.end(`
<div style="background: red; width: 200px; height: 200px;">
<h1>Test ... | true |
430fcf1dcc4bca8935874c673b1eff2f12ac835b | JavaScript | mhubenthal/HTML5_Practice | /HTML5_News_Site/js/views/SectionView.js | UTF-8 | 996 | 2.5625 | 3 | [] | no_license | define([
'jquery',
'underscore',
'backbone',
'collections/SectionArticleCollection',
'text!templates/sectionTemplate.html'
], function($, _, Backbone, SectionArticleCollection, sectionTemplate){
var SectionView = Backbone.View.extend({
el: 'section',
class: 'main-section',
initialize: fun... | true |
9f553794ece15a36e0ada5928eaf7126a5076d59 | JavaScript | Dubiy/todo-node-mongo-example | /tasks/task.js | UTF-8 | 3,392 | 2.59375 | 3 | [] | no_license | 'use strict';
const express = require('express'),
Task = require('./model'),
router = express.Router();
router.get('/tasks', (req, res, next) => {
// Task.find({name: 'Coffee'})
Task.find({})
.sort({position: 1})
.then(tasks => {
res.json({tasks});
})
.ca... | true |
ab24bb303ee566674472156f0770d18333010224 | JavaScript | YoHoHo-Project-3/yohoho | /frontend/src/pages/Dashboard.jsx | UTF-8 | 2,708 | 2.59375 | 3 | [] | no_license | import React, { Component } from "react";
import './Dashborad.css';
import TripCard from '../components/TripCard'
import DashboardMenu from "../components/DashboardMenu";
import axios from "axios";
import Profile from '../components/Profile'
export default class Dashboard extends Component {
constructor(props) {
... | true |
3d2e3a166f3b64acbf034bbe90c25af1fa5ec0ec | JavaScript | PSIXs/InfoVIS | /src/utils/DataAnalyzer/index.js | UTF-8 | 3,689 | 2.953125 | 3 | [] | no_license | const generalMC2 = require("../../data/mc2/general-MC2.json");
const moment = require("moment");
for (let i = 0; i < generalMC2.length; i += 1) {
generalMC2[i] = generalMC2[i].message;
delete generalMC2[i].type;
}
const countByMonthMC2 = sensor => {
const countMap = new Map();
const stats = [];
for (let i =... | true |
410efe29887d0189d2f623e6ebfb1310792c8280 | JavaScript | camillarussell/pi-grupo5 | /js/form.js | UTF-8 | 2,732 | 3.078125 | 3 | [] | no_license | /* ---Campo nome--- */
let formNome = document.getElementById("inputNome");
formNome.addEventListener("focus", myFocusNome, true);
formNome.addEventListener("blur", myBlurNome, true);
function myFocusNome() {
document.getElementById("inputNome").style.backgroundColor = "rgba(255, 255, 255, 0.2)";
}
function myBlur... | true |
994237da5de77c90f75ea049f256bfb34c4c2874 | JavaScript | starkhxk/QinLis_assess | /gaoyucheng/考核/register.js | UTF-8 | 2,347 | 3.15625 | 3 | [] | no_license | // JavaScript Document
var students = [{"studentid":"1903030301","idcard":"210111111111111111","name":"小一"},{"studentid":"1903030302","idcard":"210122222222222222","name":"小二"},{"studentid":"1903030303","idcard":"210133333333333333","name":"小二plus"}];
var error = document.getElementsByClassName("error");
function Confi... | true |
67b1ebdd8c621ea7eddbb9ca7747bf5a644a8c28 | JavaScript | jaroqui17/code-collab | /server/index.js | UTF-8 | 543 | 2.546875 | 3 | [] | no_license | const app = require("./app");
const { sequelize } = require("../db/models");
const { PORT } = process.env;
async function verifiedConnection() {
try {
await sequelize.authenticate();
console.log("Conntected succesfully");
} catch (err) {
console.log("Can't connect");
console.log(err.message);
... | true |
6534ab75a1a6def49a2608056100a31988ce7ab1 | JavaScript | EduPras/LifePath | /backend/src/services/hash.js | UTF-8 | 427 | 2.71875 | 3 | [] | no_license | const bcrypt = require('bcrypt');
module.exports= {
async hashed(password){
const salt = await bcrypt.genSalt();
const hashedPassword = await bcrypt.hash(password, salt);
return hashedPassword;
},
async compare_passwords(password, true_password){
if (await bcrypt.compare(p... | true |
0b133fff276f889fff865aa0384ef23ebfce7f03 | JavaScript | supertask/supertask.github.io | /edu/project/nakazieee/data/test_data180_files/new_beauty.js | UTF-8 | 753 | 2.875 | 3 | [] | no_license | // passage time
var pass = 168;
// display content
var content = '<img src="/img/beauty/top/icon_new.gif" class="new" alt="new" />';
var currentDate = new Date();
var spans = document.getElementsByTagName('span');
for (i = 0; i < spans.length; i++) {
if(spans[i].getAttribute('class') == 'new' ||
spans[i... | true |
693d03c2ff26079f2d4d9ded5f1f43f770045956 | JavaScript | xrybecky/RESTApi | /api/controllers/throwComputingController.js | UTF-8 | 1,656 | 2.796875 | 3 | [] | no_license | /**
* Created by rybec on 05.11.2017.
*/
'use strict';
exports.compute = function (req, res){
var response = {};
// handle errors
if(req.params == null){
response.error = 'Params error';
return;
}
if(req.params.angle == null){
response.error = "Param <<angle>> error";... | true |
3e26224b63b8ce480b9800e2062409f7c890e730 | JavaScript | Sashreekkumar/Paper-ball-2 | /Bin1.js | UTF-8 | 548 | 2.65625 | 3 | [] | no_license | class Bin1{
constructor(x,y,width, height){
var options= {
isStatic:true,
'density': 0
}
this.body= Bodies.rectangle(x,y,width, height, options);
this.width= width;
this.height= height;
this.image= loadImage("dustbingreen.png");
... | true |
1a9e3216495a59c206c0dc008c8b4a3d99a24229 | JavaScript | Hwije-Jung/misemungi | /server/routes/yellow.js | UTF-8 | 1,577 | 2.53125 | 3 | [] | no_license | const request = require('request')
const serviceKey = '7rloXxdcpjuUszWhliD8Ge20nEcInTTYOCCzOxtETM3H44poN7Sw7w1%2FS7ncIWuDUpdt6fM9zcumEz5auRIu8Q%3D%3D'
//공공데이터 포털에서 받은 내 서비스키
var parse = require('json-parse')
const yellow = (year, callback) => { // 연도 데이터를 여기서 받음.
console.log("황사데이타!!!!!!"); //진입... | true |
06bdb653da00f04eaf651c063e2de70ed847ba56 | JavaScript | ilichh1/iChat | /web/js/mensaje.js | UTF-8 | 1,547 | 3.0625 | 3 | [
"MIT"
] | permissive | // Destinatario de pruebas al que le vamos a enviar un mensaje
document.destinatarioActual = 7;
//Los elementos con los que nos interesa que interactue nuestro usuario
var textAreaMensaje = document.getElementById("message");
var botonEnviar = document.getElementById("send-button");
var funcionEnviarMensaje = functio... | true |
a22e0e642c5af307f606b08bfddc87146d7cb1c8 | JavaScript | mckenjus/module-2 | /passwordValidator.js | UTF-8 | 425 | 2.875 | 3 | [] | no_license | const readline = require(`readline`)
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
console.log(`Welcome to the Password Validator Tool!`)
rl.question(`Please Enter Your Password: `, (answer) => {
if(answer.length >= 10){
console.log(`that password will su... | true |
d0e388802ef43d0f2b159f0f798d9d9e3ffa2116 | JavaScript | quaywin/traning-2016 | /group2/DangNhatHuy/LeXuanQuynh_Javascript/javascript_ex_DangNhatHuy/array_ex_DangNhatHuy/array_ex_10.js | UTF-8 | 177 | 2.859375 | 3 | [] | no_license | function rand(items) {
return items[Math.floor(Math.random() * items.length)];
}
var items = [12, 332, 46, 27273, 209, 799, 012, 34, 74];
console.log(rand(items)); | true |
c45c9bc8891bf5aba5d5e3745e9473a71daff0b3 | JavaScript | matt2mi/papay | /server/models/card.js | UTF-8 | 249 | 2.84375 | 3 | [] | no_license | class Card {
family;
number;
newOne = false;
constructor(family, number, newOne) {
this.family = family ? family : null;
this.number = number ? number : null;
this.newOne = newOne ? newOne : false;
}
}
module.exports = Card;
| true |
a46b410291a23806dae5285a34e012657797e0fb | JavaScript | CodeAcademyP110/p110-11-04-2019-KamranSo | /js/js/main.js | UTF-8 | 6,260 | 2.71875 | 3 | [] | no_license |
// Ex1
// const barmenu = document.querySelector(".barmenu");
// const barcolor = document.querySelector(".barcolor");
// const btnMenu =document.querySelector(".btn");
// btnMenu.onclick=function(){
// barmenu.innerText = "";
// barcolor.classList.remove("opacity");
// barmenu.appe... | true |
5fdcbffc3b034111f52dea39f4921b91e63814c2 | JavaScript | nbutmickey/fpms | /app/tests/exception.server.routes.test.js | UTF-8 | 6,915 | 2.515625 | 3 | [
"MIT"
] | permissive | 'use strict';
var should = require('should'),
request = require('supertest'),
app = require('../../server'),
mongoose = require('mongoose'),
User = mongoose.model('User'),
Exception = mongoose.model('Exception'),
agent = request.agent(app);
/**
* Globals
*/
var credentials, user, exception;
/**
* Exception ... | true |
6dbb3b7233d1f5e9057158ca7cafd2aa9d71ec4f | JavaScript | iremol/smbis | /sms/js/main_.js | UTF-8 | 2,865 | 2.578125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
var $ = function (id) {
return document.getElementById(id);
};
var byclass = function (classname) {
return document.getElemen... | true |
02dd91443b53615e2ec267241ca3ec77ad2d0cbf | JavaScript | SamSteele01/etsy-data | /main.js | UTF-8 | 3,144 | 3.921875 | 4 | [] | no_license | // Since the `data.js` file is loaded in your `index.html` before this one,
// you have access to the `data` variable that contains the Etsy Store data.
// Open your `index.html` page in your browser and you can verify that the following
// is properly working. The `data` variable is an array with 25 items in it
consol... | true |
ea5877a5d82abba7835b2b10f39f6548bae08055 | JavaScript | mfrisbey/node-smb-server | /spec/lib/test-fs-spec.js | UTF-8 | 18,066 | 2.515625 | 3 | [
"W3C",
"Apache-2.0"
] | permissive | var fsreq = require('./test-fs');
// sanity tests for the mock FS implementation
describe('MockFSTests', function () {
var fs;
function verifyExists(path, exists) {
var doesExist = true;
try {
fs.statSync(path);
} catch (e) {
doesExist = false;
}
expect(doesExist).toEqual(exists);
... | true |
9806b66dea794cfbba10a0c4892f69e62a550de6 | JavaScript | jdrichardsappacad/curriculum-shift-2021 | /topics/react-context/projects/advanced-forms/solution/src/components/ReportPage/ReportContent.js | UTF-8 | 1,876 | 2.703125 | 3 | [] | no_license | import Answer from "./Answer";
function sensoryResults(answers) {
let sum = 0;
answers.forEach(answer => {
sum += 4 - answer;
});
return Math.round(sum / (answers.length * 4) * 100);
};
function ReportContent({ survey, values }) {
survey.questions.forEach((question, idx) => {
question.value = values... | true |
8b699e19a25989a275a0750fcd183464c9aac05e | JavaScript | infwonder/ss_code_test | /misc/test.js | UTF-8 | 1,201 | 2.71875 | 3 | [] | no_license | const Promise = require('bluebird');
var query = require( __dirname + '/querys.js');
var prepare = Promise.promisify(query.prepare);
var compare = Promise.promisify(query.compare);
query.exchanges = 'Bittrex,Poloniex,BTC-E';
var watching = 'BTC-LTC,BTC-ETH,BTC-DASH';
query.markets = watching;
prepare().then(() => {
... | true |
15c691c09b39e8231933a0583d26e69addb079d9 | JavaScript | FatimaB26/javascript | /map_adventure/map4_bonus.js | UTF-8 | 230 | 3.6875 | 4 | [] | no_license | function isEven(num) {
if(num % 2 == 0)
console.log("true");
else
console.log("false");
}
var arr = [1, 2, 3, 4]
var arr2 = arr.map(isEven() {
return arr2;
});
console.log(arr2);
| true |
94f007c9356ba4b42cf5f07050c1574062d6eb77 | JavaScript | VitaliySimeonov/SoftUni | /JavaScript (JS) Fundamentals/Arrays Advanced/SumFirstLast.js | UTF-8 | 202 | 3.390625 | 3 | [] | no_license | function sum (input){
let firstNum = Number(input[0]);
let lastNum = Number(input[input.length-1])
let result = Number(firstNum+lastNum);
console.log(result)
}
sum(['20', '30', '40'])
| true |
d8017263e793f280875919d9572af11ea2e9672c | JavaScript | ryanlaiber/trybe-exercices-ryan | /bloco_4/dia_2/exercice-6.js | UTF-8 | 171 | 3.359375 | 3 | [] | no_license | let numbers = [5, 9, 3, 19, 70, 8, 100, 2, 35, 27];
let impares = 0;
for(number of numbers){
if(number % 2 != 0){
impares ++;
};
};
console.log(impares); | true |
a26535821f42457401f8fab930e31864b378dfe5 | JavaScript | leo-shopify/test-coverage | /index.js | UTF-8 | 514 | 3.140625 | 3 | [] | no_license | /*eslint-env node*/
const tag = (t, val) => `<${t}>${val}</${t}>`;
const ratingToString = rating => {
if (rating > 0) return 'good';
else if (rating < 0) return 'bad';
return 'ugly';
};
const MID = 3;
const normalize = rating => rating - MID;
const wrap = (t, rating) => tag(t, ratingToString(normalize(... | true |
d122e970c6c40de85fc7907bfcd714a0a0b1d538 | JavaScript | VictorKmin/jscx-july-19 | /basic/lesson5/consultation/cons.js | UTF-8 | 3,297 | 3.59375 | 4 | [] | no_license | // // // створити пустий масив та :
// // // - заповнити його 50 парними числами за допомоги циклу.
// // // - заповнити його 50 непарними числами за допомоги циклу.
// // // з парними вийшло
// // //
// // // let arr = [
// // // 49, 59, 53, 37, 29, 99, 1, 55, 91, 11, 1,
// // // 1, 3, 89, 57, 93, ... | true |
c0f97209092cc88aa393f9c690fe9abd72090e50 | JavaScript | allex-libs/templateslite | /misc.js | UTF-8 | 457 | 2.59375 | 3 | [
"MIT"
] | permissive | function createMisc (execlib) {
'use strict';
var lib = execlib.lib;
function arryforsure (thingy) {
if (!lib.isVal(thingy)) {
return [];
}
if (lib.isArray(thingy)) {
return thingy;
}
return [thingy];
}
function concatany (thingy1, thingy2) {
return arryforsure(thingy1).c... | true |
35f3edc9237e00230ee56f30ba4b155c488b3a36 | JavaScript | iliakhlyzov/backend-project-lvl2 | /src/formatters/plain.js | UTF-8 | 1,356 | 2.609375 | 3 | [] | no_license | import _ from 'lodash';
import types from '../types.js';
const complexValue = '[complex value]';
const begin = 'Property';
const parseValue = (value) => {
if (_.isObject(value)) {
return `${complexValue}`;
}
if (_.isString(value)) {
return `'${value}'`;
}
return value;
};
const parseKey = (key, par... | true |
0ba3786853d65dd217b0bd1e33dc91477f37ed98 | JavaScript | Menthosc/Code_Names | /codenames-web2/src/main/webapp/js/cartes.js | UTF-8 | 2,597 | 2.734375 | 3 | [] | no_license | // Créer le tableau de carte sur la page
function listerCarte(toto) {
var maLigne = $("<tr />");
var macolonne1 = $("<td />");
macolonne1.html($('table tbody tr').length + 1);
var macolonne2 = $("<td />");
macolonne2.html(toto.libelle);
maLigne.append(macolonne1);
maLigne.append(macolonne2);
... | true |
d398dedeb36dfc706111f21d2b486dd633970bfd | JavaScript | staycruzin/brewery-finder | /src/components/BreweryList/BreweryList.js | UTF-8 | 2,245 | 3.109375 | 3 | [] | no_license | import './BreweryList.css';
const renderBrewery = (brewery) => {
const {
name,
street,
postal_code,
website_url
} = brewery;
return (
<div>
<p><b>{name}</b></p>
<p><em>{`Address: ${street}, ${postal_code}`}</em></p>
<p>
<em>
{website_url
? (
... | true |
705a91b09a9b8c3767528cc85e1a0bd14b39deb6 | JavaScript | quynhthu99/Quynhthu99 | /basic02/b4/b4vn.js | UTF-8 | 374 | 3.25 | 3 | [] | no_license | var fs = require('fs');//file system
fs.readFile('data.txt', 'utf8', (err, data) => {
if (err) {
console.log(err)
} else {
var dataAgain = data;
console.log( `${data}`)
}
})
var reverseOject = function (input) {
var keys = Object.keys(input);
var Value = Object.values(in... | true |
c086bd0a3f8a873cee14d6f0619a36c4227b35bf | JavaScript | yueng-amaiwa/javascript_examples | /juan/react-counter-app/counter-app/src/components/counter.jsx | UTF-8 | 1,943 | 3.171875 | 3 | [] | no_license | /*
* counter.jsx
* Copyright (C) 2021 juanwilches <juanwilches@juans-mbp-6.lan>
*
* Distributed under terms of the MIT license.
*/
import React, { Component } from 'react'
class Counter extends Component {
//state = {
//value: this.props.counter.value,
//tags:["tag1","tag2","tag3"] //[]
//};
... | true |
aebe832f84c9782c6af63402be2c2a913a10f42b | JavaScript | jpila/ra-project3 | /app/view/CarouselView.js | UTF-8 | 4,596 | 2.609375 | 3 | [
"MIT"
] | permissive | import Flickity from 'flickity';
import Product from '../model/Product.js';
import Products from '../model/AllProducts.js';
import PreviewView from './PreviewView'
import App from '../App';
export default class CarouselView {
constructor(app = new app()){
console.log('creating Carousel');
this.app = app;
... | true |
a02a1854c4cdb69653d6c65aad2e9387c4a09bbd | JavaScript | luckyganesh/TODO-app | /public/newUser.js | UTF-8 | 748 | 2.75 | 3 | [] | no_license | const addUser = function () {
const form = document.getElementById('form');
let properties = ['name', 'id', 'password'];
if (isInvalid(properties, form)) {
console.log('inValid');
return;
}
let details = getFormData(properties, form);
fetch('/createNewUser', {
method: 'POST',
body: JSON.stri... | true |
0c924f2a41a92c5f5b71b29f1b89749c37b23364 | JavaScript | Bashka/databinder | /src/AbstractBinder.js | UTF-8 | 437 | 2.546875 | 3 | [] | no_license | class AbstractBinder{
constructor(handler, render){
this.handler = handler;
this.render = render;
}
bind(){
if(this.handler){
this.handler.bind();
}
if(this.render){
this.render.bind();
}
return this;
}
unbind(){
if(this.handler){
this.handler.unbind();
... | true |
19d5aa5cc627c852cd772aff3357f0d504f215e7 | JavaScript | Wesselmann/JavaScript | /jQuery/basic_selectors/js.js | UTF-8 | 717 | 2.640625 | 3 | [] | no_license | /**
* Created by R_Wesselmann on 11.03.2016.
*/
var count = $('*').length;
$("#p_id").dblclick(function () {
this.innerHTML="Changed paragraph by an ID selector.";
});
$(".p_class").hover(function () {
this.innerHTML="paragraph via a class selector.";
});
$("#p_this").find("p").click(function(){
this.... | true |
6689ad5bd38212617d40b03b8f62b8c45d61af05 | JavaScript | kukas/Mesto | /assets/js/conversation.js | UTF-8 | 3,652 | 2.578125 | 3 | [] | no_license | function Conversation( options ){
/*
Object options.aspects
"id" : value
Array options.sentences
[Sentence,Sentence,...]
Function options.onStart
argument QuestEvent
Function options.onEnd
argument QuestEvent
*/
this.aspects = options.aspects === undefined ? {} : options.aspects;
this.aspectsBac... | true |
0115b592254f524a8d26365b2696dffa640b2c06 | JavaScript | AndrewMagdyGad/Introduction-To-Back-End-Development | /Node.js Checkpoint/http-json-api-server.js | UTF-8 | 972 | 2.90625 | 3 | [] | no_license | const http = require("http");
const parseTime = (time) => {
return {
hour: new Date(time).getHours(),
minute: new Date(time).getMinutes(),
second: new Date(time).getSeconds(),
};
};
const unixTime = (time) => {
return { unixtime: new Date(time).getTime() };
};
const server = http.... | true |
937524504063b28de5f6b8bea8e551677b85aab8 | JavaScript | KarolCzechowicz/OfferMaker | /src/main/webapp/js/imageName.js | UTF-8 | 251 | 3.015625 | 3 | [
"MIT"
] | permissive |
var input = document.getElementById("img");
input.addEventListener( 'change', showFileName );
function showFileName(event) {
var input = event.target;
var fileName = input.files[0].name;
document.getElementById("link").value=fileName;
} | true |
4106001714deaa3d0dc3cf331366d5cebca53e84 | JavaScript | alamin200290/teaching-web-technologies-summer-2020-2021-sec-A | /json/script.js | UTF-8 | 992 | 2.875 | 3 | [] | no_license |
function ajax(){
const json = {
'name' : 'alamin',
'id' : 12,
'dept' : 'CS'
};
const data = JSON.stringify(json);
/*let name = document.getElementById('name').value;
const http = new XMLHttpRequest();
http.open('GET', `server.php?name=${name}`, true);
http.send();
http.onreadystatechange = functio... | true |
a2ed660d3e11346608ea79126cd6b7d45cffd314 | JavaScript | lewulezo/qjs | /test_q/test_Number.q.js | UTF-8 | 289 | 2.6875 | 3 | [] | no_license | !function(){
require("../q");
console.log('------ test Number -------');
var n = 1112;
console.assert(n.toFixedString(3), '112');
console.assert(n.toFixedString(4), '1112');
console.assert(n.toFixedString(5), '01112');
console.assert(n.toFixedString(6), '001112');
}(); | true |
e48aca2fc8fb323c68f7866d0fbfac3c12d68a4f | JavaScript | codermonkey-spec/zheke | /src/pages/community/store/reducer.js | UTF-8 | 477 | 2.59375 | 3 | [] | no_license | import {Map} from 'immutable'
import * as actionTypes from './constants'
const defaultState = Map({
hotTopics:[],
recommendTopic:[]
})
function reducer(state=defaultState,action){
switch(action.type){
case actionTypes.CHANGE_HOT_TOPIC:
return state.set('hotTopics',action.hotTopics)
case actionType... | true |
7c419067c666e70858d1d20760d2a197da61fae7 | JavaScript | proconnect/acelio.github.io | /projects/whistlebox/old/js/main.js | UTF-8 | 1,034 | 2.515625 | 3 | [
"MIT"
] | permissive | // ### FADEIN + FADEOUT
$(document).ready(function() {
var $mainContent = $('.parallax'),
$mainNav = $('#main-nav'),
$mainMenu = $mainNav.find('ul'),
$navItems = $mainMenu.find('a'),
$hamburger = $('#hamburger'),
scrollOffset = -40,
scrollTime = 1000,
navOffsets;
function getNavOffsets(){... | true |
ca3e9c74118412af422f9812d5917ee946d4dc38 | JavaScript | LeeLewis/SDI-1505 | /LabSeven/js/lewis_lee_lab7.js | UTF-8 | 1,052 | 4.125 | 4 | [] | no_license | /**
* Created by llewis on 5/19/15.
*/
//alert("Yes!");
// global variables
var array1 = [ 10, 6, 7, 3, 12, 5, 1 ];
var array2 = [ 25, 100, 4, 22, 16, 105, 2, 7 ];
var array3 = [ 2, 3, 4, 1, 10, 27, 32, 51, 6, 100, 8, 42 ]
//function
function bubbleSort(argArray) {
// local variables
var newArray;
var... | true |
c527dead4a575fa0138ca9d56f348dd2b9368538 | JavaScript | HashirSadaf/level-0-coding-challenges | /task05.js | UTF-8 | 268 | 3.5 | 4 | [] | no_license | function areaOfTriangle(side1,side2,side3)
{
let halfTriangle = (side1 + side2 + side3) / 2;
let area = Math.sqrt(halfTriangle*(halfTriangle - side1)*(halfTriangle - side2)*(halfTriangle - side3));
return area
}
console.log(areaOfTriangle(420, 69, 666)); | true |
1c06ec3082752e91581d88696d2cf640bafe8797 | JavaScript | jpballejo/FINAL_MecaTip | /backend/socket/juego-socket/socket.enEspera.js | UTF-8 | 5,706 | 2.625 | 3 | [] | no_license | console.log('Socket-enEspera cargado...');
exports.funcionInit = () => console.log('socket-enEspera inicio');
enEspera = [];
enEsperaDeSala = [];
////////////////////////////////////FUNCIONES////////////////////////////////////////////
var eliminarDeEspera = (userRetador, userContendientes) => {
for(let i = 0; i <= u... | true |
18bb411c48cd4df0ca866f97fb5fc0fbc6ffceba | JavaScript | charisearter/kitten-rolodex | /src/components/card-list/card-list.component.jsx | UTF-8 | 647 | 2.765625 | 3 | [] | no_license | import React from 'react';
//import CSS for Card List
import './card-list.styles.css';
import Card from '../card/card.component';
/*
CardList is functional component because it does not need access to internal state or React LifeCycle methods
Gets everything through props passed down to it
CardList component only... | true |
5e341064a66e943af1695d05264f24dbe502196f | JavaScript | ivarkrabol/js-portfolio | /js/graphics/graphics.js | UTF-8 | 1,743 | 2.921875 | 3 | [] | no_license | import Layer from './layer.js';
import Cell from './cell.js';
import Grid from "./grid.js";
class Graphics {
constructor($root) {
this.width = Math.floor(window.config.width);
// noinspection JSSuspiciousNameCombination
this.height = Math.floor(window.config.height);
this.layers = new Map();
this.initLayers... | true |
ca1eff6d9140dacf64580aa8f7a86bd3e9f00030 | JavaScript | karanjkarnikhil4/Study_TypeScript | /FirstProject/NameSpaces/Circle.js | UTF-8 | 819 | 2.875 | 3 | [] | no_license | "use strict";
//namespace can exist in more than one file for eg here same namespace that is Math is in Circle.ts and Rectangle.ts
// we need to export the functions or variables to use them outside the namespace. else they cannot be used outside the scope
// suppose we want to use PI variable originally present in Cir... | true |
17220c580d4df1c5388416f344a8cf3088059529 | JavaScript | richardsando/weather-app-client | /src/App.jsx | UTF-8 | 3,162 | 2.625 | 3 | [] | no_license | import React from "react";
import "./App.css";
import Clock from "./components/Clock";
import axios from "axios";
import Header from "./components/layouts/Header";
import Time from "./components/Time";
import sunny from "./images/icons/sunny.svg";
import Footer from "./components/layouts/Footer";
class App extends Rea... | true |
8c20bc631924dd18b3178a40f48a7385f3fa418f | JavaScript | GermanAizek/secure-crm | /include/js/admin.js | UTF-8 | 8,609 | 2.71875 | 3 | [] | no_license | var accessCatalogs = [];
$( '.dropdown-menu a' ).on( 'click', function( event ) {
var $target = $( event.currentTarget ),
val = $target.attr( 'data-value' ),
$inp = $target.find( 'input' ),
idx;
if ( ( idx = accessCatalogs.indexOf( val ) ) > -1 ) {
accessCatalogs.splice( idx, 1 );
... | true |