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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
d8abdafa089440a181eccaf2934a620f4dbff607 | JavaScript | J0N-C/m1-0621-code-solutions | /javascript-typing-tutor/main.js | UTF-8 | 1,272 | 3.0625 | 3 | [] | no_license | var $textNodes = document.querySelectorAll('span');
var $resetButton = document.getElementById('reset');
var textIndex = 0;
var incorectKeys = 0;
var keyAccuracy;
$textNodes[0].className = 'under';
document.addEventListener('keydown', keyCheck);
$resetButton.addEventListener('click', resetAll);
function keyCheck(event... | true |
f61962f5744bc5e8f846ac77e7b43cf0f733b533 | JavaScript | Glaplant/CIT230 | /assignments/lesson-10/scripts/weathersummary.js | UTF-8 | 1,151 | 3.265625 | 3 | [] | no_license |
let weatherRequest = new XMLHttpRequest();
let apiURLstring = 'https://api.openweathermap.org/data/2.5/weather?id=5604473&units=imperial&APPID=9fc9de3e82518889680cc852f9a5b5d9';
weatherRequest.open('GET' , apiURLstring, true);
weatherRequest.send();
weatherRequest.onload = function() {
let weatherData = ... | true |
d48e48eb39793212e7101f9a332a513498ebd3b2 | JavaScript | btcrit/blockfarm | /public/explorer.js | UTF-8 | 6,716 | 2.78125 | 3 | [] | no_license | console.log("Hello! Explorer.js Loaded");
// Data Structure
// Blocks [{prev, content, confirmed, ROW}]
let blocks = [];
// Rows [rowreference,]
let rows = [];
let attempt_blink_duration = 50; // milliseconds; 1000=1s
let most_recent_duration = 1000;
window.onload = function(){
rows.push(document.getElementBy... | true |
5b4b3de90ed1cd8a7f1b282720edf3a62296adf2 | JavaScript | Zylophone/cracking | /deleteNodeinBST.js | UTF-8 | 1,405 | 3.734375 | 4 | [] | no_license | /**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @param {number} key
* @return {TreeNode}
*/
function getMin(node) {
while (node.left !== null) {
node = node.left;
}
return node;
}
... | true |
43265bdaec9b4df9ddbae87da44254803a9ef4e2 | JavaScript | RobertLbebber/NukeReactor | /frontend/src/util/func/jsonUtil.jsx | UTF-8 | 1,805 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | import _ from "lodash";
export const findKey = (rec, key) => {
if (_.isNil(rec)) return;
else if (rec[key]) return rec;
else if (rec instanceof Object) {
for (let i = 0; i < Object.keys(rec).length; i++) {
let wasFound = findKey(rec[Object.keys(rec)[i]], key);
if (wasFound !== undefined) {
... | true |
eee0624c6559f6d27c628bc611a080e835d4ed70 | JavaScript | yuan00611/Data-Structure-and-Algorithm-Practice | /LeetCode/Hash_Table/0739Daily_Temperatures.js | UTF-8 | 978 | 4.46875 | 4 | [] | no_license | //Given a list of daily temperatures T, return a list such that,
//for each day in the input, tells you how many days you would have to wait
//until a warmer temperature.
//If there is no future day for which this is possible, put 0 instead.
//For example, given the list of temperatures T = [73, 74, 75, 71, 69, 72,... | true |
07971edc37e6b25b8a444b7f850d3db4e500249b | JavaScript | MithunPrabhu777/Coding_Interview_Questions | /string problems/anagram.js | UTF-8 | 817 | 4.09375 | 4 | [] | no_license | function anagram(string1,string2){
var split1 = string1.split('')
var sorted1 = split1.sort()
var sortedstring1 = sorted1.join('');
var split2 = string2.split('')
var sorted2 = split2.sort();
var sortedstring2 = sorted2.join('');
var sorted1 = {};
var sorted2 = {};
for(var characte... | true |
4a10afb59f0b7374c0f3a4df7311692360e4f5a6 | JavaScript | TLDxilon/navigation | /js/navFixed.js | UTF-8 | 1,187 | 2.640625 | 3 | [] | no_license | /*
Menú fixed que aparece por encima
*/
$(document).ready(function($){
var lastScrollPosition = 0;
var widthLogo = $('.js-width-logo').outerWidth(true);
var $navBarFixed = $('.navbar-fixed');
var $logo = $('.logo-floating');
$logo.css('width', (widthLogo) + 'px');
... | true |
6cf67dd2445e02bd572f614a66af65bae12a5e63 | JavaScript | dxshim90/jest | /functions.js | UTF-8 | 832 | 3.171875 | 3 | [] | no_license | const axios = require("axios");
const functions = {
add: (num1, num2) => num1 + num2,
isNull: () => null,
checkValue: x => x,
createUser: () => {
const user = {
firstName: "Danny"
};
user["lastName"] = "Shimield";
return user;
},
fetchUser: () =>
axios
.get("https://jsonplac... | true |
74a07e8ecc4d87fec204581cb1a27ad34fdc475a | JavaScript | duyoji/TODO_APP_WITH_EXPRESS_AND_MYSQL | /client/tests/unit/store/getters.spec.js | UTF-8 | 797 | 2.5625 | 3 | [] | no_license | import getters from "@/store/getters";
import moment from "moment";
const state = {
todos: [
{
id: 1,
title: "getters title",
body: "getters body",
completed: false,
createdAt: moment().format("YYYY年 MM月 Do(ddd), kk時mm分 "),
updatedAt: moment().format("YYYY年 MM月 Do(ddd), kk時mm分... | true |
1d18a60dc50efb3ee6dfc5991255ab2b9dfb6591 | JavaScript | BenRamsden/football-stadium-crime-stats | /server/src/net/football-data.js | UTF-8 | 678 | 2.6875 | 3 | [] | no_license | /**
* Network util to call football-data api
* Docs: https://www.football-data.org/documentation/quickstart
*/
import axios from 'axios'
export async function getTeams() {
const footballDataApiKey = process.env.footballDataApiKey
const response = await axios({
method: 'GET',
headers: { 'X-... | true |
0ee544f0beddd93f772c6ce41aca2ac323f139a3 | JavaScript | Titania01/30-days-of-javascript | /21-Day/main.js | UTF-8 | 1,225 | 3.90625 | 4 | [] | no_license | // Exercises: Level 1
const paragraph = document.querySelector("p");
console.log(paragraph);
const pQuery = document.querySelector("#first-para");
console.log(pQuery);
const nodeList = document.querySelectorAll("p");
console.log(nodeList);
nodeList.forEach((nodeList) => {
console.log(nodeList.textContent);
});
c... | true |
2eec69029cc1d016d9d8add8e85055b1931aeaa1 | JavaScript | reza-hussain/JavaScript-Projects | /04-Write_The_Notes_App/script.js | UTF-8 | 3,058 | 3.59375 | 4 | [] | no_license | //Function for Color on Modal
let modalIcons = document.getElementById("modalIcons");
let modalColors = document.getElementById("modal-color-picker");
document.getElementById("select-color").addEventListener("click", function () {
modalColors.style.display = "flex";
modalIcons.style.display = "none";
setTimeout(... | true |
5f05471a7b3c96694e3396c9f79ab16161f0307d | JavaScript | AlfonzAlfonz/random | /tests/number.test.js | UTF-8 | 473 | 2.671875 | 3 | [
"MIT"
] | permissive | const { randomInt, randomFloat } = require("../lib");
const mockMath = Object.create(global.Math);
mockMath.random = () => 0.5125;
global.Math = mockMath;
test("test randomInt", () => {
expect(randomInt(0, 10)).toBe(5);
expect(randomInt(0, 20)).toBe(10);
});
test("test randomFloat", () => {
expect(randomFloat(... | true |
06d72f5d39109885f2ea2da926f6f8bda9af8be7 | JavaScript | DanielLShaw/portfolio | /components/AdventOfCode/2020/Day8/index.js | UTF-8 | 915 | 2.796875 | 3 | [] | no_license | import React, { useState } from "react";
import instructionsRaw from "./input.txt";
import { part1, part2 } from "./solution";
export const Day8Part1 = () => {
const [answer, setAnswer] = useState(false);
return (
<>
<p>
Run the instructions until just before an infinite loop happens, then
... | true |
331d3272bb376c9252286fb6dd3d4f9d0eb90874 | JavaScript | curtiscovington/curtiscovington.github.io | /entity.js | UTF-8 | 2,192 | 3.109375 | 3 | [] | no_license | Entity = (function () {
var count = 0;
return class Entity {
constructor(pos, s) {
this.pos = pos;
this.sprite = s;
//this.sprite = s;
this.id = count++;
}
update(dt) {
this.sprite.update(dt);
}
render(ctx) {
this.sprite.render(ctx, this.pos);
}
}
})();
class Tree extends Entity {
... | true |
48549cc029e4ac184336a87428056b752c9a9b2f | JavaScript | kevintage83/freeCodeCampBasicAlgorithms | /slasherFlick.js | UTF-8 | 291 | 4.25 | 4 | [] | no_license | //create an array, "slasher," that takes two arguments, "arr" and "howMany," as parameters.
function slasher(arr, howMany) {
arr.splice(0, howMany);
//Takes your array, and calls splice(0 is the starting index point. howMany is the number to cut)
return arr;
}
slasher([1, 2, 3], 2);
| true |
37f78059cd816d2e7e81fe0beefa3f340b206d56 | JavaScript | bernadeteaquino/mobile-flashcards | /actions/Decks.js | UTF-8 | 1,046 | 2.53125 | 3 | [] | no_license | import { GET_DECKS, ADD_DECK, ADD_CARD } from '../utils/Constants'
import { fetchDecks, addDeck, createCardOnDeck } from '../utils/API'
export default function getDecks(decks) {
return {
type: GET_DECKS,
decks: decks
}
}
export function handleGetDecks() {
return (dispatch) => {
return fetc... | true |
16f26d99d7371b24d16e1fe853d18a4e5997900d | JavaScript | krayt0n3/Liri | /liri.js | UTF-8 | 3,485 | 2.796875 | 3 | [] | no_license | require("dotenv").config();
var keys = require("./keys.js");
var Spotify = require('node-spotify-api');
var spotify = new Spotify(keys.spotify);
var inquirer = require("inquirer");
var axios = require("axios");
var moment = require("moment");
var omdbApi = require('omdb-client');
var fs = require("fs");
inquirer
.pr... | true |
8bef71f606ffafc501d774402cf74c7d65e056e8 | JavaScript | EduardOstapchuk/JS- | /script2.js | UTF-8 | 1,691 | 4.03125 | 4 | [] | no_license | // work-home 4
// let UserNumber = confirm ('Сыграем?')
// console.log(UserNumber, "type: ", typeof(UserNumber))
// if (UserNumber) {
// let num = +prompt('Введите число')
// console.log('Inputed number: ', num, "type:", typeof num )
// if (isNaN(num)) {
// alert('Вы ввели буквы')
// } else {
/... | true |
b7a2d88c778162588fac9be1646fbbff70bd9847 | JavaScript | motch0214/shelfy | /app/utils/ShelfyFile.js | UTF-8 | 893 | 2.75 | 3 | [
"MIT"
] | permissive | import path from 'path'
import jetpack from 'fs-jetpack'
export default class {
constructor(filepath, name) {
this.filepath = filepath;
this.name = name;
}
isDirectory() {
return jetpack.exists(this.filepath) === 'dir';
}
isImage() {
const ext = path.extname(this.filepath);
if (ext ===... | true |
70419f535bdf35e367e632cde4d219f288ff8347 | JavaScript | dowookims/problem_solving | /this_is_coding_test/chp5/5_1_ice_juice.js | UTF-8 | 877 | 3.578125 | 4 | [] | no_license | const N = 4;
const M = 5;
const arr = [
[0, 0, 1, 1, 0],
[0, 0, 0, 1, 1],
[1, 1, 1, 1, 1],
[0, 0, 0, 0, 0]
];
const visited = Array.from(Array(N), () => Array(M).fill(false));
const isIn = (row, col) => {
return N > row && row >= 0 && M > col && col >= 0;
}
function dfs(row, col) {
const dx = ... | true |
cee81a045f55085aa8eedd6d5b41eb0aacd07665 | JavaScript | paoim/RiiPhraseParserOO | /js/controller/AppPhraseParserCvsController.js | UTF-8 | 1,831 | 2.578125 | 3 | [] | no_license |
appPhraseParser.controller('ContentController',['$scope','$rootScope','uploadService', function($scope, $rootScope, uploadService) {
$scope.csvFile;
$scope.csvItems = [];
$scope.$watch('csvFile', function(newValue, oldValue) {
// Only act when our property has changed.
if (newValue != oldValue) {
//consol... | true |
9ff815767790b807e42c1bc60edb2c2ccf40561e | JavaScript | ahadimuhsin/pendataan | /assets/js/index.js | UTF-8 | 1,472 | 2.828125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /* Simple VanillaJS to toggle class */
var a = document.getElementById('kasir');
var b = document.getElementById('gudang');
var c = document.getElementById('text');
var d = document.getElementById('title');
var e = document.getElementById('logo');
document.getElementById('gudang').addEventListener('click', function (... | true |
599837b5b39c3297c7f82889a8d46b187a122b83 | JavaScript | MariaZahatra/userPage-API-Project-Student | /main.js | UTF-8 | 1,344 | 3.125 | 3 | [] | no_license | const apiManager = new APIManager();
let loadUsersCounter = 0
let wasAPICalled = false
$("#loadData").on("click", function () {
wasAPICalled = true
apiManager.geenrateRandomPeople();
apiManager.generateQuote();
apiManager.generatePokemon();
apiManager.generateText();
});
$("#displayData").on("click", fun... | true |
1ebbbdd055f09c4ea69d05c84111ce57d35cf9ee | JavaScript | valeriozarba/carrello-js | /src/main.js | UTF-8 | 3,633 | 2.734375 | 3 | [] | no_license | import './css/base.css'
var map = require('lodash/map');
import template from './template/lista.hbs';
import './js/utils.js';
let appContainer=document.getElementById("appcontent");
let mockElementi=[
{id:1,nome:"Titolo 1",qnt:1,descrizione:"---",immagine:"https://picsum.photos/200?random=1",prezzo:12.11},
{... | true |
dde07a4f4dc88a59fcb6b51139a2afead5987978 | JavaScript | jcrotzerrn/Jquery-drills | /dom.js | UTF-8 | 1,861 | 2.5625 | 3 | [] | no_license | $(document).ready(function () {
$('<div><ul class="mylist"></ul></div>').appendTo("body");
let submitBtn = $('#btnSubmit');
let $txt = $('#txtInput').val();
$(submitBtn).attr('disabled', true);
$('#txtInput').keyup(function () {
if ($('#txtInput').val().length != 0)
... | true |
4706969ebc13c9c7a8e56eef2d15707f18855b11 | JavaScript | ranweijie/guanghuan-02 | /js/customer-charge.js | UTF-8 | 3,608 | 2.671875 | 3 | [
"MIT"
] | permissive |
function checkChargeData(){
var tipsUL = $("#charge_tips_ul")
var needInvoice = $("input:radio:checked").val()
console.log("发票",needInvoice)
var amountRes = true
var invoiceRes = true
var charge_amount = Number($.trim($("#charge_amount").val()));
if (!isNumber(charge_amount)){
... | true |
10f949b014ba08919ee7ccf1fe25e485320637b7 | JavaScript | rt-brown/List_Pagination_Filtering | /js/script.js | UTF-8 | 2,338 | 3.578125 | 4 | [] | no_license | //global variables
const studentList = document.querySelector(".student-list");
const studentRecords = studentList.children;
const itemsPerpage = 10;
/* showPage function defines the first and last index position of studentRecords for each page.
Then we implement an if statement to check if the index position of stude... | true |
d2149bcab322b7c9d117be2d0512dd588afc161a | JavaScript | Deepongpat/ReactNativeX | /src/core/common/redux/loading.js | UTF-8 | 421 | 2.71875 | 3 | [] | no_license | const initialState = {
isLoading: false
}
export default (state = initialState, action) => {
switch (action.type) {
case 'OPEN_LOADING':
console.log("Open Loading");
return {
isLoading: true
};
case 'CLOSE_LOADING':
console.log("Close Loading");
... | true |
1b92dad3e4cf146eb66014523c967d09d1fd5b4a | JavaScript | iamsims/Image-Carousel--Vanilla-JS | /js/slider.js | UTF-8 | 1,359 | 3.0625 | 3 | [] | no_license | var carousel= document.querySelector(".carousel-container");
var forward= document.createElement("button");
forward.className= "carousel-button right"
forward.textContent=">";
carousel.appendChild(forward);
var backward= document.createElement("button");
backward.className= "carousel-button left"
backward.textContent... | true |
97e6444dec194dfbf7ca6509211a352619de7965 | JavaScript | husney/Curso-JavaScript | /Curso JS Moderno/09-Funciones/js/11-app.js | UTF-8 | 315 | 3.96875 | 4 | [] | no_license | const aprendiendo = function(tema){
console.log('Aprendiendo ' + tema);
}
function sumar(n1, n2){
console.log(n1 + n2);
}
const multiplicar = (n1,n2) => n1 * n2;
const aprendiendo2 = (tecnologia1, tecnologia2) => `Aprendiendo ${tecnologia1}, ${tecnologia2}`;
console.log(aprendiendo2('js', 'node.js')); | true |
83655bbcede75b339b9a8aa83d5a05738f2fdc33 | JavaScript | TommyTeaVee/pet-book | /pet-book-client/src/App.js | UTF-8 | 4,539 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import Auth from './auth'
import Nav from './nav'
import './App.css';
import DashBoard from './dashboard/board';
import Profile from './profile/profile';
class App extends Component {
state = {
username: "",
password: "",
first_name: "",
last_name: "",
... | true |
708514dfe760ebe16ceca2e0c604e781830116e8 | JavaScript | billykeyss/Casty | /picast.js | UTF-8 | 9,309 | 2.53125 | 3 | [] | no_license | const exec = require('child_process').exec;
const express = require('express');
const request = require('request');
const path = require('path');
const app = express();
const AWS = require('aws-sdk');
const bodyParser = require('body-parser');
const parseTorrent = require('parse-torrent');
app.use(bodyParser.json()); ... | true |
b5a982d072b23bbf1818f62eddde0795ce1af601 | JavaScript | nizp/2017-2-20 | /2017-6-14/reactES6/src/app3.js | UTF-8 | 906 | 2.953125 | 3 | [] | no_license | import React, { Component } from 'react';
class H1 extends Component {
constructor(){
super();
//初始化状态:控制器
this.state = {
num:1,
arr:[1]
}
//如果在初始化的时候不bind事件函数,那么默认事件函数的this为null(官方规定)
this.click = this.click.bind(this);//apply
}
render(){
const {arr} = this.state;
... | true |
88a84ba758a8b77a91ab389cd2a0598ef772fba2 | JavaScript | Alex-Shilman/fullproof | /src/recorderWindow/index.js | UTF-8 | 1,480 | 2.78125 | 3 | [] | no_license | let localStream;
let recorder;
let recordChunk;
const fs = require('fs');
navigator.mediaDevices.getUserMedia({
video: true
}).then(stream => {
localStream = stream;
preview.srcObject = stream;
});
function startRecording () {
console.log('start recording');
recorder = new MediaRecorder(localStream);
reco... | true |
2c495b9117c2d8d1b898ac36c536cc4f17193421 | JavaScript | gmramella/CatViz | /state.js | UTF-8 | 52,625 | 3.203125 | 3 | [] | no_license | /*
doneActions/undoneActions: string in {
"changeType",
"createEndomorphism", "createMorphism", "createMorphismFrom", "createMorphismTo", "createObject",
"cutSelected",
"deleteEndomorphism", "deleteMorphism", "deleteObject", "deleteSelected",
"dragEndomorphism", "dragSelected",
"pasteSelected",
"u... | true |
b4d681d237472891b6e3044d0d0124b4976706a9 | JavaScript | timothy-spencer/site-scanner-ui | /src/components/scans.js | UTF-8 | 1,475 | 2.75 | 3 | [
"MIT"
] | permissive | import React from 'react';
// ========================================
class Scans extends React.Component {
constructor(props) {
super(props);
this.state = {
scantypes: [],
selected_scantype: '',
};
}
// ========================================
componentDidMount() {
fetch(`https:/... | true |
4c51848f69e508e5efc558853108233c2daad430 | JavaScript | odorizziAlex/PostingBoard | /app/resources/js/views/FilterView.js | UTF-8 | 7,796 | 2.609375 | 3 | [] | no_license | /* eslint-env browser */
import { Event } from "../utils/Observable.js";
import Config from "../utils/Config.js";
import View from "./View.js";
import DateChecker from "../utils/DateChecker.js";
let calendar;
function initFilterView(wrapper) {
wrapper.buttons = {
categoryButton: wrapper.el.querySelector(".categ... | true |
7563c7075ace89baae8f79d53161d39bc170c60f | JavaScript | domapic/domapic-controller | /test/functional/specs/ability-action-api.specs.js | UTF-8 | 7,937 | 2.5625 | 3 | [
"MIT"
] | permissive |
const test = require('narval')
const utils = require('./utils')
test.describe('ability action api', function () {
this.timeout(10000)
let authenticator = utils.Authenticator()
let abilityId
let abilityNumericId
let abilityNoDataId
let serviceId
const addService = function (serviceData) {
return ut... | true |
bc928ca849489aefc8506a27712ab0c315ed0749 | JavaScript | stephenwike/GameCentralServer | /app/views/gameviews/catan/js/CatanCommunications.js | UTF-8 | 748 | 2.71875 | 3 | [] | no_license | var socket = io.connect();
socket.on('connect', function(data) { ConnectionEntry(data); });
socket.on('initgamedata', function(data) { InitializeGame(data); })
socket.on('updategamedataresult', function(data) { UpdateGameData(data); });
socket.on('updateturnresult', function(data) {UpdatePlayerRoster(data); });
socket.... | true |
cdb708da4ebe206c12897205398212e75ac64a4e | JavaScript | pilunte23/bothp9898 | /events/messageReactionRemove.js | UTF-8 | 2,105 | 2.671875 | 3 | [] | no_license | module.exports = (messageReaction, user) => {
/*
const message = messageReaction.message;
const member = message.guild.members.get(user.id)
const channel = message.guild.channels.find(c => c.name === "test-bot")
const roletTruand = message.guild.roles.fetch("443785307503067136");
const roleMysti... | true |
95980e41ba452ec9a2a56371b4da5637034cf2e1 | JavaScript | xujihui1985/nodeplayground | /stream/writeablestream.js | UTF-8 | 353 | 2.5625 | 3 | [] | no_license | var Writable = require('stream').Writable;
function MyWritable() {
Writable.call(this);
}
MyWritable.prototype = Object.create(Writable.prototype, {
constructor: MyWritable
});
MyWritable.prototype._write = function(chunk, encoding, callback) {
process.stdout.write(callback.toString());
callback();
};
proce... | true |
12b8988a8cd381416d6d44069da03a568d9f9512 | JavaScript | AllanKerr/core | /components/inputs/test/input-time.test.js | UTF-8 | 6,459 | 2.71875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | import '../input-time.js';
import { aTimeout, expect, fixture, oneEvent } from '@open-wc/testing';
import { runConstructor } from '../../../tools/constructor-test-helper.js';
const basicFixture = '<d2l-input-time label="label text"></d2l-input-time>';
const fixtureWithValue = '<d2l-input-time value="11:22:33"></d2l-in... | true |
0256d4c414287b254854e7dbc80400b3bee81672 | JavaScript | alexanderywang/chat-app-base | /server/db/models/room.js | UTF-8 | 1,725 | 2.640625 | 3 | [] | no_license | const mongoose = require("mongoose");
const Message = require("./message");
const User = require('./user')
const messageSchema = require('./message').messageSchema
const MeetingItem = require('./meetingItem')
const meetingItemSchema = require('./meetingItem').meetingItemSchema
const roomSchema = mongoose.Schema({
r... | true |
e36f3d2d98cb9501f9fb87b2114761546ecabbbb | JavaScript | lj1111111/studio | /src/components/industry/trackplus/js/with.js | UTF-8 | 7,041 | 2.6875 | 3 | [] | no_license | import moment from 'moment';
export function format(time) {
var y = time.getFullYear();
var m = time.getMonth() + 1;
var d = time.getDate();
var h = time.getHours();
var mm = time.getMinutes();
var s = time.getSeconds();
var ms = time.getMilliseconds();
return y + '-' + add0(m) + '-' + add0(d) + ' ' + add0(h) +... | true |
feace1809a76428e1744307f57848ad58d03bd9e | JavaScript | dillon-1999/project-randomizer-thing | /Controllers/ProjectController.js | UTF-8 | 3,035 | 2.515625 | 3 | [] | no_license | "use strict";
const express = require("express");
const projectsRouter = express.Router();
const { projectModel } = require("../Models/ProjectModel");
const {schemas, VALIDATION_OPTIONS} = require("../validators/allValidators");
projectsRouter.post("/create", (req, res) =>{
console.log("POST /create")
if(req... | true |
6e2c17053300f206919d45e24eae9a542de16e9e | JavaScript | hanyuningxing/query | /WebContent/scripts/index/login.js | UTF-8 | 708 | 2.53125 | 3 | [] | no_license | $(document).ready(function (){
$('#username').focus();
formValidate();
$('#loginImg').bind('click',submit);
});
function submit(){
if($('#loginForm').valid()){
var url = "/user/login";
var formObj = $("#loginForm");
formObj.attr("action",url);
formObj.submit();
}
}
function formValidate(){
... | true |
3a030b3e7856bae83b83e7371d34a0d077a49116 | JavaScript | sagarbasavaraj/people-management | /src/service/storage-service.js | UTF-8 | 1,194 | 2.6875 | 3 | [] | no_license | import localForage from "localforage";
import StorageError from "./storage-error";
//StorageService
//Used to read and write data to IndexDb.
//Uses localForage which handles read write operations async.
//By default localForage uses IndexDb fallbacks to local storage if it is not available.
class StorageService {
s... | true |
8a60c0e687eb1e59c532378567e2ecce19131aea | JavaScript | moot16ab/DOEKSocialClient | /js/regStudent.js | UTF-8 | 2,114 | 2.671875 | 3 | [] | no_license | /* Denne klasse understøtter regStudent.html og sørger for, at en gæst kan
* oprette en ny bruger.
* Den er udviklet med hjælp fra Jesper Bruun Hansen og Morten Dalgaard Laursen
*/
$(document).ready(() => {
SDK.Student.loadNav();
$("#regButton").click(() => {
const studentfirstName = $("#regFirst... | true |
cf359684085021f3e153badf6ccb3ffa9ee23bcd | JavaScript | huamchen/GameEngineRotatePhysics | /HTMLPhysicsEngine_6_26/public_html/Circle.js | UTF-8 | 1,921 | 2.984375 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
var Circle = function(center, radius, mass, friction,restitution) {
this.mType=1;//0---Rectangle;1---circle
... | true |
c41b93ee44568a586744e222c33e67f2e5dc921d | JavaScript | walex111/Initial-Pre-Work | /5-Introduction-to-JavaScript/18-Compound-Assignment-With-Augmented-Subtraction.js | UTF-8 | 107 | 3.09375 | 3 | [] | no_license | // I learned about the minus equals operator.
var a = 11;
var b = 9;
var c = 3;
a -= 6;
b -= 15;
c -= 1;
| true |
6584bd0e4bb81b43b36b13f1fb837e37b1d4fc61 | JavaScript | Acorn221/Cards-Against-Humanity | /game.js | UTF-8 | 27,976 | 2.765625 | 3 | [] | no_license | const Deck = require('./deck.js');
var _ = require('underscore');
var striptags = require('striptags');
/*
TODO:
allow users websockets to disconnect and reconnect and be put into the same game with the cookie for the ID
*/
module.exports = class Game {
constructor(host, container, name, password){
... | true |
32262bd9a587a99564426f1933ec9275cf2cbf4c | JavaScript | LiuL0703/algorithm | /剑指offer/JavaScript/#11 二进制中1的个数.js | UTF-8 | 1,485 | 4.375 | 4 | [] | no_license | /**
* 输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。
*/
// function NumberOf1(n){
// let str = '';
// if( n > 0 ){
// str = n.toString(2);
// } else{
// n = -n;
// n = n-1;
// str = n.toString(2);
// str = exchangeNegativeNum(str);
// }
// return cal(str);
// }
// function exchan... | true |
0ebef752af46baabc2e227fbee441456e0b1b051 | JavaScript | ZodiacSyndicate/leet-code-solutions | /medium/211.添加与搜索单词-数据结构设计.js | UTF-8 | 2,033 | 4.125 | 4 | [] | no_license | /*
* @lc app=leetcode.cn id=211 lang=javascript
*
* [211] 添加与搜索单词 - 数据结构设计
*
* https://leetcode-cn.com/problems/add-and-search-word-data-structure-design/description/
*
* algorithms
* Medium (38.67%)
* Likes: 54
* Dislikes: 0
* Total Accepted: 3K
* Total Submissions: 7.8K
* Testcase Example: '["Word... | true |
ba3840172394f35cd9999e386cf7c657a0427625 | JavaScript | matheussnk/curso-dev | /fundamentos-js/tpl_strings.js | UTF-8 | 465 | 3.9375 | 4 | [] | no_license | // Template string aplicado no ECMA 6
const nome = 'Matheus'
const concatenacao = 'Olá ' + nome + ' !'
const template =
`
Olá ${nome} !`// O template aceita a formatação através de ENTER e tabulação e era afetar em sua exibição.
console.log(concatenacao,template)
// expressões
console.log(`1 +1 = ${1 + 1}`)
... | true |
56190f380b059f0670cccea9d15d28dcf87071b5 | JavaScript | ezequielsalas/ecommerceapp | /src/components/Article.js | UTF-8 | 1,124 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react';
import '../App.css';
import { connect } from "react-redux";
import {selectArticle} from "../actions/index";
const mapDispatchToProps = dispatch => {
return {
selectArticle: article => dispatch(selectArticle(article))
};
};
const mapStateToProps = state => {
return {... | true |
dae1f94d905803a0718b6595e94f9d3c56fae392 | JavaScript | Takumon/jira-pullrequest-getter | /src/file-util.js | UTF-8 | 887 | 2.9375 | 3 | [] | no_license | //ファイル操作モジュールの追加
const fs = require('fs');
const mkdirp = require('mkdirp');
const path = require('path');
const getDirName = path.dirname;
const read = path => {
return new Promise((resolve, reject) => {
fs.readFile(path, 'utf8', (err, data) => {
if (err) {
reject(err);
} else {
... | true |
e1c6831704d886baf14e93e416107ddfdcd3cb0e | JavaScript | swallowlyan/personalProjects | /newTest/day3/todo.js | UTF-8 | 2,556 | 3.046875 | 3 | [] | no_license | let vm=new Vue({
el:"#app",
directives:{
focusAa(el,bindings){
if(bindings.value){
//当current==item时让内部输入框获取焦点
el.focus();//获取焦点
}
}
},
data:{
todos:[
{isSelected:false,title:'睡觉'},
{isSelected:false,... | true |
188347b736a3c4175b4dc4c92ff22308d5411966 | JavaScript | ciss1995/Graphics | /GraphicsTownP10/skybox.js | UTF-8 | 14,833 | 2.6875 | 3 | [
"BSD-2-Clause"
] | permissive | /**
* Created by Yusef.
*/
/**
A Very Simple Textured Plane using native WebGL.
Notice that it is possible to only use twgl for math.
Also, due to security restrictions the image was encoded as a Base64 string.
It is very simple to use somthing like this (http://dataurl.net/#dataurlmaker) to create one
the... | true |
1ff83a415d0efa38c76bcc35e45b37c8c75230ac | JavaScript | zesheng/Platypus | /src/components/EntityContainer.js | UTF-8 | 17,792 | 3.15625 | 3 | [] | no_license | /**
# COMPONENT **EntityContainer**
This component allows the entity to contain child entities. It will add several methods to the entity to manage adding and removing entities.
## Dependencies
- **[[Messenger]] - Entity uses `Messenger` in its prototypal chain to enable event handling.
## Messages
### Listens for:
... | true |
058129187a54d6b3ffae6ebc4e7a106235ed1295 | JavaScript | pasajero0/notes_back | /routes/notes.js | UTF-8 | 2,520 | 2.78125 | 3 | [] | no_license | const ObjectId = require('mongodb').ObjectId;
const moment = require('moment');
module.exports = (app, db) => {
app.route('/notes') // <<<<<<<<<<<<<<<<<<<<<<<<< new route
//// add new note
.post( async (req, res) => {
const note = {
title: req.body.title,
content: req.body.body,
type: 'note',
d... | true |
2142d7b2f2a20f934a501e13c7cd967990ecc965 | JavaScript | phanxuantruong-dot/nodejs-weather | /public/js/app.js | UTF-8 | 779 | 3.296875 | 3 | [] | no_license | // const res = fetchData();
const input = document.querySelector(`.input`);
const btn = document.querySelector(`.btn`);
const form = document.querySelector(`form`);
const respone = document.querySelector(`.response`);
form.addEventListener(`submit`, e => {
e.preventDefault();
const location = input.value.split(` `... | true |
cb3a251fbd5e62360c5c0877a57511aa128d590c | JavaScript | nicksellen/audioplayer | /assets/build/ws.js | UTF-8 | 3,279 | 2.765625 | 3 | [] | no_license | /** @jsx React.DOM */
function WebsocketBridge() {
this.callbacks = {};
var protocol = location.protocol.replace('http', 'ws');
var url = protocol + '//' + location.host + '/ws';
this.socket = new WebSocket(url);
this.businfos = {};
this.runOnConnect = [];
this.socket.addEventListener('open', functi... | true |
96b8c1521a76072380f95e46296383a0bbc86f45 | JavaScript | igordotsenko/bookshop | /src/main/resources/static/js/details.js | UTF-8 | 6,769 | 2.9375 | 3 | [] | no_license | function openDetails(e) {
e.preventDefault();
const bookId = e.target.dataset.bookid;
const form = getForm();
fetch(`/book/${bookId}`, { method : "get" }).
then((fetchResponse) => {
handleResponse(fetchResponse, () => {
fetchResponse.text().then(responseText => {
const response = JS... | true |
05a488382d066a80e9e6a8ab81880a08f9b63e88 | JavaScript | Stranded-Helix/JavascriptQuiz | /assets/script.js | UTF-8 | 4,367 | 3.953125 | 4 | [] | no_license | var questionsAsked = 0;
var questionsCorrect = 0;
var clock = 90;
var timer;
var timerCount = document.getElementById("timer-count");
var viewportDiv = document.querySelector(".viewport");
var startBtn = document.getElementById("start");
//array of questions, answers, and correct answer
var questions = [
... | true |
f1275e581db24cd0917edfedd97f84584a2e5921 | JavaScript | navneet27/MusicPerception | /static/js/permutation.js | UTF-8 | 408 | 3.734375 | 4 | [
"MIT"
] | permissive |
function permutation(n, r){
var result = [];
var selection;
while (true) {
console.log("in while loop");
selection = Math.floor(Math.random() * n);
if (result.indexOf(selection) > -1){
continue;
}
else{
result.push(selection);
}
... | true |
69757588c9eac6bd65ac3b16acfe375b416b99d0 | JavaScript | Chaser1102/HOMEWORK | /script.js | UTF-8 | 5,535 | 2.75 | 3 | [] | no_license | $(document).ready(function() {
$(window).load(function() {
// 淡入进入界面
$(".se-pre-con").fadeOut("slow");
});
//从高德地图提供api从ip信息获取地理信息(因为是通过api 获取经纬度 所以定位城市可能会产生误差)
$.ajax({
type: 'GET',
url: 'https://restapi.amap.com/v3/ip?output=json&key=34f09fa07ef8121f40f0ba669947d891',
success: coordinate... | true |
ecf19074889c96f62f12c535177a7eb5703b904c | JavaScript | lukasnakas/biuro-vietu-planavimas | /seat-planner-frontend/src/services/TeamService.js | UTF-8 | 3,098 | 2.625 | 3 | [] | no_license | import axios from "axios";
import { useState, useEffect } from "react";
const TeamService = (props) => {
const baseUrl = "http://localhost:8080/v1/planner/";
const [teamsData, setTeamsData] = useState([]);
const [teamData, setTeamData] = useState([]);
const [updateTeamState, setUpdateTeamState] = useState("");... | true |
e96a4467b39bea6eb1816f0597cfffaa73eafd0c | JavaScript | dewnah/sample-sessions | /src/App.js | UTF-8 | 2,063 | 2.671875 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import sample from 'lodash/sample';
import instruments from './data/instruments';
import genres from './data/genres';
import './App.scss';
const App = () => {
const [genre] = useState(sample(genres));
const [instrument] = useState(sample(instruments));
co... | true |
b55249d53d22eb3a94427c769c5a5844ece82ed1 | JavaScript | Lucyway/lucy-components | /components/changebg/changebg.js | UTF-8 | 363 | 2.703125 | 3 | [] | no_license | //слайдер изменяющий классы у #sliderBg
function changeBg(curNumber){
curNumber++;
if(curNumber > 3){
curNumber = 1;
}
if (document.getElementById("sliderBg")) {document.getElementById("sliderBg").setAttribute('class', 'slideBg' + curNumber)};
setTimeout(function(){changeBg(curNumber)}, 8000... | true |
19c0903fede9f9e1ea3764fdb22b38966afac6b9 | JavaScript | Xavier-Pierre-dev/FreeCodeCamp-Certification_JavaScript-Algorithms-and-Data-Structures | /5_Basic-Data-Structures/18_Iterate-Through-the-Keys-of-an-Object-with-a-for---in-Statement/freecodecamps.js | UTF-8 | 418 | 3.3125 | 3 | [] | no_license | function countOnline(usersObj) {
// Only change code below this line
let counter = 0;
for(let user in usersObj){
console.log(user)
console.log(usersObj[user])
console.log(usersObj[user]["online"])
if(usersObj[user]["online"] === true){
counter = counter + 1;
}
}
... | true |
297666c97fa3c4157c3c44ae271ede3a7ff096bd | JavaScript | hubhany/simple | /assets/dist/js/showInput.js | UTF-8 | 549 | 2.8125 | 3 | [] | no_license | //show search input
function showSearchInput() {
let searchIcon = document.querySelector('.search_icon');
let searchInput = document.querySelector('.search input');
let searchContainer = document.querySelector('.search_container');
let links = document.querySelector('.my_links');
searchIcon.addEven... | true |
bb3e8c0e064174a2f596a2209f5b496b7b4f5fdf | JavaScript | hamzarocko/youthBrain | /js/app.js | UTF-8 | 1,393 | 2.515625 | 3 | [
"MIT"
] | permissive | $(document).ready(function () {
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sUR... | true |
ef5d22ec838bd96535bb1c0d1056a46ab82c019c | JavaScript | corwin/easybars | /test/specs/default.spec.js | UTF-8 | 2,175 | 2.921875 | 3 | [] | no_license | var Easybars = require('../../index');
describe('with default settings', function () {
var easyDefault = new Easybars();
describe('spaces within tags are ignored, line breaks are preserved', function (expect) {
var render = easyDefault.compile('<div class="{{foo}}">{{ \n bar }} foo\n{{{num}}}</di... | true |
1d2e4c47794f2ccd83d00ae2a7d3bdf49227e1a4 | JavaScript | AbdallahAbuKhurma/Trees-Revision | /__tests__/node.test.js | UTF-8 | 449 | 2.71875 | 3 | [
"MIT"
] | permissive | 'use strict';
const Node = require('../trees/node');
describe('Node class', () => {
it('create an instance of the Node class', () => {
const node = new Node();
expect(node).toBeDefined();
});
it('create node instance with the correct properties', () => {
const value = 'any';
const node = new No... | true |
179453d798d09577cb990d70d26e0aa1e20d6edb | JavaScript | divyasehgal/js-exercises | /fibonacci.js | UTF-8 | 224 | 3.71875 | 4 | [] | no_license | var fibonacci = function (n) {
if (n == 1) {
return [0, 1];
} else {
var data = fibonacci(n - 1);
data.push(data[data.length - 1] + data[data.length - 1]);
return data;
}
};
console.log(fibonacci(5));
| true |
ff5e271e7661ef51001f20c61c1f8f20f5385ea4 | JavaScript | Dragana-code/bit-pp | /arrays_exercise.js | UTF-8 | 2,087 | 4.0625 | 4 | [] | no_license | /*4. Write a program that finds the first element larger than minimum and prints out its value.
Input array: [4, 2, 2, -1, 6]
Output: 2
*/
var a = [4, 2, 2, -1, 6, 0];
var temp;
for (var i = 0; i < a.length; i++) {
for (var j = i + 1; j < a.length; j++) {
if (a[i] > a[j]) {
temp = a[i];
... | true |
99cc1adc703b0873a9675d9b23a71b118ce51dcd | JavaScript | cwarren/cavesofmars | /assets/random_tables.js | UTF-8 | 18,851 | 2.90625 | 3 | [] | no_license | /*
Game.RandomTable = function(name, repository, table) {
the table is an array of entries, each entry being a hash with
name: REQUIRED the name/key used in the repository, or the string 'nothing'
weight: a positive integer number - used for weighted distribution of things (default= 1)
flag_decrement: if t... | true |
7aaef634f3ef30f8c210b8ec6c936611735863cb | JavaScript | ste4o26/Softuni-Tasks | /JS Advanced/Syntax, Functions And Statements Exercises/Road Radar.js | UTF-8 | 514 | 3.25 | 3 | [] | no_license | function solve(data) {
const speedLimitInAreas = {
motorway: 130,
interstate: 90,
city: 50,
residential: 20
};
let result = '';
let speedLimit = speedLimitInAreas[data[1]];
if (data[0] - speedLimit > 40) {
return 'reckless driving';
} else i... | true |
8097b640b9f3f71f9411d12395008eddbf6d8d58 | JavaScript | Colo-Codes/react-the-complete-guide-course | /01-my-react-files/04-project-practice/src/App.js | UTF-8 | 1,325 | 2.59375 | 3 | [] | no_license | import { useState } from 'react';
import './App.css';
import Modal from './Components/UI/Modal';
import UserList from './Components/UserList/UserList';
import UserNew from './Components/UserNew/UserNew';
function App() {
const [listOfUsers, setListOfUsers] = useState('');
const [errorMessage, setErrorMessage] = ... | true |
cb6a9b2f4b92dfb9ae6927e2cb518933f7dc672d | JavaScript | aquilinae/learn-programming | /learn-web/books/EloquentJavascript/04_02.js | UTF-8 | 2,105 | 4.59375 | 5 | [
"Unlicense"
] | permissive | /*
Обращаем вспять массив
У массивов есть метод reverse, меняющий порядок
элементов в массиве на обратный. В качестве
упражнения напишите две функции, reverseArray и
reverseArrayInPlace. Первая получает массив как
аргумент и выдаёт новый массив – с обратным порядком
элементов. Вторая работает как оригинальный метод
rev... | true |
8ccef9fed7a1cb40f119fd0344d11150145c8a0b | JavaScript | minhtri0795/30-days-of-react | /solutions/day-24-project/src/hooks/useClock.js | UTF-8 | 625 | 3.046875 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
function useClock() {
const [timeString, setTimeString] = useState("");
const formatTime = () => {
const date = new Date();
const hours = date.getHours();
const minute = date.getMinutes();
const second = date.getSeconds();
return `${hours}:${m... | true |
256bf759bb56a4174776365d9fca42a4824d36f7 | JavaScript | Dh529885/TravelBlog-Project-Frontend | /src/pages/Index.js | UTF-8 | 2,075 | 2.640625 | 3 | [] | no_license | import { useState } from "react"
import { Link } from "react-router-dom"
function Index(props) {
// state to hold formData
const [newForm, setNewForm] = useState({
title: "",
image: "",
desc: "",
});
// handleChange function for form
const handleChange = event => {... | true |
580e879ec791dd7e9451a05630a22a8b6506894a | JavaScript | kfitfk/svg-boundings | /lib/gradient_bounding.js | UTF-8 | 1,130 | 2.984375 | 3 | [] | no_license | 'use strict';
var ElementObject = require('./element_object');
function radialGradientBoundingBox(gradientObj) {
return {
left: gradientObj.cx - gradientObj.r,
top: gradientObj.cy - gradientObj.r,
right: gradientObj.cx + gradientObj.r,
bottom: gradientObj.cy + gradientObj.r,
width: gradientObj.r... | true |
bd81fbc48ca04d676c98064a215b90c1f4220414 | JavaScript | wu617354970/component | /前端插件库/自定义插件/插件编写/插件/z.js | GB18030 | 10,929 | 2.671875 | 3 | [] | no_license | //=========================================================
(function (window, undefined) {
var _doc = document,
_win = window;
var Z = {
//ȡԪ
$ : function (id) {
return (typeof id == 'string') ? document.getElementById(id) : id;
},
//ȡԪʵʿ ߶
width : function (elem) {
return elem.offsetWidth || (e... | true |
abe1c4944685989b8058dda4c6cede38c4a130b4 | JavaScript | toni89/fastacl | /lib/FastACL.js | UTF-8 | 3,749 | 2.578125 | 3 | [
"MIT"
] | permissive | 'use strict';
let merge = require('merge');
let get = require('lodash.get');
class FastACL {
constructor() {
this.rules = {};
}
middleware(options) {
let defaults = {
roles: 'jwt.payload.rls',
errorStatus: 403,
errorCode: 'NotAuthorized',
errorMsg: 'This route is restricted'
... | true |
227103cde409e485838869e7ed6c35844fd624b0 | JavaScript | rakiasomai/holbertonschool-web_back_end-1 | /0x0E-ES6_basic/100-createIteratorObject.js | UTF-8 | 328 | 2.578125 | 3 | [] | no_license | /* eslint-disable no-plusplus */
export default function createIteratorObject(report) {
const employees = Object.values(report.allEmployees);
let nextIndex = 0;
return {
next() {
return nextIndex < employees.length
? { value: employees[nextIndex++], done: false }
: { done: true };
},... | true |
cfd540627b46a095eba970d065eaec56062f01f6 | JavaScript | arintaosorio/ejercicios-es6-es5 | /6.-forOf/js/app.js | UTF-8 | 932 | 4.75 | 5 | [] | no_license | /*ES5
Declara la variable
Escribe tu funcion
function average(numbers){
var total = eval(numbers.join('+')) / numbers.length; //EVAL es para indicarle que es una opecación aritmética(solución squad 6)
console.log('El promedio de este arreglo es: ' + total)
return total;
}
*/
/*
function average(... | true |
28bc594009085d9f5bd54ab44a3265066a451e68 | JavaScript | quowtf/todoappjs | /App.js | UTF-8 | 1,414 | 2.765625 | 3 | [] | no_license | import React from "react";
import { View, Text, TextInput, Button } from "react-native";
class App extends React.Component {
state = {
text: "",
todos: []
};
deleteTodo = t => {
todos = this.state.todos;
index = todos.indexOf(t);
todos.splice(index, 1);
this.setState({ todos });
};
ad... | true |
7a47b10a791de3f0a59fa2b063694f2e00b011d9 | JavaScript | Bongwe/Gargoyle | /public/scripts/effects/testing.js | UTF-8 | 1,880 | 3.015625 | 3 | [] | no_license | (function () {
'use strict';
const audioContext = new AudioContext();
const recordButton = document.querySelector('#record');
navigator.mediaDevices.getUserMedia({ audio: true })
.then(attachEvents);
function attachEvents(sourceStream) {
const data = [];
let me... | true |
a7139ba1244548c45340798b05eacd9589a41cf0 | JavaScript | Danil7261/js.hw | /My repo/Part_1/05-user-interaction.js | UTF-8 | 374 | 3.578125 | 4 | [] | no_license | //Выводим для пользователя
// console.log('Test')
// alert('Danger message')
// Получать данные от пользователя
// prompt
// confirm
// let userAnsver = confirm('Are you sure?') // True False
// console.log (userAnsver)
// let result = prompt('сколько тебе лет?'); //user input / null
// console.log(result) | true |
22531018dd00739d50da58baead69a99b85e49cc | JavaScript | ccsulzf/javascriptIInfo | /src/RefrenceType.js | UTF-8 | 563 | 3.5 | 4 | [] | no_license | /**
* Reference Type JavaScript语言内部的一个规范类型
* Reference Type(base,name,strict)
* base: 对象
* name:属性名
* strict: 是否为严格模式
* 进行赋值操作hi=user.hi等其他操作,都会将Reference Type作为一个整体丢弃掉
* 而会取user.hi的值并继续传递,
*/
let user = {
name: "zs",
say() {
console.log("----", this);
},
jump() {
console.log(this);
}
};
// t... | true |
5c36402e905a3d6025e7379745efa656d1435d79 | JavaScript | klkavyashree/JavaScript | /Oops/cards2D.js | UTF-8 | 757 | 2.734375 | 3 | [] | no_license | /************************************************************
* Execution : 1. cmd> node cards2D.js
* if nodemon is installed:
* 2. cmd> nodemon cards2D.js
* nodemon helps in restart the program after every changes.
*
* Purpose : Distribute 9 cards... | true |
56dc9ab08c0c5f0f6483966edd0f87a25f1a34e1 | JavaScript | vessos/Js-Core-Archive | /JsCore/01.JS-programingLogic/sum3Numbers.js | UTF-8 | 244 | 2.796875 | 3 | [] | no_license | /**
* Created by MARK-Max on 22.9.2016 г..
*/
function sum3Nmubers(nums){
let a = Number(nums[0]);
let b = Number(nums[1]);
let c = Number(nums[2]);
let sum = a+b+c;
return (sum);
}
console.log(sum3Nmubers(['2','3','4'])) | true |
75a07c901e18e23ec5ba3321eb9a53a0b86f2fcf | JavaScript | nguyenhmp/MEAN_feb_2017 | /Kyle/JS Fundamentals/fibonacci.js | UTF-8 | 486 | 3.359375 | 3 | [] | no_license | function fib(){
var first_count = 0
var second_count = 1
function nacci(){
console.log(second_count)
var temp = second_count
second_count = first_count + second_count
first_count = temp
}
return nacci
}
var fibCounter = fib()
fibCounter() // should console.log "1"
fibCounter() // should consol... | true |
32faabbde7d696e94822d42749545e81244da3f3 | JavaScript | johneyme/7_Groupomania_React_Nodejs-OLD | /backend/routes/messagesCtrl.routes.js | UTF-8 | 4,666 | 2.546875 | 3 | [] | no_license | // imports
const models = require('../models');
const asyncLib = require('async');
const jwtUtils = require('../utils/jwt.utils')
// Constants
const TITLE_LIMIT = 2;
const CONTENT_LIMIT = 4;
const ITEMS_LIMIT = 50;
// Routes
module.exports = {
createMessage: function (req, res) {
// Getting auth header... | true |
36914b14845bcdc10bbb9a928a62921984745cca | JavaScript | DimaKV/re-store | /src/components/book-list/book-list.js | UTF-8 | 3,887 | 2.578125 | 3 | [] | no_license | import React, {Component} from 'react';
import BookListItem from '../book-list-item';
import './book-list.css';
import Spinner from '../spinner';
import ErrorIndicator from '../error-indicator';
import {connect} from 'react-redux';
//импорт action creator
import {fetchBooks, bookAddedToCart} from '../../actions';
i... | true |
c98adbcaa68210f78e0e1ba1a5578477cb59bfd4 | JavaScript | Cronos72/Orion4 | /js/main.js | UTF-8 | 6,196 | 2.875 | 3 | [] | no_license | /*
The Phaser api (..app/phaser.min.js) is a frame work that acts as a html5 game engine. Essential it is a finite state machine (FSM)
in which the states are handled by the state manager of the games instance ( new phaser.Game(params) ). Each state has a set of functions, init; preload; create; update
which get exucte... | true |
13f9c9219ccf5d9ae661e8b0d42273a3b85e9d24 | JavaScript | tosmak16/shoppit-design | /scripts/toggleBody.js | UTF-8 | 327 | 2.75 | 3 | [] | no_license | $(document).ready(function() {
document
.getElementById("nav-bar__button")
.addEventListener("click", toogleBody);
function toogleBody() {
if (document.body.style.overflow === "hidden") {
document.body.style.overflow = "visible";
} else {
document.body.style.overflow = "hidden";
}
... | true |