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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
72207e603878c53c3100af03abf6cafd569b295c | JavaScript | 796291/AP-CPS | /Lab1029 Color Bars/sketch.js | UTF-8 | 1,438 | 3.5625 | 4 | [] | no_license |
//Jakob Hachigian-Kreutzer
//Lab1029 Color Bars
var Bars = [];
function setup() {
//create canvas
var cnv = createCanvas(800, 800);
cnv.position((windowWidth-width)/2, 30);
background(20, 20, 20);
//amount of bars being displayed
numBars = 40;
//loading that amount of balls
loadBars(numBars);
//call... | true |
112c2f1fa5ed712e0575a5f280d5489db8ca80cc | JavaScript | trevor-cuffe/yelpCamp | /middleware/index.js | UTF-8 | 2,339 | 2.640625 | 3 | [] | no_license | import Campground from '../models/campground.js';
import Comment from '../models/comment.js';
//all the middleware goes here
let middlewareObj = {}
middlewareObj.loginRequired = (req, res, next) => {
if (req.isAuthenticated()) {
return next();
}
req.flash('error', 'You need to be logged in to do that!');... | true |
17951a47d7891fe1127b20e1c42af83692c574f6 | JavaScript | MadhavKauntia/game-to-debug | /js/temp_button.js | UTF-8 | 14,868 | 3.265625 | 3 | [
"MIT"
] | permissive | /*var output_txt = "Breakpoint 1, main () at h.cpp:7!\
7 int a = 5;!\
a = 32767!\
b = 0!\
var = std::vector of length 3, capacity 3 = {97 'a', 98 'b', 99 'c'}!\
arr = \"avz\"!\
uuuu!\
Breakpoint 8, main () at h.cpp:8!\
8 a = 6;!\
a = 5!\
b = 0!\
uuuu!\
Breakpoint 9, main () at h.cpp:9!\
9 long b = a + 1;!\
... | true |
8557739e8a0bb300a7b891af0128558e9ab4939c | JavaScript | sumincy/MapleStory-RPG | /冒险岛:传说世界/脚本/npc/9000178.js | UTF-8 | 4,401 | 3.015625 | 3 | [] | no_license | var status = -1;
var selectionLog = new Array(); // 记录每一轮的选择
function start() {
action(1, 0, 0);
}
function action(mode, type, selection) {
if (status == 0 && mode == 0) {
cm.dispose();
return;
}
// mode: 1 = (下一页/是/同意) -1 = (结束对话) 0 = (返回/否/拒绝)(askMenu/sendGetNumber时,结束对话)
if (mode == 1) {
status++;
} el... | true |
a25040a0ae2b72851c2fb675bd227edeac20b9d4 | JavaScript | janebt/canvas | /class/n-bezierCurve.js | UTF-8 | 4,431 | 2.578125 | 3 | [] | no_license | function creatBezierCurve(pointInfo)
{
var curve =
{
canvasId:undefined,//绘制的图表所在的canvas的ID
point:[],//用于绘制图形的点数据
init:function(pointInfo)
{
for (var prop in pointInfo)
{
if (undefined != pointInfo[prop])
{
this[prop] = pointInfo[prop];
}
}
/*支持动态生成的canvas*/
... | true |
10b70f2e638424d4431785266f8d049180ce2136 | JavaScript | guibwl/myDevelopNote | /webpack/demo/index.js | UTF-8 | 1,277 | 2.90625 | 3 | [] | no_license | const {
SyncHook,
SyncBailHook,
SyncWaterfallHook,
SyncLoopHook,
AsyncParallelHook,
AsyncParallelBailHook,
AsyncSeriesHook,
AsyncSeriesBailHook,
AsyncSeriesWaterfallHook
} = require("tapable");
const hook = new SyncHook(["arg1", "arg2", "arg3"]);
class Car {
constructor() {
this.hooks = {
brake: new... | true |
814fb9d94057a149c7d65bf373b1eaba104f693f | JavaScript | shaggyrec/urlshortener_nm | /public/cm.js | UTF-8 | 894 | 2.90625 | 3 | [] | no_license | function makeUrlShort(form){
var data = {}
for(var i=0; i < form.elements.length; i++) {
var element = form.elements[i];
if (element.value) {
data[element.name] = element.value;
}
}
var requestOpts = {
url: form.action,
data: data,
success:renderShortenResult,
error: formError
}
ajaxPost(reques... | true |
5a3e46f24d24d86deedf4da422683d018ae43e5e | JavaScript | didaquis/skylab-bootcamp | /precourse/tema2-pc/exercises2.js | UTF-8 | 12,266 | 4.40625 | 4 | [] | no_license | // https://github.com/agandia9/Subjects-PreCourse
// https://github.com/agandia9/Subjects-PreCourse/blob/master/objects.md
// # JS Objects
// a) Escribe una función que liste los nombres de propiedad del objeto (Puedes usar el objeto creado más arriba)
function propertiesInObject(myObject){
for(let key in myObject)... | true |
db44ecaf2118407d1af32751beedc98b54571005 | JavaScript | ANxiaoyu/LeetCode | /231.2的幂.js | UTF-8 | 515 | 3.90625 | 4 | [] | no_license | /**
* 题目:
* 给定一个整数,编写一个函数来判断它是否是 2 的幂次方。
*
* 示例1:
* 输入:1
* 输出:true
* 解释:2^0= 1
* 示例2:
* 输入:16
* 输出:true
* 解释: 24 = 16
* 示例3:
* 输入:218
* 输出:false
*/
/**
* @param {number} n
* @return {boolean}
*/
var isPowerOfTwo = function(n) {
if(n<=0) return false;
if(n==1) return true;
while(n>=2){
... | true |
d448a8b30b59f313f1af9fc63ac6e7d3e53f0754 | JavaScript | lerhard/Javascript-Studies | /fundamentos/tipagemFraca.js | UTF-8 | 344 | 2.859375 | 3 | [] | no_license | let qualquer = 'Legal'
console.log(qualquer)
console.log(typeof qualquer)
qualquer = 3.1516
console.log(qualquer)
console.log(typeof(qualquer))
// Evitar nomes genéricos e siglas para nomes de constantes
let valor = ''
let numero=1
let pqp = false // Produto Químico Perigoso...kkkk
//Prefira código claro ao invés de c... | true |
aac2079c96ab02526110c6b5e2fe0e6b1f08131b | JavaScript | footmess/mySmallDemo | /京东移动/js/index.js | UTF-8 | 5,180 | 2.921875 | 3 | [] | no_license | window.onload = function () {
//搜索框透明度
search();
//轮播图播放
banner();
//倒计时
cutTime();
}
function search() {
/*
* 1.颜色随着 页面的滚动 逐渐加深
* 2.当我们超过 轮播图的 时候 颜色保持不变
* */
var searchBox=document.querySelector(".jd_header");
var bannerBox=document.querySelector(".jd_banner");
var ... | true |
088be8399f7780716987c71dce6d2bc0628d0436 | JavaScript | i112358/30-day-code-challenge | /update.js | UTF-8 | 361 | 2.625 | 3 | [] | no_license | $(document).ready(function(){
//when click on x close modal
$(".close").click(function(){
$(".modal").css("display","none");
});
//close modal when click on anywhere else
var modal = document.getElementsByClassName("modal")[0];
window.onclick = function(event) {
if (event.target == modal) {
... | true |
674ca3fab889b296cc31bccb7812bd8e0cfacf3a | JavaScript | piemasters/RomanNumeralsTDD | /src/numerals.js | UTF-8 | 638 | 3.265625 | 3 | [] | no_license | const symbols = {
M: 1000,
L: 500,
C: 100,
D: 50,
X: 10,
V: 5,
IV: 4,
I: 1
};
function convertToNumerals(input) {
let handleNextNumeral = (currentInputAndString, symbol) =>
handleNumeral(symbol, symbols[symbol], currentInputAndString);
return Object.keys(symbols)
.reduce(handleNextN... | true |
51b658231dcb5764f9cca18652d69ee726974e49 | JavaScript | faisaluje/dicoding-backend-expert-submission | /src/Domains/comments/entities/_test/DetailComment.test.js | UTF-8 | 1,583 | 2.6875 | 3 | [] | no_license | const DetailComment = require('../DetailComment');
describe('a DetailComment entity', () => {
it('should create DetailComment object properly', () => {
const payload = {
id: 'comment-123',
username: 'some comment',
date: 'thread-123,',
content: 'some comment',
replies: [],
lik... | true |
e386b1f46a500415176a02176004d582d4dcfab1 | JavaScript | kim122079/webfontloader | /src/core/fontwatcher.js | UTF-8 | 5,018 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | /**
* @constructor
*/
webfont.FontWatcher = function(domHelper, eventDispatcher, fontSizer,
asyncCall, getTime) {
this.domHelper_ = domHelper;
this.eventDispatcher_ = eventDispatcher;
this.fontSizer_ = fontSizer;
this.asyncCall_ = asyncCall;
this.getTime_ = getTime;
this.currentlyWatched_ = 0;
this.... | true |
c9a6e9ccfadca0c814bc6e92ec7b48b5cd8c6bdd | JavaScript | KevinJiechengWang/Lab8 | /Part2-Cypress/custom-tests.js | UTF-8 | 2,434 | 2.546875 | 3 | [] | no_license | describe('Party Horn Tests', () => {
beforeEach(() => {
cy.visit('http://127.0.0.1:5500/');
});
it('First Test', () => {
expect(true).to.equal(true);
});
it('Slider changes when volume input changes', () => {
cy.get('#volume-number').clear().type('75');
cy.get('#volume-slider').then(function... | true |
67a2ccc4e3d5da8c95708338bcbb245049b8c6aa | JavaScript | waldenylson/fast-order | /pages/carrinho.js | UTF-8 | 9,598 | 3.03125 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import Link from 'next/link'
const Carrinho = () => {
const [orderItens, setOrderItens] = useState([])
const [indexUseEffect, setIndexUseEffect] = useState()
const [totalValue, setTotalValue] = useState(0)
const [pedidoStr, setPedidoStr] = useState("... | true |
d8e8562237b7f9909d72bf08bc628a3ac7cdc910 | JavaScript | Naman-Saxena1/Practice-11 | /index.js | UTF-8 | 905 | 3.25 | 3 | [] | no_license | const inputPassword = document.querySelector("#password")
const submitBtn = document.querySelector("#submit")
const output = document.querySelector("#output-message")
function onChangeHandler()
{
if(!(inputPassword.value===""||inputPassword.value===" "))
{
submitBtn.disabled=false
if(inputPass... | true |
e125f1bde7528b1919fa711bc7bd7af6a98294f6 | JavaScript | barisatbas/barisatbas.com | /js/contact.js | UTF-8 | 1,439 | 2.71875 | 3 | [
"MIT"
] | permissive | /*
Function to send a message, requires jQuery
*/
'use strict';
$(function() {
var ajaxData = null;
$('#contact-error').hide();
$('#contact-success').hide();
$('#contact-form').on('submit', function(e) {
e.preventDefault();
//Set data
var name = $('#name').val();
var surname = $('#surname').... | true |
ae1f543527a36e270c1e2edef639dca8143e7957 | JavaScript | thepupp3tmast3r/Assignment2 | /script.js | UTF-8 | 21,303 | 4.96875 | 5 | [] | no_license | //1. Create an application that prompts the user for their name. Then, find the length of characters in the person’s name. Use the alert method to display the result.
//step 1
//
//var name = window.prompt("what is your name?");
//
//window.alert(name);
//2. Create an application that prompts the user for their na... | true |
f69f3346582fe4a04cb4fa41c89451f579346cdf | JavaScript | desterab/my_research | /psiturk-example/static/js/mealMaker_confusion.js | UTF-8 | 2,131 | 3.265625 | 3 | [] | no_license | const menu = {
_courses: {
_appetizers: [],
_mains: [],
_desserts: [],
get appetizers() {
return this._appetizers;
},
set appetizers(appetizerIn) {
this._appetizers = appetizersIn;
},
get mains() {
return this._mains;
},
set mains(mainIn) {
this._mains = mainsIn;
}... | true |
2acdb961cf333fb3a66c45571e33ef83697c90f2 | JavaScript | prof-Devs/Prof-Devs-backend | /src/modules/course.js | UTF-8 | 817 | 2.515625 | 3 | [] | no_license | // 'use strict';
// const allCourses = [];
// const Course = require ('../models/student');
// const createCourse = (id,name ) => {
// const courseKey = (length = 8) => {
// return Math.random().toString(10).substr(2, length);
// };
// const mycourse = {
// id = courseKey,
// name,
// };
// all... | true |
3a0496e9d86ee48d792f81c9bd53c31435cbca6d | JavaScript | Abraham-newbie/bericht | /src/components/Markdown/replaceText.js | UTF-8 | 415 | 2.5625 | 3 | [
"MIT"
] | permissive | const replace = (node, replacements) => {
let value = node.value;
let children;
if (node.children) {
children = node.children.map(n => replace(n, replacements));
}
if (node.type === 'text' && value) {
Object.keys(replacements).forEach(key => {
value = value.replace(`{${key}}`, replacements[key])... | true |
a868102940c7bb6e5c8ee719ccd3ee7317027d35 | JavaScript | scroll17/media-download-extensions | /extension/popup/App.jsx | UTF-8 | 2,710 | 2.625 | 3 | [] | no_license | import React, { useState } from 'react';
function exec(code) {
return new Promise(resolve => {
chrome.tabs.query({ active: true, currentWindow: true }, tabs => {
chrome.tabs.executeScript(
tabs[0].id,
{
code: code
},
... | true |
d91bd7b1a3f3904c790faf08636097bf0102de20 | JavaScript | sinigers/SoftUni-Study | /JS-ProgramInBasics/conditionalStatm - Plus/workingHours.js | UTF-8 | 246 | 3.296875 | 3 | [] | no_license | function workingHours(hour, day) {
let h = Number(hour);
if (day === "Sunday" || h < 10 || h > 18) {
console.log("closed");
} else if (h >= 10 || h <= 18) {
console.log("open");
}
}
workingHours("1", "Monday"); | true |
5f4b204fb361005956e4718978c5f5094a4d2835 | JavaScript | tak074/CodingExercises | /leetCode/search2DMatrixII.js | UTF-8 | 1,525 | 3.484375 | 3 | [] | no_license | var searchMatrix = function(matrix, target) {
return check(0,0, matrix, target);
};
const check = function(row, col, matrix, target) {
if (row > matrix.length - 1 || col > matrix[0].length - 1) return false;
if (matrix[row][col] === target) return true;
if (matrix[row][col] > target) return false;
... | true |
be3501d1d2230b7aacd7acccf382a859d9c49f8b | JavaScript | sbilly/ppmessage | /ppmessage/ppcom/src/service/task.js | UTF-8 | 826 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | Service.$task = ( function() {
var todoList = [],
repeatList = [],
DEFAULT_TIME = 1000;
return {
plan: plan,
cancel: cancel,
repeat: repeat,
cancelRepeat: cancelRepeat
}
function plan( id, event, time ) {
todoList [ id ] = $timeout( event, time... | true |
4f7c5c337398f3a45a75f6a1204514ada28226c5 | JavaScript | ZehCnaS34/rebar | /src/modules/AudioEngine/reducer.js | UTF-8 | 273 | 2.515625 | 3 | [] | no_license | import { SET_VOLUME } from "./constants";
const initialState = {
volume: 75
};
export default function(state = initialState, action) {
switch (action.type) {
case SET_VOLUME:
return { ...state, volume: action.target };
default:
return state;
}
}
| true |
8a7d247cbf315f63aa418bf337d468cfb6fb37cb | JavaScript | kenken64/js-module-exports | /app.js | UTF-8 | 884 | 3.390625 | 3 | [] | no_license | // flat js
require('./testAA');
// directory/js
require('./testA/testB');
//one by one exports
const objAB = require('./testAB');
console.log(objAB);
console.log(objAB.sayHelloInEnglish());
console.log(objAB.sayHelloInEnglish2());
console.log(objAB.sayHelloInEnglish3());
// one block of exports
const objAC = require... | true |
a3440edf478bb94c9895f72956cf9c9964ca0eb1 | JavaScript | julienlapointe/udemy-mongodb | /users/test/association_test.js | UTF-8 | 4,725 | 2.96875 | 3 | [] | no_license | // add the NodeJS "assert" module to build assertions for unit testing
const assert = require("assert");
// add the User, BlogPost and Comment "collections" / "classes" / "models" to be tested
const User = require("../src/user.js");
const BlogPost = require("../src/blogPost.js");
const Comment = require("../src/comment... | true |
c75e96159f4c6a8712a6a370c36961f51565432f | JavaScript | brian-devops/eloquent-js | /04-data-structures/the-sum-of-a-range.js | UTF-8 | 461 | 4.34375 | 4 | [] | no_license | // Your code here.
function range(start, end) {
let result = [];
for (let i = start; i <= end; i++) {
result.push(i);
}
return result;
}
function sum(arr) {
let count = 0;
for (let i = 0; i <= arr.length; i++) {
if (arr[i] >= 0) {
count += arr[i];
}
}
return count;
}
console.log(range... | true |
c6a66c4038dccd178aedec3549841455e0779f8b | JavaScript | dtle82/react-chess | /react-chess/src/helpers.js | UTF-8 | 6,000 | 2.890625 | 3 | [] | no_license | export const factory_piece = function(
name,
emoji,
color,
moveset,
location,
history,
captureSet,
status
) {
const piece = {
isFree: true,
getName: function() {
return this.name;
},
getColor: function() {
return this.color;
},
getMoveset: function() {
return... | true |
fcfaad58803e31d2dcda698f10486cb3c5060ab6 | JavaScript | coddingbear/doit_nodejs | /Mission/mission01/mission01.js | UTF-8 | 1,202 | 3.875 | 4 | [] | no_license | /**
* Do it! 도전 문제 :
* 01. 파일의 내용을 한 줄 씩 읽어 들여 화면에 출력하는 기능을 만들어 보세요.
* (1) 하나의 파일을 만들고 각 줄에는 공백으로 구분된 이름, 나이, 전화번호가 들어가도록 구성합니다.
* (2) 파일의 내용을 한 줄씩 읽어 들이면서 각 정보를 공백으로 구분합니다.
* (3) 구분된 정보 중에서 이름만 화면에 출력합니다.
***************************************************************************************************/
const f... | true |
e5cd2918f48257d0b33e90c452b7cc09bd2cc045 | JavaScript | tobyhwang/CS491_Final_Project | /the_mixologist/src/Drink.js | UTF-8 | 954 | 2.65625 | 3 | [] | no_license | import React, { Component } from 'react';
import { ListGroupItem, Badge } from 'reactstrap';
class Drink extends Component {
constructor(props){
super(props);
this.expandInfo = this.expandInfo.bind(this);
}
//This function calls from the parent component
expandInfo(){
... | true |
e5638e0430b397a0bd2c2e7caf10f5ae2888c5ca | JavaScript | savannahvaith/21Mar-FE | /JavaScript/09-ReqRes.js | UTF-8 | 1,763 | 3.515625 | 4 | [] | no_license | 'use strict';
const DIV = document.querySelector("#people");
const NAME = document.querySelector("#name");
const JOB = document.querySelector("#job");
const ALERT = document.querySelector("#onSuccess");
axios
.get("https://reqres.in/api/users")
.then((response)=>{
console.log(response);
for(le... | true |
a5e796401702c2faac8d1e74e9cc55acd96029f4 | JavaScript | HassanFouaad/postgresEcommerce | /validate/user.js | UTF-8 | 1,464 | 2.671875 | 3 | [] | no_license | const { validationResult, check } = require("express-validator");
const userSignUpValidator = () => {
return [
check("firstname", "First name is required!").notEmpty(),
check("lastname", "Last name is required!").notEmpty(),
check("email", "Email is required")
.notEmpty()
.withMessage("Plea... | true |
faf488efc2e3ff90e02e828bfa2e2f09fab1523d | JavaScript | thangl3/iCT-Flashcard | /html-layouts/assets/js/navi.js | UTF-8 | 1,136 | 2.625 | 3 | [
"MIT"
] | permissive | // ====================================
// Navigation modules to ajax load website components
$(document).ready(function(){
NaviGoto(NaviGetCurrentPage());
});
function NaviGetCurrentPage() {
let url = new URI(window.location.href);
if (url.search(true)["get"] !== undefined) {
return url.search(t... | true |
369d652690552ae4558d37cf4a850285b9d688b4 | JavaScript | oliveirajonathas/JavaScript_estudos | /Módulo F/aula16/funcao02.js | UTF-8 | 157 | 3.8125 | 4 | [] | no_license | function soma(n1=0, n2=0){
var s = n1 + n2
return s
}
var valor1 = 20
var valor2 = 10
console.log(`A soma entre ${valor1} e ${valor2} é ${soma()}`) | true |
c4c05b9ac0e4f314c75b93d3d8106ebbc198288f | JavaScript | deepankmehta95/node-wav-to-mp3-convert | /server.js | UTF-8 | 3,245 | 2.546875 | 3 | [] | no_license | const express = require('express')
const fs = require('fs')
const unzipper = require('unzipper')
const { transcodeMediaFile } = require('symbl-media')
const cron = require('node-cron')
const nodemailer = require('nodemailer')
const app = express()
// Custom Data for Extraction
let directory = '/home/rms/recordings/0/... | true |
b9dd24273b05fd9180bfb79c39df06b911d485af | JavaScript | johnmutuma5/Notes | /Javascript/Node/master class/apps/_relay-webserver/src/router/index.js | UTF-8 | 1,858 | 2.734375 | 3 | [] | no_license | class RouterNode {
constructor(subPath) {
this.subPath = subPath;
this.children = null;
this.runners = null;
}
extrude(subPath, runners) {
this.children = this.children ? [...(this.children)] : [];
const childNode = new RouterNode(subPath);
this.children.push(childNode);
if(runners &&... | true |
432132f9b22ab76ede4f953f05e4dc4680f97c48 | JavaScript | ngolba/TriviaGame | /assets/javascript/app.js | UTF-8 | 15,114 | 3.5625 | 4 | [] | no_license | // Constructors are a thing ...
// function Question(question, answer1, answer2, answer3, answer4, correctAnswerIndex) {
// this.question = question;
// this.answer1 = answer1;
// this.answer2 = answer2;
// this.answer3 = answer3;
// this.answer4 = answer4;
// this.correctAnswerIndex = correct... | true |
d426c7ef8c2cd364fd0aa132dee85232c43db123 | JavaScript | Reverbot/cotizador-criptomonedas | /src/Components/Formulario.jsx | UTF-8 | 2,426 | 2.75 | 3 | [] | no_license | import React, {useEffect, useState} from 'react'
import styled from '@emotion/styled'
import useCriptomoneda from '../Hooks/useCriptomoneda'
import useMoneda from '../Hooks/useMoneda'
import Axios from 'axios'
import Error from './Error'
const Boton = styled.button`
margin-top : 20px;
font-weight : bold;
... | true |
56439328f6c9509653e48f8755368494f060bacf | JavaScript | kaosat-dev/shader-fu | /src/proto1-basics/transformsGizmo.js | UTF-8 | 1,724 | 2.578125 | 3 | [
"MIT"
] | permissive | var glslify = require('glslify-sync') // works in client & server
export function makeCube () {
const size = 2
const positions = [
-1, -1, -1,
1, -1, -1,
1, -1, 1,
-1, -1, 1,
-1, 1, -1,
1, 1, -1,
1, 1, 1,
-1, 1, 1,
].map(p => p * size * 0.5)
/*const cells = [
0, 1, 2, // b... | true |
e219a2f495f67b8a635a1356a1ec86345f24a380 | JavaScript | Thunderducky/rogueish | /client/src/js/fov.js | UTF-8 | 3,428 | 3.234375 | 3 | [] | no_license | // so let's think about the grid
// . . . . . . .
// . . . . . . .
// . . . . . . .
// . . . @ . . .
// . . . . . . .
// . . . . . . .
// . . . . . . .
// divide things right into octants
// 9 8 7 6 . . .
// . 5 4 3 . . .
// . . 2 1 . . . NNW
// . . . @ . . .
// . . . . . . .
// . . . . . . .
// . . .... | true |
3970ffdb3fff3b98df114d2203e2f6076a1874ae | JavaScript | katieperca/1129585-keksobooking-20 | /js/pin.js | UTF-8 | 963 | 2.71875 | 3 | [] | no_license | 'use strict';
(function () {
var openCard = function (data) {
var isMapCard = document.querySelector('.map__card');
var cardContainer = document.querySelector('.map');
if (isMapCard) {
isMapCard.remove();
}
window.map.renderCards(cardContainer, data);
};
var templatePin = document.quer... | true |
4f39cfce8667611bdcd6fbbc7955f779d38460e0 | JavaScript | WeiZheng78/Pinterest-Clone | /server/Authentication_Config/routes.js | UTF-8 | 1,734 | 2.53125 | 3 | [
"MIT"
] | permissive | // main authentication router
const isLoggedIn = require('./isloggedin');
const authRoutes = (app, passport) => {
// wether a user is logged in or not json data will show up on the profile page
app.get('/auth/profile', isLoggedIn, (req, res) => {
const headerObject = req.headers; // need for ip
let ip = (hea... | true |
33081277c8fcf70ae00c42a1cfdf310e0294155f | JavaScript | Harrylever/JavascrpitNotes | /Functional_Programming.js | UTF-8 | 7,976 | 4.15625 | 4 | [] | no_license | //***************************************************************************************************************
//HIGHER ORDER FUNCTIONS
var array1 = [1,2,3,4,5,6,7,8];
function forEach(array, callBack) {
for (var i = 0; i < array.length; i ++) { // Call calBack();
callBack(array[i]); ... | true |
9d3d324cbd5aa8b321d548830d88ac3a5231c9ea | JavaScript | Viktorjs/Web-application | /Animation.js | UTF-8 | 8,217 | 2.53125 | 3 | [] | no_license | $(document).ready(function () {
$(".btn").click(function () {
$("#login").fadeIn(800);
});
});
$(document).ready(function () {
$(".logbtn").click(function () {
$("#page1").fadeIn(800);
});
});
$(document).ready(function () {
$(".regknapp2").click(function ... | true |
98d3e3f859d936aa43805f4fda86dfdb7720b263 | JavaScript | NataliiaLazorenko/crackingJS | /lesson-5/stack-example.js | UTF-8 | 1,062 | 3.65625 | 4 | [] | no_license | (() => {
const animalsObj = {
dog: true,
cat: true,
horse: true,
};
const getAllAnimals = () => Object.keys(animalsObj);
const getSomeAnimal = (animal, animalsList) =>
animalsList.filter((animalFromList) => animal === animalFromList);
const saveToLS = (data) =>
localStorage.setItem("ani... | true |
53a3377979daa62e1afdcee14e945e0c4073910e | JavaScript | codinglist/github | /tour/js/content2.js | UTF-8 | 4,370 | 2.734375 | 3 | [] | no_license |
var slideIndex = 1;
showSlides(slideIndex);
function plusSlides(n) {
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
var i;
var slides = document.getElementsByClassName("mySlides");
var dots = document.getElementsByClassName("dot");
if (... | true |
c310f9f554fe31f61b195ef264ebec827040e0b3 | JavaScript | socalledsound/revolutions | /js/index.js | UTF-8 | 3,994 | 3.46875 | 3 | [] | no_license | const container = document.querySelector('#target-container');
const form = document.querySelector("#myForm");
form.addEventListener('submit', validateForm);
function validateForm(e) {
e.preventDefault();
const fields = ["name", "chips", "vision"];
const values = [];
for (let i = 0; i < fields.leng... | true |
79548d5a5521df8504743da69c87f86468caed16 | JavaScript | jefferdo/Material-flow-with-quality-module | /test/test.js | UTF-8 | 4,080 | 2.625 | 3 | [] | no_license | $(document).ready(function () {
function hasMatch(JSON, key, value) {
var hasMatch = false;
for (var index = 0; index < JSON.length; ++index) {
var line = JSON[index];
if (line[key] == value) {
hasMatch = true;
break;
}
}
... | true |
3dc526f8bdb6d1ee0aa32ff255e07451909473f6 | JavaScript | mjyplusone/leetcode | /405. Convert a Number to Hexadecimal(easy).js | UTF-8 | 469 | 3.40625 | 3 | [] | no_license | /**
* @param {number} num
* @return {string}
*/
var toHex = function(num) {
var hex = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
if (num === 0) return '0';
// 无符号右移得到负数的补码表示
if (num < 0) {
num = num >>> 0;
}
var res = [];
while (num... | true |
6158f7c022412a4cd550405a50c294958665e4e8 | JavaScript | Relativiteit/OOP_Python | /FirstClassFunctions.js | UTF-8 | 369 | 3.9375 | 4 | [] | no_license | function square(x) {
return x * x
}
var f = square
console.log(square)
console.log(f(5)) // first class function
function my_map(func, arg_list) {
result = []
for (var i = 1; i <= args_list.length; i++) {
result.push(func(i))
}
return result
}
var squares = my_map(cube, [1, 2, 3, 4, 5])
console.log(s... | true |
6e53787cc4c57e7c4767e698ed84583d7c11b80e | JavaScript | rustwasm/wasm-bindgen | /crates/js-sys/tests/wasm/Iterator.js | UTF-8 | 493 | 3.078125 | 3 | [
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | exports.get_iterable = () => ["one", "two", "three"];
exports.get_not_iterable = () => new Object;
exports.get_symbol_iterator_throws = () => ({
[Symbol.iterator]: () => { throw new Error("nope"); },
});
exports.get_symbol_iterator_not_function = () => ({
[Symbol.iterator]: 5,
});
exports.get_symbol_iterator_re... | true |
1ea310339a1cecfc3a01abc00869e01791d3078d | JavaScript | crei0/2020-DEV-024 | /src/App.test.js | UTF-8 | 1,545 | 2.609375 | 3 | [] | no_license | import React from 'react';
import { render, fireEvent, wait } from '@testing-library/react';
import { shallow } from 'enzyme';
import App from './App';
import Board from './components/Board';
describe('getInitialBoardState(...)', () => {
test('renders without crashing', () => {
const { getByText } = render(<Ap... | true |
5a5324c5635a0a32dccd5eada4292e20d1130f1c | JavaScript | Niyatihd/Data_Structures_and_Algorithms | /LC_Problems/valid_anagram.js | UTF-8 | 1,131 | 4.34375 | 4 | [] | no_license | // Given two strings s and t , write a function to determine if t is an anagram of s.
// Example 1:
// Input: s = "anagram", t = "nagaram"
// Output: true
// Example 2:
// Input: s = "rat", t = "car"
// Output: false
// Note:
// You may assume the string contains only lowercase alphabets.
// Follow up:
// What if the i... | true |
abede3412ebe10412c0f68b275d29f118b274ee6 | JavaScript | matiasla/api-rest | /src/routes/movies.js | UTF-8 | 1,702 | 3.140625 | 3 | [] | no_license | //DEPENDENCIES
const { Router } = require("express");
// ROUTER
const router = Router();
//DATA
const data = require("../data.json");
// GET
router.get("/", (req, res) => {
res.status(200).json(data);
})
// POST
router.post("/", (req, res) => {
const { title, director, year, rating } = req.body;
if ... | true |
5bef6bc863e6be344431f2d0066cbd46ff53a727 | JavaScript | eli-evans/sandbox | /Music/Key.js | UTF-8 | 2,011 | 2.71875 | 3 | [] | no_license | const Tonal = require('@tonaljs/tonal');
const Base = require('./Base.js');
const Scale = require('./Scale.js');
const Pitch = require('./Pitch.js');
/**
* A Key is used to set a key signature for a {@link Score}.
* It supports only major and minor scales.
* @param {string} key - the name of the key, eg, `C# Major`... | true |
29badd21b3a7a2ee34528b061f6d02dfa9db39f4 | JavaScript | AlejandraCP/TicTacToe | /js/app.js | UTF-8 | 680 | 3.265625 | 3 | [] | no_license | window.onload = function() {
var board = document.querySelector('.board');
board.addEventListener('click', addSimbol);
};
var centinel = false;
function addSimbol (event){
if(centinel){
event.target.textContent = 'O';
event.target.style.backgroundColor = '#EFF8FB';
event.target.style.fontSize = '100p... | true |
75b14112e8f70d4a4e5f1926107eed03591768fa | JavaScript | ofagbemi/dashboard-server | /routes/api/users/fetch.js | UTF-8 | 1,334 | 2.53125 | 3 | [] | no_license | const authMiddleware = require('../../../middleware/auth')
const User = require('../../../models/User')
const DEFAULT_LIMIT = 50
module.exports = function route(app) {
app
.get('/', authMiddleware, validateRoot, fetchUsers)
.get('/:id', authMiddleware, validateFetchById, fetchUserById)
}
function validate... | true |
b369c71684e42e80ee3ffb44ca23d85ca0f1c94f | JavaScript | eatingli/homebridge-accessory-faker | /playground/lightbulb-print-received/index.js | UTF-8 | 1,518 | 2.890625 | 3 | [] | no_license | function factory(Service, Characteristic) {
const service = new Service.Lightbulb('lightbulb-print-received');
service.getCharacteristic(Characteristic.On)
.on('get', (callback) => {
console.log('Get On ');
callback(null, true);
})
.on('set', (value, callback... | true |
bafef1787f9c71675f72c3a1fced6051d2485b68 | JavaScript | yanshanshan/yanshanshan.github.io | /1.js | UTF-8 | 9,835 | 3.546875 | 4 | [] | no_license | /**
* Created by db on 16/7/6.
*/
//
//var add = new Function(
// 'x',
// 'y',
// 'return (x+y)'
//
//);
//console.log (add(1,2));
//
//
//function add(x,y){
// return(x + y);
//}
//console.log(add(5,6))
//
//
//var foo1 = new Function(
// 'return "hello world"'
//);
//console.log(foo1())
//
//
//
//
... | true |
c10c98a61ae7f8e641cbe733f60bd1412faa915f | JavaScript | emveleva/JS-Fundamentals | /Mid-Terms/5 July 2020/2arrayModifier.js | UTF-8 | 1,350 | 3.546875 | 4 | [] | no_license | function solve(arr){
let initialValues = arr.shift().split(' ').map(Number);
while ((line = arr.shift()) !== 'end'){
let [command, arg1, arg2] = line.split(' ');
switch (command) {
case 'swap':
let swapIndex1 = Number(arg1);
let swapIndex2 = ... | true |
fa53841900c760d1bc971062f3ba9a9f71f7aaf4 | JavaScript | thrivesmart/radash | /app/assets/javascripts/campaigns.js | UTF-8 | 1,744 | 2.59375 | 3 | [] | no_license | // Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
// You can use CoffeeScript in this file: http://coffeescript.org/
var CampaignForm = {
flightTemplateHtml: null,
flightCount: 0,
init: function() {
this.flightTe... | true |
9157678a4ad99a7e82acafcc7029e29580cedfd8 | JavaScript | KatieSa/WeatherAppKatie | /src/index.js | UTF-8 | 5,872 | 3.796875 | 4 | [] | no_license | // variable
let humidity = document.querySelector("#humidity");
let h1 = document.querySelector("#locationName");
let todayIcon = document.querySelector("#todayIcon");
let citySearchForm = document.querySelector("form");
// variable where temperature need to be shown instead of text
let temperatureElement = document.q... | true |
99f777da40dda7debec6a79e700c7f3b9a9b605b | JavaScript | Ealinn/portfolio | /Independent_counters_JS/js/main.js | UTF-8 | 430 | 3.140625 | 3 | [] | no_license | var $square = document.querySelectorAll(".square");
$square.forEach(function (item) {
var $buttonPlus = item.querySelector(".button-plus");
var $buttonMinus = item.querySelector(".button-minus");
var $counter = item.querySelector(".counter");
$buttonPlus.addEventListener("click", function () {
$counter.text... | true |
f6d1d183beb42b617f9964bd2e0826c0efd3b574 | JavaScript | agnesbudhi/MidtermAgnes.appstudio | /forms/animalExtraXP/animalExtraXP.js | UTF-8 | 447 | 4.75 | 5 | [] | no_license | /*
Change the code in the new form by adding a for loop so the program runs exactly two times.
*/
/*
let animal = ["dog", "cat", "horse", "mouse", "pig", "cow", "ferret", "lizard", "frog"]
function animalTwice(lowerAnimal){
lowerAnimal = newAnimal.toLowerCase()
animal.push(lowerAnimal)
alert(`The last animal i... | true |
ddf163262e9bd7d92e80d9097a2c37bc6689e654 | JavaScript | abhishekbhan/notes | /assignments/week-1/control_flow_exercises/pluralizer.js | UTF-8 | 276 | 3.828125 | 4 | [] | no_license | var thing = prompt("Enter your thing you want pluralized: ")
var count = prompt("Enter the number of things you want: ")
var lenThing = thing.length;
if(count == 1 || count == 0)
console.log(count + thing);
else
var newthing = thing +"s";
console.log(count + newthing);
| true |
1eb4c671bbe9b2cd70094208e98ee53030410f2d | JavaScript | RogueParticle/kalido | /kalido.js | UTF-8 | 9,216 | 3.015625 | 3 | [] | no_license | var segments = 200,
length = 10,
width = 50,
widthIncrement = 5,
widthDuration = 10,
colorIncrement = 8,
colorDuration = 16,
linesEnabled = "true",
circlesEnabled = "true",
rectanglesEnabled = "false";
var xCoords = [];
var yCoords = [];
var colors = [];
var rColors = [];
var gColors = [];
var bColor... | true |
42679add91b89a30a385b8a197874eb5c7c66282 | JavaScript | Miaoza/- | /component/aatest/miaoza.js | UTF-8 | 9,286 | 2.65625 | 3 | [] | no_license | (function (root, _document){
var _body,
timer = 0,
parents = [],
lastParents = [];
setTimeout(function (){
_body = _document.body
getForItem();
});
/******************
*****for plugin****
*******************/
/**
*获取含有【za-for】属性的dom
*/... | true |
ac4bdcda8c18be5188b1e4ad44548ef8b4842df7 | JavaScript | akarsha-kn-xelp/node_practice | /models/product.model.js | UTF-8 | 1,812 | 2.875 | 3 | [] | no_license | var mysql = require('mysql');
var con = mysql.createConnection({
host: "localhost",
user: "user",
password: "",
database: "node"
});
con.connect(function(err) {
if (err) throw err;
console.log("Connected!");
});
module.exports = class Product {
constructor(name ='', price='') {
... | true |
40b70fe39726e09bc48151ccbcbf59354f4a238f | JavaScript | Liliaborrazas/e-s3-evaluacion-final-Liliaborrazas | /src/App.js | UTF-8 | 1,453 | 2.859375 | 3 | [] | no_license | import React, { Component } from 'react';
import { fetchHarry } from './services/harryService';
import CharacterList from './components/CharacterList';
import './App.css';
class App extends Component {
constructor(props){
super(props);
this.state = {
harry:[],
filter: ""
}
this.filterInpu... | true |
df0f6e18bc8e51e46a55374b6ce282dc9c6b38e2 | JavaScript | ankushCb/physician-portal | /src/client/app/scripts/modules/Common/FormElements/ReduxForm/Toolbox/TimingsText/index.js | UTF-8 | 799 | 2.515625 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
const renderDisplayTime = (time) => {
if (!time) { return null; }
const momentTime = moment(time, 'HH:mm:ss');
return (
<div className="display-time">
<div className="time">{momentTime.format('h:mm')}</div>
... | true |
1310826a1a276668a29823938a98257f80a75fb8 | JavaScript | Vladimir6332/brackets-old | /src/index.js | UTF-8 | 2,755 | 3.0625 | 3 | [
"MIT"
] | permissive | module.exports = function check(str, bracketsConfig) {
let openChars = [];
let closeChars = [];
let equalChars = [];
function checkEqualBrackets(a, b) {
if (b - a < 1) return true;
if ((b - a == 1) && equalChars.indexOf(arrStr[a])) return false;
arrCopy = arrStr.slice(a, b);
... | true |
238e02c001125d24332e4967e9bf81ce6e11ce85 | JavaScript | ryanlabouve/ember-cli-randoport | /tests/lib/randoport-test.js | UTF-8 | 1,446 | 2.96875 | 3 | [
"MIT"
] | permissive | "use strict";
const test = require('tape');
const randoPort = require('../../lib/randoport');
const _ = require('lodash');
const http = require('http');
test('empty object', t => {
t.plan(1);
const emptyObject = {};
const r = randoPort(emptyObject);
t.equal(typeof r.port, 'number');
});
test('object with ... | true |
655879d68e9e23faca38fd035fa88c9a377d479d | JavaScript | nicholasalanassociates/VFI-QA-Automation-challenge | /VF_Cypress_Automation/buyETHverifyTotal.spec.js | UTF-8 | 2,310 | 3.046875 | 3 | [] | no_license | //Tried a couple ways to try to debug this script using a combination of javascript, using the
// DOM however it seems that i'm getting a null value when trying to convert the value data of the
// inputs.
describe("buyETHverifyTotal", () => {
it('Proceed to https://www.binance.com/en/trade/ETH_BTC', () => {
// U... | true |
3e1631cdccb74c7330ff7ba18606eec147efca37 | JavaScript | tionix99/SolarSystem | /src/view/paint.js | UTF-8 | 3,775 | 2.625 | 3 | [] | no_license |
import {
Project,
Layer,
} from "paper";
import orbits from "../set/orbits.js";
import scaleSet from "../set/scaleSet.js";
import AstroObject from "./AstroObject.js";
const blueColor= "#006fffcc";
const orangeColor= "#ff6300";
const blackColor= "black";
var SolarSystem;
var vectorLayer;
var orbitLayer;
var ob... | true |
4f7683620570d78831677f55730faf9dba859f29 | JavaScript | vad2der/D3js | /script/interactiveDiagram.js | UTF-8 | 6,877 | 2.640625 | 3 | [
"MIT"
] | permissive | // function* f(prev = null, current = 0, next = 1) {
// yield current;
// yield *f(prev-1, next, current + next);
// }
// b = f();
// var a = function(){
// document.getElementById("result").append(b.next().value+", ");
// }
// window.a=a;
var interactiveDiagram = function(){
var data = {
n... | true |
01f7f2b6cd0a1532429789e7f6aac9d17a95327c | JavaScript | kohie632/birth-count2 | /app/static/javascript/marubatsu.js | UTF-8 | 8,374 | 3.5 | 4 | [] | no_license | class Game{
constructor(){
this.reset();
}
reset(){
this.board = [0, 0, 0, 0, 0, 0, 0, 0, 0];
this.Sente = 1;
this.Gote = -1;
this.teban = this.Sente;
this.winner = 0;
this.end = false;
for(let i = 0; i < 9; i++){
this.update(String(i))
}
const sp = document.getEleme... | true |
1798caa29cdc0a973f65d759b26f9c2354724553 | JavaScript | jkmounts/MemberManager | /public/js/Member.js | UTF-8 | 492 | 2.96875 | 3 | [] | no_license | console.log("Member.js Connected");
class Member {
constructor(name, email) {
this.name = name;
this.email = email;
}
async addToDB() {
const options = {
method: 'POST',
body: JSON.stringify(this),
headers: {
"Content-Type": "appl... | true |
183444c10e397b4774529ecd92b357c34a815ffb | JavaScript | sean-codes/cs-engine | /test/parts/inputKeyboard.js | UTF-8 | 2,357 | 2.875 | 3 | [] | no_license | /* global cs, testUtility */
var exampleKeyBoardEvent = {
keyCode: 39,
preventDefault: () => {}
}
var exampleKeyBoardEvent2 = {
keyCode: 40,
preventDefault: () => {}
}
testUtility.test({
collapse: true,
title: "cs.inputKeyboard",
tests: [
{
name: 'keyEvent down/up',
shoul... | true |
b2b4c5d5d5cb71dd3efe299003ab2cfd4cac2b9a | JavaScript | Pelumi527/waves-portal | /src/App.js | UTF-8 | 4,118 | 2.6875 | 3 | [] | no_license | import './App.css';
function App() {
// just a start variable that stores our user's public //wallet address
const [currAccount,setCurrentAccount] = useState("");
const [isLoading,setIsLoading] = useState(false)
const [allWaves, setAllWaves] = useState([]);
const[message, setMessage] = useState("")
cons... | true |
6528b221082cbea46b1265fe530f9e7e981a4396 | JavaScript | zpfarmer/assignments | /Assignments/FSW-130/Week 7/Capstone/my-app/src/redux/cities.js | UTF-8 | 705 | 3.125 | 3 | [] | no_license | import cityList from "../dataArrays/cityList"
export function addCity(city) {
return {
type: "ADD_CITY",
payload: city
}
}
export function deleteCity(city) {
return {
type: "DELETE_MOVIE",
payload: city
}
}
function cityReducer(cities = cityList, action) {
switch (... | true |
91c4399b001a7dc74ff04786509ff759622e1175 | JavaScript | qxk123321/weixinxiaochengxu | /miniprogram-7/pages/music/music.js | UTF-8 | 2,955 | 2.546875 | 3 | [] | no_license | // pages/music/music.js
Page({
data: {
item:0,
tab:0,
playlist:[{
id:1,title:'钢琴协奏曲',singer:'肖邦',
src:'http://localhost/03.mp3',coverImgUrl:'../images/k.jpg'
}, {
id: 1, title: '奏鸣曲', singer: '莫扎特',
src: 'http://localhost/03.mp3', coverImgUrl: '../images/k.jpg'
}, {
... | true |
5097872c0581bd69b1ebc6db55fc64026fe3e54d | JavaScript | jaames/kakimasu | /src/charsets/index.js | UTF-8 | 859 | 3.0625 | 3 | [
"MIT"
] | permissive | // import charset JSONs
import hiragana from "./hiragana/compiled.json";
import katakana from "./katakana/compiled.json";
var charsets = {
hiragana,
katakana,
}
var findItemById = function (set, id) {
var ret = set.filter((item) => {
return item.romaji === id;
});
return ret.length > 0 ? ret[0] : null;
... | true |
85015da62fa4e29589ca7dd257dbcd84e0004ad4 | JavaScript | orionsa/nativescript-poc | /app/pages/seekbar-video/seekbar-video-vm.js | UTF-8 | 5,643 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | const Observable = require("tns-core-modules/data/observable").Observable;
const maxDuration = 10000000 ;
const minDuration = 0;
const minimumSeekableTime = 5000
const START_TIME = "startTime";
const END_TIME = "endTime";
const CURRENT_TIME = "currentTime";
const SLIDER_VALUE = "sliderValue";
const SECONDS_TO_TRIM ... | true |
1819bf37de8a93f8f9a8ebf804fdd8094bf9a07e | JavaScript | czarnia/TpSistemasGraf | /Primitivas/supFan.js | UTF-8 | 8,503 | 2.78125 | 3 | [] | no_license | function SupFan(){
this.position_buffer = [];
this.webgl_position_buffer = null;
this.index_buffer = [];
this.webgl_index_buffer = null;
this.color_buffer = [];
this.webgl_color_buffer = null;
this.texture_buffer = null;
this.webgl_texture_buffer = null;
this.normal_buffer = [];
this.webgl_norm... | true |
b2c85f7200fd7d639daf76ed18cf15529e21d2e5 | JavaScript | Jidnyasa-raut/trial | /pong.js | UTF-8 | 820 | 3.40625 | 3 | [] | no_license | const canvas = document.getElementById("pong");
const context = canvas.getContext("2d");
context.fillStyle = "black";
context.fillRect(100,200,50,75);
context.fillStyle = "red";
context.beginPath();
context.arc(300,350,100,0,Math.PI*2,false);
context.closePath();
context.fill();
function drawRect(x,y,w,h,color){
... | true |
154d9deba176154b81f285e4cc8656a7d1fc8fd1 | JavaScript | LiYifan93/CYCLOUD | /jsp/scripts/usermanage.js | UTF-8 | 6,436 | 2.609375 | 3 | [] | no_license | $('button[name="refresh"]').hide()
$('button.remove[title="Remove"]').hide()
$('#refresh').click(function(){
$('#searchUserName').val('')
$('#searchSex').val('')
$('#searchEmail').val('')
$('#searchPhone').val('')
$('#searchMobile').val('')
$('button[name="refresh"]').click()
})
//搜索
$('#searchButton').click(... | true |
9f4427c9c02329f461bbe45f28a3e5b213a6f6c0 | JavaScript | vzuev-ha/1487995-keksobooking-20 | /js/kb-backend.js | UTF-8 | 2,544 | 3.046875 | 3 | [] | no_license | 'use strict';
(function () {
/**
* Подготовка HTTP-запроса
* @param {function(Array)} onSuccess Функция, выполняемая в случае успеха
* @param {function(string)} onError Функция, выполняемая в случае неудачи
* @return {XMLHttpRequest} Подготовленный объект Запрос
*/
function prepareXMLHttpRequest(on... | true |
bc8665ad53bd7ed6dd642ff54cc5d4baed77f0ef | JavaScript | KosukeTakahashi0410/chat-app | /src/pages/Signup.js | UTF-8 | 2,753 | 2.875 | 3 | [] | no_license | import { useState } from 'react'
import { Link, useHistory } from 'react-router-dom'
import firebase from '../firebase_config'
const Signup = () => {
// よくわからない、、、これは一体何なんだ、、、
let history = useHistory()
// ユーザーネーム
const [name, setName] = useState("")
// メールアドレス
const [email, setEmail] = useState("")
// パ... | true |
b38754b1581faee2d2b245424b08e541c0132afd | JavaScript | Criaden/sprint2Assignment | /script.js | UTF-8 | 1,120 | 2.96875 | 3 | [] | no_license | function checkSubmitted(){
var formValid = false;
var majorValid = false;
var gradeValid = false;
var pizzaValid = false;
var emailValid = false;
var email = document.getElementById("email");
if(!email == ""){
emailValid = true;
}
radio = document.getElementsByName("userMajor");
... | true |
2df2505449cd0163c3aaca5364f30c69dc85d39f | JavaScript | vclee/phase-0-tracks | /js/data_structures.js | UTF-8 | 810 | 3.640625 | 4 | [] | no_license | var colors = ["red", "blue", "violet", "green"];
var names = ["Ed", "Patrick", "Fred", "Bob"];
function horses (horse_colors, horse_names) {
var horses = {};
for (var i = 0; i < colors.length; i++) {
horses[names[i]] = colors[i];
}
return horses;
}
console.log(colors);
console.log(names);
colors.push("yellow")... | true |
75d06da995dac839487ebd70fad0d8a6be50f120 | JavaScript | zxy-Jennifer/Algorithm-offer-JavaScript | /字符串/678. 有效的括号字符串.js | UTF-8 | 1,536 | 4.21875 | 4 | [] | no_license | /**
* 递归
* @param {*} s
*/
function checkValidString1(s) {
return dfs(0, 0);
function dfs(count, start) {
if (count < 0) {
return false;
}
for (let i = start; i < s.length; i++) {
let c = s[i];
if (c === "(") {
count++;
} else if (c === ")") {
if (count-- === ... | true |
db538770722536447efb02badc7ee396dc82fece | JavaScript | roggc/teachers-students | /src/redux/reducers/students.js | UTF-8 | 1,633 | 2.78125 | 3 | [] | no_license | import {STUDENTS_CREATE,STUDENTS_DELETE,STUDENTS_BEINGEDITED,STUDENTS_SAVE}
from '../actions/students'
const initialState={
students:[],
beingEdited:false
}
const create=(state,action)=>{
return {
...state,
students:state.students.concat(action.student)
}
}
const deleteStudent=(state... | true |
b212f89e4f8175f28963199f3676a9e371be528d | JavaScript | victormorozov1/landing | /assets/js/main.js | UTF-8 | 3,134 | 2.859375 | 3 | [] | no_license | $(document).ready(function(){
let blur = 0;
function set_info(id, cost, people, mark){
$(statistics_node).children("#cost").children("p").text(cost + " млн. $");
$(statistics_node).children("#people").children("p").text(people + " тыс.");
$(statistics_node).children("#mark").children("p... | true |
7b14c851d3a1cedad98d585829c649a8addff62d | JavaScript | CristiansZorrillap/Taller_3 | /P5 ejemplos/Rectangle.js | UTF-8 | 289 | 3.265625 | 3 | [] | no_license | class Rectangle
{
constructor(name, posX, posY, height, width)
{
this.name = name;
this.x = posX;
this.y = posY;
this.height = height;
this.width = width;
}
mostrar()
{
stroke(0);
strokeWeight(0.8);
rect(this.x,this.y,this.width,this.height);
}
} | true |
fdcfe6bc309facb4e5f2eabf7cbdab3cda704c1c | JavaScript | Sirojjjka/ItCraft | /src/components/DataFetch.js | UTF-8 | 755 | 2.515625 | 3 | [] | no_license | import React, {useState, useEffect} from 'react';
import { StyleSheet, Text, View } from 'react-native';
import axios from 'axios';
import Cards from './Cards'
const DataFetch = ({navigation}) => {
let [users,setUsers] = useState([]);
let [posts,setPosts] = useState([]);
const urlUser = 'https://jsonplacehol... | true |
8ea00cee5db0f1862e742eea5c2967bbd998ea97 | JavaScript | maenp/juanPi | /src/lib/swiper/index.js | UTF-8 | 6,162 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react'
import { SwiperContainer } from './styled'
class Swiper extends Component {
constructor(props) {
super(props)
this.state = {
len: 0,//图片个数
countWidth: 0,//总宽度
imgIndex: 0,//图片下标
spotIndex: 0,//指示点下标
... | true |