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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
12fada3280db7ed29f05efc3df39317eba4ba0b3 | JavaScript | EricaSugui/interview_2021_07 | /08_Exercise.js | UTF-8 | 748 | 3.3125 | 3 | [] | no_license | /**
* 08. Exercise
* Source URL = https://www.dell.com/en-us/member/shop
* Using JavaScript or jQuery, dynamically store the
* first word of each category - highlighted in yellow below - ...
*
* ... and add it to the respective sub-links like the image below
* - this is a sample, it should be applied for all p... | true |
effa5db655b7f4eee89182896610346e2a196613 | JavaScript | JazonRaizin/web-workbook | /checkpoint 3/script.js | UTF-8 | 1,617 | 3.109375 | 3 | [] | no_license | "use script"
var killcount = 0;
var watergun = 0;
var exterminator = 0;
var bugBomb = 0;
function update() {
document.getElementById('text').value = killcount;
document.title = killcount + "Ants killed, ";
//Water guns
document.getElementById('ammountOfGuns').innerHTML = "You own " + watergun + "water guns"
... | true |
c03ec94e4df0c6a0edc3db3a98bc90786ee86abb | JavaScript | phuchau267/manga- | /src/public/js/thumbnailsLoader.js | UTF-8 | 1,570 | 2.796875 | 3 | [] | no_license | /*-- Lazy loader Image --*/
var targets =[].slice.call(
document.querySelectorAll(".lazy > source")
)
const imgOptions = {
threshhold: 1, // 1 là toàn bộ bức ành
rootMargin: "0px 0px 0px 0px",
}
const lazyLoadSearch = () => {
var targets2 =[].slice.call(
document.querySelectorAll(".lazy... | true |
146be7caa01171ecfc109859b8d3f88d99b77a4a | JavaScript | Akpjunior94/node-mongo-cli | /src/main.js | UTF-8 | 1,889 | 2.59375 | 3 | [
"ISC"
] | permissive | import chalk from 'chalk';
import fs from 'fs';
import ncp from 'ncp';
import path from 'path';
import { promisify } from 'util';
import Listr from 'listr';
const access = promisify(fs.access);
const copy = promisify(ncp);
let copyTemplateFiles = async (options) => {
return copy(options.templateDirectory, options... | true |
d41832e58806b813ab692b58330cce31ca68d82e | JavaScript | paul-gladoon/jstc | /specs/time.js | UTF-8 | 1,661 | 2.984375 | 3 | [] | no_license | function aaa(data) {
const table = document.querySelector('[id*="TimeEntryWeek"]')
const rows = table.querySelectorAll('[class*=RowData]')
const row = rows[data.rowNum]
const event = document.createEvent('HTMLEvents')
event.initEvent('change', false, false)
if (data.project) {
row.query... | true |
e434df4262ed4b5df4eeb914b6d1a8d2d45edd5d | JavaScript | kkristof93/AoC-2017 | /Day-12/day12-part1.js | UTF-8 | 651 | 3.125 | 3 | [] | no_license | const fs = require('fs');
const file = fs.readFileSync('input.txt', 'utf8');
const lines = file.split("\n");
const programs = [];
for (line of lines) {
const items = line.split(' <-> ');
const id = parseInt(items[0], 10);
programs[id] = {
id: id,
pipes: items[1].split(', ').map(x => parseInt(x, 10)),
... | true |
dc18200b0c8e227838d653f170b4fb62b1ffa366 | JavaScript | hrCO-Team-Blank/nate-fec | /client/src/components/StarChart.jsx | UTF-8 | 3,816 | 2.703125 | 3 | [] | no_license | import React from 'react';
import ProgressBar from './ProgressBar.jsx';
import { Container, Row, Col } from 'react-bootstrap';
class StarChart extends React.Component {
constructor(props) {
super(props);
const totalRatings = props.ratings[1] + props.ratings[2] + props.ratings[3]+ props.ratings[4] + props.rat... | true |
7e05ae40cf52209fae890f81a02c229c3d685c49 | JavaScript | cb-paradise-project-frontend/eureka-client-v2.0.0 | /src/utils/validators/submit/isMobileNumber.js | UTF-8 | 335 | 2.875 | 3 | [] | no_license | export default function isMobileNumber(mobile) {
if(!mobile) return false;
const conditions = [
// length valid
(mobile.length === 10),
// prefix valid
(mobile.slice(0, 2) === '04'),
];
const reducer = (accumulator, currentValue) => accumulator && currentValue;
return conditions.reduce(red... | true |
5759e55eb1951242b21f97465edc47f19be5885b | JavaScript | bananaborane/react-drills | /app-1/App1.js | UTF-8 | 435 | 2.6875 | 3 | [] | no_license | import React, { Component } from "react";
export class App1 extends Component {
constructor() {
super();
this.state = {
text: ""
};
}
handleChange = val => {
this.setState({
text: val
});
};
render() {
return (
<div>
<input type="text" onChange={e => this.h... | true |
4172e4aabc28c9cf32908a62c2d799ee1601beec | JavaScript | Kunstmaan/snipsonian | /doc/snipsonian-doc-site/prev_versions/0.11.0/redux/ReducerTest.js | UTF-8 | 474 | 2.65625 | 3 | [
"ISC"
] | permissive | class ReducerTest {
constructor(reducer) {
this.reducer = reducer;
this.initialState = this.reducer(undefined, {});
this.state = this.initialState;
}
handleAction({action, previousState = this.state}) {
this.state = this.reducer(previousState, action);
return this.... | true |
5b2aa1d385f6345fd607d00d603d71a3bd4db179 | JavaScript | PathLabs/primacy_demo | /main.js | UTF-8 | 14,147 | 2.71875 | 3 | [
"MIT"
] | permissive | /**
* @file main.js
*
* Main file for controlling window rendering and backend pipeline communication.
* Authors:
* - Chance Nelson <chance-nelson@nau.edu>
* - Austin Kelly <ak678@nau.edu>
* - Alex Lacy <al2428@nau.edu>
*/
const { app, BrowserWindow, Menu } = require('electron');
const child_pr... | true |
ac79b0978e15eabc962f738cbf1934b8cf050b45 | JavaScript | wrgyj/letao_sh20 | /public/back/js/product.js | UTF-8 | 7,316 | 2.609375 | 3 | [] | no_license | /**
* Created by 瑞瑞牛肉面 on 2018/5/12.
*/
$(function(){
var currentPage = 1;
var pageSize = 2;
var picArr=[];
render();
function render(){
$.ajax({
type:'get',
url:'/product/queryProductDetailList',
data:{
page: currentPage,
pageSize: pageSize
},
succe... | true |
ae42c4d38627296be9f765bac069526eaaa7c3f8 | JavaScript | janisoteps/inspirator | /public/client.js | UTF-8 | 15,095 | 3.015625 | 3 | [] | no_license | //Set timer for a spinner
function loadFunction() {
var delay = setTimeout(showContent, 1000);
}
//Initialize recipe and user objects
var recipe = {test: 'test'};
var user = {};
//main function block
function showContent(){
//Check if there are cookies stored of a logged in user, set the user object as per cook... | true |
1e4ec801c20bef4ff99154699788a7ad4c227c09 | JavaScript | guifors/meatn | /app/javascript/custom/confirm_booking.js | UTF-8 | 1,105 | 2.78125 | 3 | [] | no_license | const bookingButton = document.querySelector(".join-booking-button");
const confirmBookingWithRestaurant = () => {
bookingButton.addEventListener("click", event => {
const bookingConfirmation = document.querySelector(".modal-body-js");
// const buttonTrue = document.querySelector(".button-true");
modalB... | true |
cbe0115bfcdaa84b05297d626317e4648f2c134f | JavaScript | greenimpala/tiny-runner | /lib/Runner.js | UTF-8 | 2,223 | 2.546875 | 3 | [] | no_license | var bind = require('bind-this');
var EventEmitter = require('events').EventEmitter;
function Runner (params) {
params || (params = {});
this.timeoutLength = params.timeoutLength || 3000;
this.tests = [];
this.scheduled = false;
this.failed = false;
}
Runner.prototype = Object.create(EventEmitter.prototype);
Ru... | true |
0e86f91a4455ccd57c9d4545914eb1bb428e8857 | JavaScript | nuala-odonovan/typopo | /client/components/Game.js | UTF-8 | 3,663 | 2.6875 | 3 | [
"MIT"
] | permissive | import React from 'react'
import {getText} from '../store/text'
import {connect} from 'react-redux'
import Preview from './Preview'
import Score from './Score'
const defaultState = {
textToType: '',
words: [],
submission: '',
correctCount: 0,
idx: 0,
started: false,
startTime: null,
wpm: null,
sec: 0... | true |
60f76378fad2cfb64a878128bae93a3454473139 | JavaScript | pentacode/site | /_lib/toc.js | UTF-8 | 813 | 2.859375 | 3 | [] | no_license | function getItems(headers) {
if (!headers.length) {
return [];
}
const level = headers[0].level;
const items = [];
while (headers.length) {
const item = {
...headers.shift(),
children: [],
};
const subHeaders = [];
while (headers.length && headers[0].level > level) {
s... | true |
a6ad13720b9605bd8c917a711a7c6d174959c2ec | JavaScript | dreamer888/zhihuinongmao | /zhnm/zhnm-miniapp/backend/mallweb/src/main/webapp/plugins/websocketInstantMsg/ext4/ux/layout/Center.js | UTF-8 | 2,051 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | /**
* @class Ext.ux.layout.Center
* @extends Ext.layout.container.Fit
* <p>This is a very simple layout style used to center contents within a container. This layout works within
* nested containers and can also be used as expected as a Viewport layout to center the page layout.</p>
* <p>As a subclass of Fit... | true |
85255d43dbda47101abee4e8fec843decfee8bb2 | JavaScript | dartmouth-cs98/hack-a-thing-21f-2-escoch | /p5-playground/src/sketches/FlowField.js | UTF-8 | 1,211 | 3.03125 | 3 | [] | no_license | export default function FlowField(p5) {
var points = [];
var mult = 0.001;
p5.setup = () => {
p5.createCanvas(window.innerWidth, window.innerHeight);
p5.background(10);
p5.angleMode(p5.DEGREES);
p5.noiseDetail(1);
var density = 20;
var space = p5.width / dens... | true |
b60cf41f9aa46174767e6bd71fa7b3d226ddc775 | JavaScript | jodevsa/node-kinesis-producer | /src/putRecords.js | UTF-8 | 747 | 2.53125 | 3 | [] | no_license | const MAX_RETRIES=10
const MIN_WAIT_TIME=150;
const MULTIPLY_FACTOR=2;
const util = require('util');
const sleep=function(ms){
return new Promise((resolve)=>setInterval(resolve,ms));
}
async function putRecords({client,recordsParams}){
const putRecordsAsync = util.promisify(client.putRecords).bind(client);
const li... | true |
52c88437e4efb202c9e1822782adfd7857b34653 | JavaScript | TheNew000/Node101 | /helloWorld2.js | UTF-8 | 344 | 2.984375 | 3 | [] | no_license | console.log('Hello World');
var dcClass = [
'Paige',
'Eric',
'JT',
'Dave',
'Jackson',
'Summer',
'Shirlette',
'Dan',
'Alex',
'Danielle',
'Brett',
'Keith'
];
console.log(dcClass[3]);
dcClass.push('Rob');
console.log(dcClass);
console.log(dcClass[dcClass.length-1]);
window.... | true |
865c1125a874cb571cefb8d8f55fd260551a6b63 | JavaScript | congnghia0609/ntc-ncrypto | /test/dev_all.js | UTF-8 | 7,577 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | /**
*
* @author nghiatc
* @since Mar 20, 2020
*/
// Command run test:
// cd ~/ntc/ntc-ncrypto
// node ./test/dev_all.js
const sss = require('../src/sss');
const BigInteger = require("big-integer");
// // Dev1: randomNumber
// for (let i=0; i < 100; i++) {
// var rd = sss.randomNumber();
// console.log('rd: '... | true |
f15f812cb098bbfca3cbc45efaeaa264c031632b | JavaScript | xnjypt/xnhbjypt | /web-appBackground/src/main/webapp/resources/js/menuUser.js | UTF-8 | 2,865 | 3 | 3 | [
"MIT"
] | permissive | var drx = $.extend({}, drx);/* 全局对象 */
//当选中一个省份后,查询对应的市区名称
function province1(){
var province = $("#province");
if(province.val() != "0"){
var provinceId = province.val();
$.post("city.do?cityList",{"provinceId":provinceId},callback2);
}else{
//当用户没有选择省份的时候,就将市区下拉列表框中原有的“请选择”字样删除。
$("#city")... | true |
3827c5b35972095ab1cf9de7ea53530e559b38a8 | JavaScript | WhiteLotus9678/Towja- | /Towja without Node.js Modules/assets/src/levelData/Level_1.js | UTF-8 | 2,585 | 2.515625 | 3 | [
"MIT"
] | permissive | /* globals __DEV__ */
import Level from '../states/Level.js'
import LevelCollider from '../levelData/LevelCollider.js'
// import Scroll from '../itemData/Scroll.js'
// import WallJumping from '../itemData/WallJumping.js'
// import SaveScroll from '../objects/SaveScroll.js'
export default class extends Level {
... | true |
359a1dd9c078a84dfeb91508e6625c71d888b879 | JavaScript | Kaisirak/TowerProto | /Assets/Scripts/Player.js | UTF-8 | 1,333 | 2.65625 | 3 | [] | no_license | #pragma strict
public var playerClass : String;
public var playerName : String;
public var ATB : float;
public var ATB_UI : UnityEngine.UI.Slider;
public var HP : int;
public var HP_MAX : int;
public var HP_UI : UnityEngine.UI.Slider;
public var MP : int;
public var MP_MAX : int;
public var MP_UI : UnityEngine.UI... | true |
86ac8f334da5a942d6aaf8655f7488c3b7255035 | JavaScript | DanielSeehausen/fi-field-day | /code/node-server/src/app/_group.js | UTF-8 | 1,569 | 2.65625 | 3 | [] | no_license | // TODO dynamically load into the class not hard copy
const WRITE_MILESTONES = new Set([100, 500, 1000, 5000, 10000, 20000, 30000, 40000, 50000])
const BAD_REQUEST_MILESTONES = new Set([100, 500, 1000, 5000, 10000])
class Group {
// stored as g-<id> as redis key
constructor(id, redisConn) {
this.ips = new Set... | true |
2a57e68b71e919ae6c3703f6f38931e2fd96cd3d | JavaScript | pawankorotane/data-structures | /src/strings/longest-word.js | UTF-8 | 349 | 3.5625 | 4 | [] | no_license | 'use strict';
/**
* JavaScript function that accepts a string as a parameter and find the longest word within the string
*/
export default (str) => {
let arr = str.split(' ');
let max = arr[0].length;
for (let i = 1; i < arr.length; i++) {
if(max < arr[i].length){
max = arr[i];
... | true |
0c9b962c9d931b40efd032341348dd4492ffc14e | JavaScript | rhysawilliams2010/ndis-emarket | /client/components/directives/validation.directive.js | UTF-8 | 1,889 | 2.640625 | 3 | [] | no_license | 'use strict';
var validPhoneRegEx = /^((([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})([0-9]{4})$/;
angular.module('emarket').directive('phone', function() {
return {
require: 'ngModel',
link: function(scope, elm, attrs... | true |
f1a72379a10f801f27f1991beba110c4ae2eabb0 | JavaScript | HYDGITHHUB/Auction | /WebContent/js/heard-footer.js | UTF-8 | 1,565 | 2.96875 | 3 | [
"MIT"
] | permissive | /***************************页面选中情况********************/
//获得页面标签
var homepage = document.querySelector('.home-page');
var auctionpage = document.querySelector('.auction-page');
var auctionlistpage = document.querySelector('.auctionlist-page');
var auctionflowpage = document.querySelector('.auctionflow-page');
var mypa... | true |
ae6b33183ec7801d787d7c5dd7d3308134a047c8 | JavaScript | Kore-Development/Bastion | /events/guildMemberRemove.js | UTF-8 | 2,505 | 2.546875 | 3 | [
"MIT"
] | permissive | /**
* @file guildMemberRemove event
* @author Sankarsan Kampa (a.k.a k3rn31p4nic)
* @license MIT
*/
module.exports = async member => {
try {
let guild = await member.client.db.get(`SELECT farewell, farewellMessage, farewellTimeout, log FROM guildSettings WHERE guildID=${member.guild.id}`);
if (!guild) re... | true |
200eb4080a5a708c8c77451dc9423598dda928b0 | JavaScript | alexindigo/is-node-modern | /index.js | UTF-8 | 455 | 3.03125 | 3 | [
"MIT"
] | permissive | var modernVersion = 4;
module.exports = isModern;
/**
* Checks if node's major version
* is equal or above threshold
*
* @param {number} [threshold=4] - major version "modern" threshold
* @returns {boolean} - `true` if current node version equals or above provided threshold, `false` otherwise
*/
function isMo... | true |
9d918d64d72e10d5bb0e72021fa521833fdfdee1 | JavaScript | sghiassy/algorithms | /08 - Elementary Sorting Methods/03 - Bubble Sort/main.js | UTF-8 | 603 | 2.953125 | 3 | [] | no_license | $(function() {
window.terminal = new Terminal();
$('#submit').click(function() {
var sortArray = $('#sortArray').val().split(" ").map(function(value, index) {
return parseInt(value);
});
terminal.log(sortArray);
for(var backStop = 0; backStop < sortArray.length; backStop++) {
for(var pointer = so... | true |
625a079f294f35db7d918ecfb976ef52afa79f29 | JavaScript | Rilong/cleaner-cli | /bin/cleaner.js | UTF-8 | 2,692 | 2.90625 | 3 | [] | no_license | #!/usr/bin/env node
const path = require('path')
const fs = require('fs')
const yargs = require('yargs')
const chalk = require('chalk')
const moment = require('moment')
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
})
const params = yargs.option('date', {
desc... | true |
f7ccaf659205380072b25259e16ccfba31c59cb7 | JavaScript | nvodoor/recursion | /src/stringifyJSON.js | UTF-8 | 1,743 | 3.75 | 4 | [] | no_license | // this is what you would do if you liked things to be easy:
// var stringifyJSON = JSON.stringify;
// but you don't so you're going to write it from scratch:
var stringifyJSON = function(obj) {
// your code goes here
var resultstring = "" + obj
if (typeof obj === 'string') {
return '"' + obj + '"'
// ... | true |
3be027440d7bcfe81f048c744df4331b1d233dd2 | JavaScript | 3mik/mod-15-es6-task-01 | /script.js | UTF-8 | 2,608 | 4.25 | 4 | [] | no_license | //task 1
const text1 = 'Hello';
const text2 = 'world'
const text3 = `${text1} ${text2}!`;
console.log(`task 1 (join strings): ${text3}`);
//task 2
const multiply = (a=1, b=1) => a*b;
console.log(`task 2 (fn multiply default params): ${multiply()}`);
console.log(`task 2 (fn multiply(2)): ${multiply(2)}`);
console.log(`... | true |
1795aa2e0dc20cdde14e26a091dc128671fb11aa | JavaScript | romgrk/rambda | /source/forEach.spec.js | UTF-8 | 1,685 | 3.375 | 3 | [
"MIT"
] | permissive | import { forEach } from './forEach'
import { type } from './type'
test('iterate over object', () => {
const obj = {
a : 1,
b : [ 1, 2 ],
c : { d : 7 },
f : 'foo',
}
const result = {}
const returned = forEach((
val, prop, inputObj
) => {
expect(type(inputObj)).toBe('Object')
result... | true |
6cfb2b8922882e17df03c76d3a633951fe8fe301 | JavaScript | TND23/homesite | /app/assets/javascripts/snakes_js/zeta.js | UTF-8 | 2,958 | 2.984375 | 3 | [] | no_license | (function(window){
var Board = window.Board = (SnakeGame.Board || {});
var GameBoard = Board.GameBoard = function(){
this.snake_divs = [];
this.normal_mode = true;
};
GameBoard.prototype.create = function(body){
for (var i = 0; i < 20; i++){
var oldDiv = document.createElement("div");
this.makeRow(old... | true |
148256d739826012b74bcb092ba407b5cf47ab9a | JavaScript | hannesmcman/AAO-React-Native | /source/views/faqs/index.js | UTF-8 | 1,814 | 2.5625 | 3 | [
"MIT"
] | permissive | // @flow
import React from 'react'
import {RefreshControl} from 'react-native'
import {ScrollView} from 'glamorous-native'
import {Markdown} from '../components/markdown'
import {reportNetworkProblem} from '../../lib/report-network-problem'
import LoadingView from '../components/loading'
import * as defaultData from '.... | true |
d12cef217b166825ad0c58fb6e3587da699bc465 | JavaScript | sjgeyer/18-binary-search-trees-hash-tables | /src/__test__/binary-search-tree.test.js | UTF-8 | 1,228 | 3.140625 | 3 | [] | no_license | 'use strict';
import BST from '../lib/binary-search-tree';
import Node from '../lib/binary-node';
describe('binary search tree', () => {
test('NO CHILDREN REMOVE - should replace node with null', () => {
const root = new Node(2);
const tree = new BST(root);
tree.insert(1);
tree.insert(3);
tree.r... | true |
93cea6083f9ec61d0a81970d392b0f84f9b30618 | JavaScript | MayBlackwood/angularJSClasses | /app.js | UTF-8 | 956 | 2.953125 | 3 | [] | no_license | (function() {
'use strict';
var app = angular.module('LunchCheck', []);
app.controller('LunchCheckController', LunchCheckController);
LunchCheckController.$inject=['$scope'];
function LunchCheckController($scope) {
$scope.listOfDishes = '';
$scope.message;
$scope.checkAmountOfDishes = function... | true |
d00aa4b9ab5ba34524b1b32eb74be07693c79ac4 | JavaScript | MaaliLightsCribe/devprofile | /services/profile.js | UTF-8 | 9,485 | 2.515625 | 3 | [] | no_license | const Profile = require('../models/Profile');
const User = require('../models/User');
const Post = require('../models/Post');
const joi = require('@hapi/joi');
const config = require('config');
const request = require('request');
//GET: current user Profile:
const getUserProfile = async (req, res) => {
try {
... | true |
82c81b8adb7d1e409373f13e695bb646408214f4 | JavaScript | BuDap/kretbot | /events/guildCreate.js | UTF-8 | 424 | 3.015625 | 3 | [
"MIT"
] | permissive | // This event executes when a guild (server) is joined.
module.exports = class {
constructor(client) {
this.client = client;
}
async run(guild) {
this.client.user.setActivity(`dla @${this.client.user.username} help | ${this.client.guilds.size} Serwerach`, { type: "WATCHING" });
this.client.logger.lo... | true |
2967f61995d7c96c1a4407e68f5ec55fa3e18c82 | JavaScript | PHILLyaHI/moduleE2_homework | /moduleE2_homework/2/index.js | UTF-8 | 191 | 3.71875 | 4 | [] | no_license | let x = true
if (Number(x)) {
alert(x + ' -- число')
} else if (String(x)) {
alert(x + ' -- строк')
} else {
alert('Тип ' + x + ' не определён')
} | true |
6704b99679b8dbb6f81307f7cbf151e4ce5af66b | JavaScript | thomasclaudiushuber/Basta-TypeScript-Workshop | /05_Generics/01_genericArray/main.js | UTF-8 | 118 | 2.921875 | 3 | [] | no_license | var array = new Array();
array.push(1);
array.push(2);
array.push("Hello"); // Error, string not assignable to number
| true |
a0a1222a37ab71aecf52ddc4acf6b1519e5317b2 | JavaScript | vishnoishan/MY-OWN-GAME | /sketch.js | UTF-8 | 10,915 | 3.328125 | 3 | [] | no_license | // CREATING GAME STATE AND SCORE , LIFE , MODE , ENEMIES AND FIGHTER SHIP .
var PLAY = 1;
var END = 0;
var gameState = PLAY ;
var mode ;
var backgroundb, backgroundImg ;
var ship, shipimg;
var bullet ;
var enemyGroup , enemyImg ;
var bulletGroup ;
var enemy2Group,enemy2img ;
var enemy3Group , enemy3img ;
v... | true |
8ac48418bc0d200173ad8bc88187568ce700314e | JavaScript | LuisArielRetanaHernadez/Weather-App | /src/components/Message.jsx | UTF-8 | 1,160 | 2.703125 | 3 | [] | no_license |
// hooks react
import { useRef, useEffect } from 'react'
// estilos del componente Message
import '../styles/Message.style.css'
const Message = ({status, statusText, err}) => {
const messageComponent = useRef(null)
const hideMessageComponent = () => {
const idMessage = messageComponent
con... | true |
1b8cd00bd40dfb85f6da5147898e8d6046136c4b | JavaScript | gitple/haproxy | /lib/parser.js | UTF-8 | 1,652 | 2.765625 | 3 | [
"MIT"
] | permissive | 'use strict';
/**
* Automatic parser interface for configuration changes.
*
* @constructor
* @param {Configuration} config The parent configuration instance
* @api private
*/
function Parser(config) {
if (!(this instanceof Parser)) return new Parser(config);
this.config = config;
this.config.on('read', f... | true |
4008ab7ff0652fb2fe54386984c637809bfb81b1 | JavaScript | zachi/mousehero | /public/models/audio.js | UTF-8 | 989 | 2.5625 | 3 | [] | no_license | export default (function () {
var audioDomElement;
function startInterrupt() {
audioDomElement.volume = 0.0;
}
function stopInterrupt() {
audioDomElement.volume = 0.4;
}
function init(playlistName) {
if (!audioDomElement) {
audioDomElement = document.createElement('audio');
audi... | true |
b878c590b96f8af252697a89b47c9cbbab971728 | JavaScript | arm22/eloquent-javascript | /exercises/ch7-exercises.js | UTF-8 | 1,573 | 3.984375 | 4 | [] | no_license | /**
* Exercise #1
* Constructor for a smart plant eater
*/
function SmartPlantEater () {
this.energy = 30;
this.direction = 'e';
}
SmartPlantEater.prototype.act = function (view) {
var space = view.find(' ');
if (this.energy > 90 && space) {
return {type: 'reproduce', direction: space};
}
var plants... | true |
388cbfd86f31b5d8c74a8ae31a1f9da9800f5ae8 | JavaScript | PierreCavalet/module-pattern-workshop-support | /module-pattern-dependencies/people.js | UTF-8 | 1,339 | 3.234375 | 3 | [] | no_license | var peopleParams;
var PeopleModule = (function (peopleParams) {
// init
var limit = 5;
if (peopleParams.limit) {
limit = peopleParams.limit;
}
// private data
var people = ['Franck', 'Jack'];
/**
* render - render the people list
*/
var render = function () {
var peopleNode = document.ge... | true |
309c6ca0deb09f85cb174e083ab9957e7f6e586e | JavaScript | PatrykJarzynka/goit-js-hw-07 | /src/js/01-gallery.js | UTF-8 | 1,457 | 3.109375 | 3 | [] | no_license | import { galleryItems } from './gallery-items.js';
// Change code below this line
const gallery = document.querySelector('.gallery');
let array = [];
galleryItems.forEach(element => {
//tworzenie kontenera na poszczególne elementy
const item = document.createElement('div');
item.classList.add('gallery__item');
... | true |
c93f4df5296904d1a70e10db0bba01b7021cd443 | JavaScript | avk001/lab8_part2 | /src/components/useJsonFetch.js | UTF-8 | 1,141 | 2.703125 | 3 | [] | no_license | import {useState, useEffect, useRef} from 'react'
export default function useJsonFetch(url, opts) {
const [data, setData] = useState();
const [isLoading, setLoading] = useState(false);
const [hasError, setError] = useState(null);
const timestampRef = useRef();
useEffect(() => {
const fetch... | true |
1400f2bd940114cdc185f94f35c9655fca9163c7 | JavaScript | lmpeixoto/dose-certa-vanilla | /public/js/editPA.js | UTF-8 | 2,532 | 2.984375 | 3 | [] | no_license | const fetchMedicamentosDosesRecomendadas = async () => {
let response = await fetch("/medicamentos");
let data = await response.json();
return data;
};
const medicamentosDosesRecomendadas = fetchMedicamentosDosesRecomendadas();
const paSelector = document.getElementById("paSelector");
const doseSelector = docum... | true |
c8faea9a1d3d5966170b9ddc4b9cc80feec49121 | JavaScript | Clark-Minor/shark-attack | /backup1-main-scene.js | UTF-8 | 38,034 | 3.21875 | 3 | [] | no_license | // window.Cube = window.classes.Cube =
// class Cube extends Shape // A cube inserts six square strips into its arrays.
// { constructor()
// { super( "positions", "normals", "texture_coords" );
// for( var i = 0; i < 3; i++ )
// for( var j = 0; j < 2; j++ )
// { var square_transform = Mat4... | true |
a5150efad853e2ebcc321dd6c07691e1538f414f | JavaScript | nevvord/olz-backend | /router/SuperAdmin/controllers/put/changeSubCategory.js | UTF-8 | 677 | 2.546875 | 3 | [] | no_license | module.exports = async (req, res) => {
const {titleEn, titleRu, titleUa, characteristics} = req.body.subCategory
const _id = req.params.id
const subCategory = await db.SubCategories.findOne({_id})
subCategory.titleEn = titleEn
subCategory.titleRu = titleRu
subCategory.titleUa = titleUa
subCategory.c... | true |
2ca969d29c360db719d3872f20f0910fe7b8c818 | JavaScript | Desmonddai583/chat | /public/client.js | UTF-8 | 2,557 | 2.828125 | 3 | [] | no_license | $(function() {
var socket = io();
var typing = false;
$(".usernameInput").keydown(function (event) {
if (event.which === 13) {
var username = $(".usernameInput").val();
$(".login").fadeOut();
$(".chat").show();
socket.emit('new user', username);
socket.username = username;
}... | true |
618c74ec91484b411bff0955d4acbc180bdddb54 | JavaScript | Kainatn/js-assigmnet-chpter-1-to-67 | /app.js | UTF-8 | 7,636 | 3.53125 | 4 | [] | no_license | // Chapter # 21 Task = 1
// var firstName = prompt("Enter First name");
// var lastName = prompt("Enter Last name");
// var fullName = firstName + " " + lastName;
// document.write('hello ', fullName);
// Task = 2
// var fvrMobileModel = prompt('Enter Your Favorite Mobile Model');
// var lengthOfModel = fvrMobileMode... | true |
3d95d50f5370a70e44a4dbad98b63f9e73bcfc5d | JavaScript | Taicyan/InfoVis2019 | /W02/vec3.js | UTF-8 | 1,054 | 3.328125 | 3 | [] | no_license | Vec3 = function( x, y, z )
{
this.x = x;
this.y = y;
this.z = z;
}
Vec3.prototype.xget = function()
{
return this.x;
}
Vec3.prototype.yget = function()
{
return this.y;
}
Vec3.prototype.zget = function()
{
return this.z;
}
Vec3.prototype.add = function( v )
{
this.x += v.x;
this.y += v.y;
this.z += v.z;
return t... | true |
851e3443956e7b8a9e797cf859454ee90e61817f | JavaScript | gabhu-dev/LIM010-fe-burger-queen-api-client | /my-app/src/controller/users/Users.js | UTF-8 | 829 | 2.828125 | 3 | [] | no_license | // crea una nueva usuaria
// Requiere token de autenticación y que la usuaria sea admin
const getUsers = (token, admin)=>{
return fetch('http://localhost:5000/users',{
method:'POST',
headers:{
'Content-Type': 'application/json',
'Authorization': 'Bearer' + token
},
body:{
email,
... | true |
ae9cdb7414c05157af1ef4e3ac772af19febf083 | JavaScript | banerjeesouvik/React-Weather-Lookup | /server.js | UTF-8 | 683 | 2.546875 | 3 | [] | no_license | const express = require('express');
const request = require('request');
var app = express();
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
const port = 8080;
app.get('... | true |
44b60d633f3756257999189e9404dd721e71f102 | JavaScript | Bojo966/SoftUni-JS-Fundamentals | /Lab-Strings-and-Regex/count-occurances.js | UTF-8 | 316 | 3.375 | 3 | [
"MIT"
] | permissive | function countOccurances(keyword, text) {
let currentIndex = -1
let counter = 0;
while (currentIndex < text.length) {
currentIndex = String(text).indexOf(keyword, currentIndex + 1)
if (currentIndex === -1) {
break
}
counter++
}
console.log(counter)
} | true |
2ef7863c83c757084f9ff38a2ebcf8bfa885b644 | JavaScript | vaclav-langr/TUL_DetectorDemo | /stopper.js | UTF-8 | 1,338 | 3.046875 | 3 | [] | no_license | let stopperStates = {
sS: 0
};
let endState;
let currentState = stopperStates.sS;
function getKey(value) {
return Object.keys(stopperStates).find(key => stopperStates[key] == value);
}
const reset = function () {
currentState = stopperStates.sS;
};
const switchState = function (input) {
let result =... | true |
cd76f0d500d6c8a4971ab3247ff3cddbf1497296 | JavaScript | dupp21/javascript-project-1 | /level-1.js | UTF-8 | 285 | 3.265625 | 3 | [] | no_license | var numberA = 10;
let numberB = 099;
const numberC = 0.02;
//console.log( numberA + numberA + numberC);
//console.log( numberA - numberA - numberC);
//console.log( numberA * numberA * numberC);
//console.log( numberA / numberA / numberC);
//onsole.log( numberA % numberA % numberC);
| true |
459c2fd2181f746fcf84254618969dd92d44ea12 | JavaScript | musamusazada/JS-Christmas_Tree-Animated | /JS-Tasks-21_10/js/Christmas_Tree/tree_Method.js | UTF-8 | 407 | 3.796875 | 4 | [] | no_license | let arrStar = ["*"]
//Taking the height input from user(how tall should our star would be)
let Height = document.getElementById("treeHeightID").value;
//Before Starting, with this method we center the Tree in Console.
for (let i = 0; i < Height - 1; i++) {
arrStar.unshift(" ");
}
for (let i = 0; i < Height; i++... | true |
fd5b9924fadc04b267f315aebb3eb284054592a9 | JavaScript | zxuqian/react-examples | /src/examples/02-React-State-Event-gradient-generator/Gradient/index.js | UTF-8 | 1,583 | 3.03125 | 3 | [
"MIT"
] | permissive | import React, { useState } from "react";
import styles from "./styles.module.css";
export default function Gradient() {
// 设置两个 state,给默认值
const [color1, setColor1] = useState("#00F260");
const [color2, setColor2] = useState("#0575E6");
// 统一处理 input change,或者也可以分开,如果有不同的处理逻辑的话
function handleInputChange(e)... | true |
3649e04d0f07e072aa8a9fcb9eaf52dd8c0f52dd | JavaScript | black-r0s3/Javascript_beginner_to-advance | /control-assignment-problem/assignment.js | UTF-8 | 526 | 4.375 | 4 | [] | no_license | const randomNumber = Math.random(); // produces random number between 0 (including) and 1 (excluding)
const otherRandomNumber = Math.random();
if(
(randomNumber > 0.7 && otherRandomNumber> 0.7)
|| randomNumber<=0 || otherRandomNumber <= 0){
alert('GREATER THAN 0.7 or SMALLER THAN 0.2')
}
const numbers... | true |
8131e6bbc0ebd6d8e46a5849b786baaf9bea0cea | JavaScript | ezinkow/savti-elka-65th-bday-trivia | /script.js | UTF-8 | 8,641 | 2.625 | 3 | [] | no_license | $(document).ready(function(){
var currentQuestionIndex = -1
$(".introBtn").on("click",function(){
$(".btnDiv").removeClass("hide")
$(".btnDivIntro").addClass("hide")
currentQuestionIndex = currentQuestionIndex + 1
$(".currentQuestion").html(questions[currentQuestionIndex])
})
$(".nextBtn").on("click"... | true |
43e177ce6aec3b57940a564909e1c3f388b08d20 | JavaScript | yellowful/test-driven-development | /src/Counter/Counter.test.js | UTF-8 | 3,803 | 2.796875 | 3 | [] | no_license | import React from 'react';
import { render, fireEvent } from '@testing-library/react';
import Counter from './Counter';
// 用來取代原本每個test都有的
// const {getByTestId} = render(<Counter />);
let getByTestId;
beforeEach(()=>{
const component = render(<Counter />);
getByTestId = component.getByTestId;
})
test('expect te... | true |
f247075f61343cd21ad00047cfbd89ff49e59882 | JavaScript | roshil1206/chatwebapp | /index.js | UTF-8 | 5,313 | 2.515625 | 3 | [] | no_license | const express = require('express');
const app = express();
const PORT = process.env.PORT || 5000;
const server = app.listen(PORT,()=>console.log(`Server is Running on Port: ${PORT}`));
const Users = require('./models/user');
const Roomdetails = require('./models/chatroom');
const crypto = require('crypto');
const sessi... | true |
89538bd709c83ad01bc27dbe0c4fe021472f05b5 | JavaScript | simonayzman/Bubbl | /src/components/TopicBundleCard.js | UTF-8 | 3,697 | 2.59375 | 3 | [
"MIT"
] | permissive | import React, { Component, PropTypes } from 'react';
import FlipView from './FlipView';
import ArticleCard from './ArticleCard';
export default class TopicBundleCard extends Component {
static propTypes = {
topicBundle: PropTypes.object.isRequired,
onFlip: PropTypes.func,
onPressHeader: PropTypes.func,
... | true |
2504feb50e7d38e2927a311e056d02ccaa936380 | JavaScript | breitman/Starships | /client/components/forms/CheckoutForm.js | UTF-8 | 1,903 | 2.734375 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
import { connect } from 'react-redux';
//need to import correct thunk from store to get user and then make maptostate and dispatch
class CheckoutForm extends Component {
constructor() {
super();
this.state = {
firstname : '',
lastname : '',
address... | true |
34d6124b8b130fbb0b814237f67991dd3a44cfb6 | JavaScript | clay-siefken/randoscripts | /src/json-to-tsv.js | UTF-8 | 566 | 2.890625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/node
process.stdin.setEncoding('utf8');
let allChunks = '';
process.stdin.on('readable', () => {
let chunk;
while ((chunk = process.stdin.read()) !== null) {
allChunks = `${allChunks}${chunk}`;
}
});
process.stdin.on('end', () => {
let j = JSON.parse(allChunks);
let propertiesToReturn = [];... | true |
e1e241e652e05426378dcfd324484e3d38f246ac | JavaScript | fAssqy/code.me-react-redux | /homeWorksRedux/src/Tasks_11/Task-11.07/App.js | UTF-8 | 5,389 | 2.578125 | 3 | [] | no_license | import React from "react";
import {connect} from 'react-redux';
import {addZero} from './reducers';
import AddNote from './Components/addNote';
import AppHeader from './Components/appHeader';
import FilterPanel from './Components/filterPanel';
import ListNotes from './Components/listNotes';
import SearchPanel from './... | true |
92b489267e5b6f069b725ac927ccafad221ef8e1 | JavaScript | neronim1141/WarOfFour | /game.js | UTF-8 | 3,023 | 3.3125 | 3 | [] | no_license | class Game {
constructor(size = 10) {
this.size = size;
let x = -1;
let y = -1;
this.map_ = new Array(size).fill("0").map(v => {
y++;
let mapX = new Array(size).fill("0").map(v => {
x++;
return {
playerName: null,
points: 0,
x: x,
y:... | true |
faec8e49392ff685dea85bc2f926006685eb56d0 | JavaScript | MhmdAbdlh/EPL-reservation-system | /controllers/matchController.js | UTF-8 | 11,775 | 2.84375 | 3 | [] | no_license | const Match = require('../models/Match');
const Team = require('../models/Team');
const Stadium = require('../models/Stadium');
const Reservation = require('../models/Reservation');
// utility function, calculate percentage or reservation of a certain match
const getPercentage = (lounge) => {
let count = 0;
lo... | true |
b08a9c4b030a79fce34d9504f17fb510f2e9fb07 | JavaScript | joaofcmb/CGRAProject | /project/MyTrapSolid.js | UTF-8 | 2,006 | 2.84375 | 3 | [
"MIT"
] | permissive | /**
* MyUnitCubeQuad
* @constructor
*/
class MyTrapSolid extends CGFobject
{
constructor(scene, lAng, rAng)
{
super(scene);
this.lAng = lAng;
this.rAng = rAng;
this.quad = new MyQuad(this.scene);
this.frontTrapeze = new MyTrapeze(this.scene, lAng, rAng);
this.backTrapeze = new MyTrapeze(this.scene, r... | true |
9a6bf937cc118fdb9226d092361acb224fc64fef | JavaScript | mattstyles/browserify-babel-scaffold | /src/components/counter/index.js | UTF-8 | 961 | 2.921875 | 3 | [
"ISC"
] | permissive |
import {fromEvent, merge} from 'most'
import {clamp} from 'lodash/fp'
import {register} from 'core/register'
const clamped = clamp(0, Number.MAX_SAFE_INTEGER)
const add = (count, additive) => clamped(count + additive)
class Counter {
constructor (el) {
this.addEl = el.querySelector('.js-counter-add')
this... | true |
fdc4b94019191475e36a267857271bfcf4cc8543 | JavaScript | jezhou8/PygHacks | /src/Charts/DataVis.js | UTF-8 | 3,515 | 2.765625 | 3 | [] | no_license | import ReactDOM from "react-dom";
import React, { Component } from "react";
import { Chart, Pie } from "react-chartjs-2";
import Colors from "./colors";
class MainChart extends Component {
state = {
data: [],
jobs_applied: 0,
loading: false,
};
CustomChart = React.createRef();
constructor(props) {
super(... | true |
f7c02aaf922e2314768f4ee7f6ba37dc12fc8cdc | JavaScript | Nate1546/learning-p5-js | /lesson-3/ch-7-functions/exercise-7.2-fido-functions/sketch.js | UTF-8 | 1,585 | 3.4375 | 3 | [] | no_license | var fido = {
x: 10,
y: 0,
w: 200,
h: 240,
xspeed: .8,
yspeed: 0,
gravity: .1,
xdir: 1,
ydir: 1,
damp: -.85
}
function setup() {
createCanvas(640, 640);
}
function draw() {
background(220)
ellipseMode(CENTER);
rectMode(CENTER);
move();
bounce();
head();
eyes();
nose();
ears();
}
function ... | true |
d3cbaf90e3f69dfbd7d9e58e1f51ff751fa5e082 | JavaScript | amirsanni/number-to-words-js | /src/handlers.js | UTF-8 | 2,834 | 3.109375 | 3 | [] | no_license | const xml = require('./xml');
const handlers = {
handleXDigits(digits){//1-19
return xml.x[digits];
},
handleTwoDigits(digits){//20-99
if(digits <= 19){
return this.handleXDigits(digits);
}
else{
let first_digit = digits.substr(0, 1);
... | true |
7e99fe697f086f1c82a838ecaccaab052cde2ea2 | JavaScript | melinoya/227487-keksobooking | /js/pin.js | UTF-8 | 640 | 2.859375 | 3 | [] | no_license | 'use strict';
(function () {
var template = document.querySelector('template');
var pin = template.content.querySelector('.map__pin');
// ----- Создание метки на карте (шаблон) -------
window.createPin = function (arr) {
var pinClone = pin.cloneNode(true);
pinClone.style = 'left: ' + (arr.location.x -... | true |
67751a44e65c609c25e911400fd9ca737b5b19d0 | JavaScript | spaceCh1mp/pow | /client/src/components/Orders/orders.js | UTF-8 | 2,613 | 2.71875 | 3 | [
"MIT"
] | permissive | import React, {useEffect, useState} from 'react';
//Material UI core
import Link from '@material-ui/core/Link';
import Table from '@material-ui/core/Table';
import TableRow from '@material-ui/core/TableRow';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
impor... | true |
85f64ef6433aec15e5ec83610f9c8f200176b246 | JavaScript | thejsj/spinoza-parsing | /index.js | UTF-8 | 4,139 | 2.875 | 3 | [] | no_license | 'use strict'
const Promise = require('bluebird')
const fs = require('fs')
const toArabic = require('roman-numerals').toArabic
// References
const refRegexGlobal = /([ivx]+)\.(?:[\,\s])?(Prop|Deff|Def|Ax)?\.?(?:\s)?([ivx]+)\.( of this)?/ig
const refRegexes = [
/([ivx]+)\.(?:[\,\s]*)?(Prop|Deff|Def|Ax)\.(?:\s)?([ivx]... | true |
ec31b82d9789b177c531d417e7c0d82597f7ee59 | JavaScript | fzhaw/rasppi | /register-server/server.js | UTF-8 | 2,377 | 2.59375 | 3 | [] | no_license | //Lets require/import the HTTP module
var http = require('http');
var querystring = require('querystring');
var express = require('express');
var bodyParser = require('body-parser');
var https = require('https');
var app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded());
var screens = {};
var fs... | true |
fb90b3d5aa4d806f829025adf882725f670adcc2 | JavaScript | lawsomit000/nss_statefair | /scripts/main.js | UTF-8 | 273 | 2.546875 | 3 | [] | no_license | // Import and invoke the ticket booth component function
import { ticketBooth } from "./TicketBooth.js"
const buttonsContainer = document.querySelector("#buttonsContainer")
const renderAllHTML = () => {
buttonsContainer.innerHTML = ticketBooth()
}
renderAllHTML()
| true |
abe299cc364ce26dd71607809c4510b61010fb98 | JavaScript | DensonAbraham/mail-automation | /index.js | UTF-8 | 2,947 | 2.546875 | 3 | [
"MIT"
] | permissive | var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(':memory:');
const { GoogleSpreadsheet } = require("google-spreadsheet");
const creds = require("./credentials.json");
// spreadsheet key is the long id in the sheets URL
const doc = new GoogleSpreadsheet(
"1J1U8awhcpyYrQg5z4Vx9uTu8Jn3-ycwZTG... | true |
c37bfe337ca3c695b8b552431092ca38529ecf1a | JavaScript | mab1916/mabform1916 | /10th Assignment Form.js | UTF-8 | 1,687 | 3.21875 | 3 | [] | no_license | function SubMit() {
// UserId
var userId = document.getElementById("userId").value;
var userIdOutput = "";
if (userId.length < 5 || userId.length > 12) {
userIdOutput = userIdOutput + "Please Enter Character Between 5 to 12";
}
document.getElementById("userIdNote").innerHTML = userIdOutput;
... | true |
d195d8d580b2da68605a8dc69bf4ddc80dba4c8f | JavaScript | qmmr/bonsai | /src/runner/display_object.js | UTF-8 | 22,864 | 2.59375 | 3 | [
"MIT"
] | permissive | define([
'../event_emitter',
'../tools',
'./matrix',
'../point',
'./animation/animation',
'./animation/keyframe_animation',
'./filter/builtin'
], function(
EventEmitter, tools, Matrix, Point, Animation,
KeyframeAnimation, filter
) {
'use strict';
var accessor = tools.descriptorAccessor, data = to... | true |
d6ba943a6935c4d5b16f40aa0c8c3d4728e3bc81 | JavaScript | richierob62/flipmaster | /src/bar.js | UTF-8 | 933 | 2.609375 | 3 | [] | no_license | import Vector from './vector'
import { randomId } from './utils'
import spriteMeta from '../public/assets/flipmaster_spritesheet'
class Bar {
constructor(game, pos, activeSide) {
this.type = 'bar'
this.id = randomId()
this.game = game
this.pos = pos
this.activeSide = activeSide
if (activeS... | true |
1a46274198bd99213306923772a26fce4faf6fc2 | JavaScript | trezp/problem-solve-js | /app.js | UTF-8 | 1,963 | 3.953125 | 4 | [] | no_license | const gallery = document.getElementById("gallery");
const menus = document.querySelector("#menus select");
const inputField = document.querySelector("input");
const search = document.getElementById("search");
/**
* Filter Cats by Colors
* EXCEEDS ==> filter by any property
* @param {string} value -
*/
function fil... | true |
c766a20dee2646db3b59c56a9d868593cd7bc88c | JavaScript | notator/SlurTemplateConverter | /es6/Point.js | UTF-8 | 1,470 | 4.03125 | 4 | [] | no_license |
export class Point
{
constructor(x, y)
{
this.x = x;
this.y = y;
}
clone()
{
return new Point(this.x, this.y);
}
// Moves this point by adding dx and dy to its coordinates.
move(dx, dy)
{
this.x += dx;
this.y += dy;
}
// Rounds the valu... | true |
ead32a3c68e1e1a7ac72c741cef17a8480ec751f | JavaScript | hariasfrancia/Codigo_Online2 | /Semana5/Dia1/01-introjavascript.js | UTF-8 | 512 | 3.71875 | 4 | [] | no_license | // Hola soy un ocmentario .)
console.log("Hola Código!!!!!!!!");
// Mis variables
//Siempre deben comenzar con una Letra o -_ y son sensibles a las mayusculas y minusculas
var miNombre = "Héctor";
var edad = 35;
console.log(miNombre);
console.log(edad);
// Reasignamos el valor de mi variable edad
edad = 25;
consol... | true |
e17d5631e7b75d1a7b2224ea9a25c37a24a806f5 | JavaScript | nathandb1/CSCI-492-493 | /Blocks1.js | UTF-8 | 12,159 | 2.96875 | 3 | [] | no_license | //Block Definition
Blockly.Blocks['slidesquare'] = {
init: function() {
this.appendDummyInput()
.appendField("Slide")
.appendField(new Blockly.FieldDropdown([["Left","L"], ["Right","R"], ["Up","U"], ["Down","D"]]), "Slide")
.appendField("one space");
this.setInputsInline(false);
this.setPrevious... | true |
00f329b935089e7a3ecd28ed21283304bd88c5d3 | JavaScript | YuliaLevchenko/goit-fe-course-prev | /js/module-02/scripts/index.js | UTF-8 | 2,479 | 4.1875 | 4 | [
"MIT"
] | permissive | 'use strict';
/*Напишите со следующим функционалом:
При загрузке страницы пользователю предлагается ввести через prompt число. Это число добавляется в массив чисел numbers.
Операция ввода числа пользователем и сохранение в массив продолжается до тех пор, пока пользователь не нажмет Cancel в prompt. Испол... | true |
68aa033d685ac35598f0bf208a111fbc1288eddf | JavaScript | pradeep00786/slider | /custom.js | UTF-8 | 1,510 | 2.609375 | 3 | [] | no_license | $(document).ready(function(e) {
var len = $('.belt h5').length,
belt = $('.belt'),
prev = $('.shprevarrow'),
next = $('.shnextarrow'),
leftPrev = '+=960',
leftNext = '-=960',
leftWidth = '-=960',
rightWidth = '+=960',
slide_list = new Array();
slide_list[2] = "<h2>Heading1</h2><p>this is ... | true |
f8d5c3fddb6dac15685bb6135c2aadf183fb1453 | JavaScript | larkiningram/unit-4-game | /assets/javascript/game.js | UTF-8 | 1,812 | 3.421875 | 3 | [] | no_license |
var wins = 0;
var losses = 0;
var score = 0;
var target = Math.floor(Math.random() * 101 + 19);;
var red = Math.floor(Math.random() * 11 + 1);
var blue = Math.floor(Math.random() * 11 + 1);
var yellow = Math.floor(Math.random() * 11 + 1);
var green = Math.floor(Math.random() * 11 + 1);
function restart() {
score ... | true |
734174fb3a490097c4a5ab96651cb03dabebe76c | JavaScript | guidoeckelt/Homepage | /Games/BattleArena/KeyContext/Key.js | UTF-8 | 704 | 2.640625 | 3 | [] | no_license | var Key = (function () {
// private static var
var ctor = function () {
var self = this; // prevents overlaping this-context
// private var
// public instance only
// Getters & Setters
};
// public static
ctor.w = "w";
ctor.A = "a";
ctor.S ... | true |
2fd8d3ca114dcf8d3b5063b8475ab57ffa77ffe7 | JavaScript | tonngw/leetcode | /javascript/1071-greatest-common-divisor-of-strings.js | UTF-8 | 559 | 3.625 | 4 | [
"MIT"
] | permissive | /**
* @param {string} str1
* @param {string} str2
* @return {string}
*/
var gcdOfStrings = function (str1, str2) {
let [len1, len2] = [str1.length, str2.length];
function isDivisor(l) {
if (len1 % l || len2 % l) {
return false;
}
let [f1, f2] = [Math.floor(len1 / l), Math.floor(len2 / l)];
... | true |
176da4edcd4f73eea210549b39bccf9e9bff887f | JavaScript | matthew-howe/algorithms | /codewars/6-kyu/give-diamond.js | UTF-8 | 2,498 | 4.75 | 5 | [
"MIT"
] | permissive | // This kata is to practice simple string output. Jamie is a programmer, and James' girlfriend. She likes diamonds, and wants a diamond string from James. Since James doesn't know how to make this happen, he needs your help.
// ###Task:
// You need to return a string that displays a diamond shape on the screen using ... | true |
c730e00b10666ce1fd682e3166032a6a05578b86 | JavaScript | liruidong1/algorithm011-class01 | /Week_08/homework/sort.back.js | UTF-8 | 604 | 3.90625 | 4 | [] | no_license | /**
* 插入排序的思路是默认第一个元素为已排序区间,然后取未排序区间的第一个元素 插入到已排序区间的特定位置
* @param arr {number[]}
* @return {number[]}
*/
function insertSort(arr) {
let len = arr.length;
for(let i = 1; i < len; i++) {
let val = arr[i];
let j = i - 1;
for(; j >= 0; j--) {
if(arr[j] > val) {
... | true |