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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0642fbaf11307b2643c0354bcf3235b8ce7d267f | JavaScript | wyy000/item | /js/Score.js | UTF-8 | 212 | 2.546875 | 3 | [] | no_license | function Score(imgArr, picArr, x, y) {
this.index = 0;
this.imgArr=imgArr;
this.pic=picArr[0];
this.pic1=picArr[1];
this.pic2=picArr[2];
this.x = x;
this.y = y;
}
Score.prototype.change = function() {
} | true |
29897571f6a95845caa714447fd30266a105955b | JavaScript | VaibhavKakade/js | /node/example/client.js | UTF-8 | 454 | 2.8125 | 3 | [] | no_license | var net = require('net');
var connection = net.createConnection({
port: '8787',
host: '127.0.0.1'
}, function () {
console.log("connected successfully");
this.write('Hello');
});
connection.on('data', function (data) {
console.log("client received = ", data.toString());
});
connection.o... | true |
c069af88978da8050bc2e1f9512acd08011a5e24 | JavaScript | rraj13/data-persistent-to-do-list | /controllers/todo_controller.js | UTF-8 | 1,493 | 2.890625 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const todo = require("../models/todo.js");
//display all todos on load
router.get("/", function(req, res) {
todo.displayAll(function(data) {
var hbsObject = {
todo: data
};
res.render("index", hbsO... | true |
4c2d67eaf645a33c96a1e8c04d68ca3d9a02589a | JavaScript | isaac-gorman/notes-server-side-routing-express | /notes/basic-routing-express.js | UTF-8 | 946 | 3.296875 | 3 | [
"MIT"
] | permissive | // Learning Topic:
// - Basic Routing
// Q: What is routing?
// - Routing is about how the server respondes to a clienst request based on particular endpoints, which is known as a URL (or path) and a specific HTTP request method such as (GET, POST, PUT, DELETE and so on ...)
// Q: How many handler function can each... | true |
e8987bbce74c2c44fee89faef24035edda7861a9 | JavaScript | davidthemavid/WDCT-FA2019 | /week-three/day-four/javascript-tutorial/scripts/objectsAndArrays.js | UTF-8 | 917 | 3.578125 | 4 | [] | no_license | var arrayOne = [1, 2, "a", "b"];
var arrayTwo = [1, 2, "a", "b"];
// true
// console.log("arrayOne == arrayTwo?", arrayOne == arrayTwo);
// true
// console.log("arrayOne === arrayTwo?(strict)", arrayOne === arrayTwo);
var studentOne = {
firstName: "Noor",
course: "Web Dev"
};
var studentTwo = {
firstName: "No... | true |
1d5e081d8b17b4431478d8d854cbbf1c86040067 | JavaScript | pktippa/hr-tutorials | /30-days-of-code/day-7-arrays/nodejs/arrays.js | UTF-8 | 926 | 3.703125 | 4 | [
"MIT"
] | permissive | // Code for reading data from command line input and processing it
// Start
process.stdin.resume();
process.stdin.setEncoding('ascii');
var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;
process.stdin.on('data', cacheInput).on('end', processData);
function cacheInput(data) {
... | true |
aef80800eafd40e32acc4293756aed3474d591b9 | JavaScript | LucySaluki/calculator_testing | /tests/e2e/specs/test.js | UTF-8 | 2,919 | 3 | 3 | [] | no_license | // https://docs.cypress.io/api/introduction/api.html
describe('calculator', () => {
beforeEach(() => {
cy.visit('/')
});
it('should have working number buttons', () => {
cy.get('#number2').click();
cy.get('.display').should('contain', '2')
})
it('should do arithmentic operations and update', () ... | true |
ec5c1a5b06c15445222d6949b6a6e195a0443bda | JavaScript | RogerDavidCruz/code-wars | /training-js-#14-toString/index.js | UTF-8 | 1,070 | 4.1875 | 4 | [] | no_license | // CodeWar Challenge
// Coding in function ```colorOf```. function accept 3 parameter:```r``` ```g``` ```b```. It means value of color red green and blue. the value range is 0-255.
//
// Use ```toString(16)``` Convert numbers r g b to hex string form. at last, combine them to a web color code and return it.
//
// the ... | true |
408d0397a72006551266ae168620cda8f5f923b2 | JavaScript | adandeark/sum-game | /src/App.jsx | UTF-8 | 3,763 | 2.578125 | 3 | [] | no_license | import React, { Component } from "react";
import Choices from "./components/Choices";
import uuid from "uuid";
import { connect } from "react-redux";
import { actionPlay, actionTick } from "./actions/gameAction";
class App extends Component {
play = () => {
clearInterval(this.interval);
const choices = 6;
... | true |
f6527892fd79ba68eea34892a25212b15a536dec | JavaScript | aidansoffe/codeWarsKata | /arrayPlusArray.js | UTF-8 | 129 | 3.078125 | 3 | [] | no_license | function arrayPlusArray(arr1, arr2) {
var res = 0
for (var i=0; i<arr1.length; i++){
res += arr1[i] + arr2[i];
}
return res
}
| true |
ca9c283b35f8ff8775ec8bc9c83a258e77e0e400 | JavaScript | rebeccagabrielle/Webproject | /JUSTA_js/js/justa.js | UTF-8 | 5,781 | 3.34375 | 3 | [] | no_license |
//EVENTO DE CLICK
function onClick() {
var nuevajusta;
nuevajusta = new justa();
nuevajusta.batalla();
nuevajusta.imprimir();
}
//JSON
var jsonKnight1 = '{ "name": "Atenea", "attHighPct": 30, "attMidPct": 25, "attLowPct": 50, "defHighPct": 25, "defLowPct": 75 }';
var jsonKnight2 = '{ "name": "A... | true |
01e77d72891a877fa7bcd4cecae220da26d32e46 | JavaScript | corentinclichy/GuessTheNumber | /script.js | UTF-8 | 2,630 | 4.09375 | 4 | [] | no_license | let correctNumber = getRandomNumber();
let guesses = [];
window.onload = function () {
document.getElementById("check").addEventListener("click", playGame);
document.getElementById("restart").addEventListener("click", initGame);
};
function playGame() {
let userNumber = document.getElementById("guessNumber").v... | true |
5bbdd5a9a0669d51dc594c702af8b6124d409ff9 | JavaScript | leeenx/es6-utils | /modules/Condist.js | UTF-8 | 3,138 | 3.015625 | 3 | [] | no_license | export default class Condist {
result = []
// 待存储条件项
options = {}
// 待匹配条件项
matches = []
static any = `any-${Date.now()}`
any = Condist.any
add (options) {
Object.entries(options).forEach(
([ key, value ]) => {
// 转成字符串存储
this.options[key] = value
}
)
const { add,... | true |
60e3c8dfe0e7314788f84c2f9b7c7d3c737d1d44 | JavaScript | fltenwall/Code-for-JavaScript | /Code/events.js | UTF-8 | 1,271 | 2.875 | 3 | [] | no_license | function EventEmitter(){
this._events = {};
}
EventEmitter.prototype.on = function(eventName,callback){
// if(eventName !== 'newListener'){
// this._events['newListener'] ? this._events['newListener'].forEach(fn => fn(eventName)) : void 0
// }
if(!this._events){
// this._events... | true |
b1f410c2f4eb654cb567cdb737ba1f796ddd956a | JavaScript | ComputerEnchiladas/smart-climate-system | /app/node-johnny-five.js | UTF-8 | 1,987 | 2.796875 | 3 | [] | no_license | var five = require("johnny-five"), board = new five.Board(),
red, green, blue, lcd, button1, button2, temp, control,
delta = 5, reset, target, current;
var calcTemp = function(){
temp.query(function(sensor) {
var val = sensor.value,
vlt = (val / 1024.0) * 5.0,
clc = (vlt - .5) * 100,
frh = ... | true |
19e86e7e8a01383565c8f70375b87ca1a1285368 | JavaScript | tao-team/mobile | /21/src/App.js | UTF-8 | 2,598 | 2.53125 | 3 | [] | no_license | import React, { useState } from "react";
import { Button, Typography, notification, Tooltip } from "antd";
import Newsline from "./Newsline";
const { Title } = Typography;
function App() {
const [posts, setPosts] = useState([
{ key: 1, title: "Kitten 1", description: "Here is the first random kitten." },
{ ... | true |
0aaec78c895de33f9f10d0bc936626fb7b2748e9 | JavaScript | ekra26/JavaScript30Challenge | /Day3-Playing with CSS Variables and JS/script.js | UTF-8 | 624 | 3.34375 | 3 | [] | no_license | //get root element//
var root = document.querySelector(':root');
//Event listeners//
document.getElementById("blur").addEventListener("input", changeValue);
document.getElementById("spacing").addEventListener("input", changeValue);
document.getElementById("color").addEventListener("input", changeValue);
//update val... | true |
ae6c21b1cb04a8e28c09d2c27b3658ca66ffb5a8 | JavaScript | yogimasterson/ancient-ant | /test/last_test.js | UTF-8 | 527 | 2.96875 | 3 | [
"MIT"
] | permissive | var expect = require ('chai').expect
var last = require ('../src/last')
describe('last()', function(){
it('should return the last element of an array', function(){
expect(last([1, 2, 3])).to.deep.equal(3)
expect(last(['a', 'b', 'c'])).to.deep.equal('c')
expect(last([['a','b','c'],[1, 2, 3],['you','and','... | true |
09a11096e16e33f9a4283b8f6aa399c2d3493d88 | JavaScript | conor-c/JS101 | /lesson_3/easy_practice_2.js | UTF-8 | 143 | 3.015625 | 3 | [] | no_license | let str1 = "Come over here!"; // true
let str2 = "What's up, Doc?"; // false
console.log(str1.endsWith('!'));
console.log(str2.endsWith('!')); | true |
59d2876689a61d4b9617664c3ea09c5a34fe8495 | JavaScript | ktzar/fx_react | /src/utils/formatting.test.js | UTF-8 | 622 | 2.6875 | 3 | [] | no_license | import { inputToAmount, formatAmount, formatRate } from "./formatting";
describe("formattin", () => {
it("inputToAmount can process input into suitable output", () => {
[
["1234.", "1234."],
["", "0"],
["123.45.67", "123."],
["9999999999999", "9999999"],
["123.4567", "123.46"],
... | true |
1bb741ba3150febd203afd478a78705bc9546ab5 | JavaScript | guardian/facia-tool | /public/src/js/utils/url-abs-path.js | UTF-8 | 792 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | var a = document.createElement('a');
/*
* @param {string} url
* @param {bool} keepQueryString
* @description gets the absolute path, keepQueryString was added where campaign
* params where being removed. Because this helper is many other places keeping
* queryStrings is opt in
*/
export default function(url, kee... | true |
3986546e0c90c83ca21f1420fec2792f9e585039 | JavaScript | Banialczele/coursemanagement | /client/src/components/AddCourse.js | UTF-8 | 4,508 | 2.515625 | 3 | [] | no_license | import React from 'react';
import {Redirect} from 'react-router-dom';
import axios from 'axios';
import DatePicker from 'react-datepicker';
import StudentInputs from './StudentInputs';
import "react-datepicker/dist/react-datepicker.css"
import '../styles/AddCourse.css';
import Entry from "./Entry";
class AddCourse ext... | true |
bf990f505bb3b253875f0abcb53617b334e2ce5a | JavaScript | dhanushkamathS/backendWithUserAuth | /controller/auth.js | UTF-8 | 2,642 | 2.6875 | 3 | [] | no_license | var Datastore = require('nedb');
const bcrypt = require('bcrypt');
const saltRounds = 10;
const secret = "thisISWorking";
var jwt = require("jsonwebtoken");
db = new Datastore({ filename: '../models/datafile', autoload: true });
//checks if the user aready exists before adding him to the DB
exports.isSignedUp = (req,... | true |
3379b85c6d74a92333f3717016cf4dab0ac3f1e2 | JavaScript | MIGMANMX/RHW | /cti/calendario/calendar-es.js | UTF-8 | 2,112 | 3.046875 | 3 | [] | no_license |
// Calendar ES (spanish) language
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
// Updater: Servilio Afre Puentes <servilios@yahoo.com>
// Updated: 2004-06-03
// Encoding: utf-8
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
//... | true |
8968843aefce19db24e8486e6bb9beed63d4569c | JavaScript | Fekapapa/react-to-do-nohook | /src/App.js | UTF-8 | 2,879 | 3.375 | 3 | [] | no_license | import React from 'react';
import './App.css';
class TodoForm extends React.Component {
constructor(props) {
super(props);
this.state = { inputValue: "" };
}
handleSubmit = e => {
const { inputValue } = this.state;
const { addTodo } = this.props;
// prevent the "click" default behavior
e... | true |
ea07765def34351be7a4d13a1684d6c2b047b2c6 | JavaScript | stevevisinand/Chocopix | /Sirius/scripts/classes/shape.js | UTF-8 | 4,142 | 3.203125 | 3 | [] | no_license | /*-- ____________ _____ --*/
/*-- / \ / --*/
/*-- / _________\ / --*/
/*-- \ \ / --*/
/*-- \ \ / Steve Visinand --*/
/*-- \ \ / 18.11.15 ... | true |
8ba73b01c72006b9110a8a3084b3504a4151aae7 | JavaScript | conorsheehan/ga-javascript-bdd | /chapters/02-jasmine-intro/spec/02-refrigerator-spec.js | UTF-8 | 977 | 2.53125 | 3 | [] | no_license | xdescribe('My refrigerator', function() {
var refrigerator = {
hasPower: true, // Has electrical power
temperature: 40, // Temperature in Fahrenheit
capacity: 14, // Inner capacity in cubic feet
outerDimensions: { // Outer dimensions in inches
height: 70,
wid... | true |
78614504528c7e9a2aba60ddb89e0f29aaab9a99 | JavaScript | Diaa-Ghonim/article-app-react-client | /src/App/shared/GenerateMonthOptions/index.js | UTF-8 | 548 | 2.875 | 3 | [] | no_license | import React from 'react';
export const months = new Array(12);
months[0] = 'Jan';
months[1] = 'Feb';
months[2] = 'Mar';
months[3] = 'Apr';
months[4] = 'May';
months[5] = 'Jun';
months[6] = 'Jul';
months[7] = 'Aug';
months[8] = 'Sep';
months[9] = 'Oct';
months[10] = 'Nov';
months[11] = 'Dec';
export default () => {
l... | true |
622449d9436d35a163070498f268c4370fd0779e | JavaScript | stevenxchung/JavaScript-Repo | /Coursework/Egghead.io - Async and Await/04-async-errors.js | UTF-8 | 1,053 | 3.390625 | 3 | [] | no_license | // Async without error handling
// const fetch = require('node-fetch');
// class GitHubApiClient {
// async fetchUser(handle) {
// const url = `https://api.github.com/users/${handle}`;
// const response = await fetch(url);
// return await response.json();
// }
// }
// (async () => {
// const client ... | true |
65e48d16c6f9ff6bf3b99993b52e13b8e401e048 | JavaScript | YukiOnishi1129/javascript-todolist | /src/model/TodoItemModel.js | UTF-8 | 460 | 3.125 | 3 | [] | no_license | /**
* TodoItemModel
*/
// ユニークなIDを管理する変数 (App.jsでTodoの初期値として2つ設定しているので、idの初期値は3)
let todoIdx = 3;
/**
* TodoItemModel
*/
export class TodoItemModel {
constructor({ title, completed }) {
// idは自動的に連番となり、それぞれのインスタンスごとに異なるものとする
this.id = todoIdx++;
this.title = title;
this.completed = completed;
... | true |
a4dce137f1259de28e9c8f12d2ae494fad1e9254 | JavaScript | ViktorHSN/algorithms | /ZigzagConversion.js | UTF-8 | 817 | 3.3125 | 3 | [] | no_license | /**
* @param {string} s
* @param {number} numRows
* @return {string}
*/
var convert = function (s, numRows) {
let zigzag = [...Array(numRows)].map(e => []);
let result = "";
let countChars = 0;
let iterateLinear = () => {
for (let i = 0; i < numRows; i++) {
zigzag[i][zigzag[i].length] = s.charAt... | true |
4259e041cd81ba8b7c559cf29ba6ae04a7d8fd37 | JavaScript | MattBett/Ray-Casting | /3D rendering/js/particle.js | UTF-8 | 1,746 | 3.21875 | 3 | [] | no_license | class Particle {
constructor(x, y, columns, fov) {
this.pos = createVector(x, y);
this.rays = [];
this.lookAt = 0;
this.columns = columns;
this.fov = fov;
this.angleIncrement = this.fov / this.columns;
if (this.columns) {
for (let i = this.lookAt; i < this.fov; i += this.a... | true |
0b5856587b595334244f4a2d7451df425acf251a | JavaScript | AlexArchibeque/Aa_Classwork | /W9D2/Asteroids/src/game.js | UTF-8 | 2,133 | 3.546875 | 4 | [] | no_license | const Asteroid = require("./asteroid.js");
Game.DIMX = 800;
Game.DIMY = 800;
Game.NUM_ASTEROIDS = 10;
function Game() {
this.asteroids = this.addAsteroids();
}
Game.prototype.addAsteroids = function () {
let output = [];
while (output.length < Game.NUM_ASTEROIDS) {
output.push(new Asteroid(this.... | true |
f8e906f6bbd92de6601a5fd1906a46e69768c1e4 | JavaScript | nohani/music_maestro | /frontend/src/components/discover/discover.js | UTF-8 | 2,303 | 2.546875 | 3 | [] | no_license | import React from 'react'
import DiscoverItem from './discover_item'
export default class Discover extends React.Component{
constructor(props) {
super(props)
this.aggregateEvents = this.aggregateEvents.bind(this)
this.userEvents = this.userEvents.bind(this)
this.allEvents = this.allEvents.bind(this)
... | true |
89c84b8acf65eb6f0d9d7d120f56790bcac75b59 | JavaScript | gitmithy/react-lesson | /13linkedstae/app4.js | UTF-8 | 1,399 | 2.75 | 3 | [] | no_license | const LinkedStateMixin=React.addons.LinkedStateMixin;
const Comp4=React.createClass({
displayName:'Comp',
//mixins:[LinkedStateMixin],
getInitialState(){
return{
name:'',
name2:'',
name3:'',
name4:''
}
},
changeName(event){
... | true |
84587ac71ed36edef1ee4c89a8c3e4f159ecf6ee | JavaScript | clase-javascript/Clase-JavaScript | /clase JS basica/clase-01-basico.js | UTF-8 | 673 | 4.03125 | 4 | [] | no_license | //esto es una alerta
//alert("Hola mundo")
//esto es un mensaje en consola
console.log("Hola mundo")
//variables y constantes
//ambias sirven para guardar informacion
let nombreDeLaVariables = "esto es una variable"
const nombeDeLaConstante = "esto es una cosntantes"
console.log(nombreDeLaVariables)
//las variables... | true |
b6c3b282b75c0ff79b4bbea46491d8ef3a7fe820 | JavaScript | franky3w/kidify | /src/playground/play.js | UTF-8 | 1,109 | 2.84375 | 3 | [
"MIT"
] | permissive | import React from 'react';
import ReactDOM from 'react-dom';
import {Checkbox, CheckboxGroup} from 'react-checkbox-group';
class Demo extends React.Component {
constructor(props) {
super(props);
this.state = {
fruits: ['apple','watermelon']
};
}
componentDidMount() {
// Add orange and re... | true |
26ed5d26fa64185c6c9dfbeb03306bb725fab8e5 | JavaScript | anonymJS/js2 | /script.js | UTF-8 | 1,192 | 3.796875 | 4 | [] | no_license | // comment
let defaultNumber = 0; // number, változó.
let string = "string"; // alap string = változó.
defaultNumber = 5; // defaultNumber változó átalakítása, 5-é.
console.log(defaultNumber + 5) // a defaultNumber változóhoz hozzáadunk 5-öt.
console.log(string) // string változónk kiiratása
let numberOn... | true |
47b7a0421676f9a91a43ebf60f488fdf189de0aa | JavaScript | GaYoung0420/InformationDesign2Team3 | /대시보드/과정/연습용/test1.js | UTF-8 | 13,841 | 3 | 3 | [] | no_license | CarValue=0 //자동차 인덱스 전역변수
CarText="코나" //자동차 모델명 전역변수
ConditionValue=1
ConditionText="가격"
CityText=""
RegionText=""
EV = []
Subsidy =[]
// set the dimensions and margins of the graph
margin = {top: 40, right: 20, bottom: 40, left: 140},
width = 460 - margin.left - margin.right,
height = 550 - margin.top - margin.botto... | true |
f640f8b88cba104279269a47c07ca7b25d6d28df | JavaScript | jathu1994/Fast-track-training-with-Krish | /Number_Reverser/Number_Reverser.js | UTF-8 | 463 | 3.25 | 3 | [] | no_license | function reversNumber(number) {
let reversedNumber = 0;
while(number > 0)
{
//modulus by 10 will give same last digit
//multiply the result by 10 will make position correct for next addition
reversedNumber = reversedNumber * 10 + number % 10;
//division and floring will resu... | true |
edf3306b82aae670fbd67c2a2d72aa81c0079d41 | JavaScript | bhatashraf/reactjs-poc | /src/App.js | UTF-8 | 2,242 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import Projects from './components/Projects.js';
import AddProjects from './components/AddProjects.js';
import UUID from 'uuid';
import $ from 'jquery';
import Todos from './components/Todos.js';
class App extends Component {
constructor(){
super();
... | true |
5a1cf4ff5ca6b5caed6f3496e41aa1a802cd8817 | JavaScript | EntwistleOx/Fullstackopen-2020 | /part6/redux-anecdotes/src/reducers/anecdoteReducer.js | UTF-8 | 940 | 2.53125 | 3 | [] | no_license | import service from '../services/anecdotes';
const reducer = (state = [], action) => {
switch (action.type) {
case 'INIT_ANECDOTES':
return action.data;
case 'ADD':
return [...state, action.data];
case 'VOTE':
return state.map((anecdote) =>
anecdote.id !== action.data.id
... | true |
c37c780815a58e1442594d32dc74ae4055093db1 | JavaScript | odiesusanto/h8-p0-w4 | /exercise-6hitunghuruf.js | UTF-8 | 1,126 | 3.21875 | 3 | [] | no_license | function hitungHuruf(kalimat) {
var kalimatSplit = kalimat.split(' ');
var compare = 0;
var word = '';
for (var i=0; i < kalimatSplit.length; i++) { //looping sentence
word = kalimatSplit[i];
var alphabet = 0;
for (var j=0; j < kalimatSplit[i].length; j++) { //looping each word
var tempWord... | true |
7a65fbdcc785a5a3ee8e25191c8f9b7ccc99d8ba | JavaScript | bamkhatri/movies-ticket-reservation | /Front-End/js/booking.js | UTF-8 | 1,615 | 2.984375 | 3 | [] | no_license | function calcTotal(){
var noOfSeat = document.querySelector("#seat");
var price = document.querySelector("#price");
console.log(price.value)
var totalPrice = document.querySelector("#totPrice");
totalPrice.value = noOfSeat.value*price.value;
console.log(totalPrice.value)
}
// function getMovies(event){
// ... | true |
646b6711127bd4bf319a66f4827c474b226b0402 | JavaScript | youngcitrus/cohort-ta-resources | /jspy-instructional-resources-master/W07/W07D2/morning-lecture/memoization_fib.js | UTF-8 | 812 | 4.25 | 4 | [] | no_license | // Runtime: O(2^n)
function fib(n) {
if (n === 1 || n === 2) return 1;
return fib(n - 1) + fib(n - 2);
}
console.log(fib(50));
// Runtime: O(n)
// Default argument for memo
function fib(n, memo = {}) {
if (n in memo) return memo[n];
if (n === 1 || n === 2) return 1;
// Make sure to pass the memo in to your call... | true |
3a1541e799cc754eeda0fb228c8a14eb298e2322 | JavaScript | hibamouhoub/test | /classes/Appointment.js | UTF-8 | 1,747 | 3.25 | 3 | [] | no_license | class Appointment {
static id
constructor(start, maxAttendees) {
this.createAppointment(start, maxAttendees)
}
createAppointment(start, maxAttendees) {
if (new Date(start) < new Date) throw 'We cannot create an appointment in the past'
this.id = Appointment.incrementId()
... | true |
28805e13b5b42aabd5ad69386be88bebd49f75de | JavaScript | wclwksn/canvas-painter | /src/js/graph/Rect.js | UTF-8 | 2,926 | 2.734375 | 3 | [] | no_license | /**
* 图形-矩形
*/
define(function (require, exports) {
var eventEmitter = require('../common/eventEmitter');
var wipe = require('../common/wipe');
/**
* 矩形构造函数
* @param {Object} options
* @property {number} options.startX 起点x
* @property {number} options.startY 起点y
* @property {st... | true |
5a12cb7b0b400c3198d4f4661c10214aaa9a45d5 | JavaScript | dennisleung/leetCode | /1217.play-with-chips.js | UTF-8 | 1,053 | 3.625 | 4 | [] | no_license | /*
* @lc app=leetcode id=1217 lang=javascript
*
* [1217] Play with Chips
*/
/*
50/50 cases passed (56 ms)
Your runtime beats 51.42 % of javascript submissions
Your memory usage beats 100 % of javascript submissions (34.1 MB)
*/
// @lc code=start
/**
* @param {number[]} chips
* @return {number}
*/
var minCostToMo... | true |
62903b8847e4180cedee8f019c2bbf922f8952db | JavaScript | spencerf2/week_6_day_2_javascript_hw_questions_and_answers | /homework2.js | UTF-8 | 3,506 | 4.25 | 4 | [] | no_license | //==========Exercise #1 ===========//
/*
Write a function that parses through the below object and displays all of their
favorite food dishes as shown:
*/
let person3 = {
pizza:["Deep Dish","South Side Thin Crust"],
tacos:"Anything not from Taco bell",
burgers:"Portillos Burgers",
ice_cream:["Chocolate... | true |
36a9506f7ed95319ec0f4c3e16dc64b5c420e762 | JavaScript | Vasilev07/Softuni-2016-2017 | /JavaScript Tech/JavaScript Lab/05.Symmetric Numbers.js | UTF-8 | 544 | 3.75 | 4 | [] | no_license | /**
* Created by Georgi Vasilev on 3/22/2017.
*/
function solve(args) {
let n = Number(args[0]);
let result = '';
for(let i = 1; i <= n; i++) {
if (isSymmetric("" + i)) {
result += i + " ";
}
}
console.log(result);
function isSymmetric(numberAsString) {
fo... | true |
8a146a090469cc1f0f13165d69f34a073bca13dc | JavaScript | boglarkasebestyen/JavaScriptmas | /Day 23 - SocialMediaInput.js | UTF-8 | 4,720 | 3.28125 | 3 | [] | no_license | /* Social Media Input
https://scrimba.com/scrim/coef148d7b261bfbb3f375955
DESCRIPTION:
We are making a Social Media Character Counter! We want to display the available characters LEFT.
Using the keydown() event should help you here. When the characters reach 20 and below, we want them to turn red. So we will use Ja... | true |
fe12bd1c606e468c12edb0e993e50327233fd544 | JavaScript | rivetta-fr/mws-project-3 | /js/custom.js | UTF-8 | 5,504 | 2.59375 | 3 | [] | no_license | //opens database
const dbPromise = self.idb.open('rr', 3, function(upgradeDb) {
switch(upgradeDb.oldVersion) {
case 0:
const store = upgradeDb.createObjectStore('restaurants');
store.createIndex('by-id', 'id');
case 1:
if (!upgradeDb.objectStoreNames.contains('reviews')) {
const rev... | true |
6cdfea460145903ad4893dedc3a228902ec01846 | JavaScript | ZhiyuanYao93/Mongo-Practice | /test/subdocument_test.js | UTF-8 | 1,429 | 2.53125 | 3 | [] | no_license | const assert = require('assert');
const User = require('../src/user');
describe('Subdocuments',()=>{
it('create a subdocument',(done)=>{
const joe = new User({name:'Joe',
posts:[{title:'Hello World!'}]
});
joe.save()
.then(()=> User.findOne({name:'Joe'}))
.then((user... | true |
a6c221b8536310028e89f46570eeb32e50bbfdba | JavaScript | jeshsy/LS-React-II | /instagram/src/searchBar.js | UTF-8 | 827 | 2.609375 | 3 | [] | no_license | import React, { Component } from 'react';
import './searchBar.css';
class SearchBar extends Component {
constructor() {
super();
this.state = {
search: '',
history: []
};
this.updateSearch = this.updateSearch.bind(this);
this.addSearch = this.addSearch.bind(this);
}
updateSearch(... | true |
def8a8843ab33ed32789ac5a61ea94c4299d4684 | JavaScript | MelissaSalazarE/lim-2018-11-bc-core-am-data-lovers | /src/chart.js | UTF-8 | 1,354 | 3 | 3 | [] | no_license |
// Load the Visualization API and the corechart package. //
/* eslint-disable no-unused-vars */
google.charts.load('current', {'packages': ['corechart']});
/* eslint-enable no-unused-vars */
// Set a callback to run when the Google Visualization API is loaded. //
/* eslint-disable no-unused-vars */
google.charts.setO... | true |
5e2f5b1a557836afbb13d5fd4e561139c38c1549 | JavaScript | archive/talk-views-and-jasminejs | /code/js/views/products.facit.js | UTF-8 | 1,219 | 2.75 | 3 | [] | no_license | (function(){
this.ProductsView = function(productsCollection, $){
this._productsCollection = productsCollection;
this._$ = $;
};
this.ProductsView.prototype._attachEvents = function() {
// TODO: use delegate instead
this._$('#products li').click(this._productClicked.bind(this));
};
this.ProductsView.pro... | true |
1ac4ff2c31b168a642549d5a4c8d9002ea9d0d53 | JavaScript | ShonWaghchoure/Car-Racing-Game | /js/form.js | UTF-8 | 1,016 | 2.96875 | 3 | [] | no_license | class Form {
constructor(){
this.input = createInput("Name");
this.button = createButton("Login");
this.greeting = createElement('h3');
}
hide(){
this.button.hide();
this.input.hide();
this.greeting.hide();
}
display(){
var titl... | true |
fc46798c22fa14790ac656f758b89def7c6206dc | JavaScript | ogcule/bootstrap-express-website | /src/client.js | UTF-8 | 2,591 | 2.671875 | 3 | [] | no_license | export default function(){
$(document).ready(function () {
let warnDisplay = false;
function liElement(id,name,description){
return `<li class="list-group-item"><ul class="inner-list"><li><button type="button" class="close" aria-label="Close" data-id=${id} data-name=${name} data-description=${description}><span... | true |
32cd2e578e156cace498d54d210bb8e2ca994041 | JavaScript | siddardhak/API-Development-Node.js | /app.js | UTF-8 | 1,854 | 2.8125 | 3 | [] | no_license | const express =require('express');
const Joi = require('joi');
const app = express();
app.use(express.json());
app.get('/',function(req,res){
res.send('/api/names');
res.end();
});
const names=[
{id:1, name:"siddardha"},
{id:2, name:"sid"},
{id:3, name:"Kolanupaka"}
]
app.get('/api/names',functio... | true |
37e65e4377e1599fa0330d390b88875a6fc02197 | JavaScript | kokoichi206/todo | /training2/js/misc.js | UTF-8 | 6,411 | 3.15625 | 3 | [] | no_license | const oyalist = document.getElementById('oyaList');
const postSort = document.getElementById('postdate');
const deadSort = document.getElementById('deadline');
const isReverse = document.getElementById('reverse');
const isHidden = document.getElementById('hiddencheck');
// なんだっけこれ。
// innerHTMLとして読み込みたい欲求
funct... | true |
5d0ffd2bdddf249f1a86743ea9b08fe69a299561 | JavaScript | tanuki2015/node-demo | /mongodb/database.js | UTF-8 | 1,962 | 3.140625 | 3 | [] | no_license | var mongoose = require('mongoose');
var db = mongoose.connect("mongodb://127.0.0.1:27017/xf");
db.connection.on("error", err => console.log("数据库连接失败" + err));
db.connection.on("open", () => console.log("数据库连接成功"));
//定义schema
var PersonSchema = new mongoose.Schema({
name : {type: String},
age : {type... | true |
82f10f7725b1e21da0eda581cadd4d747d5d5e38 | JavaScript | ms314006/step-by-step-unit-testing | /example01-3-最後重構/todolist.js | UTF-8 | 689 | 3.53125 | 4 | [] | no_license | class TodoList {
constructor(todoList = []) {
this.todoList = todoList;
}
getList() {
return this.todoList;
}
addTodo(newTodo) {
this.todoList.push(newTodo);
}
}
(() => {
const todo = new TodoList();
const todoList = document.getElementById('todoList');
const newTodoInput = document.get... | true |
9a514e050cdd2daa8b6acb8f25cdc492ffbf9c6c | JavaScript | Dechene/starter-web | /test.js | UTF-8 | 378 | 2.796875 | 3 | [] | no_license | import axios from "../complete-javascript-course/9-forkify/starter/node_modules/axios/lib/axios";
console.log("I like pizza");
async function hello() {
return "Hello";
}
hello();
async function getResults(query) {
const result = await axios(
`https://forkify-api.herokuapp.com/api/search?q=${query}`
... | true |
1c9ba2b3b273a30b0f56643e39176b45fbfce496 | JavaScript | 7dir/audio-experiment | /audio-buffers.js | UTF-8 | 3,222 | 3.296875 | 3 | [] | no_license | /**
* It appeared that in WebAudioAPI buffers are not transformed like in streams, but modified in place.
* In that, test - hom much is it intensely to merge set of buffers of various lengths into output. What is the maximum number of troublesome mixing?
*
* Results:
* - 1000 is the maximum available number of mix... | true |
1a99fae95fb0ff11ed9a3b86756035817e8d37cd | JavaScript | Widell79/would-you-rather | /src/utils/helpers.js | UTF-8 | 2,124 | 2.5625 | 3 | [] | no_license | export function formatDate(timestamp) {
const d = new Date(timestamp);
const time = d.toLocaleTimeString("en-US");
//return time.substr(0, 5) + time.slice(-2) + " | " + d.toLocaleDateString();
return d.toLocaleDateString() + " | " + time.substr(0, 5) + time.slice(-2);
}
export function mapUsersToList(users) {
... | true |
f9fad13b1b97446ecc9cee32fa03707d000b12c6 | JavaScript | ashalansky/tweeter | /public/scripts/app.js | UTF-8 | 4,069 | 3.34375 | 3 | [] | no_license | /*
* Client-side JS logic goes here
* jQuery is already loaded
* Reminder: Use (and do all your DOM work in) jQuery's document ready function
*/
const timeDifference = function(current, previous) {
const msPerMinute = 60 * 1000;
const msPerHour = msPerMinute * 60;
const msPerDay = msPerHour * 24;
const ms... | true |
a7871afe363fa70e0ee719061972ff3a92c0afe6 | JavaScript | Yordani2k19/InstagramApp | /fs/clearFile.js | UTF-8 | 256 | 2.546875 | 3 | [] | no_license | const fs = require('fs')
export const clearFile = (file) =>
new Promise((resolve, reject) => {
fs.truncate(file, 0, function (err) {
if (err) {
reject(err)
} else {
resolve()
}
console.log('Done')
})
})
| true |
36ab592dcc30b9be7892ba2e1848c6e2a66a1d1a | JavaScript | logesh-manoharan/vuex_todos | /src/store/modules/todos.js | UTF-8 | 2,521 | 3.109375 | 3 | [] | no_license | import axios from 'axios';
const state = {
todos: [
]
};
// to get the piece of data or computed data from state
const getters = {
allTodos: (state) => {
return state.todos
},
todosLength: () => {
const responseData = actions.lengthTodos();
console.log(Object.values(respons... | true |
6c0e17bb7869ff9c1ded436c14425789e9d6a61e | JavaScript | sopresto/unit-4-game | /assets/javascript/games.js | UTF-8 | 2,665 | 3.859375 | 4 | [] | no_license | // // Each crystal should have a random hidden value between 1 - 12.
// // The random number shown at the start of the game should be between 19 - 120.
// //What needs to happen:
// //Each character needs a random value, when clicked score will reveal.
// //random number will show inside of (randomNumber) box on page.
... | true |
eef1e96b2cab1dda5e7bd8a79edcfb1d0725b844 | JavaScript | or-change/content | /test/memory-spec.js | UTF-8 | 5,988 | 2.578125 | 3 | [
"MIT"
] | permissive | const assert = require('assert');
const createMemory = require('../interface/memory');
describe('interface > memory', function () {
const storage = {};
const memory = createMemory(storage);
describe('#content', function () {
let id;
describe('#read()', function () {
it('return undefined when whithout arg... | true |
54caf6fcfeeedbed73c661499eef8899ee116165 | JavaScript | nipunanirmal/FridaLib | /Android/androidFridaLib.js | UTF-8 | 22,329 | 2.515625 | 3 | [
"MIT"
] | permissive | // _ ___ ______ _ _
// (_) / _ \ | ____| (_) | |
// __ ___ __ _| | | | | |__ _ __ _ __| | __ _
// \ \/ / |/ _` | | | | | __| '__| |/ _` |/ _` |
// > <| | (_| | |_| | | | | | | | (_| | (_| |
// /_/\_\_|\__,_|\___/ |_| |_| |_|\__,_|\__,_|
// Globe vars
Java.... | true |
a7e57b4de60b76c25aa5d349f6e9dfa66ab8ba09 | JavaScript | Megalpha18/binanceleaderboardcopier | /js_css/js/slidingdiv/slidingdiv.js | UTF-8 | 4,390 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive |
/************************************************************************************************************
Show hide content with slide effect
Copyright (C) August 2010 DTHMLGoodies.com, Alf Magne Kalleland
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser G... | true |
3195fe1b93cb68e77a2910a9e45e1fcdf796942d | JavaScript | FelipeEduardoOliveira/EstudoES6 | /spreadOperator.js | UTF-8 | 708 | 3.28125 | 3 | [] | no_license | function cadastroPessoa(dado){
var novoDado = {
...dado,
skills: ['React', 'PHP', 'CSS', 'JS', 'HTML', 'MySql']
};
return novoDado;
}
var Felipe = cadastroPessoa({nome: 'Felipe', idade: 22, cargo: 'Estagiario'});
console.log(Felipe);
// Rest Operator
function listaNomes(... | true |
c890529613de6da9ce67c0a807cb85087ad87d11 | JavaScript | DmitryKgit/algorithms | /9. Массивы/9K_v2.js | UTF-8 | 828 | 3.90625 | 4 | [] | no_license | /*
9K.js 13.02.2020
Дан список, упорядоченный по неубыванию элементов в нем. Определите, сколько в нем различных элементов.
Входные данные
Вводится список чисел. Все числа списка находятся на одной строке.
Выходные данные
Выведите ответ на задачу.
Примеры
входные данные
1 2 2 3 3 3
выходные данные
3
*/
var arrNum = '1 ... | true |
76f6acc340963a1e387811292795d06830646f64 | JavaScript | shailshikha4997/Javascript-Angular | /OOP's/script.js | UTF-8 | 1,302 | 3.765625 | 4 | [] | no_license | /*var sum = (x, y, ...rest) => {
var s = x + y;
console.log(rest)
return s;
}
var p = [4, 8, 6, 7, 9, 2]
console.log(sum(...p))
var p2 = [3, 9, 7]
var p = ... | true |
4d72efb215cbad774f3658062035340e8bf5dda2 | JavaScript | wyy521561/wyygit | /shopping mall/js/shoppingCart.js | UTF-8 | 1,176 | 2.515625 | 3 | [
"MIT"
] | permissive | $(".delete").click(function() {
//var shop = $(this).parentNode;
//shop.parentNode.removeChild(shop);
$(this).parent(".shoppingDetail").remove();
})
var footerCircle = false;
$(".footerCircle").click(function() {
if(footerCircle == false) {
$(".shoppingCircle").addClass("shoppingCircleOpen");
$(".footerCircle"... | true |
0da6daa093efea1bbe177bd5df8ba19ec924fc53 | JavaScript | redmagebr/redpgFront | /js/oldApp/sheet/Variable_Sheet.js | UTF-8 | 4,555 | 2.609375 | 3 | [] | no_license | /**
*
* @param {jQuery} $visible
* @param {Style} style
* @param {number} missingid
* @param {Sheet} parent
* @returns {Variable_Template}
*/
function Variable_Sheet ($visible, style, missingid, parent) {
/** @type number */ this.id;
this.$visible = $visible;
this.style = style;
this.parent = pa... | true |
edbf0059cba5807eee6290b27734eb88f0c34e42 | JavaScript | maxinny/pocs | /serverFacturas.js | UTF-8 | 1,097 | 2.96875 | 3 | [] | no_license | var listaFacturas=[];
var facturaDatos = {"id": "A", "concepto":"mac", "importe":1000};
var facturaDatos2 = {"id": "B", "concepto":"iphone", "importe":700};
listaFacturas.push(facturaDatos);
listaFacturas.push(facturaDatos2);
var express = require("express");
var bodyParser = require('body-parser');
var app = expres... | true |
7572a3e74efb4cc193a3829b2e49b889cbde996e | JavaScript | isuttell/Amber | /test/specs/Views_Spec.js | UTF-8 | 1,079 | 2.65625 | 3 | [
"MIT"
] | permissive | describe("Amber.Views", function() {
var TestView = Amber.View.extend();
beforeEach(function(){
Amber.Views._clear();
});
it("should be defined", function() {
expect(Amber.Views).toBeDefined();
});
it('should clear all views', function(){
var view = new TestView();
Amber.Views._clear();
expect(Amber... | true |
04f9c8c0aab5bfaf515e84b6d317a99f4111091b | JavaScript | lmaiarios/calc-app | /src/components/Calculator.js | UTF-8 | 2,589 | 2.828125 | 3 | [] | no_license | import React from 'react';
import './Calculator.css';
class Calculator extends React.Component{
constructor(props){
super(props);
this.screenStyle = {display: 'inline-flex',
backgroundColor: 'rgb(221, 78, 12)',
height: '40px',
... | true |
562a0d38fb9faa6d0e587250c6eaf8c71b7cb697 | JavaScript | rafaellross/app-frontend | /src/Redux/Actions/users.js | UTF-8 | 1,345 | 2.734375 | 3 | [] | no_license |
import * as API from '../../Api';
export const ADD_USER = 'ADD_USER'
export const REMOVE_USER = 'REMOVE_USER'
export const UPDATE_USER = 'UPDATE_USER'
function addUser (user) {
return {
type: ADD_USER,
user,
}
}
function removeUser (id) {
return {
type: REMOVE_USER,
id,
}
}
functi... | true |
6e25cd4047295215736e3a575bd8ac723a7151c2 | JavaScript | Rubin78/Firstairport | /.history/src/App_20210321150004.js | UTF-8 | 13,711 | 2.875 | 3 | [] | no_license | // import React, { Component } from 'react';
// import { wait } from "@testing-library/react";
// class App extends Component {
// state={
// loading:true,
// person:false,
// }
// async componentDidMount(){
// const url = "https://api.randomuser.me/"
// const response = await fetch(url);
// const data = await... | true |
4f75e1f0b6d87cd6283e7e1901ba6c54187ce0c5 | JavaScript | devinwelch/greeter-bot | /src/gbp/resetEconomy.js | UTF-8 | 3,397 | 2.6875 | 3 | [] | no_license | /**
* Reset the GBP economy
* @param data Reset data
* @retuns void
*/
export function resetEconomy(client, db, data) {
console.log('Resetting the economy!');
client.channels.cache.get(client.ids.channels.botchat).send('**From the ashes we are born anew. The GBP economy has been reset. ... | true |
cd85da34f9e1bdc3675f936e64ce672216aa9d6d | JavaScript | Yangbiubiu/82-heima-base | /src/utils/axios.config.js | UTF-8 | 3,722 | 2.71875 | 3 | [] | no_license | // 专门处理axios拦截器 请求拦截器 响应拦截器的
// 在main.js中引入
import axios from 'axios' // 1.引入axios插件
import router from '../permission' // 引入router或者permission 都行import router from '../router'
import { Message } from 'element-ui' // 引入 Message消息提示 elementUI组件
import jsonBigInt from 'json-bigint'// 引入json-bigint npm的包后端传回的id数字超过了前端的最大... | true |
bbaa5fcfa571486d1d23805fae9d6a8e638e3829 | JavaScript | xpnobug/Lm | /src/main/resources/static/js/dojs/comment.js | UTF-8 | 3,144 | 2.59375 | 3 | [] | no_license | function initCom(){
$.post("/comment/com",successCom,"JSON")
}
//回调函数
function successCom(data){
//1.选中要添加的标签
var $mytbody=$("#mytbody");
//2.添加显示的内容
if(data.length>0){
for(var i=0;i<data.length;i++){
$mytbody.append("<tr>" +
"<td>" +
"<div class=\... | true |
54fe1d2e653748f9c1c0f99e645fe706516b9799 | JavaScript | mb3online/article-exercise | /static/index.js | UTF-8 | 4,365 | 2.921875 | 3 | [] | no_license | const BASE_URI = "https://simple-articles.now.sh/api/articles";
const mountForm = function mountForm({ _id, title, image, author, content }) {
return function mountFormWithContext(event) {
/**
* Open the form modal
*/
const edit = document.querySelector(".edit");
edit.classList.add("edit--open"... | true |
460c9f57f2f81071eeb3ccf95ed972239a5eeab5 | JavaScript | shahdarshil123/luggage_tracking | /web_app/sign_out.js | UTF-8 | 585 | 2.875 | 3 | [] | no_license | const LogoutUser = document.getElementById('logout');
function sign_out(){
firebase.auth().signOut().then(() => {
// Sign-out successful.
console.log("Logged Out successfully!");
window.localStorage.removeItem("email");
window.alert("Logged out!");
window.location.replace("login.html"... | true |
a3ce6242f0536bd25536f7819895da802561a6a7 | JavaScript | Lambda-School-Web-PT-22/Introduction-to-JavaScript | /index.js | UTF-8 | 7,104 | 4.875 | 5 | [] | no_license | /************************************************************** Task 1: Warm-up! **************************************************************/
//Task a: declare a variable called votingAge, console log true if age > 18 (no function required)
let votingAge = 19
if(votingAge > 18){
console.log(true);
} else {
... | true |
c6bddba4749fa397cd4eff2e76db1cedbe0fa31c | JavaScript | leihongyan/code | /代码练习/FPrototype.js | UTF-8 | 604 | 3.46875 | 3 | [] | no_license | function Rabbit() {
}
// Rabbit.prototype={
// jumps:true
// }
Rabbit.prototype.jumps=true;
Rabbit.prototype={constructor:Rabbit};
let rabbit=new Rabbit();
// console.log(rabbit.constructor===Rabbit);
let obj={
0:'hello',
1:'world',
length:2
}
obj.join=Array.prototype.join;
// console.log(obj.join(','))
f... | true |
c5e26e8fdc39878042d4dac2ba469be48b5fa878 | JavaScript | AbhishekDesai56/WS1 | /Repetition/For_Loop/powerOfTwo.js | UTF-8 | 462 | 3.390625 | 3 | [] | no_license | const { read } = require("fs");
const requiredReadLine = require("readline");
const readLine = requiredReadLine.createInterface({
input: process.stdin,
output: process.stdout
});
readLine.question("Please enter power of nth value: \n", function (number) {
let powerOfTwo = 1;
for (var intialValue = 0; intialVa... | true |
dc7626dcabca61aeb5e9f9fc4dfe4268ded10875 | JavaScript | raghavgr/library-assistant | /app/screens/EditUser.js | UTF-8 | 8,128 | 2.53125 | 3 | [] | no_license | import { createStackNavigator } from 'react-navigation';
import React, { Component } from 'react';
import { StyleSheet, Text, View, Button, Alert, } from 'react-native';
import { Card, FormLabel, FormInput } from "react-native-elements";
import { StackNavigator } from 'react-navigation'; // 2.6.2
import { BarCodeScan... | true |
543330fd0849b3c1676726d9271158fdc90ee685 | JavaScript | Renszit/Spiced | /week_04/wednesday/6_generator_reverse/script.js | UTF-8 | 193 | 3.609375 | 4 | [] | no_license |
const array = [1, 2, 3, 4, 5];
function* genaReverse(arr){
let clone = [...arr];
yield clone.reverse();
}
const it = genaReverse(array);
const val = it.next();
console.log(val);
| true |
f9ffd5c168f88210cf4f305ea7438eced6aee5ce | JavaScript | friedolina/scripting17 | /TCM/script/addInput.js | UTF-8 | 845 | 2.859375 | 3 | [
"MIT"
] | permissive | /*
function addInput(divName, arrayName){
var newdiv = document.createElement('div');
newdiv.innerHTML = "<input class='eingabe' type='text' name='" + arrayName + "'><input type='button' value='-' class='minusbutton'>";
newdiv.className = "flexcontainer";
document.getElementById(divName).appendChild(n... | true |
18966c8cf8d77d2498e90005e49bffbe897a866d | JavaScript | daniel1rosso/luzmel-backend | /src/routes/login.js | UTF-8 | 2,395 | 2.609375 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const bcrypt = require('bcrypt')
const LoginModel = require('../models/LoginModel');
const UsuarioModel = require('../models/UsuarioModel');
var jwt = require('jsonwebtoken');
const checkAuth = require('../middleware/checkAuth');
//--- Login al siste... | true |
6f9535ff61c3aa20a6bc0ac865f12f7491f610d3 | JavaScript | annasauciuc/javascript--es6-challenges | /Challenge 17/solution/script.js | UTF-8 | 996 | 4.65625 | 5 | [] | no_license | // /* CHALLENGE 17 - IIFE (Immediately Invoked Function Expression)
// Complete IIFE that will expose following methods:
// greet() - It will take one argument and return greeting string
// changeGreeting() - It will change greeting string
// Initial greeting string "Hey, that's" must be defined inside IIFE.
// *... | true |
6080425ba9a77a1d9c4a7165d301eb60b2b5ce8f | JavaScript | TheonLL/JSProblemSolver | /JSProblemSolver/js/domains/puzzle/PuzzleState.js | UTF-8 | 1,979 | 3.4375 | 3 | [] | no_license | function PuzzleState(tiles) {
this.tiles = tiles;
this.toString = function() {
var builder = "";
for (r = 0; r < 3; r++) {
builder += "+---+---+---+";
builder += "\n";
builder += "|";
for (c = 0; c < 3; c++) {
i... | true |
7063d58fb299879096fc205f63ca0f079bdb630a | JavaScript | Ross65536/LTW_FEUP | /js/AjaxFormSubmitAdapter.js | UTF-8 | 2,321 | 2.734375 | 3 | [] | no_license | 'use strict';
class AjaxFormSubmitAdapter extends AjaxRequestAdapterAbstract
{
/**
* If received error not in map, an alert is displayed
*
* @param {*} actionPath path to php action
* @param {*} eventHandlerMap a map that maps an eror string returned from php to a function(void)
... | true |
2dac8526a4ee00e0f0e312a65304b90b6dacb623 | JavaScript | TheCell/beautifulMathBook | /Doodling/p5js/Collatz-Conjecture-Trees/sketch.js | UTF-8 | 3,119 | 2.875 | 3 | [] | no_license | let gfx;
const startupParameters = {
xSize: 600,
ySize: 600,
resizeCanvas: function() {
createCanvas(startupParameters.xSize, startupParameters.ySize);
gfx = createGraphics(startupParameters.xSize, startupParameters.ySize)
gfx.background(options.background);
}
}
const options = {
background: '#13... | true |
168bdce1f6ed5d70be6c7979b77277145e92bd73 | JavaScript | previnright/td-screenpop-google-extension | /background.js | UTF-8 | 1,993 | 2.59375 | 3 | [
"MIT"
] | permissive | // chrome.runtime.onInstalled.addListener(function() {
// $.getScript('https://td-screenpop.herokuapp.com/socket.io/socket.io.js',function() {
var socket = io.connect('https://td-screenpop.herokuapp.com/');
socket.on('message', function(msg) {
var s = JSON.parse(msg);
var link = s.url;
console.log(link);
// chro... | true |
c4c44dc0711969c5d0de8036cede911123ce7b19 | JavaScript | gkulk007/Hacktoberfest2021 | /Projects/Sorting Visualiser/src/algorithms/ShellSort.js | UTF-8 | 2,149 | 2.875 | 3 | [
"MIT"
] | permissive | import React from 'react';
import {
swap,
newTrace,
addToTrace,
createRange,
createKey
} from './helpers';
const ShellSort = (nums) => {
const trace = newTrace(nums);
for (
let gap = Math.floor(nums.length / 2);
gap > 0;
gap = Math.floor(gap / 2)
) {
for (let j = gap; j < nums.length; ... | true |