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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0cd0198de5a34e366825f97187fefd4677e4578a | JavaScript | rowanhogan/wikipadia | /src/store/tabs/index.js | UTF-8 | 1,161 | 2.625 | 3 | [] | no_license | import uuid from 'uuid/v4'
export const activateTab = (id) => dispatch =>
dispatch({
type: 'TABS/ACTIVATE',
payload: { id }
})
export const addTab = (name, path) => dispatch =>
dispatch({
type: 'TABS/ADD',
payload: { name, path }
})
export const removeTab = id => dispatch =>
dispatch({
... | true |
b2236931adfd0f00cbe2590a5e09e6fb20db612c | JavaScript | elkinsaacar/MERN-task-v2 | /src/route/task.routers.js | UTF-8 | 1,431 | 2.546875 | 3 | [] | no_license | const { request } = require('express');
const express = require('express');
const router = express.Router();
const Task = require('../models/task');
/* router.get('/', (req, res) => {
Task.find( function(err, tasks){
console.log( tasks );
});
res.json({
status: 'API Funciona'
});
}); *... | true |
5c35e72344c70792b675cb6727a2c79e5ba37c6b | JavaScript | MTAZero/RNAnimation | /src/helpers/common/getShorterText.js | UTF-8 | 446 | 2.90625 | 3 | [] | no_license | export default (text = '', maxWord = 50) => {
if (!text || typeof text !== 'string') return ''
const words = text.split(' ')
if (words.length <= maxWord) return text
const testRemakeString = words.slice(0, maxWord - 1).join(' ')
const finishPosition = testRemakeString.length
const suffix = te... | true |
28b31eb66c94d8df436f88b90035a27c8fa58f69 | JavaScript | iamrameshkr/nbcfdc_dashboard | /dashboard/WebContent/js/skill/skill2018-19.js | UTF-8 | 5,149 | 2.515625 | 3 | [] | no_license |
var webUrl ="http://localhost:8080/dashboard/api/";
//bar graph
var barColors=["#D32F2F","#303F9F","#388E3C","#F57C00","#C2185B","#1976D2","#689F38","#E64A19","#0288D1","#AFB42B","#5D4037","#7B1FA2","#0097A7","#FBC02D","#616161","#512DA8","#00796B","#FFA000","#455A64","#003f5c","#58508d","#bc5090","#ff6361","#ff... | true |
ad6a12d5f61a63937b82053818c8ff4298e7c1d4 | JavaScript | atrijo2001/Hiv-aids-database | /client/src/Components/StateWise/StateChart.js | UTF-8 | 561 | 2.609375 | 3 | [] | no_license | import {useParams} from "react-router-dom"
import axios from 'axios'
import {useState, useEffect} from "react"
const StateChart = () => {
const {id} = useParams()
const [res, setRes] = useState(null)
const fetchData = async(id)=>{
const {data} = await axios.get(`http://localhost:5000/api/v1/cases/... | true |
aba3f72b176b747d56c719e79363983954197387 | JavaScript | courses-angular/JS_Lessons_by_Vladilen_Minin | /Spread_rest-operators/spread_rest.js | UTF-8 | 2,972 | 3.796875 | 4 | [] | no_license | const citiesRussia = ['Moscow', 'St.Petersburg', 'Novosibirsk', 'Kazan'];
const citiesEurope = ['Prague', 'Rome', 'Paris', 'Madrid'];
// Spread for arrays
console.log(...citiesRussia)
console.log(...citiesEurope)
const russianCities = [...citiesRussia]; //clone the array
console.log('New array of russian cities', rus... | true |
26242ec1587cd48386e3bb39b8defc143164731b | JavaScript | Koderkup/keyboard | /script.js | UTF-8 | 4,401 | 3.015625 | 3 | [] | no_license | const keyMatrix = [
[
["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "=", "Backspace"],
[49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 187, 8]
],
[
["Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]"],
[9, 81, 87, 69, 82, 84, 89, 85, 73, 79, 80, 219, 221]
... | true |
615bcdbaac19ff9c0bf4a668f77a4e948ec3c2b4 | JavaScript | TIC-3/app-backend | /src/routes/profesores.js | UTF-8 | 1,212 | 2.796875 | 3 | [] | no_license | const express = require('express')
const router = express.Router()
const Profesor = require('../models/profesor')
router.get('/', async (req, res)=> {
try{
res.send("De aca salen cosas")
}catch{
res.status(500).json({message: err.message})
}
})
//Getting one
router.get('/:username', getPr... | true |
316faaaccb62d4c186697ed9b5d459b4c328ff42 | JavaScript | Arthaey/google-apps-scripts | /google-docs-word-count/ReportCard.gs | UTF-8 | 2,551 | 3.109375 | 3 | [] | no_license | function updateReportCard(newWordCount) {
log("\n\nUPDATING REPORT CARD SPREADSHEET...\n\n");
var story = getDocument();
if (!story) {
log("ABANDONING BECAUSE STORY DOCUMENT NOT FOUND: " + getStoryId());
return {};
}
var spreadsheet = getSpreadsheet();
if (!spreadsheet) {
log("ABANDONING BECAU... | true |
1fbe9bbe3bbe2f9985cf5ea68716a6634e0459ca | JavaScript | Arixka/Dikram--back | /api/controllers/auth.controller.js | UTF-8 | 1,779 | 2.5625 | 3 | [] | no_license | const { userModel } = require('../models/user.model')
const bcrypt = require('bcrypt')
const jwt = require('jsonwebtoken')
exports.login = (req, res) => {
userModel
.findOne({ email: req.body.email })
.then(user => {
if (!user) {
return res.json({ error: 'Wrong ' })
}
bcrypt.compare... | true |
ef4ce25f3fe87bd86fa431ab7ee7949fcd62819d | JavaScript | Slyke/z80-emulator | /emu/dec/z80.dec.js | UTF-8 | 52,664 | 2.53125 | 3 | [] | no_license | /*
DEC - Decoder
This module is the decoder for the Z80 CPU. Its job is to figure out how many bits each command takes, and which circuit
each command should activate. In the emulator, the command's timing is done here to simulate a crystal clock.
// */
if (!objEmulatorFactory) {
var objEmulatorFactory = ... | true |
7e105957f7e4186ec96ec966a17d55d6967212c8 | JavaScript | javierdeaguilera/ejercicios-coderbyte | /main.js | UTF-8 | 970 | 4.5 | 4 | [] | no_license | function add(n1, n2) {
console.log(n1 + n2);
}
add(3, 2);
/*
Haga que la función LetterChanges(str) tome el parámetro str que se está pasando y lo modifique utilizando el siguiente algoritmo. Reemplace cada letra de la cadena con la letra que le sigue en el alfabeto (es decir, c se convierte en d, z se convierte... | true |
80e901ef91d0d78d37e20cb7054492dee4994c30 | JavaScript | pangbayy/Drft | /src/components/Services/JournalService.js | UTF-8 | 2,011 | 2.640625 | 3 | [] | no_license | import axios from "axios";
class JournalService {
async postJournal(title, userId, content) {
try {
const res = await axios({
method: "POST",
url: "http://localhost:3000/api/v1/journals",
data: {
title,
userId,
content,
},
});
if (re... | true |
3d42d9abf81b48acc5ff64d06c86b24bd8c62f7d | JavaScript | kostayOK/609267-keksobooking | /js/pin.js | UTF-8 | 1,081 | 2.671875 | 3 | [] | no_license | 'use strict';
(function () {
window.createPin = function (obj, index) {
/** createPin - создаем дом элимент метка */
/** отрисовка дом элимента button и добовление фотографии */
var buttonLocation = document.createElement('button');
buttonLocation.className = 'map__pin';
buttonLocation.draggable =... | true |
9945e4bd3f2459404c29ffaa1926e309ce63a881 | JavaScript | jimbopagan/vschool-assignments | /exercises/angular-services-begining/services/services.js | UTF-8 | 340 | 2.90625 | 3 | [] | no_license | var app = angular.module('myApp');
app.service('pokeService', function() {
this.pokemon=[];
this.addPokemon = function(name){
this.pokemon.push(name);
}
this.removePokemon = function(name) {
// var index = this.pokemon.indexOf(name);
this.pokemon.splice(this.pokemon.indexOf(... | true |
b82a7c3731ee0a4977d17b46de82a688aaff10b0 | JavaScript | shubhamshetti08/BridgeLabz-javascript | /DataStructures/PrimeNumbers/primeNumbers.js | UTF-8 | 1,240 | 3.25 | 3 | [] | no_license | /********************************************************************************************************************
* @Execution : default node : cmd> primeNumbers.js
* @Purpose : To perform operations specified.
* @description : first take range of numbers 1 to 1000 and send it to find primes and stored in 2d array... | true |
d17c59f11480dd76cbf1814c1ac76904e0e5b67c | JavaScript | MK-314/Node_JS | /notes-app/notes.js | UTF-8 | 2,257 | 3.375 | 3 | [] | no_license | var chalk = require('chalk');
var fs = require('fs');
const log = console.log;
var getNotes = function() {
return "Your notes...";
};
var addNote = (title, body) => {
var notes = loadNotes();
// var itemDontExist = true;
var itemExist = notes.find(note => note.title == title);
log(itemExist);
/... | true |
f40a13f83c8102779d30edb9cb6cf955b263cad6 | JavaScript | mborecki/accountant-cg | /src/simulation.js | UTF-8 | 3,679 | 2.703125 | 3 | [] | no_license | import Targets from './targets.js';
import Enemies from './enemies.js';
import {distance, getBonusPoints, damage} from './utils.js';
import {ENEMY_SPEED, ENEMY_POINTS, TARGET_POINTS, KILL_RANGE} from './config.js';
let gameTimeLimit = null;
export function getGameTime() {
return gameTimeLimit;
}
export function ... | true |
15d446c1a5412eae991f06f36c5ba0a3dab99339 | JavaScript | NickMarinade/budget-app | /data/budgetClass/budgetListener.js | UTF-8 | 259 | 2.640625 | 3 | [] | no_license | const budgetForm = document.getElementById('budget-form');
const budg = new budget();
const balanc = new balance();
budgetForm.addEventListener('submit', function (event) {
event.preventDefault();
budg.submitBudgetForm();
balanc.showBalance();
}); | true |
0e9762dcb6962839ba8d1b16923550dbcc0ca3f2 | JavaScript | Rbnzuiga/Aplicaciones-moviles- | /JavaScript+API - Clima/index.js | UTF-8 | 1,143 | 3.484375 | 3 | [] | no_license |
function Leer() {
const ciudad = document.getElementById("input").value;
const key='9ebc257ba76951cd62f1e472b24f15e5';
buscar1(ciudad,key);
}
function buscar1(ciudad,key){
const api_url=`http://api.openweathermap.org/data/2.5/forecast/?q=${ciudad}&cnt=7&units=metric&appid=${key}`
fetch(api_u... | true |
73f5e87ed5d54cd4cfbe9cc5685b2f34ab20108d | JavaScript | Sultenhest/bowling-opgave | /src/Frame.js | UTF-8 | 465 | 3.015625 | 3 | [] | no_license | export default class Frame {
firstRoll = 0
secondRoll = 0
constructor(frame) {
this.firstRoll = frame[0]
this.secondRoll = frame[1]
}
isStrike() {
return this.firstRoll === 10
}
isSpare() {
return ! this.isStrike() && this.getScore() === 10
}
isLastFrame() {
return this.getSc... | true |
5f1aa588e1a1f4273f786e6d1052416c86f25614 | JavaScript | mohamednossair/Spring-Boot-React-Test | /Frontend/src/components/input.spec.js | UTF-8 | 3,253 | 2.59375 | 3 | [] | no_license | import React from "react";
import { fireEvent, render, screen } from "@testing-library/react";
import Input from "./input.js";
describe("Layout", () => {
it("has input item", () => {
const { container } = render(<Input />);
const input = container.querySelector("input");
expect(input).toBeInTheDocument(... | true |
437900caac591c2b498e136513eac817d0213c96 | JavaScript | iceycc/daydayup | /攻读红宝书(第四版)/示例代码/Chapter10Functions/DefaultParameterValues/DefaultParameterScopeAndTemporalDeadZone/DefaultParameterScopeAndTemporalDeadZoneExample02.js | UTF-8 | 109 | 2.828125 | 3 | [
"MIT"
] | permissive | function makeKing() {
let name = 'Henry';
let numerals = 'VIII';
return `King ${name} ${numerals}`;
}
| true |
953cdbc411f34e3945163b7cf8c1c84c74bb7748 | JavaScript | kittson/homework-four-v3 | /notes/leafmulcharraystyle.js | UTF-8 | 3,544 | 2.953125 | 3 | [] | no_license | $(document).ready(function(){
// second try, reconfiguring characters var to individual vars
var tommy = {
healthPoints: 10,
attackPow: 10,
counterPow: 10
};
var sister = {
healthPoints: 10,
attackPow: 30,
counterPow: 10
};
var wrapper = {
healthPoints... | true |
9d6195fa564b305c2c3928c78d74dc6473252a47 | JavaScript | LeXteRpro/orie-websitev0.9-form-data | /scripts/app.js | UTF-8 | 1,099 | 3.328125 | 3 | [] | no_license | "use strict";
//Scroll Down to Portfolio section
$("#portfolio-link").click(function() {
$('html, body').animate({
scrollTop: $("#portfolio-doc").offset().top
}, 500);
});
//Scroll Down to Contact section
$("#contact-link").click(function() {
$('html, body').animate({
scrollTop: $("#cta"... | true |
c888f7acfdde1c6f09dfaf6c039890345c31dea1 | JavaScript | patrick-salvatore/Notes | /client/src/Actions/MessageActions.js | UTF-8 | 1,674 | 2.65625 | 3 | [] | no_license | import {FETCH_MESSAGE,POST_MESSAGE,DELETE_MESSAGE} from './types';
import axios from 'axios';
const url = 'http://localhost:3001/API/messages';
/*GET MESSAGES FROM STATE*/
export const recieveMessages = messages => {
return {
type: FETCH_MESSAGE,
messages
}
}
export const fetchMessages = ()... | true |
4981e29f7b1fbd85efe3ee0fa1f77dcc9d415e29 | JavaScript | WilliamDeveloper/udemy_cursos | /nodejs/003_formacao_nodejs/0041_aula_proj8_fullcalendar/services/AppointmentService.js | UTF-8 | 3,439 | 2.6875 | 3 | [
"MIT"
] | permissive | const appointment = require('../models/Appointment')
const mongoose = require('mongoose')
const Appointment = mongoose.model('Appointment', appointment)
const AppointmentFactory = require('../factories/AppointmentFactory')
const nodemailer = require('nodemailer')
class AppointmentService{
async Create({ name, e... | true |
c1ed9f7c4b50ec40120138a522a8f7021b003d1d | JavaScript | kihwan-lee/dunder-mifflinfinity | /database/controllers/employees.js | UTF-8 | 1,310 | 2.875 | 3 | [] | no_license | const db = require("../models");
// RETURN ALL EMPLOYEES
const index = (req, res) => {
db.Employee.find({})
.then((foundEmployees) => {
res.json({ employees: foundEmployees });
})
.catch((err) => {
console.log('Error in employees.index:', err);
res.json({ Error: 'Unable to get your data... | true |
e2d5b6613463d651a1bef339d30f3e6ce7fdd35a | JavaScript | raminDutt/JavaScript | /cyclops/taskFormEditDialogue.js | UTF-8 | 8,176 | 2.671875 | 3 | [] | no_license | "use strict"
var taskFormEditDialogue = (function ()
{
function checkLength(o, n) {
if (o.val().length === 0) {
o.addClass("ui-state-error");
updateErrorMessage(n + " cannot be empty.");
return false;
} else {
return true;
}
}
funct... | true |
25c08849a62addbe8026b01d8a4498b84b3f21bb | JavaScript | SitharthanLearning/Sithu-NodeJS-Express-LocalServer-API | /routes/index.js | UTF-8 | 4,695 | 2.828125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var fs = require("fs");
var path = require('path');
var moment = require('moment');
var sampleObject = [];
var AllDates = [];
var buildCount = -1;
/* GET home page. */
router.get('/', function(req, res, next) {
// console.log("Current date is ",new Dat... | true |
54f5ffea27051575265b82db531d038abc2e0fe2 | JavaScript | annmirosh/researches-FoodTracker | /src/common/ingestion.service.spec.js | UTF-8 | 1,589 | 2.640625 | 3 | [] | no_license | (function () {
'use strict';
describe('IngestionService:', function () {
var ingestionService = null,
dateTimeService = null;
beforeEach(function () {
module('app');
module('ingestion.service');
});
beforeEach(inject(function (_IngestionService_, _DateTimeService_) {
inges... | true |
b765de8e8e40dc87e19fe459053d2eff10659dd2 | JavaScript | Covisint/cui-i18n | /generator.js | UTF-8 | 2,845 | 2.59375 | 3 | [] | no_license | var fs = require('fs');
module.exports = {
parseOverrides: function(parsedResponse,overrideParsedResponse,languageCodes){
var tempObject=parsedResponse;
var overrideKeys=Object.keys(overrideParsedResponse[languageCodes[0]]);
overrideKeys.forEach(function(overrideKey){
languageCodes.forEach(function... | true |
97f739c73c8dd097fe8ac86030fd7ce8d0ce78ad | JavaScript | thatoneguyadf/cohort-project | /loopingNumbers/js/apps.js | UTF-8 | 598 | 4.09375 | 4 | [] | no_license | var btn = document.getElementById("btn");
btn.addEventListener("click", numberLoop);
function numberLoop() {
var start = prompt("Please enter a number to start the loop.");
var end = prompt("Please enter a number to end the loop.");
start = parseInt(start);
end = parseInt(end);
if(isNaN(start) || isNaN(end)) {
... | true |
59ed7fa2ab9f6763e86bce2829ca194247022501 | JavaScript | TikoCisneros/rn-incidents | /src/common/util.js | UTF-8 | 581 | 2.671875 | 3 | [] | no_license | import { Dimensions } from 'react-native';
const getDeviceHeight = () => Dimensions.get('window').height;
const getDeviceWidth = () => Dimensions.get('window').width;
const isValid = (value) => value !== null && value !== undefined;
const isFunction = (value) => isValid(value) && typeof value === 'function';
const... | true |
46e053fd7f012a83d5a28a82035521400bc1c8e0 | JavaScript | zzVIPz/schedule | /src/utils/getEventColor.js | UTF-8 | 444 | 2.875 | 3 | [] | no_license | /**
* Returns the pre-computed color
* @param {Array} palette - color presets
* @param {(Array|string)} type - event type
* @param {boolean} mode - event mode
* @returns {string} event color
*/
const getEventColor = (palette, type, mode) => {
const formattedType = Array.isArray(type) ? type[0] : type;
if (mo... | true |
6b900e31a83e48daec22c5f4c87435d72c95a100 | JavaScript | zachfey/Scheduler | /client/src/components/WeekSchedule/weekSchedule.js | UTF-8 | 5,549 | 2.609375 | 3 | [] | no_license | import React, { Component } from "react";
import RowData from '../RowData';
import { Container, Row, Col } from 'react-bootstrap';
import API from '../../utils/API'
// import '../table.css';
// import { createBrotliCompress } from "zlib";
const moment = require('moment')
const dayArray = ['Monday', 'Tuesday', 'Wednesd... | true |
feeb57fb607c4977ee41ce95208576a1ba155662 | JavaScript | tcampestrini/uojs | /_back/map.js | UTF-8 | 11,833 | 2.53125 | 3 | [] | no_license | const { resolve, basename } = require('path');
const { openSync, statSync, readFileSync, writeFileSync } = require('fs');
class BinReader {
constructor(options) {
// @TODO: check file
this.buffer = readFileSync(options.file);
}
set buffer(buffer) {
this._buffer = buffer;
}
... | true |
8c66fa0d289ac483dc124a08e4659136d290554c | JavaScript | HugTheBug/practice2018 | /server/models/post.js | UTF-8 | 6,440 | 2.921875 | 3 | [] | no_license | let post = (function () {
const fs = require('fs');
const path = require('path');
const dataPath = path.join(__dirname, '../data', 'posts.json');
let self = {};
function readPosts() {
let posts = JSON.parse(fs.readFileSync(dataPath, 'utf-8'));
posts.forEach((value, index, ar) => ar... | true |
444e0a4739f153873a3668e807f3e53797439aab | JavaScript | klaus580925/MyFrontEndCode | /JavaScript/Exercises/20180907_01_prototype.js | UTF-8 | 1,642 | 4.25 | 4 | [] | no_license | function Person(name, age) {
this.name = name;
this.age = age;
}
Person.prototype.toString = function() {
return '[' + this.name + ', ' + this.age + ']';
};
var p1 = new Person('Klaus', 12);
console.log(p1.toString());
console.log(p1 instanceof Person);
console.log(Person.prototype === Object.getPrototypeOf(p1));... | true |
599cb12a50b09dbc06815d8260aedc55cc2f69f0 | JavaScript | aspahixa/xd | /commands/pay.js | UTF-8 | 2,312 | 2.734375 | 3 | [] | no_license | const Discord = require("discord.js");
const db = require("quick.db");
const ms = require("parse-ms");
module.exports.run = async (client, message, args) => {
let user = message.mentions.users.first();
let money = await db.fetch(`money_${message.guild.id}_${message.author.id}`);
let embed1 = new Discord.Mess... | true |
4fa3a6b8a9e1f9f197720cf311647d87c1cc9c00 | JavaScript | green-fox-academy/hojpaat | /week-08/day-01/clickOnce/app.js | UTF-8 | 530 | 2.9375 | 3 | [] | no_license | 'use strict';
document.addEventListener('DOMContentLoaded', () => {
let button = document.querySelector('button');
//solution1
/*button.addEventListener('click', () => {
console.log(Date());
button.setAttribute('disabled', 'true');
})*/
//solution2
button.addEventListener('click', (e) => {
let ... | true |
5b40fbff6706983fc6ef59f41048dfb61ce0af17 | JavaScript | thgus1247/exercise | /assets/js/common.js | UTF-8 | 1,132 | 2.640625 | 3 | [] | no_license | /*common*/
var leftMenu = {
//오류시 메세지
message: false,
//이벤트를 바인딩한다.
doBind: function() {
var p = this;
p.setMenu();
},
//메뉴 생성
setMenu: function(event) {
var thisElm = $("#left-menu");
if(!thisElm... | true |
c1ea292b386041845838a9c0cc2d32d313387439 | JavaScript | harkaran3009/ShoppingSite | /javascript/validationSigin.js | UTF-8 | 1,507 | 2.875 | 3 | [] | no_license |
$(document).ready(function(){
$("#logIn").click(function () {
var temp = validateForm();
if(temp == false)
{
return false;
}
else
{
ajaxPostData();
}
});
});
function validateForm() {
var emailValue = $("input[name='email']").val();
v... | true |
0bcc07aa95938d61a72095ac85cab84b4caf6d9e | JavaScript | The-Monkeys-and-MAUD/MonkeyBot-Pi | /hubot-scripts/run.js | UTF-8 | 1,432 | 2.53125 | 3 | [] | no_license | // Description:
// Runs a command on hubot
// TOTAL VIOLATION of any and all security!
//
// Commands:
// hubot run <command> - runs a command on hubot host
module.exports = function(robot) {
// Blink
robot.respond("/blink/i", function(msg) {
console.log(msg);
var cmd = '/home/pi/MonkeyBot-Pi/Blinky/bli... | true |
9004af760df45ede38e4c4d739d2d9391566dfb9 | JavaScript | mbwhite/chaincode-commericalpaper | /contracts/javascript/lib/utils.js | UTF-8 | 807 | 2.921875 | 3 | [
"ISC",
"Apache-2.0"
] | permissive | /*
SPDX-License-Identifier: Apache-2.0
*/
'use strict';
/**
* Utility class for data, object mapulation, e.g. serialization
*/
class Utils {
/**
* Convert object to buffer containing JSON data serialization
* Typically used before putState() ledger API
* @param {Object} object object to seria... | true |
5a78f7516423b88f35605cc2d06f871be81c6d52 | JavaScript | DryFlyRyan/workshop-daily-programmer | /11_diagonalSum/solutions/IL.js | UTF-8 | 134 | 2.859375 | 3 | [] | no_license | function diagonalSum(array) {
final = 0;
for (i=0;i<array.length;i++) {
final += array[i][i]
}
return final
}
| true |
6deb21db830160fe3fd728af9b5d2856b915cda5 | JavaScript | ext0404/byndyusoft | /byndyusoft.js | UTF-8 | 906 | 3.6875 | 4 | [] | no_license | let result = 0;
function getMin(arr){
if(arr == !Array | Infinity){ //Проверяем на пустоту и бесконечность
return 0;
}
else if(arr.some(isNaN)){ //Проверяем, что массив из чисел
return 0;
}
else{
let arrLen = arr.length;
let minEl = arr[0];
for (var i = 0; i < arrLen; i... | true |
b587e06edf6f21a85b15618d65e65afc5980f57d | JavaScript | shayd3/twitch-filtered-chat | /commands.js | UTF-8 | 33,986 | 2.875 | 3 | [
"BSD-2-Clause"
] | permissive | /* Twitch Filtered Chat Commands */
"use strict";
/** Chat Commands
*
* Adding a chat command:
* ChatCommands.add(command, function, description, args...)
* command (string) chat command to add, executed via //command
* function a function taking the following arguments
* cmd the command... | true |
d7e91b7e2f1897787acabca390d45c92a31e298b | JavaScript | kennon/Accrete.js | /src/DoleParams.js | UTF-8 | 2,641 | 2.890625 | 3 | [] | no_license | var DoleParams = Object.create({
B: 1.2e-5, // For critical mass
K: 50, // Dust/gas ratio
dustDensityCoeff : 1.5e-3, // A in Dole's paper
cloudEccentricity: 0.25,
eccentricityCoeff: 0.077,
// ALPHA and N both used in density calculations
ALPHA: 5,
N: 3,
criticalMass: function(radius, eccentrici... | true |
71b95ac45156f937bc3a63ce7c58b5999b84132a | JavaScript | albiurs/edu_codecademy_full-stack-engineer | /src/02_learn_javascript/01_introduction_to_javascript__data_types__string__Math__Date/string/string.replace.js | UTF-8 | 1,158 | 4.46875 | 4 | [] | no_license | // String.prototype.replace()
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
// The replace() method returns a new string with some or all matches of a pattern replaced by a replacement. The
// pattern can be a string or a RegExp, and the replacement can be a string... | true |
54dd2dd7e232691304e3b3ab99ff17fd33b6cb47 | JavaScript | haench/haenchs-planner-google-tasks-API | /src/stores/eventStore.js | UTF-8 | 3,817 | 2.59375 | 3 | [] | no_license | import { createRef } from "react";
import { store } from "react-easy-state";
import gCalApi from "utils/gCalApi";
import {
parse,
differenceInCalendarDays,
eachDay,
isSameDay,
isFirstDayOfMonth,
isLastDayOfMonth,
isMonday,
startOfWeek,
addWeeks
} from "date-fns";
const eventStore = store({
calenda... | true |
f0791f621f95a6d943fac1bb1c450ec990b9b0a9 | JavaScript | kevinbarabash/live-proxy | /test/sandbox_spec.js | UTF-8 | 1,987 | 2.75 | 3 | [] | no_license | const assert = require('assert');
const { handleUpdate } = require('../src/live-proxy');
const { getCode } = require('./helpers');
describe('Sandboxing', () => {
describe('.toString()', () => {
it('should work on functions', () => {
const context = handleUpdate(getCode(() => {
... | true |
ff728da8acd43e8b9a16e874194d671b56f528b6 | JavaScript | pedromaxado/simons | /src/run.js | UTF-8 | 695 | 2.734375 | 3 | [
"MIT"
] | permissive | const bandeco = require('./bandeco')
const calendar = require('./calendar')
const dolar = require('./dolar')
const euro = require('./euro')
const twitter = require('./twitter')
const weather = require('./weather')
function parserRunner(text) {
return async parser => {
try {
return await parser(text)
} catch (e... | true |
f8ba3ba5abf4994cd52842656e8df357e8d9570b | JavaScript | YadharthGC/todoreact | /src/App.js | UTF-8 | 2,937 | 2.75 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import axios from "axios";
import "./App.css";
function App() {
const [list, setlist] = useState([]);
const [task, settask] = useState([]);
useEffect(async () => {
fetch();
}, []);
let fetch = async () => {
try {
let products = await axios.g... | true |
ca6ba246687a24469701d23984fa3ed19ed9d2ce | JavaScript | jangsohee/Breadcrumb-server | /server/components/mongoose/lib/schema/number.js | UTF-8 | 2,095 | 2.53125 | 3 | [
"MIT"
] | permissive | /*!
* Module requirements.
*/
var mongoose = require('mongoose'),
SchemaNumber = mongoose.SchemaTypes.Number,
SchemaType = require('../schematype'),
CastError = SchemaType.CastError,
Document;
/**
* Casts to number
*
* @param {Object} value value to cast
* @param {Document} doc document that tri... | true |
72866b6d21f7810a885d70c18145764890f7de95 | JavaScript | ZJingW/vuex-todo | /src/store/index.js | UTF-8 | 1,789 | 2.578125 | 3 | [] | no_license | import Vue from 'vue'
import Vuex from 'vuex'
import axios from 'axios' //异步操作
Vue.use(Vuex)
export default new Vuex.Store({
state: {
//所有的任务列表
list:[],
//文本框的内容
inputValue:'aaa',
//下一个id
nextId:5,
str :'all'
},
mutations: {
initList(state,a){
state.list = a
},
/... | true |
10981f888bbe60e2dadd847b2524d33a9c5436e3 | JavaScript | ngabello/sampleSite1.x | /app/scripts/services/quotes/vehicleService.js | UTF-8 | 7,421 | 2.515625 | 3 | [] | no_license | /**
* Created by gabello on 12/9/2015.
*/
function VehicleService() {
'use strict';
var getVinIsoYears = function (vinIsoDataService) {
return vinIsoDataService.getVinIsoYears();
};
var getVehicleAssignments = function(quoteData){
var vehicles = quoteData.getVehicles();
var collection = [];
... | true |
dce25ad1218d5ce27c5e7d384b75948b098c3985 | JavaScript | shernshiou/backflippy | /chrome/lib/fsecure/FsioTicket.js | UTF-8 | 3,724 | 2.546875 | 3 | [] | no_license | define(["FsioBase"], function(FsioBase) {
/**
* @fileOverview
*
* FSIO Ticket API.
*/
FsioTicket.prototype = new FsioBase(); // inherit
FsioTicket.prototype.constructor = FsioTicket;
/**
* @class
* @name FsioTicket
* @augments FsioBase
* @see Fsio#ticket
*... | true |
722b5e89a6ebd9b6c0a772a1a1fa07140f73eac0 | JavaScript | Tsuguya/gulp-sugar-srcset | /test/picture.js | UTF-8 | 15,610 | 2.71875 | 3 | [
"MIT"
] | permissive | const test = require('tape');
const main = require('../lib/main');
const options = require('../lib/options');
const pfx = '[picture]';
const case1 = options();
const case2 = options({
replace: {
large: '(min-width: 1000px)',
medium: '(min-width: 800px)'
}
});
const case3 = options({
sourceSrc: false
});... | true |
81918bb078f87cb91650203646a4f7c637737c8d | JavaScript | Lyndeno/smashbrowse | /src/client/input.js | UTF-8 | 2,493 | 3.21875 | 3 | [] | no_license | // Learn more about this file at:
// https://victorzhou.com/blog/build-an-io-game-part-1/#6-client-input-%EF%B8%8F
import { updateSpeed, upFloor, downFloor } from './networking';
function onKeyUp(e) {
const speed = 0;
updateSpeed(speed);
// console.log("OnKeyInput!");
// var code = e.which || e.keyCode;
// c... | true |
26c9de83cf3657248029f59c4115d927a76573b6 | JavaScript | jchavez3019/cv | /jqueryPractice.js | UTF-8 | 788 | 2.953125 | 3 | [] | no_license | $("h1").addClass("big-title");
$("h1").text("bye");
$("button").html("<em>Hey</em>");
$("button").text("bye");
$("a").attr("href", "https://www.google.com");
$("h1").click(function() {
$("h1").css("color", "purple")
});
$("button").click(function() {
// $("h1").toggle();
// $("h1").fadeTog... | true |
d3f36397e044b6fe5138d578e8085b5c2fe43ab2 | JavaScript | paulagrata/map-data-game | /map-mania.js | UTF-8 | 3,876 | 2.890625 | 3 | [
"MIT"
] | permissive | var gMap;
var i = 0;
var favoritePlaces = [
{content:"Chicago, Illinois",lat:41.878113,lng:-87.629799},
{content:"New York, New York",lat:40.7128,lng:-74.0060},
{content:"Las Vegas, Nevada",lat:36.1699,lng:-115.1398},
{content:"Montgomery, Alabama",lat:32.3792,lng:-86.3077},
{content:"Orange County... | true |
552059971094489bca7a6c417b15055ad4bcb330 | JavaScript | Natannegara/Refactory-MuhammadFitranatanegara-Frontend | /soal_keempat.js | UTF-8 | 1,129 | 4.3125 | 4 | [] | no_license | // creating 1000 number consecutively
const list_number = []
for (var i = 1; i <= 1000; i++) {
list_number.push(i)
}
// selecting "even" and "odd" numbers directly
const even_number = []
const odd_number = []
list_number.map(v => {
if (v % 2 == 0) even_number.push(v)
else odd_number.push(v)
})
// selectin... | true |
a3925856b5478042963321dcb10db6d0e977d7dd | JavaScript | lukasz-kapica/metronome | /src/components/Rhythm.js | UTF-8 | 607 | 2.640625 | 3 | [] | no_license | import React from "react";
const range = (from, to) => {
if (from > to) {
return [];
}
const xs = new Array(to - from + 1);
for (let i = 0; i < xs.length; i++) {
xs[i] = from + i;
}
return xs;
};
const Rhythm = ({ count, beats }) => {
const Circle = ({ active }) => (
<div
className={`h... | true |
88a16ac84cfce3f9c10ca0177d1341b5a106aec5 | JavaScript | elgubbo/gallery_demo | /angular/services/image.service.js | UTF-8 | 2,947 | 2.625 | 3 | [] | no_license | export class ImageService{
constructor(API, ToastService, $q){
'ngInject';
this.API = API;
this.unpartitionedImages = [];
this.userImages = [];
this.ToastService = ToastService;
this.$q = $q;
}
deleteImage(image) {
return this.$q((resolve, reject) => {
if (!angular.isObject(ima... | true |
c6d1babd9afbcf2bef41d0b0987860438d1af5f6 | JavaScript | acoderleex/movies | /react/reducers/home.js | UTF-8 | 851 | 2.515625 | 3 | [] | no_license | 'use strict';
import type { Action } from '../actions/types';
import type { HomeModel } from '../model/home';
export type State = {
isLoading: bool;
isRefreshing: bool;
data: HomeModel;
};
const initial : State = {
isLoading: false,
isRefreshing: false,
data: null
};
function home(state: State=ini... | true |
ba0bcdac0898b1ecb2232939582857351395448d | JavaScript | ferVargasB/vuira2.5 | /app_tramite_assets/js/form_captura_tramite.js | UTF-8 | 3,689 | 2.609375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | $(document).ready(function(){
console.log("YEAHH");
$("#main_form").on("submit", function(e){
e.preventDefault();
var datos = new FormData(document.getElementById("main_form"));
Swal.fire({
title: '¿Estás Seguro?',
text: "Verifica tus datos antes de guardarlos",
... | true |
cc09621a6e43057371ea094ddcd497c02d63c682 | JavaScript | bannerlegal/bannerlegal.github.io | /xlsxMerge/main.js | UTF-8 | 2,201 | 2.609375 | 3 | [] | no_license | const main = function () {
setUpWindowListeners();
setUpRunButton();
setWindowVarHolder();
setUpInputEles();
}
function setUpWindowListeners() {
window.addEventListener("objsRdy", objectsAreReady);
}
function setUpRunButton() {
_$("#runButton")[0].addEventListener("click", runButtonClicked);
... | true |
256130c13778867a2faf7bf7e79b1db64b83099a | JavaScript | mpvcenfo/schoolshop | /public/js/controlador-login.js | UTF-8 | 2,111 | 2.875 | 3 | [
"MIT"
] | permissive | cerrarSesion()
let txtEmail = document.querySelector('#txtEmail');
let txtPassword = document.querySelector('#txtPassword');
let btnLogin = document.querySelector('#btnLogin');
let divMensaje = document.querySelector('#divMensaje');
btnLogin.addEventListener('click', validarFormulario);
function validarFormulario() ... | true |
d635a1d59ec4e582902a990cd63aa659c214e6f4 | JavaScript | osaichuk/3101_Frontend | /hw2602/05/05.js | UTF-8 | 194 | 3.5 | 4 | [] | no_license | var firstNumber = prompt('Введите первую цифру');
var secondNumber = prompt('Введите вторую цифру');
var result = +firstNumber + +secondNumber; alert(result); | true |
cde95ce04e446df2577777961b452f3e2d9fb701 | JavaScript | tingjiangjiang/work-study | /node.js/node.js/day11/express_baofeng_new/express_baofeng/public/js/banner.js | UTF-8 | 2,491 | 2.90625 | 3 | [] | no_license | // 自执行函数,避免全局变量与其他js文件的变量冲突
(function(){
var nav = tools.getById('nav');
var lis = tools.getByTag(nav,'li');
var banner = tools.getById('banner');
var imgList = tools.getByClass(banner,'img-list')[0];
var imgs = tools.getByTag(imgList,'li'); //获取到的li
var btnPrev = tools.getByClass(banner,'btn-p... | true |
b48ae94c11836dc0503ef2328ee84d0665ce4240 | JavaScript | lasse1900/someJavaScript | /oop/hangman_start.js | UTF-8 | 299 | 3.6875 | 4 | [] | no_license | const Hangman = function(puzzleWord, remainingGuesses){
this.puzzleWord = puzzleWord
this.remainingGuesses = remainingGuesses
}
const game1 = new Hangman('Lasse', 4)
const game2 = new Hangman('Tim', 3)
let name = 'Tim'
console.log(name.toLowerCase())
console.log(game1)
console.log(game2) | true |
9f5067542da7de3897393324be9f1f12bf655be6 | JavaScript | kelgwiin/twiss-app | /app-post.js | UTF-8 | 1,996 | 2.65625 | 3 | [
"MIT"
] | permissive | var Scheduler = require('node-schedule');
var Googl = require('goo.gl');
var Twitter = require('twitter');
var mySettings = require('./settings.json');
var DBUtils = require('./mongodb-utils');
//Settings Google
Googl.setKey(mySettings.google.googlAPIKey);
var twitterPoster = new TwitterPoster();
//Main
if(mySettings... | true |
31dfa43e34668cbe647c9459c8b8f1e4d94ca1f1 | JavaScript | giantjs/giant-cli-tools | /src/CliArgument.def.js | UTF-8 | 1,966 | 2.6875 | 3 | [] | no_license | $oop.postpone($cliTools, 'CliArgument', function () {
"use strict";
var base = $oop.Base,
self = base.extend();
/**
* @name $cliTools.CliArgument.create
* @function
* @param {string} [argumentStr]
* @returns {$cliTools.CliArgument}
*/
/**
* Represents a single ar... | true |
50632c7f430983408c1018f30588ad7715454940 | JavaScript | dattadebajyoti/Deba | /graphQl/mutationOperations.js | UTF-8 | 2,793 | 2.625 | 3 | [] | no_license | // requiring all the necessary modules
var express = require('express');
var graphqlHTTP = require('express-graphql');
var {
buildSchema
} = require('graphql');
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://localhost:27017/mydb";
var ObjectId = require('mongodb').ObjectID;
//connecting to th... | true |
f771d191f7e5d4bad2c459372d9c4c3b0a1af674 | JavaScript | FHAFnie/mythird | /code/three/三阶段/my-react9/src/scripts/react-redux/views/counter.js | UTF-8 | 1,091 | 2.71875 | 3 | [] | no_license |
// 通过 UI 组件 生成 容器组件
import { connect } from "react-redux";
import ReactReduxDemoUI from "./index";
import { increment, changeCity } from "../actions";
// 建立 容器 组件 state 到 UI 组件的 props 的映射
// mapStateToProps会订阅 Store,每当state更新的时候,就会自动执行,
// 重新计算 UI 组件的参数,从而触发 UI 组件的重新渲染
const mapStateToProps = (state) => { // st... | true |
a35685b767cd157132e4066b24e8633e9a131f9b | JavaScript | nayangogoi744/type-checking | /src/App.js | UTF-8 | 420 | 2.5625 | 3 | [] | no_license | import React, { Component } from "react"
import Pt from "prop-types";
class App extends Component{
render(){
return(
<div>
<h1>
Hello: {this.props.name}
</h1>
<h2>
Roll: {this.props.roll}
</h2>
<h3>Accessing children: {this.props.children}</h3>
</div>
);
... | true |
2159d3a7ba6c63d66e52b8895643721d55b49192 | JavaScript | ImSamin/basic-assignment-JS | /assignment.js | UTF-8 | 1,665 | 4 | 4 | [] | no_license | /* Feet to Miles Assignment
********************************************/
function feetToMile (feet){
var mile = feet / 5280;
return mile;
}
var result = feetToMile(3000000);
console.log(result + ' miles');
/* Wood Calculator Assignment
*******************************************/
function woodCalculator(... | true |
528d4f88cbf282cc48de785fcf0f58b71d36edfe | JavaScript | stm32p103/raspberrypies | /trigger/index.js | UTF-8 | 1,069 | 2.859375 | 3 | [] | no_license | const http = require( 'http' );
const spawn = require('child_process').spawn;
const header = { 'Content-Type': 'text/plain' };
// git pullする。spawnは spawn( 'git pull' )してはならない。エラーになる。
function executePull() {
const prc = spawn( 'git', [ 'pull' ] );
prc.stdout.setEncoding( 'utf8' );
prc.stderr.setEncoding( 'u... | true |
e29102449f9f3c5d2a1dc81d061d8e62085ce0fa | JavaScript | jkdoshi/fx4web | /toolkit/src/com/doshiland/fx4web/resource/conversation.js | UTF-8 | 2,813 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2006 Jitesh Doshi
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law o... | true |
bc8656f6ef728b28c5b5b625d21918a91ddb8f87 | JavaScript | shouryamittal/jobfinder | /client/src/utils/formValidator.js | UTF-8 | 1,002 | 2.953125 | 3 | [] | no_license | function validateForm(fields) {
let errs = {};
for(let field in fields) {
if(fields.hasOwnProperty(field)) {
if(fields[field] === '') {
errs[field] = `This field can't be empty`;
}
if(field === "email") {
let email = fields... | true |
05386adc791b98f36b3e8c68c1d2c81283fc06b4 | JavaScript | abhinav290/elect-2019-viz | /src/components/maps/VoteMap/index.js | UTF-8 | 4,357 | 2.5625 | 3 | [] | no_license | import React from "react";
import * as d3 from 'd3'
import * as topojson from 'topojson'
import * as utils from "../../../utils/consts";
class VotingMap extends React.Component {
geoData="/Indian_States.json"
state = {
countryData: null,
}
static defaultProps = {
width: 800,
... | true |
e25b35dcb349bec0dd1815c8f7afa48c7d4b8e92 | JavaScript | danyalsajid/Highcharts-boilerplate | /index.js | UTF-8 | 1,693 | 2.515625 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", () => {
const chart = Highcharts.chart("container", {
chart: {
type: "areaspline",
zoomType: "xy",
},
credits: {
// enabled: false,
text: "My custom chart",
href: "https://google.com",
position: {
align: "left",
... | true |
26b67dd70ea4e76b9de8584b87e1d37437cd43f8 | JavaScript | AndrewSushket/experimental | /src/flocking/2.js | UTF-8 | 3,518 | 2.625 | 3 | [] | no_license | import SimplexNoise from 'simplex-noise';
import * as THREE from 'three';
import * as Recorder from '../recorder';
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';
import { UnrealBloomPass } from 'three/e... | true |
24fc5d370c3f3e480a9aa10faa66eb1e16a82344 | JavaScript | ccpromise/Code-Log | /Leetcode/JS/143.js | UTF-8 | 587 | 3.078125 | 3 | [] | no_license | var ListNode = function(val) {
this.val = val;
this.next = next;
};
var reorder = function(head) {
if(head === null || head.next === null)
{
return;
}
var pre = null;
var s = head;
var f = head;
while(f !== null && f.next !== null)
{
pre = s;
s = s.next;
f = f.next.next;
}
pre.next = null;
pre =... | true |
2bd72d06ed64e9e1d716efc323c6f453b771e431 | JavaScript | Bendernnm/nodejs-certification-jsnad | /docs/buffer/character-encodings.js | UTF-8 | 212 | 2.734375 | 3 | [] | no_license | const buf = Buffer.from('hello world', 'utf8');
console.log(buf.toString('hex'));
console.log(buf.toString('base64'));
console.log(Buffer.from('qwerty', 'utf8'));
console.log(Buffer.from('qwerty', 'utf16le'));
| true |
9b6754c338cc4bc940a9d27c5a471f4a89f86faf | JavaScript | dancomanlive/webworker | /public/worker.js | UTF-8 | 887 | 3.296875 | 3 | [] | no_license | const array = []
let limit = 10
onmessage = event => {
if(event.data.limit) {
limit = event.data.limit
}
if (event.data.randomNr) {
compute()
}
function binaryInsert(x, array) {
let l = 0,
r = array.length - 1,
m;
while (l <= r) {
m = (l + r) / 2 | 0;
if (array[m] ... | true |
ce724d2baaecb0b93f8283fcdaa369de1a0ba739 | JavaScript | Natoons/Epitech-Pools | /Pool Web/Day06/tester.js | UTF-8 | 1,304 | 3.265625 | 3 | [] | no_license | const exercise01 = require('./exercise01');
const exercise02 = require('./exercise02');
const exercise03 = require('./exercise03');
const exercise04 = require('./exercise04');
const exercise05 = require('./exercise05');
const exercise06 = require('./exercise06');
const exercise07 = require('./exercise07');
// exercis... | true |
17223913c5db6d2d5117a77d5f42f5c9f024defe | JavaScript | angeal185/jquery-prompt | /demo/index.js | UTF-8 | 585 | 2.859375 | 3 | [
"MIT"
] | permissive | //demo
// set global prompt string defaults
$.xPrompt.defaults = {
placeholder: "test",
error: "error"
};
// set global prompt boolean defaults
$.xPromptQ.defaults = {
speed: 'slow'
};
//prompt string
$('.ptest').on('click', function(){
$.xPrompt({header: 'header', placeholder: 'enter text'}, function(i){
... | true |
39ffc7fee596dc83cc2dc19722767abd5d47e90d | JavaScript | yangxin1994/js-component-education | /src/utils/filters.js | UTF-8 | 635 | 2.84375 | 3 | [] | no_license | const sortData = (data, value) => {
switch(value) {
case '人气排序':
return data.sort((a, b) => b.orderNum - a.orderNum);
break;
case '价格最低':
return data.sort((a, b) => a.price - b.price);
break;
case '价格最高':
return data.sort((a, b) => b.price - a.price);
... | true |
085542b66344705e0293d47ec0f802894922bc7d | JavaScript | sociomantic-tsunami/nessie-ui | /src/Slider/driver.js | UTF-8 | 3,311 | 2.65625 | 3 | [
"MIT"
] | permissive | /*
* Copyright (c) 2018 dunnhumby Germany GmbH.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the LICENSE file
* in the root directory of this source tree.
*
*/
const ERR = {
SLIDER_ERR : ( label, action, state ) =>
`Slider ${label ? `'${label}'` : ''} cannot... | true |
f0b16e20d59bec04d17e31f1d319ec75d017ff72 | JavaScript | Kaydrae/Dashboard | /Old/Untitled-3/js/index.js | UTF-8 | 468 | 2.53125 | 3 | [] | no_license | document.addEvent('domready', function(){
var _wheel = $('wheel');
$$('a').addEvent('click', function(){
if (!this.hasClass('selected')) {
$$('a.selected').removeClass('selected');
var that = this;
that.addClass('selected');
_wheel.erase('class');
setTimeout(function... | true |
0d06c7bc992aace3963ef512bf2f31d729584717 | JavaScript | samwaree/spike-exercise | /server/models/Course.js | UTF-8 | 1,779 | 2.515625 | 3 | [] | no_license | const mongoose = require('mongoose')
let CourseSchema = new mongoose.Schema({
name: {type: String, required: true},
semester: {type: String},
gpa: {type: Number, default: 0},
assignments: [{type: mongoose.Schema.Types.ObjectId, ref: 'Assignment'}],
comments: [{type: mongoose.Schema.Types.ObjectId, ... | true |
70175ca2bf6e4c244b11dc3f523f87bc97504a64 | JavaScript | yboodhan/JS-Basic-Loops | /excitedKitten.js | UTF-8 | 410 | 3.390625 | 3 | [] | no_license | let i = 1;
let catTalk = {
1 : "...human...why you taking pictures of me?...",
2 : "...the catnip made me do it...",
3 : "meow?",
4 : "...why does the red dot always get away..."
}
while (i <= 10) {
if (i % 2 ==0) {
let key = Math.floor(Math.random() * 4 + 1);
console.log(key, catT... | true |
c5118a1d8c3738822bee9573f6185c9786ec1b68 | JavaScript | vituhugo/react-components-init | /src/components/AppInput.js | UTF-8 | 646 | 3.03125 | 3 | [] | no_license | import React, { useState } from 'react';
function AppInput() {
let [state, setState] = useState({
texto: "banana",
texto_2: "uva"
})
let handleInput = event => {
setState({
...state,
[event.target.name]: event.target.value
});
}
return (
... | true |
d97ea7fcee3ead051755941cd2b787cc0c047327 | JavaScript | JoshuaMVitullo/DivCalendar | /assets/js/displayTask.js | UTF-8 | 9,100 | 3.015625 | 3 | [] | no_license | /* Height offset created by expansion of previous employee row */
let heightOffset = 0;
/* Object to hold task info for displaying */
function taskInfo(taskDiv, empRow, empName, start, end, height, length) {
this.taskDiv = taskDiv;
this.empRow = empRow;
this.empName = empName
this.start = start... | true |
4054d4a5e8f81ec475d8fcc4308dedbfd87b640d | JavaScript | aoxrud/alexoxrud.com | /src/index.js | UTF-8 | 1,987 | 2.765625 | 3 | [] | no_license | const init = () => {
const imageContainers = document.querySelectorAll('.project-image-container');
const viewportHeight = document.documentElement.clientHeight;
imageContainers.forEach(imageContainer => {
const imagePosY = imageContainer.offsetTop;
if(imagePosY > viewportHeight) {
imageContainer... | true |
90df9363b7ddf60a3b903a17e52b6cb66d6e3892 | JavaScript | vishnu2255/Foodapp | /public/js/mapscript.js | UTF-8 | 3,402 | 2.6875 | 3 | [
"MIT"
] | permissive |
$(document).ready(function()
{
alert("test");
var map;
var mylatlng;
var lat;
var lon ,frm,tolat,tolon ;
var dirDis = new google.maps.DirectionsRenderer();
var dirSer = new google.maps.DirectionsService();
$.post('/maps',{id:1,'_token': $('input[name=_token]').val()},function(data){
... | true |
535dfb257b7f0304e8b501efdb1ea80207f9d24d | JavaScript | JinWangQ/MyLeetcode | /src/405ConvertaNumbertoHexadecimal/src.js | UTF-8 | 751 | 3.59375 | 4 | [] | no_license | /**
* @param {number} num
* @return {string}
*/
var toHex = function (num) {
if (num === 0) return "0";
let res = "";
if (num > 0) {
let dic = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", "d", "e", "f"];
if (num < 16) return dic[num] + "";
let left = ~~(num / 16);
let ri... | true |
2fc205be0d0a19ea792b50d8b7fdeb4bb027389d | JavaScript | kusshi/chat | /public/room_create.js | UTF-8 | 3,845 | 2.859375 | 3 | [] | no_license | window.addEventListener('load', () => {
let form = document.getElementById('form');
let chatroom_name = document.getElementById('chatroom_name');
let chatrooms = document.getElementById('chatrooms');
let remove_room_button = document.getElementById('remove_room_button');
remove_room_button.addEvent... | true |