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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
445e2a21e9c1198f9a24dd0a198dee05122f09bc | JavaScript | Abdul-Qoyyum/validation_api | /api/middlewares/not-equal-middleware.js | UTF-8 | 872 | 2.71875 | 3 | [] | no_license | const _ = require('lodash');
module.exports = (req,res,next) => {
const { rule, data, fieldLevels, successMessage,errorMessage } = req.body;
const { condition, condition_value } = rule;
//checks for not equal to
if(condition == "neq"){
//second level
if(!_.isEmpty(fieldLevels[1]) && (condit... | true |
63d424b9833cd9559d8ee588dadd59e647d0e5aa | JavaScript | ianfmc/D3Playground | /archive/boxscore.js | UTF-8 | 1,437 | 2.59375 | 3 | [] | no_license | 'use strict';
/**
function updatePoloData(data) {
angular.element(document.getElementById('polo-tables')).scope().refresh(data);
angular.element(document.getElementById('polo-tables')).scope().refresh('teamOne');
}
function showTeamOne(){
angular.element(document.getElementById('polo-tables')).scope().refresh('... | true |
3e8dbab05a522683793e3663475e7310e5988ac1 | JavaScript | airfec/Reviews-Service | /generate.js | UTF-8 | 2,153 | 2.703125 | 3 | [] | no_license | const mongoose = require('mongoose');
const faker = require('faker');
const db = require('./models');
class ReviewGenerator {
constructor() {
this.reviews = [];
}
createReviews() {
const years = [2016, 2017, 2018];
for (let i = 0; i < 100; i += 1) {
for (let j = 0; j < Math.floor(Math.random()... | true |
b9095fcf429ac4c3659db5fe010bd83fd4cfb406 | JavaScript | keyurpkhant/Viraj-Work | /js/questioncrud.js | UTF-8 | 9,057 | 2.859375 | 3 | [] | no_license | class Question {
constructor(id, category, question, options, answer) {
this.id = id;
this.category = category;
this.question = question;
this.options = options;
this.answer = answer
}
}
var questionList;
var selectedAnswer=null;
var selectedCategory1=null;
var selectedC... | true |
7f55c4c43a16a67be1beec7554cb02da1570a4ee | JavaScript | tiffanyRossyRobinson/toDo | /main.js | UTF-8 | 3,548 | 2.6875 | 3 | [] | no_license | // dom ready;
$(document).ready(function () {
page.init();
});
var page = {
completeCount: 0,
todoCount : 0,
url: "http://tiy-fee-rest.herokuapp.com/collections/trossy",
init: function () {
page.initStyling();
page.initEvents();
},
initStyling: function () {
page.loadItems();
page.getI... | true |
f5b9b200c81f2d5590f688ca968ab24154959524 | JavaScript | jagad89/node-test | /utils/utils.test.js | UTF-8 | 1,459 | 3.125 | 3 | [] | no_license | const utils = require('./utils');
const expect = require('expect');
describe('Utils',()=>{
describe('#add',()=>{
it('should add two numbers',()=>{
var res = utils.add(33,11);
expect(res).toBeA('number').toBe(44);
// if(res !== 44){
// throw new Error(`Ex... | true |
e8262d63951853f0e999845017e0a9b1cfd1ac7c | JavaScript | singhenso/javascript-practice | /youDontKnowJSAdvanced/scope/callApplyBind.js | UTF-8 | 7,736 | 4.03125 | 4 | [] | no_license | /*
bind() is used to call a function setting this explicitly
if we use a this kw in a method and we call that method from a receiver
object, we need .bind()
The this value is also bound to another object if we assign
the method (where this is defined) to a variable.
call()
pass in function parameters as... | true |
9d53abb05498cc311c93c2e1fe743dec01118a9f | JavaScript | GAIKU/react-dates | /src/utils/isInclusivelyBeforeDay.js | UTF-8 | 268 | 2.59375 | 3 | [
"MIT"
] | permissive | import isDate from 'date-fns/is_date';
import isBefore from 'date-fns/is_before';
import isSameDay from './isSameDay';
export default function isInclusivelyBeforeDay(a, b) {
if (!isDate(a) || !isDate(b)) return false;
return isBefore(a, b) || isSameDay(a, b);
}
| true |
a51910b40ed420e76a635ce85928765703cdff9c | JavaScript | violet2525/youjo_player | /src/index.js | UTF-8 | 3,949 | 2.515625 | 3 | [
"MIT"
] | permissive | (function(){
'use strict';
const electron = require('electron');
const {remote} = require('electron');
const fs = require('fs');
const path = require('path');
const media = require('../IGNORE/folder.json')
const video = document.getElementById('video');
const Menu = remote.Menu;
co... | true |
8613cf06582143763317860ddb59ac36050e1be0 | JavaScript | tj-zhuh/mfr | /src/render.js | UTF-8 | 2,325 | 3 | 3 | [] | no_license | /**
* 渲染
* 传入需要渲染的节点数据(指明需要绘制哪些节点,并指出哪些节点是active的)
*
* 绘制算法
* ·清空所有容器
* ·遍历需要绘制的节点,如果dom元素不存在,则创建;将dom元素添加到容器里
* ·根据active状态,修改dom元素的className
*
* 返回
* ·返回本次渲染过程中,新绘制了dom元素的节点(后续绑定事件时需要用到)
*/
define(function () {
var helper = require('./helper');
// 绘制元素,返回生成的dom元素
functio... | true |
625f9e666217065d546aaab17f3aaa7c0979f234 | JavaScript | chanduthedev/nodejs | /multer/server.js | UTF-8 | 2,556 | 2.765625 | 3 | [
"MIT"
] | permissive | var Express = require("express");
const multer = require('multer');
var fs = require('fs');
var url = require('url')
var app = Express();
// reading configurations from the file
var config = require('./config.js')
HOST_IPADDRESS = config.HOST_IP;
PORTNUMBER = config.PORTNUMBER;
// App server starts listening for the ... | true |
48239349dc85b49aabbcf7d0807f8b761f50ba12 | JavaScript | leolm83/SENAI | /UC 09/S1 A3/Encontro 2/arquivos/_javascript/valida_form.js | UTF-8 | 3,970 | 3.359375 | 3 | [] | no_license | //função para totalizar valor de assinatura mensal
function totaliza()
{
total = 0.00;
//plano mensal
if(document.form.planos[0].checked)
total = total + 85.00;
//plano quadrimestral
if(document.form.planos[1].checked)
total = total + 300.00 / 4;
//plano anual
if(d... | true |
9b390721cd597f9c467ccb3111bbc6940a440521 | JavaScript | makarpi/node-express-modbus | /public/js/myscript.js | UTF-8 | 774 | 2.796875 | 3 | [] | no_license | /*
File: myscript.js
Description: Contains frontend script: views/index.html
*/
setInterval( () => {
fetch('/modbus')
.then( resp => resp.json())
.then( resp => {
let listGroupContent = '<ul class="list-group">';
console.log(resp);
resp.forEa... | true |
a4bf8fdc2e1dfc90b2ab8fc68ebe247ef9c0fc60 | JavaScript | JD-aka-Techy/practice_challenges | /FreeCodeCamp/Wiki Viewer/script.js | UTF-8 | 1,672 | 3 | 3 | [] | no_license | // uses //cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js
// uses //cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js
$(".search").autocomplete({
source: function(request, response) {
$.ajax({
url: "http://en.wikipedia.org/w/api.php",
dataType: "jsonp",
... | true |
1bfe2128233d1b2342cf68c903942f963c9b98a6 | JavaScript | whiskyplausible/directory-api-JS | /lib/directory/Business.js | UTF-8 | 2,667 | 2.8125 | 3 | [] | no_license | "use strict";
require('../utils/ArrayFunctions.js');
require('../utils/ObjectFunctions.js');
const StaticHelper = require('../utils/StaticHelper.js');
/**
* User class as an abstract class for field objects
*
* @constructor
* @param {Object} [init={}] - Object to initialise the newly created instance
* @param ... | true |
7dc4d3d541eeaacd67e572bb0d08fe9b8f246a44 | JavaScript | fng3r/javascript-task-9 | /tasks.js | UTF-8 | 1,363 | 2.671875 | 3 | [] | no_license | 'use strict';
var api = require('./gitapi.js');
var flow = require('./flow.js');
/**
* Сделано задание на звездочку
* Реализовано получение html
*/
exports.isStar = true;
/**
* Получение списка задач
* @param {String} category – категория задач (javascript или markup)
* @param {Function} callback
*/
exports.g... | true |
36aff674569f346233b8b81ab8f2cf8b482d1c8b | JavaScript | kait-schorr/Conways-Life | /projects/life/src/App.js | UTF-8 | 3,837 | 3.0625 | 3 | [] | no_license | import React, { Component } from "react";
import Life from "./life";
import "./App.css";
const canvasWidth = 600;
const canvasHeight = 400;
/**
* Life canvas
*/
class LifeCanvas extends Component {
/**
* Constructor
*/
constructor(props) {
super(props);
this.life = new Life(props.width, props.heig... | true |
276717a2b45536bc4e10dd89f8c466506f17d011 | JavaScript | poetries/code-practice | /HTML5&&CSS3/HTML5/canvas/demo-old/canvas-ball/js/index.js | UTF-8 | 1,279 | 2.90625 | 3 | [] | no_license | window.addEventListener("load",eventWindowLoaded,false);
function eventWindowLoaded(){
canvasApp();
}
function canvasSupport(){
return Modernizr.canvas;
}
function eventWindowLoaded(){
canvasApp();
}
function canvasApp(){
if (!canvasSupport()) {
return;
}
function drawScreen(){
context.fillStyle = "#EEEEEE... | true |
7c92f013bf6ad8326eb51ed77ee62da83a220969 | JavaScript | dhornback10/GrandCircus-JavascriptLab1 | /Script.js | UTF-8 | 886 | 3.828125 | 4 | [] | no_license | var grantHealth = 10;
var playerHealth = 40;
var playerWin = 0;
var grantWin = 0;
var question = prompt("Would you like to play the game?")
if (question === "yes"){
var Name = prompt("What is your name?");
}
while (playerWin < 3 && grantWin != 1) {
var playerDamage = Math.floor(Math.random() * 2) + 1;
var grant... | true |
87cd568aba60e4d32004c257043daffceb81a983 | JavaScript | Macabre1/codewars | /wordsWithinWords/solution.js | UTF-8 | 347 | 3.34375 | 3 | [] | no_license | // words within words
function nestedWordCount (wordList) {
var biggest = [-1, ''];
wordList.forEach(function(word) {
var count = 0;
wordList.forEach(function(word2) {
if(word.indexOf(word2) > -1) {
count++;
}
});
if(count > biggest[0]) {
biggest = [count, word];
}
}... | true |
7d0b3b9db0bf9559fdf69952b62936ece1294fab | JavaScript | CrypTools/Binascii | /js/encrypt.js | UTF-8 | 792 | 3.34375 | 3 | [] | no_license | /* ==========================================================================
*
* Use:
* "Hello World!".encrypt()
* => "01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010 01101100 01100100 00100001"
*
* ========================================================================... | true |
560b811be2088ce8a45cb90733559ac02d596883 | JavaScript | yosefkurniawan/icube-react-training-batch2 | /session-3/redux/reducers/home.js | UTF-8 | 1,092 | 2.546875 | 3 | [] | no_license | import { DELETE_ITEM } from "../actions/home";
const defaultState = [
{
id: 14,
name: "Jackets",
image: null,
url_path: "men/tops-men/jackets-men",
__typename: "CategoryTree",
},
{
id: 15,
name: "Hoodies & Sweatshirts",
image: null,
url_path: "men/tops-men/hoodies-and-sweatshi... | true |
d915bfa9c98940556ed77fbf12fa8b1fbdadc31a | JavaScript | utsocial/laravel4crud | /public/js/basemodule.validations.js | UTF-8 | 4,112 | 2.96875 | 3 | [] | no_license | /**
* Base Module validations
* @type BaseModule.Validations
* @param {object} $
*/
BaseModule.Validations = (function($) {
var self = {},
errorMessages = [],
submitErrorMessage = '',
requiredFieldMessage = 'This field is required',
emailFieldMessage = 'Invalid email address',
... | true |
2f34d3a3985d704d5189415af53ed43c1eca99ab | JavaScript | testertwy3/design | /d3/components/js/global.js | UTF-8 | 1,031 | 2.84375 | 3 | [] | no_license | function ready(param) {
window.addEventListener("load", param());
}
function $(selector) {
try {
return document.querySelectorAll(selector);
} catch (e) {
console.log(e.message);
}
}
function $$(selector) {
return document.querySelector(selector);
}
function on(selector = "", sele... | true |
a73aa4e7fee770d592ebd1470959ebbc238d880e | JavaScript | bacevedo1/bacevedo1.github.io | /guess_my_number/application.js | UTF-8 | 1,159 | 3.59375 | 4 | [] | no_license | $(document).ready(function(){
var guess = 0; // starts program off by setting the guess to 0
var comp_integer = Math.floor(Math.random()*100); //program chooses random number from 0 to 100
console.log(comp_integer);
$('button').on('click', function(){ //when the player clicks on the 'guess' button
$("#fe... | true |
cd8e872993419c900c07371fadbbc1d641a40e94 | JavaScript | fkguo1120/fkguo1120.github.io | /compretitive/js/common2 - 複製.js | UTF-8 | 3,093 | 2.734375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | $(function () {
var tallbox = $('.tallbox');
var tallbox2 = $('.tallbox2');
function showgame() {
// for (var i = 0; i < testArray.length; i++) {
// tallbox.append(
// "<li><button>" + testArray[i].name + "</button></li>"
// )
// };
$('.tallbox .col-4').click(function() {
$(this).toggleClass('ac... | true |
982dec1a2fea440cc0c2f6c18f7c79ef8226daf1 | JavaScript | aziis98/aziis98.github.io | /delucreziotto/scripts/displayers.js | UTF-8 | 1,442 | 3.015625 | 3 | [
"MIT"
] | permissive | (function(exports) {
'use strict';
function text(text) {
return document.createTextNode(text);
}
function displayTable(simulation) {
const $table = $('#table');
$table.empty();
function renderCell(squadra, domanda) {
const $elem = $('<div></div>');
$elem.text(squadra.punteggiPerDomanda[domanda.in... | true |
4cfa49b3d3533ff3ff83c676929a8fe7cf7b2699 | JavaScript | zhanyunzhi/reactByCreateReactApp | /src/js/components/bodyIndex.js | UTF-8 | 2,208 | 2.546875 | 3 | [] | no_license | /**
* Created by ZYZ on 2017/7/23.
*/
import React,{ Component } from 'react';
import ReactDOM from 'react-dom';
import PropTypes from 'prop-types';
import ReactMixin from 'react-mixin';
import MixinLog from './mixins';
import BodyChild from './bodyChild';
const defaultProps = {
userName: '默认的userNa... | true |
2a62a81a01f98490bcadfde98cb62166bbf9c1b0 | JavaScript | alimb2002/react-skeleton | /src/components/User.js | UTF-8 | 780 | 2.65625 | 3 | [] | no_license | import React, {useState , useEffect} from 'react'
import SkeletonProfile from './skeletons/SkeletonProfile';
const User = () => {
const [user, setUser] = useState(null);
useEffect( () => {
setTimeout (async()=> {
const res = await fetch('https://jsonplaceholder.typicode.com/users/1');
... | true |
756e586815a692542f4832f6a0e172bc79325a2b | JavaScript | bokonist/leetcode | /58.length-of-last-word.js | UTF-8 | 555 | 3.234375 | 3 | [] | no_license | /*
* @lc app=leetcode id=58 lang=javascript
*
* [58] Length of Last Word
*/
// @lc code=start
/**
* @param {string} s
* @return {number}
*/
var lengthOfLastWord = function (s) {
let count = 0;
for (let i = s.length - 1; i >= 0; i--) {
while (s[i] === " " && i > 0) {
i--;
}
//dealt with tra... | true |
323cf1d5aa1c7cc0caf771abd6925d0d011b315a | JavaScript | haryoooo/front-end-codingtest-btpn | /src/store/action/contactAction.js | UTF-8 | 1,784 | 2.515625 | 3 | [] | no_license | import axios from "axios";
import { url } from "../../helpers/urlConfig";
import {
LOAD_CONTACT,
LOADING_CONTACT,
ADD_CONTACT,
DELETE_CONTACT,
EDIT_CONTACT,
} from "./actionType";
export function loadContact(data) {
return {
type: LOAD_CONTACT,
payload: data,
};
}
export function loadingContact(... | true |
730ae817f0f97e6a85c12e1b10be648ab140f4ef | JavaScript | mathewpwheatley/CTCI-Solutions | /2_1.js | UTF-8 | 876 | 3.6875 | 4 | [] | no_license | // Remove Dups
// Assumptions:
// - Singly linked list
// - Data in linked list is a integer
// Time Complexity: N
// Space Complexity: 1 (only head currNode and prevNode)
// Alternate Approaches:
// - Use two pointers to avoid having the buffer
function removeDups(head) {
// Create object to store data
set = {... | true |
c1ccc0e6623482d3b5afb5fef21ebb55b22dfb02 | JavaScript | AdamModus/vuetiful-weather-js | /src/services/TemperatureService.js | UTF-8 | 333 | 3.203125 | 3 | [
"MIT"
] | permissive | function kelvinToCelsius(tempK) {
return Math.round(tempK - 273.15);
}
function kelvinToFahrenheit(tempK) {
return Math.round(tempK * (9 / 5) - 459.67);
}
export default {
convertTemperature(unit, tempK) {
if (unit === 'CELSIUS') {
return kelvinToCelsius(tempK);
}
return kelvinToFahrenheit(tem... | true |
eca3465335b1cef68d5d9c4b3561d374366dc1b0 | JavaScript | reteshg/site | /src/components/featureList.js | UTF-8 | 4,545 | 2.53125 | 3 | [] | no_license | import React from 'react';
import {Container,Row,Col} from 'react-bootstrap';
import './featureComponents.css';
function FeatureList(props){
return(
<Container>
<Row>
<Col>
<div className="titleRow"><b>{props.title}</b></div>
</Col... | true |
57bb4b090a951c2f56a86128233a7cfca70b614c | JavaScript | Chevreau-Maxime/Chevreau-Maxime.github.io | /CharacterGenerator/generator.js | UTF-8 | 7,426 | 2.859375 | 3 | [
"MIT"
] | permissive | "use strict";
var inter;
window.onload = function () {
//--------------------------------------------------------GLOBAL VARIABLES :
var can = document.getElementById("canvas");
var con = can.getContext("2d");
var input_complexity = document.getElementById("complexity");
var input_sharpness... | true |
21db9b7e265d28e2832ed129d7ad6aeba02618bd | JavaScript | umarjabbar/sanbercode-reactjs-0820-2 | /src/Tugas-11/clock.js | UTF-8 | 984 | 3 | 3 | [] | no_license | import React from 'react';
class Clock extends React.Component {
constructor(props){
super(props)
this.state = {
waktu : ""
}
}
componentDidMount() {
this.addInterval = setInterval(() => this.jam(), 1000);
}
componentDidUpdate() {
}
componentWillUnmount() {
clearInterval(thi... | true |
8a1592b9d32542e822ed37ac670d27446fa74e07 | JavaScript | josueperezf/nodeSocketChatBasico | /public/js/auth.js | UTF-8 | 2,555 | 2.84375 | 3 | [] | no_license | //Referencia al formulario para el logueo sin google
const miFormulario = document.querySelector('form');
// la siguiente linea la coloco fernando para verificar con que servidor loguearse, es de recordar que en la pagina de google se le dijo que se podria loguear desde localhost con el puerto 8080 y desde https://r... | true |
2bb0be5aa1c23c6e5a01e47affd9e9df492539e6 | JavaScript | Alisher778/crm-alitech | /src/reducer/reducers/sidebarReducer.js | UTF-8 | 363 | 2.53125 | 3 | [] | no_license | import { TOOGLE_MENU } from '../actions/index';
const initialState = {isOpen: true};
const sidebarReducer = (state=initialState, action) => {
switch(action.type) {
case TOOGLE_MENU:
return {
...state,
isOpen: action.status
}
default:
return sta... | true |
8d3126a8f74893a9cceeb456af8728982a9b7832 | JavaScript | joshsoriano/bored-and-broke | /src/components/FacebookLinkButton.js | UTF-8 | 1,046 | 2.671875 | 3 | [] | no_license | /**
This file creates a button with a link to a specified user's Facebook profile.
**/
import React from 'react';
import PropTypes from 'prop-types';
import injectSheet from 'react-jss';
import { Button } from 'react-bootstrap';
const propTypes = {
classes: PropTypes.object.isRequired,
userID: PropTypes.s... | true |
2ae3b5fc417558ee8e2a6bd807cc988e54a0863e | JavaScript | wzd-front-end/leetcode-practise | /medium/1473-find-the-longest-substring-containing-vowels-in-even-counts.js | UTF-8 | 1,178 | 3.71875 | 4 | [] | no_license | /**
* @name 每个元音包含偶数次的最长子字符串
* @url https://leetcode-cn.com/problems/find-the-longest-substring-containing-vowels-in-even-counts/
* @date 2020-05-20 09:35
* @tags 字符串
* description
* ```
* 给你一个字符串 s ,请你返回满足以下条件的最长子字符串的长度:每个元音字母,即 'a','e','i','o','u' ,在子字符串中都恰好出现了偶数次。
*
*
*
* 示例 1:
*
*
* 输入:s = "eleetmini... | true |
56d1c26e8941058491388ff69791c695351f3dfa | JavaScript | xavier1425/internetCafe | /routes/routes.js | UTF-8 | 2,334 | 2.609375 | 3 | [] | no_license | // Add require that point to Product controller
var product = require('../controllers/productController')
// Rquire Index controller to view homepage
var index = require('../controllers/indexController')
module.exports = (router, passport) => {
// HOME PAGE ===========================
router.get('/', index.home)
/... | true |
52e1c62c311d68c10ee88b24762a4a0eb4299249 | JavaScript | pnowak2/learnjs | /lang/javascript/promises/test/spec/promiseSpec.js | UTF-8 | 6,353 | 3 | 3 | [] | no_license | describe('Promz', function() {
describe('creation', function() {
it('should exist', function() {
expect(Promz).toEqual(jasmine.any(Function));
});
});
describe('state property', function() {
var promz;
beforeEach(function () {
promz = new Promz;
});
it('should be defined', function() {
expec... | true |
2f671599a31acc52ba56d7a39ffd2463d78fa744 | JavaScript | hi0826/Algorithms | /LeetCode/4.js | UTF-8 | 439 | 3.65625 | 4 | [] | no_license | /**
* @param {number[]} nums1
* @param {number[]} nums2
* @return {number}
*/
const findMedianSortedArrays = (nums1, nums2) => {
const nums = nums1.concat(nums2);
nums.sort((a, b) => a-b);
console.log(nums);
if(nums.length % 2 === 1) {
return nums[parseInt(nums.length/2)];
} else {
... | true |
cea85c4e3d8eecda58a032d6bd083df0a63546d2 | JavaScript | MashaMor/Codewars-Solutions | /8kyu/Convert a String to a Number!.js | UTF-8 | 113 | 3.015625 | 3 | [] | no_license | //https://www.codewars.com/kata/544675c6f971f7399a000e79
let stringToNumber = function(str){
return +str;
}
| true |
bbd7ef5cbd5e8f917ddcbae20102b983c38421ac | JavaScript | Chiki1601/Guess-the-number-in-JS | /app.js | UTF-8 | 3,636 | 3.84375 | 4 | [
"Unlicense"
] | permissive | // GUESS THE NUMBER GAME STEP BY STEP EXPLANATION
// ~ Hitik Saini.
//Generating a random number from 1-500
let randomNumber = parseInt((Math.random()*500)+1);
//make variables
const submit = document.querySelector('#user_guess');
const userInput = document.querySelector('#guessField');
const guessSlot = document.q... | true |
40b6df58a8e35d790b47ef7de0c3639edc66d594 | JavaScript | caaz160782/module-js | /07-objects-foreach/clase/js/main.js | UTF-8 | 1,929 | 3.75 | 4 | [] | no_license | const personObject={
name: "carlos",
lastName: "aguirre",
gender:"male",
age :39,
isSingle: false,
hobbies:["play videogames","watch tv"],
otros:[{
signature: "HTML",
score: 10
},
{
signature: "css",
score: 6
}],
socialNetwork:{
face... | true |
23bf7bd196c49c837c48fc1011a84c6e83f26a92 | JavaScript | ssniteman/backbone.js-practice | /app/scripts/list-view.js | UTF-8 | 701 | 2.703125 | 3 | [] | no_license | var ListView = Backbone.View.extend({
className: 'list-item',
createTemplate: _.template($('#list-item-template').text()),
events: {
"click": "createMainView",
},
initialize: function(){
$('.js-contact-list').prepend( this.el );
this.render()
},
render: function(){
var renderedTemplate = this.c... | true |
f19faba1cb6d767491047ce87c4c69de036ee5c8 | JavaScript | kyle-sammons/egg | /lib/runtime/operator/zip.js | UTF-8 | 1,281 | 2.59375 | 3 | [] | no_license | import Operator from './Operator'
export default new Operator({
name: 'z',
clauses: [
{
sig: ['array', 'array', 'block'],
desc: 'Zip two arrays together, combining elements with the block.',
body: (context, left, right, block) => {
const value = []
... | true |
d06a677ad09e13077ff8f5f77f289fcf0f852e7e | JavaScript | jithraj/slackBot | /stopword/stopword.js | UTF-8 | 415 | 2.703125 | 3 | [] | no_license | var defaultStopwords = require('./stopwords_en.js').words
exports.removeStopwords = function(tokens, stopwords) {
stopwords = stopwords || defaultStopwords
if (typeof tokens !== 'object' || typeof stopwords != 'object'){
throw new Error ('expected Arrays try: removeStopwords(Array[, Array])')
}
return toke... | true |
205ab3a304aeaefe066869d760a3fde61b99e694 | JavaScript | internet-research-labs/svv.im | /src/TriangleClipGrid.js | UTF-8 | 1,558 | 3.359375 | 3 | [] | no_license | import TriangleClip from './TriangleClip.js';
/**
* Construct a grid where xy-coordinates correspond to triangles instead of squares
* --------------------------------------
* \1,1 /\1,3 /\
* \ / \ / \
* \/1,2 \/1,4 \
* ---------------
* /\2,2 /\ /
* / \ / \ /
* 2,1\/ \/
* ------------... | true |
36747aa819f0fe32e6be5b02a4464a31618d1721 | JavaScript | rrozek555/testnet-faucet | /app.js | UTF-8 | 5,284 | 2.5625 | 3 | [] | no_license | var express = require("express");
var cors = require("cors");
var bodyParser = require("body-parser");
var http = require("http");
var redis = require("redis");
var Promise = require("promise");
var bitcoin = require("bitcoin");
var btcmath = require("bitcoin-math");
var config = require("./config");
// set constants... | true |
ad52cf13f6ebecf176b306ec225d2dfff59e43a9 | JavaScript | riraq/Leetcode_Practice | /Easy/twoSum.js | UTF-8 | 323 | 3.359375 | 3 | [] | no_license | // Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
// You may assume that each input would have exactly one solution, and you may not use the same element twice.
// You can return the answer in any order.
var twoSum = function(nums, target) {
... | true |
c5d4583dcafeba0d8ae958b12cfa169cc30b9a4c | JavaScript | Anantpatel123/Hw_7_Train-Scheduler | /javascript.js | UTF-8 | 3,521 | 3 | 3 | [] | no_license |
var config = {
apiKey: "AIzaSyBK67OsyKmd9naABZuJAo4U2Kso6-juPBA",
authDomain: "activity-9f716.firebaseapp.com",
databaseURL: "https://activity-9f716.firebaseio.com",
projectId: "activity-9f716",
storageBucket: "activity-9f716.appspot.com",
messagingSenderId: "923349095451"
};
firebase.initia... | true |
3ff4be4c5fcda8876d861945fa275eb28d6d8465 | JavaScript | valDij/pierre-feuille-ciseaux | /app.js | UTF-8 | 1,574 | 3.5 | 4 | [] | no_license | var nomutilisateur=prompt ("entrer votre nom");
do {
var choixutilisateur = prompt ("Choisissez entre pierre,feuille et ciseaux");
var choixOrdi = Math.random ();
if (Math.random <= 0.30) {
choixOrdi = alert ("l'ordinateur choisit la pierre");
}
else if (Math.random >0.31 <0.60) {
ChoixOrdi = alert ("l'or... | true |
000e35cb789278cf0144d44219f501bbe619f8d9 | JavaScript | Abdulshakur11/Bozorlik-ro-yhati | /js/main.js | UTF-8 | 1,826 | 3.234375 | 3 | [] | no_license | var elForm = document.querySelector(".form");
var elInput = document.querySelector(".input");
var elButton = document.querySelector(".button-first");
var elShoppingList = document.querySelector(".result-list");
var elCheckForm = document.querySelector(".check-form");
var elCheckResult = document.querySelector('.result-... | true |
16af0f01962c46bdf76adf7f1ec446b421091c5b | JavaScript | audeen/IDW | /Liste_falsch/shopping.js | UTF-8 | 439 | 3.796875 | 4 | [] | no_license | /* Nicht die geilste Lösung, da das Array geleert wird */
var shopping = ['Milch', 'Eier', 'Brot', 'Mehl'];
list();
function list () {
for (i=0; i < shopping.length; i++) {
document.getElementById("list").innerHTML += "<li>" + shopping[i] + "</li>";
};
}
function add_item() {
var item = document.get... | true |
5af8d21bb4aa6518865aeb9146fa9e25b99be477 | JavaScript | iamso/u.js | /src/partials/methods/clone.js | UTF-8 | 191 | 2.53125 | 3 | [
"MIT"
] | permissive | /**
* clone method
* clone an element
* @return {object} element clone
*/
clone: function() {
return this.length ? u(this[0].cloneNode(true)) : this;
},
| true |
e6841690dc8235ec1b0293dc62ad5b93d6d07e5e | JavaScript | rkulov/JS-Basic-Projects | /01.DevIntro/scripts/dec2hex.js | UTF-8 | 159 | 3.25 | 3 | [] | no_license | var input = Number(prompt("Enter a number"));
while (input<=0){
input = prompt("Enter a number");
}
var hex = input.toString(16).toUpperCase();
alert(hex); | true |
20340e48cf942ec0480704b88fa50ed7a178d069 | JavaScript | DennyHo2020/Data-Visualizations-Showcase | /TreeMap/test-cases.js | UTF-8 | 1,307 | 2.734375 | 3 | [] | no_license | //
// test-cases.js
// Dataset
//
// These are two very simply trees, the first (test_1) being a single
// node with three children and the second (test_2) being a tree with
// two branches, the first with 3 children and the second with 2.
//
var test_1 = {
"name": "root",
"children": [
{
... | true |
50ed60011c361cae5af2ce44a81d60306db073f3 | JavaScript | samsungiotjs/iotjs_demo | /iotjs_modules/tasker.js | UTF-8 | 1,292 | 2.984375 | 3 | [] | no_license | // utils
var async_queue = [];
function addTask(task) {
var func;
if (typeof task === 'function') {
func = task;
} else if (task instanceof Task) {
func = task.func;
} else {
console.error('unknown type');
return;
}
async_queue.push(func);
}
function callNextTask() {
if (async_queue.le... | true |
a002b1536cca9d68a2e413610eebb4de72120fa5 | JavaScript | dogosoft205/html5app-kame | /Html5Application/WebContent/ch09_indexedDB/03_bookshelf_objectstore_1_keypath.js | UTF-8 | 1,049 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | var bookShelfDB;
function openDB() {
var openResult = window.indexedDB.open("bookShelf", 2);
openResult.addEventListener("success", function() {
console.log("데이터베이스 오픈 성공 : " + this.result);
bookShelfDB = this.result;
showDatabaseInfo(bookShelfDB);
});
openResult.addEventListener("error", function() {... | true |
b92399b8ae7bcf8a5efd69611517be6bb004e24c | JavaScript | kojolaino/webuiCourse01 | /demo02/app/directives/imgHover.js | UTF-8 | 1,747 | 2.796875 | 3 | [] | no_license | /*defining the directive image hover which is used to create an expresive html to display images and changed them when the mouse hovers over them*/
app.directive('imgHover', function ($location) {
return {
restrict: 'E',
/*the scope of the the directive takes 4 parameters: */
scope: {
... | true |
323883bcf81e5c95e906abfd160f78d88827036e | JavaScript | aarushverma96/movie-poster-app | /src/App.js | UTF-8 | 1,505 | 2.625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import 'bootstrap/dist/css/bootstrap.min.css';
import Movies from './components/Movies.js'
import MovieInfo from './components/MovieInfo.js'
import SearchBar from './components/SearchBar.js'
import './App.css';
const App = ()=>{
const [movies, setMovies] = useStat... | true |
b264e844beed6c728ff2a568b7346300ad54c4c1 | JavaScript | lulzzz/assistant-os | /src/helpers/human-readable.js | UTF-8 | 361 | 3.328125 | 3 | [
"MIT"
] | permissive | export const delay = (milliseconds) => {
if (milliseconds > 1000) {
var seconds = Math.floor(milliseconds / 1000)
if (seconds > 120) {
var minutes = Math.floor(seconds % 60)
return `${minutes} min`
} else {
return `${seconds} s`
}
} else {
... | true |
5fe0c81d70453cfbdd5108a67d886e0a9bcc44bd | JavaScript | DanHefrman/test | /Resource-Hub-Mark_II/experimental/Overflow/TOOLS/js/word-sort1d9a.js | UTF-8 | 465 | 2.828125 | 3 | [
"MIT"
] | permissive | $(function () {
mkTool('word-sort', function (text) {
text = text.replace(/[?.,!"]/g, ' ');
text = text.replace(/\s+$/g, '');
text = text.replace(/^\s+/g, '');
var words = text.split(/\s+/);
words.sort(function (a, b) {
if (a.toLowerCase() < b.toLowerCase()) retur... | true |
3f06b3d8872c66975db2854d59fa119b8565c0e4 | JavaScript | lukewang1990/airhockey | /app/js/register.js | UTF-8 | 3,350 | 2.640625 | 3 | [
"MIT"
] | permissive | function showTerm() {
alert('Term of usage: You are confident enough to be the best airhockey guru!');
}
$(document).ready(function(event) {
// for select element bootstrap support plugin
$('.selectpicker').selectpicker();
var request; // variable to hold request
$('#reg-form').submit(function(... | true |
0902afeb7e2b931aaf649d68da0e70327efab9dd | JavaScript | Geor23/library-grad-project-geo-java | /client/views/componentS/BookForm.jsx | UTF-8 | 3,404 | 2.59375 | 3 | [] | no_license | var React = require('react');
var TextField = require('material-ui/TextField').default;
var RaisedButton = require('material-ui/RaisedButton').default;
var Add = require('material-ui/svg-icons/content/add').default;
var DatePicker = require('material-ui/DatePicker').default;
var BookForm = React.createClass({
getI... | true |
300468511f2c8b35c8c9a20162bae14c4159bfec | JavaScript | jamestewartjr/LG-week14-crud-bookstore | /database.js | UTF-8 | 4,480 | 2.5625 | 3 | [
"MIT"
] | permissive | const DATABASE_NAME = 'magpie-bookstore'
const connectionString = `postgres://${process.env.USER}@localhost:5432/${DATABASE_NAME}`
const pgp = require('pg-promise')()
const database = pgp(connectionString)
const selectAllBooksByPage = "SELECT * FROM books LIMIT $1 OFFSET $2"
const selectBookById = "SELECT * FROM book... | true |
69565e9aad6b8d64eea1c0400b59d2ec983561e1 | JavaScript | sergul/DataStructures | /2019/recursion/factorial.js | UTF-8 | 162 | 4.0625 | 4 | [] | no_license | const factorial = (n) => {
console.log(n);
if (n <= 1) {
return 1;
}
return n * factorial(n - 1);
}
const value = factorial(30);
console.log(value); | true |
5e74bbe7a4f0cceca187a04a1b5f7eda23aded80 | JavaScript | josephW1805/digimon-rolodex | /src/App.js | UTF-8 | 1,202 | 2.5625 | 3 | [] | no_license | import React, {Component} from "react";
import {CardList} from "./components/card-list/card-list.component";
import {SearchBox} from "./components/search-box/search-box.component";
import './App.css';
class App extends Component {
constructor(props) {
super(props);
this.state = {
dig... | true |
ba6e45de60cc72ca42e52eb9af66925e78421704 | JavaScript | foo123/structurae | /test/bit-array.spec.js | UTF-8 | 2,160 | 3.40625 | 3 | [
"MIT"
] | permissive | const BitArray = require('../lib/bit-array');
describe('BitArray', () => {
describe('constructor', () => {
it('creates a bit array of a required size', () => {
const array = new BitArray(100);
expect(array instanceof BitArray).toBe(true);
expect(array instanceof Uint32Array).toBe(true);
e... | true |
4c6906020bb1880e45c24192c8c5cd2bbdbba57e | JavaScript | ykn9080/micrologin | /passport/authServer.js | UTF-8 | 2,254 | 2.890625 | 3 | [] | no_license | const jwt = require("jsonwebtoken");
let refreshTokens = [];
module.exports = (app) => {
app.post("/token", (req, res) => {
const refreshToken = req.body.token;
if (refreshToken == null) return res.sendStatus(401);
if (!refreshTokens.includes(refreshToken)) return res.sendStatus(403);
jwt.ver... | true |
ce92b2d7778724540a2a53e69b9bc2d8458ef033 | JavaScript | hgalstyan/game_show_app_v7 | /js/app.js | UTF-8 | 2,528 | 3.453125 | 3 | [] | no_license | const overlay = document.getElementById('overlay');
const btnStart = document.getElementsByClassName('btn__reset')[0];
const btnLetter = document.getElementsByTagName('button');
const ulPhrase = document.getElementById('phrase').getElementsByTagName('ul')[0];
const letters = document.getElementsByClassName('letter');
c... | true |
75a3d46ef6092682bc9bd2077c4deaac7b9c2d73 | JavaScript | Franky-G/AirportApplication | /client/src/components/Trip/TripObject.js | UTF-8 | 3,385 | 3.296875 | 3 | [] | no_license |
export default class TripObject {
constructor(name, places, note) {
this.name = name;
this.places = places;
this.note = note;
this.positionUp = this.positionUp.bind(this);
this.positionDown = this.positionDown.bind(this);
}
addPlace(latLng, index, note){
th... | true |
057ec3c49dcd88a7c4a5d75dab8b4b69f0cccb83 | JavaScript | KuanG97/javascript-JQuery-learning | /imgStorage/index.js | UTF-8 | 348 | 3 | 3 | [] | no_license | function showPic(whichPic){
var source = whichPic.getAttribute("href");//获取链接
var title = whichPic.getAttribute("title");
var obj = document.getElementById("showBox");
var showTitle = document.getElementById("showTitle");
obj.setAttribute("src",source);//将对应链接放到展示处
showTitle.textContent = title;
} | true |
527cc83d64ccbf004b813b1595bb7099dc0c628c | JavaScript | Akanksha872/crejoFun | /js/form.js | UTF-8 | 1,569 | 3.546875 | 4 | [] | no_license |
function isNumberKey(evt){
var charCode = (evt.which) ? evt.which : evt.keyCode
return !(charCode > 31 && (charCode < 48 || charCode > 57));
}
function addSpace(event){
let removedSpaced = event.target.value.split(" ");
let cardNumber = removedSpaced.join('');
console.log(cardNumber);
let spa... | true |
ac90f5faa36c86ec9374a0fc164ee89d9f9b8393 | JavaScript | starwed/Crafty | /src/graphics/dom.js | UTF-8 | 8,542 | 2.546875 | 3 | [
"MIT"
] | permissive | var Crafty = require('../core/core.js'),
document = window.document;
/**@
* #DOM
* @category Graphics
* @kind Component
*
* A component which renders entities as DOM nodes, specifically `<div>`s.
*/
Crafty.c("DOM", {
/**@
* #._element
* @comp DOM
* @kind Property
* The DOM element use... | true |
52c89f110500c17ed784a30a3746378a31d827f7 | JavaScript | CameronC17/PokerTeam2 | /PokerGameAPI/game/player.js | UTF-8 | 655 | 2.890625 | 3 | [] | no_license | function Player(username, id, wallet){
this.isAI = false;
this.username = username;
this.id = id;
this.wallet = wallet;
// this.stake = 0
this.hand = [];
this.handValue = [null, null, null, null, null, null, null, null, null, null];
this.command = null;
}
Player.prototype.getID = function() {
return ... | true |
7a24289d7d3b4c5af7573ac77c86077c8bb4c202 | JavaScript | DzoYee/learnspace | /algs/leetcode/198houseRobber.js | UTF-8 | 1,836 | 3.546875 | 4 | [] | no_license | /**
* @param {number[]} nums
* @return {number}
*/
var rob1 = function(nums) {
var first = 0;
var second;
var total = nums[0];
for (var i = 1; i < nums.length; i++) {
if (second !== undefined) {
if (nums[i] > nums[second] && i === second+1) {
total = total - nums[second] + nums[i];
}... | true |
54d7f3554199483f55250a71a0da6290c2f859d1 | JavaScript | faksam/cohort39-index | /src/components/Home.component.jsx | UTF-8 | 1,052 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react';
// components
import Input from './Input.component.jsx';
import ToDo from './ToDo.component.jsx';
import Button from './Button.component.jsx';
class Home extends Component {
constructor() {
super();
this.state = {
todo: '',
todos: ... | true |
9d9600428049c49213f557631659250569054901 | JavaScript | shawlycode/my_clock_app | /src/Clock.jsx | UTF-8 | 758 | 2.90625 | 3 | [] | no_license | import React, { Component } from 'react';
class Clock extends Component {
constructor(props) {
super(props);
this.state = {
date: new Date()
};
}
//define || setup a life-cycle method to class to enable app
// render to webpage for the first time
componentDidMou... | true |
68bb4083d13c86223c8ce4e326959b8ca457fa67 | JavaScript | Sophan-Developer/Amakano-DiscordJs | /commands/Fun/drake.js | UTF-8 | 524 | 2.609375 | 3 | [] | no_license | const fetch = require('node-fetch');
const Discord = require('discord.js');
module.exports = {
name: "drake",
aliases: [],
usage: "drake",
description: "meme",
run: async(client, message, args) => {
const userd = args[0]
const user22 = args[1]
const res = await fetch(`https://frenchnoodles.xyz/a... | true |
982bdf768b1c43433eb13d05ae428f5d6803f1b5 | JavaScript | gabriellopesdev/desafio_microservico_auth | /services/mock/src/middlewares/auth/index.js | UTF-8 | 539 | 2.515625 | 3 | [
"MIT"
] | permissive | const AuthenticateService = require('../../services/authenticate')
async function validateToken(req, res, next) {
const token = req.headers['x-access-token']
if (!token) {
return res.status(401).json({ message: 'No token provided.' })
}
const result = await AuthenticateService.validateTo... | true |
583526bf7dcb951aeed681b46d8a40a4dc6dc309 | JavaScript | abhishekDeshmukh74/code-signal-challenges | /arcade/intro/level4/array-change/index.js | UTF-8 | 679 | 3.6875 | 4 | [] | no_license | function arrayChange(inputArray) {
let count = 0
for (let i = 0; i < inputArray.length; i++) {
if (inputArray[i + 1] <= inputArray[i]) {
count += inputArray[i] - inputArray[i + 1] + 1
inputArray[i + 1] = inputArray[i] + 1
}
}
return count
}
// best solution
func... | true |
84662cdcada81c430a5f5a02416318e1fcaab21f | JavaScript | douhaoi/learn-data | /Handwriting-series/promiseAll.js | UTF-8 | 910 | 3.34375 | 3 | [] | no_license | function promiseAll(promises) {
return new Promise((resolve, reject) => {
if (!promises || promises.length === 0) {
resolve([]);
}
const result = [];
let count = 0;
// for (let i = 0; i < promises.length; i++) {
// Promise.resolve(promises[i])
// .then((res) => {
// ... | true |
5ca2e12acdcbabcfde08081176d75717f21e61e6 | JavaScript | cgadam/dependencies-analyzer | /lib/dependencies/dependency.js | UTF-8 | 2,061 | 2.828125 | 3 | [
"MIT"
] | permissive | /*
@license
The MIT License (MIT)
Copyright (c) 2016 Christian Adam
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
t... | true |
ee14bce8584e94cb22c5f3421e7b6cdf93c9af24 | JavaScript | grace-kang/lists | /apps/web/assets/javascripts/update_list.js | UTF-8 | 1,017 | 3.1875 | 3 | [] | no_license | var list_name = document.getElementsByName("list_name");
var list_form = document.getElementsByName("list_form");
var delete_list = document.getElementsByName("delete_list");
var rename_list = document.getElementsByName("rename_list");
addEventListener("click", function(event) {
var isClickInside = false;
var inde... | true |
7ab9ce1c11bc1e94021425c23e940dc4bb01b5ce | JavaScript | arkokoley/sani | /javascripts/app.js | UTF-8 | 4,881 | 2.75 | 3 | [
"MIT"
] | permissive | (function ($, undefined) {
var userName = 'arkokoley';
// Put custom repo URL's in this object, keyed by repo name.
var repoUrls = {};
// Put custom repo descriptions in this object, keyed by repo name.
var repoDescriptions = {};
// Return the repo url
function getRepoUrl(repo) {
... | true |
03df8174920c25074be1ed8e88c0dc329af53bc8 | JavaScript | isysd/is-obj | /test.js | UTF-8 | 531 | 2.515625 | 3 | [
"MIT"
] | permissive | import test from 'ava';
import m from './';
test(t => {
t.true(m({}));
t.true(m(new Object())); // eslint-disable-line
t.true(m(new Date()));
t.true(m(new RegExp()));
t.true(m(Object.create(null)));
t.true(m({foo: true}));
t.true(m([]));
t.true(m(['foo', 'bar']));
t.true(m(() => {}));
t.true(m(arguments));
... | true |
c01ec9de4d45ae0cc0e99f8d77de044e4bbe8ee2 | JavaScript | mareebsiddiqui/SummerOfCode | /chat/js/messages_view.js | UTF-8 | 206 | 2.5625 | 3 | [
"MIT"
] | permissive | var MessagesView = function() {
this.renderMessage = function(new_message) {
$("#chat").append(new_message.nick + " @ " + new Date(new_message.timestamp) + " said,\"" + new_message.msg + "\"<br/>");
}
} | true |
fbfa451d01f032516d704535d5b9997833ba2612 | JavaScript | jbaojunior/vsdb | /js/search_evol.js | UTF-8 | 3,085 | 2.875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | function addRow(search) {
var selSearch = document.getElementById(search);
var numberSearch = (selSearch.getElementsByTagName("INPUT")).length;
if ( numberSearch > 5 )
{
exit;
}
var selTable = document.getElementById('search0');
var selComparation = document.getElementById('comparation0');
var sel... | true |
6514f9089fe6e90af9102ed977b235c2efdf3860 | JavaScript | TeliaProjectB/StoreFront | /homeSplashPage/scripts/changeAPIScript.js | UTF-8 | 1,105 | 2.9375 | 3 | [] | no_license | var myIndex = 0;
changeElement();
function changeCurrentButton(myIndex){
var x = document.getElementsByClassName("splashNavButton");
for (i = 0; i < x.length; i++) {
x[i].style.backgroundColor = "gray";
}
var button = document.getElementById("button" + myIndex );
button.style.bo... | true |
c6b10ee09683fcd30d341a5a1741b1ae1c1d8115 | JavaScript | Montjoie75/Api-call---Weather | /meteo/src/App.js | UTF-8 | 1,326 | 2.640625 | 3 | [] | no_license | import "./App.css";
import { useState } from "react";
import { BrowserRouter as Router, Route } from "react-router-dom";
import Header from "./components/header/Header";
import CityTemperature from "./components/temperature/CityTemperature";
import GetTemperature from "./components/form/GetTemperature";
function App()... | true |
bdf83789e74a73ac1966091fa1a97438b98fed14 | JavaScript | mihov/TelerikAkademy2016 | /JavScript/07. Arrays/02. Lexicographically comparison.js | UTF-8 | 279 | 2.765625 | 3 | [] | no_license | function name(params) {
var arr = params[0].split('\n');
var arr1 = String(arr[0]);
var arr2 = String(arr[1]);
if (arr1> arr2) {
return '>';
}
if (arr1 < arr2) {
return '<';
}
return '=';
} | true |
426562fde66752cffd4d904e3a6cff59d9c02346 | JavaScript | samuelfcf/buzzfeed-projeto06 | /js/screen2.js | UTF-8 | 4,624 | 3.046875 | 3 | [] | no_license | const initialScreen1 = `\
<section class="create-initial-quizz">\
<div class="container">\
<p>Você não criou nenhum quizz ainda :(</p>\
<button class="create-quizz">Criar Quizz</button>\
</div>\
</section>\
<section class="personal-quizzes hidden">\
<div class="container">\
<div class="title">\
<h3>Seus Qui... | true |
10da01674de61bc682aa916f940191092326b7cc | JavaScript | vincenthanguk/toboggan-trajectory | /script.js | UTF-8 | 3,065 | 3.484375 | 3 | [] | no_license | 'use strict';
import { largeMap } from './data.js';
// 1) create nested array out of map string
const mapString =
'..##.......,#...#...#..,.#....#..#.,..#.#...#.#,.#...##..#.,..#.##.....,.#.#.#....#,.#........#,#.##...#...,#...##....#,.#..#...#.#'.split(
','
);
const mapArr = [];
for (let i = 0; i < mapStrin... | true |
87df53d14fe121b35c8f69b456945feeba7e3ba9 | JavaScript | alari/orena | /Moo/mootools-core/Compatibility/Core/Browser.js | UTF-8 | 1,856 | 2.71875 | 3 | [] | no_license |
Browser.__defineGetter__('hasGetter',function(){
return true;
});
if(Browser.hasGetter){ // webkit, gecko, opera support
window.__defineGetter__('ie',function(){
console.warn('window.ie is deprecated. Use Browser.Engine.trident');
return (Browser.Engine.name == 'trident') ? true : false;
});
window.__define... | true |
440cc1013f6df9a38b560065e4936b77f73dd357 | JavaScript | FreeFlight-Code/norrisAPI | /src/js/index.js | UTF-8 | 1,953 | 2.890625 | 3 | [] | no_license | import { store } from "../store";
import { addJokeToHistory } from "../redux/history";
import { displayModal } from "../redux/modal";
export function handleJokeClick(joke) {
let tempJoke = joke;
tempJoke.viewed_at = new Date();
store.dispatch(displayModal(tempJoke.value));
store.dispatch(addJokeToHistory(tempJ... | true |
0588958f58d1980a90b0c4690466ae002fa8ecd6 | JavaScript | jugonzal/lhl-lectures | /w1d2-dev-workflow/code/sum.js | UTF-8 | 1,168 | 4.65625 | 5 | [] | no_license | /*
Given that I have some numbers
I want to sum them all
so that I can know the result
We already know:
- How to get arguments from the command line
- How to sum numbers
- How to go through all of them
*/
// Small function to figure out if a number is actually a number.
// This is just to avoid that double negative ... | true |
201264a870e911271816c218e0ea4b1147f29d40 | JavaScript | KKOULY/Skovoroda | /Frontend/src/Shop/ShopMenu.js | UTF-8 | 2,068 | 2.78125 | 3 | [] | no_license | var Templates = require('./Templates');
var ShopCart = require('./ShopCart');
var API = require('./API');
var ShopList = [];
//HTML едемент куди будуть додаватися піци
var $shop_list = $("#shop-list");
function initItemsList(error, data){
if (error === null){
ShopList = data;
showItemsList(ShopLis... | true |