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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a7db4e4fee1083793ca4747c4ffe9f0a0b815af5 | JavaScript | Phunmbi/shopmate | /src/components/ProductReviews/SingleProductReview/index.jsx | UTF-8 | 1,461 | 2.546875 | 3 | [] | no_license | import React, {Component, Fragment} from 'react';
import moment from 'moment';
import GoldStar from '../../../images/gold 4.svg';
import SilverStar from '../../../images/grey 1.svg';
import './SingleProductReview.scss';
class SingleProductReview extends Component {
renderRatings = (ratingCount) => {
const goldSt... | true |
3d0c5237a79db060a5f237108c1d30df15107081 | JavaScript | MUebachs/WBA2SS19UebachsFoitzik | /Abgabe_2/index.js | UTF-8 | 10,711 | 2.546875 | 3 | [] | no_license | var express = require("express");
var app = express();
const admin = require('firebase-admin');
var serviceAccount = require('./restourant-c87ba-c4fb35e484e0.json');
admin.initializeApp({
credential: admin.credential.cert(serviceAccount)
});
var db = admin.firestore();
app.use(express.json());
//aufgrund von Proble... | true |
a6b9f0545a39ab4d8bcbaf0fe102bfadad1a8ab3 | JavaScript | wenso/vue-system-manage | /src/mock/utils.js | UTF-8 | 1,427 | 2.84375 | 3 | [
"MIT"
] | permissive | import {isEmpty} from "../utils/obj";
/**
* 时间在指定范围内
* @param current 数据时间值
* @param start 起始时间条件
* @param end 结束时间条件
* @returns {boolean}
*/
export const isRangeTime=(val,start,end)=>{
if(!isEmpty(val)){
if(isEmpty(start)&&isEmpty(end)){
return true;
}else{
if(isEmpty... | true |
3adad7021db1e27e7a1315254d63f2698e25785a | JavaScript | AlexBrueckner/kehrwochenprojekt_nodejsbackend | /dbfunctions.js | UTF-8 | 16,043 | 2.953125 | 3 | [] | no_license | //dbfunctions.js
var mongoose = require('mongoose');
var User = require('./scheme').user;
var Flat = require('./scheme').flat;
var Task = require('./scheme').task;
var bcrypt = require('bcryptjs');
var fs = require('fs');
var randomstring = require("randomstring");
// ===================================================... | true |
d5b6fca1bfcf4ccc601a9be82b49382603dd6515 | JavaScript | Polvyer/Shake-Shack-Menu | /src/items/chicken.js | UTF-8 | 1,090 | 2.703125 | 3 | [] | no_license | const chicken = () => {
// Preset data
let chicken_h = ["Chick'n Shack", "Chick'n Bites", "Chicken Dog"];
let chicken_p = ["Antibiotic-free, crispy chicken breast with lettuce, pickles, and buttermilk herb mayo on a non-GMO Martin’s Potato Roll.",
"Antibiotic-free, crispy, all white-mea... | true |
24c7f6c696374fce4f568bc3fb279f1fd9208142 | JavaScript | adventurerlog/lbry-analytics | /src/main/index.js | UTF-8 | 1,325 | 2.65625 | 3 | [
"MIT"
] | permissive | // Modules to control application life and create native browser window
const { app } = require("electron");
const path = require("path");
const findProcess = require("find-process");
const createWindow = require("./create-window");
const SDK = require("./sdk");
// This method will be called when Electron has finishe... | true |
94e4f965f6238f414c39c3c112a74699a33717ed | JavaScript | RTurney/Code_wars_katas | /getAverage/spec/getAverageSpec.js | UTF-8 | 375 | 2.6875 | 3 | [
"MIT"
] | permissive | describe('getAverage', () => {
describe('returns an average', () => {
it('will return 2', () => {
expect(getAverage([2, 2, 2, 2])).toEqual(2);
});
it('will return 3', () => {
expect(getAverage([1, 2, 3, 4, 5])).toEqual(3);
});
it(' will return 1', () => {
expect(getAverage([1... | true |
7b0f7ebb0d2623c97a05015f0611edb2bf9ceccb | JavaScript | tristan3755/gantColor | /script.js | UTF-8 | 9,921 | 2.890625 | 3 | [] | no_license |
let exit = false;
console.log(exit);
let ouverture = false;
console.log(ouverture);
let exit1 = false;
console.log(exit1);
let ouverture1 = false;
console.log(ouverture1);
let exit2 = false;
console.log(exit1);
let ouverture2 = false;
console.log(ouverture1);
let exit3 = false;
console.log(exit1);
let ouverture... | true |
f7fa562127205cd1b71f0bc9977c39e1a76d279c | JavaScript | ryanjmurry/doctor-lookup | /src/api-parse.js | UTF-8 | 819 | 2.703125 | 3 | [
"MIT"
] | permissive | import { Doctor } from './doctor.js';
export class ApiParse {
getConditions(response) {
let body = JSON.parse(response);
let allConditions = [];
body.data.forEach(function(condition) {
allConditions.push(condition.name);
});
return allConditions.sort();
}
getDoctors(response) {
... | true |
6d05fd236c98f80d6a5186832245a9812c4575e1 | JavaScript | Yoshuag11/node-course-2-chat-app | /playground/time.js | UTF-8 | 341 | 3.296875 | 3 | [] | no_license | const moment = require( 'moment' );
// const date = new Date();
// const months = [ 'Jan', 'Feb' ];
// console.log( date.getMonth() + 1 );
// const date = moment();
// date.
// add( 1, 'years' ).
// subtract( 9, 'months' );
// console.log( date.format( 'MMM Do, YYYY' ) );
const date = moment();
console.log( date... | true |
af206ae3763d1eb9afad467f0dabf1470804ed41 | JavaScript | pudu87/testing-practice | /scripts/arrayAnalysis.js | UTF-8 | 439 | 3.265625 | 3 | [] | no_license | function analyse(array) {
return {
average: average(array),
min: min(array),
max: max(array),
length: array.length
}
}
function average(array) {
return array.reduce((sum, item) => {
return item + sum;
}) / array.length;
}
function min(array) {
return array.sort((a, b) => {
return a -... | true |
f5ecc5169a128783c81cb31a20609bf31e71ab6f | JavaScript | aagneess/Hacker_News | /assets/scripts/app.js | UTF-8 | 791 | 2.921875 | 3 | [
"MIT"
] | permissive | "use strict";
const upvoteForm = document.querySelectorAll(".upvote");
upvoteForm.forEach((upvote) => {
upvote.addEventListener("submit", (event) => {
event.preventDefault();
const formData = new FormData(upvote);
fetch("/app/upvotes/upvotes.php", {
method: "POST",
body: formData,
})
... | true |
167efcb971e4d01ec17056c85f0809e3d854f61e | JavaScript | Zestymcspicy/marvel | /src/characterCrosses.js | UTF-8 | 2,131 | 2.640625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import Box from './box';
export default function CharacterCrosses(){
const [charOne, setCharOne] = useState(undefined)
const [charTwo, setCharTwo] = useState(undefined)
const [crossoverEvents, setCrossoverEvents] = useState(undefined)
useEffect(
()=>{
... | true |
88c67e22c1a8be3afdab7a35fa2cd69a46b27734 | JavaScript | mmercado4/weddingweb_mc | /src/components/Admin/List.js | UTF-8 | 5,488 | 2.625 | 3 | [] | no_license | import React, { Fragment, useState, useEffect } from "react";
import { HOST, APIPORT } from "../../tools/constants";
import { capitalize } from "../../tools/capitalize";
import Pages from "./Pages";
import Edit from "./Edit";
import ReactHTMLTableToExcel from "react-html-table-to-excel";
export default function List({... | true |
8684806b6320e3aadcd5aa464a2c8c4378cf8c0c | JavaScript | foolmadao/my-leetcode | /15.三数之和.js | UTF-8 | 881 | 3.3125 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=15 lang=javascript
*
* [15] 三数之和
*/
/**
* @param {number[]} nums
* @return {number[][]}
*/
var threeSum = function(nums) {
nums = nums.sort((a,b) => a - b);
if(nums.length < 3) return [];
const numList = [];
for (let index = 0; index < nums.length-2; index++) {
const fi... | true |
7107ea568b676309f03cda3ada73b8b708fc4cc2 | JavaScript | Dmitry2703/TodoApp | /app/reducers/todoApp.js | UTF-8 | 1,581 | 2.921875 | 3 | [] | no_license | /**
* @fileOverview Редюсеры
*/
import { combineReducers } from 'redux';
// редюсер для одного элемента списка дел
const todo = (state, action) => {
switch (action.type) {
case 'ADD_TODO':
return {
id: action.id,
text: action.text,
completed: false
};
case 'TOGGLE_TODO'... | true |
94cd715b7695b66ccf5ccd3932d75d9a31cf3c4c | JavaScript | sspanak/dimmusaurus | /build-tools/css-convert-legacy.js | UTF-8 | 2,079 | 2.796875 | 3 | [
"Apache-2.0",
"BSD-2-Clause"
] | permissive | /* eslint no-console: 0, no-undef: 0 */
const readFileSync = require('fs').readFileSync;
const basename = require('path').basename;
function replaceVariables(css) {
const cssVars = {};
[...css.matchAll(/[\s{;](--[^:]+):\s*([^;]+)/g)].forEach(match => {
cssVars[match[1]] = match[2];
});
if (!Object.keys(cssVars... | true |
854df8b694b84a33bcc86af1bd5cd7b3aa9aa7ee | JavaScript | krishna3614/polarityTest | /polar/src/components/create.js | UTF-8 | 4,147 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
import 'bootstrap/dist/css/bootstrap.min.css';
export default class Create extends Component {
constructor(props){
super(props);
this.onChangeUserName = this.onChangeUserName.bind(this);
this.onChangeHobbies = this.onChang... | true |
ded83bd27443d221dc4475e134921a991fcfffcb | JavaScript | SmallPigGG/StudyNodeJS | /课程课件及示例代码/day2/01.js | UTF-8 | 823 | 3.625 | 4 | [] | no_license | /**
Created by www.it666.com
*/
/*
let buffer = new Buffer(10);
console.log(buffer);
*/
/*
00 - ff
0 - 255
00000000 - 11111111
0 或 1 代表1位(bit)
8 bit = 1B
1KB = 1024B
1MKB = 1024KB
1GB = 1024KB
1TB = 1024GB
*/
// 1. 字符串转成二进制
/*// let str = "www.it666.com";
let s... | true |
58e6cd9f42caa7d9725458342438fa1fe4bbd4f2 | JavaScript | danieltorrer/lab | /dailies/170206.js | UTF-8 | 3,928 | 2.921875 | 3 | [
"MIT"
] | permissive | /*
Copyright 2017 Keith Peters
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, su... | true |
c72d23be685bd87a6a179dbd907af65f01cf037e | JavaScript | pokotyan/linemusic | /app/assets/javascripts/modal_playlist.js | UTF-8 | 1,638 | 2.953125 | 3 | [] | no_license | $(document).on('ready',function(){
$(".input").on("keyup", function() { //入力するたび
display_number_of_remaining_characters(this) //残り入力可能文字数の表示
active_inactive_of_button() //作成ボタンのアクティブ、非アクティブ
});
$(".create_playlist").on('click', function() {
if($('.create_playlist').has... | true |
fd1146e61621efcd959f79a437aeba846330eef7 | JavaScript | solidity-parser/parser | /run.js | UTF-8 | 280 | 2.578125 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
const parser = require('.');
if (!process.argv[2]) {
console.error('No filename given');
process.exit(1);
}
const content = fs.readFileSync(process.argv[2]).toString();
const ast = parser.parse(content);
console.log(JSON.stringify(ast, null, 2))
| true |
0256951eec240e6c6b8c3baa6c4308027733b697 | JavaScript | jen-wan/book-javascript | /chapter-Objects/exercise9.js | UTF-8 | 313 | 3.0625 | 3 | [] | no_license | /*
The program logs 'hi' and 'hello'. This is because objects are mutable, but
strings and primitives are not. Line 16 logs the original value of qux.
This is because on line 10, the reassignment occured within a block scope. The
variable argument2, which represents qux is a copy of qux, not the real qux.
*/
| true |
cd3d4edde0bb3c3c12cccab415b429a9e06eda9e | JavaScript | dddExperiments/PhotosynthViewer | /src/API/SimpleFileWriter.js | UTF-8 | 2,401 | 2.59375 | 3 | [
"MIT"
] | permissive | "use strict";
/*
The MIT License (MIT)
Copyright (c) Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to u... | true |
28f8b84875d655eccf566c615089e227009224d3 | JavaScript | tuanna2/todos-reactjs | /src/editable/todos/ModalEdit.jsx | UTF-8 | 2,491 | 2.640625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { Modal } from "react-bootstrap";
const ModalEdit = ({todo, showModalEdit, setShowModalEdit, handleSubmit }) => {
const [id, setId] = useState("");
const [title, setTitle] = useState();
const [content, setContent] = useState("");
const [time, setTime] ... | true |
aa985407e86bdb200562c5680ffedc1097f409ea | JavaScript | maccmiles/Post | /post.js | UTF-8 | 1,463 | 2.921875 | 3 | [] | no_license | /*
Maccmiles
01-25-18
Generate HTML POST Requests without page redirection
input msg - enter a string to be sent via content field of POST request (preferably one that won't break the code)
array api - secondary file holding an array of URL's (Webhook API) for post request to be sent to
*/
function DiscPost(msg){
m... | true |
5e14655bb52b59fa99fc39e3d0352b62ea35e0e9 | JavaScript | so-andrew/hussein-bot | /commands/pog.js | UTF-8 | 1,610 | 2.921875 | 3 | [] | no_license | const fs = require("fs");
const Discord = require("discord.js");
module.exports = {
name: 'pog',
description: "Function to add to the pog jar.",
cooldown: 7,
dev: true,
async execute(message, args){
let output;
let pogCount;
if(args == 2 || args == 3){
output = [... | true |
66fa47413a65ade748beab776858ec4dffeb2f69 | JavaScript | jakubminkiewicz/MoonDogeOpenSource | /scripts/DogecoinPriceScript.js | UTF-8 | 1,645 | 3.40625 | 3 | [
"MIT"
] | permissive | var xmlhttp = new XMLHttpRequest();
var url = "https://api.coingecko.com/api/v3/simple/price?ids=dogecoin&vs_currencies=usd&include_24hr_change=true&include_last_updated_at=true";
//This function parses the JSON to something we can use in the code
xmlhttp.onreadystatechange = function() {
if (this.readyState... | true |
05daa7098aa0c9a75d01f28e14455a45f7a930d4 | JavaScript | velosotiago/ITup-exercises | /Programming Basics/Homework/Part 1/3.js | UTF-8 | 176 | 2.90625 | 3 | [] | no_license | function diff(Age, Average) {
if (Age > Average) {
return Age - Average;
} else {
return Average - Age;
}
}
console.log(diff(18, 20));
console.log(diff(20, 18)); | true |
f10c99554641dbc67be2e350e2717c5e879e28ba | JavaScript | WhoOisOdis/ProTek_Training | /Assignments/Phone_input_example.js | UTF-8 | 1,478 | 2.6875 | 3 | [] | no_license | $( document ).ready( function()
{
$(".box1").keyup( function ()
{
var x = $(this).val().length;
if (x == 3)
{
$(this).next().focus();
}
});
var i = 0;
$("#next").click(function ()
{
var sources = ["Pic1.jpg", "Pic2.jpg", "Pic3.jpg", "Pic4.jpg", "Pic5.jpg"]
i++;
if (i == sources.length)
... | true |
8c8fca6cfdb242eddfeb9c8a88e0e446fcd248bb | JavaScript | gahyun-lim/p5-sketches | /01/02-9-sketch.js | UTF-8 | 1,454 | 2.9375 | 3 | [] | no_license | let Lobster;
let fontSize = (9);
// let hArray;
// let letterH;
function preload () {
letterH = loadImage ('../assets/letterH02.png')
Lobster = loadFont ('../assets/Lobster.ttf');
}
function setup () {
createCanvas (1000, 1000);
background (0);
textFont (Lobster);
textSize (fontSize);
... | true |
0f035a8b730c0e1f96209075c456339f7cfc6bac | JavaScript | joshpson/the-dom-challenge-dc-web-042318 | /challenge.js | UTF-8 | 3,167 | 3.78125 | 4 | [] | no_license | //Initialize Timer
let counterH1 = document.getElementById('counter');
let counter = 0;
let timer = setInterval(increaseCounter, 1000);
let setCounter = () => (counterH1.innerHTML = counter);
let restartTimer = () => (timer = setInterval(increaseCounter, 1000));
let stopTimer = () => (clearInterval(timer));
//Increas... | true |
ce2a801369a26cbca197d07df21d5a6f096e28d2 | JavaScript | alanag13/yall.js | /src/yall.js | UTF-8 | 3,666 | 2.78125 | 3 | [
"MIT"
] | permissive | /**
* yall.js version 1.2.0
* Yet Another Lazy loader
**/
(function(window, document){
var
// The primary goal here is to keep this script as small as possible
// while maintaining functionality. The uglifier goes a long way,
// but we can take things a bit farther by saving references for
// frequently us... | true |
07b0f6df0bf743f58b6b885e5f437e3a8145b944 | JavaScript | abhijeetvermayash/BasicCalculator | /src/index.js | UTF-8 | 3,472 | 3.046875 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
class App extends React.Component {
constructor(props) {
super(props);
this.state = { one: 0, two: 0, ans: 0,err: '' };
}
render() {
return (
<div className="ui container" style={{ height: '600px', w... | true |
8804d4bd1807564eaf6485ce4328f9039d5c2d8a | JavaScript | itruong/collegeprograms-public | /collegeprograms-backend/gateway/src/middleware.js | UTF-8 | 1,201 | 2.515625 | 3 | [] | no_license | const cors = require('cors');
const fetch = require('node-fetch');
const config = require('./config/config')
const authMiddleware = async (req, res, next) => {
if (req.headers.authorization) {
const authResponse = await fetch(
config.routing.auth,
{ headers: req.headers }
);
const data = aw... | true |
0ef27bc6ff90698e4f55d9fba51017b456e38ac4 | JavaScript | gordontoh/gordontoh.github.io | /script.js | UTF-8 | 3,900 | 3.125 | 3 | [] | no_license | let input = document.querySelector('input')
let textarea = document.querySelector('textarea')
// This event listener has been implemented to identify a
// Change in the input section of the html code
// It will be triggered when a file is chosen.
input.addEventListener('change', () => {
let files = input.files... | true |
6461b904633a4cd24c1370b35a3ef41288bf5ec2 | JavaScript | 2ndwann/Yoinkbot | /commands/misc/roulette.js | UTF-8 | 1,739 | 2.796875 | 3 | [] | no_license | const commando = require('discord.js-commando');
const fs = require('fs');
const { DiscordAPIError } = require('discord.js');
const Discord = require('discord.js')
module.exports = class RouletteCommand extends commando.Command {
constructor(client) {
super(client, {
name: 'roulette',
... | true |
0cf155f5b0d95d0475e8a48e0245832b9c084fdd | JavaScript | JulioMorenoMCE/sweetalert2 | /src/instanceMethods/enable-disable-elements.js | UTF-8 | 1,335 | 2.8125 | 3 | [
"MIT"
] | permissive | // Currently, `this` is the private `context` (or `currentContext`) object
import { getInput } from './getInput'
export function enableButtons () {
this.domCache.confirmButton.disabled = false
this.domCache.cancelButton.disabled = false
}
export function disableButtons () {
this.domCache.confirmButton.disabled... | true |
f481bad15560c531fb146f2f92ab38c1feecdc3f | JavaScript | b-dan/JavaScript_Adv_ITEA_2021 | /homework08/script_localstorage.js | UTF-8 | 1,460 | 3.03125 | 3 | [] | no_license | window.addEventListener('load', init);
function init() {
let log = document.querySelector('#log-in');
let logInSubmit = document.querySelector('#log-in [type="button"]');
let logInText = document.querySelector('#log-in [type="text"]');
logInSubmit.addEventListener('click', logInHadler);
let logOut... | true |
f7f33c9140e6de0d3e9cce6eed8b17d53fa9216d | JavaScript | samirfarhi/algorithms_in_javascript | /quickSort.js | UTF-8 | 753 | 3.53125 | 4 | [] | no_license | function quickSort(array) {
const swape = (arr, a, b) => {
let temp = arr[a];
arr[a] = arr[b];
arr[b] = temp;
}
const partition = (arr, start, end) => {
let pivot = arr[end];
let pivotIndex = start;
for (let i = start; i < end; i++) {
if (arr[i] < pivot) {
swape(arr, i, pivo... | true |
aec459f43d4793cb0bfc014defe887a170e6dacd | JavaScript | MiguelCastillo/pulling-deps | /src/index.js | UTF-8 | 4,203 | 2.78125 | 3 | [
"MIT"
] | permissive | const utils = require('belty');
const walk = require('acorn-walk');
const dynamicImportPlugin = require('acorn-dynamic-import').default;
const acorn = require('acorn').Parser.extend(dynamicImportPlugin);
const TokenTypes = {
Identifier: 'Identifier',
Literal: 'Literal',
ArrayExpression: 'ArrayExpression',
Impo... | true |
8ea289dc77860c467f6f4cabbd2354326bb9f59e | JavaScript | ChanakyaNani/react-tania | /src/index.js | UTF-8 | 1,263 | 2.84375 | 3 | [] | no_license | import React, { Component } from 'react';
import { render } from 'react-dom';
import Hello from './Hello';
import Table from './Table';
import Api from './Api';
import Form from './Form';
import './style.css';
class App extends Component {
state = {
name:'react',
chars: [{
'name': 'Charlie',
... | true |
e905483466f28bf0473d05e9a89aeb57c5b83cce | JavaScript | tsionac/Final-Project-2021 | /projects/api/cache/ActiveEdits.js | UTF-8 | 2,468 | 2.859375 | 3 | [] | no_license | class ActiveEdits {
//Save a list of curently active edits (ent time was not recived yet)
// for each component, store a list of active users and thier start edit time
userEdits = new Map();
//use for seperation between difrent key properties
seperator = '\t';
/**
* get a list of currently active ... | true |
582ec797c00094f1e7b36147494ef267618145e7 | JavaScript | yvesandre-middleton/connecting-from-javascript | /famous-people-db.js | UTF-8 | 697 | 2.625 | 3 | [] | no_license | function findFamous(client, person, callback) {
const query =
`SELECT
*
FROM famous_people
WHERE last_name = $1;
`
client.query(query, [person],
(err, result) => {
if (err) {
callback(err)
return
}
callback(null, result.rows)
}
);
}... | true |
1e3f182f4d0789016b57d9729e7f7c6867baea16 | JavaScript | yanling001/businessProject | /target/businessProject/index/user/userLogin/branch/index/index.js | UTF-8 | 1,280 | 2.703125 | 3 | [] | no_license | var businessId = document.getElementsByClassName('num')[0];
//获取参数封装
function GetPar(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r != null) return decodeURIComponent(r[2]);
return null;
}
//传入参数名称(为字符串形式)
//在这里获取,用变量储存,在后续页面才能获得,否则后续子页面无法... | true |
42d2f25e360b16ba5663c77462140b3d7ebb957f | JavaScript | ywwhack/es6jq | /src/async.js | UTF-8 | 446 | 2.859375 | 3 | [] | no_license | export const async = function(gen) {
let it = gen();
onFulfill();
function onFulfill(res) {
let ret;
try {
ret = it.next(res);
}catch(e) {
reject(e);
}
next(ret);
}
function onReject(res) {
let ret;
try {
ret = it.throw(err);
} catch (e) {
return rej... | true |
9a3eff702e6bce1d53a9cde20607b9ec2381b2ec | JavaScript | MGMDV-Orbs/microservices | /dangerfile.js | UTF-8 | 2,939 | 2.609375 | 3 | [] | no_license | /**
* @name Production PR Dangerfile
*
* @description
* This dangerfile validates production PRs before the deployment step
* to assure all change order requirements are met.
* The data captured here is then forwarded to Azure.
*
* See the orb commands for reference:
*/
const danger = require('danger')
const {... | true |
42cf8e304bbd5b32776ccac5215515eff838b94a | JavaScript | Tythyrn/treehouse_project_8_SQL_Library_Manager | /routes/index.js | UTF-8 | 4,266 | 3 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const { Book, Sequelize } = require('../models');
const { Op } = require("sequelize");
/* Handler function to wrap each route. */
function asyncHandler(cb){
return async(req, res, next) => {
try {
await cb(req, res, next)
} catch(erro... | true |
d573df402ae3b943b4344c7b1831d2bb89946aa2 | JavaScript | gitrocket/updownCounter | /script.js | UTF-8 | 565 | 3.59375 | 4 | [] | no_license |
const number = document.getElementById('num');
const up = document.getElementById('up');
const reset = document.getElementById('reset');
const down = document.getElementById('down');
var count = 0;
function countUp() {
count = count + 1;
number.textContent = count;
}
function countDown() {
count = cou... | true |
843b3a9f431ecc992646c7c6b50b524bae0a1cb2 | JavaScript | thatygranger/Ado | /akira.js | UTF-8 | 10,004 | 3.234375 | 3 | [] | no_license | /*
5 Dez. 2015
Ricardo Akira Paiva Ichikawa
2o Semestre de Redes de Computadores
ADO Final de Algoritmos de Programação
Professor Fábio de Toledo Pereira
Grupo 15 - 0, 1, 2, 4, 5, 7
----------------------------------------------------------------------------------------------------------------------------
Função a... | true |
d1a43eee99acbaf909e8ecba6f7a4017be83fe29 | JavaScript | onephrase/util | /arr/intersect.js | UTF-8 | 463 | 3.0625 | 3 | [
"MIT"
] | permissive |
/**
* @imports
*/
import _isArray from '../js/isArray.js';
/**
* Returns the intersection of two arrays;
* optionally using a custom matching function.
*
* @param array arr
* @param array arr2
* @param function callback
*
* @return array
*/
export default function(arr, arr2, callback = null) {
return ... | true |
234e17d9c1d3bb32a6be867316f1276b76466d18 | JavaScript | souviknsl07/Dev-News | /index.js | UTF-8 | 2,463 | 2.9375 | 3 | [] | no_license | let key= "a5476e6b5106b2584d8d8c2d889ba420";
let newsAccordian = document.getElementById("newsAccordian");
const xhr = new XMLHttpRequest();
xhr.open('GET', `https://gnews.io/api/v4/top-headlines?token=${key}&lang=en`, true)
xhr.onload= function(){
if(this.status===200){
let json = JSON.parse(this.respons... | true |
374a7de869c721e6445544ffaaf2981f7d349874 | JavaScript | pabloriusblanco/FreeCodeCampCourses | /Responsive Web Design Projects/Build a Personal Portfolio Webpage/ventanasDinamicas.js | UTF-8 | 1,771 | 2.671875 | 3 | [] | no_license | // function gifPreviewDinamico(previewArray, numero) {
// let imagenPreviewDinamico = document.createElement("img");
// let ImagenPreviewEstatico = previewArray[numero].children[2];
// imagenPreviewDinamico.setAttribute("class", "preview");
// imagenPreviewDinamico.style.position = "absolute";
// //... | true |
817db32151d34424e5eb13c08e272defb2bd3bed | JavaScript | Alvai/docs | /scripts/lint-slugcheck.mjs | UTF-8 | 1,688 | 3.125 | 3 | [
"MIT"
] | permissive | import glob from 'fast-glob';
import kleur from 'kleur';
/** Makes sure that all translations’ slugs match the English slugs. */
class SlugChecker {
async run() {
const errors = await this.#findMismatchedSlugs();
this.#outputResult(errors);
}
/** Load all Markdown pages and check non-English pages have counter... | true |
e6c453f6d26645d398355d13b4d1de05338abe57 | JavaScript | pmkreppein/js-dom-and-events-listening-to-dom-events-readme-v-000 | /js/index.js | UTF-8 | 258 | 2.59375 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // using this file is optional
// you can also load the code snippets in using your browser's console
document.getElementById("myBtn").addEventListener("click", displayDate);
function displayDate() {
document.getElementById("demo").innerHTML = Date();
} | true |
7cfb447981a56b28c2ffc300ef428d13a819cb23 | JavaScript | liu9856866814/jsDemo | /WEEK4/day2/js/3-图片渐现.js | UTF-8 | 568 | 3.046875 | 3 | [] | no_license | // 需求: 做一个图片渐现的效果;
// 导入工具方法
const { css } = window.utils;
// 1. 获取元素
let img = document.querySelector('.img-con img');
let timer = setInterval(() => {
// 1. 获取opacity属性
let op = css(img, 'opacity'); // css 方法获取到opacity的值是字符串,需要把op的值转成数字
let curOp = parseFloat(op) + 0.005;
// 当curOp的值大于1时 就应该停止动画
... | true |
23056ddc7995261b2f1841cbba9c0d5714a61c0d | JavaScript | volumnet/raas.cms.shop | /resources/js/_blocks/goods-comments/goods-comments.vue.js | UTF-8 | 1,851 | 2.5625 | 3 | [] | no_license | /**
* Отзывы к товару
*/
export default {
props: {
/**
* ID# блока
* @type {Object}
*/
blockId: {
type: Number,
required: true,
},
},
mounted: function () {
this.getVotes();
},
methods: {
/**
* ... | true |
58b145d5253ec3f92a137f3c117131078e8181f8 | JavaScript | 979070830/Voxel-World-Generation | /Script/World/Handling/ChunkRemover.js | UTF-8 | 1,867 | 2.59375 | 3 | [] | no_license | const CR_MaxDeletionsPerSecond = 40;
function ChunkRemover(parent) {
this.parent = parent;
this.index = 0;
this.lastIndex = 0;
this.chunkList = [];
this.processedList = [];
this.distancesList = [];
}
ChunkRemover.prototype = {
constructor: ChunkRemover,
chunkOffsets: [[0,0,0], [0,0,1], [0,0,-1], [1,0,0], [-1,... | true |
d990ee92cbccf3d7bb0572df15359ddceb952c47 | JavaScript | ankitac3021/AngularAndNodeJSPractise | /NodeJSWorkSpace/SeventhNodeLoginProject/demo.js | UTF-8 | 1,017 | 2.71875 | 3 | [] | no_license | var http=require("http");
var fs=require("fs");
var url=require("url");
var qs=require("querystring");
var server=http.createServer(function(request,response){
console.log(request.url);
if(request.url==="/"){
response.writeHead(200,{'Content-Type':'text/html'});
var myReadStream=fs.creat... | true |
87b21abd1e3f2a5148d0e90b4bbb68d4195aaf43 | JavaScript | raihan-muhammad/simple-absensi-app | /assets/plugins/cleave.js/test/unit/NumeralFormatter_spec.js | UTF-8 | 2,292 | 2.59375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | var _ = require('underscore');
var NumeralFormatter = require('../../src/shortcuts/NumeralFormatter');
var numerals = require('../fixtures/numeral.json');
describe('NumeralFormatter', function () {
_.each(numerals, function (numeral) {
var title = [];
if (numeral.thousandsGroupStyle) {
... | true |
aa2492ef0474fe1b051259e4b26bad7cf1604fd0 | JavaScript | chanind/cn-grammar-matcher | /scripts/allset/regexFromRule.js | UTF-8 | 2,895 | 2.828125 | 3 | [
"MIT"
] | permissive | const { isOnlyHanzi, hasHanzi, getNumHanzi } = require('../scriptUtils');
const numRegex = '[零一二三四五六七八九十百千万亿两0-9]+';
const collapseAdjacentHanzi = allsetPatternParts => {
const collapsedParts = [];
let currentPart;
for (const part of allsetPatternParts) {
const partIsHanzi =
isOnlyHanzi(part, 'xyzXYZ|... | true |
ab162f38aa4c2e742da455caa6a611b0004f5a5c | JavaScript | known-as-bmf/tah-fp | /04-currying/02-curry.js | UTF-8 | 630 | 3.703125 | 4 | [] | no_license | const R = require('ramda');
// ? le principe ?
// ? pouvoir utiliser une fonction de manière partielle
// ? currying simple "à la main"
const add = a => b => a + b;
const addTen = add(10);
console.log(addTen(2));
console.log(add(2)(2));
// ? on reprend l'exemple précédent
const arr = [2, 4, 6, 8];
const mapArr = a... | true |
ee7f6bb8d0f26e0e243cf8bc7b18f61ac1ca44db | JavaScript | Parissai/JavaScript-Calculator | /script.js | UTF-8 | 5,197 | 3.21875 | 3 | [] | no_license | const display = document.getElementById('display');
const resultDisplay = document.getElementById('result');
const buttons = document.querySelectorAll('.button');
const equalsButton = document.getElementById('equalsButton');
const allClearButton = document.getElementById('allClearButton');
const displayClearButton = do... | true |
4a539cab12838d7b2162e915ea5d211d28063e31 | JavaScript | roromusic/Algorithms | /answers/interval/Merge.js | UTF-8 | 730 | 3.28125 | 3 | [] | no_license | /**
* @param {Interval[]} intervals
* @return {Interval[]}
*/
var merge = function(intervals) {
if(intervals.length === 0) return intervals;
const sorted = intervals.sort((a,b) => a[0] - b[0]);
const answer = [];
let prev = sorted[0];
for(let i=1, len=intervals.length; i < len; i++){
if... | true |
dac2862f33fe49407057e692a4d67451d9e6a01b | JavaScript | oamaok/lc | /src/client/math.js | UTF-8 | 669 | 2.859375 | 3 | [] | no_license |
function mulMat23(lhs, rhs)
{
return [
lhs[0] * rhs[0] + lhs[1] * rhs[3],
lhs[0] * rhs[1] + lhs[1] * rhs[4],
lhs[0] * rhs[2] + lhs[1] * rhs[5] + lhs[2],
lhs[3] * rhs[0] + lhs[4] * rhs[3],
lhs[3] * rhs[1] + lhs[4] * rhs[4],
lhs[3] * rhs[2] + lhs[4] * rhs[5] + lhs[5],
];
}
function mulMat23Vec2(mat, vec)
... | true |
1cc1890d273efc6f0a1172a1d7eb6ab33883d8ce | JavaScript | Zahro25/Ujian_chunin | /soal2/2.1.js | UTF-8 | 732 | 3.15625 | 3 | [] | no_license | let raport = function (nilaiUN){
let rataRAta = nilaiUN.reduce((acc, cur)=> acc+cur)/nilaiUN.length
if(nilaiUN.length === 4){
if (rataRAta <= 100 && rataRAta >= 90){
console.log('A');
}else if (rataRAta < 90 && rataRAta >= 80){
console.log('B');
}else if (rataRAta... | true |
6cb3706b3d2f0d223a5e754069c5c707c97663ca | JavaScript | christine-kit/KitBot | /util.js | UTF-8 | 617 | 2.953125 | 3 | [] | no_license |
var fs = require('fs');
module.exports = {
readJSON(filename) {
var raw = fs.readFileSync(filename);
return JSON.parse(raw);
},
writeJSON(filename, content) {
fs.writeFileSync(filename, JSON.stringify(content, null, 4));
},
//sends a message to the channel listing correct ar... | true |
23f9357638eb9b086e4aab244f11ce9ffd75cde8 | JavaScript | RomanKuratli/GameOfLife | /script.js | UTF-8 | 4,048 | 3.125 | 3 | [] | no_license | let SIZE = 100;
let MIDDLE = SIZE / 2;
let FIELD = getEmptyField();
let INTERVAL_ID = null;
function getEmptyField() {
let field = [];
// initialize field
for (let y = 0; y < SIZE; y++) {
field[y] = [];
for (let x = 0; x < SIZE; x++) {
field[y][x] = false;
}
}
return... | true |
a851eeba1d95dede0fe8e8e0230276e2b9bd4bad | JavaScript | tehat/jQueryAssessment | /script.js | UTF-8 | 862 | 2.859375 | 3 | [] | no_license | $(document).ready(function(){
// console.log("hi");
$('#container').on('click', function(){
appendDom();
});
$('.deleteButton').on('click', '.deleteButton, .changeButton', function(){
$(this).parent().remove('#container');
console.log("hey i am working");
});
});
function appendDom(){
var $e... | true |
252545fa281dc1a49c89a2d0b30d660cefb26ce9 | JavaScript | soominok/SpringFrontendExamples | /react-frontend/src/App.js | UTF-8 | 2,052 | 2.703125 | 3 | [] | no_license | import React, { useState, useRef, useCallback } from 'react';
import TodoTemplate from "./todo_components/TodoTemplate";
import TodoInsert from "./todo_components/TodoInsert";
import TodoList from "./todo_components/TodoList";
import CounterContainer from "./asynchronous/CounterContainer"
const App = () => {
// ... | true |
c4da264c629759ef75854751b7a5fc30ab1227f8 | JavaScript | Gary-Schulke/D3-challenge | /D3_data_journalism/assets/js/app.js | UTF-8 | 9,035 | 3.0625 | 3 | [] | no_license | // D3-challenge
// Gary Schulke
// January 8, 2020
var margin = null, width = null, height = null;
var svg = null, chartView = null;
var data = null; // The data source file.
var horLabels, vertLabels;
var selectedX = "poverty", xAxis, xCircles;
var selectedY = "healthcare", yAxis, yCircles;
var xL... | true |
7e1f37162888bff89990f915f77b6c2e9b6e5bc1 | JavaScript | notforu/sample-react-app | /src/entities/repos.js | UTF-8 | 1,687 | 2.5625 | 3 | [] | no_license | import { takeLatest, call, put } from "redux-saga/effects";
import Api from "shared/api";
/* Constants */
export const FETCH_REPOS_REQUEST = "FETCH_REPOS_REQUEST";
export const FETCH_REPOS_SUCCESS = "FETCH_REPOS_SUCCESS";
export const FETCH_REPOS_FAILURE = "FETCH_REPOS_FAILURE";
/* Action Creators */
export functio... | true |
fd7bf43da2927650f644bc603fdfc1a63ab02be7 | JavaScript | javnet/modulo-javascript-Julio | /Dia1/app.js | UTF-8 | 527 | 3.578125 | 4 | [] | no_license | /*
* Aquí podéis hacer los ejercicios y
* practicar Javascript!
*/
//hoisting
/*console.log("Probando, probando, 1, 2, 3!");
console.log(object);
[1, 2].forEach(alert);*/
/*let edad = 38;
let nombre = "Julio";
const cumple;
alert("Mi nombre es " + nombre + " y tengo " + edad);
console.log(`Mi nombre<
es ${nombre}`);... | true |
530686477d6a9cdf3af454cab45e43f03956ffe7 | JavaScript | morusleaf/forager-handbook | /js/datatypes.js | UTF-8 | 9,598 | 2.578125 | 3 | [
"MIT"
] | permissive | Function.prototype.clone = function() {
var that = this;
var temp = function temporary() { return that.apply(this, arguments); };
for(var key in this) {
if (this.hasOwnProperty(key)) {
temp[key] = this[key];
}
}
return temp;
};
class ForagerObject {
// key;
// name;
// _desc;
co... | true |
307db72d4f0d416d758369174370605444a51109 | JavaScript | sam-621/Platzi | /Jest/__test__/true.test.js | UTF-8 | 668 | 2.515625 | 3 | [
"MIT"
] | permissive | import { isFalse, isNull, isTrue, isUndefined } from '../src/true';
describe('Null', () => {
test('Is null?', () => {
expect(isNull()).toBeNull(); //Or toBe(null)
});
});
describe('True', () => {
test('Is true?', () => {
expect(isTrue()).toBeTruthy(); //Or toBe(null)
});
});
describe('False', () => {... | true |
e5b6fd94692844a3f29cece96db5b137a807a0a9 | JavaScript | galanin/whoosh-directory | /common/js/lib/datetime.js | UTF-8 | 1,734 | 2.984375 | 3 | [
"CC-BY-3.0"
] | permissive | import { padNumber } from '@lib/number';
export const formatDayTime = (hours, minutes) =>
padNumber(hours) + ':' + padNumber(minutes);
export const formatDate = (month, day) =>
padNumber(month + 1) + '-' + padNumber(day + 1);
const MONTH_DAYS = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
const MONTH_OFFSE... | true |
2dac996fbc910c65423857b1cdf0f02edacaacd9 | JavaScript | whytul/study_es6 | /script.js | UTF-8 | 256 | 2.875 | 3 | [] | no_license | import { student as park, student2 as ted, student3 as abby } from './students.js';
const student = 'Kim';
console.log(student); // "Kim"
console.log(park); // "Park"
console.log(ted); // "Ted"
console.log(abby); // "Abby" | true |
d569845066f511052cb350cf156adc33e48bdfc8 | JavaScript | sanjeevsubedi/mvc-js | /scripts/DatabaseHelper.js | UTF-8 | 4,303 | 2.59375 | 3 | [] | no_license | function DatabaseHelper(callback) {
/*
This method is used to initialize database and is called every time app is loaded.
*/
function populateDB(tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS RESPONSE (id INTEGER PRIMARY KEY, surveyId INT,email VARCHAR(255), response TEXT, status I... | true |
a020c1422bf997ec8d56e42b10d393287d04f381 | JavaScript | brendanreape88/DSA-Arrays | /drills.js | UTF-8 | 986 | 3.671875 | 4 | [] | no_license | const Memory = require("Memory");
const MEMORY = new Memory();
class MyArray {
constructor() {
const INITIAL_CAPACITY = 4;
this._capacity = INITIAL_CAPACITY;
this._startAddress = MEMORY.allocate(INITIAL_CAPACITY);
this.length = 0;
}
_resize() {
const newStart = MEMORY.allocate(this._capaci... | true |
4675792bb059b46678dc135ee569a939b1c19d7c | JavaScript | RadicalLinux/faceBot | /plugins/GiftBox/helpers/auto-load.js | UTF-8 | 1,014 | 3 | 3 | [] | no_license |
function setImages(group)
{
// If the images haven't finished loading, just return
if (!group.IsComplete())
return;
// A set of images has just loaded; so go through the image set
// and reconnect them with the document
for (i = 0; i < group.items.length; i ++)
{
var img_name = group.items[i];
var img_obj... | true |
8117bf6c65608caf6e494bde65444afca8c6172e | JavaScript | edencha/Sadari | /js/SadariView.class.js | UTF-8 | 2,609 | 2.96875 | 3 | [] | no_license | !function (window, document, undefined) {
class SadariView {
/*
* DOM요소 초기화
*/
constructor () {
this.appIntroForm = document.querySelector("#app-intro");
this.appResult = document.querySelector("#app-result");
this.appStartData = document.querySelector("#sadari-start-data");
this.appEndData = do... | true |
fe147cdce1bc1cd6825844a01f5d74130f4cbc5b | JavaScript | mskumar864/ds-algo | /Frequency Counter/isAnagram.js | UTF-8 | 846 | 4.34375 | 4 | [] | no_license | // Frequency Counter pattern
// check if the given 2 strings are Anagram
function isAnagram(str1, str2) {
// check for length
if (!str1 || !str2) return false;
if (str1.length != str2.length) return false;
let freqCount = new Map();
// set the freq count for each char in string 1
for (let char of str1) ... | true |
6c3da5488d9bec74bcc70ed2654966061fd2f2dc | JavaScript | Maes95/TFG-WebChat | /NodeJSCluster-WebChat/master.js | UTF-8 | 986 | 2.53125 | 3 | [] | no_license | const cluster = require('cluster');
const numCPUs = require('os').cpus().length;
cluster.setupMaster({ exec: 'worker.js' });
var users = new Set();
for (var i = 0; i < numCPUs; i++)
cluster.fork();
cluster.on('message', (worker, message) => {
switch (message.type) {
case "message":
// Broadcast messag... | true |
0b35bc6e34f6544f82142bbdeb75059e021babe3 | JavaScript | EzeVasari/gauchoRocket | /gauchoRocket/Vista/js/agregarTrayecto.js | UTF-8 | 1,473 | 3.21875 | 3 | [] | no_license | $(document).ready(function(){
var maxField = 6; // Numero maximo de campos
var addButton = $('#btn-nuevoTrayecto'); // Selector del boton de Insertar
var wrapper = $('#contenedor1'); // Contenedor de campos
var fieldHTML = "<... | true |
5115d80ba47ad2dd69d424f2d0a214ba36041983 | JavaScript | AbuKhalil95/jadwalla-app | /src/store/template.js | UTF-8 | 1,174 | 2.515625 | 3 | [
"MIT"
] | permissive | /* eslint-disable import/no-anonymous-default-export */
/* eslint-disable no-duplicate-case */
/* eslint-disable no-case-declarations */
import cookie from 'js-cookie';
const initialState = {
name: '',
courses: [],
ownerId : cookie.get('userId'),
};
export default (state = initialState, action) => {
... | true |
7636dc7b986720c1e0c0bd72fa4c71102bf489a1 | JavaScript | DX94/webvs | /src/ResourceManager.js | UTF-8 | 3,808 | 2.703125 | 3 | [
"MIT"
] | permissive | /**
* Copyright (c) 2013-2015 Azeem Arshad
* See the file license.txt for copying permission.
*/
(function(Webvs) {
// ResourceManager manages async loading and caching of resources.
// Basically, it maintains a map of fileNames to URI for the resource.
// When a request for resource fileName is received, the uri ... | true |
7436de2615f25f93bbdd6368a23f5da80439f954 | JavaScript | Sciulio/planetary-weight-home | /src/code/helpers/controls.js | UTF-8 | 1,826 | 2.640625 | 3 | [] | no_license | import { emitEvent, registerEvents } from './events'
import { addHtmlFunc } from './bfunctions'
import { randName } from './utils'
export const effectPcText = (text, onEvent, thenEvent, delay = 35) => {
const elId = randName("effectPcText");
let el, int;
registerEvents(
onEvent,
() => typeof text == 'fun... | true |
048fe4f23342ee947e6e5aecb85810bd7d766ba7 | JavaScript | QBE256/RecoverySupport | /recovery_support.js | UTF-8 | 17,879 | 2.59375 | 3 | [] | no_license | /*--------------------------------------------------------------------------
ターン開始時に範囲回復、範囲ダメージができるようになるスクリプト ver 2.3
■作成者
キュウブ
■概要
スキル「支援」でターン開始時に範囲回復、範囲ダメージができるようになるスクリプトです。
例えば、
・毎ターンxマス以内にいる味方のHPを回復する
・毎ターンxマス以内にいる敵のHPを削る
といった使い方ができます。
敵勢力支援スクリプトrival_support.jsと組み合わせるとカスタマイズ性が広がります。
■使い方
スキル「支援」のカスタムパラメータで
・敵勢に... | true |
2e2bb23a2e87ca4866ab28af85af2c2ded52f3e9 | JavaScript | andynicoo/loading | /Space-Pinball/assets/subpackages/script/magnet.js | UTF-8 | 2,184 | 2.515625 | 3 | [] | no_license | //磁铁吸引小球控制类
cc.Class({
extends: cc.Component,
properties: {
isTouchedBall: false,
type: "left"
},
//加载完成
onLoad() {
//引入公共音源类
this.audio = cc.find('audio').getComponent('audio');
},
//碰撞开始
onBeginContact(contact, self, other) {
if (other.node.name ... | true |
4ce104fd048311ba64373ec174d12bd0eb56a856 | JavaScript | pmg0738/CryptSharingFront | /src/redux/actions/index.js | UTF-8 | 887 | 2.59375 | 3 | [] | no_license | import _ from 'lodash';
import apis from '../apis';
// 商品の一覧を取得 ItemList
export const fetchItems = (searchWord) => async dispatch => {
const response = await apis.get('items/', {
// params: { name: searchWord },
});
// item の item_idをキーにするハッシュマップを作る
// _.mapKeys([{id: 1}, {id: 2}], v => v.id); // => { 1: {... | true |
3a397c8a5e76c84096434d9164047d84b395546d | JavaScript | arabog/everySm28 | /index.js | UTF-8 | 2,196 | 4.65625 | 5 | [] | no_license | /*
Coding in function ```mirrorImage```. function accept 1
parameter ```arr```, it's a number array. Your task is
find the first pair of mirror-image number and return as
an array. The two number must be adjacent, and the
returned array is in accordance with the order from left to right.
What's the mirror-image nu... | true |
ad252ed87512850280a6212954b98c13806fb7c6 | JavaScript | yunwei1237/StudentManager | /src/main/webapp/js/myjs/personModifyInfo.js | UTF-8 | 1,988 | 2.5625 | 3 | [] | no_license | $(function() {
getPersonnel();
updatePersonnel();
});
function getPersonnel(){
var id = $("#id").val();
var params = "{\"id\":\""+id+"\"}";
$.postJson("person/getPersonnel.do",params,function(result){
var person = result.objs.person;
var clazzs = result.objs.clazzs;
if(person){
$("#name").val... | true |
5a4daa71d0f9ea5f7847d25bad28983c992c518a | JavaScript | JiXiangChua/code_exp_demo-events-app | /screens/EventScreen.js | UTF-8 | 2,051 | 2.859375 | 3 | [] | no_license | import * as React from "react";
import { Text, View, Button } from "react-native";
import { createStackNavigator } from "@react-navigation/stack";
function EventsScreen({ navigation }) {
// grabbing the property that they want instead of writing props.navigation. This is destructuring, grabbing that stuff and assign... | true |
4cf5dc5afd0b0725dfbae76b4126f6126f78a6e4 | JavaScript | marinDaniele/pragma_premi | /Premi/premi_src/Premi/public/modules/premi/test/unit/model/node/TU65.js | UTF-8 | 2,189 | 2.84375 | 3 | [] | no_license | /**
* File: TU65.js
* @author fvedovato - blacky_grp@yahoo.com
* Data: 2015-05-16
* Descrizione: Test di unità TU65 Premi::Front-End::Model::Node
*/
'use strict';
describe('TU65 Premi::Front-End::Model::Node', function(){
var nodeContent1 = new NodeContent(0,'text_content',1,2,100,200,'text');
var nodeContent2 =... | true |
127e612ab69e2c5b9047ff6db7251cda6a031f7e | JavaScript | gitter-badger/mimodal | /public/js/demo.js | UTF-8 | 1,230 | 3.015625 | 3 | [] | no_license | // var buttons = document.getElementsByTagName('button'),
// buttonCallbacks = [
// function() {
// var button = this;
// // button.modal = modal.dialog();
// modal.dialog.apply(button);
// // console.log([button]);
// }
// ];
// for (var i = 0; i < buttons.length; i++) {
// butto... | true |
9462029e2b3c4e4df09426f4a6e9502495f06294 | JavaScript | feychou/ice-cream-saga | /redux/assignment/src/features/colorsSlice.js | UTF-8 | 1,768 | 2.71875 | 3 | [] | no_license | import { createSlice } from '@reduxjs/toolkit';
export const colorsSlice = createSlice({
name: 'colors',
initialState: {
data: [{
id: '#F6A7DC',
isSelected: true
},
{
id: '#F7F25D',
isSelected: false
},
{
id: '#90F9E8',
isSelected: false
}... | true |
d2f3055cef3af7f28eafcccb59dc1be9996bc0a8 | JavaScript | devinspire-gitch/simple-express | /src/client/js/nameChecker.js | UTF-8 | 495 | 2.796875 | 3 | [] | no_license | function validCityNames(cityDepart, cityArriving) {
console.log("check names valid ", cityDepart, cityArriving);
//this regular expression from https://www.regextester.com/94502
//ther are alot of ------------
//var regex = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/... | true |
2bb3bb8cfc448776e90decf99f573892bda7fba7 | JavaScript | starBastet/disemvoweled | /src/views/gameScreen/PuzzleInput.js | UTF-8 | 2,983 | 2.6875 | 3 | [] | no_license | import React, {Component} from 'react';
import './PuzzleInput.css';
class PuzzleInput extends Component
{
constructor(props,context)
{
super(props,context);
this.state={
solved:false,
className:'',
inputClassName:'',
focusField:this.props.focusField,
blurField:this.props.blurField
};
th... | true |
537bcfb9c5979e8dd18a5799e592625096969fb9 | JavaScript | MSghais/cube_mono_repo | /assets/react_app/mobile/store/reducers/resources/stateResourceReducer.jsx | UTF-8 | 518 | 2.734375 | 3 | [] | no_license | /**
* author: JamesStandbridge
* date: 22/01/2021
*/
const initialState = {
resourceStates: [],
isUpdated: false
}
function ResourceUserStateHandler(state = initialState, action) {
switch(action.type) {
case 'REPLACE_STATES':
return {...state, resourceStates: action.resourceStates, isUpdated: true}
ca... | true |
624b74a773f21e7ab708db3faccc3fc96e3ad886 | JavaScript | nazeeeh/Employee-time-sheet | /assets/js/employee_details.js | UTF-8 | 1,335 | 2.953125 | 3 | [] | no_license |
let islogged_In_Employee = JSON.parse(localStorage.getItem("current_EmployeeUser"));
// function to employee user details
if(islogged_In_Employee[0].user_type.toLowerCase() == "employee")
{
employeeDetails()
}
function employeeDetails()
{
// this displays the user type on the dashboard node with id "role_dis... | true |