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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
10ac5cf2a5902259e7044dbb7baf1eb2c9ce1e73 | JavaScript | saiyedaws/EL | /libraries/custom.functions.js | UTF-8 | 1,178 | 3.328125 | 3 | [] | no_license | function insensitiveReplaceAll(original, find, replace) {
var str = "",
remainder = original,
lowFind = find.toLowerCase(),
idx;
while ((idx = remainder.toLowerCase().indexOf(lowFind)) !== -1) {
str += remainder.substr(0, idx) + replace;
remainder = remainder.substr(idx + fin... | true |
e7e92f4cd08b9a4e4d4dcf1cc11e92fc4d0d69af | JavaScript | nairihar/conference-data | /scripts/tests/conferences.test.js | UTF-8 | 3,968 | 2.84375 | 3 | [
"MIT"
] | permissive | /* global describe, it, expect, require */
/* eslint-disable no-console, shopify/prefer-early-return */
import {range} from 'lodash';
import {getDuplicates} from './utils';
import {TOPICS, START_YEAR, CURRENT_YEAR} from '../config';
const BASE_DIR = '../../conferences';
const conferencesJSON = {};
range(START_YEAR, C... | true |
be2c058b260745e9907d5a50beca9ec13a7501f7 | JavaScript | yelyaht/DiscordBot | /index.js | UTF-8 | 955 | 2.671875 | 3 | [] | no_license | require('dotenv').config();
const Discord = require('discord.js');
const bot = new Discord.Client();
const TOKEN = process.env.TOKEN;
bot.login(TOKEN);
bot.on('ready', () => {
console.info(`Your savior is heerrree!}!`);
});
bot.on('message', msg => {
if (msg.content === 'hi') {
msg.reply('Hello');
msg.ch... | true |
41231f22d2c7842c6ba15509572075811e2630dd | JavaScript | fpsimonee/loginapp | /src/components/LoginStore.js | UTF-8 | 1,025 | 2.59375 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
class LoginStore extends BaseStore {
constructor() {
// First we register to the Dispatcher to listen for actions.
this.dispatchToken = AppDispatcher.register(this._registerToActions.bind(this));
this._user = null;
this._jwt = null;
}
_registerToActions... | true |
fea39e8c9fa5169f1a2bab86224436d202e304ac | JavaScript | afsanehesteki/Guess-My-Number-JS | /script.js | UTF-8 | 2,878 | 4.15625 | 4 | [] | no_license | 'use strict';
/*console.log(document.querySelector('.message').textContent); // selecting 'message' class, then read textContent property of the element
//Set content of the element:
document.querySelector('.message').textContent = 'Correct number! ';
document.querySelector('.number').textContent = 13;
document.quer... | true |
afc445e6a60294cf626bec242967c732b98346e8 | JavaScript | benskov95/CA3-Frontend-startcode | /src/base-components/Home.js | UTF-8 | 1,509 | 2.734375 | 3 | [] | no_license | import { useEffect, useState } from "react";
import { LOCAL_URL, REMOTE_URL } from "../utils/settings";
export let URL = "";
export default function Home() {
const [currentURL, setCurrentURL] = useState(
URL === LOCAL_URL ? "Local API" : URL === REMOTE_URL ? "Remote API" : "none"
);
useEffect(() => {}, [cu... | true |
29a7bd8a91488825423e827bde08cfca074558f0 | JavaScript | aritocohen/DI_bootcamp | /Week 4/Day 10/script.js | UTF-8 | 2,649 | 3.859375 | 4 | [] | no_license | // Day 10 Excersie 1
// function checkDriverAge(){
// let age = prompt("What is your age?");
// if (Number(age) < 18) {
// alert("Sorry, you are too young to drive this car. Powering off");
// } else if (Number(age) > 18) {
// alert("Powering On. Enjoy the ride!");
// } else if (Number(age) === 18) {
// ... | true |
b6a71d17c8139a3d9e422cb67286e41d04cce83d | JavaScript | MR26-UA/front-end-pro-2019-september | /lections/lection_7_functions-practice/materials/main.js | UTF-8 | 2,459 | 3.15625 | 3 | [] | no_license | console.log('Lection_7');
// var x = 10;
// function f(y) {
// // hoisting
// console.log(x, y);
// var x = 678;
// console.log(x, y);
// }
// f(56);
// console.log(x, y);
// -----------------------------
// var z = 20;
// var a = 700;
// function f(a, x) // f.scope = Global f.LE -> b = 20,... | true |
ffe432e00ada36c7600c3b11ce7213a523a940fd | JavaScript | omarProgrammer/rxjs-example-ajax-wikipedia | /js/script.js | UTF-8 | 1,655 | 2.75 | 3 | [
"MIT"
] | permissive | (function(window, document, $) {
window.addEventListener('load',init)
var dom = null;
function init() {
initDom();
initAutoCompletion();
}
function initDom() {
dom = {
input: document.getElementById('term'),
error: document.getElementById('error'),
list: document.getElementsByTagName('ul')[0... | true |
1f93b6912e8f0da9ba1b2ba3c9edb77ac4995fa9 | JavaScript | tangweikun/peacock | /canvas/life-transcript.js | UTF-8 | 2,403 | 2.640625 | 3 | [] | no_license | function generateScore() {
const scores = [0, 1, 2, 3].map(_ => Math.round(90 + Math.random() * 10))
const average = Math.round(scores.reduce((acc, n) => acc + n, 0) / 4)
return { scores, average }
}
export function createLifeTranscript(userInfo = { nickName: '请先授权' }) {
const { scores, average } = generateSco... | true |
876c5227b18d841c14543a29dd490ab39cfa7e9f | JavaScript | NoonanL/TEmPoSmobile | /src/services/mqtt.js | UTF-8 | 2,290 | 2.578125 | 3 | [] | no_license | import init from 'react_native_mqtt';
import { AsyncStorage } from 'react-native';
/**
* This method creates a connection to the MQTT Broker and publishes a message to a topic.
* @param {*} topic The topic to publish to
* @param {*} publishMessage The message to publish to the topic
*/
export const publishMQTT = (... | true |
2be826fc2f21638d4f729e5ea8fbe5ef7fa784ea | JavaScript | Sorrelljs/scraping-excercise | /getUSStates.js | UTF-8 | 1,540 | 2.9375 | 3 | [] | no_license | const axios = require('axios');
const cheerio = require('cheerio')
const page_url = 'https://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States'
async function getUSStates(){
const {data} = await axios.get(page_url)
const $ = cheerio.load(data)
const table = $('caption:contains("Sta... | true |
daeace921dcb90a8f9a815f7a0655e52f7700575 | JavaScript | vmashnitskaya/basic-js | /src/extended-repeater.js | UTF-8 | 469 | 2.921875 | 3 | [
"MIT"
] | permissive | module.exports = function repeater(str, options) {
const {
repeatTimes = 1,
separator = '+',
addition = '',
additionRepeatTimes = 1,
additionSeparator = '|'
} = options;
const additionCalculated = Array(additionRepeatTimes).fill('' + addition)
... | true |
261777ddfe5c872a354391e7dd4c7e5f9a6cd8da | JavaScript | mstaal/toolkitSearch | /toolkitSearch/options.js | UTF-8 | 2,900 | 2.90625 | 3 | [] | no_license | function Rule(data) {
var rules = document.getElementById('rules');
this.node = document.getElementById('rule-template').cloneNode(true);
this.node.id = 'rule' + (Rule.next_id++);
this.node.rule = this;
rules.appendChild(this.node);
this.node.hidden = false;
if (data) {
this.getElement('path').value ... | true |
0595e8c1c84ecf76c3ddb19421280ff36e8b70d5 | JavaScript | caoweiju/js_utils | /commonjs_utils/string.js | UTF-8 | 396 | 2.828125 | 3 | [] | no_license | /**
* @function trim
* @param {string} str {需要请求两端空格的字符串}
* @return {string} {清除两端空格的字符串结果}
*/
function trim(str){
if (!String.prototype.trim) {
String.prototype.trim = function () {
return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
};
}
return str.trim();
}
module... | true |
bf60a8b6270d77601ddc35b6e6118c89f59da34e | JavaScript | Arunkayathi/BudgetPlanner-React | /src/selectors/expenses.js | UTF-8 | 728 | 2.8125 | 3 | [] | no_license | import moment from 'moment';
export default (expenses,{text,startDate,endDate,sortBy})=>{
return expenses.filter((expense)=>{
const createdMoment=moment(expense.createdAt);
const startDateMatch=startDate?startDate.isSameOrBefore(createdMoment,'day'):true;
const endDateMatch=endDate?endDate.... | true |
10d224f877418002102d689396237bcac6cc0eda | JavaScript | broady/Bootcamp-sample-code | /random-marker-polyline/3.js | UTF-8 | 946 | 3.21875 | 3 | [] | no_license | function initialize() {
var mapDiv = document.getElementById('map-canvas');
var map = new google.maps.Map(mapDiv, {
center: new google.maps.LatLng(37.4419, -122.1419),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var addMarkerButton = document.createElement('button');
document.body.appe... | true |
0bbe365106d40b618e82623b290f09d1b635d17b | JavaScript | Daria-Skachkova/localStorage | /js/index.js | UTF-8 | 546 | 2.96875 | 3 | [] | no_license | function visitLink(path) {
let num = +localStorage.getItem(path) || 0
localStorage.setItem(path, String(++num))
}
function viewResults() {
const values = [
localStorage.getItem('Page1') || 0,
localStorage.getItem('Page2') || 0,
localStorage.getItem('Page3') || 0
]
const ite... | true |
5ee5bd1b382651b03347d77691924b45ad9cb45c | JavaScript | vdmpeniel/MindTeck_Store | /FinalProject_MindTeckStore/WebContent/javascript/Forms.js | UTF-8 | 3,728 | 3.140625 | 3 | [] | no_license | // Input Prototype Constructor
function Input(id, name, errorMessage, label, value){
// Properties
this.id = id;
this.name = name;
this.errorMessage = errorMessage;
this.label = label;
this.value = value;
}
// Form Prototype Contructor
function Form(title, submit, cancel){
// Properties
this.inputList = [];
... | true |
2d91e86fb520f3e2cb885a4b666df3a437727900 | JavaScript | ev-ran/Coins_dropping | /main.js | UTF-8 | 1,945 | 3.875 | 4 | [] | no_license | let coin = {
state: 0,
flip: function () {
/* 1. Randomly set your coin object's "state" property to be either
0 or 1: use "this.state" to access the "state" property on this object.*/
let randNum = Math.round(Math.random());
this.state = randNum;
},
toString: fun... | true |
2efaab90d611c87786b94c5cc1d5391b7e990d72 | JavaScript | kikexp/apiBriz | /.history/controladores/uploadControlador_20190325101504.js | UTF-8 | 3,427 | 2.5625 | 3 | [] | no_license | "use strict"
// importamos la libreria de upload
var fileUpload = require('express-fileupload')
// Importamos el modelo de usuarios
var Usuarios = require("../modelos/usuario.js");
var Clientes = require("../modelos/cliente.js");
//Importamos la dependencia para encriptar contraseñas
var bcrypt = require("bcrypt-... | true |
b668901fb348b260a323b698efe9e9f7c817f0c9 | JavaScript | rajat404/Just-Arrived | /contentScript.js | UTF-8 | 2,196 | 3.125 | 3 | [
"MIT"
] | permissive | let seenTweets = [];
let unSeenTweets = [];
// Date to timestamp - thanks Stack overflow
Date.prototype.yyyymmdd = function () {
var mm = this.getMonth() + 1; // getMonth() is zero-based
var dd = this.getDate();
return [
this.getFullYear(),
(mm > 9 ? "" : "0") + mm,
(dd > 9 ? "" : "0") + dd,
].joi... | true |
36576e174a6608c3c4d7936578238fa0a8661091 | JavaScript | mbalindaba01/first_terminal_test | /test/mostProfitableDepartment.test.js | UTF-8 | 758 | 2.5625 | 3 | [] | no_license | let assert = require('assert')
let mostProfitableDepartment = require('../mostProfitableDepartment')
describe('mostProfitableDepartment function', () => {
it('must return "hardware" if the hardware department produces the most profit', () => {
assert.deepStrictEqual(mostProfitableDepartment([
{depa... | true |
11f1546304a825db4d2e129835dcc244b4a1a7ad | JavaScript | tkonopka/makealive | /lib/isprime/isprime.js | UTF-8 | 1,306 | 3.390625 | 3 | [
"MIT"
] | permissive | /* isprime.js. Copyright 2017 Tomasz Konopka. */
/* global makealive */
/**
* A demo conversion function
* It is plain-js and provides a decomposition of a number into factors
*
* Authors: Tomasz Konopka
*
* @param obj - target DOM element that will contain output
* @param x - object with configuration and d... | true |
f4c0f271ccf519ae051c8cd099b64355de87f3e7 | JavaScript | RabillerCharlie/Exercice-1-TP-javascript | /Exercice1.js | UTF-8 | 840 | 3.921875 | 4 | [] | no_license | //Fonction adder modifié pour nombre de parametres variables
function adder() {
var args = Array.prototype.slice.call(arguments);
return function (v) {
var somme = 0;
args.forEach(function (val) {
somme += val(v);
});
return somme;
}
}
function mult(v) {
ret... | true |
53c0827c713302d0c8ece1b81458ce7bc72f4786 | JavaScript | D3athb3rry/expression-calculator | /src/index.js | UTF-8 | 842 | 3.40625 | 3 | [] | no_license | function eval() {
// Do not use eval!!!
return;
}
function expressionCalculator(expr) {
let bracketOpen = 0;
let bracketClosed = 0;
for (let i = 0; i < expr.length; i++) {
if (expr[i] === "(") {
bracketOpen++;
} else if (expr[i] === ")") {
bracketClosed++;
... | true |
12446aa0bb186a6887b731340095e70848afd6ac | JavaScript | ducduong303/WebClone | /Lalvai/assets/js/main.js | UTF-8 | 5,500 | 2.609375 | 3 | [] | no_license | var all = {
init: function () {
this.load();
this.mess();
this.scrollNav();
this.clickNav();
this.carosel();
this.lightBox();
this.carosel2();
},
load: function () {
const load = document.querySelector('.load');
setTimeout(() => {
... | true |
676d45547669585d17ff4daa6788baabcfadd4da | JavaScript | umar15/Covid19-Tracker-React-Native | /Screens/WorldStats.js | UTF-8 | 4,551 | 2.59375 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { View, Text, StyleSheet, ActivityIndicator } from "react-native";
import { Card } from "react-native-elements";
const WorldStats = () => {
const [GlobalStats, setGlobalStats] = useState([]);
const [isLoading, setIsLoading] = useState(true);
const [worldPop... | true |
54bcc4a4d66064c6398e966fe09275c9af2859a3 | JavaScript | muvari/EloWorld | /eloworld/leagues/static/league.js | UTF-8 | 751 | 2.59375 | 3 | [] | no_license | $("tr.player-row").hover(function () {
var name = $(this).attr("id");
$('tr.player-row').each(function(i, obj)
{
var opp = $(this).attr("id");
var r = records[name];
if (r[opp] > 0)
$('#' + opp).css("background-color","#CEE9CE");
else if (r[opp] < 0)
... | true |
16fa511881b1aaa4fa87a300435eb2142a581bb8 | JavaScript | yizhiyan1992/Udemy-the-complete-javascript-course-2021 | /Section3/script.js | UTF-8 | 2,641 | 4.0625 | 4 | [] | no_license | 'use strict';
/*
let hasLicense = false;
const passTest = true;
if (passTest) hasLicense = true;
if (hasLicense) console.log("i can drive.");
function logger() {
console.log("my name is Jonas.");
}
// calling, invoking
logger();
function fruitProcessor(apples, oranges) {
const juice = `${apples} apples mixe... | true |
533bf8476003d7522a735e4661045c93d4ecf6e6 | JavaScript | Wa5abi/tweetr | /public/scripts/app.js | UTF-8 | 2,715 | 2.609375 | 3 | [] | no_license | // Test / driver code (temporary). Eventually will get this from the server.
const data = [
{
"user": {
"name": "Newton",
"avatars": {
"small": "https://vanillicon.com/788e533873e80d2002fa14e1412b4188_50.png",
"regular": "https://vanillicon.com/788e533873e80d2002fa14e1412b4188.png",
... | true |
920a515828e2d4a28bc49132f6ff443fc75c2614 | JavaScript | TechWilli/aula-final-API | /index.js | UTF-8 | 2,625 | 2.5625 | 3 | [] | no_license |
const express = require('express');
const ExpressMongoDb = require('express-mongo-db');
const cors = require('cors');
const bodyParser = require('body-parser');
const ObjectID = require('mongodb').ObjectID
const app = express();
app.use(ExpressMongoDb('mongodb://hamburgueria:hamburgueria123@165.227.221.155/hamburgue... | true |
cae13f4b07b6a3e411df8e7f408d72cef0a7ec2f | JavaScript | kwrush/weather-react | /src/utils/api.js | UTF-8 | 1,569 | 2.75 | 3 | [] | no_license | // sepcify "as" or "from" causes "only absolute urls are supported"
// error in the test with fetch-mock
import 'isomorphic-fetch';
// Based on https://github.com/cloudmu/darksky/blob/master/src/apiUtils.js
const checkResponseStatus = (response) => {
if (!response.ok) {
const error = new Error(response.st... | true |
8ccdb231d5175c140a49ca07de38e84d66592bec | JavaScript | ramyres110/FFatura_App | /tools/asyncStorageTool.js | UTF-8 | 1,906 | 2.71875 | 3 | [] | no_license | // RUN INSIDE APP
// Add To App.js
import StorageUtils from '../src/utils/storage-utils';
import UserModel from '../src/models/user-model';
async function listAllKeys() {
const all = StorageUtils.retrieveAll('');
return all;
}
async function listAllUsers() {
const users = await UserModel.getAll();
r... | true |
87f72f9496a07da8f2394a2a135be2556c538337 | JavaScript | willhu85/spirit-cli | /command/download.js | UTF-8 | 1,175 | 2.609375 | 3 | [] | no_license | if (!fs.existsSync(name)) {
const answers = await promptHandler(name)
const spinner = ora('正在下载模板...')
spinner.start()
download(
'http://192.168.2.27:10080:web/Vue-Template#dev', // 仓库地址,注意端口号后面的 '/' 在参数中要写成 ':'
name, // 路径,此处直接在当前路径下创建一个 name 的文件夹存放模板
{clone: true},
err => {
... | true |
e00a5343d128cf45fb9f5c212bd392b248386cb1 | JavaScript | Vol4n3/portefolio-wp | /js/main.js | UTF-8 | 2,757 | 2.546875 | 3 | [] | no_license | /**
* Created by vol4n3 on 20/06/2017.
*/
var SeeElement;
jQuery(document).ready(function () {
"use strict";
const $ = jQuery;
class HeaderTitle {
constructor(element) {
this.setActive($(document).scrollTop());
this.element = element;
}
... | true |
48dd99d026159b2a99d0aa0715064472d699ac3b | JavaScript | AndriiZil/nodejs-streems | /readable2.js | UTF-8 | 629 | 3.34375 | 3 | [] | no_license | const { Readable } = require('stream');
const myReadbleStream = () => {
const data = [
"This is the stream data 1",
"This is the stream data 2",
"This is the stream data 3",
"This is the stream data 4",
"This is the stream data 5"
];
return new Readable({
read () {
if(data.length =... | true |
932884f43b9bdef26bc8c838e8dc879cfa1b7d47 | JavaScript | MarwanEsm/Currency-Rate-Exchange | /src/CurrenciesListscreen/Converter.js | UTF-8 | 2,117 | 2.796875 | 3 | [] | no_license | import React, { useContext, useState } from "react";
import Button from "react-bootstrap/Button";
import { CurrenciesContext } from "../Components/CurrenciesContext";
function Converter({ searchedCurrency }) {
const { exchangeRates } = useContext(CurrenciesContext);
const [fromCurrency, setFromCurrency] = useStat... | true |
3b1207cabd0c434eb419218cfb10ff30620e8820 | JavaScript | iwkt/career | /assets/js/smooth.scl.js | UTF-8 | 1,171 | 3.15625 | 3 | [] | no_license | // aタグ要素の参照を取得
/*
const links = document.querySelectorAll('a[href^="#"]');
// 各aタグにクリックイベントを設定
for ( let i = 0; i < links.length; i++ ) {
links[i].addEventListener('click', (e) => {
// デフォルトのイベントをキャンセル
e.preventDefault();
// 対象(aタグ)のY軸の絶対座標を取得
const elemY = links[i].getBoundingClientRect().top;
... | true |
17a2a28158ec43c2a3528e9bacda0d8257e2ff73 | JavaScript | LeticiaSPedroso/funk-generator | /funk-generator-scraper/parser.js | UTF-8 | 564 | 2.921875 | 3 | [] | no_license | const { readFileSync, writeFileSync } = require('fs');
const funks = JSON.parse(
readFileSync('./funks.json', 'utf8'),
);
const funksParsed = funks.map(funk => {
const newFunk = {};
newFunk.letterWithHtml = funk.letter;
newFunk.name = funk.songName;
newFunk.author = funk.author;
newFunk.letter = funk.lett... | true |
d77589ca2f79e719a4efa8220b167d3e626e00d2 | JavaScript | RostislavBlaha/nejlepsiReactVypisNaSvete | /public/modul.js | UTF-8 | 4,524 | 3.015625 | 3 | [
"MIT"
] | permissive | /**
* @jsx React.DOM
*/
var Formular = React.createClass({
render: function() {
return (
<div>
<AhojSvete/>
<NakupniSeznam/>
</div>
);
}
});
var AhojSvete... | true |
fcff1719fbae781c20b07eed87d68b3b0fe23931 | JavaScript | fjimenez95/project-3-api-client | /src/services/todoService.js | UTF-8 | 1,831 | 2.5625 | 3 | [] | no_license | // const getTodos = () => fetch("http://localhost:3002/todos").then(res => res.json).catch((error) => console.log(error));
import TodoForm from '../components/TodoForm';
import { getToken } from './tokenService';
export function getTodos() {
return fetch('https://todos4teams.herokuapp.com/todos', {
method: 'G... | true |
0f297f7607a75ff4edfba04c03bd080c8c19da01 | JavaScript | salarsen/dojoWebDev | /jquery/datevalidations/dateval.js | UTF-8 | 1,261 | 2.890625 | 3 | [] | no_license | $(document).ready(function(){
$('form').submit(function(){
var date1 = $("#datepicker1").val();
var date2 = $("#datepicker2").val();
var phone = $("#phonenum").val();
var name = $("#name").val();
var form_complete = true;
$("input[type=text]").siblings("span").html(""... | true |
fe5d10435f66d401cb5ef3a004d30bd7f7badb27 | JavaScript | YaseminLi/note | /js/es6-leaning.js | UTF-8 | 819 | 3.5625 | 4 | [] | no_license | 'use strict'
//1.let和const
//let声明只在代码块内有效
for(let i=0;i<5;i++){
// console.log('a');
}
//console.log(i);//i is not defined
for(var i=0;i<5;i++){
//console.log('a');
}
//console.log(i);//5
(function(){
var tmp='a';
//console.log(tmp);
}())
//console.log(tmp);// 立即执行函数会封装内部tmp is not defined
//const f... | true |
ee90e053961079b17921781593d8246bc3e2441c | JavaScript | anamolina07/Testcafe_Bootcamp | /Testcafe/practica5.js | UTF-8 | 1,266 | 3.03125 | 3 | [] | no_license | import page from './pageModel';
fixture('Practica 5 con Testcafe')
.page('https://the-internet.herokuapp.com/')
test('Probar ingresar valores en Input', async t =>{
await t
.click(page.link5)
await t
.typeText(page.input51, "Letras",{speed:0.1})
.expect(page.input51.value).eql(... | true |
e52f3e9aea32724a30030cc8c0ebaa7c4f1260b6 | JavaScript | ndgndg91/for-my-development | /ES6/_chapter29.TypedArray/of.js | UTF-8 | 184 | 2.671875 | 3 | [] | no_license | console.log(Uint8Array.of(10));//[10]
console.log(Uint8Array.of(20, 30, 40));//[20,30,40]
console.log(Uint8Array.of(null));//[0]
console.log(Uint8Array.of("4", "A", "6"));//[4, 0, 6]
| true |
b939b9d6c6670e0392f8f08ce30b902b84380962 | JavaScript | luislourencos/books | /books-server-logic/accepted-share-book.js | UTF-8 | 1,671 | 2.953125 | 3 | [] | no_license | /**
* Accepted share books.
*
* @param {string} userId take by token.
* @param {string} newUserId new actualUserId.
* @param {string} bookId bookId.
*
* @throws {UnexistenceError} if don`t find userId in data base.
* @throws {CredentialsError} if you want a share a book and it not yours.
* @throws {Void... | true |
046b012de0ce04caf42181549505998cfcc0f381 | JavaScript | sid1602/chartED | /JS/SemesterSystem/SemesterSystem.js | UTF-8 | 7,879 | 2.59375 | 3 | [] | no_license | function SemesterSystem() {
this.semesters = [];
this.aRPS = null;
var newSemester = null;
newSemester = new Semster();
newSemester.name = "Year 1 - Fall Semester";
newSemester.givenID = "Y1Fall";
newSemester.average_GPA = Math.random() * 0.0;
this.semesters.push(newSemester);
ne... | true |
d849490c0eac95d077beeb8462b2c391ef45bcea | JavaScript | spicysoup/sei32 | /week11/node-websockets-tweetstreamer/public/js/main.js | UTF-8 | 984 | 2.734375 | 3 | [] | no_license |
console.log('io:', io);
// TODO: how to authenticate websocket connections?
const socket = io.connect('http://localhost:3000');
socket.on('connect', () => {
console.log('Websockets connection established!');
});
socket.on('disconnect', () => {
console.log('lost connection to server!');
})
// Listen for 'news' ... | true |
9d59c2de9d0bb7629cb6bbaed83725695702706c | JavaScript | mjraybk07/promises | /exercises/bare_minimum/basicChaining.js | UTF-8 | 1,734 | 3.203125 | 3 | [] | no_license | /*
* Write a function WITH NO CALLBACKS that,
* (1) reads a GitHub username from a `readFilePath`
* (the username will be the first line of the file)
* (2) then, sends a request to the GitHub API for the user's profile
* (3) then, writes the JSON response of the API to `writeFilePath`
*
* HINT: We exported s... | true |
b5c167631550e2bf82aa334e4deff17435fc2f75 | JavaScript | MPascaud/pedlg2021 | /front/lib/rules/messages.js | UTF-8 | 3,232 | 3 | 3 | [] | no_license | const messages = {
/* Commmon */
REQUIRED: 'Ce champs est requis',
USER_NOT_FOUND: "Cet utilisateur n'existe pas",
FIELD_CONFIRMATION: field =>
`Ce champ et "${field}" doivent être identiques`,
/* Username */
USERNAME_EMPTY: () => messages.REQUIRED,
USERNAME_UNIQUE: "Ce nom d'utilis... | true |
50df37353b1f665db67bfcf5e59e4027c039ad2f | JavaScript | startail/PowerWordBattle-Tour | /public/assets/js/firebase-authentication-signin.js | UTF-8 | 643 | 2.921875 | 3 | [] | no_license | // Sign In
var firebaseSignIn = function(){
var signInEmail = document.getElementById('signInEmail').value;
var signInPassword = document.getElementById('signInPassword').value;
firebase.auth().signInWithEmailAndPassword(signInEmail,signInPassword)
.then( function(user){
console.log("Success Si... | true |
6b9f454beb28767b648425d9ded18af7d7754084 | JavaScript | michaelscotthurley/restful-api | /models/coffee.js | UTF-8 | 619 | 2.734375 | 3 | [] | no_license | var mongoose = require('mongoose');
var CoffeeSchema = mongoose.Schema({
name: String,
size: String,
shots: Number,
milk: String
});
// Let's craft how our JSON object should look!
// http://mongoosejs.com/docs/api.html#document_Document-toObject
CoffeeSchema.set('toJSON', {
transform: function(doc, ret, ... | true |
9b9e835850336bfc254e8203d26f528981e9491b | JavaScript | drowzero0/cyberpunk2020 | /module/lookups.js | UTF-8 | 5,799 | 2.5625 | 3 | [] | no_license | // This is where all the magic values go, because cyberpunk has SO many of those
// Any given string value is the same as its key in the localization file, and will be used for translation
export let weaponTypes = {
pistol: "Pistol",
submachinegun: "SMG",
shotgun: "Shotgun",
rifle: "Rifle",
heavy: ... | true |
18d3f229ddf05b7bf7392de698f5a02faf845805 | JavaScript | Yana1112pstr/goit-js-hw-07 | /js/task-03.js | UTF-8 | 1,480 | 3.171875 | 3 | [] | no_license | const images = [
{
url: 'https://images.pexels.com/photos/140134/pexels-photo-140134.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260',
alt: 'White and Black Long Fur Cat',
},
{
url: 'https://images.pexels.com/photos/213399/pexels-photo-213399.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=... | true |
55533721062b203e08741e0cf36f3a49e6618e93 | JavaScript | iameclair/eeasydeal-react | /src/store/reducers/product/ProductByIdReducer.js | UTF-8 | 824 | 2.640625 | 3 | [] | no_license | import {ProductConstants} from "../../../constants/ProductConstants";
const initState = {
loading: false,
result: {},
error: null
};
const productByIdReducer = (state = initState, action) =>{
switch (action.type) {
case ProductConstants.GET_PRODUCT_BY_ID_REQUEST:
return {
... | true |
da34f8114b453b99067c6539f7e3dc30d9084a04 | JavaScript | FCO/Dispatcher | /asyncForEach.js | UTF-8 | 260 | 2.953125 | 3 | [] | no_license | require("./callBackAgain.js");
Array.prototype.asyncForEach = function(cb, cba) {
var func = cba;
var cbcba = function(val){
func = cb.bind(this, val).cba(func);
};
for(var i = this.length - 1; i >= 0; i--) {
cbcba(this[i]);
}
setImmediate(func);
};
| true |
43d2cfa463b385bb1ca204c811d828415154582f | JavaScript | nerdijoe/npm-package | /index.js | UTF-8 | 763 | 3.015625 | 3 | [] | no_license | exports.printMsg = function() {
console.log("This is a message from the demo package");
}
const monthIndo = {
0: 'Januari',
1: 'Februari',
2: 'Maret',
3: 'April',
4: 'Mei',
5: 'Juni',
6: 'Juli',
7: 'Agustus',
8: 'September',
9: 'Oktober',
10: 'November',
11: 'Desember'
}
const dayIndo = {
0: 'Minggu',
... | true |
e0880f4775ee206d08eac8c82be2cc4c9ec5abae | JavaScript | YFdevel/ModernJS_final | /js/ProductComponent.js | UTF-8 | 2,078 | 2.546875 | 3 | [] | no_license | Vue.component('products', {
data() {
return {
filtered: [],
products: [],
}
},
mounted() {
this.$parent.getJson(`/api/products`)
.then(data => {
console.log(data)
for (let item of data) {
this.pro... | true |
bebf046f1d74c51c642bac2fd714d5f4a8f7d1db | JavaScript | Dimotres/Programming-Basics-SoftUni-May-2021 | /Final exam & more exercises/Задача 3. Мобилен оператор.js | UTF-8 | 1,148 | 3.21875 | 3 | [] | no_license | function ermo(input){
let QuantityOfContract = input[0]
let TypeOfContract = input[1]
let ExtraInternet = input[2]
let MonthsForPayment = Number(input[3])
let price = 0;
let extraPrice = 0;
switch(TypeOfContract){
case "Small":
if(QuantityOfContract === "one"){
price = 9.98
}else{
... | true |
653a02eb0a9a7ffcbe86e8eb8b511469cf348902 | JavaScript | BugVogel/AVAA | /js/recursos.js | UTF-8 | 1,448 | 2.71875 | 3 | [] | no_license | function onlyOneCheck(idPressed){
var inputs = [document.getElementById('check1'), document.getElementById('check2')]
var idOn = idPressed.id;
var fileLabel = document.getElementById('fileLabel');
var fileInput = document.getElementById('fileInput');
var linkLabel = document.ge... | true |
d60ca82cd36f9c6c0f703c7f571f9f20c085bf26 | JavaScript | MaggieChege/Store-Manager | /public/js/logout.js | UTF-8 | 1,287 | 2.75 | 3 | [] | no_license | function logout() {
access_token = getToken()
token_clear = localStorage.clear();
window.location.href = '../index.html'
// window.location.href = 'admin.html'
}
window.onload = function Users(){
let products_url = 'http://127.0.0.1:5000/api/v2/users';
fetch(products_url,{
method:"GET",
He... | true |
b5369964a3231f96a51d767dfe7424ef70f55e79 | JavaScript | AdityaPratap006/AirStrike | /public/js/SpriteSheet.js | UTF-8 | 1,835 | 3.21875 | 3 | [] | no_license | export default class SpriteSheet {
constructor(image, width, height, scale = 1) {
this.image = image;
this.width = width;
this.height = height;
this.scale = scale;
this.tiles = new Map();
this.animations = new Map();
}
defineAnim(name, Animation) {
th... | true |
795cd5282e9c66b758daa81ba0fa60d2a6307930 | JavaScript | rahullgulati/Test | /four.js | UTF-8 | 403 | 2.953125 | 3 | [] | no_license | function validateForm() {
var x = document.forms["firstname"].value;
if (x == "") {
alert("Name must be filled out");
return false;
}
ErrorText= "";
if ( ( form.checkme[0].checked == false ) && ( form.checkme[1].checked == false ) )
{
alert ( "Please fill the check b... | true |
e7fd9165b1ced49cc41de8e23cc2cc8c119d8b4e | JavaScript | sunshineLixun/DGtle | /src/component/Date/DateTool.js | UTF-8 | 1,107 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
import { } from 'react-native';
export default class DateTool{
/**
*
* 比较时间差
* @param {any} targetTime 毫秒值
* @memberof Main
*/
static getLocalTime(targetTime) {
//当前时间的毫秒值
var nowDate = new Date().valueOf().toString().substr(... | true |
d5a7f3f2099f625feb4dc6cd0b522a76d3719938 | JavaScript | ArmandasM/react-timesheet-widget | /src/reducers/events/index.js | UTF-8 | 1,224 | 2.65625 | 3 | [] | no_license | import { Record } from 'immutable';
import moment from 'moment';
export const HourEvent = Record({
date: null,
eventType: null,
firstTaskStart: null,
lastTaskEnd: null
});
export const ExpenseEvent = Record({
date: null,
eventType: null,
quantity: null,
price: null
});
export const addEvents = (state... | true |
da8f9419f16b84a1f3e70c6d3d19fc4f33710449 | JavaScript | EddiePulido/LeetCode_problems | /valid-anagram.js | UTF-8 | 651 | 3.5 | 4 | [] | no_license | function isAnagram(s, t) {
if(s.length !== t.length){
return false;
}
// return s.split('').sort().join("") == t.split('').sort().join("")
const sCharCounts = {};
const tCharCounts = {};
//Fill sCharCounts
for(let i=0; i< s.length; i++){
const sChar = s[i];
//incre... | true |
b463792e0f36301e665b268812f67c395851e066 | JavaScript | Fernandogj87/Curso-JavaScript | /025. Secuencias de escape en JavaScript.js | UTF-8 | 530 | 3.421875 | 3 | [] | no_license | /*
Secuencias de escape en JavaScript.
*/
/*
Código | Resultado
------------------
\' Comilla Simple
\" Comilla Doble
\\ Barra invertida
\n Línea Nueva
\r Retorno de Carro
\t Tabulación
\b Retroceso
\f Salto de Página
*/
let objetivo;
objetivo = "Aprender \'JavaScript\'";
c... | true |
709c52f5b1790c97ce66c62c41a8b3765926a6ce | JavaScript | thedevelopnik/map-filter-reduce-exercises | /reduce/core.js | UTF-8 | 371 | 2.8125 | 3 | [] | no_license | function sum (array) {
return array.reduce(function(prev, cur) {
return prev + cur;
});
}
function productAll (array) {
// your code here
}
function objectify (array) {
// your code here
}
function luckyNumbers (array) {
// your code here
}
module.exports = {
sum: sum,
productAll: productAll,
ob... | true |
6bae04ace780853edb4113303f7da8b495ab8c60 | JavaScript | ExtremeLVL9001-DODO/website | /web/assets/scripts/animation-controls.js | UTF-8 | 2,654 | 3.15625 | 3 | [] | no_license |
// init global vars
var displayArea;
var Mottolist = [ `Experience Local Classes`,
`Find Your Passion`,
'Make New Friends',
`Find Fun Classes Near You!`,
`Revolutionize Your Hobbies`,
'Make $ Sharing your Passion'
... | true |
529bfd331916dcbfff87c5a3f27b03d02cc3ee17 | JavaScript | NicoAdams/vee | /scripts/gameWindowInit.js | UTF-8 | 503 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | /* This is dumb but necessary to get 'require' calls to work right
*
* (TLDR: The first js file loaded by index.html thinks its in directory "vee",
* and every consecutive one thinks it's in directory "vee/scripts". So this
* js file is the throwaway that thinks it's in "vee" so that every file
* following thinks ... | true |
9ec18f46ea3627ff867b65b5cd75b3ba596349a8 | JavaScript | Debbykalu/Variables.js | /variables.js | UTF-8 | 727 | 4 | 4 | [] | no_license | /*Var can be globally access while Const and Let cannot be access globally.
Var is a functioning scope while Const and Let is a block-scoped.
Let and Var works the same way when used in a function block.
Var variables can be redeclared or reassigned but Let variables cannot be redeclared in the same scope, Const variab... | true |
9f8c8c4112841504eb7f36fb40dcc56c2cdd2c24 | JavaScript | bganderson95/blake-app | /src/store/actions/groups.js | UTF-8 | 1,801 | 2.59375 | 3 | [] | no_license | import * as actionTypes from "./actionTypes";
import axios from "../../axios";
//SELECT GROUP
export const selectGroup = groupId => {
return {
type: actionTypes.SELECT_GROUP,
groupId: groupId
};
};
//FETCH GROUPS
export const fetchGroupsStart = () => {
return {
type: actionTypes.FETCH_GROUPS_START
... | true |
f236b952efe5e065c285a5d0b76987a83a76158c | JavaScript | alessandroaw/electronic-medical-record | /server/models/dokter.js | UTF-8 | 1,492 | 2.609375 | 3 | [] | no_license | const validator = require('validator');
const mongoose = require('mongoose');
const _ = require('lodash');
const bcrypt = require('bcryptjs');
var DokterSchema = new mongoose.Schema({
nama:{
type: String,
required: true,
minlength: 1,
trim: true
},
email:{
type: String,
required: true,
minlength: 1,
... | true |
7175c79fe1d4e8e494611d31b0c818182146e4ae | JavaScript | Seneca-CDOT/RealCameras | /SourceCode/CircularProgressControl.js | UTF-8 | 4,234 | 2.96875 | 3 | [] | no_license |
var Application = Application || {};
Application.CircularProgressControl = (function(){
function CircularProgressControl () {
this.canvas = document.createElement('canvas');
this.ctx = this.canvas.getContext('2d');
this.halfPI = 1.5707963267948966;
this.twoPI = 6.283185307179586;
this.radius = 15;
th... | true |
43d50a2720d0cf549011bddff522b810d7b4edcc | JavaScript | DannyPadron09/Speed-Maze | /src/Leaderboard/UpvoteButton.js | UTF-8 | 522 | 2.625 | 3 | [] | no_license | // import React from 'react'
// class UpvoteButtons extends React.Component {
// constructor(props) {
// super(props)
// this.state = { i: 0 }
// }
// updateCount = () => {
// this.setState(prvState => ({
// i: prvState.i + 1
// }))
// }
// render() {
/... | true |
00010bf47b188c4766b73f842752d4b43e47a101 | JavaScript | laismatie/CPW3_2020_1 | /Atividade1/src/js/controller/ValidacaoController.js | UTF-8 | 2,990 | 3.421875 | 3 | [] | no_license | export default class validacaoController{
validaCPF(cpf){
cpf = cpf.replace(/[.-]/g,'');
console.log(cpf);
var soma;
var resto;
soma = 0;
if ( !cpf || cpf.length != 11 || cpf == "00000000000"
|| cpf == "11111111111" || cpf == "22222222222"
|| cpf == "33333333333... | true |
7a0fa5f8dcaa92765888ae492327ead12f82753f | JavaScript | xiaolin18/vue-single | /index1.js | UTF-8 | 1,053 | 3.5 | 4 | [] | no_license | /**
* @description 响应式基本原理 第一步
*
**/
// 模拟视图更新
function cb(newValue) {
console.log('视图更新啦~' + newValue);
}
// 属性响应式化
function responsiveObj(obj, key, value) {
Object.defineProperty(obj, key, {
// 属性可枚举
enumerable: true,
// 属性可被修改或删除
configurable: true,
get: function responsiveGet() {
... | true |
bb655b1618f125083bd03c31abe858b65ac09604 | JavaScript | Arxcis/MyPortfolio | /javascript/cells_p5/sketch.js | UTF-8 | 624 | 3.3125 | 3 | [] | no_license | var cells = [];
function setup() {
createCanvas(800, 800);
frameRate(120);
cells.push(new Cell());
cells.push(new Cell());
}
function draw() {
background(51);
for(var i = 0; i < cells.length; i++) {
cells[i].move();
cells[i].show();
}
}
function mousePressed() {
noStro... | true |
70ac145d85f91f8e9ca104ff989d14f2ea58e1ba | JavaScript | khoitd1997/qt_signal_analyzer | /qt/qt_signal_analyzer/qml/LiveTab/ScopeView/ScopeView.js | UTF-8 | 970 | 2.515625 | 3 | [] | no_license | function updateGraph(chartViewObj, serieIndex, xAxis) {
if (chartViewObj.serieList[serieIndex].visible) {
var serie = chartViewObj.serieList[serieIndex]
// var xAxis = chartViewObj.xAxis
xAxis.min += serie.at(serie.count - 1).x + 5 - xAxis.max;
xAxis.max += serie.at(serie.count - 1).... | true |
5ae66cdbd78233bb9b6e9f4e09607d572374e50c | JavaScript | JinTianGuoNian/web_print_service | /printWin/demo/jkPrint.js | UTF-8 | 2,411 | 2.609375 | 3 | [] | no_license | function jkPrintSend(paperWidth, paperHeight, printerName, pages,successFun,errorFun) {
var query = "http://127.0.0.1:19999/";
if (paperWidth >0 && paperHeight>0) {
query = query + "?paperWidth=" + paperWidth + "&paperHeight=" + paperHeight;
}
if (printerName != undefined && printerName != "") ... | true |
8333f82a3a3ec7102232adcd36c1148cc22d9c2c | JavaScript | mcirami/StockSite | /HarvardShuttleGame/js/service.js | UTF-8 | 16,587 | 3.1875 | 3 | [] | no_license | /**
* service.js
*
* Computer Science 50
* Problem Set 8
*
* Implements a shuttle service.
*/
// default height
var HEIGHT = 0.8;
// default latitude
var LATITUDE = 42.3745615030193;
// default longitude
var LONGITUDE = -71.11803936751632;
// default heading
var HEADING = 1.757197490907891;
// default numbe... | true |
af0cc95663cd4b74cedc2f58c37e2b38c00c4c64 | JavaScript | RegularGuy1998/MinhDuc-Web-13 | /JavaScript/Day 1 . 20.6/js-practices/Practice3/generatePractice.js | UTF-8 | 873 | 3.40625 | 3 | [] | no_license | 'use strict'
function generate(testLengthArray){
let arr = []; // syntax array;
for (let i = 0; i < testLengthArray.length; i++) {
let len = testLengthArray[i];
let input = [];
for (let j = 0; j < len; j++) {
input.push(Math.floor((Math.random()*20000)-10000));
}
let target;
if (i ===... | true |
c7288c49fa80bfe7fe1656949d18117db85c94c0 | JavaScript | scareaphina/JavaScript_practice | /udemy/practice.js | UTF-8 | 4,808 | 4.09375 | 4 | [] | no_license | //playing around with alerts and simple string fiddling
var name = prompt("What is your name?");
var firstChar = name.slice(0,1);
var nameIntCaps = firstChar.toUpperCase();
var restOfName = name.slice(1,name.length);
var nameFullLower = restOfName.toLowerCase();
var newName = nameIntCaps + nameFullLower;
alert("... | true |
75851203af281d637dfa8d2694a933bcab7f5793 | JavaScript | Sree-001/gitwars | /src/containers/main.jsx | UTF-8 | 2,815 | 2.640625 | 3 | [] | no_license | import React, { Component } from "react";
// import { Route, Switch } from "react-router-dom";
// import Ninja from "../components/ninja";
import axios from "axios";
import Home from "./home";
import Winner from './winner';
const url = "https://api.github.com/users";
class Main extends Component {
state = {
user... | true |
0df043eed2bf2e54c7575f69053c7fe65bd37123 | JavaScript | nspragg/pipes | /test/pipes.js | UTF-8 | 5,298 | 2.6875 | 3 | [] | no_license | const _ = require('../src/pipes');
const assert = require('assert');
const fs = require('fs');
const request = require('request');
const sinon = require('sinon');
const LORUM_IP_SUM = __dirname + '/fixtures/loremIpSum.txt';
const BINARY_FILE = __dirname + '/fixtures/binaryFile';
const LORUM_IP_SUM_GZ = __dirname + '/f... | true |
9bb70c114cf956354a44efbe05e75a84a2df0afd | JavaScript | Miltonr87/Alurabank-Typescript | /dist/js/models/negociacao-controller.js | UTF-8 | 393 | 2.734375 | 3 | [] | no_license | export class NegociacaoController {
constructor() {
this.inputData = document.querySelector('#data');
this.inputQuantidade = document.querySelector('#quantidade');
this.inputValor = document.querySelector('#valor');
}
adiciona() {
console.log(this.inputData);
console.... | true |
e1582ecc14cc785059b9ca5e22fe502e146f6a07 | JavaScript | AkashNemade16/VisualSorting | /src/Algorithms/insertionSort.js | UTF-8 | 393 | 3.703125 | 4 | [] | no_license | export function Insertion(array){
for(let i=1;i<array.length;i++){
let j = i;
while(j>0&&array[j]<array[j-1]){
let temp = array[j];
array[j] = array[j-1];
array[j-1] = temp;
j-=1;
}
}return array;
}
const a = [];
for(var i=0; i<100; i++){
... | true |
f4a0f773ecdda42fbb2ef56194a13f0c6c6c1db1 | JavaScript | hdennen/surf-commentary | /domain/commentaryGenerator.js | UTF-8 | 2,488 | 3.21875 | 3 | [] | no_license | import * as words from './words/words';
import {generateRandom} from '../tools/utils';
export class CommentaryGenerator {
constructor() {
console.log('instantiated CommentaryGenerator');
console.log(words)
}
subjectAction(surfer = 'he') {
const actionIndex = generateRandom(words.a... | true |
2f91420e37f8c7539e992ed9d7295a3a6a964016 | JavaScript | CLooker/LeetCode | /letter-combinations-of-a-phone-number.js | UTF-8 | 1,589 | 3.4375 | 3 | [] | no_license | // https://leetcode.com/problems/letter-combinations-of-a-phone-number/
const compose = (...fns) => data =>
fns.reduceRight((updatedData, fn) => fn(updatedData), data);
const getAllCombinations = ({ beginnings, endings }) => other => {
if (!beginnings) beginnings = other;
if (!endings) endings = other;
retur... | true |
93f92a24c432fef17420ae62943a972c58f87798 | JavaScript | apollon313131/Cosmetichka31 | /public/js/nav.js | UTF-8 | 1,913 | 2.703125 | 3 | [] | no_license |
$("nav div").click(function() {
$(".ul_top").slideToggle();
$("ul ul").css("display", "none");
});
$('ul li').click(function() {
$('ul ul').slideUp();
$(this).find('ul').slideToggle();
});
$(window).resize(function(){
if($(window).width() > 768) {
$('.ul_top').removeAttr('style'... | true |
9ac5eb7a3f1212ff5789c2392c6df9d4277c034a | JavaScript | Freivincampbell/javascript | /11-objects/js.js | UTF-8 | 434 | 3.890625 | 4 | [
"MIT"
] | permissive | let car;
car = { type:"Fiat", model:"500", color:"white" };
console.log(car);
//Object Definition
let person = {
firstName:"John",
lastName:"Doe",
age:50,
eyeColor:"blue"
};
console.log(person.firstName);
let person2 = {
firstName: "John",
lastName : "Doe",
id : 5566,
fullNam... | true |
1743f9d77c8639a1761bb058ebe0a20593b65974 | JavaScript | toure5013/javascript-debutant---beginner-javascript---quelques-exercices-en-javascript | /04 Calculatrice Scientifique/calculatrice.js | UTF-8 | 5,606 | 3.3125 | 3 | [] | no_license | //numero
function un(){
var x = document.getElementById("un").value;
var valeur = document.getElementById("resultat").value;
document.getElementById("resultat").value = valeur + x;
}
function deux(){
var x = document.getElementById("deux").value;
var valeur = document.getElementById("resultat").v... | true |
688e51836182db846f4d5a197e2edf097f8ee050 | JavaScript | wjr1005/coingame | /client-web/games/dice/dice.js | UTF-8 | 16,496 | 2.515625 | 3 | [] | no_license | define(function(){
var config = {
my :{
username : '',
balance : 0
},
bet : {
house_edge : 0.01,
max_win_odds : 98,
min_win_odds : 0.0001
}
};
var COIN = 100000000;
var g_is_lock_bet = 1;
var Timer;
var c... | true |
4728a4d580dfdd0dd918c1606795355988c7bfaf | JavaScript | Utkarsh-969/ReactHooks | /src/useCounter.js | UTF-8 | 268 | 2.765625 | 3 | [] | no_license | import React,{useState} from "react"
export const Counter = () => {
const[count1,setCounter] = useState(0)
function countHandler () {
setCounter(count1+1);
}
return(
<button onClick={countHandler}>Cliked {count1} times</button>
)
} | true |
47adec47d5b2d1ad8f5bb308fe844644d0d5d85b | JavaScript | find404/ThreeAjax | /index.js | UTF-8 | 1,614 | 2.515625 | 3 | [] | no_license |
//主题部分。
var ThreeAjax = {
Interactive : [],
Send : (function(){
var Url = (this.Interactive[0].Url==undefined) ? window.location.pathname : this.Interactive[0].Url;
var Operation = (this.Interactive[0].Operation==undefined) ? 'post' : this.Interactive[0].Operation;
... | true |
5055a54874c848293db5b406f207cb5f177c635c | JavaScript | TatyanaSirenko15/TatyanaSirenko15.github.io | /js/graph.js | UTF-8 | 7,312 | 3.4375 | 3 | [] | no_license | class Graph {
constructor(canvas) {
this.ctx = canvas.getContext("2d");
this._edges = [];
this._loops = [];
this._vertexes = [];
}
get edges() {
return this._edges;
}
get loops() {
return this._loops;
}
get vertexes() {
return this._vertexes;
}
/* VERTEXES */
createV... | true |
8246f3b817923f8e5746d984c9515511478909f0 | JavaScript | SupaluckN/Search-Images-Via-Unsplash | /app.js | UTF-8 | 1,661 | 3.421875 | 3 | [] | no_license | (() => {
// Append Image Element.
function appendImg(keyword, index) {
const createImg = document.createElement('img');
createImg.src = `https://source.unsplash.com/400x225/?${keyword}&sig=${index}`;
const galleryDiv = document.querySelector('.gallery');
galleryDiv.appendChild... | true |
41f3f9cd0f334ad74fab7943cbcf6cb569c3f23f | JavaScript | RobotikUTT/eurobot-core | /src/communication/packets/OdometryPacket.js | UTF-8 | 1,062 | 2.765625 | 3 | [] | no_license | import Packet from './Packet';
const PACKET_NUMBER = 2;
const PACKET_LENGTH = 12;
/**
* Packet used to request the odometry state and store
* the response packet
*/
class OdometryPacket extends Packet {
/**
* Constructor
*/
constructor() {
super();
this.packetNumber = PACKET_N... | true |
6ad51f9285d4827e6b1694c36cad9999a7eb8f99 | JavaScript | LastCoder0/JavascriptLibrary | /referenceTypes.js | UTF-8 | 554 | 3.625 | 4 | [] | no_license | //primitive tipler
let age=32;
let newAge=age;
age=40;
console.log(age,newAge);
let name = "Cihat";
let newName= name;
name ="Mert";
console.log(name,newName);
//Referans tipli array object
let colors=['red','green'];
let newColors=colors;
colors.push('blue');
colors.push('grey');
console.log(colors,newColors);
let st... | true |