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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2eb17e63aba06dba8dd15fa3d29984669d87d371 | JavaScript | BlackYoup/leapZoom | /js/m/zoom.model.js | UTF-8 | 3,421 | 2.671875 | 3 | [] | no_license | function ZoomModel(){
var self = this;
this.Leap = null;
this.waitForFrame = null;
this.currentFrame = null;
this.previousFrame = null;
this.currentIndexesFingersPos = null;
this.previousIndexesFingersPos = null;
this.zoomUpdates = [];
this.zoomObject = null;
this.haveUpdate = function(){
emitter.emit('v... | true |
a99e16c2a1bcff881b8ed9204fd29686bf8ef6ac | JavaScript | iJayRathod/ijayrathod.github.io | /colorgame/js/script.js | UTF-8 | 3,313 | 3.53125 | 4 | [] | no_license | var easyBtn = document.querySelector("#easybtn");
var hardBtn = document.querySelector("#hardbtn");
var newGame = document.querySelector("#newgame");
var numColors =6;
var tilesColorArr= randomColorGenerator(numColors);
var tiles = document.querySelectorAll(".tile");
var result = document.querySelector("#result");
setS... | true |
5d33978d72e21fed80b953ef455db1e766e09d38 | JavaScript | jonreading81/Algorithms | /src/countDistinctSlices.js | UTF-8 | 498 | 2.921875 | 3 | [] | no_license | const solution = function (n, A) {
let front = 0;
let back = 0;
let found = [];
let count = 0;
for (back = 0; back < A.length; back++) {
front = back;
found = [];
while (front < A.length) {
found.push(A[front]);
count++;
if (count > 1000000000) {
return 1000000000;
... | true |
08e20f7414c2d2c4b41a1ea9eb3addaf090a39bd | JavaScript | maksimlya/electronSchedule | /src/mainProcess/excelParser.js | UTF-8 | 4,397 | 2.546875 | 3 | [] | no_license | const { days } = require('./constants');
const ExcelJS = require('exceljs');
const nodemailer = require('nodemailer');
const homedir = require('os').homedir();
const desktopDir = `${homedir}/Desktop`;
const transporter = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 587,
secure: false,
aut... | true |
bb28b6edaf5f319d18dd8826038efbd2d29a97e6 | JavaScript | naoko3in4/3months_challenge | /concentration_retry/main.js | UTF-8 | 2,364 | 4.0625 | 4 | [] | no_license | const cards = [];
const pairs = 13;
let flipCount = 0;
let firstCard = null;
let secondCard = null;
//init
function init() {
let card;
for (let i = 1; i <= pairs; i++) {
// creatCards呼び出す→cards[]配列に足していく
cards.push(createCards(i));
cards.push(createCards(i));
}
// Domに配列の中からランダムに1つ取り出したものをappendする... | true |
eb7acf3c2b982deb3cbff71eaaabf789341e2d68 | JavaScript | shiichi/app_front_public | /src/js/reducers/selector.js | UTF-8 | 2,200 | 2.53125 | 3 | [] | no_license | import {
SET_TYPE_STATUS,
CHANGE_TYPE_CHECKED,
SET_PLACE_STATUS,
CHANGE_PLACE_ACTIVE,
CHANGE_PLACE_CHECKED,
CHANGE_WEEK
} from '../constants/ActionTypes';
const initialState = {
flightTypes: [
{id: null, name: '', en: '', checked: true},
{id: null, name: '', en: '', checked: false},
{id: null... | true |
1d12ecef9ee17f202bd02558ebc97c38365f6a93 | JavaScript | Muntarin/ReactJs | /src/components/Card.js | UTF-8 | 719 | 2.796875 | 3 | [] | no_license | /*
const hi="Welcome";
const month= new Date();
const currentmonth= month.getMonth();*/
/*const headingstyle ={
backgroundColor : "purple",
color : "red",
textAlign : "center",
padding : "15px"
}*/
const date = new Date();
const day = date.getDate();
const newMonth = date.getMonth();
const year =... | true |
6981f0bd871a6042b486d359e2e8c1b600db8e96 | JavaScript | Matthew921-hub/projectUdem | /js/script3.js | UTF-8 | 512 | 3.359375 | 3 | [] | no_license | "use strict"
const str = "7бун 30коп + 8бун 20 коп";
function qq(str){const array = str.split(" ");
let sumBun = 0,
sumCop = 0;
for(let i = 0; i < array.length; i++){
if(array[i].slice(-3) == "бун"){
sumBun = sumBun + +array[i].slice(0, array[i].length-3);
} else {
sumCop = sumCop + +array[... | true |
d3c745ea5ac85dcfd25764757f2a41aa30d6ccdb | JavaScript | jeffreyj123/SpaceInvaders | /app/view1/uiClasses/alien.js | UTF-8 | 2,341 | 2.796875 | 3 | [
"MIT"
] | permissive | uiClasses.factory("Alien", ['loaderSvc', 'Projectile', function (loaderSvc, Projectile) {
function Alien(obj) {
/* if (obj.characterAssetName != 'alien4') {
var spriteSheet = new createjs.SpriteSheet({
framerate: 30, // edit the values
images: [loaderSvc.getResult(obj.characterAssetName)],
... | true |
4b3e46ed91ed09ac13a5e659b9ea144de8c3cbed | JavaScript | scarletjs/scarlet | /tests/spec/events/assertions/eventMethodAssertion.js | UTF-8 | 396 | 2.65625 | 3 | [] | no_license | var assert = require("assert");
module.exports = function (eventSpy,method,expectedResult,parameters,eventName) {
describe("when "+eventName+" event fired on a method with return called",function(){
before(function(){
eventSpy.reset();
try{
method.apply(method,parameters);
}catch(exception){}
});
... | true |
c56cddf0196ec66366d55475a294b76198503254 | JavaScript | dmitrydwhite/tuples | /tuples.js | UTF-8 | 1,131 | 3.078125 | 3 | [
"MIT"
] | permissive | var _ = require('lodash');
var singles = ['name', 'JSI', 'location', { city: 'Portland', 'state': 'OR' }, 'school', 'PCS'];
var pairs = [['name', 'JSI'], ['location', { city: 'Portland', 'state': 'OR' }], ['school', 'PCS']];
var nums = ['1', '2', '3', '4', '5', '6'];
var classData = _.reduce(pairs, function (obj, t... | true |
94a8df9fcccab7e0b407b98118f0d836931a9625 | JavaScript | pawan92/Twitch-Streamer | /js/index.js | UTF-8 | 2,264 | 2.921875 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
//initiale and declare array of channels
var channels = ["freecodecamp", "storbeck", "terakilobyte", "habathcx", "RobotCaleb", "thomasballinger", "noobs2ninjas", "beohoff", "monstercat", "comster404","streamerhouse"];
//Loop through each element in the array to output which channel... | true |
6552d85e8da90f1b6977f75a391aa3d397011648 | JavaScript | RolandR/pamphlet-stand | /main.jscad | UTF-8 | 1,681 | 2.890625 | 3 | [] | no_license |
function main(){
// all dimensions in mm
var insideWidth = 148; // width of brochures
var widthMargin = 2; // how much space on each side of brochures
var insideThickness = 20; // maximum thickness of stack of brochures, so to speak
var wallThickness = 1.5;
var standHeight = 60;
var cutoutMargin = 10;
... | true |
41945d55c204bc858d75a4889a81ae677a38daba | JavaScript | chrisMGcoding/JS-----Les-Conditions | /Exercice_1/src/JS/main.js | UTF-8 | 1,065 | 3.65625 | 4 | [] | no_license | // 1.
console.log(1 == "1");
// 2.
console.log(1 === "1");
// 3.
let Surname = prompt("quel est ton prénom ?");
if (Surname.length < 5) {
alert("ton nom est trop court");
}
else {
alert("nom assez long");
}
// 4.
let Addition = prompt("10 + 10 ?");
if (Addition == 20) {
alert("félicitations !")
}
else {
... | true |
bf9114eef0708172a4f4435fbce8c32ed00b4709 | JavaScript | niceilm/meteor-astronomy | /lib/modules/fields/utils/castToClass.js | UTF-8 | 494 | 2.65625 | 3 | [
"MIT"
] | permissive | function castToClass(args = {}) {
const {
Class,
rawDoc,
options
} = args;
// If the class has a type field, then we have to check if we are
// casting to some of the nested classes.
const typeField = Class.getTypeField();
if (typeField) {
const ChildClass = Class.get(rawDoc[typeField]);
... | true |
abb71828d1b09415f759f5f5ab728f6dc013ed66 | JavaScript | lss1ash/nodeClassesTest | /index.js | UTF-8 | 5,842 | 3 | 3 | [] | no_license | 'use strict';
(function (app) {
var ERROR_CLASS = 'error';
var FIO_WORDS_COUNT = 3;
var PHONE_SUM = 30;
var HTTP_SUCCESS = 200;
var errorFields;
var myForm = document.getElementById('myForm');
var inputFields = {
fio: myForm.querySelector('#fio'),
email: myForm.querySelector('#email'),
p... | true |
955fe14ea972ae0f7b9874c83edcda5ae5163f02 | JavaScript | hlnmargary/chooseyourcharles | /src/js/script.js | UTF-8 | 2,782 | 2.890625 | 3 | [] | no_license | var glassesList = document.querySelectorAll('.glassesList');
var beardsList = document.querySelectorAll('.beardsList');
var hatsList = document.querySelectorAll('.hatsList');
var beardsChoice = document.querySelectorAll('.beardsChoice');
var hairstylesChoice = document.querySelectorAll('.hairstylesChoice');
var hairsty... | true |
d9af7a791e7ec604198b7d2e0955e3caabc5dc4d | JavaScript | rafalciecwierz/BookBuy-Rent-TAS2017 | /models/bookModel.js | UTF-8 | 928 | 2.515625 | 3 | [] | no_license | var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var BookSchema = new Schema({
title: {type: String, required: true},
//zdjecie okladki????????
cover: {type: String, default: 'undefined'},
author: {type: Schema.ObjectId, ref: 'Author', required: true},
description: {type: String, default: nu... | true |
f2e812127a36984ec7a9c1b3838aa0eb97d63fe8 | JavaScript | axelajv/FirefoxOS-ProjetDLL | /js/next-train.js | UTF-8 | 3,355 | 2.671875 | 3 | [
"MIT"
] | permissive |
$(document).ready(function(){
$("input").click(function(){
$("#footer").css("display", "none").fadeOut(2000);
});
$("input").blur(function(){
$("#footer").css("display", "block");
});
});
$(function() {
$.getJSON('json/StationNavi... | true |
b7c93f71d2d1db01add2773001e1b3aecf2972d1 | JavaScript | Truelj/Start_web | /JavaScript study/Javascript-the def guide/Core js/Classes and Modules/Inheritance and composition in JS/Subclass /subclasses to Set/FilteredSet.js | UTF-8 | 1,122 | 3.234375 | 3 | [] | no_license | function filteredSet(superclass, f){
//create a subclass constructor
sub = function(){
//chain to the superclass constructor
superclass.apply(this, arguments);
};
sub.prototype = inherit(superclass.prototype);
sub.prototype.constructor = sub;
sub.prototype.add = function(){
... | true |
946b4cf016538ebe8c80dcef07de11725982f7b0 | JavaScript | togiberlin/algorithmic_challenges | /coderbyte/a_easy/javascript/tests/08_check_nums.test.js | UTF-8 | 1,000 | 2.984375 | 3 | [
"MIT"
] | permissive | const checkNums = require('../08_check_nums/check_nums.js');
describe('checkNums', () => {
test('(1, 11) returns true', () => {
expect(checkNums(1, 11)).toBe(true);
});
test('(122, 12) returns false', () => {
expect(checkNums(122, 12)).toBe(false);
});
test('(3, 134) returns false', () => {
exp... | true |
f91a93b6ac8812ff7dae6b93bf0bf7d7fcd37d0e | JavaScript | rajan-31/Carbon-Footprint-Indicator | /extension/popup.js | UTF-8 | 2,396 | 2.6875 | 3 | [] | no_license | let getResult = document.getElementById("get-result");
let resultSpan = document.getElementById("result");
getResult.addEventListener("click", async () => {
let [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
chrome.scripting.executeScript({
target: { tabId: tab.id },
... | true |
74277cfd49161cf2ef1df6bc2b13dc764d0ca694 | JavaScript | denoland/deno_std | /jsonc/testdata/test262/propertyHelper.js | UTF-8 | 6,853 | 2.875 | 3 | [
"MIT"
] | permissive | // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Ported from test262
// https://github.com/tc39/test262/blob/276e79d62e8c45bc1e427fc680320c4899eace27/harness/propertyHelper.js
// Copyright (C) 2017 Ecma International. All rights reserved.
// This code is governed by the BSD license found i... | true |
9b497a350a192ce5b246616a64a46833b1a1b31e | JavaScript | Davidzyt/JavaScript | /03-dates/05-get-spooky-fridays-Optional/script.js | UTF-8 | 983 | 3.078125 | 3 | [] | no_license | /* becode/javascript
*
* /04-dates/05-get-spooky-fridays/script.js - 4.5: calcul des vendredi 13
*
* coded by leny@BeCode
* started at 26/10/2018
*/
// NOTE: don't focus on the existing code structure for now.
// You will have time to focus on it later.
(function () {
const buttonRun=document.getElementByI... | true |
d363025a673c1ac813debb092d600d8a7b0dac57 | JavaScript | fimi2008/kq-system | /src/main/webapp/skin/js/jquery-plugins.js | UTF-8 | 1,348 | 2.765625 | 3 | [] | no_license | /**
* jquery
* 核心 (选择器, dom操作, 事件, ajax)
* 插件:
* 全局方法的插件
* $.extend({
* })
*
* 局部方法的插件
* $.fn.extend({
* })
* UI : easyUI(它是基于jquery的一个扩展)
*
*/
$.fn.extend({
datagrid: function (obj) {
var $table = $(this);
var colums = obj.columns;
var tr = "<tr>";... | true |
fe37e8ad58dce08f031ddfd1b54ee80e0c0ac1a3 | JavaScript | Patchx/rj-validate | /test/zip-rule-tests.js | UTF-8 | 1,958 | 2.8125 | 3 | [
"MIT"
] | permissive | var assert = require('chai').assert;
var rules = require('../src/rules_functions.js');
describe('Zip rule on a number', () => {
it('should return true for 0 a zip rule of false', () => {
var result = rules.zip(0, {zip: false});
assert.equal(result, true);
});
it('should return false for 0', () => {
var resul... | true |
e7cd7b3ce487bc4956cb756de06ddd2ef455c367 | JavaScript | MananTheCoderKid/CookingWebsite | /CC.js | UTF-8 | 2,905 | 3.234375 | 3 | [] | no_license | //ingredients
function hide() {
document.getElementById("ingredients_div").style.display = "none";
console.log("Ingredients Are Hidden - Double click to show");
}
function show() {
document.getElementById("ingredients_div").style.display = "inline-block";
console.log("Ingredients Are Shown - Si... | true |
6b17a6eeb2be813a51f1bea09bbf0c03affa5c6e | JavaScript | funnysmile9x/reactjslogin | /server.js | UTF-8 | 3,672 | 2.5625 | 3 | [] | no_license | var express = require('express');
var app = express();
var mongoose = require('mongoose');
var bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
mongoose.connect('mongodb://localhost/dbtest');
var personSchema = mongoose.Schema({
username: String... | true |
8996a8ea7fafa0e542c14b0e44e5a4f555d1471b | JavaScript | ducbt/react-native-clean | /test/fake-component.js | UTF-8 | 456 | 2.65625 | 3 | [] | no_license | export default class FakeComponent{
props = {};
state = {};
fakeStore = null;
constructor(fakeStore) {
this.fakeStore = fakeStore;
this.props = this.fakeStore.initialise(undefined, {}, this.updateProps);
}
dispatch = (action) => {
this.props = this.fakeStore.dispatch(action);
};
updatePr... | true |
0cbdf2ef91bb04d003ba85aeb3dadade2aae28ef | JavaScript | Jack0215/React_Basic | /my-app/src_05_event/components/Child.js | UTF-8 | 1,041 | 2.734375 | 3 | [] | no_license | import React, { Component } from 'react';
export class Child extends Component {
render() {
return (
<div>
<button onClick={this.handleEvent}>handleEvent</button>
<br/>
<button onClick={this.handleEvent2}>handleEvent</button>
<br/>... | true |
f4f7b252df256a1125f92d4a7fba80cb31c2e737 | JavaScript | AlgoRen/MERNSTACKAPP | /client/src/components/dashboard/Experience.js | UTF-8 | 2,949 | 2.953125 | 3 | [] | no_license | import React, { Fragment } from "react";
import PropTypes from "prop-types";
import Moment from "react-moment";
import { connect } from "react-redux";
import { deleteExperience } from "../../actions/profile";
//TODO Purpose:
//TODO 1) To return a table containing the user's experience credentials.
//TODO ... | true |
180433ca2036ee59e39a9243d98f426c94eccddd | JavaScript | archerImagine/myNewJunk | /JSNicholas/src/chapter03/BitwiseXorExample01.js | UTF-8 | 50 | 2.9375 | 3 | [] | no_license | var result = 25 ^ 3;
alert("25 ^ 3 = " +result);
| true |
17f35aba456796487eb2c13548e340ecddfc62c9 | JavaScript | James6996/T2OMETEO | /src/components/Table/index.js | UTF-8 | 2,096 | 2.671875 | 3 | [] | no_license | import React, { useState } from 'react';
import REACTHTMLTableToExcel from 'react-html-table-to-excel';
import './Table.scss';
const Table = ({ cities }) => {
const [selectedOption, setSelectedOption] = useState('Todas las ciudades')
console.log(selectedOption)
return (
<div className="homeContainer">
... | true |
335d85dbcab7b9e2c4bac6f6400093658d5ae5fb | JavaScript | nowherefast/scitech_pond_static | /src/blogs/D3_Part_1_The_Basics.js | UTF-8 | 24,057 | 2.6875 | 3 | [] | no_license | import React from 'react';
/*REACT Bootstrap Stuff*/
import FormGroup from 'react-bootstrap/lib/FormGroup';
import FormControl from 'react-bootstrap/lib/FormControl';
import Form from 'react-bootstrap/lib/Form';
import Col from 'react-bootstrap/lib/Col';
import HelpBlock from 'react-bootstrap/lib/HelpBlock';
import B... | true |
d340559b837378ab972b69916a10081066ada947 | JavaScript | Harieshwar-Dilipan/Feed-the-rabbit--doubt | /sketch.js | UTF-8 | 840 | 2.859375 | 3 | [] | no_license | var garden,rabbit;
var gardenImg,rabbitImg;
var apple,appleImg,appleGroup;
var score=0;
function preload(){
gardenImg = loadImage("garden.png");
rabbitImg = loadImage("rabbit.png");
appleImg=loadImage("apple.png");
}
function setup(){
createCanvas(400,400);
garden=createSprite(200,200,0,0);
garden.addI... | true |
e1563063b728c10562c0a8d7df8674aa98a815ed | JavaScript | ColoradoDemography/AgeMap | /src/common/js/add_custom_control.js | UTF-8 | 7,632 | 2.5625 | 3 | [
"MIT"
] | permissive | var refreshdata = require("./refresh_data.js");
module.exports = function(map: Object, layer: Object, worker_data: any) {
'use strict';
//Custom Layer Control
var command: Object = L.control({
position: 'topleft'
});
//var ages_data = worker_data[2];
var yrs_data = worker_data[1];
... | true |
074181642f8a24411d40a3772acb993a35eb2090 | JavaScript | ajablanco/React-Github-User-Card | /user-card/src/App.js | UTF-8 | 2,771 | 2.828125 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from "axios";
import UserCard from "./components/UserCard";
import './App.css';
export default class App extends Component {
state = {
current_user: "",
login: "",
avatarURL: "",
name: "",
location: "",
bio: "",
followers: [],
mes... | true |
2f3a78126114850ac0966ccddcc18d8f9c34e6fb | JavaScript | Prathmesh-Chalia/v3-2 | /Source/Class/Levels/LevelOne.js | UTF-8 | 3,216 | 2.796875 | 3 | [] | no_license | class LevelOne {
constructor () {
}
start () {
startButton.visible = false
island.visible = true
player.body.visible = true
// obsRadius.x = obs.x;
// obsRadius.y = obs.y;
function createOptionalIndexes( value ) {
... | true |
9bbe1725f82da438c99b84621dff55fe2bcd9606 | JavaScript | btipling/meteor_irc | /website/client/client.js | UTF-8 | 5,842 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | /**
* fileOverview Client code etc.
*/
var dataMap, URL_REGEXP, QUERY_URL_REGEXP;
Meteor.subscribe('secret');
Meteor.subscribe('messagesPerHourData');
Meteor.subscribe('messagesPerDayData');
Meteor.subscribe('onlineData');
Meteor.subscribe('namesData');
Meteor.subscribe('topURLsData', 8);
Meteor.subscribe('topNicks... | true |
6b37b651c76744adee832d0c4e2e44cd36549af9 | JavaScript | HahajProgress/jstest | /EnterWelcome.js | UTF-8 | 586 | 3.109375 | 3 | [] | no_license |
function move() {
var ansshow=document.getElementById('ans');
var txt=document.getElementById('txt').value;
// document.getElementById('btn').value=txt;
document.getElementById('btn').innerHTML=txt;
var sex=document.getElementsByName("sex");
if(txt=="變態")
{
alert("變態");
ansshow.style.display=... | true |
9f56fa92d02cecd4b44e81c3e7237135450aeaba | JavaScript | mjbenefiel/tutorials | /OOP/lesson2.js | UTF-8 | 240 | 3.03125 | 3 | [] | no_license | // encapsulation
var userOne = {
email: "sample@ninja.com",
name: "Ryu",
login(){
console.log(this.email, 'has logged in');
},
logout(){
console.log(this.email, 'has logged out')
}
};
userOne.age = 25
console.log(userOne)
| true |
cf455697f0d18386e78b14f880edd43daabfe5af | JavaScript | magikarppe/Team-Profile-Generator | /test/Intern.test.js | UTF-8 | 550 | 2.9375 | 3 | [] | no_license | const Intern = require("../lib/Intern");
test("Can set school via constructor", () => {
const testVal = "UCF";
const e = new Intern("Vis", 1, "test@test.com", testVal);
expect(e.school).toBe(testVal);
});
test("getRole() should return \"Intern\"", () => {
const testVal = "Intern";
const e = new Intern("FVis... | true |
a9d89294cbdba8079053886193287efe7b0cde1b | JavaScript | sebastianflorez0806/BabyFull | /web/Estilos/ValidacionCampos/ValidacionProductoEditar.js | UTF-8 | 3,196 | 3.4375 | 3 | [] | no_license | const nserie = document.getElementById('nserie');
const nombre = document.getElementById('validate');
const valor = document.getElementById('valor');
const exis = document.getElementById('cexistencias');
nserie.addEventListener('keyup', e => {
e.preventDefault();
checkNSerie();
});
nombre.addEventListener('... | true |
e88998ed7f5722b6c576d781a5a5fa01411f343e | JavaScript | halotx3/ccass-visual | /base/static/js/racingchart.js | UTF-8 | 5,987 | 3.09375 | 3 | [] | no_license | //Grabbing URLs
const athletesURL = 'http://serene-beach-38826.herokuapp.com/api/v1/athletes';
const celebURL = 'http://serene-beach-38826.herokuapp.com/api/v1/celebrities';
document.getElementById("buAth").addEventListener("click", athleteChart);
document.getElementById("buCel").addEventListener("click", celebChar... | true |
bbe5ca72b273c6b55ca4d5b9618888b0bcd36f05 | JavaScript | Kirillosman/lesson12 | /js/main.js | UTF-8 | 2,460 | 3.34375 | 3 | [] | no_license | let studentKolya = {
firstName: "Kolya",
lastName: "Ivanov",
age: 19,
grades: [5,3,2,5,4],
course: 2,
gender: "male",
};
let studentPetya = {
firstName: "Petya",
lastName: "Ivanov",
age: 21,
grades: [4,2,2,5,5],
course: 4,
gender: "male",
};
let ... | true |
a9aefa7a88b3eafa899ec0720b105dab46c7176b | JavaScript | Csprier/marvel-client | /src/actions/charactersActions.js | UTF-8 | 2,334 | 2.59375 | 3 | [] | no_license | import { REACT_APP_MARVEL_URL } from '../config';
import Axios from 'axios';
export const GET_CHARACTERS_REQUEST = 'GET_CHARACTERS_REQUEST',
getCharactersRequest = () => ({
type: GET_CHARACTERS_REQUEST
});
export const GET_CHARACTERS_SUCCESS = 'GET_CHARACTERS_SUCCESS',
getCharactersSuccess = () => ({
ty... | true |
c06cc2c419d8e30c9bb018a241b214062ec28008 | JavaScript | dmwaters17/Initial-Pre-Work | /5-Introduction-to-JavaScript/50-Global_vs._Local_Scope_in_Functions.js | UTF-8 | 248 | 2.984375 | 3 | [] | no_license | // When both local and global variables are present with differing values; the local variable will override the global.
// Setup
var outerWear = "T-Shirt";
function myOutfit() {
// Only change code below this line
var outerWear = "sweater";
| true |
8009f2084f8a15de35af4e9bae0379d5af61d022 | JavaScript | electerm/electerm | /src/client/common/download.js | UTF-8 | 438 | 2.671875 | 3 | [
"MIT"
] | permissive | /**
* simulate download
*/
export default function download (filename, text) {
var pom = document.createElement('a')
pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text))
pom.setAttribute('download', filename)
if (document.createEvent) {
const event = document.createEvent(... | true |
c26e8db44e959223b3ada9e274c04b531f3a3eac | JavaScript | nafiul90/ecom-admin-view | /src/contexts/ProductContextProvider.js | UTF-8 | 3,067 | 2.6875 | 3 | [] | no_license | import React, { createContext, useState } from 'react';
import { GET_ALL_PRODUCT_API, POST_PRODUCT_API, UPDATE_PRODUCT_API } from "../helpers/apis";
import axios from "axios";
export const ProductContext = createContext();
const ProductContextProvider = ({ children }) => {
const [products, setProducts] = useStat... | true |
b62209199b832960fba223fd0710bafb04fe73a3 | JavaScript | chaim-faragi/dalya-and-anael | /components/Post.js | UTF-8 | 527 | 2.6875 | 3 | [] | no_license | import React,{useState,useEffect} from 'react'
export default function Post(props) {
const[name,setName] =useState('shem')
const[info,setInfo] =useState('abcdefg')
const[myColor,setmyColor] =useState('black')
return (
<div>
<p style={{color:myColor}}>{name}</p>
... | true |
162062264772e79e06910e6d9d74a46c1737b7df | JavaScript | jeanmile/MIF13-TP1 | /XHTML/js/cv.js | UTF-8 | 400 | 2.640625 | 3 | [] | no_license | function afficheFrEn(idBlock) {
var divEn = document.getElementById("main")
var divFr = document.getElementById("mainFr")
if (idBlock=="en") {
divEn.style.display = 'block'
divFr.style.display = 'none'
}
else {
divEn.style.display = 'none'
divFr.style.display = 'bloc... | true |
9fe4f5a9726136130d531f77e268457109296b92 | JavaScript | kysonic/lrn | /CodeWars/pockerHand/best.js | UTF-8 | 2,003 | 3.0625 | 3 | [] | no_license | const face_number = {T: 10, J: 11, Q: 12, K: 13, A: 14}
const card_number = (x) => face_number[x[0]] || +x[0]
const cards_to_numbers = (h) => h.split(" ").map(card_number)
const numbers_in_sequence = (arr) => arr.reduce((a,c)=>a+c) == arr.length * (2*arr[0] + arr.length - 1) / 2
const straight = (h) => numbers_in_seque... | true |
0f377e319d79f10234db10dd917043d1484b30a8 | JavaScript | justindra/marvel-comic-app | /src/redux-store.js | UTF-8 | 15,856 | 2.5625 | 3 | [] | no_license | function buildStore() {
"use strict";
var API_KEY = 'bb7b0d40bc2bdfbb870e9955e97c381a';
var REQUEST_COMIC = 'REQUEST_COMIC';
var RECEIVE_COMIC = 'RECEIVE_COMIC';
var REQUEST_COMIC_CHARACTERS = 'REQUEST_COMIC_CHARACTERS';
var RECEIVE_COMIC_CHARACTERS = 'RECEIVE_COMIC_CHARACTERS';
function... | true |
d20e99e0ab6f475883eb65c2ef5429e70cb14de5 | JavaScript | telec16/website-V1 | /content/informatique/sound/drawer.js | UTF-8 | 2,161 | 3.03125 | 3 | [] | no_license | var inCnv, inCtx;
var outCnv, outCtx;
var drawing = false;
var prevX = 0, currX = 0;
var prevY = 0, currY = 0;
var xSize, ySize;
var lowScale, highScale;
function initCanvas(inName, outName) {
inCnv = document.getElementById(inName);
inCtx = inCnv.getContext("2d");
outCnv = document.getElementById(o... | true |
7102cdf47130002ad1ce02514c6eb9ab5bc49e62 | JavaScript | geniein/alogorithm | /js/dupPriority.js | UTF-8 | 979 | 3.328125 | 3 | [] | no_license | function solution(operations) {
var answer = [];
let list = operations.map((v) => v.split(" "));
let queue = [];
for(let i =0; i < list.length; i++){
if(list[i][0] == 'I'){
queue.push(list[i][1]);
}else if(list[i][0] == 'D'){
if(list[i][1] == '-1'){... | true |
2d06bdf5b8a6ee6891dde2bf2c4db4878124a813 | JavaScript | bote795/EazyFair | /js/ShapesHistoryManager.js | UTF-8 | 519 | 3.171875 | 3 | [] | no_license | var ShapesHistoryManager = function() {
this.queue = [];
};
//adds item to history
ShapesHistoryManager.prototype.add = function(item){
this.queue.push(item);
}
//pop item from histroy
ShapesHistoryManager.prototype.pop = function(){
return this.queue.shift(); // queue is now [5]
}
//saves to db
Shapes... | true |
6ab68dca888df1458be916e8b960dbaa63a6d0ba | JavaScript | jinman36/Recipe-page | /hold-code.js | UTF-8 | 2,094 | 3.6875 | 4 | [] | no_license | //console.log("hello, world");
//console log();
//camel case
//var myVariableName;
//var myVariableName = "hello, world!";
//console.log(myVariableName);
//var order; //walk to coffee shop
//order = "black coffee" ; //pace order
//console.log("Your order of "+ order + " is ready!") //order ready
//console.log(myVaria... | true |
e307b3305249d03c95301d72f219a70fff54b234 | JavaScript | dlrandy/tsexer | /basics/dist/generics.js | UTF-8 | 307 | 2.875 | 3 | [] | no_license | function pushSomethingIntoCollection(something, collection) {
collection.push(something);
console.log(collection);
}
var sd = { name: 'jean' };
var ss = { name: 'www' };
var heros = [sd];
var powers = ['qq', 'qw'];
pushSomethingIntoCollection(ss, heros);
pushSomethingIntoCollection('dfd', powers);
| true |
d1f8891dfea518ea7295ad6844428e059546b1a5 | JavaScript | aggarwalneha01/split-array | /src/index.js | UTF-8 | 971 | 2.96875 | 3 | [] | no_license |
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(
<React.StrictMode> <b>Group Array Exercise</b>
<br/> <br/> When the original array is [1,2,3,4,5,6,7,8,9] and num of Arrays it needs to be divided is 3 <br/>
<b>Result: </b>{JSON.stringify(App([1,2,3,4,... | true |
97bb4b999c5c3950776b5a0f59ef3b2a49204ed8 | JavaScript | davidmartinez10/react-gameoflife | /src/presets.js | UTF-8 | 1,319 | 2.515625 | 3 | [] | no_license | function diehard(matrix) {
matrix[12][11] = 1;
matrix[13][12] = 1;
matrix[13][11] = 1;
matrix[17][12] = 1;
matrix[18][12] = 1;
matrix[19][12] = 1;
matrix[18][10] = 1;
return matrix;
}
function gosper_glider_gun(matrix) {
matrix[0][4] = 1;
matrix[0][5] = 1;
matrix[1][4] = 1;
matrix[1][5] = 1;
... | true |
cfafe47a8a5c29f08b08fa86ac1d1a0ea76c4f82 | JavaScript | HackerYou/chalk-api | /api/testRunner.js | UTF-8 | 2,420 | 2.625 | 3 | [] | no_license | const spawn = require('child_process').spawn;
const vm = require('vm');
const fs = require('fs');
const bcrypt = require('bcryptjs');
//Transpile file for HTML tests and React tests
function transpile(file,tempContent) {
return new Promise((resolve,reject) => {
fs.writeFile(`${file}.js`,tempContent,(err) => {
i... | true |
aec1588b354b1110476d980a41f445f7e6fbbf48 | JavaScript | Vxee/leetcode | /806_Number_of_Lines_To_Write_String.js | UTF-8 | 407 | 3.09375 | 3 | [] | no_license | var numberOfLines = function(widths, S) {
var len = S.length,
row = 1,
leftRoom = 100;
for(var i = 0; i < len; i++){
var index = S.charCodeAt(i)-97;
if(leftRoom < widths[index]){
row++;
leftRoom = 100 - widths[index];
}else{
le... | true |
e3e5794c41b8838bfa900a4d0b3becfade63c2d1 | JavaScript | francisZimo/webMasterSource | /react/app/src/05/customReact/vDom1.js | UTF-8 | 1,674 | 3.234375 | 3 | [] | no_license | export const initVnode=(vNode,container)=>{// 把vNode转换成Dom
const {vType}=vNode;
let node=null;
if(!vType){
node=initTextNode(vNode,container)
}
if(vType===1){
//原生标签
node=initHtmlNode(vNode,container)
}
if(vType===2){
//class 组件
node=initClassComponent(vNode,container)
}
if(vType==... | true |
ceda03ae0eb55833c02be3de83fe418d4166f3a8 | JavaScript | MelussiMkhonta/Crypto-Analysis | /integration_tests_/sentiment_api.test.js | UTF-8 | 1,420 | 2.578125 | 3 | [] | no_license | const request = require('supertest');
const app = require("../app");
describe(`POST /sentiment/getAverages`, () => {
jest.setTimeout(100000);
test(`when parameters are correct`, async () => {
const response = await request(app).post(`/sentiment/getAverages`).send({email: `codexteam4@gmail.com`, crypto_... | true |
0069a213260cf07df905e22c37c27f25e593cbe7 | JavaScript | tarunjangra4/Pokedex | /src/components/PokemonGallery.js | UTF-8 | 4,311 | 2.75 | 3 | [] | no_license | import {Link} from 'react-router-dom';
// import sampleSize from 'lodash/sampleSize';
import {pokemons} from './pokemonList'
import FavoriteIcon from '@material-ui/icons/Favorite';
import { Button } from '@material-ui/core';
import { useState } from 'react';
// import {useEffect} from 'react';
// function getPokemo... | true |
174b7e422fddbca80281765cc528f9c7d13bf3e0 | JavaScript | CaliZam/skylab-bootcamp-202004 | /staff/hector-gracia/web-components/my-reapp/logic/Pete.js | UTF-8 | 756 | 3.25 | 3 | [] | no_license | class Pete{
constructor(message,user){
if(typeof message!=="string") throw new TypeError(message+" is not a string");
if(user.constructor.name!=="User") throw new TypeError(user +" is not a User");
this.message=message;
this.user=user;
this.date=Date.now();
//Cuanto l... | true |
0fff4f4d8852cf4b83455954502dafffd9b27e08 | JavaScript | makerdark98/coding-test-extension | /js/custom.js | UTF-8 | 3,054 | 2.765625 | 3 | [
"MIT"
] | permissive | let problems;
chrome.storage.sync.get(['problems', 'submit'], (item) => {
problems = JSON.parse(item.problems);
const submit = JSON.parse(item.submit);
for (let i = 0; i < problems.length; ++ i) {
const container = document.querySelector(`#problem-${i+1}`);
container.children[0].children[1].innerText = pr... | true |
e8c632a8d88afaa2aaea517dd0b90238ed08e8c6 | JavaScript | JacobLomas/DWEC_Unit1 | /Worksheet5/Exercise3BUCLES.js | UTF-8 | 120 | 3.203125 | 3 | [] | no_license | var n;
do{
n=parseInt(prompt("Introduce un número"));
if(n!=0)
document.write(n+"<hr>");
}while(n!=0);
| true |
5c412b5a245395e82a3ada0b67ebf0a57ea1f02b | JavaScript | Neha-123/chat-app | /src/app.js | UTF-8 | 2,442 | 2.546875 | 3 | [] | no_license | const express = require('express');
const path = require('path');
const { createServer } = require('http');
const { generateMessage, generateLocationMessages } = require('./utils/messages');
const { addUser, removeUser, getUser, getUsersInRoom } = require('./utils/user')
const socketio = require('socket.io');
const Fi... | true |
3a434ff5b6a737161919d7e930ef419304ddec3c | JavaScript | hannahrobot/algorithms | /Design/designLeaderboad.js | UTF-8 | 4,078 | 3.84375 | 4 | [] | no_license | //naive solution
//within top (k)
//get object.values
//sort
//return slice(0, k)
/////////////////////
//optomize
//heap could be used
//the time complexity of adding an element to heap is 0(log n)
//the time complexity of retrieving an element is 0(1)
//the desicion to use a heap with these time complexities would ... | true |
20433caaf6f9614c594985c0a43f896da453b811 | JavaScript | chabadilla92/photos-frontend | /src/App.js | UTF-8 | 3,176 | 2.8125 | 3 | [] | no_license | // Import All Our Components
import AllPosts from "./pages/AllPosts";
import SinglePost from "./pages/SinglePost";
import Form from "./pages/Form";
import Nav from "./components/nav"
// Import React and hooks
import React, { useState, useEffect } from "react";
// Import components from React Router
import { Route, Sw... | true |
82d1f9d22fd4e761bd88f21ed68b777880c4395b | JavaScript | swedy13/Meteor | /modules/themes/default/client/components/sidebar/sidebar.js | UTF-8 | 1,663 | 2.78125 | 3 | [] | no_license | if (Meteor.isClient) {
Template.footer.onRendered(function() {
// Put sidebar button ids into an array
var ids = [];
$('#sb').children().each(function() {
var id = $(this).prop('id');
ids.push(id);
});
// Find any items with an active class
var isActive = [];
$('#sb > a').each(function() {
if... | true |
3829bc6da0ae891eff1430f2cb4d0a5dc5dec258 | JavaScript | eblomst/javascript | /period1/examExamples/moduleEx.js | UTF-8 | 224 | 2.828125 | 3 | [] | no_license | var counter = require("./app.js");
var counter1 = counter();
var counter2 = counter();
counter1.increment();
counter1.increment();
counter2.increment();
console.log(counter1.value())// =2
console.log(counter2.value())// =1 | true |
bcd6b38e9360b641749afd91dc79660ea14a4012 | JavaScript | greatestkim/greatestkim.github.io | /JS/translate.js | UTF-8 | 2,063 | 3.203125 | 3 | [] | no_license | import { Alien } from "./alien.js";
import { String } from "./string.js";
export function Translator(mode,string){
var char = [];
var transText="";
if(mode == "eng"){
if(string.indexOf("?") !== -1){
transText += "¿";
}else if(string.indexOf("!") !== -1){
tr... | true |
24d0db31937cef02b80b2134fa5af5953cb24f6b | JavaScript | Comurule/mobile_payment_system | /src/services/vendor.js | UTF-8 | 1,748 | 2.53125 | 3 | [] | no_license | const DB = require('../models');
const projection = { _id: 1, title: 1, description: 1 };
exports.create_a_vendor = async (req, res) => {
const { title, description } = req.body;
const title_regex = new RegExp(title, 'i');
const check_record = await DB.Vendor.findOne({ title: title_regex });
if (chec... | true |
d0357afd3d1bba2fc858f4ef285b3eec69251dfb | JavaScript | crappy-coder/astrid | /src/Rectangle.js | UTF-8 | 5,668 | 2.859375 | 3 | [] | no_license | import Equatable from "./Equatable";
import StringTokenizer from "./text/StringTokenizer";
import Vector2D from "./Vector2D";
import Size from "./Size";
class Rectangle extends Equatable {
constructor(x, y, width, height) {
super();
this.update(x, y, width, height);
}
update(x, y, width, height) {
this.x = ... | true |
d8f15c539a97d2005029dd45e6316b607026283a | JavaScript | Isaiah361/lab-thinking-in-react | /starter-code/src/ProductTable.js | UTF-8 | 1,962 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
import ProductCategoryRow from './ProductCategoryRow';
import ProductRow from './ProductRow';
class ProductTable extends Component {
sportingGoods = () => {
return this.props.items.map((product, index)=>{
if(product.category === "Sporting Goods"){
... | true |
efe8af196abac3703f427ba8b773a05bec604d87 | JavaScript | Den4ik5/VironIt | /FrontEnd/Data_structures_with_front/Stack/Stack.js | UTF-8 | 496 | 2.875 | 3 | [] | no_license | const Stack = (function(EventEmitterClass) {
class Stack extends EventEmitterClass {
constructor() {
super();
this._values = [];
}
push(value) {
this._values.push(value);
this.emit('pushStackNode', value);
return this;
}
... | true |
030083430ece320146ac46652e7a4cae101d6782 | JavaScript | djflexible/Node-Samples | /Socket/tcpChatClient.js | UTF-8 | 672 | 2.703125 | 3 | [] | no_license | var net = require('net');
var ip = '127.0.0.1';
var port = 3000;
console.log('trying to Chat Server : ', ip, port);
var socket = new net.Socket();
socket.connect({port : port, host : ip}, function() {
console.log('Connected..');
var is = process.stdin;
is.on('data', function(data) {
var str... | true |
36c582e6ba80b4cd1f3347b5bce0682e2934bf02 | JavaScript | Michielu/my-statement-analyst | /client/src/utils/dates.js | UTF-8 | 982 | 3.515625 | 4 | [] | no_license | const months = (num) => {
switch (num) {
case ("01"):
return "Jan";
case ("02"):
return "Feb";
case ("03"):
return "Mar";
case ("04"):
return "April";
case ("05"):
return "May";
case ("06"):
retur... | true |
73752ef0084641178bd97e5445f117085e87c486 | JavaScript | rasnavm/javascriptwork | /sort.js | UTF-8 | 329 | 3.390625 | 3 | [] | no_license | let arr=[15,11,10,7,12,4];
let sorted = arr.sort(function(a, b){return b - a});
let iteration = Math.ceil(arr.length/2);
let length = arr.length;
let b=[];
for (i=0,j=0;i<iteration;i++,j++){
b[i+j] = sorted[i];
if (((length%2) == 0 ) || ((i+1) != iteration)){
b[i+j+1] = sorted[length-1-i]
}
}
conso... | true |
49e5c03285a89b1e472aa971788ea029a5ec26bd | JavaScript | JochenFromm/SwarmIntelligence | /src/agent.js | UTF-8 | 3,377 | 3.375 | 3 | [
"CC-BY-4.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
import { Point } from './point.js';
import { Vector } from './vector.js';
class Agent {
constructor(x, y, dx, dy) {
this.pos = new Point(x,y);
this.speed = new Vector(dx,dy);
this.steering = new Vector(0,0);
this.timestep = 0;
this.HALFTIME = 140;
this.TEACHING_TIME = 70;
this.FEARFULNE... | true |
372d77bb599ad91088e93bc3bb98f09c7c2581c8 | JavaScript | nschwenne/phase-4-final-project | /client/src/components/AbilityScores.js | UTF-8 | 4,923 | 2.671875 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import React, { useState, useEffect } from "react"
import AbilityScoreModifier from "./AbilityScoreModifier"
function AbilityScores({ character }) {
const [abilityScores, setAbilityScores] = useState({
strength: "",
dexterity: "",
constitution: "",
intelligence: "",
wisdom: ... | true |
cc1488310b745c32cf211db586b8d4aa01fd36e7 | JavaScript | JaniPM/react-reminder-calendar | /src/components/calendar/view-model/calendar.view-model.js | UTF-8 | 1,372 | 3.3125 | 3 | [] | no_license | import {
startOfWeek,
endOfWeek,
startOfMonth,
endOfMonth,
getISOWeek,
addDays,
isSameMonth,
isToday
} from 'date-fns';
export const monthTitles = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
export const dayTitles = ['Sun',... | true |
5f1ec8196efceffeb6df9ab8d7f0bd2c2f1d910c | JavaScript | harsha35/assignment | /project/src/folder/task6.js | UTF-8 | 1,085 | 2.78125 | 3 | [] | no_license | import React from "react";
class Task6 extends React.Component {
constructor(props) {
super(props);
this.state = {
tasks: [],
value: "",
};
}
handleChange = (e) => {
console.log(e.target.value);
this.setState({ value: e.target.value });
};
add = () => {
return this.set... | true |
175de2761276dacf9ec3301f9828a9335e75c4c9 | JavaScript | GarlicGo/web-utils | /load-local-image/index.js | UTF-8 | 1,504 | 3.21875 | 3 | [] | no_license | //获取file对象的base64编码
/*
* 接收一个对象参数(imgObj),该对象参数有以下几个可以用属性:
var updateObj = {
file: {},
success:function (response) {
},
error:function (response) {
}
};
* 1.file:指定图片的文件对象(例如:evt.target.files[0])
* 2.success,error分别是ajax成功,失败的回调函数
* */
function getBase64URL(imgObj) ... | true |
0b1d11a9961a3d0db76fe1109b2e061c7c82eb54 | JavaScript | ibelal/js-palindrome | /main.js | UTF-8 | 763 | 3.53125 | 4 | [] | no_license | function valid(e) {
var inputPalindrome = e.val();
if (inputPalindrome !== '') {
return inputPalindrome;
} else {
return false
}
}
function palindrome(str) {
var re = /[\W_]/g; // match non-word characters and underscores
var lowRegStr = str.toLowerCase().replace(re, '');
va... | true |
ba8d379f0e4baed60b9e3ffb1b4c3af93b283f90 | JavaScript | donic994/VersoAltima | /public_html/js/main.js | UTF-8 | 4,979 | 3.203125 | 3 | [] | no_license | var errors = document.getElementById("errors");
var file = document.getElementById("selectedFile").value;
var nodes = null;
class Node {
constructor(name) {
this.children = [];
this.name = name;
}
add(child) {
this.children.push(child);
}
remove(child) {
var length... | true |
90536bb25e26fae27fd169d330509aa59488f600 | JavaScript | neisoo/baseweb | /public_html/bookPlayer/artwork/core_client_library/js/legacy-sites-js/1.0/mobject.js | UTF-8 | 2,157 | 3.59375 | 4 | [] | no_license | /*
Last Edit: Corey Rosamond
Added new version of append text that allows you to appendText without worrying about clearing the previous text area.
objType = same as createElement()
objAttr(optional) = Object that holds all of the setAttribute types
objStyle(optional) = string of inline styles
appendObj(option... | true |
8b9c8e9d35dffa7c3b6f1a28c0a2ca10aa12e058 | JavaScript | ferrucc-io/DripForm | /public/js/dripform.js | UTF-8 | 1,968 | 2.6875 | 3 | [
"MIT"
] | permissive | function addCss(fileName) {
const head = document.head;
const link = document.createElement('link');
link.type = 'text/css';
link.rel = 'stylesheet';
link.href = fileName;
head.appendChild(link);
}
addCss('https://dripform.ga/css/toggle.css');
const userID = document.currentScript.getAttribute('tguser');... | true |
86831282f5c479cb5fe0bdaeda3e9de68330485c | JavaScript | Aaron09/Scrapbook | /frontend/bucketlist/src/bucket-page/components/BucketPage.js | UTF-8 | 2,659 | 2.765625 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import GoalList from "./GoalList.js"
import GoalAdder from "./GoalAdder.js"
export default class BucketPage extends React.Component {
constructor(props) {
super(props);
this.getBucketID = this.getBucketID.bind(this);
this.requestBucketData = ... | true |
34a53ca73a7a7dad2beb013bf8704a630277436d | JavaScript | wesww/window-cleaner | /WindowCleaner/Assets/Scripts/RainAnimRandomStart.js | UTF-8 | 385 | 2.53125 | 3 | [
"MIT"
] | permissive | var rainObject : GameObject;
private var randomStartingTime;
function Start(){
randomStartingTime = Random.Range(0.0, 700.0);
PlaySound();
}
function disableTheseWhileRaining(){
}
function PlaySound(){
rainObject.animation["rainCycle"].time = randomStartingTime;
animation.Play("rainCy... | true |
fd56b0a7ac7a49122fe6954847d5fee33d1e140b | JavaScript | anveshishori/my-quiz-game- | /sketch.js | UTF-8 | 427 | 2.65625 | 3 | [] | no_license | var canvas;
var gameState = 0
var contestantCount;
var database, myQuiz, question
var contestant
var allContestant
function setup(){
canvas = createCanvas(850,400);
database = firebase.database();
myQuiz = new Quiz();
myQuiz.getState()
myQuiz.start()
}
function draw(){
background("pink");
if(contes... | true |
f5e6c7857d4e6d665beecd5752a7f8659afcf5d9 | JavaScript | 5sun0/vanilla-js-draft | /js/dday.js | UTF-8 | 2,470 | 3.171875 | 3 | [] | no_license | const ddaySubmit = document.querySelector("#dday-submit");
const ddayTitle = ddaySubmit.querySelector("#dday-title input");
const ddayForm = ddaySubmit.querySelector("#dday-form");
const ddayDate = ddayForm.querySelector("input");
const submitButton = ddayForm.querySelector("button");
const ddayPainted = document.qu... | true |
a07b516f16083fec290991e9b208796fa53179cd | JavaScript | Infatakanda/assignmentJS | /feetToMile.js | UTF-8 | 151 | 3.609375 | 4 | [] | no_license |
function feetToMile(feet) {
if (feet < (100)) {
return 'input cannot be less than zero';
} else {
return (feet*100);
}
}
console.log(feet); | true |
ccfbe8a99f57900efdc46d0256b4c6954e4e7ad3 | JavaScript | KevinSwiftiOS/DataStructureReview | /sort.js | UTF-8 | 1,445 | 3.703125 | 4 | [] | no_license | //直接插入排序
function insertSort(a, length){
var i,j,k,temp;
for(i = 0; i < length;i++){
//从后向前移动
for(j = i - 1; j >= 0;j--)
if(a[i] > a[j])
break;
temp = a[i];
if(j != i - 1){
for(k = i - 1; k >= 0 && a[k] > temp;k--)
a[k + 1] = a[k];
a[k + 1] = temp;
}
}
r... | true |
4b6b38f33d2901a836ef85df55b523d118928a30 | JavaScript | ga-chicago/ga-chicago.github.io | /dragons/01_front_end_fundamentals/paul_boyle/d04_hoisting.js | UTF-8 | 87 | 2.890625 | 3 | [
"MIT"
] | permissive | function sayHello(words){
return name + ' says ' + words;
}
var name = 'Cecelious';
| true |
0ee16f8c67c1b719aa709f668f095992ad9ba6df | JavaScript | andy012/faceSwiping | /src/main/webapp/resources/js/util.js | UTF-8 | 20,417 | 2.890625 | 3 | [] | no_license | ///**
// *
// * js工具类
// *
// * @author 谢长春 2015-11-5 14:35:11
// */
//// Base64编码集定义
//var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
///**
// * 返回信息代码表
// *
// * 当请求查询列表时,>0表示成功返回数据条数 =0表示无数据 <0表示异常代码表
// *
// * 当请求操作(增、删、改)时,=1表示操作成功 =0表示失败 <0表示异常代码表
// *
// * @author Jason X... | true |
4043a1e027e657a223f98ff945e810362eff9275 | JavaScript | oscmedgon/oscmedgon-precourse | /skylab/study_session3/exercises.js | UTF-8 | 12,819 | 4.375 | 4 | [] | no_license | //a) Primero, creamos una función que nos cree un saludo, pasa tu nombre como parámetro y devuélvelo por la consola.
function nombre(value){
console.log("HOLA!!!" , value , ",como tu por aquí." )
}
nombre("Óscar");
//b) Intenta retornar los valores en lugar de usar console.log.
var name = "oscar";
var saludar = functi... | true |
0a0a7559aafcdbb9ebf883f618a0b60bb56b0b00 | JavaScript | mendelbrot/return-to-mars | /src/bridge/HelmWheel.js | UTF-8 | 2,164 | 2.796875 | 3 | [] | no_license | import React, { createRef, useEffect } from 'react';
function HelmWheel(props) {
const bgColor = 'saddlebrown';
const WrapperStyle = {
backgroundColor: bgColor,
padding: 10,
borderRadius: 20,
marginRight: 20,
};
const canvasRef = createRef();
useEffect(() => {
... | true |