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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1204a45a823d7a8f346c6a2acd3195bf66b8cf16 | JavaScript | themost-framework/themost-event-app | /server/listeners/generate-person-user-listener.js | UTF-8 | 989 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | /**
* @param {DataEventArgs} event
* @param {Function} callback
*/
export function beforeSave(event, callback) {
return callback();
}
/**
* @param {DataEventArgs} event
* @param {Function} callback
*/
export function afterSave(event, callback) {
if (event.state == 1) {
let newUser = event.target.... | true |
644f854844471400cb73ad13689ff7ee5e25b8c2 | JavaScript | quan612/ChatApp | /mapp/helpers/users-connect.js | UTF-8 | 778 | 2.59375 | 3 | [] | no_license | module.exports = class UsersConnect {
constructor() {
this.users = [];
}
addUser(id, username, avatar) {
// to handle situation that having the same user login twice, when duplicate browser tab
let user = this.getUserByUsername(username);
if (!user) {
let user = { id, username, avatar };
... | true |
58f580ec1f51b564b2a39af6b59c16d638783ba8 | JavaScript | anthonymanoel/eventoPresencial | /eventoPresencial1.js | UTF-8 | 785 | 3.8125 | 4 | [] | no_license | {
// Verificar se a data colocada é atual ou não
console.log("digite o dia de hoje")
var diaDeHoje=20;
var mesHoje=09;
if(diaDeHoje=20)
console.log("digite o mês");
else if(mesHoje=09);
console.log("data inserida corretamente, prossiga");
} // Código para verificar idade, se for maior que 18... | true |
345ba6381fa1b8cbf4809e33bf9ef437126910f1 | JavaScript | vitalboyzf/learning-notes | /算法/js算法刷题/回溯dfs/括号生成.js | UTF-8 | 703 | 3.75 | 4 | [] | no_license | // https://leetcode-cn.com/problems/generate-parentheses/
const generateParenthesis = function (n) {
const ret = [];
if (n < 0) return ret;
const path = new Array(n << 1);
dfs(0, ret, path, n, n);
return ret;
};
function dfs(idx, ret, path, leftRemain, rightRemain) {
if (idx === path.length) {... | true |
dfa732a7e6b8d1279bfa30a4d4ba485774613147 | JavaScript | Nahum-Delport/weather-app | /src/test/fetch.test.js | UTF-8 | 462 | 2.625 | 3 | [] | no_license | import React from 'react';
import App from '../App';
import renderer from 'react-test-renderer';
test('the data is humidity', async () => {
const api_call = await fetch(`http://api.openweathermap.org/data/2.5/weather?q=Lagos&appid=6e9c4d44e0cc64f81bcffccf748d4601&units=metric`);// we pass the variable into the api... | true |
219b9bde205fe53f59519a5d04dcfe49b06e15e5 | JavaScript | juddroid/2021CodeSquadMasters | /al/210719-programmers-clothes.js | UTF-8 | 754 | 3.1875 | 3 | [] | no_license | // const clothes = [
// ['yellowhat', 'headgear'],
// ['bluesunglasses', 'eyewear'],
// ['green_turban', 'headgear'],
// ];
const clothes = [
['crowmask', 'face'],
['bluesunglasses', 'face'],
['smoky_makeup', 'face'],
];
function solution(clothes) {
let clothesSet = {};
for (let i = 0; i < clothes.le... | true |
dadb7d771ce57d01f60172d4ac29ca2d7c45c614 | JavaScript | synartisis/synartisis | /weblib/client/flipcard/flipcard.js | UTF-8 | 300 | 2.8125 | 3 | [] | no_license | window.addEventListener('DOMContentLoaded', function() {
flipcard()
})
function flipcard() {
var flipCards = [...document.querySelectorAll('.syn-flip')]
flipCards.forEach(function(card) {
card.addEventListener('click', function(ev) {
card.classList.toggle('flipped')
})
})
}
| true |
35cae4cf79b7867727652535bfcb1f0af2178b19 | JavaScript | yonatansnir/PainterT | /server/server.js | UTF-8 | 1,053 | 2.59375 | 3 | [] | no_license | // Run `V=31 node server.js` for specific version or just type `node server.js`.
// I thoughted to manage the version number of the build in a separate file on the system for CI/CD.
// Usually, I separate services to separate files but because it is a very small app I did it this way.
const express = require("expre... | true |
98dda2adcea276272edd1b409853164fe29520a7 | JavaScript | makt-k/dozens | /app/assets/javascripts/services/main/jsonData.js | UTF-8 | 2,493 | 2.671875 | 3 | [] | no_license | // get data
angular.module('dozens').factory('jsonData',['$http', function($http){
var jsonData = {recipes: [ ], ingredients:[]};
// method to get all the recipes.
jsonData.loadRecipes = function(callback){
$http.get('./recipes.json').success(function(data){
callback(data);
c... | true |
7482371d82111aa5874df388831c466d19adc0a5 | JavaScript | Paramount1987/keyboard-game | /src/utils/index.js | UTF-8 | 296 | 2.90625 | 3 | [] | no_license | import { ALPHABET } from '../constans';
export function generateWord (length = 5) {
const lengthAlphabet = ALPHABET.length - 1;
let word = '';
for (let i = 0; i < length; i++) {
word += ALPHABET.charAt( Math.round(Math.random() * lengthAlphabet) );
}
return word;
} | true |
649d1cb7038b84fd7cb51f6fd63e646002662ec8 | JavaScript | remiodufuye/M4-DQ5-Observing-Selection-and-Insertion-Sort-dc-web-102819 | /src/insertionSort.js | UTF-8 | 343 | 3.21875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | function insertionSort(arr) {
let startIdx = 0;
for (let startIdx = 0; startIdx < arr.length; startIdx++) {
for (
let currIdx = startIdx;
currIdx > 0 && arr[currIdx - 1] > arr[currIdx];
currIdx--
) {
let temp = arr[currIdx];
arr[currIdx] = arr[currIdx - 1];
arr[currIdx - ... | true |
9bf7c5d36075835667509273f61d771597c90246 | JavaScript | River2056/wallet | /src/components/AddForm.js | UTF-8 | 2,374 | 2.75 | 3 | [] | no_license | import React from "react";
import uuid from 'uuid';
class AddForm extends React.Component {
constructor(props) {
super(props);
const currentDate = new Date();
this.state = {
inputMonth: currentDate.getMonth() + 1 < 10 ? '0' + currentDate.getMonth() + 1 : currentDate.getMonth() + 1,
inputDate:... | true |
54b05d94ffa36b14d4dd3a05f32f458958f318ce | JavaScript | Apurv-Deshpande/FootballStadium | /middleware/index.js | UTF-8 | 1,579 | 2.53125 | 3 | [] | no_license | var Stadium = require("../models/stadium");
var Comment = require("../models/comment");
var middlewareObj = {};
middlewareObj.checkStadiumOwnership = function (req,res,next){
if(req.isAuthenticated()){
Stadium.findById(req.params.id, function(err, foundStadium){
if(err){
req.flash("error", "... | true |
deaf20469c6296f816d577ba8aa198502f8bf4b8 | JavaScript | nickpoorman/tallship-manifest | /lib/id.js | UTF-8 | 150 | 2.609375 | 3 | [
"MIT"
] | permissive | module.exports = function() {
return [1, 1, 1].map(function() {
return Math.random().toString(16).substring(2).toUpperCase();
}).join('');
};
| true |
fb624c640b5de6787637df993e35f47f91fe2722 | JavaScript | andyhuaj/ProjBase | /frontend/reactjs/jianshu/src/common/header/store/reducer.js | UTF-8 | 1,646 | 2.609375 | 3 | [] | no_license | /*
* @Author: Andy Hua
* @Date: 2021-04-16 22:28:25
* @Last Modified by: Andy Hua
* @Last Modified time: 2021-04-19 23:50:27
*/
import * as constants from './constants.js';
import { fromJS } from 'immutable';
const defaultState = fromJS({
focused : false,
mouseIn: false,
list: [],
... | true |
d5ee54c53325bc83ac7714b571caa2067753b969 | JavaScript | isaacos/js-beatles-loops-lab-js-apply-000 | /index.js | UTF-8 | 600 | 3.609375 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | // add solution here
const theBeatlesPlay = (musicians, instruments) => {
let arr = [];
for(let i = 0; i < musicians.length; i = i + 1){
let whoAndWhat = musicians[i] + ' plays ' + instruments[i];
arr.push(whoAndWhat)
}
return arr
}
const johnLennonFacts = (factsList) => {
let i = 0;
while (i < fact... | true |
e1176cc3436d9c4bfa8dd38ce155fc3acca9906e | JavaScript | ovi-brandon-ronnie/book-list-client | /scripts/views/new-book-view.js | UTF-8 | 539 | 2.84375 | 3 | [] | no_license | $('#newBookForm').on('submit', (e) => {
e.preventDefault();
var title = $('#title').val();
var author = $('#author').val();
var isbn = $('#isbn').val();
var imgUrl = $('#imageUrl').val();
var description = $('#description').val();
let book = new app.Book (title, author, isbn, imgUrl, description);
app.... | true |
93ab1b2db2bf14e6c3eb8cd8d77e9f8960cc6bb2 | JavaScript | akiryk/gronster2.0 | /app/webroot/js/backups/scripts-bak.js | UTF-8 | 7,967 | 2.75 | 3 | [] | no_license | $(document).ready(function () {
/* ********************************************************
* ********************* CANVAS CONTROLS ******************
/* ******************************************************** */
var width = 660;
var height = 335;
var offset = 20;
var canvas;
var context;
var filepa... | true |
e7d2c4cc79decd08502ece055fef2ae298e7db99 | JavaScript | tommyturcovsky/GigReport | /src/actions/reviewSearch.action.js | UTF-8 | 1,783 | 2.71875 | 3 | [] | no_license | import Axios from 'axios'
function getResultsAttempt() {
return {
type: "GET_RESULTS_ATTEMPT"
}
}
function getResultsSuccess(searchResults) {
return {
type: "GET_RESULTS_SUCCESS",
searchResults
}
}
function getResultsFailure(error) {
return {
type: "GET_RESULTS_FAI... | true |
86f3e6121adea22b65d3dd89e4ebc404e0772be4 | JavaScript | pietro93/DoorMaze | /js/sound.js | UTF-8 | 1,471 | 3.0625 | 3 | [
"MIT"
] | permissive | var intention, gender, base, shape;
function readSound(sound){
switch (sound[0]) {
case "B":
base = "beep"
break;
case "H":
base = "human";
break;
}
switch (sound[2]){
case "B":
shape = "bottom"
break;
c... | true |
b7599a8dc7e059678b034f9b325908a410411e43 | JavaScript | stevenobadiah/cv_project | /src/components/Education.js | UTF-8 | 4,741 | 2.71875 | 3 | [] | no_license | import React, { Component } from "react";
import EducationFactory from "./EducationFactory";
import uniqid from "uniqid";
class Education extends Component {
constructor() {
super();
this.state = {
education: {
university: '',
degree: '',
graduation_year: 2016,
id: uniq... | true |
b57e27b22fe4de6019edfa3db5ef006221e64cef | JavaScript | olegkus/fe-advance-hw | /home work17/src/buttons.js | UTF-8 | 1,303 | 3.578125 | 4 | [] | no_license | const startBut = document.querySelector("#start");
const stopBut = document.querySelector("#stop");
class Timer {
constructor(startTime,stopTime){
this.startTime = startTime;
this.stopTime = stopTime;
this.interval = this.stopTime - this.startTime;
}
start(){
this.startTime ... | true |
949fef3d8f69c783fbeaa4aeea2a9064f5ab933a | JavaScript | k-liaojiale/k-demo | /vue-http/src/utils/token.js | UTF-8 | 1,142 | 2.546875 | 3 | [] | no_license | import { Http } from '@/utils/http'
import { settLocalStorage, getLocalStorage } from '@/utils/util'
class Token {
static refreshing = false
static async getAccessToken () {
const accessToken = getLocalStorage('accessToken')
if (!accessToken) {
await this.doRefresh()
}
return getLocalStorage... | true |
c644850d7c627d970fc55b5a2ae21ed3dede49f4 | JavaScript | ydnay/stringinator-base | /test/underbar/contains.test.js | UTF-8 | 992 | 2.984375 | 3 | [] | no_license | const _ = require('../../underbar');
describe('contains()', () => {
it('returns true if an array contains the target', () => {
// Your code goes here
const nums = [1, 2, 3, 4];
expect(_.contains(nums, 2)).toBe(true);
});
it('returns false if an array does not contain the target', () => {
// Your... | true |
391f47a4acabf7afa948da7efe83506c477cc2a9 | JavaScript | LachyStevens/keyboard-institute | /Virtual Tour/sketch.js | UTF-8 | 8,973 | 2.546875 | 3 | [] | no_license | var walter_pic;
var sceneControl=0;
var interact_areas=[];
var return_button;
//var transition;
var tint_value;
var enlarge = false;
var texts = [];
function preload(){
walter_pic = [
loadImage('assets/image/Walter Front 2560px.jpg'),
loadImage('assets/image/Walter Dampers 2560px.jpg'),
loadImage('assets... | true |
d4d183657f5a6fda1ad8e901902387366db6896d | JavaScript | bgoonz/UsefulResourceRepo2.0 | /GIT-USERS/ashishdotme/code.ashish.me/leetcode/136-single-number.js | UTF-8 | 451 | 3.703125 | 4 | [
"MIT"
] | permissive | /**
*
* Ashish Patel
* e: ashishsushilPatel@gmail.com
* w: https://ashish.me
*
*/
/*
* Given a non-empty array of integers, every element appears twice
* except for one. Find that single one.
*
* Example 1:
* Input: [2,2,1]
* Output: 1
*/
function singleNumber(value) {
let result = 0
for (let i = 0; ... | true |
5e5bab89e8f77e1f258158069024d55a3b0e579f | JavaScript | WJXHenry/IFTTT-Edmonton | /src/controllers/aqhi-base.js | UTF-8 | 2,745 | 2.75 | 3 | [
"MIT"
] | permissive | const request = require('request-promise-native')
const uuid = require('uuid/v4')
const parseXML = require('../utils/parse-aqhi-xml')
const indexToColor = require('../utils/index-to-color')
/**
* This is a factory function for creating air quality controllers. IFTTT requires unique
* routes for every trigger. Since ... | true |
fa24727761d78d15a5a2b746e8275ed7fabd85c4 | JavaScript | RonaldPS1993/WebAppFrontend | /src/Components/Wishlist/AddToWish.js | UTF-8 | 3,672 | 2.625 | 3 | [] | no_license | import React, {useState,useEffect} from "react";
import {Link} from "react-router-dom";
import Button from '@material-ui/core/Button';
import * as ReactBootStrap from "react-bootstrap";
import Axios from "axios";
function AddToWish({match}) {
useEffect(() => {
getWishNum();
console.log(username)... | true |
74347ed671d8f2836938217ec4f7fc5fa2f76c60 | JavaScript | Vikosh1st/practica-frontend-wantsome | /JS-Training/Wantsome-JavaScript-Homeworks/Tema_JavaScript_2_Function_types_&_Conditions/ex4.js | UTF-8 | 351 | 2.953125 | 3 | [] | no_license | // 4. Scrieti o functie de tip IIFE care afiseaza in consola:
// "Afisez, deci ma autoapelez".
// Veti crea un fisier javascript separat pe care il veti include intr-un fisier html.
// Verificarea se va face prin deschiderea paginii html in browser.
(function immediatelyInvokedFunctionExpression() {
alert("Afis... | true |
3b3f6bb1ad07a169c5090057e5fd8609fffaa287 | JavaScript | speederking07/SocialScore | /js/newAccount.js | UTF-8 | 2,897 | 2.640625 | 3 | [] | no_license | $(document).ready(function () {
$('.peselCheck').focusout(function () {
var person = $(this);
person.removeClass('valid');
person.removeClass('invalid');
if (person.val() === '') {
person.addClass('valid');
person.parent().children('span').attr('data-success'... | true |
adc50afe256ac2156d0c2a2804a958c01a639ccf | JavaScript | masanorifunaki/codecontest | /Shiftonly.js | UTF-8 | 241 | 3.5 | 4 | [] | no_license | 'use strict';
var a = `3\n8 12 40`
var nums = a.split('\n')[1].split(' ').map((n) => Number(n));
var count = 0;
console.log(nums);
while (nums.every((n) => (n % 2) === 0)) {
count++;
nums = nums.map((n) => n / 2);
};
console.log(count); | true |
cbc9cece283770944194aad0340710dd11272dfc | JavaScript | J-pilon/Scheduler | /src/hooks/useVisualMode.js | UTF-8 | 828 | 2.921875 | 3 | [] | no_license | import { useState } from "react";
export default function useVisualMode(initial) {
const [ mode, setMode ] = useState(initial);
const [ history, setHistory ] = useState([initial]);
const transition = (newMode, replace = false) => {
let newHistory = [ ...history, newMode ];
if(replace) {
co... | true |
9c21020a254cc3614f9b3ece8568f43dde827b29 | JavaScript | razorcreations/feedme-node-queueman | /runner.js | UTF-8 | 2,755 | 2.65625 | 3 | [] | no_license | const fivebeans = require('fivebeans');
const request = require('request-promise');
class Runner {
constructor(
handle,
errorHandler = (() => {}),
host = '127.0.0.1',
port = 11300,
) {
this.handle = handle;
this.errorHandler = errorHandler;
this.host = host;
this.port = port;
}
run() {
const wor... | true |
b67e5da27776fed7c4d8fee308380b4293002cfc | JavaScript | webcoding/anyproxy | /rule_sample/zhangchao.js | UTF-8 | 3,417 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive |
// 爱抢购测试,重定向域名响应
module.exports = {
summary:function(){
return "重定向ajax";
},
//=======================
//收到用户请求之后
//=======================
//是否截获https请求
shouldInterceptHttpsReq :function(req){
return false;
},
//是否在本地直接发送响应(不再向服务器发出请求)
shouldUseLocalRespon... | true |
337b19f478c6f800d6fd6643bf52adeee1eaddf1 | JavaScript | uwspstar/DataStructures-Algorithms | /Data-Structure/Nodejs/500 Must Know/Easy/Bit Manipulation/136. Single Number.js | UTF-8 | 675 | 3.65625 | 4 | [] | no_license | //136. Single Number
/*
Given a non-empty array of integers nums, every element appears twice except for one.
Find that single one. (has duplicate)
You must implement a solution with a linear runtime complexity and use only constant extra space.
Input: nums = [2,2,1] Output: 1
Input: nums = [4,1,2,1,2] Output: 4
Inp... | true |
905f20f0a3b23b6f933b969d2d1de99b650b5c99 | JavaScript | zehric/ALCodes | /merchant.js | UTF-8 | 1,580 | 2.859375 | 3 | [] | no_license | // examples: dex, str, int. Or, if equal to '*', include all items in inventory.
// set to false to not buy or sell. set to 'compound' to include all
// compoundable items.
var sellKeyword = '*';
var buyKeyword = false;
setInterval(function () {
if (sellKeyword && character.slots['trade1'] !== undefined) {
var... | true |
1fd1ad7474597e5ad4c18fae8f26175bf6f56145 | JavaScript | meto92/SoftUni--JS-Core--JS-Advanced | /Exercises/05. Object Composition/Lab/02. Fibonacci.js | UTF-8 | 235 | 2.890625 | 3 | [] | no_license | function getFibonator() {
let fn1 = 0;
let fn2 = 1;
function getNextFibonacciNumber() {
let next = fn1 + fn2;
fn1 = fn2;
fn2 = next;
return fn1;
}
return getNextFibonacciNumber;
} | true |
d0d2e64de98b72fbbd419c0ecc15804b1a98df10 | JavaScript | Levis44/ProgramadorBr-Course | /Express/Rotas/index.js | UTF-8 | 953 | 3.109375 | 3 | [] | no_license | let express = require('express');
let app = express();
let bodyParser = require('body-parser');
let alunos = [
{ id: 0, nome: "José"},
{ id: 1, nome: "Maria"},
{ id: 2, nome: "Levi"},
{ id: 3, nome: "João"},
];
app.use(bodyParser.urlencoded())
app.get("/", (req, res) => {
res.send("Opa");
})
app... | true |
e15588f4994d149037dac35e3a8b962fc1ba2336 | JavaScript | BrianHilson/Java-and-Javascript-Code-Challenges | /JavaScript-Solutions/find-longest-word-in-string.js | UTF-8 | 265 | 3.46875 | 3 | [] | no_license |
function findLongestWord(str) {
var stringArray = str.split(" ");
var greatestNum = 0;
for (var i = 0; i < stringArray.length; i++) {
if (stringArray[i].length > greatestNum) {
greatestNum = stringArray[i].length;
}
}
return greatestNum;
}
| true |
a4de65858bfbc4f03b18c2f0f734b436852c9176 | JavaScript | Danjik2k18/Homework-3 | /11/main.js | UTF-8 | 155 | 3.109375 | 3 | [] | no_license | /* Возведите 2 в 10 степень. Результат запишите в переменную st.
*/
var st = Math.pow(2, 10)
console.log(st) | true |
2ec039e2265ea0dddb5d87987bde87a8bb64d780 | JavaScript | cunyutech/soya2d | /src/display/TileSprite.js | UTF-8 | 4,096 | 2.65625 | 3 | [
"MIT"
] | permissive | /**
* 瓦片精灵,可以让该精灵内部平铺指定的纹理<br/>
* @class soya2d.TileSprite
* @extends soya2d.DisplayObjectContainer
*
* @constructor
* @param {Object} data 所有父类参数,以及新增参数,如下:
* @param {soya2d.Sprite | HTMLImageElement | String} data.sprite 瓦片精灵,必须
* @param {boolean} [data.autoScroll=false] 自动移动瓦片
* @param {int} data.speed 移动速... | true |
948c45df5b87e0944f2a2ac6fbad99b1394fb991 | JavaScript | Lorezz/cute-todo | /src/index.js | UTF-8 | 3,769 | 2.546875 | 3 | [] | no_license | import React from "react";
import ReactDOM from "react-dom";
import "./styles.css";
import Header from "./Header";
import Item from "./Item";
import AddItemForm from "./AddItem";
import { ITEMS, COLORS } from "./constants.js";
import uuid4 from "uuid4";
class App extends React.Component {
constructor() {
super... | true |
1b2aa0083d1aa1488949a2069ce751b12736ccb3 | JavaScript | brandonwc5/TriviaGame1 | /assets/javascript/app.js | UTF-8 | 1,866 | 2.984375 | 3 | [] | no_license | var questionsArray = [
{
question: "Which of the following are considered one single unit in physics?",
answer: ["Light and Heat", " Quarks and Atoms", " Gravity and Fusion", " Time and Space"],
correctAnswer : 3
},
{question: "What number is greater?",
answer: ["4", "5", "6", "7"],
correctAnswer: 0}
]
$(docu... | true |
85c4cc86d190b0ba5cdca70549b8296001fd89d2 | JavaScript | anlaganlag/react_collections | /checked/pokedex_react/src/components/TypeList.js | UTF-8 | 2,639 | 2.75 | 3 | [] | no_license | import React from 'react';
import { useState } from 'react';
import { useEffect } from 'react';
import PokemonDetail from './PokemonDetail';
import BackToTopArrow from './BackToTopArrow';
export default function TypeList() {
const [types, setTypes] = useState([]);
const [type, setType] = useState('');
const [pok... | true |
fec7a7f48fd77e1defce6910e72cc60bd5bfd2ef | JavaScript | raghavddps2/Learning-NodeJs-2 | /node26.js | UTF-8 | 826 | 3.390625 | 3 | [] | no_license | /*
Here, in this lesson, we are gonna talk about the route parameters in express..
So, route paramters are generally used when we talk about dynamic routes.
So, we might have an id of the progile of the person and the username of thr person.
We basically access what we send using the parameters as 'id'... | true |
1da4973ea850597df1710a67eff8bc8028fc06ad | JavaScript | kerlysanchez/curso | /Modulo 2/ejercicioRepaso2.js | UTF-8 | 2,557 | 3.828125 | 4 | [] | no_license | //SEMANA2, ASESORIA2 MODULO2 ------> APRENDIENDO A PROGRAMAR
//Crea un programa en donde tengas que adivinar
//las letras de una palabra de 4 letras, tendrás solo
//4 intentos para adivinarla, en un inicio la palabra
//estará oculta, pero cada vez que aciertes, se mostrará
//la letra, si adivinas la palabra antes ... | true |
1965035d0cb6843de6877c5acaaa823399cf5094 | JavaScript | Rodrigo-Zx15/nextLevelWeek3 | /public/scripts/page-create-orphanage.js | UTF-8 | 2,762 | 3.0625 | 3 | [] | no_license | //cria o mapa
const map = L.map('mapid').setView([-23.7108781,-46.7940031], 15);
//cria a camada
L.tileLayer(
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
// {
// attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
// }
).addTo(map);... | true |
610370e2c453f1c601cbe8f29c3642c25ba6030d | JavaScript | phanhongphat/DevBasicSkills2018-Team14 | /pages/rndInt/script.js | UTF-8 | 1,039 | 3.953125 | 4 | [] | no_license | function getRandomInterger() {
let min = parseInt(document.querySelector(".minValue1").value);
let max = parseInt(document.querySelector(".maxValue1").value);
let getOutput = document.querySelector(".output1");
let generator = Math.floor(Math.random() * (max - min + 1) ) + min;
getOutput.innerHTML ... | true |
f70bbdfa70acb1e362405b29818f5f7256191105 | JavaScript | tkarmstrong/web-231 | /week-5/armstrong-exercise-5.3.js | UTF-8 | 1,033 | 3.578125 | 4 | [] | no_license | /*
============================================
; Title: Assignment 5.3 - Object Collections
; Author: Tyler Armstrong
; Date: 13 January 2019
; Modified By: N/A
; Description: Showcases object collections.
;===========================================
*/
/**
* Params: firstName, lastName, assignment
* Response: out... | true |
e25409298a0ee3e0ff550b9573c50e1c612b4087 | JavaScript | drewitzmax/WF-DrewitzMax-CodeReview-02 | /js/script.js | UTF-8 | 728 | 3.78125 | 4 | [] | no_license | function calculateInsurance(country, horsepower, age){
let cost = 0;
switch(country){
case "AT": cost = horsepower * 100/age +50;
case "HU": cost = horsepower * 120/age +100;
case "AT": cost = horsepower * 150/(age+3) +50;
}
return Math.floor(cost);
}
function buttonClick(){
... | true |
cc51e01e1991331c8cf92493e837229acfbed3e7 | JavaScript | BorisMatic/borisfps | /static/js/terrain_objects/SkyBox.js | UTF-8 | 972 | 2.96875 | 3 | [] | no_license | SkyBox = function ()
{
this.imagePrefix = "images/";
this.directions = ["left", "right", "up", "down", "front", "back"];
this.imageSuffix = ".png";
this.skyGeometry = new THREE.BoxGeometry( 500, 500, 500 );
this.materialArray = [];
for (var i = 0; i < 6; i++)
{
this.ma... | true |
139aab5c05d4d30c8b75a37c900e744826947357 | JavaScript | srinivasamanohar/ZenClass-Tasks | /Week1/Day2/maxOfArray.js | UTF-8 | 143 | 3 | 3 | [] | no_license | var arr = [23,44,53,19,42,30,21,62,77,84,44,33,22];
var maxn = arr.reduce(function(a, b) {
return Math.max(a, b);
});
console.log.(maxn);
| true |
9f3e76fae41f69536be7414902fb81a3ea95b77a | JavaScript | kusumotolab/freat | /src/main/webapp/showsrc.js | UTF-8 | 860 | 2.515625 | 3 | [
"MIT"
] | permissive | var width = 1000, height = 350;
var minW = 100, minH = 50;
function setSrc(fragmentId) {
d3.select("#sourceContainer").selectAll("*").remove();
width = window.innerWidth * 0.7;
height = window.innerHeight * 0.45;
var w = Math.max(width, minW);
var h = Math.max(height, minH);
d3.select("#sourceContainer").styl... | true |
52960925aee9a885c10dc5a12de5f68024465df9 | JavaScript | tswartz/split | /js/app/views/Trip.js | UTF-8 | 2,484 | 2.515625 | 3 | [] | no_license | define(function (require) {
"use strict";
var $ = require('jquery'),
_ = require('underscore'),
Backbone = require('backbone'),
VenmoView = require('app/views/Venmo'),
tpl = require('text!tpl/Trip.html'),
... | true |
817d40c8679df71ab2e08c44911723859fb7d204 | JavaScript | Pandaphobic/prb-tracker | /src/services/FirestoreService.js | UTF-8 | 923 | 2.8125 | 3 | [] | no_license | import { db } from "../firebase/firebase-config"
class ItemsDataService {
async getAll() {
const items = []
db.collection("items")
.get()
.then(querySnapshot => {
querySnapshot.forEach(doc => {
// doc.data() is never undefined for query doc snapshots
items.push(doc.dat... | true |
4658a1c655e6019901665628eb43ed8837e17e7c | JavaScript | Shane-Geary/js-advanced-functions-context-lab-online-web-sp-000 | /index.js | UTF-8 | 2,037 | 3.953125 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /* Your Code Here */
/*
We're giving you this function. Take a look at it, you might see some usage
that's new and different. That's because we're avoiding a well-known, but
sneaky bug that we'll cover in the next few lessons!
As a result, the lessons for this function will pass *and* it will be available
for yo... | true |
726aa83cb2d3c8b1eba9826d94a5aba203ccd125 | JavaScript | Sagar-agarwal/CodePractice | /JS/FM - dsAlgo/practice/type-categories/indeing.js | UTF-8 | 488 | 2.640625 | 3 | [] | no_license | let dir = {};
dir.user1 = {
phone: 1,
street: 'abc',
city: 'London',
country: 'UK',
};
var user1 = {
name: 'Jack',
posts: [
{ id: 1, data: 'post1' },
{ id: 2, data: 'post' },
],
hashes: [1, 2, 3, 4, 5, 6],
};
function printAll(strs) {
if (typeof strs === 'object') {
... | true |
0b6f3918a660751996a7c988a70a865ccaabc0ff | JavaScript | NikitaLatynin/JS | /DZ-7/script.js | UTF-8 | 2,144 | 3.28125 | 3 | [] | no_license | //22 prezentation
//1.
/**
* Проверяет, является ли 2 элемент дочерним 1
* @param {*} parent
* @param {*} child
*/
const isParent = (parent, child) => {
console.log(child);
const realParent = child.parentNode;
console.log(realParent);
if (realParent == parent) {
console.log('True');
} ... | true |
674ae7853f24379159ac67e09bf865f65a18922c | JavaScript | WissamSawah/me-react | /src/components/Chat/Chat.js | UTF-8 | 3,468 | 2.671875 | 3 | [] | no_license | import React, { Component } from 'react';
import io from 'socket.io-client';
import { animateScroll } from "react-scroll";
class Chat extends Component {
constructor() {
super();
this.state = {
username: '',
message: '',
messages: [],
};
this.so... | true |
3a766fcf1ea3894c2d0268cfb2f954c8983576fa | JavaScript | sproutcore/sproutcore | /frameworks/runtime/debug/test_suites/array/base.js | UTF-8 | 11,845 | 2.75 | 3 | [
"MIT"
] | permissive | // ==========================================================================
// Project: SproutCore Costello - Property Observing Library
// Copyright: ©2006-2011 Strobe Inc. and contributors.
// Portions ©2008-2011 Apple Inc. All rights reserved.
// License: Licensed under MIT license (see license.js)
... | true |
3acda4e25e89c72d8377c090da745e3aaeb23018 | JavaScript | arturfil/game-project-ironhack | /js/brick-destroyer.js | UTF-8 | 7,719 | 3.234375 | 3 | [] | no_license |
//game variables go here//
var difficulty = 0.45;
var ballX = 450;
var ballY = 450;
var ballSpeedX = 5;
var ballSpeedY = 5;
var radius = 10;
var audio = new Audio();
i = 0;
var playlist = new Array(
"./audio/little_secrets.m4a",
"./audio/fire.m4a",
"./audio/brocoli.m4a",
"./audio/fall.m4a"
);
audio.addEv... | true |
5eeb71884f967646d6e89af04f01b5672d52711c | JavaScript | godwinbw/sofa-spud | /client/src/utils/localStorage.js | UTF-8 | 877 | 2.84375 | 3 | [] | no_license |
export const getSavedTitleIds = () => {
const savedTitleIds = localStorage.getItem('saved_titles')
? JSON.parse(localStorage.getItem('saved_titles'))
: [];
return savedTitleIds;
};
export const saveTitleIds = (titleIdArr) => {
if (titleIdArr.length) {
localStorage.setItem('sav... | true |
26afc1f4d4ca9bb7ed19bd572e9c935198190090 | JavaScript | fernantg/NodeJSDemo | /app.js | UTF-8 | 368 | 2.671875 | 3 | [] | no_license | var express = require('express');
var app = express();
app.get('/', function (req, res) {
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
res.setHeader('content-type', 'text/application');
res.send('Node.js App');
console.log('Access from ' + ip);
});
app.listen(80, function () {
consol... | true |
bf8919611ea6dbc9ef1471551ca24068ed5acfca | JavaScript | vainmusic/we7_module | /yyf_company/lib/web_export_1.js | UTF-8 | 1,734 | 3 | 3 | [] | no_license | function tableToExcel(json) {
//列标题
let str = `<tr>
<th>姓名</th>
<th>电话</th>
<th>年级</th>
<th>专业</th>
<th>单位</th>
<th>职务</th>
<th>订单号</th>
<th>金额</th>
... | true |
50e7eefa6021ef82a2a41ed59250d97f82eb5fb6 | JavaScript | mochammadshenna/zenith-apps | /design/scripts/products.js | UTF-8 | 1,634 | 3.234375 | 3 | [] | no_license | // The following example creates five accessible and
// focusable markers.
$(document).ready(function () {
$(window).scroll(function () {
if (this.scrollY > 20) {
$(".navbar").addClass("sticky");
} else {
$(".navbar").removeClass("sticky");
}
});
});
function initMap() {
... | true |
8249476777b22231debeb0c3ac67a8f5092f9bff | JavaScript | gupta-anand/node-typescript-jest | /src/Greeter.js | UTF-8 | 97 | 2.53125 | 3 | [] | no_license | "use strict";
function greeter(name) {
return `Hello, ${name}`;
}
exports.greeter = greeter;
| true |
8e899019b8cd5c7991966e9953cf8564d4a61575 | JavaScript | stagas/object-map | /test.js | UTF-8 | 787 | 2.9375 | 3 | [
"MIT"
] | permissive | import assert from 'assert';
import map from './index.js';
const source = {
a: 2,
b: 3,
c: 4
};
const expected = {
length: 3,
values: [2, 3, 4],
keys: ['a', 'b', 'c'],
refs: [source, source, source],
output: { a: 4, b: 6, c: 8 }
};
const results = {
length: 0,
values: [],
keys: [],
refs: [],
... | true |
126daff67c90280d9b991bc097efd72635a77425 | JavaScript | zhangmaliang/Conference | /js/Redux/Reducer/ConferenceListReducer.js | UTF-8 | 2,783 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | /**
* Created by zhangmaliang on 2017/7/27.
*/
import * as types from '../ActionTypes';
import {ListView} from 'react-native';
import {ObjectUtil, ArrayUtil} from '../../Utils'
const initialState = {
page: 1, // 页码
pageSize: 10, // 每次请求一页多少数据
topic: '', // 会议名称,用于搜索时
refreshing: false, // ... | true |
2a662276787d93359a746e664e99773021cdff8e | JavaScript | evinma/algorithm-demo | /src/utils.js | UTF-8 | 357 | 3.015625 | 3 | [
"MIT"
] | permissive | const initList = (num, start = 0, end = 100) => {
const list = Array(num)
for (let i = 0; i < num; i++) {
list[i] = Math.round(Math.random() * (end - start) + start)
}
return list
}
const changeNum = (list, l, r) => {
const tmp = list[l]
list[l] = list[r]
list[r] = tmp
}
module.expo... | true |
e3d44cca65959f9cd380ee996a9b36dbacce69e1 | JavaScript | spywhere/mini-challenges | /quint/index.js | UTF-8 | 155 | 3.25 | 3 | [] | no_license | function output(number) {
console.log(`${output.toString()}\n\noutput(${
(number % 5) + 1
}); // ${
(number % 5) + 1
}`);
}
output(1); // 1
| true |
9bc3d073b552b71942585cce7b1663d4b87b0690 | JavaScript | nathanworden/JS210-Fundamentals-of-JavaScript-for-Programmers | /09.JS_Small_Problems/05.easy5/04.get_the_middle_char.js | UTF-8 | 494 | 3.859375 | 4 | [] | no_license | function centerOf(str) {
var even = str.length % 2 === 0;
var centerIdx = Math.round((str.length / 2) - 1);
if (even) {
return str.slice(centerIdx, centerIdx + 2)
} else {
return str.slice(centerIdx, centerIdx + 1)
}
}
console.log(centerOf('I Love JavaScript')); // "a"
console.log(centerOf('Launch Sc... | true |
15eb72173a3cdb8ae3b63a644a9b3afc6478d7af | JavaScript | NomulaManaswini/project24 | /sketch.js | UTF-8 | 851 | 2.578125 | 3 | [] | no_license |
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
var engine,world,dustbin1,dustbin2,dustbin3,paper,ground;
function setup() {
createCanvas(1200, 700);
rectMode(CENTER)
engine = Engine.create();
world = engine.world;
Engine.run(engine);
groun... | true |
e7a6557a43ac26b56f215e68305b04dfcaf9f35b | JavaScript | ngr900/fx-nbp | /src/api/tablesApi.js | UTF-8 | 1,179 | 2.53125 | 3 | [
"MIT"
] | permissive | const {
validateDate,
validateCurrencyCode,
validateFXDate,
adjustFXDate,
validateDateRange,
validateAmountOfRecords,
} = require('../lib/validate.js');
const {
formSingleTableResponse,
formMultiTableResponse,
} = require('../lib/response/tables.js');
const { performCall } = require('../lib/core.js');
async... | true |
c878a7fe027cf2ad305682ad733c91d9cd5eecdd | JavaScript | mduguil/c0321-code-solutions | /javascript-loops-practice/countdown.js | UTF-8 | 141 | 3.078125 | 3 | [] | no_license | /* exported countdown */
function countdown(num) {
var nums = [];
while (num >= 0) {
nums.push(num);
num--;
}
return nums;
}
| true |
bc667fa29ae082928114909391eb9ab726c1617c | JavaScript | franklyhollywood/lab-06-e-commerce-site | /test/example.test.js | UTF-8 | 1,879 | 3.03125 | 3 | [] | no_license | // IMPORT MODULES under test here:
// import { example } from '../example.js';
import { findById } from '../findById.js';
import { candies } from '../data.js';
import { calcItemTotal } from '../cart/render-table-row.js';
import { renderTableRow } from '../cart/render-table-row.js';
// import { addToCart } from '../loc... | true |
bcb44b2c07cb2756e042ad3eeca6391825b92b56 | JavaScript | theeeita/Codewars-solutions | /completed/6kyu/simDigPow.js | UTF-8 | 1,018 | 3.96875 | 4 | [] | no_license | "use strict";
// https://www.codewars.com/kata/5626b561280a42ecc50000d1
/**
* @description Находит все числа удовлетворяющие условию d1^1 + d2+2+ dn^n = value, где d1, d2, ... dn
* цифры каждого числа в промежутке от a до b (включительно).
* @param {Number} a Начало промежутка.
* @param {Number} b Конец промежутк... | true |
587caacfdd71c7c1ff414d71c9d2f9e11b554afa | JavaScript | XiaopengDuan/Hello | /src/utils/utility.js | UTF-8 | 2,076 | 2.859375 | 3 | [] | no_license | import store from '@/stores'
export function digitize(n) { //接受一个number类参数,拆分成一个数组并返回
var str = n + ""; //加上空字符中,把接收的参数转换为字符串
var arr = []; //声明结果空数组,稍后返回
str.split("").forEach(function (item) { //调用split,以空字符串为分隔符切割字符串并返回数组,在数组上调用forEach方法
arr.push(parseInt(item)); //对传入的每个字符用pasre... | true |
edc7e8c3a337c26f0ff6c100927ae351c2d2bafa | JavaScript | iso159/kim-s-market | /frontend/src/store/reducers/memberReducer.js | UTF-8 | 1,323 | 2.671875 | 3 | [] | no_license | const initState = {
status: 'Y',
currentPage: '1',
rowPerPage: '5',
totalPages: 0,
totalMembers: 0,
members: [],
searchObject: {
searchKey: 'memberId',
searchValue: ''
}
}
const memberReducer = (state = initState, action) => {
switch(action.type) {
case 'GET_... | true |
2a5841e272b4c0a5d911affe1252ed7ca8984c53 | JavaScript | pshrmn/expiring-redux-messages | /src/helpers.js | UTF-8 | 331 | 3.359375 | 3 | [
"MIT"
] | permissive | /*
* returns a 10 character code
* ~839 quadrillion possibilities
*/
export function pseudoRandomID() {
const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
const charCount = chars.length;
return Array.from(Array(10))
.map(() => chars[Math.floor(Math.random() * charCount)])
.... | true |
004ec54b44604a34055f85fddb9bd5e409754088 | JavaScript | erraX/react-autocomplete | /src/util.js | UTF-8 | 1,075 | 2.796875 | 3 | [] | no_license | const toString = Object.prototype.toString
export function inArray(array, predict) {
return array.indexOf(predict) !== -1
}
export function isArray(source) {
return toString.call(source) === '[object Array]'
}
export function makeContainerId(id) {
return `${id}-dropdown__container`
}
export function con... | true |
b36afde7929c27e50873d1aa18d566d3472090ac | JavaScript | andrcatros/flora-api | /functions/index.js | UTF-8 | 1,537 | 2.6875 | 3 | [] | no_license | //import libraries
const functions = require("firebase-functions");
const admin = require("firebase-admin");
const express = require("express");
const bodyParser = require("body-parser");
//initialize firebase in order to access its services
admin.initializeApp(functions.config().firebase);
//initialize express serve... | true |
47b1ee96212ce0993cb124fc74fc741de98cbf56 | JavaScript | TheSignLab/CreativeLab_20180817_BB_HageIguru | /index.js | UTF-8 | 739 | 2.90625 | 3 | [
"MIT"
] | permissive | // Include BeastByte
const BeastClass = require("./lib/BeastByte.js");
// List all files in a directory in Node.js recursively in a synchronous fashion
const allFilesSync = (dir, fileList = []) => {
var fs = require("fs");
const path = require("path");
fs.readdirSync(dir).forEach(file => {
const filePath = p... | true |
4e1587817f194818aa2964f5bc5e319c4aaae62f | JavaScript | ghadad/datahub | /lib/transformer.js | UTF-8 | 3,565 | 2.6875 | 3 | [] | no_license | const moment = require("moment");
const lodash = require("lodash");
const rfs = require("require-from-string");
class Transformer {
constructor(params) {
this.functions = {}
this.init();
}
init() {
let self = this;
self.functions.customFunction = {
func: self.cus... | true |
e83a9350b023bc16f730d0cbbd8ba54ca50ae4b0 | JavaScript | MRchenkuan/html5-somatosensory | /server.js | UTF-8 | 2,461 | 2.59375 | 3 | [] | no_license | var express = require('express');
var session = require('express-session');
var cookieParser = require('cookie-parser');
var app = express();
/*全局变量,用来替代session*/
var DATA={};
// 设置 Session
app.use(cookieParser());
/*nodejs 的奇葩之处在于要显示的调用下req.session中的数据,才能对浏览器写入如下 name 的 session */
app.use(session({
secret: '123... | true |
f35888fead48322dcf25353e42a518db8f1b9f22 | JavaScript | Alexis559/polyteach-video | /src/core/Storage.js | UTF-8 | 2,201 | 2.921875 | 3 | [] | no_license | const fs = require('fs');
const logger = require('../helpers/logger');
/**
* Function to delete a file.
*
* @param pathFile The path of the file to delete
*/
const deleteFileFromStorage = (pathFile) => {
fs.unlink(pathFile, function (err) {
if (err) {
logger.log('error', 'src.core.Storage.d... | true |
4bd5e282b75d03394bc75b2cafddc359f899fff9 | JavaScript | DangerN/mod-3-client | /src/app.js | UTF-8 | 13,048 | 2.78125 | 3 | [] | no_license | const apiBase = 'http://localhost:3000/api/v1/'
const exercisePath = 'exercises'
const exerciseSessionsPath = 'exercise_sessions'
const exerciseSessionPath = 'exercise_session/'
const pageElements = {
home: document.querySelector('#home-button'),
out: document.querySelector('#out-button'),
in: document... | true |
788612592a1a7d058dfccf761a89dc90a345c02f | JavaScript | hararia/Katas | /5kyu/maximumSubarraySum.js | UTF-8 | 365 | 3.171875 | 3 | [] | no_license | //https://www.codewars.com/kata/54521e9ec8e60bc4de000d6c
//solution 1
var maxSequence = function(arr){
let max = 0
let i=0
while(i<arr.length){
for(let j=1; j<arr.length+1; j++){
let tempMax = arr.slice(i,j).reduce((acc,val)=>{return acc+val},0)
if (tempMax>max)
max=tempMax
... | true |
150350179c8d37a9dd7a08c104972dd4efd99e4f | JavaScript | SylvainMJC/clap-series-2 | /src/occurences.js | UTF-8 | 3,622 | 3.75 | 4 | [] | no_license | /*
* /!\ À essayer seul, me mp si trop compliqué !
*
* Le but de cette fonction est de déterminer le nombre de cartes ayant la même valeur dans un tableau :
* cards = ["Ad", "7h", "8d", "As", "Qs"] alors occurences(cards)
* retournera { as: 2, seven: 1, eight: 1, queen: 1 }
*
* Une carte est une chaîne de cara... | true |
5d28fbc97ef36406d2a28669f2a4b7d50e304329 | JavaScript | ricardocerq/FEUP-LAIG | /Project 1/MyDiamond.js | UTF-8 | 2,799 | 3.015625 | 3 | [] | no_license | function MyDiamond(scene, slices) {
CGFobject.call(this,scene);
this.slices=slices;
/*this.tris = [];
var delta_rad = Math.PI*2/this.slices;
for(var j = 0; j <= slices; j++){
this.tris.push(new MyTriangle(scene, 0,1,0, .5*Math.cos(j*delta_rad), 0, .5*Math.sin(j*delta_rad),.5*Math.cos((j+1)*delta_rad), 0, .5*M... | true |
7c39dd793bc66eff08d3dda62feb37078ad9d979 | JavaScript | pedrooaugusto/desafio-back-end-wpensar | /frontend/src/Api/Compras.js | UTF-8 | 2,353 | 2.625 | 3 | [] | no_license | import * as Authorization from './Authorization';
const LOCAL_HOST = '';//'http://localhost:8000';
const makeHeaders = token => {
const headers = new Headers();
headers.append('Content-Type', 'application/json');
headers.append('Authorization', token);
return headers;
}
const hasToken = (fn) =>{
const token = ... | true |
4f202e5ac6207a5f259c79b50c4c9e1d347ba6f6 | JavaScript | OpusCapita/react-hierarchy-selector | /test/models/checked-hash-item.spec.js | UTF-8 | 2,494 | 2.5625 | 3 | [
"MIT"
] | permissive | /* eslint-disable prefer-arrow-callback */
/* eslint-disable func-names */
import { expect } from 'chai';
import getData from '../data';
import CheckedHashItem from '../../src/models/checked-items/checked-hash-item';
const data = getData();
const parent1 = data[0];
const parent10 = parent1.children[0];
const item =... | true |
61a010be0263eb7304f4b3942ae6e6d25cf2cfc7 | JavaScript | Abdo-Najjar/Fundamentals-of-savings-course | /نشاط 2 أسس الإدخار/js/entities.js | UTF-8 | 1,178 | 2.671875 | 3 | [] | no_license | "use strict"
class Question{
constructor(content , sulotion , op1 , op2 , op3 , op4){
this.content = content;
this.sulotion= sulotion;
this.op1 = op1;
this.op2 = op2;
this.op3 = op3;
this.op4 = op4;
}
}
var content1 = "هو الادخار الحر الذى يقوم به الفرد طوعاً واستجاب... | true |
6c4b698202508da1797143f3e50a8c42c27c0f76 | JavaScript | gdouglas/curriculum-designer | /currMap-panel/js/script.js | UTF-8 | 8,764 | 2.53125 | 3 | [] | no_license | // flags
var filterApplied = false;
$(document).ready(function(){
$('#currMapSwitcher').on('change', function(e){
$('#maps div[id ^= "map"]').hide();
$('[id ^= "'+this.value+'"]').show();
});
addListeners();
});
function addListeners(elem){
//select menu
$('#cohort-chooser').on('change',function(e){... | true |
758250e7d1d946e744759904d80321af77a285f3 | JavaScript | dayTimeAffect/Growth-record | /nowcoder/剑指offer/数组/二维数组中的查找.js | UTF-8 | 2,279 | 4 | 4 | [] | no_license | /*
* 题目描述:在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序
* 请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
* */
// 注意关键字,顺序排序
function Find(target, array) {
/*
* 思路:如果存在一个数在这个每一行每一列的递增二维矩阵中
* 那么它一定满足这一行 array[i][0] <= target && target <= array[i][length]
* 只要满足这样条件的每行,使用查找算在该行进行查找
* 每一行n... | true |
d68d01020012d9f81238935e612f6b0981c74e8a | JavaScript | emon061/FriendFinder | /app/routing/htmlRoutes.js | UTF-8 | 673 | 2.75 | 3 | [
"MIT"
] | permissive | // DEPENDENCIES
// Path package to get the correct file path for our html
var path = require('path');
// ROUTING
module.exports = function(app) {
// HTML GET Requests. When users visit a page/endpoint, show the corresponding HTML page to user
app.get('/survey', function(req, res) {
res.sendFile(path... | true |
4ffa48a93fbe386c3e0d5d19a0b103a45606499a | JavaScript | pentiafrn/BOC.build | /src/foundation/template-loader/template-loader.test.js | UTF-8 | 721 | 2.875 | 3 | [] | no_license | import TemplateLoader from './template-loader';
document.body.innerHTML = `<div>
<script id="template-name" type="text/template">
<h1 class="title">{title}</h1>
<div class="description">{description}</div>
<a href="{href}">{linkText}</a>
</script>
</div>`;
describe('Template Loader', () => {
it('it c... | true |
ecd6c01c06022d279195d4998ec878dc49ca29ec | JavaScript | Jeremyreiner/DI_Bootcamp | /week3/Day3/Daily_Challenge/dailyChallenge.js | UTF-8 | 883 | 3.859375 | 4 | [] | no_license | let input = document.getElementById("userInput")
let button = document.getElementById("enter")
let ul = document.getElementsByTagName("ul")[0]
//add a listener for key down and open a new function
input.addEventListener('keydown', keyDown);
function keyDown(e) {
//creat a new variable for li
let li = document... | true |
8ac9df10fdb4caa9cd9bd4f0c2bb45433fa43920 | JavaScript | automarketing/BidApplier | /Sportsjun/public/js/sportsjun.js | UTF-8 | 52,399 | 2.53125 | 3 | [
"MIT"
] | permissive | var textAreaLength = 250;
var tabPressed = false;
function InitRatings(){
$('input.b-rating').not('.rate-init').addClass('rate-init').rating().on('change', function () {
var target_id = $(this).data('target_id');
var type = $(this).data('type');
var value = $(this).val();
$.ajax({
... | true |
d9170fb41c521dfb70f86863ed2b43eac88b196c | JavaScript | cerebralideas/phi-simple-blog | /routes/blog.js | UTF-8 | 4,315 | 2.8125 | 3 | [
"MIT"
] | permissive | /*
* GET blog posts.
*/
var fs = require('fs'),
markdown = require('markdown').markdown;
function buildBlogPosts(req, res) {
var iter = 0,
iterTwo = 0,
postFiles = [],
length = 0,
posts = [];
function compare(a, b) {
if (a.rawDate > b.rawDate)
return -1;
if (a.rawDate < b.rawDate)
return 1;
... | true |
99adc94e7586d51a71bb89b432145cbd1e84a816 | JavaScript | hanlinz/leetcode-javascript | /数组/1.两数之和.js | UTF-8 | 992 | 3.984375 | 4 | [] | no_license | /*
给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。
你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。
示例:
给定 nums = [2, 7, 11, 15], target = 9
因为 nums[0] + nums[1] = 2 + 7 = 9
所以返回 [0, 1]
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/two-sum
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
*/
/**
* @param {number[]} ... | true |