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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
293e5dbe1036afa2345caaf4c47a0bbbb22c2e8a | JavaScript | MTLChrisLEE/DrawingApp | /DrawingApp.js | UTF-8 | 2,473 | 2.53125 | 3 | [] | no_license | $(function () {
var canvas = document.getElementById("paint");
var context = canvas.getContext("2d");
var paint = false;
var paint_erase = "paint";
var container=$("#container");
var mouse = {x:0, y:0};
if(localStorage.getItem("YourImage")!=null)
{
var img = new Image();
... | true |
9e3d1388c4e4eebbbdccfe423c952d65a77461d8 | JavaScript | Duchieuctk41/vocabb | /client/src/redux/utils/storeUtils.js | UTF-8 | 419 | 2.90625 | 3 | [] | no_license | export const addItem = (store, id) => {
let store1 = store.filter(item => item._id === id);
store1[0].quantity = store1[0].quantity + 1;
console.log(store1);
return [ ...store, ...store1 ];
}
export const removeItem = (store, id) => {
let store1 = store.filter(item => item._id === id);
store1[0... | true |
584b8ffb40e6c00005ddb78af2ac328d08cf88dc | JavaScript | owozz94/vmc_front | /src/components/dashboard/Orders.js | UTF-8 | 2,457 | 2.734375 | 3 | [] | no_license | import * as React from 'react';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
import TableCell from '@mui/material/TableCell';
import TableHead from '@mui/material/TableHead';
import TableRow from '@mui/material/TableRow';
import Title from './Title';
//volume : 거래랑, rateOfR... | true |
efc168bc1c40c35b159ae4a49ea06ab5d23d8e1a | JavaScript | eleazarMar/lazer | /src/canvas/graphics/LineDash.js | UTF-8 | 451 | 2.921875 | 3 | [
"MIT"
] | permissive |
// An Array. A list of numbers that specifies distances to alternately draw a line and a gap (in coordinate space units).
// If the number of elements in the array is odd, the elements of the array get copied and concatenated.
// For example, [5, 15, 25] will become [5, 15, 25, 5, 15, 25].
export default function L... | true |
389692804527560bd2229eea87cfbc5692305bfd | JavaScript | Roumit/VictronVRMread | /src/index.js | UTF-8 | 2,601 | 2.703125 | 3 | [] | no_license | "use strict";
const login_pass = require('./login_pass.js');
const axios = require('axios');
import {writeInstallationsList} from "./domCreate";
import {getAxiosRequest} from "./getRequest";
//APIs:
// https://vrmapi.victronenergy.com/v2/auth/login
// /v2/users/{idUser}/installations
export const target... | true |
28e49b9fe4e3fd37abfa5bf4abc27840c0bab95b | JavaScript | artlantis/css-expression | /lib/functions.js | UTF-8 | 13,456 | 2.671875 | 3 | [] | no_license | /**
* Functions implementations used in LESS expressions.
* It’s a slightly modified version of original LESS implementation:
* https://github.com/less/less.js/blob/master/lib/less/functions.js
*
*/
if (typeof module === 'object' && typeof define !== 'function') {
var define = function (factory) {
module.expor... | true |
25c45bb1855a1eeda411183918acf60f612608b4 | JavaScript | rahimianarezoo/LIQID-Coding-Challenge | /assets/scripts/loadProductList.js | UTF-8 | 1,484 | 2.953125 | 3 | [] | no_license | function loadProductList(productList, wrapperId) {
const listContainer = document.getElementById(wrapperId);
if (listContainer) {
listContainer.innerHTML = '';
productList.forEach(product => {
let li = document.createElement('li');
li.classList.add('product-list__item')... | true |
9611d13c0be9ce2d1c4f879dd6b6a67669f4ba8b | JavaScript | jren-lambda-school/React-Components-Insta-Clone | /src/App.js | UTF-8 | 1,097 | 3.046875 | 3 | [] | no_license | /*
Start here and then work through the
PostsContainer components and the CommentSection Components.
Not all files need code added.
Look at each file to see where you need to pass props or add code
*/
import React, {useState} from "react";
import "./App.css";
import PostsPage from "./components/PostsContainer/Post... | true |
ca50d2fbc1909a6806ab85e648471ff0a7ef5d37 | JavaScript | tasvora/DataVisualizations_JobMarketAnalysis | /static/js/app.js | UTF-8 | 5,261 | 2.75 | 3 | [] | no_license | /*
//@Author tasneem: Adding code for button selection.
On click event will be handled and the required states will be retireved
from the database based on the routes.
*/
var indeedSite = d3.select("#indeed");
var glassdoorSite = d3.select("#glassdoor");
indeedSite.on("click", function () {
// Select the current co... | true |
ecfa3df1145151e9f6a5ee8175bd49879e1effe0 | JavaScript | nikeyes/GameOfLife | /js/src/GameOfLifeCanvasRender.js | UTF-8 | 2,678 | 3.078125 | 3 | [
"MIT"
] | permissive | function GameOfLifeCanvasRender(gameOfLife, pixelSize, numMaxGenerations, insertionElement) {
this.gameOfLife = gameOfLife;
this.generation = 0;
this.pixelSize = pixelSize;
this.insertionElement = insertionElement;
this.generationLabel = document.createElement("Label");
this.generationLabel.inne... | true |
00f12d2a15d5b6f3634f1877347451df0e83063d | JavaScript | Kyznake/CatchUp | /src/main/resources/static/components/addFriendAdded.js | UTF-8 | 3,778 | 2.546875 | 3 | [] | no_license | /********************************* /
* Orginal by Hassan. 2020-03-24
* Last Edited by Hassan. 2020-04-08
* Notes: This component lists friends that will be members of new created channel
/**********************************/
export default{
template:`
<section id="friendListForCreateChannelContainer">
... | true |
cc414440bbf2e8c95799263cc50e3387d1acd8e6 | JavaScript | gopsmaddy/WakHelps | /UIScripts/extjs/MYUI/lib/common/xjqueryvalidation.js | UTF-8 | 861 | 2.65625 | 3 | [] | no_license |
// password restrictions
jQuery.validator.addMethod("password", function(value,element)
{
return this.optional(element) || /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{7,20}$/i.test(value);
}, "Password must contain 7-20 characters with uppercase letters, lowercase letters and at least one number.");
/*
jQuery.validator.addMe... | true |
dde54c7decfaabe1eb5cc02389e47ffa6b7f44bc | JavaScript | varadgautam/scripter | /main.js | UTF-8 | 3,175 | 2.5625 | 3 | [] | no_license | //game resources
var g_resources = [
{name: "ground_tiles", type: "image", src: "data/ground_tiles.png"},
{name: "gameover", type: "image", src: "data/other/gameover.png"},
{name: "heart", type: "image", src: "data/other/heart_1.png"},
{name: "metatiles", type: "image", src: "data/metatiles.png"},
{name: "area0... | true |
59155c7c23f30e5065181ef27db85f98e192bb7a | JavaScript | SarangShah87/distilled.pm | /atom.js | UTF-8 | 1,045 | 2.515625 | 3 | [] | no_license | module.exports.feed = function (entries, updated) {
return `<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Distilled Pamphlets</title>
<id>https://distilled.pm</id>
<link href="https://distilled.pm/feed.xml" rel="self" />
<link href="https://distil... | true |
cabf517dafb7cca45943967f004063ff0df4299c | JavaScript | NicolasSchwarzer/nicolas1.1 | /system/javascripts/Math.js | UTF-8 | 1,282 | 3.59375 | 4 | [
"MIT"
] | permissive | /**
*
* @author Nicolas Wan
*
* Math API
*
* public static Number distance(Number x, Number y);
*
* public static Number distance2(Array point1, Array point2);
*
* public static Number angle2radian(Number angle);
*
* public static Number radian2angle(Number radian);
*
* public static Number angle(Number x... | true |
9d7e989fe42218737bd583bc11e9522b7c436542 | JavaScript | ColeMacGrath/SpinAndAnswer-Front | /Questions/Add/script/script.js | UTF-8 | 1,987 | 2.8125 | 3 | [] | no_license | var button = document.getElementById('button');
var cookie = getCookie('session');
var header = new Headers();
header.append("Content-Type", "application/json");
header.append("Authorization", "Bearer " + cookie);
var logoutButton = document.getElementById('logout');
logoutButton.addEventListener('click', f... | true |
cfabda69116a799d6a1e2bc88df2118d23997a1a | JavaScript | JoseRobertoECJr/tour-of-heroes | /api/routes/api.js | UTF-8 | 3,072 | 2.8125 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
//models
var Hero = require('./../models/hero');
//GET api listing
router.get('/', (req, res) => {
res.send('api works');
});
//routes
//'/hero routes'
router.route('/heroes')
//Create a Hero (accessed at POST http://localhost:8080/api/hero... | true |
c878d2aa9735303e641127976ccf8103c3948e90 | JavaScript | KSimonnet/open_all_LinkedIn_search_results | /open_all_LinkedInRecruiter_search_results-branch.js | UTF-8 | 5,583 | 3.234375 | 3 | [] | no_license | // Solution 1: solved using promise/then and async/await
function scrollToElm(elm) {
return new Promise(function (resolve) {
setTimeout(function () { // the function executes on the window scope
resolve(elm.scrollIntoView(true));
}, 10);
});
}
async function loadDOMsubTree(arr) ... | true |
cbc47e0891511102d01acc24f026df37211c5c29 | JavaScript | lmedinatriana/To-Do-List | /js/app.js | UTF-8 | 917 | 3.3125 | 3 | [] | no_license | var userSubmit = document.querySelector('#user-submit');
var toDoList = document.querySelector('#to-do-list');
function addToDo(event){
event.preventDefault(); //Whatever you do, DO NOT do it
var userInput = document.querySelector('#user-input');
if (userInput.value === '') { //empty string
return false;
}
//... | true |
e51af9c381414ef130ae2ea72adddac35161f4a5 | JavaScript | seizethegap/msheroes | /scripts/npc/2001004.js | UTF-8 | 565 | 2.546875 | 3 | [] | no_license | var status = 0;
function start()
{
cm.sendYesNo("Would you like to be warped back to your home town?");
}
function action(mode, type, selection)
{
if (mode == -1)
cm.dispose();
else
{
if (status >= 0 && mode == 0)
{
cm.sendOk("Okay. Let me know when you want to get out of here.");
cm.dispose();
}
... | true |
657bf845558164447aa9130843446a85d929c532 | JavaScript | chenhx2015/collection | /proxy/this.js | UTF-8 | 1,102 | 3.765625 | 4 | [] | no_license | // 虽然 Proxy 可以代理针对目标对象的访问,但它不是目标对象的透明代理,即不做任何拦截的情况下,也无法保证与目标对象的行为一致。主要原因就是在 Proxy 代理的情况下,目标对象内部的this关键字会指向 Proxy 代理
const target = {
m: function () {
console.log(this === proxy);
},
};
const handler = {};
const proxy = new Proxy(target, handler);
target.m(); // false
proxy.m(); // true
// 例子一:
const target =... | true |
e5846f660cbb03eae0411088303690bd1e562ba9 | JavaScript | yourant/explore-world | /fromSL/shared-erp/directives/defaultValOnlyRead.js | UTF-8 | 2,065 | 2.8125 | 3 | [] | no_license | /**
* // el-select 多选下拉默认值只读,不可删除
* // el-select 的clearable功能依旧可删除默认值
*
* 使用示例:data-valueKey="attrTermId" v-slDefaultValOnlyRead="{'selected': [1,2,3], 'defaultVal': [2]}"
* 使用示例:data-valueKey="attrTermId" v-slDefaultValOnlyRead="{'selected': [{id:1, label:'test1'}, {id:2, label:'test2'}], 'defaultVal': [{id:2}]}"... | true |
4ecea49680d5b2a0dd27d6956a519b045a7bcca7 | JavaScript | beebeean09/widgets | /Widgets/tabs.jsx | UTF-8 | 837 | 2.78125 | 3 | [] | no_license | import React from 'react';
class Tabs extends React.Component{
constructor () {
super();
this.state = {selectedPane: 0};
this.selectedTab = this.selectedTab.bind(this);
}
selectedTab(num) {
// debugger;
this.setState({selectedPane: num });
alert(num);
}
render () {
// debugger... | true |
e0405948aba906e35d32851cede17de6593a4cc5 | JavaScript | njk345/Miscellaneous-Javascript | /binaryOctConvert.js | UTF-8 | 1,186 | 4.125 | 4 | [] | no_license | //this program takes an input value in base 2 and converts it to base 8, and vice-versa.
function bin2Oct (bInput) {
var input = bInput;
input = input.toString();
var arrPut = [];
for (var i = 0; i < input.length; i++) {
arrPut.push(input[i]);
}
if (arrPut.length % 3 !== 0) {
if (arrPut.length % 3 === 1) {
... | true |
c68cdd73d874607783a48441ac21f9ce03feb424 | JavaScript | ott8bre/elm-iot | /server.js | UTF-8 | 532 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | const http = require("http");
const server = http.createServer((req, res) => {
res.setHeader("Access-Control-Allow-Origin", "*");
res.writeHead(200, { "Content-Type": "application/json" });
const data = [Math.random(), Math.random(), Math.random()];
res.end("[" + data.join() + "]");
});
const callback = () =>... | true |
41d95c1f63bb339474a7cf22afd175f949f9b07c | JavaScript | Boydbueno/imp01-2014 | /week5/examples/1-arrays/scripts/script.js | UTF-8 | 1,233 | 4.625 | 5 | [] | no_license | // Creating an array
var fuelTypes = [];
console.log(fuelTypes); // []
// Filling the array
fuelTypes[0] = "Gas";
fuelTypes[1] = "Diesel";
fuelTypes[2] = "Gasoline";
fuelTypes[3] = "Electricity";
console.log(fuelTypes); // ["Gas", "Diesel", "Gasoline", "Electricity"]
// Combined
var fuelTypes = ["Gas", "Diesel", "Gas... | true |
086aae547dba53c3365ba701c8ac9d5bf5c9fd86 | JavaScript | mkjiro/ReversiForReact | /src/index.js | UTF-8 | 5,018 | 2.953125 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
const MASUNUM = 8;
class Square extends React.Component {
/* constructor(){
super();
this.state={
value:null
}
}
*/
render() {
return (
<button className="square" onClick={()=>this.props.onClick()}>
{this.props.value}... | true |
4b15fc1b7c0f41998a2b752791774b666cffb441 | JavaScript | bergtholdt/jigna | /jigna/js/src/app/client.js | UTF-8 | 9,656 | 2.5625 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////////////
// Client
///////////////////////////////////////////////////////////////////////////////
jigna.Client = function() {};
jigna.Client.prototype.initialize = function() {
// jigna.Client protocol.
this.bridge = this._get_b... | true |
35a9ae74a15a345ef5db9c16591a8b5611a70f2c | JavaScript | swapman972/fewpjs-iterators-fndcl-fnexpr-filter-lab-nyc-web-033020 | /index.js | UTF-8 | 419 | 3.75 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Code your solution here
function findMatching(array, string) {
return array.filter( (n) => {
return n.toLowerCase() === string.toLowerCase();
})
}
function fuzzyMatch(arr, str) {
return arr.filter( r =>
r.toLowerCase().indexOf(str.toLowerCase()) === 0
)
}
function matchName(array, ... | true |
d6da421afd898abb659f0b7f9a2ae2b2d88d453c | JavaScript | Happacode/scheduler | /src/helpers/selectors.js | UTF-8 | 824 | 2.734375 | 3 | [] | no_license | export function getAppointmentsForDay(state, day) {
const appFind = state.days.find(
(days) => days.name === day);
const appArray = appFind ? appFind.appointments.map(
(id) => state.appointments[id]) : [];
return appArray;
};
export function getInterview(state, interview) {
if(!interview) {
re... | true |
028ce2857158a742913a683e48b4ef9e82bbc415 | JavaScript | oguzkulcu/reactjs-weather | /src/data/reducers/active/index.js | UTF-8 | 282 | 2.515625 | 3 | [] | no_license | let initialState = {
link: 'home'
};
export default function user(state = initialState, action) {
switch (action.type) {
case 'SET_ACTIVE':
return Object.assign({}, state, {link: action.payload.link});
default:
return state;
}
}
| true |
accea81cbc932f6c2d27114c61b396bbe003420a | JavaScript | frdvorak/newsfeed | /src/components/Science.js | UTF-8 | 3,735 | 2.8125 | 3 | [] | no_license | import React, { Component } from 'react';
import Article from './Article';
import Headline from './Headline';
import Calendar from './Calendar';
import Controls from './Controls';
class Science extends Component {
state = {
articles: [],
headlines: [],
country: 'country=gb',
categor... | true |
38a6de17d01c30db758daffc683b05895e770a41 | JavaScript | alexzywiak/learnyounode | /08.js | UTF-8 | 310 | 2.890625 | 3 | [] | no_license | var http = require('http');
var url = process.argv[2];
http.get(url, function(response){
var completeData = '';
response.on('data', function(data){
completeData += data.toString();
});
response.on('end', function(){
console.log(completeData.length);
console.log(completeData);
});
}); | true |
45712fce388c6ea48afcc8d6fe13d2380a6257fd | JavaScript | StefanoQuiroz/REACT-MERN | /forms/src/components/moreForms/MoreForms.js | UTF-8 | 3,750 | 2.921875 | 3 | [] | no_license | import React from 'react';
const MoreForms = (props) => {
const {inputs, setInputs} = props;
const onChangeClick = (event) => {
const name = event.target.name;
const value = event.target.value;
setInputs({
...inputs,
[name]:value,
})
}
... | true |
a22ad92e354dfa7bb5dcde66262d6bacd51788a9 | JavaScript | ssjjcao/AnimationRecommend | /animation_recommend_frontend/JS/InfoDetails.js | UTF-8 | 1,492 | 2.71875 | 3 | [] | no_license | if (!getCookie("user")) {
window.location = "../html/login.html";
}
const obj = {};
obj.targetName = getCookie("user");
const jsonStr = JSON.stringify(obj);
var json1 = JSON.parse(jsonStr);
$.ajax({
url: "http://127.0.0.1:8080/user/getUserInfo",
method: 'get',
data: json1,
dataType: "json",
bef... | true |
e4ea172ef001ea73d7a1a02292f649595f555955 | JavaScript | zoecahill1/dataRepresentation-project | /js/search.js | UTF-8 | 3,766 | 3 | 3 | [] | no_license | $(document).ready(function () {
let apikey = "c460f163";
// Search function
function search() {
// Grab the search term value from input field
let searchTerm = $('#search').val().toLowerCase(),
// Set empty HTML value for printing to page after getting search results
... | true |
3dc53611f1e9a241c799b434696af23efd523cff | JavaScript | Pinjasaur/rpin | /lib/util.js | UTF-8 | 992 | 3.109375 | 3 | [
"MIT"
] | permissive | const rpn = require("./rpn");
// Remove all non-digits and non-operators
const normalize = input => input.replace(/[^\d+\-\/*% ]/g, "");
// Iterate over a normalized input to delimit based on operators/operands
function format(input) {
let chars = input.split(""),
acc = "",
expr = [];
chars.forEac... | true |
f9e628afd489ca7968ab1bfdd87b37f00986fe24 | JavaScript | melonybox/JavaScript_Practice | /code_challenges/days_1-7/day_2_edabit.js | UTF-8 | 532 | 2.96875 | 3 | [] | no_license | class Employee {
constructor (firstname, lastname) {
this.firstname = firstname
this.lastname = lastname
// Complete the code!
}
get fullname(){
return `${this.firstname} ${this.lastname}`
}
get email(){
return `${this.firstname.toLowerCase()}.${this.lastname.toLowerCase()}@company.com`
}
}
// ... | true |
269ad1b2429c42b7e32f83e554756812f4560980 | JavaScript | bhanu-manthry/phaser-clock | /js/text.js | UTF-8 | 1,101 | 2.828125 | 3 | [] | no_license | function textRef() {
style = {
// font: '20px Arial',
fill: 'white',
// fontWeight: 'bold',
// align: 'center'
};
// tempText.anchor.set(0.5);
// tempText.setShadow(1, 1, 'rgba(0, 0, 0, 0.5)', 1);
// tempText.addColor('#ff00fe', 2);
// tempText.addColor('#3F51B5'... | true |
bfa8714cdd5003a6e7e59ddbb2c6f6fdbcdfbd3a | JavaScript | krystyna26/Algorithm_Challenges_Dojo | /7 - Arrays II/flatten.js | UTF-8 | 1,130 | 4.09375 | 4 | [] | no_license | // eliminate nested & empty arrays. do not alter it. return a new one retaining order
// function flatten(arr){
// var newArr =[];
// for(var i=0; i<arr.length; i++){
// if(arr[i] instanceof Array){
// // for(j=0; j<arr[i].length; j++){
// // newArr.push(arr[i][j].pop());
//... | true |
edbedd6fc204c909ffcf0ed8d328809c99482b64 | JavaScript | Amazonash/password-generator | /script.js | UTF-8 | 1,649 | 4.0625 | 4 | [] | no_license | // Assignment Code
var generateBtn = document.querySelector("#generate");
var lowerString = "abcdefghijklmnop"
var lowerArray = lowerString.split("");
console.log(lowerArray)
var upperString = "ABCDEFG"
var upperArray = upperString.split("");
console.log(upperArray)
function askForOptions() {
var length = parseI... | true |
f4b0c1aa48f4bf4cc68aabfc96b7d57261f6f6f0 | JavaScript | TilangaPramith/MyLawyer-Mobile | /server/modules/appointment/model.js | UTF-8 | 2,625 | 2.796875 | 3 | [] | no_license | const sql = require('../../database/db');
const Appointment = function(appointment){
this.client = appointment.client;
this.abstract_day = appointment.abstract_day;
this.time = appointment.time;
this.create_day = new Date();
this.appointment_Id = appointment.appointment_Id;
this.today = new Da... | true |
cdb6ca1e71ce914194d7d21bc8d13c23cdbdb6f8 | JavaScript | Djpowell23/liri-node-app | /liri.js | UTF-8 | 7,736 | 2.9375 | 3 | [] | no_license | // Storing Spotify Information in process.env
require("dotenv").config();
// Require Axios
var axios = require('axios');
// Require Bands in Town
// var bandsintown = require('bandsintown')('codingbootcamp');
// Require Inquirer
var inquirer = require('inquirer');
// Require Spotify
var Spotify = require('node-spot... | true |
279517a7e7f6a37f7f19da17ef43d420c01527bd | JavaScript | AemiliusM/Lab04bnumber-tester | /app.js | UTF-8 | 1,247 | 4.1875 | 4 | [] | no_license | // import functions
import { isEven, isOdd } from './is-even.js';
// reference needed DOM elements
const input = document.getElementById ('input');
const oddImage = document.getElementById ('odd');
const evenImage = document.getElementById ('even');
const button = document.getElementById ('button');
function showCorr... | true |
b7f745b81b9e1e9fd7b88571b4586af2f9da8e75 | JavaScript | hawjeh/NodeJS-SimpleSocketIOChatApp | /server/utils/validation.test.js | UTF-8 | 495 | 2.578125 | 3 | [] | no_license | const expect = require('expect');
const {isRealString} = require('./validation');
describe('isRealString', () => {
it('should reject non-string values', () => {
var resp = isRealString(98);
expect(resp).toBe(false);
});
it('should reject string only spaces', () => {
var resp = isRealString(' ');
... | true |
a82d7f37b470e105e12850276126676ba44f2687 | JavaScript | achadha0111/moodbot | /alexabot/test/moodbot.js | UTF-8 | 1,794 | 2.546875 | 3 | [
"MIT"
] | permissive | 'use strict';
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
var expect = chai.expect;
var mood_Data_Helper = require('../moodDataHelper');
chai.config.includeStack = true;
describe('mood_Data_Helper', function() {
var subject = new mood_Data_Helper();
var u... | true |
3af146051254604d4aa10530f105ba44bb3b2968 | JavaScript | StartPolymer/polymer-starter-kit-old | /app/scripts/psk-app.js | UTF-8 | 619 | 2.640625 | 3 | [
"MIT"
] | permissive | (function (document) {
'use strict';
// Grab a reference to our auto-binding template
// and give it some initial binding values
// Learn more about auto-binding templates at http://goo.gl/Dx1u2g
var app = document.querySelector('#app');
// Listen for template bound event to know when bindings
// have r... | true |
db1427849ee9c9caa2ac6d6e8f978817de8518cb | JavaScript | Shahar13/SelaMainProject | /backend_OLD/app.js | UTF-8 | 8,797 | 2.609375 | 3 | [] | no_license | // TO RUN THE NODE SERVER ===>
// npm run start:server
// OR
// node server.js
const express = require('express');
const bodyParser = require('body-parser');
const bcrypt = require('bcryptjs');
const fs = require('fs');
const multer = require('multer');
const upload = multer({dest: __dirname + '../../src/assets/img'})... | true |
048014efef18886b385fb4688be35ad74d1d06b3 | JavaScript | LaurelOlson/betting_game_node | /game.js | UTF-8 | 1,751 | 3.40625 | 3 | [] | no_license | "use strict";
var prompt = require('sync-prompt').prompt;
var INITIAL_BANKROLL = 100;
var MIN_GUESS = 1;
var MAX_GUESS = 10;
var MIN_BET = 5;
var MAX_BET = 10;
var bankroll = INITIAL_BANKROLL;
newGame();
function newGame() {
bankroll = INITIAL_BANKROLL;
playRound();
}
function playRound() {
var bet = prompt(... | true |
aa7940dcff22ba6dd10d249a534ed0ddbecc40af | JavaScript | TomG90/exercises | /day22-react-arrays-fetch/03-list-and-keys--arrays-in-state/src/components/ListWithArrayState.jsx | UTF-8 | 2,140 | 3.828125 | 4 | [] | no_license | import { useState } from 'react'
const ListWithArrayState = () => {
const [numbers, setNumbers] = useState([1,2,3,4,5])
const handleClick = () => {
/* the principle of changing the array state is shown here. Everything else - multiplying the numbers,
multiplying the whole list or even remo... | true |
df2e7b6204beaf84028cf343c2366fe683065768 | JavaScript | mikekline/Sait-Javascript-Assignment3 | /js/app.js | UTF-8 | 3,482 | 3 | 3 | [] | no_license |
home = home => {
//resests to default home screen
document.querySelector('#title').innerHTML = "Welcome to a D&D Companion App";
document.querySelector('#emblem').src=`assets/icons8-dragon-100.png`;
let clear = document.querySelectorAll("p");
clear.forEach(p => {
p.innerHTML=""
});
}
callApi ... | true |
0168c242c72b776199c27b45736deb0aaa484882 | JavaScript | fjfoxru/test-for-gpm-radio | /js/main.js | UTF-8 | 1,305 | 2.671875 | 3 | [] | no_license | const modal = document.querySelector('.modal-wrapper');
const modalClose = document.querySelector('.close');
modalClose.addEventListener('click', event => {
event.target.closest('.modal-wrapper').classList.remove('modal-wrapper_active');
});
const modalOpen = Array.from(document.getElementsByClassName('button_open... | true |
8147f788061f2bcc9e52281b7317b66f788bcadb | JavaScript | belcurv/node-mentorship | /client/js/output-module.js | UTF-8 | 1,051 | 2.6875 | 3 | [] | no_license | /** output-module.js
Feature module to contain output from GET and POST features
*/
/* globals app */
app.outputModule = (function() {
/* ===================== init module scope variables ===================== */
const DOM = {};
/* =========================== private methods ===========================... | true |
99e485fbd4901812edce1596152fa570d93f9191 | JavaScript | zquaddd/360mall | /src/js/louti.js | UTF-8 | 935 | 2.515625 | 3 | [
"MIT"
] | permissive | // 首页楼梯效果
const $louti = $('.leftMenu')
const $btn = $('.leftMenu li')
const $con = $('.con')
let $top = $(window).scrollTop()
// 页面下滚至一定高度,显示楼梯
$(window).on('scroll', function() {
$top = $(window).scrollTop()
if ($top > 500) {
$louti.show()
} else {
$louti.hide()
}
// 页面滚动至某一个楼层,对... | true |
398f40ab57dceb0f7b9c700b1616d9d97efe276a | JavaScript | AdhikChintalwar/JavascriptProject | /controls.js | UTF-8 | 782 | 3.484375 | 3 | [] | no_license | // function click(){
// alert("hello")
// }
// function mouse(){
// alert("hi")
// }
// function blurs(){
// let x= document.getElementById("text")
// x.value = $("#text").val().toUpperCase();
function isNumber(evt) {
if(evt.keyCode>47 && evt.keyCode<58 || evt.keyCode==8){
... | true |
0be834002fe62c346ee5a6090ab1d52244fcaf9b | JavaScript | 08yuta1408/dmo_projects | /javascript/age_stay_with/2017/age_stay_with_feb.js | UTF-8 | 6,741 | 3.59375 | 4 | [] | no_license | /*
定義
one:一人旅行
couple:カップル・夫婦
parent:家族・親子
friend:友人
group:団体旅行
others:その他
*/
var age_stay_with_feb_one = [0, 0, 0, 0, 0, 0, 0, 0]; //index番号順に、20代未満・20代・30代・40代・50代・60代・70代・80代以上
var age_stay_with_feb_couple = [0, 0, 0, 0, 0, 0, 0, 0]; //index番号順に、20代未満・20代・30代・40代・50代・60代・70代・80代以上
va... | true |
3b20dc8caa2e71266ca8a07cb14c1231f088d8dc | JavaScript | tom9744/Algorithms | /프로그래머스/Level2/Javascript/기능개발.js | UTF-8 | 1,245 | 3.28125 | 3 | [] | no_license | function solution(progresses, speeds) {
var answer = [];
while (progresses.length > 0) {
// 각 작업에 대한 진척도를 반영한다.
progresses = progresses.map((progress, index) => {
const nextProgress = progress + speeds[index];
return nextProgress > 100 ? 100 : nextProgress;
}... | true |
7ce988871e8394e66e7bd5ee87ddf4e7bc063a1c | JavaScript | micahstubbs/world-mayors-data | /scripts/src/is-category-page.js | UTF-8 | 310 | 2.765625 | 3 | [] | no_license | function isCategoryPage(link) {
const patterns = ['/wiki/Category:']
for (let i = 0; i < patterns.length; i += 1) {
const pattern = new RegExp(patterns[i].toLowerCase())
const found = pattern.test(link.toLowerCase())
if (found) return true
}
return false
}
module.exports = isCategoryPage
| true |
643cae9b4b6636172b57989f2ac7e581f5bd13de | JavaScript | whatsupnanap/nanatSDI | /sdi-lab8/Tanaka_Nanap_Lab8.js | UTF-8 | 985 | 4.21875 | 4 | [] | no_license | //alert("JavaScript works!");
//variables
var emailInput = prompt("Please enter your email");
var emailChecker = function (stringValue){
var at = emailInput.indexOf("@");
var dot = emailInput.lastIndexOf(".");
//if statement
if ( at < 1 || dot < at + 2 || dot + 2 >= emailInput.length ) {
var falseOutput ... | true |
27d2de5841ddc4d3153259aedb2d350e446acb50 | JavaScript | mobeausoleil/BeausoleilMO_JeuxDame | /source/jeu.js | UTF-8 | 41,652 | 2.53125 | 3 | [] | no_license | (function () { // IIFE
"use strict";
//Variable pour référencer le jeu
var leJeu;
//Constantes du jeu
var TAILLE_TUILES = 64;
var NB_COLONNES = 8;
var NB_TUILES_PAR_RANGE = 4;
var NB_LIGNES = 8;
var NB_TUILES = NB_COLONNES * NB_LIGNES;
var NB_DAMES = 12;
//Variables ... | true |
36a957b91ee28df2c37b70e6cbcdf7badfad0391 | JavaScript | Rinaldysputra/kanban-app | /server/controllers/taskController.js | UTF-8 | 1,828 | 2.59375 | 3 | [] | no_license | const { Task } = require('../models')
class TaskController{
static getAllTasks(req,res,next){
Task.findAll({
where: {
userId: +req.userData.id
},
order:[['date','asc']]
})
.then(data => {
res.status(200).json(data)
})
... | true |
e390668361b07d4294c5f41fcd3243e63fb57eb5 | JavaScript | jomefavourite/frontendmentor_room-homepage. | /public/app.js | UTF-8 | 1,457 | 2.953125 | 3 | [] | no_license | function call(name) {
return document.querySelector(name);
}
function callAll(name) {
return document.querySelectorAll(name);
}
let mobileNav = call("#mobileNav"),
ham = call(".ham"),
close = call(".close"),
overlay = call(".overlay");
ham.addEventListener("click", () => {
mobileNav.classList.toggle("show... | true |
96d05998b61937727ee5b99c968f7fa39ff40360 | JavaScript | jensandresen/kvlocal | /src/tests/test-store.js | UTF-8 | 2,325 | 2.75 | 3 | [
"MIT"
] | permissive | const mocha = require("mocha");
const { assert } = require("chai");
const TheSut = require("../store");
function sutBuilder(options) {
const inMemoryStore = new Map();
if (options && options.seed) {
for (key in options.seed) {
inMemoryStore.set(key, options.seed[key]);
}
}
return new TheSut({
... | true |
c06bc4c96ffe764418b0f8f7355a59299d0d26cf | JavaScript | chrismilway/tocalabs | /src/App.js | UTF-8 | 3,730 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
import NodeContext from './context';
import AppList from './AppList';
import AppControls from './AppControls';
import AppWindow from './AppWindow';
import { getId } from './utils';
const LSKEY = 'toca-test-nodes';
class App extends Component {
constructor() {
supe... | true |
ef1d63983ebf52a694c7bbdab31c378e19a6e57b | JavaScript | shinnn/npm-version-compare | /index.js | UTF-8 | 1,086 | 2.71875 | 3 | [
"ISC"
] | permissive | 'use strict';
const {inspect} = require('util');
const importPackage = require('import-package');
const inspectWithKind = require('inspect-with-kind');
const npmCliVersion = require('npm-cli-version');
const ERROR = 'Expected a semver-valid version (<string>)';
importPackage.preload('semver');
module.exports = asy... | true |
6c14b3a81c64a230e8f56f99b8c0ad259049e2a0 | JavaScript | seopseo/react-dictionary | /src/Person.js | UTF-8 | 685 | 3.03125 | 3 | [] | no_license | import React, { Component } from 'react'
// class Person extends Component {
function Person({country, name, age}) {
//render(){
// 초기 데이터
// const name = "seopseo"
// const age = 32
// const {country, name, age} = props // 부모로부터 전달되는 값, 함수 사용시 this. 제거
// props을 지정 후 넣어줘도 되... | true |
6b18992d6f7ee0e3fdd218a4509d7b9e2e2c3a48 | JavaScript | artback/uphold_bot__coding_exercise | /src/bot.js | UTF-8 | 920 | 2.859375 | 3 | [] | no_license | import { EventEmitter } from "events";
/**
* @param {Object} config Configuration to run bot
* @param {number} config.fetchInterval interval in ms between each fetch,
* @param {function} config.retriever used on each currency pair to retrieve new data
* @param {[]string} config.currencyPairs Array of all the curren... | true |
6cd98ba0bf3cc835414e6251b513712aebf501a6 | JavaScript | shashi7846/countryweatherdetails | /index.js | UTF-8 | 3,517 | 3.40625 | 3 | [] | no_license |
var container = document.createElement("div");
container.setAttribute("class", "container");
var row = document.createElement("div");
//Added these two lines which is required
row.setAttribute("class", "row");
row.setAttribute("id", "rowId");
var col = document.createElement("div");
col.setAttribute("c... | true |
970618e517f575ce2c2ad311fad933142c6e9de4 | JavaScript | ziflex/rapture-js | /src/validators/common.js | UTF-8 | 5,927 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | const _ = require('lodash');
const Issue = require('../issue.js');
const LogicDefinition = require('../logicDefinition.js');
const Rule = require('../rule.js');
const RuleContext = require('../ruleContext.js');
function validateSeverity(severity) {
if (_.isNil(severity)) {
return 'error';
}
switch... | true |
6ba99d84e9a0ae86820bce2496c843c42f1001e3 | JavaScript | jakwer84/triangle | /script.js | UTF-8 | 293 | 3.265625 | 3 | [] | no_license | var a = 12;
var h = 12;
var triangleArea = a*h/2;
console.log('Triangle field with base a: ' + a + ' and height h: ' + h + ' is equal to: ' + triangleArea);
function myFunction() {
alert('Triangle field with base a: ' + a + ' and height h: ' + h + ' is equal to: ' + triangleArea);
} | true |
653eb7393a9715b19935a0a512d789001f0aebb8 | JavaScript | Jigunho/preprocessing | /makelog/2_find_location.js | UTF-8 | 1,286 | 2.53125 | 3 | [] | no_license | const fs = require('fs');
const config = require('./config');
const date = config.date;
const folder = `./result/${date}_after/`;
const outerFolder = `./location`;
const locationName = config.location
const minLatitude = config.minLatitude;
const maxLatitude = config.maxLatitude;
const minLongitude = config.minLongitud... | true |
18ed849d5b7b495c73890c0ebeca673d575d0c97 | JavaScript | konstantin-kolomiets/fe_course | /experiments/promises.js | UTF-8 | 257 | 2.953125 | 3 | [] | no_license | const getNumber = new Promise((resolve, reject) => {
setTimeout(() => resolve('4'), 3000);
// setTimeout(() => reject(new Error('Error')))
});
getNumber
.then((res) => console.log(res))
.catch(console.log)
.finally(console.log('exit')); | true |
9d0b2aa3b56c13249898da9e34cb516617313338 | JavaScript | GuiiMoreira/Desafio-modulo-1-BackEnd | /Questao 1/index.js | UTF-8 | 177 | 3.390625 | 3 | [] | no_license | function solucao(lista) {
const totalAcumulado = lista.reduce((acc, item) => acc + item)
console.log(totalAcumulado)
}
const numeros = [1, 2, 3, 4]
solucao(numeros) | true |
38caf76a6f545497cdc57a57a769911ccc040ef7 | JavaScript | mgjeffries/NSS-martins-aquarium | /scripts/fish-dom-modifier.js | UTF-8 | 671 | 3.15625 | 3 | [] | no_license | // build the html of all the fish, and insert it into the dom
import { lookupFish } from './dataProvider.js'
import { fishHTMLCreator } from './fish-html-creator.js'
// export function for modifying the DOM
export const fishDomModifier = () => {
// get the element to modify
const contentElement = document.querySel... | true |
6037b162985c958c907d10ccf08dc9136f537c73 | JavaScript | aleksslav/Smart-Device-master | /js/main.js | UTF-8 | 4,657 | 2.953125 | 3 | [] | no_license | 'use strict';
(function () {
const KEYCODE = {
esc: 27
};
const link = document.querySelector(`.main-nav__button`);
const popup = document.querySelector(`.modal-overlay`);
const close = popup.querySelector(`.modal-overlay__close`);
const form = popup.querySelector(`.modal-overlay__form`);
const modal... | true |
ae941100d2055b437f25b4bf36546150d662ddc0 | JavaScript | snailjj/ReactNativeDemos | /FlexBox/index.ios.js | UTF-8 | 1,696 | 2.78125 | 3 | [] | no_license | /**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
var FlexBox = React.createClass({
render : function () {
return (
<View style = {styles.container}>
... | true |
88c8300e0341b9a02417e168c82a9c15562ecac8 | JavaScript | hegnn/filtered-shopping | /src/App.js | UTF-8 | 3,640 | 2.5625 | 3 | [] | no_license | import React from 'react'
import Products from './components/Products/Products'
import data from './data.json'
import {filterPlainArray} from './filterPlainArray'
import { useEffect, useState } from 'react'
import Navbar from './components/Navbar/Navbar'
import CartLayout from './components/Cart/Layout/CartLayout'
imp... | true |
b2210acf933308cb4d33e9bb0404deed13a24459 | JavaScript | sunnysetia93/competitive-coding-problems | /LeetCode/All/js/90.subsets-2.js | UTF-8 | 502 | 3.046875 | 3 | [
"MIT"
] | permissive | /**
* @param {number[]} nums
* @return {number[][]}
*/
var subsetsWithDup = function(nums) {
const powerSet = [];
const map = {};
function addToPowerSet(arr, index){
const str = arr.length ? arr.sort().join() :'';
if(map[str] == null){
powerSet.push(arr);
map[str] ... | true |
520009d17ea5309ea2b98773c5203ded7dd1f01c | JavaScript | cindy-wang2/week6 | /homework/movies.js | UTF-8 | 3,136 | 3.078125 | 3 | [] | no_license | window.addEventListener('DOMContentLoaded', async function(event) {
let db = firebase.firestore()
let url = 'https://api.themoviedb.org/3/movie/now_playing?api_key=9b581f7d8c842c457d6c8baa24e27295&language=en-US'
let response = await fetch(url)
let movies = await response.json()
console.log(movies)
let al... | true |
0ab692ff5e13a62048a957058ff62b43781ece4d | JavaScript | Max-Shevchenko-Web/phonebook_backend | /utl.js | UTF-8 | 167 | 2.6875 | 3 | [] | no_license | // eslint-disable-next-line arrow-body-style
const isContains = (arr, keyWord, item) => {
return arr.some((a) => a[keyWord] === item)
}
module.exports = isContains
| true |
6eb911be472306466ab4831df379ab1b041cb39c | JavaScript | razvanilin/react-tests-lecture | /src/Overview/Overview.js | UTF-8 | 2,649 | 2.796875 | 3 | [] | no_license | import React, { Component } from "react";
import { Link } from "react-router-dom";
import modelInstance from "../data/DinnerModel";
import "./Overview.css";
class Overview extends Component {
constructor(props) {
super(props);
// We create the state to store the various statuses
// e.g. API data loading ... | true |
34d1736a13fb325d53838aff3b40d084a324dade | JavaScript | darkprado/js1 | /hw1/1li.js | UTF-8 | 168 | 2.515625 | 3 | [] | no_license | function celsi() {
var f = +prompt("Введите градусы по фаренгейту");
var c = (f - 32) / 1.8;
alert( Math.round(c * 100) / 100);
} | true |
5e0941f1dbf07e9b5df50a4335500574848c1d3e | JavaScript | OscarLundberg/PlayFabGameJam | /cloud.js | UTF-8 | 5,745 | 2.640625 | 3 | [] | no_license | function read(key) {
// return JSON.parse(server.GetTitleData()[key] || "[]");
var dataRequest = { "Keys": [key] };
var response = server.GetTitleData(dataRequest);
if (!response.Data.hasOwnProperty(key)) {
log.error("no data found");
return [];
}
else {
return JSON.pars... | true |
871d33b1cf3d5f8d1c56bda85a1bba7aa23f8042 | JavaScript | Shuvayu/mfa-webapp | /src/MFA/wwwroot/js/speechFunctionality.js | UTF-8 | 963 | 2.8125 | 3 | [
"MIT"
] | permissive | $(document).ready(function () {
$('#speech-text-button-trigger').click(function () {
if (GetTextSpeech() === "") {
return;
}
$.ajax({
type: 'GET',
url: 'api/speechAnalysisAsync?speechText=' + GetTextSpeech(),
success: function (file... | true |
35e0c7c2cddc8af4af97e751613e3a48affbd0d7 | JavaScript | farhanashammas/newrep | /casestudy/ajax.js | UTF-8 | 531 | 2.59375 | 3 | [] | no_license |
$(document).ready(function(){
$("#demo").click (function(){
$.ajax({
method:"GET",
url:"https://jsonplaceholder.typicode.com/todos",
success:function(result)
{
// console.log(result);
list="<ul>"
for(i in result)... | true |
8cba0cc0fe5c0fcf3f86e5d047a7c2c262c7bc8f | JavaScript | Hani-ALHamad/JavaScript30-Challenges | /23 - Speech Synthesis/my_js.js | UTF-8 | 2,130 | 3.125 | 3 | [] | no_license | let voices = [];
const speakButton = document.querySelector('#speak');
const stopButton = document.querySelector('#stop');
const rate = document.getElementsByTagName("input")[0]
const pitch = document.getElementsByTagName("input")[1]
const select = document.getElementById("voices");
const text = document.getEleme... | true |
ea782a1aaec50c703f89cec7bd442419c31f3579 | JavaScript | alex-curtin/the-ride-classroom-app | /client/src/components/teacher/Dates.js | UTF-8 | 1,069 | 2.5625 | 3 | [] | no_license | import React, { useEffect } from 'react';
import { Link } from 'react-router-dom';
import Moment from 'react-moment';
/**
* Functional React component diplaying all available dates.
* @user Teacher
* @param {object} props - React props.
* @returns {JSX.Element} - Rendered component.
*/
const Dates = ({ dates, loa... | true |
04643972bb5fa411471ab7bfb052c6fc25a27db7 | JavaScript | baragon23/Movie-Text-Alert-postgresql- | /app/assets/javascripts/movieApp/movieCtrl.js | UTF-8 | 3,114 | 2.640625 | 3 | [] | no_license |
//jQuery.getScript('../youtube_api.js');
window.movieApp.controller('MovieController', [ '$http', '$scope', 'Movie',
function($http, $scope, Movie, YoutubeSvc) {
var apiURL = "http://api.themoviedb.org/3/movie/upcoming?api_key=d0a8b0361581f05b502a995a7cf2e923&callback=JSON_CALLBACK";
var poster_directory = "http:... | true |
dc8c7913017930d95ae8ac8715ef4765abd39496 | JavaScript | ArthurDon/claroErp | /src/utils/Validator/CNPJ/index.js | UTF-8 | 758 | 3.125 | 3 | [] | no_license | /**
* Function Validator CNPJ
* @param {int} value
*/
export function validatorCNPJ(value) {
const cnpj = value.replace(/[^0-9]+/g, '');
if (cnpj.length < 14) {
return {
status: false,
message: 'Por favor, digite um número de CNPJ válido!',
};
}
if (
cnpj === '00000000000000' ||
... | true |
5bafc3d514596b975c2c0ae27dd08cc8afaf0276 | JavaScript | AneeqaKhan/cartExample | /src/components/common/commonReducer.js | UTF-8 | 568 | 2.515625 | 3 | [] | no_license | import {REQUEST_BEGIN, REQUEST_DONE, CONNECTION_STATUS} from './commonType';
const initialState = {
requestCount: 0,
isConnected: true,
};
const CommonReducer = (state = initialState, action) => {
switch (action.type) {
case REQUEST_BEGIN:
return {...state, requestCount: state.requestCount + 1};
c... | true |
fd109c0f3386e3bef82cc36de0135fba76411201 | JavaScript | xuanquy1120/CI44 | /chatApp/js/controller.js | UTF-8 | 2,408 | 2.5625 | 3 | [] | no_license | const controller = {}
controller.register = (registerInfo) => {
if (registerInfo.firstName === '') {
view.setErrorMessage('error-first-name', 'Please input first name')
} else {
view.setErrorMessage('error-first-name', '')
}
if (registerInfo.lastName === '') {
view.setErrorMessage('error-last-name',... | true |
edff3259ba91f34976c2c3332213a6287b31249d | JavaScript | cloud-tech-assignments/assignment-two | /pub.js | UTF-8 | 2,563 | 3.15625 | 3 | [] | no_license | const json2xml = require("json2xml");
const EXI4JSON = require("exificient.js");
const {
input,
topicOne,
topicTwo,
sensorOne,
sensorTwo,
client,
numOfPublishers,
} = require("./config").config;
// Sends message every 5 seconds
client.on("connect", () => {
// Ends the session if the input in config.js ... | true |
1f5efbf67f2028bbfe773ef93a5602988f747ee2 | JavaScript | jgwill/lampyno | /www/wp-content/plugins/ultimate-reviews/js/ewd-urp-pie-graph.js | UTF-8 | 1,860 | 2.96875 | 3 | [
"GPL-2.0-or-later",
"GPL-1.0-or-later",
"GPL-2.0-only",
"GPL-3.0-only",
"MIT"
] | permissive | /* http://jsfiddle.net/cM74U/3/ */
jQuery(document).ready(function() {
URP_AddReviewPieGraph();
});
function URP_AddReviewPieGraph() {
jQuery('.ewd-urp-pie-graphic').each(function() {
var canvas = jQuery(this).get(0);
var ctx = canvas.getContext("2d");
var rating = jQuery(this).dat... | true |
e916c1700378dbb807a54956711ce6e256541b65 | JavaScript | Bento0397/bento.com | /atividades/web/at-3/js/gameLoop.js | UTF-8 | 2,614 | 3.453125 | 3 | [
"MIT"
] | permissive | var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
canvas.width = 640;
canvas.height = 423;
document.body.appendChild(canvas);
//Cenário
var bgReady = false;
var bgImage = new Image();
bgImage.onload = function(){
bgReady = true;
};
bgImage.src = "./image/background.jpg";
//Jogador
v... | true |
6a479196abce4f8f972595bb6ef7e1d20ece644d | JavaScript | GregoryArmstrong/portal2d | /test/detector-test.js | UTF-8 | 7,377 | 2.515625 | 3 | [
"MIT"
] | permissive | const chai = require('chai');
const assert = chai.assert;
const Detector = require('../lib/detector');
const Player = require('../lib/player');
const Block = require('../lib/block');
const Projectile = require('../lib/projectile');
describe('Detector', function(){
let detector = new Detector();
context('with def... | true |
53bc3feb0c2fe4f610eade91d86eea9c990df99d | JavaScript | pkthein/axie-manager | /coinsServer.js | UTF-8 | 1,880 | 2.640625 | 3 | [] | no_license | // const bodyParser = require('body-parser');
const express = require('express');
const app = require('express')();
// const axios = require('axios');
//1. Import coingecko-api
const CoinGecko = require('coingecko-api');
//2. Initiate the CoinGecko API Client
const CoinGeckoClient = new CoinGecko();
const port = 500... | true |
693bc2666e78b1bc802046676c19d4ab90bbbbba | JavaScript | mathieuLrt/dw-ui | /lib/components/utils/timer.js | UTF-8 | 417 | 2.703125 | 3 | [
"MIT"
] | permissive | export default function (callback, delay) {
let timerId; let start; let remaining = delay
this.pause = function () {
window.clearTimeout(timerId)
remaining -= new Date() - start
}
this.resume = function () {
start = new Date()
window.clearTimeout(timerId)
timerId = window.setTimeout(callba... | true |
95a445515e6281e1aa9f7e26f881843a929cbf38 | JavaScript | ofionz/bodrii | /assets/js/scripts.js | UTF-8 | 1,239 | 2.78125 | 3 | [] | no_license | // function([string1, string2],target id,[color1,color2])
startAnimateTable();
function startAnimateTable() {
let tables = Array.from(document.querySelectorAll("[id^='content-']"));
tables.forEach(function (table) {
let tableNodes = Array.from(table.childNodes).filter(elem => elem.tagName);
... | true |
5a46e5847bf75d0a65d763990752e903281901cb | JavaScript | smaloron/formation-nodejs-06-2020 | /my-modules/fruit-list.js | UTF-8 | 1,068 | 3.296875 | 3 | [] | no_license | // Importation du modue events
const EventEmitter = require("events");
// instanciation d'un nouvel EventEmitter
// qui est exporté pour que les autres
// fichiers puissent écouter
exports.fruitEvent = new EventEmitter();
// Création d'une liste vide
const fruitList = [];
// Fonction d'ajout d'élément à la liste
exp... | true |
6849ecd44c526ef570b5536ecfeb503c08982b69 | JavaScript | karann7/rgb-color-game | /main.js | UTF-8 | 3,506 | 3.71875 | 4 | [] | no_license | function greet(){
var name = prompt('What is your name?');
var textOutput = $('#greettext');
if(name === null){
greet();
} else if(name.length > 3){
textOutput.html(name);
} else {
alert('Name must be over three letters.');
greet();
}
}
greet();
function randomColors() {
var squareTracker = 6;
v... | true |