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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
e8d2c50020302d7f6b58fc0e287001a05a33a678 | JavaScript | mallang7/SONEMARY-1 | /files/detail_script.js | UTF-8 | 3,370 | 3.203125 | 3 | [] | no_license |
var slideIndex = 1;
showDivs(slideIndex);
function plusDivs(n) {
showDivs(slideIndex += n);
}
function showDivs(n) {
var i;
var x = document.getElementsByClassName("slide-image");
if (n > x.length) {slideIndex = 1}
if (n < 1) {slideIndex = x.length} ;
for (i = 0; i < x.length; i++) {
x[i].style.displ... | true |
8f0b75a9e1be1c7aabe3edb3f64a96bafcd71c7f | JavaScript | thinkful-ei-orka/DSA-Searching-Jon-Brian | /maxProfit.js | UTF-8 | 763 | 3.890625 | 4 | [] | no_license | function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
function maxProfit(arr) {
let maxprofit = 0;
let buyIndex = 0;
let sellIndex = 0;
for (let i = 1; i < arr.length; i++) {
let buy = arr[i];
for (let j = i + 1; j < arr.length; j++) {
let sell = arr[j];
let ... | true |
fc53a8260c35224c55022e7346b3b921e96d6247 | JavaScript | lucasBRYG/Web-API-Coding-Quiz | /assets/script.js | UTF-8 | 7,448 | 3 | 3 | [] | no_license | const interval = 1000;
const quizButtonDiv = document.getElementById("quiz-button");
const startButton = document.getElementById("start-button");
const quizDiv = document.getElementById("quiz");
let timerDiv = document.getElementById("quizTimer");
const startingTime = 50;
let score = 0;
const quizObject = {
questio... | true |
5e617bd1e75a557a3e48b62762a018a530027717 | JavaScript | AimAmit/Rock-Paper-Scissor | /func.js | UTF-8 | 2,235 | 3.578125 | 4 | [] | no_license | let userPoint=0;
let compPoint=0;
const userDisplay = document.getElementById('user-point');
const compDisplay = document.getElementById('comp-point');
const rockClick = document.getElementById('Rock');
const paperClick = document.getElementById('Paper');
const scissorClick = document.getElementById('Scissor');
const ... | true |
714fcb4a1d66e31b0eb20d094b9b73c0af353957 | JavaScript | chelsabeth/DOM-II | /js/index.js | UTF-8 | 2,255 | 3.515625 | 4 | [] | no_license | // Your code goes here
// Mouseover & Mouseout - makes nav bar background pink when hovering off and white when hovering over
const navBar = document.querySelector('.nav');
navBar.addEventListener('mouseover', (e) => {
navBar.style.backgroundColor = 'white';
});
navBar.addEventListener('mouseout', (e) => {
n... | true |
113192dcaa3efa13581b7457ba56fd506e2a53e2 | JavaScript | wheresmypen/Client6-short | /functioner.js | UTF-8 | 294 | 2.875 | 3 | [] | no_license | var profileCompile = function(){
var name = prompt("Please enter your name:");
var phone = prompt("Please enter your phone number:");
var address = prompt("Please enter your street:");
alert('Thank you! Victim entered: \n' +
name + ", " +
phone + ", " +
address);
return;
}; | true |
ad532148fc6b08e411c31304605238aa769cafda | JavaScript | CoderTvisha/ParagraphConcatProject80 | /main.js | UTF-8 | 630 | 3.5 | 4 | [] | no_license |
function getParagraph1() {
var paragraph1_array = [];
for (var j = 1; j < 4; j++) {
paragraph1_array.push(document.getElementById("input" + j).value);
console.log(paragraph1_array);
}
document.getElementById("Paragraph1").innerHTML = paragraph1_array.join(".");
}
fu... | true |
286fbb2cc81544a69711ac6f33c61f94bb36aafa | JavaScript | JocobZling/tw2_practiceAll | /FuzzBuzzWhizz_TDD_test/fuzzBuzzWhizz/main/main.js | UTF-8 | 819 | 3.46875 | 3 | [] | no_license | 'use strict';
function mapNumberToWord(num) {
let fizz = 3;
let buzz = 5;
let whizz = 7;
let word="";
if(num.toString().indexOf('3')==0){
word='fizz';
}
else if(num%fizz==0){
word ='fizz';
if(num%buzz==0){
word+=' buzz';
if(num%whizz==0) {
... | true |
a4e669f9460ec73f59dab1f14782dd40bb18d04b | JavaScript | ray0095/employee-manager | /employeeee/src/pages/Home.js | UTF-8 | 3,039 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
import Header from '../components/Header';
import API from "../utils/API";
import Wrapper from '../components/Wrapper';
import "./index.css";
class Home extends Component {
state = {
users: [],
searchByName : "",
searchByCity : "",
}
componentDidMount()... | true |
bd770287dc521fcfe55452430d3d7c4296130f50 | JavaScript | jvaldezn/webgl-chess | /src/server/shared/chess/ChessQueen.js | UTF-8 | 615 | 2.953125 | 3 | [
"MIT"
] | permissive | function ChessQueen()
{
this.owner = null;
this.position = null;
//Get details for a proposed move
this.interpretMove = function(move)
{
//Path must be clear
if(!move.game.isPathClear(move.from, move.to))
{
return false;
}
var files = Math.abs(move.to[0] - move.from[0]);
var ranks = Math.abs(move.t... | true |
bcd6c83a4efa35f14cb680a4793f73b34ac210a4 | JavaScript | raahn/freemark | /js/form.js | UTF-8 | 3,739 | 2.578125 | 3 | [] | no_license | $(document).ready(function() {
$('form[name=inputForm]').submit(function(e) {
e.preventDefault();
$("#resultContainer").show();
$("#resultText").text("");
$("#loadWrap").show();
$("html, body").stop().animate({
scrollTop : $("#resultContainer").offset().top
... | true |
d103403d9afaf82d72cff7783f5ac92ba77a1b14 | JavaScript | Nad188/check-Point-Dom | /shoppoingCard.js | UTF-8 | 3,086 | 3.53125 | 4 | [] | no_license |
// ================================================================== Delete items from the cart. =========================================================================
var dlt=document.querySelectorAll('.delete-btn')
console.log(dlt.parentElement)
for(let i=0;i<dlt.length;i++){
var button=dlt[i];
button.a... | true |
bbd634500d99cc6a1837d302ed7d513d8b8ba4f9 | JavaScript | yiduoke/10softdev-objects | /soft.js | UTF-8 | 1,970 | 3.640625 | 4 | [] | no_license | // I don't know how to objectify this
// you can't make an svg circle one of your own objects
// the only attribute of these circles that changes is their
// color, which you can't objectify
var NS="http://www.w3.org/2000/svg";
var svg = document.createElementNS(NS,"svg");
svg.setAttribute("height", 500);
svg... | true |
c1b71af7a249c1f7258ed13b1e0fe0ff89341cc2 | JavaScript | sejalgoyal/JavaScript_crash | /Chapter-2/static/js/main.js | UTF-8 | 4,447 | 3.25 | 3 | [] | no_license | // alert('Hello World');
function ageIndays()
{
var age = prompt("What is your birth year..?");
var daysAge = (2021-age)*365;
var h1 = document.createElement('h1');
var textAnswer = document.createTextNode("You are "+daysAge+" days old");
h1.setAttribute('id', 'prompt_result');
h1.appendChild(... | true |
e0537f87ecbb95611eb471aee2754c3853ff6147 | JavaScript | simonchan2013/code-snippets | /mysql/MysqlBase.js | UTF-8 | 5,963 | 2.578125 | 3 | [] | no_license | // =====================================================================================================================
// Description: mysql dao and api - base construstor
// =====================================================================================================================
'use strict';
const BASE... | true |
b9500537d3ffb6f079dcfc05bcc63bf0ee4df3ce | JavaScript | mrzaid/PIAIC-React-Assignment | /React-Hooks-with-Boostrap-Kit/src/component/contact/index.js | UTF-8 | 5,534 | 2.5625 | 3 | [
"MIT"
] | permissive | import React, { useState } from 'react'
const Contact = () => {
const [state, setState] = useState({
email: "",
password: "",
address: "",
address2: "",
zip: "",
city: "",
state: "",
checkValue: [],
})
const [payload, setPayload] = useState... | true |
49b4ef2a9730e61f8e52a1f4d571e9e43eb7ea02 | JavaScript | cleobuck/JS-Hill | /03-colors/01-change-bcg-one/script.js | UTF-8 | 908 | 3.125 | 3 | [] | no_license | /* becode/javascript
*
* /03-colors/01-change-bcg-one/script.js - 3.1: couleur de fond (1)
*
* coded by leny@BeCode
* started at 26/10/2018
*/
// NOTE: don't focus on the existing code structure for now.
// You will have time to focus on it later.
(() => {
let buttonArray = document.querySelectorAll("butto... | true |
19a5713ba7eda3d5f253d5ea721d0c168c3908c8 | JavaScript | XieZhiXian-NA/canvas | /vue_canvas_renderer/src/runtime-canvas/index.js | UTF-8 | 2,047 | 2.5625 | 3 | [] | no_license | import {createRenderer} from '@vue/runtime-core'
import {Graphics,Text,Container,Sprite, Texture} from 'pixi.js'
//创建渲染器
const renderer = createRenderer({
createElement(type){ //根据虚拟的dom开始生成真实的dom节点
// const element = new Graphics()
// if(type === 'circle'){
// element.beginFill(0... | true |
b0c10e0dda5298ca8d32348bbae49463ec53a0ed | JavaScript | merrillkoshy/Gulf-Motorcycles | /components/Admin/Booking/statusSwitchers/Completed.js | UTF-8 | 1,732 | 2.71875 | 3 | [] | no_license | import moment from "moment";
import { useEffect, useState } from "react";
const Completed = (props) => {
const [response, setResponse] = useState(null);
const efficiencyResponse = () => {
var a = moment(`${props?.completedDate}`, "YYYY-MM-DD");
var b = moment(`${props?.completionDate}`, "YYYY-MM-DD");
... | true |
646587a3e6b0788c75f8ce4ed57ebf0baf638f97 | JavaScript | FridaWaldt/grupparbete-majestic-ninjas | /grupparbete-majestic-ninjas-master/react-airbean/src/components/Status/Status.js | UTF-8 | 1,678 | 2.828125 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { useHistory } from "react-router-dom";
import Styles from "./status.module.css";
import droneImg from "../../graphics/drone.svg";
function Status() {
const [status, setStatus] = useState([]);
const history = useHistory();
// Vi hämtar vår data från API... | true |
48c40a8aefe579031015b45c95a4455995e8ac9c | JavaScript | Ankit-Developer143/JavaScript | /Array/pop().js | UTF-8 | 264 | 3.703125 | 4 | [] | no_license | /* REMOVE LAST ELEMENT IN THE ARRAY */
var fruits = ["Banana", "Orange", "Apple", "Mango"];
var obj = fruits.pop();
//remove last element in the Array
console.log(obj);
/* op :- Mango */
//after
console.log(fruits);
/* op :- [ 'Banana', 'Orange', 'Apple' ]*/
| true |
eb0b4887f7b032c0ec64f8305a640acf93121332 | JavaScript | j7nguyen/TeamSlap | /app/assets/javascripts/teamShow.js | UTF-8 | 1,300 | 2.765625 | 3 | [] | no_license | var playerRemove = function(rosterAddId, teamId) {
$.ajax({
url: ("" + teamId + "/roster_adds/" + rosterAddId),
type: 'DELETE',
success: function(response) {
playerToDropdown(response.player_id);
}
});
}
var playerAdd = function(formData, teamId, playerId) {
$.ajax({
url: "/teams/" + teamId + "/roster_... | true |
959b31bd8624afe2f86ce02c4333a2cce4895003 | JavaScript | entenity/entenity.github.io | /post_copy.js | UTF-8 | 1,587 | 2.84375 | 3 | [] | no_license | const path = require("path");
const fs = require("fs");
const target_folder = path.resolve(__dirname, './docs/category');
const source_folder = path.resolve(__dirname, "./docs/archive");
const ignoreFiles = [
"README.md",
];
function deleteFolder(path) {
let files = [];
if( fs.existsSync(path) ) {
files =... | true |
16669649dd69f0038c034e0c1d9ef9e829c6145c | JavaScript | ErangaD/GetIt-API | /routes/authentication.js | UTF-8 | 2,304 | 2.578125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var User = require('../model/User');
var validator = require('validator');
var isEmpty = require('lodash.isempty');
var jwt = require('jsonwebtoken');
var config = require('../config');
function validateInput(data) {
var errors = {};
if(va... | true |
e200ed181cde1dc6e04007106d8d391f999aa8b1 | JavaScript | julianmendonca/RecomendationAlgorithm | /Graph.js | UTF-8 | 289 | 2.625 | 3 | [] | no_license | module.exports = class Graph {
constructor() {
this.nodes = [];
this.graph = {};
}
getNode(user) {
var n = this.graph[user];
return n;
}
addNode(n) {
this.nodes.push(n);
var title = n.value;
this.graph[title] = n;
}
};
| true |
6d2a4000271395784515f2e16e3871917db0894d | JavaScript | DominicTremblay/w5d3-lecture-oct14 | /helpers/queryHelpers.js | UTF-8 | 587 | 2.515625 | 3 | [] | no_license |
module.exports = pgClient => {
const getTodos = () => {
// Creating the text of the query
const query = {
text: 'SELECT * FROM todos'
};
// Running the query
return pgClient
.query(query);
};
const addTodo = (task, dueDate, categoryId) => {
// Insert to the info to the D... | true |
14ed03ec9e9ca272ed237fbb74168fb9369003f0 | JavaScript | angelinasentyakova/Account---React | /src/Redux/authReducer.js | UTF-8 | 2,263 | 2.59375 | 3 | [] | no_license | import { stopSubmit } from "redux-form";
import { authAPI, securityAPI } from "../Api/Api";
const SET_USER_DATA = "SET-USER-DATA";
const GET_CAPTCHA_URL_SUCCESS = "GET_CAPTCHA_URL_SUCCESS";
let initialState = {
id: null,
email: null,
login: null,
isAuth: false,
captchaUrl: null,
};
const authReducer = (sta... | true |
e9f1978aa37d64381afdc09b8d7c8e05f7632488 | JavaScript | AllusiveBox/discordBot | /commands/ping.js | UTF-8 | 1,312 | 2.890625 | 3 | [
"MIT"
] | permissive | /*
Command Name: !ping
Function: Returns ping so that users can tell if the bot is accepting commands currently.
Clearance: none
Default Enabled: Yes
Date Created: 10/15/17
Last Updated: 10/06/18
Last Update By: Th3_M4j0r
*/
// Load in Required Files
const Discord = require(`discord.js`);
... | true |
1ace8af9ed017957d7f6cf59f80fb8d61224f998 | JavaScript | lsoder/lab-3-socket-chat | /server.js | UTF-8 | 2,183 | 2.671875 | 3 | [] | no_license | const express = require("express");
const http = require("http");
const app = express();
const server = http.createServer(app);
const { Server } = require("socket.io");
const io = new Server(server);
const rooms = [];
// CONNECT
io.on("connection", (socket) => {
console.log("Client was connected: ", socket.id);
i... | true |
7b790dc06fcdd5cc695da5ffc86fb4a0ad00b59a | JavaScript | m-hiroaki/atcoder-archive | /atcoder.jp/abc144/abc144_a/Main.js | UTF-8 | 314 | 3.125 | 3 | [] | no_license | function Main(arg) {
var A = arg.split(" ")[0];
var B = arg.split(" ")[1] -0;
var ans = 0;
if (1 <= A && A <= 9 && 1 <= B && B <= 9) {
ans = A * B;
}
else {
ans = -1;
}
console.log(ans)
return;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8")); | true |
22a70e6e1329334f190835faa30dad635a2baa3a | JavaScript | Nicolasfiguerasparras/2DAW | /DWEC/1trimestre/entregas/Carlos Conejero Martín/tablas 231018/datosTablasLibros.js | UTF-8 | 1,725 | 2.8125 | 3 | [] | no_license | let libros={
"978-0062511409":{
Titulo:"El Alquimista",
NombreAutor:"Paulo",
ApellidoAutor:"Coelho",
Precio:"$8.46"
},
"978-0307744593":{
Titulo:"Aleph",
NombreAutor:"Paulo",
ApellidoAutor:"Coelho",
Precio:"$12.23"
},
"978-034580704... | true |
3e487d2793d0c90031234914d67e66f3d1bad29b | JavaScript | dysbulic/xml-to-ipld | /src/utils/content.js | UTF-8 | 1,965 | 2.90625 | 3 | [] | no_license | import { arraysEqual, allOfType } from './types'
export const parsererrorNS = (() => (
(new DOMParser())
.parseFromString('INVALID', 'application/xml')
.getElementsByTagName('parsererror')[0]
.namespaceURI
))()
export const isParseError = (doc) => (
doc.getElementsByTagNameNS(
parsererrorNS, 'parsererro... | true |
03503afe2440c09966906c7b90244c000c9059b9 | JavaScript | charan1973/pizzashop | /backend/controllers/admin/item.js | UTF-8 | 2,137 | 2.546875 | 3 | [] | no_license | const Item = require("../../models/Item");
const uploader = require("../../config/cloudinaryConfig")
exports.createItem = async (req, res) => {
const { itemName, size, itemCategory } = req.body;
let image = ""
if(req.file !== undefined){
const { url, secure_url, public_id, asset_id } = await uploader.upload... | true |
d12cf1486869d770f97962ed1d05cd028a71e57b | JavaScript | InvoiceAppCreator/InvoiceApp | /frontend/src/Pages/Settings.js | UTF-8 | 9,172 | 2.5625 | 3 | [] | no_license | import React, {Component} from 'react'
import '../components/Settings/settings.css'
import axios from 'axios'
import sha256 from 'crypto-js/sha256';
class Settings extends Component {
constructor(props) {
super(props)
this.state = {
firstName: document.cookie.split('&')[2].split('=')[1],
lastName... | true |
62225bf5c85011c9887482c45b6e241b0c38eb94 | JavaScript | kkuzie/Assignment-2-FEWD-2 | /beginning-Assign-2/js/04-coinflip-streak.js | UTF-8 | 1,397 | 4.75 | 5 | [] | no_license | // In this part of the assignment you will explore what you’ve learned so far about variables, do while loops, conditionals, operators, math, and more to create a “coin flip streak game”. The point of this simple game is to see what kind of streak you can get to (how many times “Heads” comes up in a row before “Tails” ... | true |
57892d7993f3578bc27667afcc4557eee41407cc | JavaScript | sheepshine/woshidashabi | /base/2020.12.15/4.js | UTF-8 | 744 | 3.453125 | 3 | [] | no_license | var interpret = function(command) {
let curStr = ""
// for (let i = 0; i < command.length; i++) {
// let curS = [command[i]]
// if (curS ==)
// curStr += strMap[command[i]]
// }
let cur = 0
while (cur < command.length) {
console.log(cur, curStr)
if (command.indexOf("()", cur) =... | true |
c26dec7f2a1668c1b3b54c7272f10c5063ad24a1 | JavaScript | acphung/Practice | /FireBase/Profile/profile.js | UTF-8 | 2,084 | 2.890625 | 3 | [] | no_license | const elemEditBtn = document.getElementById('editBtn');
window.addEventListener('load', displayUserProfile);
elemEditBtn.addEventListener('click', editActive);
function displayUserProfile() {
firebase.database().ref('/users/anon').once('value').then(function (snapshot) {
let data = snapshot.val();
... | true |
2719a3448ba439268cf6227d2e66a2736c1a7ba5 | JavaScript | joinposter/pos-platform-boilerplate | /examples/loyalty/bonus.js | UTF-8 | 2,350 | 2.734375 | 3 | [] | no_license | /**
* Окно подтверждения списания бонусов
*/
export default class BonusView extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
updateInput = (e) => {
let {id, value} = e.target;
this.setState({[id]: value});
};
setBonus = () => {
... | true |
ff8a1d068435b96bd26e231f29965f3c425950b4 | JavaScript | rlaffers/adventofcode | /2022/16.js | UTF-8 | 13,037 | 2.875 | 3 | [] | no_license | import Graph from 'node-dijkstra'
import * as R from 'ramda'
import S from 'sanctuary'
import colors from 'colors'
const pad = (n) => {
let str = ''
for (let i = n; i > 0; i--) {
str += ' '
}
return str
}
function makeGraphAndValueMap(vx) {
const g = new Graph()
const valveSizes = {}
for (let v of v... | true |
c6cafde89e26d9fce25e4ac9c97dd1e7599bcda6 | JavaScript | bpaiken/SlashGaming | /src/reducers/auth_reducer.js | UTF-8 | 1,912 | 2.640625 | 3 | [] | no_license | import {
RECEIVE_CURRENT_USER,
SIGNOUT_CURRENT_USER,
RECEIVE_AUTH_TOKEN
} from '../actions/user_auth_actions'
import { RECEIVE_VERIFIED_CHARACTER } from 'APP/actions/character_auth_actions'
import { RECEIVE_USER_CHARACTERS } from 'APP/actions/character_actions'
import merge from 'lodash/merge'
const initialSta... | true |
d2d41c8685b822e9020e0e438864aa5ad5ffc61a | JavaScript | joselitokn2/javaScript | /UD4/Ejercicios4_I_soluciones/Ejer4_I_1/Ejer4_I_1.js | UTF-8 | 308 | 3.1875 | 3 | [] | no_license | // Funcion que actualiza un elemento p con id p1, mostrando posicion del raton
function mostrarPosicion(evento) {
document.getElementById('p1').innerHTML = 'Posicion X ' + evento.clientX + ' Posicion Y ' + evento.clientY;
}
// Asignamos un manejador a onmouseover
document.onmousemove = mostrarPosicion; | true |
fbe17d6c60cef37129ab8d7db6e1c936cadace09 | JavaScript | Tweety79rw/Circuit-Logic | /or.js | UTF-8 | 261 | 2.6875 | 3 | [] | no_license | class OrGate {
constructor(inputs, outputs) {
this.inputs = inputs;
this.outputs = outputs;
}
update() {
let state = false;
for(let input of this.inputs) {
state = state || input.state;
}
this.outputs[0].state = state;
}
}
| true |
62a53592c922c45511b4ba0c01af18c47710b664 | JavaScript | yangzhengca/coding-sample-client | /src/reducers/vehicles.js | UTF-8 | 568 | 2.71875 | 3 | [] | no_license | import { FETCH_ALL, CREATE, UPDATE, DELETE } from "../constants/actionTypes";
const vehicleReducer = (vehicles = [], action) => {
switch (action.type) {
case FETCH_ALL:
return action.payload;
case CREATE:
return [...vehicles, action.payload];
case UPDATE:
return vehicles.map((vehicle) =... | true |
5c604c85453cb2083b4805b12a47fc19eea73fee | JavaScript | sruthiviswanathan/Zterns-19-Sruthi | /UI-Tasks/javascript/todo.js | UTF-8 | 2,414 | 3.125 | 3 | [] | no_license |
var items = localStorage.getItem('list')? JSON.parse(localStorage.getItem('list')) : [];
var n = localStorage.getItem('on_load_counter');
if (n === null) {
n = 0;
}
var ul = document.getElementById("list");
var li = document.createElement("li");
console.log(n);
function listAllItems(items) {
... | true |
74eb5e2d489317144574787d7d597500fe6a3c57 | JavaScript | dcquentin/Tck221.github.io | /resource/js/activedShowing.js | UTF-8 | 1,951 | 2.9375 | 3 | [
"MIT"
] | permissive |
// 用ajax返回文本数据并包装。
var activedShowing = (function(){
var xajax,
textDiv,
input;
xajax = new XMLHttpRequest();
textDiv = document.getElementById("ajaxxx");
input = document.getElementById("hrefff");
xajax.onreadystatechange = function(){
console.log(this.readyState+" "+... | true |
a77ec20a79a2333f43fb5c89e6a222886cff16c9 | JavaScript | SirishaMunala/Kony_LocationServiceSample | /Kony_LocationServiceSample/jssrc/winphone8/nongenerated/gps.js | UTF-8 | 1,716 | 2.84375 | 3 | [] | no_license | function successGpscallback(position) {
try {
kony.print("successGpscallback function");
var lat = position.coords.latitude;
var lng = position.coords.longitude;
//lat="38.89870539307594";
//lng="-77.0365297794342";
kony.print("lat:" + lat);
kony.print("lng:" ... | true |
7ad815a0604df57903958a5521063966d970c6d2 | JavaScript | silvio-souza/excel-converter | /app.js | UTF-8 | 1,936 | 2.578125 | 3 | [] | no_license | const fs = require('fs')
const express = require('express')
const upload = require('express-fileupload')
const lerArquivoOriginal = require('./src/controllers/lerArquivoOriginal')
// const path = require('path')
const app = express()
let fileName = ""
// filePath = path.join(__dirname, '../../arquivoSicom')
app.use(u... | true |
95a911c9f8ab3f4ed4bb98c70c8c82ab3600ce1c | JavaScript | Sylfide/project-gestion-hospitalier | /Obole-Back/spread/index.js | UTF-8 | 394 | 3.484375 | 3 | [] | no_license | const name=['Chris','Laura','Vincnent','Reuben'];
const names=[...name].join(',')
//console.log(names);
const object={person1:"Laura",person2:"Reuben",person3:"Chris"}
//console.log(object);
const emptyObj={};
const objectEntries=Object.entries(object);
for(let [keyInfo,keyValue] of objectEntries){
emptyObj[keyI... | true |
c78f97ced18a710d9e71f2b3ba91892cf7d9c56e | JavaScript | scolt/travel-notes | /client/containers/User/common/ReducerUsers.js | UTF-8 | 1,038 | 2.53125 | 3 | [] | no_license | export default function (state, action) {
if (action.type === 'onChangeFormField') {
const {name, value, formName} = action;
let editForm = state[formName];
if (!editForm) return state;
editForm = {...editForm, fields: [...editForm.fields]};
const i = editForm.fields.reduce... | true |
1ba14e8d075bfa814955d16b5737e719783580c7 | JavaScript | charlie1201/c4e_session3 | /session3/app.js | UTF-8 | 4,076 | 3.515625 | 4 | [] | no_license | // A= 1 + 2 + 3+....+ n
// let n = Number(prompt("Input n"));
// let a = (1+n)*(n/2);
// console.log(`A = ${a}`)
// let n = Number(prompt("Input n"));
// let a = 0;
// for(let i= 1; i<=n; i++){
// a= a +i;
// }
// console.log(a);
//B
// let n = Number(prompt("Input n"));
// let a= 0;
// for(let i = 1; i <= n; i =... | true |
d2b775ad146e9d46db45e9b972bafc3d64a5df7d | JavaScript | AbdenourBout/wp-theme | /assets/js/script.js | UTF-8 | 542 | 2.6875 | 3 | [] | no_license | $(document).ready(function(){
var img = new Image;
console.log("var img = new Image; ");
console.log(img.src);
img.src = "pic1.jpg";
console.log("src :"+$('.bg').css('background-image'));
console.log("New :"+img.src);
var bgImgWidth = img.width;
var bgImgHeight = img.height;
console.log(bgImgHeight+... | true |
085346781132f38d3866ab3d7b537c2d21bbf720 | JavaScript | mazsola739/Rika-s-Katas | /Elementary_Expeditions/8 kyu Regular Ball Super Ball/index.js | UTF-8 | 484 | 4.3125 | 4 | [] | no_license | /*
Description:
Create a class Ball. Ball objects should accept one argument for "ball type" when instantiated.
If no arguments are given, ball objects should instantiate with a "ball type" of "regular."
ball1 = new Ball();
ball2 = new Ball("super");
ball1.ballType //=> "regular"
ball2.ballType //=> "super"... | true |
fac94df6156c985f661e2042ce69e2d2ccc85dac | JavaScript | Ramovha/computer-graphics-and-visualisation-introduction | /PROJECT/WorldRunner/js/StageDescriber.js | UTF-8 | 11,306 | 3.125 | 3 | [] | no_license | /*
* each stage is described here
* the approach used is indexed face set
* */
export class StageDescriber{
static objectsDesc = {
EMPTY: -1,
GATE: 0,
END_POINT: 1,
BLOCK_GATE: 2,
FLOATING_GATE: 3,
FloatING_BLOCK_GATE: 4,
FLOATING_END_POINT: 5,
BULLET:... | true |
010343463ca4e13e1f3ef9feab0f334d955b1182 | JavaScript | osiastedian/EventPlannerTestRepo | /war/js/ajax_ianSampleRequest.js | UTF-8 | 969 | 2.703125 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | /**
* Sample Request to Server
* Author: Ian Osias
*/
$(document).ready(function() {
$('#submitButton').click(function() {
var title_html = $("#title").val();
var description_html = $("#description").val();
var totalQuantity_html = $("#quantity").val();
var jsonData = {
data: JSON.stringify({
titl... | true |
526c5d3282c5601e0dd0e51527d24a556ec2319f | JavaScript | GrtBoomerInDaHouse/simple-calculator | /main.js | UTF-8 | 4,147 | 3.1875 | 3 | [] | no_license | const btn = document.querySelectorAll("button");
const input = document.querySelector(".h1-input");
const output = document.querySelector(".h1-output");
const footer = document.querySelector('.footer');
let a = new Date().getFullYear()
console.log(a)
footer.innerHTML = ` <p>smallNumbers © </p> <strong>${a}<... | true |
71591c36199d7627b50ff66a00a75d1d95750bbb | JavaScript | ChristopherHauschild/maratona-alura-quarentenadev | /aula_4/exercicio.js | UTF-8 | 269 | 3.25 | 3 | [] | no_license | distancia_km = prompt('Informe a distancia da corrida em km: ');
tempo_min = prompt('Informe a duração da corrida em minutos: ');
valor_da_corrida = 2 + distancia_km * 1.4 + tempo_min * 0.26;
document.write('Sua corrida custou: R$ ' + valor_da_corrida.toFixed(2));
| true |
d8d5b431d55efefb8e77c3a9a82c7a318bc09375 | JavaScript | chulack/DOMCoreBasic | /DOMCoreBasic.js | UTF-8 | 9,517 | 3.5625 | 4 | [
"MIT"
] | permissive | "use strict";
/*
DOMCoreBasic.js
Original build by Luke Christopher Chulack
05/09/2021
v0.2
*/
// num object
const num = {
// num random method
random: (aNum) => {
if (typeof aNum === "number" ) {
if (Number.isInteger(aNum)) {
return Math.floor(Math.ra... | true |
93f775dc2a7eaa8b4aced7450a32670e4d422cf4 | JavaScript | JulesVautier/FindAgendasAvaibilities | /src/getAvailabilities.js | UTF-8 | 2,811 | 2.8125 | 3 | [
"MIT"
] | permissive | import moment from 'moment'
import knex from 'knexClient'
const UNDEFINED = 0
const OPENING = 1
const APPOINTMENT = 2
export function createTab(nbDays) {
let tab = new Array(nbDays)
for (let day = 0; day < nbDays; day++) {
tab[day] = new Array(24 * 2)
for (let hour = 0; hour < 24 * 2; h... | true |
b3b20418346a70caa20060b8f2b27e52ae3fb1c9 | JavaScript | tetris0k/numsep | /test.js | UTF-8 | 2,292 | 3.015625 | 3 | [
"MIT"
] | permissive | var formatNumber = require('.');
var triadTmpl = function(n) { return '<span>' + n + '</span>' };
var numberTmpl = triadTmpl;
var te = new Te(formatNumber);
te.st(1, '<span><span>1</span></span>');
te.st(100, '<span><span>100</span></span>');
te.st(10001, '<span><span>10</span><span>001</span></span>');
te.st(-10001, ... | true |
4b30c884e73775ec4b7889716417a7e8183d34cf | JavaScript | chaimaeBel/CRUD-employee | /client/src/Components/ListEmployee.js | UTF-8 | 3,197 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
import { Table, Button } from 'react-bootstrap';
// To use routing functionalities
import { Link } from 'react-router-dom';
import SweetAlert from 'react-bootstrap-sweetalert';
import '../index.css';
const divStyle = {
margin: '8% 8%',
};
class L... | true |
6104830e8551fdc64b60c6b757d4159aa6d547f8 | JavaScript | flysouls/something | /src/App.js | UTF-8 | 2,170 | 2.59375 | 3 | [] | no_license | import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class Child extends Component{
constructor(props){
super(props);
this.state = this.props;
}
componentWillMount() {
console.log("componentWillMount");
}
componentDidMount() {
console.log("component... | true |
b867f82fb5f3794100c17b1bf4484532d56a3d5b | JavaScript | Morkalork/time-to-tell | /server/report.js | UTF-8 | 423 | 2.515625 | 3 | [] | no_license | const fs = require('fs');
const path = require('path');
const loadReports = userId => {
const filePath = path.join(__dirname, 'data/reports.json');
const file = fs.readFileSync(filePath, 'utf8');
const data = JSON.parse(file);
if (!userId || userId === '0') {
return data;
}
userId = parseInt(userId, ... | true |
e96c7492c88f1073d58517402e095b0875f0472d | JavaScript | Code-Institute-Submissions/CI_MS2_CardMemoryGame | /assets/js/easy-game.js | UTF-8 | 7,578 | 3.40625 | 3 | [] | no_license | /* Bug fix: solved jshint errors by including the following line */
/* jshint esversion: 6 */
// Global variable across all versions of the game to display score counter
const resultDisplay = document.querySelector('#result');
// Inserts back content hidden upon DOM loaded
// Removes introductory information
function... | true |
3bc11d7b0c0606a8c19d124c270d47c79aae259a | JavaScript | kdeun1/algorithm | /8. recursion and DFS/1. recursive function.js | UTF-8 | 651 | 4.1875 | 4 | [] | no_license | // my solution
function solution(n) {
let cnt = 1;
let answer = '';
function recursive(n) {
if (cnt <= n) {
answer += `${cnt} `;
cnt++;
recursive(n);
}
}
recursive(n);
return answer;
}
solution(3);
// explanation
function solution(n) {
function DFS(L) { // level의 약자를 쓴다.
if... | true |
d054cd5cff56fde25ccab42fb10cb4656b7327bd | JavaScript | cs165/homework4-tyc105u | /app.js | UTF-8 | 695 | 2.859375 | 3 | [] | no_license | class App {
constructor() {
let Main = document.querySelector('#main');
this.MusicScreen = new MusicScreen(Main);
this.MusicScreen.Pause();
let Menu = document.querySelector('#menu');
this.Submit = this.Submit.bind(this);
Menu.addEventListener('submit', this.Submit);... | true |
3ad89cecddab2399a335a0b74580af8b8d6ccc25 | JavaScript | PavelZaika/Hexlet_JS | /formattedTime.js | UTF-8 | 887 | 4.03125 | 4 | [] | no_license | /**Реализуйте и экспортируйте по умолчанию функцию, которая принимает на вход количество минут (прошедших с начала суток) и возвращает строку,
* являющуюся временем в формате чч:мм.
Пример:
formattedTime(5); // 00:05
formattedTime(15); // 00:15
formattedTime(60); // 01:00
formattedTime(67); // 01:07
formattedTime(1... | true |
73846bd785fcc032f1c940d9dbfb1cf6d76f8d2c | JavaScript | mescalchuan/clock | /main.js | UTF-8 | 4,859 | 3.015625 | 3 | [] | no_license | /**
* Created by qc on 2016/3/31.
*/
var WIDTH=document.documentElement.clientWidth;
var HEIGHT=document.documentElement.clientHeight;
var RADIUS=Math.round(WIDTH*4/5/108)-1;
var MARGIN_LEFT= Math.round(WIDTH/10);//第一个数字距离画布左端的距离
var MARGIN_TOP=Math.round(HEIGHT/5);//距离顶部的距离
var curShowTimeSeconds=0;//当前剩余时间(秒);
var ... | true |
f5f0aec1bffae839d4e62675877b065019fcfa63 | JavaScript | jgangel/parcial1PruebasAutomaticas | /tests/e2e/signup.js | UTF-8 | 2,997 | 2.65625 | 3 | [] | no_license | var assert = require('assert');
describe('Failed sign up because of registered email', function() {
it('Visits los estudiantes and fails at signup', function() {
browser.url('https://losestudiantes.co');
browser.click('button=Cerrar');
browser.waitForVisible('button=Ingresar', 5000);
browse... | true |
fae272a2b3eebaf3b54846d079d080d2fc65f91c | JavaScript | hack1973/DOM-and-Events-Studio | /scripts.js | UTF-8 | 4,673 | 3.28125 | 3 | [] | no_license | let takeoffButton = null;
let landButton = null;
let missionAbortButton = null;
let upButton = null;
let downButton = null;
let rightButton = null;
let leftButton = null;
let shuttleHeight = 0;
let rocket = null;
let rocketXPosition = 250;
let upos = 0;
let rpos = 0;
function init () {
// Obtain a reference to th... | true |
0cb1542b3d0d673d21d2b58c34046caf60189f10 | JavaScript | bjorntirsen/node-recipes | /public/scripts/script.js | UTF-8 | 2,171 | 2.765625 | 3 | [] | no_license | function addRow() {
const new_row = document.createElement('tr')
const name_input = document.createElement('input')
name_input.setAttribute('name', 'ing_name')
name_input.setAttribute('type', 'text')
const name_td = document.createElement('td')
name_td.appendChild(name_input)
new_row.appendChild(name_td)
... | true |
7927141039b7c330d0296e82b79642c7f8d79b0c | JavaScript | StevenSunzh/MedicalKGQA | /web_client/static/custom.js | UTF-8 | 1,902 | 2.84375 | 3 | [] | no_license | function get_answer(){
var start_time = get_time();
var question = $("#question").get(0).value;
if (question == ''){
return false;
}
$.ajax({
type:'post',
data:{"question":question},
url:'http://127.0.0.1:5000/',
async:... | true |
828d4e157236eca57583790b7edc236726f49ee4 | JavaScript | Shraddha15/custom-umbrella | /src/index.js | UTF-8 | 2,863 | 2.8125 | 3 | [] | no_license | const blue_background = 'rgba(53, 181, 230,0.1)';
const pink_background = 'rgba(219, 60, 145,0.1)';
const yellow_background = 'rgba(254, 211, 77,0.1)';
const blue_color = 'rgb(53, 181, 230)';
const pink_color = 'rgb(219, 60, 145)';
const yellow_color = 'rgb(254, 211, 77)';
(function(){
let uploadBtnImage = document... | true |
020868b53d7770aab7cabeade8a5f010b6b7f4f1 | JavaScript | pat-white-code/snippets | /test/tests/wordCloud.js | UTF-8 | 514 | 2.6875 | 3 | [] | no_license | const { wordCloud } = require('../../interview-cake/wordCloud');
const { expect } = require("chai")
describe('wordCloud', ()=> {
it('should return map of words', ()=> {
let returned = wordCloud("Add milk and eggs, then add flour and sugar.");
let expected = new Map()
expected["add"] = 2;
expected["m... | true |
d1fd930e1eed2e67653d4d34b4abedc6bac436aa | JavaScript | ailraon/ComOn_Algorithm_Study | /Week09/Day54/bj1929_jhi_fb.js | UTF-8 | 1,012 | 3.640625 | 4 | [] | no_license | const fs = require("fs");
const stdin = fs.readFileSync("/dev/stdin").toString().trim().split("\n");
const input = (() => {
let line = 0;
return () => stdin[line++];
})();
const [startNum, endNum] = input().split(' ').map(Number);
let primeNum = [];
makeEratos(findMinPower(endNum), endNum);
let result = "";
for... | true |
69587a76845480e2d815d7515664410fdc212a61 | JavaScript | TheJacksonLaboratory/smart-table-website | /sections/pagination/code.js | UTF-8 | 1,273 | 2.625 | 3 | [] | no_license | app.controller('paginationCtrl', ['$scope', function (scope) {
var
nameList = ['Pierre', 'Pol', 'Jacques', 'Robert', 'Elisa'],
familyName = ['Dupont', 'Germain', 'Delcourt', 'bjip', 'Menez'];
function createRandomItem() {
var
firstName = nameList[Math.floor(Math.random() * 4... | true |
065423416a2dcc1fbeb842b41e3958cadce75dd2 | JavaScript | vadim-sartakov/react-erp-ui | /src/utils/filter/filter.test.js | UTF-8 | 3,132 | 2.828125 | 3 | [] | no_license | import filter from './';
describe('await filter', () => {
const value = [
{ string: '1', number: 1 },
{ string: '2', number: 2 },
{ string: '1', number: 3 }
];
it('should apply default eq filter', async () => {
const result = await filter(value, [{ string: '2' }]);
expect(result).toEqua... | true |
64f98f88bd77d609f6a8d9ced2e4b6b5fd24ae28 | JavaScript | ayfickle/css-js-test-demo | /todo_list/react/v1.0/src/App.js | UTF-8 | 7,178 | 2.65625 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
// import TODOS from './data';
const TODOS = [
{id: 1, item: 'Sporting', completed: false},
{id: 2, item: 'Goods', completed: false}
];
let ids = 2;
let getItems = {
all: function(todos) {
return todos;
},
active: function(todos) {... | true |
7c54ed65eb56088cda0f43bac817a1b16f600a39 | JavaScript | anirbanmu/muc | /src/lib/youtube-api.mjs | UTF-8 | 1,693 | 2.671875 | 3 | [] | no_license | 'use strict';
import axios from 'axios';
import qs from 'qs';
const YOUTUBE_BASE_URI = 'https://www.googleapis.com/youtube/v3';
const YOUTUBE_VIDEOS_URI = YOUTUBE_BASE_URI + '/videos';
const YOUTUBE_SEARCH_URI = YOUTUBE_BASE_URI + '/search';
export default class YoutubeApi {
constructor(apiKey) {
this.apiKey =... | true |
5f055dcf61b73d908b9605449bff554d374a22e9 | JavaScript | nicoarcu11/DesafioArrays-23660Arcusin | /script.js | UTF-8 | 841 | 3.90625 | 4 | [] | no_license | function constructorPersona(nombre,edad,altura){
this.nombre = nombre;
this.edad = edad;
this.altura = altura;
}
function ordenarArray(array) {
var temp = 0;
for (var i = 0; i < array.length; i++) {
for (var j = i; j < array.length; j++) {
if (array[j].edad < array[i].edad) {
... | true |
89d3890c41c2e8ff92e46c5a7ec36b561a11df22 | JavaScript | RobGriggs/ReadySetJet-2x | /js/pageJScripts.js | UTF-8 | 10,135 | 2.96875 | 3 | [] | no_license | $(document).ready(function(){
//global variables
var globalData; //results returned from database via ajax call
var globalDates; //calendar dates associated with information pulled from database
var globalStartInt; //for use with slider output and sorting, simple integer to date conversion
var globalEndInt; //for... | true |
008cf3baebbebb28bff319984e6624044db75b7e | JavaScript | SakuraAmy/srdevkings | /srdev/server/models/mission.model.js | UTF-8 | 2,464 | 2.671875 | 3 | [
"MIT"
] | permissive | const express = require("express");
const Router = express.Router();
const mysqlConnection = require("../db_config/connection");
const Mission = function(mission){
this.mission_id = mission.mission_id,
this.title = mission.title,
this.flight_num = mission.flight_num,
this.show_on_front = mission.show_... | true |
d2cef96a382257a0eda63e9f62a9c5f2f40a87b8 | JavaScript | csiu22/maraudersMIT | /MaraudersMIT/client/templates/checkInOverlay.js | UTF-8 | 1,409 | 2.609375 | 3 | [] | no_license | CheckInService = {
/**
* Set user-inputted status, availability, duration, and location.
*/
checkInUser: function (end_time, availability, status, duration, pos) {
Meteor.call("checkIn", end_time, availability, status, duration, pos, function() {
maraudersMap.renderSelf();
if(!timer) {timer = ... | true |
237c0ce7933104b84fba1366c767c13d2c32b8ea | JavaScript | TigiGln/Biblio | /modules/edit_article_menu/annotatethreads/annotatethreads-INTERACTIONS.js | UTF-8 | 7,146 | 2.640625 | 3 | [] | no_license | /*
* Created on Mon May 3 2021
* Latest update on Thu May 27 2021
* Info - JS for annotate threads module in edit article menu
* @author Eddy Ikhlef <eddy.ikhlef@protonmail.com>
*/
/*******************************************************************************/
/* interactions function */
/**********************... | true |
1c0ee242da64e05af1539d8d955ef7b30be7787f | JavaScript | harmonicinc-com/shaka-player | /lib/abr/sliding_percentile_bandwidth_estimator.js | UTF-8 | 2,651 | 2.671875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | goog.provide('shaka.abr.SlidingPercentileBandwidthEstimator');
goog.require('shaka.abr.SlidingPercentile');
/**
* @summary
* This class tracks bandwidth samples and estimates available bandwidth.
* Based on the minimum of two exponentially-weighted moving averages with
* different half-lives.
*
*/
shaka.abr.Sli... | true |
0e5b27aeeb159041f246c8f6f6db532be7039a46 | JavaScript | anishatulika/github-search | /script.js | UTF-8 | 3,192 | 2.78125 | 3 | [] | no_license | if(localStorage.getItem("number") == null) {
localStorage.setItem("number", "0");
} else {
var count = localStorage.getItem("number");
$("#counter").html(count);
}
$('#typeahead-input').typeahead({
minLength: 3,
items: 20,
source: function (query, process) {
var githubSearchAPI = "https://api.github.co... | true |
7c544efbbe072cbbb36cd4f8c5805b366d3c5789 | JavaScript | NPettyjohn/nickpettyjohn.com | /server/controllers/mailer.js | UTF-8 | 1,545 | 2.71875 | 3 | [] | no_license | // Require dotenv so we can get our username and password from environment variables
require('dotenv').config();
'use strict';
const nodemailer = require('nodemailer');
module.exports = {
send(request, response) {
// console.log("Trying to send email from: " , request.body.sender);
// console.log("Trying t... | true |
82b6012f8c292f6931612ec3a08beb930d3210be | JavaScript | GGulberdi/Second-day-project | /05-Simple Conditionals/script.js | UTF-8 | 4,015 | 3.484375 | 3 | [] | no_license |
let score = prompt( "What is your score");
if (score < 0) {score = 0;}
if (score > 100) {score = 100;}
if (score < 49) {score = "\"F\""}
if (score <= 59) {score = "\"D\""}
if (score <= 69) {score = "\"C\""}
if (score <= 79) {score = "\"B\""}
if (score >= 80) {score = "\"A... | true |
67d727725b5992ce468c972e2ee4692846bb34dd | JavaScript | valentinebm/Ironhack_bootcamp | /Week_5/Day_1/jquery-exercise/index.js | UTF-8 | 1,358 | 2.96875 | 3 | [] | no_license | var phrases = [
"The coolest phrase.", "Let's go to the movies.", "Le compte avait commencé à rebours."
];
var list = $('ul.allsentences')
function loadPhrase(){
var phrase = phrases[Math.floor(Math.random()*phrases.length)];
$(".phrase").text(phrase);
};
$(".button-refresh").click(function(){
var phrase = ... | true |
9ec0f35ed9e3a9b465ac1896ebb98789bb4a0d72 | JavaScript | Rodrigohernandezsan/lab-hello-ironhack | /src/App.js | UTF-8 | 1,524 | 2.609375 | 3 | [] | no_license | import React from "react";
import "./app.css";
const App = () => {
return (
<div>
<section className="first-div">
<nav>
<img src="../images/ironhack-logo.svg"></img>
<img src="../images/menu-top.svg"></img>
</nav>
{/* Blocked 1 */}
<section>
... | true |
7fdbac558e1ccabd6baa189c4a2a51cefb04afec | JavaScript | unphurlng/mob-sorted-contact-list | /src/load-contacts.js | UTF-8 | 828 | 3.0625 | 3 | [] | no_license |
export function createTableTemplate(contacts) {
const html = /*html*/`
<tr>
<td>${contacts.isActive ? 'Yes' : 'No' }</td>
<td>${contacts.firstName}</td>
<td>${contacts.lastName}</td>
<td>${contacts.company}</td>
</tr>
`;
const template = document.createElement('tem... | true |
9823cf4fc74ee5414e40fda423ab8b48018e518a | JavaScript | Coil-Recoil/Psychic-Game | /assets/javascript/game.js | UTF-8 | 1,078 | 4.1875 | 4 | [] | no_license |
//Letters
var possibles = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
var index = Math.floor(Math.random()*possibles.length);
var psychic=possibles[index];
console.log(index);
console.log(psychic);
//Counters
var wins = 0;
var ... | true |
000f2ad1e63e6c5fceba7c719c9f33fafed0d7d4 | JavaScript | Cikii/formular | /js.js | UTF-8 | 1,015 | 3.234375 | 3 | [] | no_license | console.log("Funguje ti to debile haha");
let a = document.getElementById("a");
let b = document.getElementById("b");
let c = document.getElementById("c");
let v = 0;
let strana =0;
let stra=0;
let strb=0;
let strc=0;
let delka = document.getElementById("delka");
let vyska = document.getElementById("vys... | true |
e1763b4e925d05711fda143290bd67af8bc9e628 | JavaScript | danyim/ConsultantSpeak | /server/api/jargon/jargon.controller.js | UTF-8 | 1,874 | 2.890625 | 3 | [] | no_license | /**
* Using Rails-like standard naming convention for endpoints.
* GET /jargon -> index
* POST /jargon -> create
* GET /jargon/:id -> show
* PUT /jargon/:id -> update
* DELETE /jargon/:id -> destroy
*/
'use strict';
var _ = require('loda... | true |
206125e67ede1e59f43b4712c8235bc532cd8c23 | JavaScript | jreplinger/wolf-server | /src/controllers/joinGame.js | UTF-8 | 1,211 | 2.65625 | 3 | [] | no_license | import Game from "../models/Game.js";
import GetGameData from "./helper/getGameData.js";
import { ErrorResponse, errorFormater } from "../util/errorResponse.js";
const joinGame = async (req, res, next) => {
if (req.body.gameCode) {
let gameFound = await Game.findOne({
gameCode: req.body.gameCode,
});
... | true |
8351a3c620657b18e0fe9e045f0906eac834a4cd | JavaScript | DevelopFroZo/EcoGo | /routers/users.js | UTF-8 | 717 | 2.53125 | 3 | [] | no_license | let express;
express = require( "express" );
async function registerHandler( req, res ){
res.send( await req.db.users.register(
req.body.fi, req.body.email,
req.body.phone, req.body.password
) );
}
async function authHandler( req, res ){
res.send( await req.db.users.auth(
req.body.emailOrPhone, req... | true |
344303c7e2d8d130cf8b91aff7aba8fe6d1a9743 | JavaScript | shah1012/Weather-App | /src/components/containers/CardHolder.js | UTF-8 | 1,056 | 2.75 | 3 | [] | no_license | import React from "react";
import {
GridDiv,
Card,
CardDate,
CardImage,
MinDegreeLabel,
MaxDegreeLabel,
DegreeWrapper,
} from "../../styles/Card-Div-styles";
// getting which day it is
const getDay = (date) => {
const dayOfWeek = new Date(date).getDay();
return isNaN(dayOfWeek)
? null
: [
... | true |
1705b4dd9b3fc80fc7da7d2b79341c46cd2fcbe3 | JavaScript | maxgud/Learn_JS_the_hard_way | /escape_chars.js | UTF-8 | 252 | 3.09375 | 3 | [] | no_license | let talking = "I'm not sure if she said, \"Hello\" or not.";
let walking = 'I\'ll need to go \'cause you don\' know.';
let height = "6'2";
console.log('I\'m not g\'na see y\'all for a while.');
console.log(`${talking}`);
console.log(`${walking}`);
| true |
c0f1222e6368e4a0ae244851f296d6c3761ec089 | JavaScript | MLDB2020/MLDB | /server/routes/users.js | UTF-8 | 2,500 | 2.671875 | 3 | [] | no_license | const { Router } = require('express');
const { mysql } = require('../database/mysql');
const usersRouter = Router();
// GET USERS DATA INFORMATION
usersRouter.get('/', (req, res) => {
mysql.select('*').from('user').then(data => {
res.send(data);
});
});
// REGISTER USERS
usersRouter.post("/", async (req, re... | true |
d5cb86b7f86247297a188256261ba0ab0f02bb7c | JavaScript | cristi-radu/infinite-scroll | /script.js | UTF-8 | 2,092 | 3.453125 | 3 | [
"MIT"
] | permissive | const imageContainer=document.getElementById('image-container');
const loader=document.getElementById('loader');
let ready=false;
let imagesLoaded=0;
let totalImages=0;
let photosArray=[];
//Unsplash API
const collections="travel";
const count=30;
const apiKey='CfgPAzEcuUI3rtpGqSt5Io41gLmX7mNNOFHg_6AklA4'
const apiUr... | true |
a0dc852e815f14673de0bbb05ee6d42061191b21 | JavaScript | christinelant/budgetanalyzer | /js-budget.js | UTF-8 | 2,222 | 3.84375 | 4 | [] | no_license | const addExpense = document.querySelector(".add")
const list = document.querySelector(".entered-expenses")
const form = document.querySelector('form')
form.addEventListener('submit', function (event) {
event.preventDefault()
addNewExpense()
})
const expenses = []
const addNewExpense = () => {
// this wil... | true |