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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
623ed660d89a93b43dec989ce41ece865ecd5178 | JavaScript | elbitapmoC/js-2021-cc | /s5/es6-classes.js | UTF-8 | 797 | 4.15625 | 4 | [] | no_license | class Person {
constructor(fN, lN, dob) {
this.firstName = fN;
this.lastName = lN;
this.dob = new Date(dob);
}
greeting() {
return `Hello, ${this.firstName} we're glad you made it here safe.`
}
calcAge() {
const diff = Date.now() - this.dob.getTime();
const ageDate = new Date(diff);
... | true |
db3113f9351671d3d3850ad8809db8779b846e9c | JavaScript | BeIntrepid/dash-docs | /src/samples/pipes/PipeWithInput.js | UTF-8 | 236 | 2.609375 | 3 | [
"MIT"
] | permissive | export class PipeWithInput {
// todo - perhaps this could be moved to a base class
activate(model){
this.title = model.title;
this.sample();
}
sample(){
// I bet you want to know how to do pipes with inputs
}
}
| true |
15185c25bdb3493ee18964112f9a10316bee82a8 | JavaScript | MHMighani/memory-game | /script.js | UTF-8 | 2,602 | 2.765625 | 3 | [] | no_license | const CARDSARRAY = [
{
name:"amelia",
img:"images/amelia-close-350_40071288.jpg"
},
{
name:"blackRose",
img:"images/Black_Roses_Tinted_350.jpg"
},
{
name:"bluePink",
img:"images/Blue-Pink-Purple1-350_85e15aa1.jpg"
},
{
name:"blueTinted",
img:"images/Blue_Tinted_Roses_Close_... | true |
773412942fff6fbd41564db3e6d5ea409da81658 | JavaScript | hertzg/front-node | /files/js/CloseButton.js | UTF-8 | 433 | 2.6875 | 3 | [] | no_license | function CloseButton (listener) {
var button = document.createElement('button')
button.className = 'CloseButton'
button.appendChild(document.createTextNode('Close \xd7'))
button.addEventListener('click', listener)
return {
element: button,
disable: function () {
button.... | true |
cdd7efefddf62f1a1b4f9844b36a5b465b2099bf | JavaScript | project-clim-app/climApp | /controllers/search.controller.js | UTF-8 | 1,786 | 2.578125 | 3 | [] | no_license | const data = require('../data/aemet-locations.json');
const weatherService = require('../services/weather.service');
const passport = require('passport');
const User = require('../models/user.model');
const Places = require('../models/places.model');
// const mongoose = require('mongoose');
const Clime = require(... | true |
006cb45ab57875d98ef761815fc06a426e8dd3eb | JavaScript | prototypefund/approxi | /src/util/math/power.js | UTF-8 | 123 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | export function power(n) {
return Math.floor(Math.log(+n) / Math.LN10);
};
export function int(n) {
return ~~(+n);
};
| true |
1c573e128b716c9c0f66f74334cb5dd1f76c45c6 | JavaScript | saullobueno/gobarber | /mobile/src/components/DateInput/index.ios.js | UTF-8 | 1,579 | 2.609375 | 3 | [
"MIT"
] | permissive | import React, { useState, useMemo } from 'react';
// importando o componente de data do IOS
import { DatePickerIOS } from 'react-native';
import { format } from 'date-fns';
import pt from 'date-fns/locale/pt';
import Icon from 'react-native-vector-icons/MaterialIcons';
import { Container, DateButton, DateText, Picker... | true |
45f2d924b92ad66da624f0eb304c02d9ace1150d | JavaScript | pdl/regexp-capture-interpolation | /test/test.js | UTF-8 | 4,847 | 2.53125 | 3 | [
"MIT"
] | permissive | var test = require ('tape');
var Interpolator = require('../lib/index.js');
var suite = [
{
"why" : "Empty string replacement produces empty string",
"matchObject" : [],
"replacement" : "",
"expected" : ""
},
{
"why" : "Can interpolate $1, $2",
"matchObject" : ["foo, ba... | true |
f21f05b5c326aa4d628e237f504e2ea5a81ca544 | JavaScript | cfpb/ccdb5-ui | /src/components/RefineBar/Select.js | UTF-8 | 2,085 | 2.703125 | 3 | [
"CC0-1.0"
] | permissive | import PropTypes from 'prop-types';
import React, { useMemo } from 'react';
export const Select = ({ id, handleChange, label, title, value, values }) => {
const idSelect = 'select-' + id;
const vals = useMemo(() => {
// different cases that values can me:
// Array
// handle cases where an array of sing... | true |
5cb25b80d10f261dc3ea245f9192ed710ad9db86 | JavaScript | remy-auricoste/adriatik | /src/model/newModel/fsm/MachineBuilder.spec.js | UTF-8 | 3,879 | 3.171875 | 3 | [] | no_license | const MachineBuilder = require("./MachineBuilder");
describe("MachineBuilder class", () => {
it("should execute 1 simple step", () => {
let machine = new MachineBuilder()
.step({
name: "step1",
action: ({ value }) => {
return { value: value + 1 };
},
condition: ({ ... | true |
d98b0a3b400598ec1e4121b07f129e5b2b4fdf16 | JavaScript | anyaPinchuk/contactDirectory | /WebSide/src/main/webapp/web-resources/scripts/mail.js | UTF-8 | 830 | 2.734375 | 3 | [] | no_license | var form = document.forms[0];
form.template.addEventListener("change", fillContent);
function fillContent() {
var selectedOption = form.template.options[form.template.selectedIndex];
form.content.value = selectedOption.attributes.label.textContent;
form.content.disabled = selectedOption.attributes.label.te... | true |
583cbf4f1196dd94de8e3eb739b681ca1f55bf4f | JavaScript | thaysonpinheiro/securedbx | /securedbx/web/scripts/gauge/dist/graphs.js | UTF-8 | 1,305 | 3.046875 | 3 | [
"MIT"
] | permissive | function update(color) {
var opts = {
lines: 12, // The number of lines to draw
angle: 0, // The length of each line
lineWidth: 0.12, // The line thickness
pointer: {
length: 0.78, // The radius of the inner circle
strokeWidth: 0.042, // The rotation offset
... | true |
17a787a98e7cd2b97fe2a048001445414006c06c | JavaScript | mauroBus/charty | /src/utils/datavalidator/datavalidator.js | UTF-8 | 2,078 | 2.90625 | 3 | [] | no_license | /**
* Data checker for different data input
*
* @class DataValidator
* @requires d3,
* underscore
*
* @author "Marcio Caraballo <marcio.caraballososa@gmail.com>"
*/
(function(root, factory) {
/** Setting up AMD support*/
if (typeof define === 'function' && define.amd) {
/** AMD */
... | true |
c9072cd3fcccea9e29b4dfc55f3dfc409f0d6739 | JavaScript | hemstreet/Planning-Poker | /app/lib/services/room/roomService.js | UTF-8 | 2,691 | 2.671875 | 3 | [
"MIT"
] | permissive | "use strict";
(function () {
angular.module('planningPoker').service('roomService', ['$q', 'socket', 'userService', roomService]);
function roomService($q, socket, userService) {
this.currentRoom = null;
this.setCurrentRoom = function(id) {
this.currentRoom = id;
retu... | true |
1eb9a8199b43b201ab52f73b32c96812e1051bc3 | JavaScript | shofol1/movie-theater | /js/movie.js | UTF-8 | 1,511 | 3.109375 | 3 | [] | no_license |
// image api
// https://image.tmdb.org/t/p/original/2CAL2433ZeIihfX1Hb2139CX0pW.jpg
fetch('https://api.themoviedb.org/3/movie/top_rated?api_key=f21c768c8fcf8ec5e953778305a09cb7')
.then(res=>res.json()
.then(data=>setMovies(data.results)));
const setMovies=movies=>{
const movieRow=document.getElementById('movie... | true |
e82324beaf397ffe35b13b0772d714606068c3cc | JavaScript | euguilhermegirardi/Rocketseat-Intro-Level-1 | /frontend/src/App.js | UTF-8 | 1,363 | 2.859375 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import './App.css';
import backgroundImage from './assets/harley.jpg';
import Header from './components/Header';
import api from './services/api';
function App() {
const [projects, setProjects] = useState([]);
useEffect(() => {
api.get('projects').then(resp... | true |
c3a28badf46f804b6c12f759dee72fdd4e982556 | JavaScript | atherdon/house-lp | /assets/js/slider.js | UTF-8 | 4,694 | 2.671875 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
// Put slider into variable to use public functions
var gallerySlider2 = $('#bxslider').bxSlider({
pager: false,
easing: 'easeInOutQuint',
infiniteLoop: false,
speed: 500,
auto: false,
slideWidth: 500,
// auto: true,
... | true |
25773523811e2082dec05c6f7d6bf279c164dea9 | JavaScript | oleguer531/todolist | /src/components/AddTask.js | UTF-8 | 1,756 | 2.625 | 3 | [] | no_license | import React from "react";
const renderCategoriesList = categories => categories.map(cat =>
<option value={cat.hash}>{cat.title}</option>
)
class AddTask extends React.Component {
constructor(props) {
super(props);
this.state = {
task: null,
category: null,
isCompleted: false,
}
}... | true |
dcc5f85bfa7c1aea1561e91de60bc44109a21e41 | JavaScript | rkgallaway/archive-201 | /201d47/Trae/lab7/Lab-06/app.js | UTF-8 | 3,904 | 3.53125 | 4 | [] | no_license | 'use strict';
//each element should be separate strings, add location string
var hours = ['6am', '7am', '8am', '9am', '10am', '11am', '12pm', '1pm', '2pm', '3pm', '4pm', '5pm', '6pm', '7pm', '8pm'];
function getRandomIntNumber(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math... | true |
e616329a3252acd783dd82e5f7fbfba98431cf0f | JavaScript | yerle89/ferratin | /Seminario1/carrito_module.js | UTF-8 | 1,460 | 2.703125 | 3 | [] | no_license | const products_db = require('./database');
let available_products = new Map();
const cart_products = new Map();
exports.get_available_products = async function () {
const products = await products_db.get_products();
products.forEach(product => {
available_products.set(product._id, product);
});
... | true |
44d8f4514f8c64bbb1374cb60e6ca8d0d09ae178 | JavaScript | teencoderPro/pro-c34 | /sketch.js | UTF-8 | 1,322 | 2.71875 | 3 | [] | no_license | const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const body = Matter.body;
const Body = Matter.Body;
var ground;
var divisionsHeight=300;
var particles=[];
var plinkos=[];
var divisions=[];
function setup() {
createCanvas(480,800);
engine = Engine.create();... | true |
050c0db40b82062a4fb318bcafd5dab3afee519e | JavaScript | ducquanbn/tfs-03 | /les_05/drop.js | UTF-8 | 114 | 2.9375 | 3 | [] | no_license |
drop = [1,2,5,5,8,6,7]
let drops = drop.filter(e => e > 3);
console.log(drops)
// Test: [ 5, 5, 8, 6, 7 ]
| true |
722a362868aab50dffdbd6d6beb31c955d1dc2d0 | JavaScript | 2222-42/jihou-gisou-gs | /gs_file/postMessage.gs | UTF-8 | 1,190 | 2.875 | 3 | [
"MIT"
] | permissive | function sendToSlack() {
// To behave as user, use OAuth Access Token which has `chat:write` of User Token Scopes.
const url = "https://slack.com/api/chat.postMessage?token=xxx-xxxx-xxx-xxx-xxx"
const headers = {
"contentType" : "application/json",
}
// Insert your messages.
var sample_message = ['Hi B... | true |
3ba8dc58f103f9a867f5af3e8b6aad0f984fbe5f | JavaScript | MyBalaOrg/AMT | /STG/unpackaged/aura/Peak_Base/Peak_BaseHelper.js | UTF-8 | 2,168 | 2.625 | 3 | [] | no_license | /**
* Edited by Joe Callin on 8/12/2017.
*/
({
getSitePrefix: function(component) {
var action = component.get("c.getSitePrefix");
action.setCallback(this, function(actionResult) {
var sitePrefix = actionResult.getReturnValue();
component.set("v.sitePrefix", sitePrefix);
... | true |
d3ea41bcc6be7327cb818b0f7a14148437f509b4 | JavaScript | SwethaVanga/MultiplicationApp | /src/components/MultiplicationGrid.js | UTF-8 | 1,067 | 2.6875 | 3 | [] | no_license | import React, { useState } from 'react'
import { Container, Row } from 'react-bootstrap'
import { MAX_NUMBER } from '../utils/config'
import { getNumbers, getMultiplesFromRange } from '../utils/numbers'
export const MultiplicationGrid = () => {
let [multiples, setMultiples] = useState([])
const numbers = getNumber... | true |
a02c591b5376537e4ebd6a04fd1731fa0652b579 | JavaScript | j-fro/react-todo | /app/containers/MainContainer.js | UTF-8 | 922 | 2.578125 | 3 | [] | no_license | const React = require('react');
const Main = require('../components/Main');
let MainContainer = React.createClass({
getInitialState: () => {
return { newTodo: '', todos: [] };
},
componentDidMount: function() {
this.setState({
todos: this.props.todos
});
},
handl... | true |
182e36224ca4ad1d7fd0de426158c342ccfed6b8 | JavaScript | Gimmay/Meeting | /Project/Resource/Script/jQuery/step/step.js | UTF-8 | 2,633 | 2.875 | 3 | [] | no_license | try{
/*
* 更新日志
*
* Version 1.00 0000-00-00 00:00
* 初始版本
*
*/
(function($){
/**
* 组件模板
*步骤插件
*
* @created 2016-12-29 8:00
* @updated 2016-12-29 15:00
* @author Iceman
* @version 1.00
* @param options 组件参数 {'message':'xxxxxxxxx!'}
* @returns {$.fn.Iceman}
* @constructor
*... | true |
b8c7aeb2fc6b1c0a8d651aa939e529ef45d2e9d9 | JavaScript | DebanjanBarman/skillgear | /controllers/courseController.js | UTF-8 | 1,952 | 2.53125 | 3 | [] | no_license | const Course = require("./../models/courseModel");
const catchAsync = require('../utils/catchAsync')
const AppError = require("../utils/appError");
exports.getAllCourses = catchAsync(async (req, res, next) => {
//Build query
// 1) Filtering
const queryObj = {...req.query};
const excludedFields = ['page', 'sort', '... | true |
25792f9e90dabc6f31347473c41ab24cf8eef489 | JavaScript | bennettscience/gas-canvasapi | /src/modules/PaginatedList.js | UTF-8 | 2,602 | 3.171875 | 3 | [
"MIT"
] | permissive | import {parseLinkHeader_} from './Utils.js';
/**
* Abstract the Canvas paginatied results
* https://canvas.instructure.com/doc/api/file.pagination.html
*
* Sometimes Canvas returns an object key instead of an array directly. The
* `root` param is used in these cases to access the array.
*
* @param {object} i... | true |
331a01306e971ed671fbd040baa35eeb91523074 | JavaScript | jonstuebe/website-next | /cli.js | UTF-8 | 1,907 | 3 | 3 | [] | no_license | const fs = require("fs");
const path = require("path");
const slugify = require("slugify");
const chalk = require("chalk");
const { isObject } = require("lodash");
const prompts = require("prompts");
function toFrontMatter(obj, fields = []) {
const bookends = "---";
const data = fields
.map((field) => {
... | true |
0d7ec47a49b26281fcf81295df6dcb3fb882e8a1 | JavaScript | EdgarHSalinas/mini-apps-1 | /challenge_2/server.js | UTF-8 | 882 | 2.59375 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const json2csv = require('json2csv').parse;
const fields = ['firstName', 'lastName', 'county', 'city', 'role', 'sales'];
const opts = { fields }
const app = express();
app.use(express.static('./client'))
console.log('client ****');
// cr... | true |
09f0336e77c3a78f137cca3adc290bb9b6262a50 | JavaScript | ryanhsin0508/ec-vue | /js/common.js | UTF-8 | 621 | 2.515625 | 3 | [] | no_license | /*function getToken() {
return $.ajax({
async: false,
type: "POST", //GET, POST, PUT
url: `${apiHost}Api/lssue` //the url to call
}).done((res) => {}).fail(function(err) {
//Error during request
}).responseText;
}*/
// var token = getToken();
function getData(url){
return JSON.parse($.ajax({
... | true |
dbc6d353e37a2b04be3dde370f0db79da5a22ee2 | JavaScript | PixelRifts/moobot-mitra | /commands/play.js | UTF-8 | 1,626 | 2.609375 | 3 | [
"MIT"
] | permissive | module.exports = {
name: 'play',
description: '',
args: true,
cooldown: 2,
expected: '/play [SuperSection] <Your Move>',
execute(message, args) {
let finishedGame;
for (let game of global.RunningMTTGames) {
if (game.p1 == message.author || game.p2 == message.author) {... | true |
161e8a05d26248714b1a908f1a2f59eef342227d | JavaScript | megjc/megjc-corporate-intranet | /public/app/modules/help-desk/help.controller.js | UTF-8 | 2,376 | 2.578125 | 3 | [] | no_license | (function(){
angular
.module('help')
.controller('HelpDesk', HelpDesk);
HelpDesk.$inject = ['$scope', '$http', 'helpDeskService'];
function HelpDesk($scope, $http, helpDeskService){
var vm = this;
vm.open_tickets = true;
vm.closed_tickets = false;
vm.create_ticket = false;
vm.message = false;
vm.dism... | true |
d2bd4859adb8472cdc747e68f4ba4d4316aeee03 | JavaScript | soniaperezg21/react-course-2-expensify-app | /src/firebase/firebase.js | UTF-8 | 5,378 | 2.890625 | 3 | [] | no_license | //import * as firebase from 'firebase'; //Con el * me traigo todo (DA ERROR EN ESTA VERSION)
import firebase from "firebase";
//<script src="https://www.gstatic.com/firebasejs/8.1.1/firebase-app.js"></script>
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is op... | true |
143c657ba46b1d0a8efd67ad43b08d044e609a7b | JavaScript | matthewpflueger/code-challenges | /server/knightstour/index.js | UTF-8 | 810 | 2.75 | 3 | [
"MIT"
] | permissive | 'use strict';
var readline = require('readline');
var _ = require('highland');
var Board = require('./board')();
var Knight = require('./knight')();
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
function nextBoard(rl, board) {
rl.question('Hit Enter to see next board ',... | true |
873c071060b306fe48f9ea0ada94049ce1d92a4a | JavaScript | Curvaderioou/js-estudos-gerais | /strings.js | UTF-8 | 519 | 4.28125 | 4 | [] | no_license | //variavel contendo string
//var nome = "Felipe"
//variavel contendo número dentro de string
//var num = "5"
// variade com sua idade
//var idade = 29
//duas variaveis, uma com nome e outra com sobrenome e some as duas
/*
var nome = "Felipe "
var sobrenome = "Portella"
console.log (nome + sobrenome)
*/
//coloque... | true |
324f25e939aa62f460c324be994faefcc5c5e12b | JavaScript | safwan-mansuri/codeforces-update | /index.js | UTF-8 | 1,377 | 2.6875 | 3 | [] | no_license | require('dotenv').config()
const cron = require('node-cron');
const http = require('http');
const axios = require('axios');
const client = require('twilio')(process.env.TWILIO_SID, process.env.TWILIO_TOKEN);
const sendMessage = async (contestToday) => {
let msg = '';
contestToday.forEach(element => {
msg += `Y... | true |
c4a5eb8ab7e2d4e2f490da489768f41f3ab5896d | JavaScript | nwangemann/to-do-list | /js/scripts.js | UTF-8 | 661 | 3.296875 | 3 | [] | no_license | var taskList = []
var count = 0;
$(document).ready(function(){
$("#todoForm").submit(function(event){
event.preventDefault();
var input = $("#todoInput").val();
var task1 = new Todo(input);
taskList.push(task1);
console.log(taskList);
$("#list").append("<li id='" + count + "'>" + "To do:" + "... | true |
6e8de5b1a683484611a112c0f40469c8c97bdeb3 | JavaScript | ArtsyArtys/Checkpoint-2-Finished | /00_runNumTimes/numNumTimes_spec.js | UTF-8 | 636 | 3.53125 | 4 | [] | no_license | /* eslint-env jasmine */
/* eslint-disable no-undef */
describe('runNumTimes function', () => {
it('takes a function as an argument, and runs that function num times', () => {
let myString = '';
runNumTimes(() => {
myString += 'hello';
return myString;
}, 3);
expect(myString).toEqual('he... | true |
d6bc854072aebfebc84786fb57fd9e7adc0a6669 | JavaScript | AlphaGit/circular-gallifreyan | /js/models/LetterDescriptor.js | UTF-8 | 1,394 | 2.78125 | 3 | [] | no_license | define(['models/BaselinePositions', 'models/Shapes', 'models/Decorations'],
function(BaselinePositions, Shapes, Decorations) {
var PUNCTUATION_SYMBOLS = ['.', '?', '!', '"', '\'', '-', ','];
function isPunctuation(letter) {
return PUNCTUATION_SYMBOLS.indexOf(letter) > -1;
}
var LetterDescriptor... | true |
a28758b44cefc9641ba33ca6dfc7ff325f815536 | JavaScript | zohl/inferno-state-observer | /src/inferno-state-observer.js | UTF-8 | 4,134 | 2.640625 | 3 | [] | no_license | // @flow
import Inferno from 'inferno';
type Action<State> = (s: State, d: Dispatch<State>) => void;
type Dispatch<State> = (a: Action<State>) => void;
type ObserverState = {
observer: {
enabled: bool
, watchPaths: Array<string>
, rootName: string
, delimiter: string
, ignore: RegExp
}
};
... | true |
378fbd11860753352e1253bb27723121080f7b89 | JavaScript | Dorkat0/fullstackopen_part5 | /src/components/NewBlogForm.js | UTF-8 | 1,860 | 2.625 | 3 | [] | no_license | import React, { useState } from 'react'
const NewBlogForm = ({
setNotificationMessage,
setErrorMessage,
blogService,
user,
setBlogs,
blogs,
newBlogFormRef
}) => {
const [title, setTitle] = useState('')
const [author, setAuthor] = useState('')
const [url, setUrl] = useState('')
const handleNewBlo... | true |
0c4b665e2cb11dac552c3bb5f0f8bf8af78fe740 | JavaScript | Ciria007/Ciria-Cardenas-A00367773 | /lab3/lab3.js | UTF-8 | 3,164 | 3.78125 | 4 | [] | no_license | //Ex 1
function mySquare() {
var number = prompt("Please enter a number");
if (number != null) {
var square=number*number;
var cube=number*number*number;
document.write("square: " + square + " "+"cube: " +cube);
}
}
//Ex 2
function myRand() {
var rand1=... | true |
65ae20c1c0c7ca7a0ab7b91af484e9c5b5849769 | JavaScript | winpeed/Commune-Landing-Page | /script.js | UTF-8 | 286 | 2.65625 | 3 | [] | no_license | let menuHamburger = document.getElementsByClassName("menu");
let hamburger = document.getElementsByClassName("hamburger");
let navBar = document.getElementsByClassName("nav-bar");
menuHamburger[0].addEventListener("click", function () {
navBar[0].classList.toggle("nav-toggle");
});
| true |
4b963460cb0fc015aea3a6d1b4313fb675e7d105 | JavaScript | zhihanzzh/Web-programming | /lab3/textMetrics.js | UTF-8 | 1,913 | 2.984375 | 3 | [] | no_license | module.exports = {
simplify: (text) => {
if (!text || typeof text !== 'string') {
throw 'need to provide a valid text input';
}
let str = text.toLowerCase();
str = str.replace(/\\n/g, " ").replace(/\\t/g, " ");
str = str.replace(/[^a-zA-Z\d]/g, " ").trim();
... | true |
d9c69307fd80e598826963e3020799c0a043d0df | JavaScript | vefforritun/vef1-2018 | /fyrirlestrar/08/daemi/number.js | UTF-8 | 448 | 3.25 | 3 | [] | no_license | console.log(1.25);
console.log(0.2 + 0.1); // 0.30000000000000004
console.log(1.25e6); // 1.25 * 10^6 = 1250000
console.log(9e999); // Infinity
console.log(1 / 0); // Infinity
console.log(10 % 2); // = 0, jöfntala skilar alltaf 0
console.log(11 % 2); // = 1, oddatala skilar alltaf 1
console.log(5 * 10 + 2); // 5... | true |
739c572a66fd614c067f4ff2e6bfb7e6df2d5fb5 | JavaScript | raj455/es6 | /let.js | UTF-8 | 198 | 2.84375 | 3 | [] | no_license | function vijay()
{
var a = true;
var b = 'vijay';
console.log('\n before:',b);
if(a){
var b = 'raj';
console.log('after:',b);
}
console.log(b);
}
vijay();
| true |
1c3aa79cdeffaa65e5deca4d11e229a026727153 | JavaScript | roxana-ahmadi/crud-datafilter | /src/js/storage/storage.js | UTF-8 | 4,747 | 2.578125 | 3 | [
"MIT"
] | permissive | /*
* Copyright (c) 2019-present, The Yumcoder Authors. All rights reserved.
*
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree.
*/
/* eslint-disable no-param-reassign */
class Storage {
constructor() {
// #todo check creation lifecycle
... | true |
d165e6d10e47ee9a75bd1678de5ed4cafc190f1f | JavaScript | karajsch/Fridge_For_All | /client/src/components/Inventory/SecondInventoryList.js | UTF-8 | 2,050 | 2.5625 | 3 | [
"MIT"
] | permissive | import React, {Component} from 'react';
import {Container, ListGroup, ListGroupItem, Button } from 'reactstrap';
import {CSSTransition, TransitionGroup } from 'react-transition-group';
import uuid from 'uuid';
class SecondInventoryList extends Component{
state = {
items: [
{ id: uuid(), name: '... | true |
44ea68a56e8fc5a1cbddefaf6cf9bc277c369abf | JavaScript | YushengLi/WebduinoXTelegram | /webduinobot.js | UTF-8 | 6,407 | 2.71875 | 3 | [
"MIT"
] | permissive | var Settings = require('./secrets.json');
const AdminID = Settings.Telegram.AdminID;
//
var Bot = require('telegram-api');
// require message types needed
var Message = require('telegram-api/types/Message');
var Question = require('telegram-api/types/Question');
var Keyboard = require('telegram-api/types/Keyboard'... | true |
0add852254109d471b6f3f4e5cda639b4bca9543 | JavaScript | danielkocsan/pulpojs | /worker.js | UTF-8 | 912 | 2.6875 | 3 | [] | no_license | var queue = require("./queueBuilder.js");
var deferred = require("deferred");
var startUp = 0 + process.env.startUp;
module.exports = function () {
console.log('worker ' + process.pid + ' started up, took ' + (Date.now() - startUp) + ' ms');
process.send('getIndex');
process.on('message', function (index... | true |
6875cef6b0eb0260e39b394d0e2c2c37e390891b | JavaScript | qlurkin/qlurkin.github.io | /docs/courses/python1ba/slides/slides2/uml.js | UTF-8 | 4,929 | 2.578125 | 3 | [] | no_license | import {SVG, Point} from 'https://cdnjs.cloudflare.com/ajax/libs/svg.js/3.1.1/svg.esm.min.js'
export { SVG, Point }
export function arrow(context) {
const size = 5
context.polyline([[-size, -size], [0, 0], [-size, +size]]).fill('none').stroke({color: 'black'})
}
export function backArrow(context) {
const si... | true |
b685bf3489714dedb173bc8a783502c125ef6937 | JavaScript | HvZWAT/claremontHvZ | /hvz/main/static/scripts/player_list.js | UTF-8 | 4,470 | 3.234375 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
"use strict";
var SCHOOL_COLUMN = 1;
var YEAR_COLUMN = 2;
var HUMAN_COLS = 4;
var ZOMBIE_COLS = 5;
function filterPlayers(players, text, column) {
var selects = [
[SCHOOL_COLUMN, $('#school')],
[YEAR_COLUMN, $('#gradyear')],
... | true |
e85d7acd40bf699ecac441ffdbf3445ca39e5de3 | JavaScript | IFRCGo/go-frontend | /src/root/reducers/email.js | UTF-8 | 642 | 2.5625 | 3 | [
"MIT"
] | permissive |
import { stateInflight, stateError } from '#utils/reducer-utils';
const initialState = {
fetching: false,
fetched: false,
receivedAt: null,
error: null
};
function email (state = initialState, action) {
switch (action.type) {
case 'SHOW_USERNAME_INFLIGHT':
state = stateInflight(state, action);
... | true |
ae0bef68c8d977473c7c9c5fc47aa134be83609e | JavaScript | blubberbo/dekline | /tools/sentence-validator.js | UTF-8 | 12,255 | 3.609375 | 4 | [] | no_license | // checks if a character is uppercase
// returns a boolean
const isUpperCase = (char) => {
return char === char.toUpperCase();
};
// makes the first character of a string uppercase
// returns a string
const firstCharToUpperCase = (string) => {
string[0] = string.charAt(0).toUpperCase();
return string;
};
// chec... | true |
5345cd97ccff5e6bab776a3bc45af19af79435f3 | JavaScript | manpreet77/git | /DSP/public_html/src/Implementation/Actions.js | UTF-8 | 1,183 | 2.609375 | 3 | [] | no_license |
function doNextAction (oldState, currEvent, action, newState) {
var newEvent, actionId;
switch (action){
case 'ac_prepare_work' : newEvent = ac_prepare_work (oldState, currEvent, action, newState); break;
case 'ac_kickoff_work' : newEvent = ac_kickoff_work (oldState, currEvent, ac... | true |
e49e53c928a73ae3b30e3fce269f2965e36cf60a | JavaScript | closer76/PrincessJump | /js/GameApp.js | UTF-8 | 4,925 | 2.625 | 3 | [] | no_license | var FPS = 60;
var FRAMEINTERVAL = 1000 / FPS;
var KMS_WIDTH = 16;
var KMS_HEIGHT = 12;
var V_ITERATION = 6;
var P_ITERATION = 2;
var GameApp = function() {
var that = {};
var gameData = null;
// 2D context
var canvas = null;
var ctx = null;
var view = {};
var pix_per_m = 1;
// Box2D objects
var ... | true |
b5813831a9923a8116bd6ef2e67ba5ba9dff1d93 | JavaScript | uk-gov-mirror/nhsdigital.nhs-login-prototype-admin-portal | /app/assets/javascript/main.js | UTF-8 | 488 | 2.671875 | 3 | [
"MIT"
] | permissive | // devmode function toggle
function toggleDevMode(){
const devModeButton = document.querySelector('#nhsuk-footer ul li a[href*=“#”]');
devModeButton.addEventListener('click', function (event) {
event.preventDefault();
if(window.location.href.indexOf('devMode=') === -1){
window.locati... | true |
680122f13e1c283e8769a49b816fe7e0fde8b822 | JavaScript | contesini/Hash-Teste-Front-end | /src/services/rateService.js | UTF-8 | 1,317 | 3.140625 | 3 | [] | no_license | function addEventCalculate() {
var mdr = document.getElementById('mdr').value
var price = document.getElementById('price').value
var instalments = document.getElementById('instalments').value
if (instalments > 12) {
document.getElementById('instalments').value = 12
instalments = 12... | true |
f1accc592709b3c7aa916f3fdd7bc27db3e85ec0 | JavaScript | KristijanCetina/PI-homeworks | /js-202.js | UTF-8 | 301 | 3.265625 | 3 | [] | no_license | // for (let i = 1; i <= 100; i++) {
// let f = i % 3 == 0,
// b = i % 5 == 0;
// console.log(f ? b ? "FizzBuzz" : "Fizz" : b ? "Buzz" : i);
// }
for (i = 0; i < 100;) console.log((++i % 3 ? '' : 'Fizz') + (i % 5 ? '' : 'Buzz') || i) // https://gist.github.com/jaysonrowe/1592432 | true |
c759a7504d8b463c4255175c508b4bf53f08b5e9 | JavaScript | Quo0/you-should-try-puppeteer | /demos/captcha/functions/slow-actions.js | UTF-8 | 739 | 2.671875 | 3 | [] | no_license | const slowType = async (selectorOrHandle, text, page, timeout = 2000) => {
const handle = typeof selectorOrHandle === 'string'
? await page.waitForSelector(selectorOrHandle)
: selectorOrHandle;
await page.waitFor(timeout);
await handle.hover();
await page.waitFor(timeout / 10);
... | true |
365adb574e2a8e44aadac815a5060ebdbfafb489 | JavaScript | Optibus/playback-js | /reference/playback/tape-cassettes/fs-tape-cassette.js | UTF-8 | 2,638 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* Tape-Cassette class - the small plastic box that contains the tape which has the recordings.
* This class is the file system implementation of a cassette
*/
const fs = require('fs');
const _ = require('lodash');
const path = require('path');
const AbstractTapeCassette = require('./abstract-tape-cassette');
c... | true |
3a04ab2660841b62856905ab437aae2d71c4190a | JavaScript | selamwoldu/MyFirstRepo | /WAP_LAB/Node/myFirstApp/FinalExam1/database_con.js | UTF-8 | 1,826 | 2.984375 | 3 | [] | no_license | var mysql=require('mysql');
var con=mysql.createConnection({
host:"localhost",
user:"root",
password:"root",
database:"bank",
});
con.connect((err)=>{
if(err) throw err;
console.log('database connected');
});
//select
exports.selectCustomer=(value,request,response)=>{
let inval=mysql.esc... | true |
71c2aa525f4cf576eee240e9fcb4e4e9848c44e5 | JavaScript | NikolayMantchev/JS-Advanced | /Documents/JavaScript-code/StudyCode/FUNDAMENTALS JS/02. Data Types and Variables/01. Lab/02.Right Place.js | UTF-8 | 196 | 2.796875 | 3 | [] | no_license | function solve (string1, char, string2){
let result = string1.replace('_', char);
let output = result === string2 ? 'Matched' : ' Not Matched';
console.log(output)
}
solve('Str_ng', 'i', 'String') | true |
57c9ea68762a14a815b562f8a54169da66850933 | JavaScript | adaojreess/api-otica-sao-paulo | /src/utils/generateSchedules.js | UTF-8 | 1,027 | 2.75 | 3 | [] | no_license | const moment = require('moment');
const listTimes = require('./listTimes');
module.exports = generateSchedules = (appointmentList, date) => {
let list = [];
appointmentList.forEach(schedule => {
var start = moment.unix(schedule.start.seconds).utc();
if (date.date() === start.date() && date.mon... | true |
b24e0130d8b7f6121b07ffd45a464fd7779ff26c | JavaScript | Gewalt79/SocketChatApplication | /src/JoinRoom.js | UTF-8 | 718 | 2.875 | 3 | [] | no_license | import React, { useRef } from "react";
export default function JoinRoom({socket, room, username}) {
const chatRoom = useRef()
// Получает основную комнату в которой находится юзер
socket.on("get_room", (rm) => {
chatRoom.current = rm
console.log(rm)
})
/... | true |
e5cc14149d807b9b68d1dc86f74bd5538913a835 | JavaScript | Ezequiel-CE/MD-LARIOJA-2021 | /fundamentos-js/clase-3/Objetos.js | UTF-8 | 980 | 4.3125 | 4 | [] | no_license | // Objetos Creación
// De forma literal
let persona = {
altura: 1.70,
edad: 28,
nombre: 'Pepito'
}
persona.cabello = 'negro'
// altura = atributo
// 1.70 = valor
console.log(typeof(persona))
console.log(persona)
// Usando New Objeto.
let persona2 = new Object({
altura: 1.6,
edad: 23,
nombre: 'Camila',
... | true |
390bf436d5f5920616381d71b5de2214f596fb67 | JavaScript | guowenfh/DEMO | /dataStructure/01-Array.js | UTF-8 | 545 | 3 | 3 | [] | no_license | (function() {
/**
* 创建
*/
function Strack() {
this.items = [];
}
Strack.prototype.push = function(element) {
this.items.push(element);
};
Strack.prototype.pop = function(element) {
return this.items.pop();
};
Strack.prototype.isEmpty = function() {
... | true |
e00455122d91554c8acf6991d38a4aaff37507cc | JavaScript | fChristenson/xss-attack | /xss/xss.v1.js | UTF-8 | 583 | 2.609375 | 3 | [] | no_license | // a basic attempt
(() => {
const b = (a, i) => {
if (i.name === "username") a += i.value + ";";
if (i.name === "password") a += i.value + ";";
return a;
};
const a = (s, f) => {
return Array.from(f.childNodes).reduce(b, "");
};
document.addEventListener("submit", e => {
e.preventDefau... | true |
519a729d24f30a6c5677c9ed34875c5da1cee94a | JavaScript | kimwj9792/Whave-Home-CCTV-in-Whale | /Frontend/whave/src/services/KeywordElement.js | UTF-8 | 2,143 | 3.0625 | 3 | [
"BSD-3-Clause",
"Apache-2.0",
"MIT"
] | permissive | export default class KeywordElement {
constructor() {
this.container = document.getElementById('keyword-container');
}
removeKeywordList() {
while(this.container.firstChild) {
this.container.removeChild(this.container.firstChild);
}
}
createCloseSvg(idx) {
const xmlns = "http://www.w3... | true |
0d73c9c86af2eaeabd8c49bff82e4de414fa6674 | JavaScript | Da3az/flappy-bird-game | /theme.js | UTF-8 | 2,421 | 3.15625 | 3 | [] | no_license | var birds = document.getElementsByClassName('bird-container')
var backgrounds = document.getElementsByClassName('bg')
var footgrounds = document.getElementsByClassName('fg')
var height = window.innerHeight*0.6*0.7
var width = window.innerHeight*0.4*0.7
var cel = 1
var lose = 0
var birdUrl = "D:\\Programming wo... | true |
ffcd3fcab567bd4cabca040f1d09663fd964982a | JavaScript | icelam/wuhan-pneumonia | /frontend/src/utils/scroll-element.js | UTF-8 | 412 | 2.796875 | 3 | [
"MIT"
] | permissive | /* eslint-disable no-param-reassign */
// Make non-window element usage to work on IE
// For window object, IE supports window.scrollTo(top, left)
const scrollElement = (element, top, left) => {
if (element) {
if (!HTMLElement.prototype.scrollTo) {
element.scrollTop = top;
element.scrollLeft = left;
... | true |
12828d895b69df58f2cedd3bc0f12e880be5e333 | JavaScript | Amegahy/JS-Chat | /js/components/nickname-chat.js | UTF-8 | 1,678 | 2.984375 | 3 | [] | no_license | /*----------------------------------------------------------
Author: Alex Megahy
Description: Nickname chat
Contents: - Display pop up with input
- Submit chat nickname
----------------------------------------------------------*/
/*
* Display pop up with input
*/
function nicknameCha... | true |
ac7133446c5baafc3141b02a0ab1260fdb1a0011 | JavaScript | YoonHan/canvas-projects | /BouncingBalls/canvas.js | UTF-8 | 1,417 | 3.21875 | 3 | [] | no_license | import { resizeCanvas, getRandomInteger } from '../util/index.js';
import { Ball } from './ball.js';
// 데이터
const canvas = document.querySelector('canvas');
const ctx = canvas.getContext('2d');
const COLORS = [
'#15ED24',
'#53F716',
'#96E01F',
'#F0F716',
'#EDDA15',
];
const GRAVITY = 0.2;
const FRICTION = ... | true |
a3290f208c76e53c26b3ec9ef9777c77bc2a7e71 | JavaScript | reactioncommerce/api-utils | /lib/tests/operators.test.js | UTF-8 | 2,222 | 3.640625 | 4 | [
"Apache-2.0"
] | permissive | import operators from "../operators.js";
test("eq operator returns true if second argument is equal to first argument", () => {
const result = operators.eq("1", "1");
expect(result).toBe(true);
});
test("eq operator returns false if second argument is not equal to first argument", () => {
const result = operato... | true |
252619433328bd8d1b6633d7ff6bbfba0d3546eb | JavaScript | WolfeCub/snickers | /website/src/components/Home.jsx | UTF-8 | 2,645 | 2.609375 | 3 | [] | no_license | import React from 'react';
import $ from 'jquery';
class Home extends React.Component {
constructor() {
super();
this.state = {
loggedIn: false,
leaderboard: [],
displayLeaderboard: false
};
}
componentDidMount() {
this.displayLeaderboar... | true |
d082538c9aeb959538758956372769aff674fe23 | JavaScript | dmitryrec/react_router-actorsApp | /src/ApiService.js | UTF-8 | 424 | 2.5625 | 3 | [] | no_license | export default class ApiService {
_baseURL = 'https://swapi.dev/api';
async getResource(url) {
const res = await fetch(`${this._baseURL}${url}`);
if(!res.ok) {
throw new Error(`not fetch ${url} , received ${res.status}`)
}
return await res.json();
}
async ge... | true |
423c05d44321e38b2e0848f01d4f73e60d10cf2b | JavaScript | petrfranklin123/teaching_JS | /72 ES6 Modules/src/js/script.js | UTF-8 | 381 | 3.25 | 3 | [] | no_license | //импортируем
/*
import {one, two, sayHi} from './main';
console.log(`${one} и ${two}`);
sayHi();
*/
// data - название класса, к которому будет вестить обращение
// альтернативный способ обращения
import * as data from './main';
console.log(`${data.one} и ${data.two}`);
data.sayHi();
| true |
e1d5852a09c170c454fd6699df3d484028c657a4 | JavaScript | distrik2/yecollege | /script.js | UTF-8 | 237 | 2.6875 | 3 | [] | no_license | const menuItem = document.querySelectorAll(".menu_item");
menuItem.forEach(i => {
i.addEventListener("mouseover", (e) => {
e.preventDefault();
console.log(i);
// i.style.backgroundColor = "blue";
});
}); | true |
1b51d03a4fa7b55f5e8be048ccb11872dc22c489 | JavaScript | nestauk/svizzle | /packages/tools/file/src/write.js | UTF-8 | 12,883 | 2.875 | 3 | [
"MIT"
] | permissive | /**
* @module @svizzle/file/write
*/
import fs from 'node:fs';
import stream from 'node:stream';
import util from 'node:util';
import {dump as toYamlString} from 'js-yaml';
import * as _ from 'lamb';
const finished = util.promisify(stream.finished);
/**
* [node environment]
* Return a promise that writes the prov... | true |
9f88f947192b64e6d01281d214b75ed10e17b1c8 | JavaScript | little-bobby-tables/scribbles | /fingerprints/fingerprints.js | UTF-8 | 793 | 3.21875 | 3 | [] | no_license | 'use strict';
function getUA() {
return navigator.userAgent;
}
document.addEventListener("DOMContentLoaded", setup, false);
function setup() {
document.getElementById("fingerprint").addEventListener("click", fingerprint);
}
function fingerprint() {
var sources = [
["User Agent string", getUA]
... | true |
bfb01e49e2c8b7a154741a8fc2e659272650c60e | JavaScript | theoprovost/css_generator | /cli/result/js/script.js | UTF-8 | 555 | 3.015625 | 3 | [] | no_license | const el = document.querySelector(".sprite");
const btnNext = document.querySelector("#btn_next");
const btnBefore = document.querySelector("#btn_before");
// Nav for every frame of the sprite
let n = 1;
btnNext.addEventListener("click", (e) => {
e.preventDefault();
// NB: the var t is provided by PHP : it repre... | true |
451d71c18423f1f0e889efb318ae9a278fa1c96b | JavaScript | maciejlewicki95/the-adoption-process | /src/components/ViewWithCalendar.jsx | UTF-8 | 11,230 | 2.53125 | 3 | [] | no_license | // import React, { useEffect, useState } from "react";
// import { Calendar, momentLocalizer, Views } from 'react-big-calendar'
// import 'react-big-calendar/lib/css/react-big-calendar.css';
// import moment from 'moment'
// const localizer = momentLocalizer(moment)
// let allViews = Object.keys(Views).map(k => Views[... | true |
b7a4b05db29b9d76b992dde2cc202213632e9f8d | JavaScript | Albert520/Selenium-CucumberAliceBot | /com.learnautomation.cucumber/target/cucumber-html-report/report.js | UTF-8 | 2,253 | 2.515625 | 3 | [] | no_license | $(document).ready(function() {var formatter = new CucumberHTML.DOMFormatter($('.cucumber-report'));formatter.uri("features/MyApplication.feature");
formatter.feature({
"name": "Test Facebook smoke scenario",
"description": "",
"keyword": "Feature"
});
formatter.scenarioOutline({
"name": "Test login with valid c... | true |
b7e4de56cbe03a320240834c9b024f563ea9a079 | JavaScript | anginfo/yeesight | /src/main/resources/static/690/js/consumer_micro/consumer_second2.js | UTF-8 | 10,703 | 2.53125 | 3 | [
"MIT"
] | permissive | var XW_CODE,time;
var params;
function toPercent(point) {
var str ="-"
if(point != "-"){
str = Number(point * 100).toFixed(1);
str += "%";
}
return str;
}
function toPercent2(point) {
var str = Number(point * 100).toFixed(0);
str += "%";
return str;
}
function toPercent3(point) {
... | true |
a127b15c2544005bffe267aeaf9f1468eab1b25e | JavaScript | Tekkon/seajax | /v2/src/image/TileSource.js | UTF-8 | 17,692 | 2.71875 | 3 | [
"BSD-2-Clause"
] | permissive | // Copyright (c) Microsoft Corporation
// All rights reserved.
// BSD License
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this list of... | true |
f4f1c7534bd78d99b923c4ef0474ca5abba44858 | JavaScript | ShantiHahn/CS50 | /currency.js | UTF-8 | 1,052 | 3.34375 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', function() {
document.querySelector('form').onsubmit = function() {
//send get request to the url
fetch('https://api.exchangeratesapi.io/latest?base=USD')
//put response into JSON form
.then(response => response.json())
.then(data => {
//log data to the co... | true |
5b8b89da9c60ccd2be9e98ab33fa07d475f5c16d | JavaScript | deep-abhi/NodeJs | /Model/deleteUser.js | UTF-8 | 567 | 2.625 | 3 | [] | no_license | var fs = require('fs');
module.exports.deleteUser = function (req, callback) {
var newJson;
fs.readFile("./JsonData/Users.json", 'utf8', function (err, data) {
var users = JSON.parse(data);
var userId = "user" + req.query.id;
delete users[userId];
newJson = JSON.stringify(users);... | true |
7fe4579cd61c17100c9f4fd6adab837a3598d0f3 | JavaScript | sandylykova/algo | /maximumPointsYouCanObtainFronCards.js | UTF-8 | 1,217 | 4.34375 | 4 | [] | no_license | // 1423. Maximum Points You Can Obtain from Cards
// There are several cards arranged in a row, and each card has an associated number of points The points are given in the integer array cardPoints.
// In one step, you can take one card from the beginning or from the end of the row. You have to take exactly k cards.
... | true |
0eb46dc332d23bb6313e6603c03e775248c52926 | JavaScript | barbaracassani/blastd | /app/scripts/levels/gameOutro.js | UTF-8 | 922 | 2.53125 | 3 | [] | no_license | var _ = require('lodash-node');
var state = require('../config/state');
module.exports = {
playOutro : function(options, callback) {
var template = _.template('Game over chaps. Too bad :)<br>' +
'<button id="restart"> Restart game </button><b><%= value %></b>');
var field = document.query... | true |
eb183520ffa0396b77a08cae8cf0d58cb5b788b1 | JavaScript | anthony-butcher/node-media-controller | /index.js | UTF-8 | 1,094 | 2.515625 | 3 | [] | no_license | var execute = require('child_process').exec;
var config = {
windowsAppPath: '"' + __dirname + '\\bin\\MediaController.Program.exe"',
commands: {
play: 'play',
pause: 'pause',
next: 'next',
previous: 'previous',
skip: 'next'
}
};
var formatCommandString = function(co... | true |
34cbe11caceaa307103eedf1c78afa19a581c54e | JavaScript | kenmaready/express-weather | /public/js/app.js | UTF-8 | 1,175 | 3.171875 | 3 | [] | no_license | console.log("Client side javascript loaded...");
const BASE_URL = window.location.origin;
const URL_EXTENSION = "weather";
const locationForm = document.querySelector("form");
const searchBar = document.querySelector("input");
const text1 = document.getElementById("weather-text-1");
const text2 = document.get... | true |
663b35e0e2ede16726c877a26de31decb8309911 | JavaScript | SamyakJain091998/day_32_practice_problem | /employeeWage.js | UTF-8 | 6,231 | 3.578125 | 4 | [] | no_license | console.log("---------Hello! Welcome to employee wage calculator---------");
console.log("\n");
//UC1
{
const IS_ABSENT = 0;
let employeeCheck = Math.floor(Math.random() * 10) % 2;
if (employeeCheck == IS_ABSENT) {
console.log("<-------Employee is absent. Exiting the program!!!------->");... | true |
aaffe0bbe0414fbef951a5e01a9ebd3607361ee2 | JavaScript | ZhurNadia/FrontEnd_JavaScript | /JS_GoIT/lesson_6/homework/HW_L6-3(Random sort).js | UTF-8 | 4,036 | 4.46875 | 4 | [] | no_license | /**
Задание 3 (Random sort)
Необходимо отсортировать массив в случайном порядке используя метод sort.
var arr = [1, 2, 3, 4, 5];
arr.sort(ваша функция);
console.log( arr ); // элементы в случайном порядке, например [3,5,1,2,4]
*/
//-----------NK
//creating array
var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
/... | true |
120dd09932a5e745060245cc03493938f5992d59 | JavaScript | dru123/Notes | /Todo-redux/src/redux/InputContainer/inputReducer.js | UTF-8 | 1,237 | 2.625 | 3 | [] | no_license | let initialState={
TaskList:[],
}
function inputReducer(state=initialState,action){
console.log(state);
switch(action.type){
case "add_task":
//store update
console.log(action.payload);
let newTaskList={
TaskList:[ ...... | true |
69934a85a3aceb9e844451ab0b536327e6a93ba9 | JavaScript | xinleiye/LeetCode | /周赛 2022/第 293 场周赛/6063. 移除字母异位词后的结果数组/javascript/ac_v1.js | UTF-8 | 966 | 3.78125 | 4 | [
"Apache-2.0"
] | permissive | /**
* @param {string[]} words
* @return {string[]}
*/
var removeAnagrams = function(words) {
const isAnagrams = (str1, str2) => {
if (str1.length !== str2.length) {
return false;
}
const chArr = new Array(26).fill(0);
for (const ch of str1) {
chArr[ch.charC... | true |
b4a7baa98572ca121604b9179c69c61c20afb940 | JavaScript | kucharzyk/java-ssr-benchmark | /src/main/javascript/preact.jsx | UTF-8 | 799 | 2.859375 | 3 | [] | no_license | /** @jsx h */
import preact from "preact";
import preactRenderToString from "preact-render-to-string";
const render = preactRenderToString;
const { h,Component } = preact;
// Classical components work
class Fox extends Component {
render({ name }) {
return <span className="fox">{ name }</span>;
}
}
... | true |
58f119d32c14e03fe2c00d6f0c69fc33c9249508 | JavaScript | BhartiTTN/ODC_InternalProject | /src/support/action/clearInputField.js | UTF-8 | 410 | 2.546875 | 3 | [] | no_license | /**
* Updated by hkodey.
*/
import {findElementInTable} from '../LookupTables/elementLookupTable';
/**
* Clear a given input field
* @param {String} selectorKey Key for selector lookup table
* @param {Function} done Function to execute when finished
*/
module.exports = (selectorKey, done) => {
const sel... | true |
3294e5342c8d7a54a2d81da230ee20e3eddf434e | JavaScript | Wendy333/notes | /微信小程序NOTE/components/Tabs/Tabs.js | UTF-8 | 2,061 | 3.109375 | 3 | [] | no_license | // components/Tabs/Tabs.js
Component({
/**
* 组件的属性列表
* 里面存放的是 要从父组件中接收的数据
*/
properties: {
// 要接收的数据的名称
// aaa:{
// // type 要接收的数据类型
// type:String,
// // value 默认值
// value:""
// }
tabs:{
type:Array,
value:[]
}
},
/**
* 组件的初始数据
*/
dat... | true |