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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7d916e983c797e00e8b8b8eb203e5d542245626e | JavaScript | rezac78/SliderShow | /script.js | UTF-8 | 701 | 2.984375 | 3 | [] | no_license | var currentIndex = 1;
var $ = document;
function displaySlide(imgIndex) {
currentIndex = imgIndex;
var slides = $.getElementsByClassName("slide");
var dots = $.getElementsByClassName("dot");
var slNo = $.getElementById("slideNo");
if(currentIndex > slides.length) {
currentIndex = 1;
}
if(currentIndex... | true |
91132f894073fa36b2146bf4b0f29d95da993bd4 | JavaScript | Sylphide/es6-skeleton | /src/main.js | UTF-8 | 273 | 3.46875 | 3 | [] | no_license |
const width = parseInt(readline()); // the number of cells on the X axis
const height = parseInt(readline()); // the number of cells on the Y axis
for (let y = 0; y < height; y++) {
let line = readline(); // width characters, each either 0 or .
}
print('0 0 0 1 1 0'); | true |
6c8d4c4ec8a171dc49632a97d2f0134643c604fc | JavaScript | heisehuoyan/my-promisa | /promise-finally.js | UTF-8 | 1,521 | 3.640625 | 4 | [] | no_license | //是原型的finally, 无论如何都会执行,可以继续向下执行
Promise.prototype.finally = function (cb) {
return this.then(
(data) => {
// 如何能保证promise执行完成
// cb()里面可能有promise,则需要等待cb()里的promise执行完成,使用Promise.resolve实现等待cb()里的promise执行完成
// data使用最外层的resolve返回的值
return Promise.resolve(cb()).then(() => data);
},
... | true |
d888ced07abb9ab8e5808e22122c3497fd4a7372 | JavaScript | TeodorSK/dispatch-react-app | /src/components/NewTaskInput/NewTaskInput.js | UTF-8 | 2,799 | 2.703125 | 3 | [] | no_license | import React, { useState } from 'react'
const NewTaskInput = ({cellFunction, closeModal, placeholders, id, deleteTask, isTask}) => {
const [taskType, setTaskType] = useState(placeholders.taskType);
const [startTime, setStartTime] = useState(placeholders.start);
const [endTime, setEndTime] = useState(placeholders... | true |
f2c2e51a30e064ff1c2f2a2aa646008af2caf6fa | JavaScript | EliseoRom/FT15a-PI-Videogames | /client/src/components/CreateGame/CreateGame.jsx | UTF-8 | 9,942 | 2.65625 | 3 | [] | no_license | import React, { useState } from "react";
import s from "./Create.module.css";
import Navbar from "../NavBar/NavBar";
import axios from "axios";
//---------FUNCTION CREATE GAME----------//
function CreateGame() {
const [errors, setErrors] = useState({ form: "complete form" });
const [form, setForm] = useState({
... | true |
1e8e3965dc5cdabcb12abdcb221ab218d10752f8 | JavaScript | nikasepiskveradze/Social-Network-js | /src/assets/js/modules/Register.js | UTF-8 | 1,259 | 2.671875 | 3 | [] | no_license | import http from '../lib/EasyHTTP';
import modal from './Modal';
import User from './User';
class Register {
constructor() {
this.regName = '#reg-name';
this.regLastname = '#reg-lastname';
this.regEmail = '#reg-email';
this.regPassword = '#reg-password';
this.regBirth = '#reg-birth';
this.mal... | true |
a19c8cb10319674b4de782896b9bbeb6c5e78e84 | JavaScript | ArjunAranetaCodes/MoreCodes-EcmaScript | /Conversions/problem12.js | UTF-8 | 151 | 3.5625 | 4 | [] | no_license | //Problem 12: Write a program that converts numbers of day to seconds.
var day = 1;
var seconds = day * 24 * 60 * 60;
console.log(seconds.toString());
| true |
98aa3113a8b047d47fa158df2030d430aaaf9651 | JavaScript | gregorykx/regularexpressions-book | /chapter4/variabledistance.js | UTF-8 | 128 | 2.515625 | 3 | [] | no_license | var patt = /\b(there)\W+(?:\w+\W+){1,5}?\1\b/;
var text = "here and there is like there and here";
console.log(patt.test(text)); | true |
814f139177da44fa8875f3f4304b0af2ed7e3d24 | JavaScript | angelocerqueira/consultorioJa | /public/js/dropzoneInit.js | UTF-8 | 731 | 2.640625 | 3 | [
"MIT"
] | permissive |
export default function dropzoneInit(){
var myDropzone = new Dropzone("div#my-awesome-dropzone", { url: "uplaod.php"});
myDropzone.on("complete", function(file) {
myDropzone.removeFile(this);
});
Dropzone.options.myAwesomeDropzone = {
paramName: "file", // The name that will be used to transf... | true |
9af69b6efb7630e4b9afa1ff6fba665b1e84a087 | JavaScript | TSalminen/Full-Stack-Open-2019 | /osa2/maiden_tiedot/src/App.js | UTF-8 | 3,115 | 2.890625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
//import axiosService from './services/axiosService'
import axios from 'axios'
const ShowCountries = ({countriesToShow, setCountriesToShow}) => {
if (countriesToShow.length > 10) {
return <div>Too many matches, specify another filter</div>
} else if (countri... | true |
b30acfa133b37b3eca23d4385e00de0a41cd8e4a | JavaScript | FlowerCake13/new | /js/app.js | UTF-8 | 233 | 2.703125 | 3 | [] | no_license | console.log("afahofe");
function test() {
var colors = ["#00ff00", "#00cc00", "#99ff99"];
var divs = document.getElementsByTagName("div");
for(var i = 0; i< colors.length; i++){
divs[i].style.backgroundColor = colors[i];
}
}
| true |
9f217379a829085a97195d48e7cf5696dc16a597 | JavaScript | wdluft/social-media-dashboard-with-theme-switcher | /script.js | UTF-8 | 353 | 3.0625 | 3 | [] | no_license | const themeToggle = document.querySelector('.themeSliderToggle__label');
console.log(themeToggle);
const body = document.body;
const toggleTheme = () => {
if (body.classList.contains('lightTheme')) {
body.classList.remove('lightTheme');
} else {
body.classList.add('lightTheme');
}
};
themeToggle.addEven... | true |
afc4ebcac494d65dfd88d35b4d124524c35dc95c | JavaScript | qingaoti/Trainer | /JStest/co-test.js | UTF-8 | 7,881 | 3.1875 | 3 | [
"MIT"
] | permissive | var co = require('co');
var fs = require('fs');
var encode ={
encodind:"utf-8"
}
/**
* 1 .. 异步串行调用 ---不用流程控制的结果
*/
fs.readFile('test/one.txt', function (err, data) {
if (err) throw err;
console.log(data.toString());
});
//
//fs.readFile('test/two.txt', function (err, data) {
// if (err) throw err;
/... | true |
fa5be1025b674a14a0bbccbae43fa05fec5ac72f | JavaScript | iabreuda/Hackathon | /www/js/service.js | UTF-8 | 3,691 | 2.515625 | 3 | [] | no_license | var BackendService = function( config ) {
var self = this;
var APPLICATION_ID = '3F45B053-F438-3A64-FF3B-5662C23EAC00';
var SECRET_KEY = '3094F20A-BA0F-5777-FF98-9172F1668500';
var VERSION = 'v1';
var cache;
this.initialize = function () {
var d = $.Deferred();
Backendless.ser... | true |
a1757f8aa347ebad8e6fb2babbd92df4aa64f8c7 | JavaScript | orema10/pokemon | /frontend/src/services/userService.js | UTF-8 | 951 | 2.5625 | 3 | [] | no_license | import axios from 'axios';
const BASE_URL = (process.env.NODE_ENV !== 'development')
? '/user'
: '//localhost:3000/user';
export default {
query,
addUser,
updateUser,
removeUser,
getUserById,
}
function query(filterBy = { id: '', name: '' }) {
let queryParams = '';
if (filterBy.id... | true |
224758976e4894d79c6dd9aeb38c579415961f2f | JavaScript | imabg/joke-generator | /app.js | UTF-8 | 767 | 3.34375 | 3 | [] | no_license | document.getElementById('btn').addEventListener('click', function(e){
e.preventDefault();
const number = document.getElementById('joke-inp').value;
const xhr = new XMLHttpRequest();
xhr.open('GET', `http://api.icndb.com/jokes/random/${number}`,true);
xhr.onload = function(){
if(this.s... | true |
0cb536d1e8a893a498352aec36453e21d0954f5c | JavaScript | anjungdae/waku | /waku/src/main/webapp/mj/map/map.js | UTF-8 | 1,855 | 2.84375 | 3 | [] | no_license | var map;
var infoWindow; // infoWindow Object를 담을 변수
var marker; // Marker Object를 담을 변수
var ns = 37.478034;
var ew = 127.184032;
// var rad = Math.toRadian(30);
// console.log(rad);
// var tangen = Math.tan(rad);
var radian = -30;
var x = M... | true |
52d0fd91584921c0bcfb13b267bc8bdfc1f1a95d | JavaScript | malachispencer/leetcode | /two-sum.js | UTF-8 | 3,116 | 4.625 | 5 | [] | no_license | /*
Leetcode. 12/02/2021. Given an array of integers and a target integer, returns the indices of the two numbers in the array which will add
up to the target. Here is the solution I used, taken from a Codewars user the first time I solved 'Two Sum' (on Codewars).
1) We create an empty object called indexOf, which will ... | true |
4e571e83a4778c0e0a5fe6e28fbf5fc896ed7ecf | JavaScript | THL20ab/scrabble-project | /js/Game.js | UTF-8 | 8,654 | 2.90625 | 3 | [
"MIT"
] | permissive | import Player from "./Player.js";
export default class Game {
players = [];
currentPlayer = '';
async start() {
this.createFormAndShowInStartPage();
this.startGameButtonListener();
this.buttonWork();
await this.tilesFromFile();
}
startGame() {
this.createBoard();
this.currentPlayer ... | true |
6365b1e9d32a66a7afd7cd6db5de228d1b184271 | JavaScript | bhsgsh10/dinosaur_names | /static/viewdata.js | UTF-8 | 2,217 | 2.671875 | 3 | [] | no_license | var callOnLoad = function() {
$.each(dinos, function(index, dino){
//build the HTML for each of the search results
var idx = dino["id"] - 1
var container_div = "<div class='container dino'>"
var row_div = "<div class='row'>"
//var result_div = "<div class='result'>"
v... | true |
107a3cf9c15b829cac9b1bad2477023583eebe83 | JavaScript | averynortonsmith/HTMLViews | /src/main.js | UTF-8 | 7,377 | 2.640625 | 3 | [] | no_license | // start by hiding all elements that have '[data-view-show]'
// to prevent a flash-of-unstyled-content
(function(){
var elements = document.querySelectorAll('[data-view-show]')
Array.prototype.forEach.call(elements, function(el, i){
el.style.display = "none"
});
}());
// get jQuery (Browserify)
var $ = require("j... | true |
0da979d2be439411adae378bb7667d00aaa33630 | JavaScript | Habernet/NeighborGood | /fortest.js | UTF-8 | 282 | 3.65625 | 4 | [
"MIT"
] | permissive | var stuff = [10, 34, 56, 67, 93, 120, 137, 168, 259, 280, 311, 342, 413, 514];
var random_value = stuff[Math.floor(Math.random() * 14)];
for (let i = 0; i < stuff.length; i++) {
if (stuff[i] === random_value) {
console.log("Found " + random_value + " at index: " + i);
}
}
| true |
cfffefa3acb402ddf19e0aa5213175da65c89b08 | JavaScript | gloer/gloer.github.io | /it2/eksamen/h2018/oppgave-1/index.js | UTF-8 | 1,824 | 2.90625 | 3 | [] | no_license | // DOM-elementetr
const skjema = document.querySelector("#skjema");
const rbBarn = document.querySelector("#rbBarn");
const rbVoksen = document.querySelector("#rbVoksen");
const inpAntallDager = document.querySelector("#inpAntallDager");
const visType = document.querySelector("#visType");
const visDagpris = document.qu... | true |
1a2417a0e54c3d83aec25ee15a7181e81bfa9db8 | JavaScript | yanntyb/Exo-72-JS-DOM-2 | /exo 3/exercice.js | UTF-8 | 226 | 2.921875 | 3 | [] | no_license | let listDiv = document.getElementsByClassName("name-tag");
for(let i of listDiv){
let newP = document.createElement("p");
newP.innerHTML = "Hello !";
newP.style.bottom = "0px";
i.appendChild(newP);
}
| true |
e1dc13a5fae1393dfbf9fa68c64ecbae1b4d467d | JavaScript | amirsaeed671/slack-message-logging | /src/index.js | UTF-8 | 545 | 2.515625 | 3 | [
"MIT"
] | permissive | require("dotenv").config();
const { app } = require("./app");
const { port } = require("./constants");
const { postAsUser } = require("./postAsUser");
const moment = require("moment");
(async () => {
await app.start(port);
console.log("app is running on port", port);
})();
let i = 0;
let timer = null;
timer = se... | true |
864eedfe9978178af8c4e60e85748a09d34ade00 | JavaScript | aweijnitz/led-run-pi | /test/test.Player.js | UTF-8 | 1,268 | 2.59375 | 3 | [] | no_license | const assert = require('assert');
const Player = require('../lib/Player').Player;
const PM = require('../lib/Player');
const MAX_POS = require('../lib/World').MAX_POS;
describe('Player', function () {
describe('reduceLife', function () {
it('should reduce lives left by one', function () {
let ... | true |
6f209d1609b3ef7c098278e51f14c0de5cd39591 | JavaScript | Lmangoxx/react-web | /js/lib/mainFun.js | UTF-8 | 7,487 | 2.84375 | 3 | [] | no_license | /**
****** mainFun()公共功能构造 ******
@ 基于jquery
@ 里面为网站公共功能函数
@ 函数名称遵循驼峰命名规则,ex:goToUp()
@ author: 277040350@qq.com
@ 创建时间2016-5-10
*/
var $ = require('jquery');
var mainFun = function(){
'use strict'; //符合ECMAScript 5标准
this.versions = "1.1.0"; //版本号
this.loading = $('<div class="loading-gif"></div>'); //loa... | true |
3c4e57e0b2cbd2f408369425074b8d74883fe21b | JavaScript | spearwolf/ecs | /src/utils/toJSON.js | UTF-8 | 363 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive |
export const toJSON = (obj) => {
if (obj == null) {
return obj;
}
const out = {};
const keys = Object.keys(obj);
keys.forEach((key) => {
const val = obj[key];
switch (typeof val) {
case 'number':
case 'bigint':
case 'string':
case 'boolean':
case 'object':
ou... | true |
a91f72b3bce4b73dfc2dca8ff99a1bdab24afdc2 | JavaScript | miclay/canvas-electronic-transition | /lib/etrans/define.js | UTF-8 | 1,032 | 2.71875 | 3 | [] | no_license | (function(win, doc){
var modules = {};
window.define = function(name, body){
body = body || function(){};
if(!modules[name]){
modules[name] = body(win, doc);
}else{
throw new Error('[' + name + '] is already exists!');
}
};
window.require = function(name){
return modules[name];... | true |
e00f70bafb2382fbd5b0f522c41920e96cb0d18b | JavaScript | million-views/praas | /praas-app/src/app/components/form-fields/error-message.js | UTF-8 | 1,892 | 2.875 | 3 | [
"MIT"
] | permissive | import React from 'react';
// Experimental
function _get(object, path, defaultValue) {
// function arr_deref(o, ref, i) {
// return !ref ? o : (o[ref.slice(0, i ? -1 : ref.length)]);
// };
function isObject(o) {
return o && typeof object === 'object';
}
function isObjectEmpty(o) {
return Object.... | true |
ee70f8768c6f90118a3da5ead6c78b15be1a3df4 | JavaScript | Shogi-Grandmasters/shogi-grandmasters | /socket-server/src/lib/matchLog.js | UTF-8 | 968 | 2.65625 | 3 | [] | no_license | import { boardIds, oppositeBoardSide } from './constants';
import { reverseBoard } from './boardHelpers';
const rowLabel = (x) => x + 1;
const columnLabel = (x) => Math.abs(x-8) + 1;
const logCoords = ([x, y]) => `${rowLabel(x)}${columnLabel(y)}`;
const reflectOrientation = (board, from, to) => {
return {
board... | true |
5eb5a9095862b80ed8a2781e4366fc07c431fc99 | JavaScript | OKNoah/endless-cosby | /public/js/scripts.js | UTF-8 | 784 | 3.09375 | 3 | [] | no_license | // fills the screen with cosbys before any scrolling. based on height of window and the .container element.
var originalHeight = $(window).height();
// calls /row with ajaxs and prints html result
function getRow() {
$('.loading').show();
$.ajax({
url: 'row?' + new Date().getTime(),
success: function(html) {
$... | true |
dbfd6302cfcc75b950886570628982686550dbb9 | JavaScript | Ricardo-VR/A01746958_Graficas_Computacionales | /Sierpinski/triangulo.js | UTF-8 | 1,655 | 3.8125 | 4 | [] | no_license | class Triangle{
constructor(x, y, len){
this.x= x;
this.y = y;
this.len = len;
}
draw(context){
context.fillStyle = "white";
context.beginPath();
context.moveTo(this.x, this.y);
context.lineTo(this.x + this.len / 2, this.y - this.len * Math.sin(Math.... | true |
df74028b4269f537ab1d3b58d1fcfedb48e09ae8 | JavaScript | fr-quoctv/CNQ-API | /api/services/GmailService.js | UTF-8 | 1,447 | 2.625 | 3 | [] | no_license | 'use strict';
/**
* Execute Send mail with Gmail
*/
const nodemailer = require('nodemailer');
/**
*
* @param {object} options
* {string} to : email address of receiver
* {string} from : email address of sender < e.g noreply@tokuby.vn >
* {string} subject : title of email
* {string} h... | true |
7c5e548b99ca6bb9a3c079dfc75afe40e7e2eef6 | JavaScript | praewiiezzz/SensorTest | /index.android.js | UTF-8 | 2,284 | 2.671875 | 3 | [] | no_license | /**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
DeviceEventEmitter
} from 'react-native';
import { SensorManager } from 'NativeModules';
export default class SensorTest extends C... | true |
93a8be7ff90f2eff430a03ec7e03130dadc94eb3 | JavaScript | gustavoaz7/OSSU-Computer-Science | /Nand2Tetris/08/vmTranslator.js | UTF-8 | 1,526 | 2.546875 | 3 | [] | no_license | const fs = require("fs");
const path = require("path");
const { parse } = require("./parser");
const { translateInstructions, translateBootstrap } = require("./translator");
const TRAILING_SLASH_REGEX = /\/$/;
const SYS_INIT_REGEX = /^\s*function\s+Sys\.init\s+0\s*$/m;
function getPathsFromInput() {
const inputPat... | true |
d16ad95c1fabba7a1fa36612a156887e069b0e71 | JavaScript | rgpriede/javascript | /hola-mundo/js/21-funciones-anonimas.js | UTF-8 | 616 | 4.25 | 4 | [] | no_license | 'use strict'
// funciones anonimas : es una funcion sin nombre
var pelicula = function(nombre){
return "La pelicula es "+ nombre;
}
function sumame(num1,num2, sumaYmuestra, sumaPorDos){
var sumar= num1+num2;
sumaYmuestra(sumar);
sumaPorDos(sumar);
return sumar;
}
sumame(2,5, function(dato){
console.log("La... | true |
fb80da3fdedc08f6fb3760da1ed52fd36b7e19de | JavaScript | acarstoiu/phones | /tst/phone.js | UTF-8 | 4,983 | 2.765625 | 3 | [] | no_license | 'use strict';
const assert = require('assert').strict;
const { clone } = require("../src/toolbox");
const DB_KEY = "phn";
const ONE_PHONE = {
type: "MOBILE",
color: "BLACK",
serialNo: "one",
metadata: { a: "secret" }
};
const ANOTHER_PHONE = {
type: "LANDLINE",
color: "BLACK",
serialNo: "another",
metadata... | true |
a11610c85cd4c3d37d63e7c73e0a70169dd3a5c1 | JavaScript | michellebholland/recoil-demo-todo | /demo-todo/src/store/store.js | UTF-8 | 4,330 | 2.6875 | 3 | [
"MIT"
] | permissive | import { selector } from 'chromogen';
import { todoListState, todoListFilterState, todoListSortState, quoteNumberState } from './atoms';
/* ----- SELECTORS ---- */
// filtered todo list
const filteredTodoListState = selector({
key: 'filteredTodoListState',
get: ({ get }) => {
const filter = get(todoListFilter... | true |
0d023c972e4c08a1a23d1136297c4d4879c886ba | JavaScript | henryaraujo/phpfuncional-backtofront | /JSFuncional/filter/filter.prototype.js | UTF-8 | 399 | 2.890625 | 3 | [] | no_license | const { books } = require("../books.js");
Array.prototype._filter = function (f) {
let result = [];
this.forEach((item) => {
if (f(item)) {
result.push(item);
}
});
return result;
};
//const booksMaxPages = books._filter(book => book.pages > 400);
const funcBookMax = (book) => book.pages > 400;
... | true |
d5ce3793af6a988e43c798dfdb972a3a24f2a6e3 | JavaScript | C-Coding/sketchpad | /src/Tools/Polygon/index.js | UTF-8 | 6,717 | 2.640625 | 3 | [] | no_license | import NumSlider from '@/components/Slider/NumSlider';
import SizeSlider from '@/components/Slider/SizeSlider'
import ColorSlider from '@/components/Slider/ColorSlider';
import s from './index.less';
import html from './index.html';
class Polygon {
constructor({ frontCanvasEl, frontCanvasCtx }) {//接收Sketchpad传递的... | true |
b8aabfe06915ca9beae850dfcc038f7e90cd1bf3 | JavaScript | smeky42/c3wahlcomputer | /site/script.js | UTF-8 | 311 | 2.984375 | 3 | [] | no_license | function feel(feeling) {
console.log(feeling);
// HTTP-POST
let request = new XMLHttpRequest();
request.open('POST', '/api.php', true);
request.setRequestHeader('Content-Type', 'application/json');
let body = {
"feeling": feeling
}
request.send(JSON.stringify(body));
}
| true |
5a81fa277e40aa4c1d8834af33c00aff21d51f3f | JavaScript | UlisesGascon/node | /benchmark/http/bench-parser.js | UTF-8 | 1,386 | 2.546875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"LicenseRef-scancode-unicode",
"ISC",
"NAIST-2003",
"NTP",
"Autoconf-exception-generic",
"BSD-3-Clause",
"ICU",
"Apache-2.0",
"GPL-1.0-or-later",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"CC0-1.0",
"Artistic-2.0",
"GPL... | permissive | 'use strict';
const common = require('../common');
const bench = common.createBenchmark(main, {
len: [4, 8, 16, 32],
n: [1e5],
}, {
flags: ['--expose-internals', '--no-warnings'],
});
function main({ len, n }) {
const { HTTPParser } = common.binding('http_parser');
const REQUEST = HTTPParser.REQUEST;
con... | true |
cbf6b8b12ed7a10d33d05f59070d6500269009b2 | JavaScript | Aseelwadi/Jordanian-Culture | /js/celebrations.js | UTF-8 | 1,644 | 2.875 | 3 | [
"MIT"
] | permissive | 'use strict';
function NewCelebrationSection( title, text, path ) {
this.title = title;
this.text = text;
this.path = path;
}
NewCelebrationSection.all = [];
function runderCelebration() {
const parentElement = document.getElementById( 'newCelebrationContent' );
for ( let i = 0; i < NewCelebrationSecti... | true |
9b61e8be609061f60e5e9ec0b277e2e2fcd0f6ef | JavaScript | AntoineS92/Fleet-movieList | /src/App.js | UTF-8 | 1,604 | 2.71875 | 3 | [] | no_license | import React, { Component } from "react";
import MoviesList from "./components/Movies";
class App extends Component {
state = {
moviesList: [],
};
//here we import the JSON file from the URL with the fetch method
componentDidMount() {
fetch(
"https://s3.us-west-2.amazonaws.com/secure.notion-sta... | true |
086ce11eabff6a415c38ece17735763e721e3c2b | JavaScript | gauravsharmasfdc/lwc-input-multiselect-picklist | /force-app/main/default/lwc/lightningInputMultiselectPicklist/lightningInputMultiselectPicklist.js | UTF-8 | 2,555 | 2.578125 | 3 | [] | no_license | import { LightningElement, track, api } from "lwc";
export default class LightningInputMultiselectPicklist extends LightningElement {
@api label;
@api items;
@track listItems;
@track selectedItems = [];
connectedCallback() {
this.listItems = JSON.parse(JSON.stringify(this.items));
this.loadSelectedI... | true |
a9de166c470ea0b6a211fa22a7c539d6e413ddb7 | JavaScript | kauri-2016/tmatl | /js/index.js | UTF-8 | 806 | 2.75 | 3 | [] | no_license | import request from 'superagent'
import challengeList from '../views/challengeList.hbs'
import completedList from '../views/completedChallenges.hbs'
const showList = (err, res) => {
const placeholder = document.getElementById('placeholder')
placeholder.innerHTML = challengeList(res.body)
}
const getList = () => {... | true |
0e706c65c8c7ad947e763b36acf594087eed1241 | JavaScript | ashin54/TY_BCITS_ELF_BATCH1_JFS_ASHINJIMMY | /usecasebcits/src/main/webapp/assets/js/paymentP.js | UTF-8 | 841 | 2.734375 | 3 | [] | no_license | var cName=document.getElementById("Name");
var cNumber=document.getElementById("cNumber");
var pTag=document.getElementById("pele");
var pTag2=document.getElementById("eele");
let numberV = cNumber.match(/[0-9]/)
function validateForm() {
if ((cNumber.value.trim().length!=16) && (numberV ==null) ) {
... | true |
c9c77ce134a6d0d6f626304f3c645b1190a588b6 | JavaScript | crypto-maven/movie_api | /client/src/components/main-view/main-view.jsx | UTF-8 | 1,527 | 2.71875 | 3 | [] | no_license | import React from "react";
import axios from "axios";
import { MovieCard } from "../movie-card/movie-card";
import { MovieView } from "../movie-view/movie-view";
import { LoginView } from "../login-view/login-view";
import Row from "react-bootstrap/Row";
import Col from "react-bootstrap/Col";
export class MainView ext... | true |
5f4294989cc8fadd938997baf78fee5cd4267069 | JavaScript | backmeup/peripleo-wrapper | /app/assets/javascripts/peripleo-ui/urlBar.js | UTF-8 | 3,894 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | /** In charge of updating the URL bar hash segment with current map & search settings **/
define(['peripleo-ui/events/events'], function(Events) {
// Make sure we don't update the URL bar too frequently as it
// introduces noticable delays
var SLEEP_DURATION = 1000;
var URLBar = function(eventBroker) {
v... | true |
a0c2f7108098783284fe1b4a96cca48f9fb98e20 | JavaScript | anyathedeveloper/mesto | /src/script/script.js | UTF-8 | 3,435 | 2.6875 | 3 | [] | no_license | import {
Card
} from "./card.js";
import {
CardList
} from "./cardlist.js";
import {
Api
} from "./api.js";
import {
Popup
} from "./popup.js";
/* переменные */
const serverUrl = NODE_ENV === 'development' ? 'http://praktikum.tk/cohort4' : 'https://praktikum.tk/cohort4';
const placesList = document.... | true |
6856cb59e0ce0633c59cc82ea993afd87bc6083c | JavaScript | axecopfire/southern-dev | /src/js/main.js | UTF-8 | 6,584 | 2.640625 | 3 | [] | no_license | window.onload = function () {
if(document.getElementById("slides")) {
$('.fade').slick({
speed: 1000,
autoplaySpeed: 15000,
autoplay: true,
fade: true,
arrows: false,
cssEase: 'linear'
});
}
const logo = document.querySelector(".logo"),
hamburger = document.query... | true |
c29b209da25303dea4fe458f5c9f58ee60cafc22 | JavaScript | sfoster/Roaming | /src/client/vendor/store/lib/knockout.composeWith.js | UTF-8 | 1,983 | 3.140625 | 3 | [] | no_license | define(['lang', 'knockout'], function(lang, ko){
function isObservableArray(thing) {
return (
'function' === typeof thing.valueWillMutate &&
'function' === typeof thing &&
(thing() instanceof Array)
);
}
ko.extenders.composeWith = function(target, functions) {
// target is the orig... | true |
f94811c3a50ad6fde31d51dc24a4b187a181ff4f | JavaScript | yizhiyan1992/Udemy-the-complete-javascript-course-2021 | /Section7/modal/script.js | UTF-8 | 824 | 2.8125 | 3 | [] | no_license | 'use strict';
const layer = document.querySelector('.overlay');
const modal = document.querySelector('.modal');
const modalCloseBtn = document.querySelector('.close-modal');
const modalButtons = document.querySelectorAll('.show-modal');
const openModal = function () {
modal.classList.remove('hidden');
layer.class... | true |
4dc2d38baf7a3c7e7520ded191cbe23e0d0e07b5 | JavaScript | sarvex/javascript-puzzles | /1.js | UTF-8 | 382 | 3.765625 | 4 | [
"BSD-3-Clause"
] | permissive | // problem: why does Ralph only bark once?
// fix it to make Ralph bark twice!
var Dog = function( name ) {
this.name = name
}
Dog.prototype.bark = function() {
console.log( this.name )
}
// make a new instance of a Dog
var ralph = new Dog('Ralph')
// make Ralph bark once immediately
ralph.bark()
// in 1 secon... | true |
266af910bc08b6a091db4597ca097bce21204b29 | JavaScript | alexvanmanen/backbonetraining | /js/events.js | UTF-8 | 235 | 2.78125 | 3 | [] | no_license | let person = {
name: 'Remy',
age: 33,
speed: 4,
walking: function (){
this.trigger('trigger')
}
}
_.extend(person, Backbone.Events);
person.on('trigger', function () { console.log('hallo functieee') });
| true |
e37eeb82fbb93127c81d224f9812877aa460b23b | JavaScript | joeltankam/checkif.js | /src/is/arithmetic.js | UTF-8 | 997 | 3.015625 | 3 | [
"MIT"
] | permissive | import { isNumber } from './types';
/**
* Determines whether a given value is even
* @param {*} value the value to check
* @returns {Boolean} `true` if the value is even; otherwise, `false`
*/
export function isEven(value) {
if (!isNumber(value)) return false;
return value % 2 === 0;
}
/**
* Determines w... | true |
dfea24b055ecf6fe875e514c5f072f16cf4cbc03 | JavaScript | ilyai/oojs | /class.js | UTF-8 | 1,194 | 2.796875 | 3 | [] | no_license | /**
* Class.js
* JavaScript inheritance
* (c) 2013 Ilya Igonkin
* Licensed under the MIT license
*/
(function(window, undefined) {
var Class = window.Class = function() {};
var has = Object.prototype.hasOwnProperty;
Class.inherit = function(Parent, protoProps) {
var Child = (protoProps && has.call(pro... | true |
b733eac7451c5c6083127b687fe3f8fa8d0041cf | JavaScript | flaviannymaciel/Trybe-exercises | /exercises/introducao-dev/4_1/Ex5.js | UTF-8 | 536 | 4.5 | 4 | [] | no_license | /* Faça um programa que defina três variáveis com os valores dos três ângulos internos de um
triângulo. Retorne true se os ângulos representarem os ângulos de um triângulo e false caso contrário.
Para os ângulos serem de um triângulo válido, a soma dos três deve ser 180 graus.
Caso os ângulos estejam inválidos, o progr... | true |
4540a5c026427f9fd24da0bde7aecbf6ccd8ed36 | JavaScript | forelax/projects | /drop Boy/data/triangleObject.js | UTF-8 | 531 | 3.34375 | 3 | [] | no_license | function Triangle(x1,y1,x2,y2,x3,y3){
this.point1=new Point(x1,y1);
this.point2=new Point(x2,y2);
this.point3=new Point(x3,y3);
this.speed=2;
this.update=function(){
this.point1.y+=this.speed;
this.point2.y+=this.speed;
this.point3.y+=this.speed;
}
this.display=function(){
ctx.beginPath();
... | true |
9a26d0e1f2cae92c6bf567e7c3bd87c6b6bffea4 | JavaScript | alexdevero/edabit-challenges | /math/js-among-us-imposter-formula.js | UTF-8 | 170 | 2.734375 | 3 | [] | no_license | function imposterFormula(i, p) {
return Math.round(100 * (i / p)) + '%'
}
imposterFormula(1, 9) // "11%"
imposterFormula(2, 10) // "20%"
imposterFormula(3, 7) // "43%"
| true |
1fe3165b5066258598034cc910a1d0f77e1ba033 | JavaScript | vincen7tran/stock-chart-jeff | /FEC/seed.js | UTF-8 | 2,978 | 2.984375 | 3 | [] | no_license | const mysql = require('mysql');
const faker = require('faker');
const Math = require('mathjs');
const random = require('math-random');
const connectRobinhood = mysql.createConnection({
host: 'localhost',
user: 'root',
password: 'password',
database: 'robinhood_stock_chart',
});
connectRobinhood.connect((err)... | true |
31fc6f70d78e9dc826045d6fb8bf2c0a7c979800 | JavaScript | alan9518/pokedex | /src/components/pokemon/PokemonGender.js | UTF-8 | 2,068 | 3.15625 | 3 | [] | no_license | /* ==========================================================================
** Pokemon Gender Ratio Layout
** 15/04/2019
** Alan Medina Silva
** ========================================================================== */
// --------------------------------------
// Get Dependences
// ------------------------------... | true |
37ea77a53325f89a5c0e4eab75e293a6732bdc1e | JavaScript | James5955/pokedex-app | /js/scripts.js | UTF-8 | 3,259 | 3.390625 | 3 | [] | no_license | let pokemonRepository = (function () {
// This is my IIFE for pokemonList
let pokemonList = [];
let apiUrl = 'https://pokeapi.co/api/v2/pokemon/?limit=150';
let modalContainer = document.querySelector('#modal-container');
function loadList() {
return fetch(apiUrl).then(function (response) {
return ... | true |
28c26826b6298dc100f10b704cd5c738c6b7f28b | JavaScript | samWebster12/ebookExtractor | /backend/scrapers/libgen-v3.js | UTF-8 | 3,152 | 2.59375 | 3 | [] | no_license | const EbookResource = require('../classes/EbookResource');
const trimWhiteSpace = require('../utils/trimWhiteSpace');
const loadCheerio = require('../utils/loadCheerio');
const sourceWebsite = 'http://libgen.li';
function scrapeLibgen(ebookName, headers, bookIndex) {
return new Promise(async function (resolve, reje... | true |
f96c624b8d93fac96c0da5a5dc60077d2295af01 | JavaScript | firststef/RealQuest | /src/client/game/classes/Monster.js | UTF-8 | 1,604 | 3.15625 | 3 | [] | no_license | class Monster{
static radius=8;
constructor(sprite, x, y, velocity,hp, type) {
let id = getUniqueId();
this.sprite = sprite;
sprite.mType = type;
if (type === "Red") {
sprite.projectileTimer = 2 * Math.floor((60 + Math.random() * 120));
sprite.timeToSh... | true |
1447e62a27295b21e8a97fa88d3550bc56878bfa | JavaScript | martinhilary/Curator | /views/users/feed.jsx | UTF-8 | 4,366 | 2.71875 | 3 | [] | no_license | var React=require('react')
var LayoutContainer=require('../layouts/main.jsx')
//Need to call a mthod to render html in react
//Should use map here and not controller
//Set innerHTML to the link;
//Control the DOM elements;
// <p dangerouslySetInnerHTML={ { __html: this.props.verge[i].content } } />
class feed extends ... | true |
a38f9fe70e3ee718af1bebf7edaa62f1f192ec81 | JavaScript | lsanchoc/TaxComp | /ApiDownloader/public/javascripts/runtimeTests.js | UTF-8 | 788 | 3.265625 | 3 | [] | no_license |
//bugs found and fixed
//checks for consistency in visual node array
function testNodeArrayOrder(nodeArray){
var previuosY = -100; // cords must be positive or 0
for(let i = 0; i < nodeArray.length; i++){
var node = nodeArray[i];
if(node.y <= previuosY){
return false;
}
... | true |
0cd1b9a45ab296aadb614287b1f6f653d8b51824 | JavaScript | Ankityadav/Pomodoro-Productivity-Clock | /js/mainjs.js | UTF-8 | 3,315 | 2.828125 | 3 | [] | no_license | /**
* Created by Ankit
*/
(function(){
var updateSessionTime,updateBreakTime, minutes, seconds;
var breakTime = 300;
var startTime = 1500;
var $sessionTimer = $('.sessionTimer');
var $breakTimer = $('.breakTimer');
var $clockSession = $('.clockSession');
var $clockBreak = $('.clockBreak... | true |
53e0e0ef993bd4f0ee137f1186d02bb476f35d99 | JavaScript | lucascnascimento/Codenation | /Quarto Módulo/Hora do Código 2/src/filtro-aula.spec.js | UTF-8 | 2,249 | 3.296875 | 3 | [] | no_license | const filtro = require("./filtro-aula");
const data = require("./data/data.json");
describe("Filtro", () => {
describe("Status", () => {
it("Retorna somente os vivos", () => {
const response = filtro.filterByStatus(data.results, "Alive");
expect(response.length).toBe(8);
});
it("Retorna some... | true |
a87855bb87dba675f35641051e11b07ab6042293 | JavaScript | carolynthio/seshi | /seshi-open-source/server/teamFormation.js | UTF-8 | 2,296 | 2.578125 | 3 | [
"MIT"
] | permissive | var exec = Npm.require('child_process').exec;
// var Fiber = Npm.require('fibers');
// var Future = Npm.require('fibers/future');
// var spawn = Npm.require("child_process").spawn;
Meteor.methods({
callPython: function(number, list) {
// var process = spawn('python',["/Users/carolynthio/Desktop/randomTeams.py", ... | true |
efe99b17c53ffdc4e3bb65afda2ebf79a067982a | JavaScript | Walaam126/TreasureHunt-front | /src/store/reducers/ThingReducer.js | UTF-8 | 479 | 2.59375 | 3 | [] | no_license | const initialState = {
randoms: [],
treasures: [],
fetch: true,
};
export const ThingsReducer = (state = initialState, action) => {
switch (action.type) {
case "FETCH_RANDOM":
return {
...state,
randoms: action.payload.randoms,
};
case "FETCH_TREASURE":
return {
... | true |
06853a811d39e32a05ae3089386e263472db2925 | JavaScript | toddmac12/Mr.-Roboger-s-Neighborhood | /js/scripts.js | UTF-8 | 795 | 3.78125 | 4 | [
"MIT"
] | permissive | // Business Logic
function numberRoboNumber(number) {
let numberUserOutput = [];
for (let i = 0; i <= number; i++) {
if (i.toString().includes(3)) {
numberUserOutput.push("Won't you be my neighbor?");
} else if (i.toString().includes(2)) {
numberUserOutput.push("Boop !");
} else if (i.toStr... | true |
45e33d67c0522914bcbefb2fdbffffa59abfcc35 | JavaScript | ltth1999/App_English | /src/SearchScreen.js | UTF-8 | 2,308 | 2.796875 | 3 | [] | no_license | import React, {Component} from 'react'
import {
Switch,
Text,
TextInput,
View
} from 'react-native'
import {styles} from '../components/styles'
const english2vietnam = require('../data/JsonTranslate/english_vietnam.json')
const vietnam2english = require('../data/JsonTranslate/vietnam_english.json')
export de... | true |
41b1ca9303e402ee2627d6176ef6421837e9ab4a | JavaScript | WuXiangyue1/bingxiang | /pages/utils/test.js | UTF-8 | 1,758 | 2.578125 | 3 | [] | no_license |
// // 按rssi从大到小排序
// arr.sort((first, second) => {
// if (isNaN(first.rssi) && isNaN(second.rssi)) {
// return 0;
// } else if (isNaN(first.rssi)) {
// return 1;
// } else if (isNaN(second.rssi)) {
// return -1;
// } else {
// return first.rssi < second.rssi;
// }
// }),
// // 开始冰箱的数据轮询
/... | true |
e8946c278cc92a9996fb7dfffd3638ac554514ee | JavaScript | deanssmart/react-developme-week9 | /src/bootstrap-components/PasswordStrength.js | UTF-8 | 1,231 | 2.796875 | 3 | [] | no_license | import React, { Component } from 'react';
import Form from 'react-bootstrap/Form';
export class PasswordStrength extends Component {
constructor(props) {
super(props);
this.state = { input: "" };
this.handleChange = this.handleChange.bind(this);
}
handleChange(e) {
this.s... | true |
e4edb6ee1d7714d106965aaa36009048276d1a17 | JavaScript | RafaelRCLima/LearningJavaScript | /Fundamentos/mainha.js | UTF-8 | 515 | 3.46875 | 3 | [] | no_license | function mainha(nome, idade, vontade, cabelo, unha) {
this.nome = nome
this.idade = idade
this.vontade = vontade
this.cabelo = cabelo
this.unha = unha
}
const mariaMamae = new mainha('Maria Cida', 18, 'Sossegar', 'Tem', true)
const { nome, idade, vontade } = mariaMamae
function aumentar(valor) {
... | true |
318ea06ad6827a632f63a0b887318190a3db0e80 | JavaScript | acswu/tech2704 | /final/template-p5js/sketch.js | UTF-8 | 3,810 | 2.703125 | 3 | [] | no_license | var serial;
var serialOptions = { baudrate: 115200 };
var inData;
var outData = "#000000";
var pix = [];
var millisLast;
var doAnimation = false;
var pixCounter = 0;
var rainbowStep = 0;
var aioKey = "411df6ac6fc24eb0892c6f20bcfa1e60";
var aioGroup = "Default";
var aioData = "#000000";
var aioDataLast = "#000000";
fu... | true |
c0e4fbed60df860c477d0ea22f3e9f50637f5892 | JavaScript | andrewzlee/SponsorBlockServer | /src/routes/getUsername.js | UTF-8 | 869 | 2.625 | 3 | [
"CC-BY-NC-SA-4.0",
"MIT"
] | permissive | var db = require('../databases/databases.js').db;
var getHash = require('../utils/getHash.js');
const logger = require('../utils/logger.js');
module.exports = function getUsername (req, res) {
let userID = req.query.userID;
if (userID == undefined) {
//invalid request
res.sendStatus(400);
... | true |
861bf8c705a6b7e752be9561d45376234e282863 | JavaScript | tsmarkov/JS-Core | /JS Fundamentals/IntroJS/Exercise/ImperialUnits.js | UTF-8 | 162 | 2.640625 | 3 | [] | no_license | function imperialUnits(inputInches) {
let foots = Number.parseInt(inputInches / 12);
let inches = inputInches % 12;
return `${foots}'-${inches}"`;
} | true |
12a9cdca1ad1f57b98a9b1042092286e7df2f196 | JavaScript | ohillaryzc/calendar | /calendar.js | UTF-8 | 5,790 | 3.296875 | 3 | [] | no_license | // 生成日历构造方法
/*
* @params dom(日历放置位置的DOM) fn(点击日期的回调方法) start(开始星期,默认星期天0)
**/
function Calendar ({dom, fn, start, title, shield}) {
this.dom = dom
this.clickLi = fn || function () {}
this.start = start || 0
this.title = title
this.shield = shield
let nowDate = new Date()
this.nowYear = nowDate.getFullYear... | true |
ef890d1575c1a6031bf8a0311470e6aa5c715575 | JavaScript | emanuelbalcazar/coderhouse-backend | /ejemplos/21-DBaaS/02-firebase/index.js | UTF-8 | 1,457 | 2.765625 | 3 | [] | no_license | const admin = require('firebase-admin');
const account = require('./firebase-clave.json');
admin.initializeApp({
credential: admin.credential.cert(account),
database: "coderhouse-backend.firebaseio.com"
});
console.log('Conexion a la base de datos realizada!');
async function CRUD() {
const db = admin.... | true |
26b573c4ee814d2b57fc193d768ea7a54c9a9f9f | JavaScript | tomfjug/Visualizing-3D-geology-with-React-and-X3DOM | /src/UTM/UTMSettings.js | UTF-8 | 759 | 2.9375 | 3 | [] | no_license | //Usefull values related to conversion of coordinates
export default class UTMSettings {
constructor(){
this.origin_latitude = 80.99738888888889;
this.origin_longitude = 8.228622222222223;
this.leftUTM = 381970.000;
this.upUTM = 8999810.000;
this.rightUTM = 850020.000;
... | true |
eedf99c02f37f9ff4a8e363270822a2eba93c899 | JavaScript | murilobast/paper-wall | /site/js/main.js | UTF-8 | 634 | 2.828125 | 3 | [] | no_license | var loadedImages = 0;
function imageLoaded() {
(typeof loadedImages === 'undefined')
? loadedImages = 1
: loadedImages++;
}
document.addEventListener("DOMContentLoaded", function () {
var posters = document.querySelector('.posters__list');
var images = posters.getElementsByTagName('img');
var loade... | true |
bde4b99145251a5ed6238f0feff6919240b20e6a | JavaScript | mtham8/interviewQuestions | /Coding/codingQuestions.js | UTF-8 | 918 | 4.03125 | 4 | [] | no_license | // Coding Questions:
// Question: What is the value of foo?
// var foo = 10 + '20';
// Question: How would you make this work?
// add(2, 5); // 7
// add(2)(5); // 7
// Question: What value is returned from the following statement?
// "i'm a lasagna hog".split("").reverse().join("");
// Question: What is the value o... | true |
1387d383471f3f55fb601d4195562d3937729a8b | JavaScript | zseti/snaps.js | /src/ai/pathfinder.js | UTF-8 | 21,092 | 2.953125 | 3 | [] | no_license | /*global define*/
define(['util/clock'], function(clock) {
'use strict';
/**
* @module ai/pathfinder
*/
/** Internal structure representing a point of travel along a path.
* @constructor module:ai/pathfinder.Node
* @private
* @param {Number} x X position of the node.
* @par... | true |
deeebc0e4dd6e9a0d7e7a58d437b61871531fc2a | JavaScript | mathandcrypto/cryptomath-next | /utils/object.js | UTF-8 | 478 | 3.0625 | 3 | [] | no_license | export const checkNested = (obj, structure) => {
for (let key of structure) {
if (Array.isArray(key) && key.length > 1) {
const nestedKey = key[0]
const nestedStructure = key[1]
if (
!Object.prototype.hasOwnProperty.call(obj, nestedKey) ||
!checkNested(obj[nestedKey], nestedStru... | true |
a5cacaa88493731b8ff7918391badd21410440fe | JavaScript | maksimpetrov55/maksimpetrov55.github.io | /teplpol/js/scripts.js | UTF-8 | 802 | 2.875 | 3 | [] | no_license | $(document).ready(function() {
$(".calc__btn").click(function(){
var a1 = $("#input_S").val();
var b1 = $("#select_1").val();
var b2 = $("#select_2").val();
var b3 = $("#select_3").val();
var b4 = $("#select_4").val();
var c1 = $('input[name=radio_sauna]:checked').val();
var c2 = $('input[name=radio_... | true |
417a8aa03abc625b5bd9919fad1f20361bf2ecf7 | JavaScript | Hypatia13/MIP_BigTask | /www/js/index.js | UTF-8 | 4,987 | 2.765625 | 3 | [] | no_license | /*
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); y... | true |
ea0df84e04f1dd08d9b9f78d216d2d5ba8c85835 | JavaScript | chengtianci/ctc | /js_learn/module_pattern _SINGLETON/private_var.js | UTF-8 | 671 | 3.65625 | 4 | [] | no_license | // function MyObject () {
// var privateVariable = 10;
// function privateFunction () {
// return false;
// }
// this.publicMethod = function () {
// privateVariable++;
// return privateFunction();
// }
// }
function Person (name) {
var name;
this.getName = function () {
return name;
}
... | true |
8590e59b82e11e4c36a398caeeb682bc37b39061 | JavaScript | amaidah/listings-parser | /lib/validate.js | UTF-8 | 453 | 2.84375 | 3 | [
"MIT"
] | permissive | const validateString = (value) => {
return (value != null && typeof value === 'string') ? value.trim() : null;
}
const validate = (value) => {
return (value != null) ? value : null;
}
const validateUrl = (url) => {
// check if url seems like a yelp url
if (url.includes('yelp.com')) {
// returns full url i... | true |
4469811464e35c8b7a081466b56a6a6181fa30c0 | JavaScript | hugsmidjan/qj | /src/__polyfills/Object.fromEntries.js | UTF-8 | 196 | 3.0625 | 3 | [] | no_license | if (!Object.fromEntries) {
Object.fromEntries = function (list) {
const obj = {};
[].slice.call(list).forEach((entry) => {
obj[entry[0]] = entry[1];
});
return obj;
};
}
| true |
9a79171f7f8990eed259c233df26385ad5ea8f4d | JavaScript | luckyfanghe/giftguide | /src/reducers/authReducer.js | UTF-8 | 704 | 2.578125 | 3 | [] | no_license | // @flow
import types from "../actions/types";
const initialState = {
sidebarOpened: true,
sidebarStyle: "login",
authState: ""
};
function authReducer(state = initialState, action) {
switch (action.type) {
case types.AUTH.OPENSIDEBAR:
return {
...state,
sidebarOpened: true,
s... | true |
e89068a51b580d8cee84d8fdeb25a3b427d488c9 | JavaScript | tanya247/DataStructure | /MirrorValue.js | UTF-8 | 305 | 3.484375 | 3 | [] | no_license | var mirrorValue = [];
for (let index = 0; index < 100; index++) {
let numberToString = index.toString();
if (numberToString.charAt(0) == numberToString.charAt(1)) {
let StringToInteger = parseInt(numberToString);
mirrorValue.push(StringToInteger)
}
}
console.log(mirrorValue); | true |
9f6929bafd16901dd2468fdc988fb8fec3faffb8 | JavaScript | ar600/POTR | /client/src/Catalog/catalog.js | UTF-8 | 3,494 | 2.859375 | 3 | [] | no_license | import React, { Component } from 'react';
import "./catalog.css";
import Axios from 'axios';
class Catalog extends Component{
constructor(props){
super(props);
this.state = {
listOfItems: [],
admin: Boolean,
title: "Catalog"
}
}
componentDidMount... | true |
d2122a4bb2c778157e38f0dededbc752ae989420 | JavaScript | framelunch/tableware | /lib/core/State.js | UTF-8 | 4,127 | 2.8125 | 3 | [] | no_license | 'use strict';
var
Cp = require('./Cp'),
loop = require('../utils/loop'),
Data,
State;
Data = function (value)
{
this.data = this.make(value);
this.str = '/'+this.data;
this.array = (this.data === '') ? [''] : this.data.split('/');
};
Data.prototype = {
make: function (value)
{
... | true |
b49883fc2d4378218d70d13a5cbdabbb7b923787 | JavaScript | aplot249/404blog | /backend/node/routes/blog.js | UTF-8 | 3,199 | 2.578125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
// 登录验证中间件
const loginCheck = require('../middleware/loginCheck')
const {
getList,
getBlogDetail,
getEditArticle,
editArticle,
getMyArticle,
addArticle,
delArticle,
addview
} = require('../controller/blogController')
const {
SuccessModel... | true |
99df8fa441c0a6ca6afab244c0140aa485b383d9 | JavaScript | ginabethrussell/front-end-1 | /src/components/HowTos.js | UTF-8 | 3,486 | 2.671875 | 3 | [
"MIT"
] | permissive | import React, { useState, useContext, useEffect } from "react";
import { UserContext } from "../contexts/UserContext";
import { axiosWithAuth } from "../utils/axiosWithAuth";
import {Spinner} from 'reactstrap';
import HowTo from "./HowTo";
import { Label, Input } from "reactstrap";
// component will display all exist... | true |
5ec9ee9866c730eb85ff818abd472ca11e3dfbef | JavaScript | robmorris180/robmorris.me.uk | /src/js/global.js | UTF-8 | 536 | 3.0625 | 3 | [] | no_license | function switchTheme(e) {
const variant = e.target.dataset.switch;
const root = document.documentElement;
if (variant === 'dark') {
root.style.setProperty('--black', 'white');
root.style.setProperty('--white', 'black');
e.target.dataset.switch = 'light';
} else {
root.s... | true |
f55cc6432f1836bd75a5ed7b53275dd03c1d2a4f | JavaScript | SoftHeroes/JSObfuscator | /extension.js | UTF-8 | 5,902 | 2.578125 | 3 | [
"MIT"
] | permissive | // The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
const vscode = require('vscode');
const fs = require('fs');
const JavaScriptObfuscator = require('javascript-obfuscator');
// this method is called when your extension is activate... | true |