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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
17a803cbdcdc6d269459abcf2cd7818bf047ab73 | JavaScript | oashtari/vacation-suggester | /js/script.js | UTF-8 | 2,523 | 3.109375 | 3 | [] | no_license | // back end
var vacation = function(name,continent,landscape,social,age) {
if(name) {
if (continent === "europe") {
if (landscape === "beach") {
if (social === "introvert") {
return "norway";
} else if (social === "extrovert") {
return "estonia";
}
} else ... | true |
870d724c1ab83eff4a87941c9defba3ca6f35ff7 | JavaScript | wfwuestc/BlockBreaker | /js/main/utils.js | UTF-8 | 484 | 2.828125 | 3 | [] | no_license | var log = console.log.bind(console)
// var log = function (s) {
// e('#id-text-log').value += '\n' + s
// }
// var imageFromPath = function (path) {
// var img = new Image();
// img.src = path
// return img
// }
var rectIntersects = function (a, b) {
if (Math.min(a.x + a.image.width, b.x + b.image.width) > M... | true |
a13f4dac690733b0bc98590af2ccd567d655a373 | JavaScript | michaelfarrow/gatsby-newsletter | /src/lib/date.js | UTF-8 | 305 | 2.546875 | 3 | [
"MIT"
] | permissive | import moment from 'moment'
export const DATE_FORMAT = 'DD-MM-YYYY'
export const DATE_REGEX =
'(?:0[1-9]|(?:[1-2][0-9])|3[0-1])-(?:0[1-9]|1[0-2])-\\d{4}'
export const DATE_FORMAT_FRIENDLY = 'Do MMMM YYYY'
export default function date(str) {
if (!str) return null
return moment(str, DATE_FORMAT)
}
| true |
1ebc635aedd6f2db819a5f3c318c21d12a236f57 | JavaScript | mdshohidulislam1486/Prg-hero-projects | /JS PRACTICE/explore-function/switch.js | UTF-8 | 843 | 3.765625 | 4 | [] | no_license | // var color ="yellow";
// if (color ==="blue"){
// console.log("color is blue")
// } else if (color =="red"){
// console.log("Color is red")
// } else if (color =="white"){
// console.log("Color is white")
// }
// else if (color =="black"){
// console.log("Color is black")
// } else if (color =="yello... | true |
14f2752141473acb3215564e33cb7e2e85df4f7d | JavaScript | humayun-ahmad/node-js-basics | /script.js | UTF-8 | 1,144 | 4.03125 | 4 | [] | no_license | /*
var firstName = 'John';
console.log(firstName);
var lastName = 'Smith';
var age = 28;
var fullAge = true;
console.log
var job;
console.log(job);
*/
/*******************
* coding chalange 1
*/
/*
var markMass = prompt("Enter Mark's mass & and it's unit will be kg.");
var markHeight = prompt("Enter Mark's heig... | true |
bf536d844f828854b305cc1412a1b27d95c2423d | JavaScript | VladRezonans/sky_fish | /script/mega_missile.js | UTF-8 | 2,560 | 2.59375 | 3 | [] | no_license | //---------------------------------------------------------------------------------------------------------------------------------------------------
extend(tMegaMissile, tSmartMissile);
//-----------------------------------------------------------------------------------------------------------------------------------... | true |
fbc1aaaeb77346f9a601538af88139b5cf8368e1 | JavaScript | Chithra42/-chithra-badge-challenge-3 | /ajax.js | UTF-8 | 754 | 3.34375 | 3 | [] | no_license |
const rankingsBody=document.querySelector("#rankings-table>tbody")
function loadRankings(){setTimeout(() => {
const request= new XMLHttpRequest()
request.open("get","rankings.json")
request.onload=()=>{
const json =JSON.parse(request.responseText)
populateRankings(json)
}
request.se... | true |
3ced99cd35d9067c55daa8b2b215adc412a3b394 | JavaScript | karenpeng/nerdy | /bubble_sort/visualize.js | UTF-8 | 8,450 | 3.09375 | 3 | [] | no_license | /*
* This is a JavaScript port of Aldo Cortesi's Python program
* See: http: //www.hatfulofhollow.com/posts/code/visualisingsorting/index.html
*
* This code is in the public domain - do whatever you like with it.
*
*/
function Sortable(i) {
this.i = i;
this.path = [];
}
function TrackList(itms) {
for (var i=... | true |
b7603107303345a05e8e988cc05a271084b831c2 | JavaScript | robertasliekis/book-search-code | /src/components/oldScripts.js | UTF-8 | 1,262 | 2.65625 | 3 | [] | no_license | var columnAmount = 4;
var dataAmountInColumn = 0;
if (dataAmount % columnAmount == 0) {
dataAmountInColumn = dataAmount / columnAmount;
}
var containerMinHeight = booksSelectorHeight / columnAmount;
var containerSetHeight = 0;
var booksInColumn = 0;
booksSelector.forEach((book, index) => {
if (contai... | true |
65a4bf0c624d49f78fcd0b95308c9856e9cb853c | JavaScript | fangdiao/thoughtworks_homework | /bin/dataHandle.js | UTF-8 | 3,489 | 2.796875 | 3 | [] | no_license | const message = require('./message');
const moment = require('moment');
let dataHandle = {
//存储所有数据
_data: {
'A': {
'booked': [
// {
// 'username': 'user111',
// 'price': 100,
// 'startTime': 1409500800000,
// 'endTime': 1530374400000
// }
],
... | true |
cf78988fe3173dd424201fab6784a05ab759208a | JavaScript | puntnomads/YelpEvents | /client/src/components/Results/reducer.js | UTF-8 | 2,304 | 2.578125 | 3 | [] | no_license | import {
SEARCH_YELP,
SEARCH_YELP_SUCCESS,
SEARCH_YELP_ERROR,
SAVE_EVENT,
SAVE_EVENT_SUCCESS,
SAVE_EVENT_ERROR
} from "./constants";
import type { ResultsState } from "./types";
type State = ResultsState;
const initialState = {
results: [],
event: {},
requesting: false,
successful: false,
messag... | true |
a1951721cc38e38bd14c44a3a1b02f30b2dc3ff3 | JavaScript | femosc2/surveymetrics | /src/components/Questionnaire/QuestionnaireScale.js | UTF-8 | 3,681 | 2.65625 | 3 | [] | no_license | import React from 'react';
import styled, {css} from "styled-components"
class QuestionnaireScale extends React.Component {
constructor(props) {
super(props);
this.state = {
value: ''
};
this.handleChange = this.handleChange.bind(this)
this.handleSubmit = this.h... | true |
b15c49d0726f9683d5f305c9ea7f650095bf99e1 | JavaScript | Sindhudevan/Javascript | /test.js/testjavascript05.js | UTF-8 | 793 | 3.3125 | 3 | [] | no_license |
function profession(){
var name = document.getElementById("enter01").value;
var result = name.split("+");
console.log(result)
let sum=0;
for(let i=0;i<result.length;i++){
sum+=parseInt(result[i])
}
document.getElementById("enter02").value=(sum) ;
// switch(name){
// ... | true |
5df5e2cacbe02cb84f53d82b583d1aa5e3d6a1d6 | JavaScript | projetweb2i/3eme_version | /projet_web/fonction.js | UTF-8 | 8,992 | 2.515625 | 3 | [] | no_license | var largeur, hauteur, barre, connection, inscription, contenu, indice, ss_menu, banniere;
var select1, select2, select3;
var test;
var test1, test2, test3, test4;
function largeur_hauteur_page()
{
largeur=window.innerWidth;
hauteur=window.innerHeight;
}
function init()
{
var i, text, taille;
taille=... | true |
abe138b5875078baf38877fd78eb9f21ab266853 | JavaScript | Adiso-1/Bootcamp-exercises | /Javascript/6.1-simple loop.js | UTF-8 | 95 | 2.859375 | 3 | [] | no_license | for (let i = 1; i <= 50; i++) {
console.log(`Voter number ${i} is currently voting`);
} | true |
0114ac9f891ff2ba93a6becefe3555d1edbaea5b | JavaScript | Caio-ED/logica | /03 - While__Ok/ex12.js | UTF-8 | 239 | 3.5625 | 4 | [] | no_license | // receber 15 numeros de entrada e fazer a media
var rs = require('readline-sync');
var i = 0;
var soma = 0;
while(i < 15){
var input = rs.questionInt("Digite um numero: ");
soma = soma + input;
i++
}
console.log(soma / 15); | true |
b963951ee3fa6b9ac8fe4839d9da743d17ac6e29 | JavaScript | Axolotl-Associated/axolota-articles | /server/server.js | UTF-8 | 2,726 | 2.625 | 3 | [] | no_license | const express = require('express');
// const path = require('path');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const cors = require('cors');
const userController = require('./controllers/userController');
const cookieController = require('./controllers/cookieController');... | true |
f73e7e451e0d2d09411d26460e6365a1553567f7 | JavaScript | Ana-R89/React | /More-React/app-game/src/Form/index.js | UTF-8 | 2,575 | 2.78125 | 3 | [] | no_license | import React, { useState } from 'react'
import validateForm from './validateForm'
const Form = () => {
const [user, setUser] = useState({})
const [hasBeenSubmitted, setHasBeenSubmitted] = useState(false)
const [formError, setFormError] = useState({})
const onChangeHandler = ({ target: { name, value } ... | true |
99fb2bfe23c3be919c3825826c23871d6f13cbb7 | JavaScript | fkupper/data-structure-algorithms | /src/algorithmic_toolbox/max_pairwise_product.js | UTF-8 | 3,004 | 3.203125 | 3 | [] | no_license | 'use strict';
let readline = require('readline');
process.stdin.setEncoding('utf8');
let rl = readline.createInterface({
input: process.stdin,
terminal: false
});
let input = [];
rl.prompt();
rl.on('line', readLine);
function readLine(line) {
if (line !== "\n") {
input.push(line);
}
if (input.leng... | true |
8600cce5c7ebec2e2fee2d7121fee5c4dd26565b | JavaScript | ClementFo/EasyPoster | /modules/storeggmap/views/js/front-ggmap.js | UTF-8 | 2,823 | 2.5625 | 3 | [] | no_license | var map;
var infowindow = null;
$.getScript('https://maps.googleapis.com/maps/api/js?key=' + ggApiKey, initMap);
function initMap() {
map = new google.maps.Map(document.getElementById('storemap'), {
center: {lat: parseFloat(defaultLat), lng: parseFloat(defaultLong)},
disableDefaultUI... | true |
112ce78911fd8af17b5f6713ec21b22ca09120c9 | JavaScript | Nanton83/fewpjs-build-the-example-v-000 | /main.js | UTF-8 | 1,806 | 3.21875 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Defining text characters for the empty and full hearts for you to use later.
const EMPTY_HEART = '♡'
const FULL_HEART = '♥'
const errorPElement = document.getElementById('modal-message')
// Your JavaScript code goes here!
let classyHearts = document.querySelectorAll(".like-glyph")
for (let lkGlyph of classyHearts... | true |
aa8707bfb2a5240bd219890dbdf349e189121a61 | JavaScript | ADBionicman/goit-js-hw-07 | /js/task-2.js | UTF-8 | 488 | 3.046875 | 3 | [] | no_license | const ingredients = [
'Картошка',
'Грибы',
'Чеснок',
'Помидоры',
'Зелень',
'Приправы',
];
const listForAddingItems = document.querySelector(`#ingredients`);
const addListItems = (array) => {
const listArray = array.map(item => {
const listItem = document.createElement('li');
listItem.... | true |
6403b39adff189807c422c7b9976e5f94d0ce04c | JavaScript | mauricio-gamboa/video-player-app | /src/components/App/App.js | UTF-8 | 1,773 | 2.640625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
// CSS
import './App.scss';
// Components
import Form from '../Form/Form';
import Video from '../Video/Video';
import Thumbnails from '../Thumbnails/Thumbnails';
// Services
import {
getItem,
setItem
} from '../../services/store';
function App() {
const [videos... | true |
83fc7fef9921463bbba1af2ed14612c90871b062 | JavaScript | DanielYu0864/FunApp | /client/src/pages/CategoryPage/index.js | UTF-8 | 1,984 | 2.515625 | 3 | [
"ISC"
] | permissive | import React, {useEffect, useState} from 'react'
import { useLocation, Link } from 'react-router-dom';
import CategoryContainer from '../../components/CategoryContainer'
import Button from '../../components/Category/Button';
import media03JSON from '../../utils/media03.json';
import ActionButton from '../../components/... | true |
69353deb240de66b1c5cb19824147ea4fe3c4535 | JavaScript | calmm-js/turboshaft-lenses | /src/toOptic.js | UTF-8 | 620 | 2.6875 | 3 | [] | no_license | import {identity} from './identity'
import {index} from './index'
import {o} from './o'
import {prop} from './prop'
import {reader} from './reader'
export function toOptic(x) {
switch (typeof x) {
case 'string':
return prop(x)
case 'number':
return index(x)
case 'object': {
if (Array.is... | true |
f8961a06b2e640cc9405fd5b62b85eea9f4df690 | JavaScript | jhoopes/laravel-vue-forms-js | /src/classes/apiClient.js | UTF-8 | 4,055 | 2.625 | 3 | [] | no_license | export default class apiClient {
constructor() {
this.urlBase = null;
if (window.location && window.location.origin) {
this.urlBase = window.location.origin;
}
this.protocol = null;
this.defaultHeaders = {
Accept: "application/json"
};
}
... | true |
eaba63b45c2f21c549867f5f7a4461891a33cf7e | JavaScript | DarthAwesome/PF2E-Monster-Importer-UI | /src/utils/parsing-helpers-spells.test.js | UTF-8 | 18,023 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | import * as parsingHelper from './parsing-helpers.js'
test('spellList -> Array with 1 spellList - prepared', ()=>{
expect(parsingHelper.splitMultipleSpellStringToArray(`Primal Prepared Spells DC 35, attack +25; 7th regenerate, summon plant
or fungus; 6th baleful polymorph, chain lightning, tangling creepers;
5th c... | true |
51d1db176537809570766287c81a85dd77c08c91 | JavaScript | ghidalgo93/ClimbLib | /test/html.test.js | UTF-8 | 2,201 | 2.921875 | 3 | [] | no_license | // const ClimbLib = require('../src/climbLib');
// const Climb = require('../src/climb');
// const DomManipulation = require('../src/html');
const ClimbLib = require('../src/main').ClimbLib; //while I figure out modules, I'm combining them
const Climb = require('../src/main').Climb; //while I figure out modules, I'm co... | true |
2312122b6430c3aff16de6a164165b3315103a32 | JavaScript | skomaravelli/JavascriptTraining | /Session4/Task5.js | UTF-8 | 269 | 3.515625 | 4 | [] | no_license | //- http://www.codewars.com/kata/function-composition-1
function compose() {
var args = [].slice.call(arguments, 0);
return function(input) {
return args.reduceRight(addValues, input);
};
}
function addValues(val, step) {
return step(val);
} | true |
d73c53849d7958fab6c0898a310977f2dd901c95 | JavaScript | hsycamp/codesquad | /step5-3/model.js | UTF-8 | 2,433 | 3.109375 | 3 | [] | no_license | class Model {
constructor(initialData, MAX_HISTORY_CAPACITY) {
this.todoList = initialData || [];
this.historyStack = [];
this.MAX_HISTORY_CAPACITY = MAX_HISTORY_CAPACITY;
this.redoStack = [];
}
getId(key, value) {
const targetData = this.todoList.filter(todoData => todoData[key] === value).s... | true |
10339eb25b1ee3d886eda9805453c4a12f5d9049 | JavaScript | xkl2013/vipboon | /tests/killPort.js | UTF-8 | 429 | 2.796875 | 3 | [] | no_license | const kill = require('kill-port');
var http = require('http');
const port = normalizePort(process.env.PORT || '4000');
function normalizePort(val) {
var port = parseInt(val, 10);
kill(port).then(()=>{
console.log(`${port}端口已被kill`);
})
if (isNaN(port)) {
// named pipe
return val;... | true |
c15a3c5ce108157707c916a277efb8dabe7f1b0a | JavaScript | mahalo777/wleet | /simple/longCommonPre.js | UTF-8 | 5,024 | 3.875 | 4 | [] | no_license | /**
* 编写一个函数来查找字符串数组中的最长公共前缀。如果不存在公共前缀,返回空字符串 ""。
*/
const getCommonStr = (str1, str2) => {
if (str1 === '' || str2 === '') {
return '';
}
let minStr = str1.length > str2.length ? str2 : str1;
let maxStr = str1.length > str2.length ? str1 : str2;
let common = '';
for (let j = 0; j < minStr.length; j... | true |
9093ee25ed52bea5d2332122b266b7ae9fd83187 | JavaScript | Abhijeet-tilekar/Assignments | /book_ops.js | UTF-8 | 7,044 | 2.765625 | 3 | [] | no_license | const readline = require('readline')
const path = './books/'
const Fs = require('fs')
const RL = readline.createInterface({
input : process.stdin,
output : process.stdout
});
function list_books(path)
{
console.log("dsdsdsd")
Fs.readdir(path,(err,books)=>
{
if(err)
{
c... | true |
7b987f190c962274a91bad1eb30816e6e4394cb3 | JavaScript | parg-programador/blog-arquivos | /vuetify/auto-copy-c-sharp/postbuild.js | UTF-8 | 1,804 | 2.703125 | 3 | [] | no_license | const fs = require('fs');
const path = require('path');
console.log("Executando o postbuild...");
// função para limpar o diretório de destino
function limpar_destino(dest_dir) {
// processa a lista de arquivos e pastas do diretório
var files = fs.readdirSync(dest_dir);
files.forEach(function (file) {
... | true |
6cfc9d1b519bacff315e611416fe362e6f3b3c0c | JavaScript | dekuan/thingTrust-byteballcore | /uri.js | UTF-8 | 5,210 | 2.515625 | 3 | [
"MIT"
] | permissive | /*jslint node: true */
"use strict";
var log = require( './log.js' );
var ValidationUtils = require( './validation_utils.js' );
var constants = require( './constants.js' );
var conf = require( './conf.js' );
var Mnemonic = require( 'bitcore-mnemonic' );
function parseUri( uri, callbacks )
{
var protocol = con... | true |
dd52afaceeb9d3bee6ec91fe4f33b3a471e39705 | JavaScript | bcupp/Example-Slider-Bar | /js/scripts.js | UTF-8 | 392 | 2.53125 | 3 | [] | no_license | function sliderChange(value){
if (value > 15) {
$("#textDropDown1").slideDown("slow");
} else {
$("#textDropDown1").slideUp("slow");
}
if (value > 50) {
$("#textDropDown2").slideDown("slow");
} else {
$("#textDropDown2").slideUp("slow");
}
if (value > 75) {
$("#textDropDown3").slideD... | true |
2ca246388d9db6c8b7683a6948c33b340a35807b | JavaScript | ericstoecker/invoice-api | /src/toolbox/toolbox.js | UTF-8 | 1,763 | 2.90625 | 3 | [] | no_license | const Invoice = require('../models/Invoice');
const Customer = require('../models/Customer');
const fs = require('fs');
module.exports = {
//reads properties file and returns it
readProperties: function() {
const propertiesFileName = "properties.json"
const properties = require(`../../${proper... | true |
fba27aa789d634557f8a592d912528720b784955 | JavaScript | wilsonjackson/cake-knife | /test/spec/engine/ecs/SystemSpec.js | UTF-8 | 1,902 | 2.78125 | 3 | [] | no_license | describe('System implementation', function () {
'use strict';
var TestSystem;
var entityMatcher;
beforeEach(Engine.load(['ecs.System', 'util.Arrays'], function (System) {
entityMatcher = {match: function () {}};
TestSystem = function () {
System.call(this, entityMatcher);
};
TestSystem.prototype = Obje... | true |
c007437bfbd6892e88fbb5ca52bc35d282bf82bb | JavaScript | lucaspalencia/cs-go | /src/utils/date.js | UTF-8 | 647 | 3.328125 | 3 | [
"MIT"
] | permissive | const dateFormat = (date) => {
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
let dateTime
let dateClass = new Date(date)
let dateYear = dateClass.getFullYear()
let dateDay = (dateClass.getDate() < 10 ? '0' : '') + dateClass.getDate()
let dateFormat = `$... | true |
6fdcc31f7ad2623a329e89e2c503a73345b7c54f | JavaScript | gillanjali63/Weather-App-Anjali | /src/components/comment/Comment.js | UTF-8 | 2,231 | 2.828125 | 3 | [] | no_license | import React, {Fragment, Component} from 'react';
import "./Comment.css";
import "font-awesome/css/font-awesome.min.css";
class Comment extends Component{
constructor(){
super();
this.state = {
comments: [],
count: 0
};
}
handleComments = (e) => {
... | true |
50f93484417472f9847afc129610d41ade654581 | JavaScript | cdsimmons/screeps-ai | /src/classes/Hub.js | UTF-8 | 5,099 | 2.96875 | 3 | [] | no_license | // Required modules
var log = require('helpers/log');
var config = require('config');
var filter = require('helpers/filter');
// Log
log('Loading: classes/hub');
// Initially Hub was just the rooms and config for a hub... now each hub has all of it's creeps, flags, and structures on load...
// We're setting the hubs ... | true |
b4f47c741f1a406586f0bd37bcfab6a12b8df911 | JavaScript | Jyati/Class-30 | /sketch.js | UTF-8 | 2,076 | 2.734375 | 3 | [] | no_license | const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Constraint = Matter.Constraint;
var myWorld, myEngine;
var ground1, base1, base2;
var polygon, polygonImage;
var slingshot;
function preload() {
polygonImage = loadImage("polygon.png");
}
function setup() ... | true |
962dcd0401563c2ed00ff6dfd9ecd8361e3ad589 | JavaScript | Antoww/learn-nodejs | /server_http.js | UTF-8 | 1,374 | 2.796875 | 3 | [
"MIT"
] | permissive | let http = require('http');
let fs = require('fs');
let url = require('url');
const EventEmitter = require('events');
let App = {
start: function() {
let emitter = new EventEmitter();
let server = http.createServer((request, response) => {
response.writeHead(200, {
... | true |
13aaa67542ff83e8918428865874ffccef46029c | JavaScript | anwittw/udacity-IntermediateJS-oop | /app.js | UTF-8 | 6,254 | 3.3125 | 3 | [] | no_license | const $submitButton = document.getElementById("btn");
const $resetButton = document.getElementById("reset-btn");
function toogleElementVisibility(id) {
const element = document.getElementById(id);
element.classList.toggle("hidden");
}
function resetComparison() {
tiles.removeFromDom();
tiles.empty();
toogle... | true |
6785e4e6975b3d1dfc7eb9d72b3369f123efe2f5 | JavaScript | DomWat/react | /study/day4/src/App.js | UTF-8 | 438 | 2.984375 | 3 | [] | no_license | import React, { useState } from 'react'
function App() {
let [counter, setCounter] = useState(0)
let handleIncrement = () => {
setCounter(counter + 1)
}
let handleDecrement = () => {
setCounter(counter - 1)
}
return(
<div>
<h1>{counter}</h1>
<button onClick = {handleIncrement}>I... | true |
ccc5f55c526e2c6d9067c62ebe67fd165bc7993e | JavaScript | godoyislebi/bicis-locas-lvl2 | /js/main.js | UTF-8 | 7,256 | 3.9375 | 4 | [] | no_license | function validateForm(){
function validarNom (){
var nombre = document.getElementById('name').value;
var larg = nombre.length;
if (nombre === null || nombre.length===0){ //El campo no puede quedar vacío
//alert ('Ingrese nombre');
var contenedor = document.getElementsByClassName('name-container')[... | true |
4ae6a54ca73f97a9d5091bc06920b685d7bc6eac | JavaScript | AlexeyShevchuk/ShkolaSoftheme | /Frontend/JS/src/user.service.js | UTF-8 | 1,167 | 3.625 | 4 | [] | no_license | import { user } from './user.js';
function showMessage() {
alert('Hello ' + user.name);
}
export function confirmAge() {
var age = prompt("What's your age?");
if (age >= 18) {
showMessage();
}
else {
window.location.href = "https://www.youtube.com/watch?v=OK03o3BHafk";
}
}
fun... | true |
946394e111124651589d64d83b095d49bfae9175 | JavaScript | mickvangelderen/funko-fs | /src/mkdirf.js | UTF-8 | 750 | 2.921875 | 3 | [] | no_license | import curry from 'funko/lib/curry'
import mkdir from './mkdir'
import rejected from 'funko/lib/future/rejected'
import resolved from 'funko/lib/future/resolved'
import stat from './stat'
// Assuming it is more likely for the directory to already exist, we will stat first.
const mkdirf = curry(2, (mode, path) =>
mk... | true |
29ce939cf1baf397054640afc95235bb9e65b3bb | JavaScript | chopperqt/chopperqt.github.io | /src/components/Slider/Slider.jsx | UTF-8 | 2,593 | 2.71875 | 3 | [] | no_license | import { useState ,useEffect } from 'react';
import './style.css';
let currentSlide = 1;
let currentNavItem = 1
let timer = setInterval(() => {
animationSwipeSlide()
}, 7000 )
const animationSwipeSlide = () => {
let currentSlideItem = document.querySelector('.slide-'+currentSlide);
let currentNavigatio... | true |
ff71587c19a0c637b47ab5c4e57aa272cb801ef8 | JavaScript | arun1104/interviewPreparation | /Nodejs/Sorting/Array/timeConvertion.js | UTF-8 | 578 | 3.265625 | 3 | [] | no_license | function newTime(time) {
let lastSubstring = time.substring(time.length - 2, time.length);
let firstSubstring = time.substring(0, 2);
let number = parseInt(firstSubstring);
if (lastSubstring == "AM")
{
time=time.replace("AM",'');
if(number==12)
time=time.replace("12",'00');
... | true |
7e61a82169dd86c36416c7d31097f5f4b7bd46e5 | JavaScript | FabricioS-t07/trybe-exercises | /bloco_4/DIA_1/exercice3.js | UTF-8 | 112 | 2.875 | 3 | [] | no_license | let a = 10;
let b = 50;
let c = 5;
let maior = 0;
maior = (a > b) && (a > c) ? a : (b > c) && (b > a) ? b : c;
| true |
0ca33921ab118624840c00e84fbc51bfa72048f1 | JavaScript | vadym-usatiuk/Video-Library | /src/apiPopular.js | UTF-8 | 882 | 2.515625 | 3 | [
"MIT"
] | permissive |
const baseUrl = 'https://api.themoviedb.org/3/';
export default {
key: '667e6c0579f71e858d539ca597385526',
type: '',
page: 1,
language: 'en-US',
query: 'fast',
fetch() {
const requestParam = `${this.type}/popular?api_key=${this.key}&language=${this.language}&page${this.page}`;
return fetch(... | true |
90ff1b1d0104f2f4d64baa2dad69f7101e252592 | JavaScript | JosephClay/xaja-js | /local_modules/gulp-replacer/index.js | UTF-8 | 1,292 | 2.640625 | 3 | [
"MIT"
] | permissive | var _ = require('lodash'),
through = require('through2');
var strReplace = function(content, value, key) {
var regex = new RegExp("'"+ key +"'", 'g');
return content.replace(regex, value);
};
var varReplace = function(content, value, key) {
var regex = new RegExp(key, 'g');
return content.replace(... | true |
7fcffd11b5cf16a7a2b5cc609ae4624e564e863f | JavaScript | lotusbaba/JavaScript | /LindoGatito/js/principal.js | UTF-8 | 2,555 | 3.578125 | 4 | [] | no_license | /**
Crea una clase Gato, y a partir de ella crea tantos gatos como quiera el usuario.
Cada gato tendrá un nombre, una fecha de nacimiento, una raza y un peso (1-15).
Cada vez que crees un objeto gato aparecerá una ventana nueva con una imagen que
cambiará en función de su estado (comiendo, durmiendo y jugando, que es... | true |
3b9a2f4fade2c2cd614b93c1b16652609c9ac43a | JavaScript | wujinbo-web/zhujia-react | /src/component/common/ListBox.js | UTF-8 | 1,438 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import style from './listBox.scss';
class ListBox extends Component {
static propTypes={
datas: PropTypes.array,
changeEvent: PropTypes.func
}
state = {
value: ''
};
items = [];
moveFlag = fa... | true |
c45d73f07a40430ce7febdae6038d4ca61e3d845 | JavaScript | ChristophLabacher/SWARM | /JavaScript/scripts/Objects/LightBeam.js | UTF-8 | 597 | 2.75 | 3 | [
"MIT"
] | permissive | ////////////////////////////////////////////////////////////////////
//// SOUNDSPOT
////////////////////////////////////////////////////////////////////
function LightBeam(i_, p_) {
this.id = i_;
this.position = p_;
// Load lightbeam
this.lightbeam = sprites[this.id];
this.dust = [];
for (var i = 0; i < 60; i+... | true |
14cca0ff6f74a3908368d9e7e7931d2337ab4011 | JavaScript | daniel-z/strongloop-training | /Day1/Day1-notes.js | UTF-8 | 1,717 | 3.078125 | 3 | [] | no_license | var cb = function dataCallback(data) { // is good to give a name to the function even if it's assigned to a variable
arguments[0] === data; // in functions you always have access to arguments array "like" object
}
/* ES6 new variable declarations
let new variable type in javascript
const constants
node --harm... | true |
7e854e68545b0d07a4fac8917d0c30f799bbcf7f | JavaScript | AsafDavidov/bookliker-practice-challenge-nyc-web-091718 | /index.js | UTF-8 | 1,909 | 3.421875 | 3 | [] | no_license | const list = document.getElementById('list');
const show = document.getElementById('show-panel')
let allBooks = []
let allUsers = []
let currentUser;
populateUsers();
displayList();
list.addEventListener('click',(e)=>{
if (e.target.localName === 'li'){
//first find in array
let curBook = allBooks.find(book=>b... | true |
4d93167a1df889848aa7958db467ee67864995d4 | JavaScript | TheBridge-FullStackDeveloper/ft-sep20-RampUp-examples | /JS/Day5+/js/hamlet.js | UTF-8 | 1,767 | 3.65625 | 4 | [] | no_license | // ------------------ Global variables ------------------
// ------------------ & Initializations ------------------
let enabled = false;
let fruits = ["apple", "orange", "banana"]; // TODO: Hardcoded!!!
// Crear un nodo de tipo lista por cada fruta de mi array
fruits.map( function(item, index) {
let newFruit = doc... | true |
7eb4d6db904f2548b3a6cc90285e3ec841ae0046 | JavaScript | MWest2020/Static-Site | /routes/index.js | UTF-8 | 466 | 2.65625 | 3 | [
"MIT"
] | permissive | /*
* Standard requiring of the express framework and assigning it to the variable router. Minimalistic routing to the 'index' page. Renders with data object's project property from the json. Exported the piece of code (module) via express call.
*/
const express = require('express');
const router = express();
con... | true |
4f0f44834f7f4d449a87c35f92fc509e469c6f50 | JavaScript | Fatimasah/Travel-Tourism-responsive-sass | /js/main.js | UTF-8 | 1,336 | 2.515625 | 3 | [
"MIT"
] | permissive | $("document").ready(function($){
// for navigation
var anchor = $('.nav-link');
anchor.on('click', function (event) {
if ($(window).width() <= 767) {
if (this.hash !== "") {
event.preventDefault();
var hash = this.hash;
$('html, body').animate({
scrollTop: $(hash).offset().top -... | true |
ca92bab7a26a53f842c1e7ae92b4c4d465edbeb9 | JavaScript | 1991995430/youlexuan | /youlexuan_search_web/target/youlexuan_search_web-1.0/js/controller/searchcontroller.js | UTF-8 | 2,765 | 2.703125 | 3 | [] | no_license | app.controller('searchController',function ($scope,searchService,$location) {
$scope.search = function () {
searchService.search($scope.searchMap).success(function (response) {
$scope.resultMap = response;
buildPageLabel();
})
}
//定义搜索对象
$scope.searchMap = {'key... | true |
b35b86566da1875e38d3a8ef281b674feadf009d | JavaScript | thinkful-ei22/kev-dev-spaced-rep-client | /src/actions/word.js | UTF-8 | 1,918 | 2.734375 | 3 | [] | no_license | import {API_BASE_URL} from '../config';
export const WORD_REQUEST = 'WORD_REQUEST';
export const wordRequest = () => ({
type: WORD_REQUEST
});
export const WORD_SUCCESS = 'WORD_SUCCESS';
export const wordSuccess = word => ({
type: WORD_SUCCESS,
word
});
export const WORD_VALIDATION = 'WORD_VALIDATION';
export ... | true |
8147798fd7f439cedcdf0f8d863c87f835a6b4de | JavaScript | joneverard/notesapp | /src/actions/index.js | UTF-8 | 1,792 | 2.515625 | 3 | [] | no_license | import { ContentState } from 'draft-js';
export const CREATE_NOTE = 'create';
export const FETCH_NOTES = 'fetch';
export const SELECT_NOTE = 'select';
export const CANCEL_NOTE = 'cancel';
export const TOGGLE_EDITOR = 'toggle';
export const EDIT_NOTE = 'edit';
export const DELETE_NOTE = 'delete';
export cons... | true |
9d3bea0b8d8e259d8cbbf961f210761162f1a9e0 | JavaScript | dhnash1/Solo-jQuery-2016 | /scripts/script.js | UTF-8 | 661 | 3.03125 | 3 | [] | no_license | var r = 0;
var b = 0;
var g = 0;
var y = 0;
$(document).ready(function(){
$('.color-button').on('click', function(){
val = $(this).data('color');//get that button data yo
$('.container').append("<div class='" + val + " color-cube'></div>");
place();
});//end on clicku
});//end ready
function place(){
if... | true |
50a097a9a8bb38bc4a62a492c63685d7824eb971 | JavaScript | dongyicheng/class | /正式课/第三周/0809/第三天/js/2.js | UTF-8 | 1,822 | 3.421875 | 3 | [] | no_license | var oDiv = document.getElementById('div1');
function getGroup(ele,arr) {
//循环
}
getGroup(oDiv,['width','height']);// --> [200,200];
function setCss(ele,attr,value) {
//这里我们需要知道 attr 这个属性需不需要加单位
// width height left top margin padding border fontSize...
// 第一种 用数组
// var ary = ["width", "h... | true |
807901751fb422dd46bcfc1de9a01eee92a5aa31 | JavaScript | evanburawa/mwb_metabolite_search | /app/src/components/Layout/SearchForm.js | UTF-8 | 1,442 | 2.671875 | 3 | [] | no_license | import React, { Component} from "react";
import {Form, Button} from 'react-bootstrap'
import axios from 'axios'
class SearchForm extends Component{
constructor(props){
super(props)
this.state = {
metabolite: ''
}
this.searchMetabolites = this.searchMetabolites.bind(this);
this.handle... | true |
59f728092e19d8485d91a2c432aec0ee1a273e3a | JavaScript | gorvin/96boards-website | /assets/js/app/members.js | UTF-8 | 2,008 | 3.171875 | 3 | [] | no_license | // Store the Members JSON data
var membersJSONData = [];
// This file is required to retreive the 96Boards member details from Linaro.org
$(document).ready(function(){
// Get the members JSON
$.ajax({
url: "https://www.linaro.org/assets/json/members.json",
dataType: 'json',
complete: fun... | true |
8c329e78e76530261f030e937eb7033abdd7fbbb | JavaScript | NicoGangi5/Plano_inclinado | /js/formularios.js | UTF-8 | 2,718 | 3.3125 | 3 | [
"MIT"
] | permissive | //En este archivo validamos los formularios (damos error si el usuario ingresa algo que no sea un numero. (isNaN)
$(document).on("ready",function ()
{
//NOTA: .value significa que toma el valor
$("#input-peso-figura").keyup(function () {
var peso = document.getElementById("input-peso-figura")... | true |
914dd9f6e85b7cec4f052db618aeb8d233cbaddd | JavaScript | iuliaccc/DistribuitedSystems | /fronten/src/reducers/categoryTypes.js | UTF-8 | 908 | 2.78125 | 3 | [] | no_license |
const initialState = []
export default (state = initialState, {type, payload}) => {
switch (type) {
case 'ADD_CATEGORY_TYPE':
console.log(payload)
return [
...state,
payload
]
case 'UPDATE_CATEGORY_TYPE':
return [
payload,
... | true |
e2c2c4bc695c5325611b2f0bcf5132cf952c1416 | JavaScript | Laura-Jin/ICS2O-Unit5-03 | /script.js | UTF-8 | 371 | 2.734375 | 3 | [] | no_license | document.getElementById('display-message').addEventListener('click', buttonOne)
document.getElementById('display-image').addEventListener('click', buttonTwo)
function buttonOne () {
document.getElementById('background').style.backgroundColor = 'aquamarine'
alert('Hello')
}
function buttonTwo () {
document.getE... | true |
0faf534a1986dffa762da3416f2814bbe34edea4 | JavaScript | bgoonz/UsefulResourceRepo2.0 | /MY_REPOS/MihirBegMusicLab/ADD-ONS/wubalubadubdub/js/tracks.js | UTF-8 | 20,763 | 2.515625 | 3 | [
"MIT"
] | permissive | var audioCtx = null;
var leftTrack = null;
var rightTrack = null;
var FADE = 0.01;
var REVPERSEC = 33.3 / 60.0;
var masterGain = null;
var runningDisplayContext = null;
// The Track object represents an in-memory track. In order to be able to
// reverse the playback, it also creates and keeps a reversed version of
/... | true |
1c6c83a77845f72e364c33e2b34590e93893c9ef | JavaScript | ShustKristina/ShustKristina.github.io | /31.03dz/B4+/script/script.js | UTF-8 | 2,112 | 3.4375 | 3 | [] | no_license | function compareWords(word1, word2) {
var counterDifferentLetters = 0;
for (var i = 0; i < word1.length; i++) {
if (word1[i] !== word2[i]) {
counterDifferentLetters++;
}
}
return counterDifferentLetters;
}
function nextStep(startWord, dictionary, endWord) {
var wordArray... | true |
f60e59c6392eba8f6f848aad2314d7de5ef4b26d | JavaScript | psypersky/What-the-Fuck-is-Node.js | /students/axel/ServerResponse/receivingText.js | UTF-8 | 814 | 2.5625 | 3 | [] | no_license | var http = require('http'),
zlib = require('zlib'),
fs = require('fs');
// console.log(http.STATUS_CODES);
http.createServer(function (req, res) {
console.log("Method: " + req.method);
res.writeHead(200, {
'Content-Type': 'text/html'
});
res.write("<h1>Welcome home, cowboy!</h1><br>")... | true |
44e4aedd1a0f6bb4d1b76ff757c8c0f562de18e3 | JavaScript | jameyer/js-algorithms-and-data-structures | /Search/binarySearch.js | UTF-8 | 499 | 3.921875 | 4 | [] | no_license | const binarySearch = (arr, search) => {
let start = 0;
let end = arr.length;
let middle = Math.ceil((end + start) / 2);
while (start < end) {
middle = Math.ceil((end + start) / 2);
if (search === arr[middle]) {
return middle;
} else if (search > arr[middle]) {
start = middle + 1;
} ... | true |
51db739672b79c1aa9e1a52d97b9e633942cf831 | JavaScript | hpsprmpsp/hpsprmpsp | /items/capture.js | UTF-8 | 569 | 2.515625 | 3 | [] | no_license | function capture(element){
html2canvas(ele).then(function(canvas){
var p = new DOMParser();
var image = "<img src='" + canvas.toDataURL("image/png") + "' alt='chema' class='image-contain'/> ";
image = p.parseFromString(image,"text/xml");
addPopup(image);
});
function addP... | true |
936c2567756a070ab7f060a23d66690d5fc9ce36 | JavaScript | gamkedo-la/phlyingphonics | /js/screenshake.js | UTF-8 | 1,092 | 2.984375 | 3 | [] | no_license | // current offsets for the game camera
let screenshakeX = 0;
let screenshakeY = 0;
let screen_shakes = 0; // frames of screenshake used as player feedback for when we take damage
let MAX_SCREEN_SHAKES = 20;
let MAX_SCREEN_SHAKE_SIZE_PX = 16;
function screenShake(howmany) {
screen_shakes += howmany;
// max out... | true |
fb86ee0b2b37202dddc9f4d50b0b387f119d75a3 | JavaScript | hariv/presentMe | /common.js | UTF-8 | 799 | 2.5625 | 3 | [] | no_license | var authenticateUser=function(userId,userSecret,connection,callback)
{
connection.query("SELECT * FROM `app_users` WHERE `name`=? AND `password`=?",[userId,userSecret],function(err,results){
if(err)
{
console.log("Error in user Authentication in querying users "+err);
return;
}
if(results.length>0)
{... | true |
1ecc9225a19b0dc5009bc567e7fc82faf9ff3dc7 | JavaScript | joly534/test-pong | /main.js | UTF-8 | 1,259 | 3.4375 | 3 | [] | no_license | var canvas=document.getElementById('canvas');
var ctx= canvas.getContext('2d');
var game =true;
canvas.width=600;
canvas.height=400;
var Balle = function(x,y,vx,vy){
this.x=x;
this.y=y;
this.vx=vx;
this.vy=vy;
this.rayon=10;
this.draw=function(){
ctx.beginPath();
ctx.arc(x,y,thi... | true |
a5ce83a22ccfa933f8cb8b71ac63b3a29180859f | JavaScript | xBlazeTECH/mean-stack-template | /server/api/thing/thing.socket.js | UTF-8 | 639 | 2.609375 | 3 | [
"MIT"
] | permissive | var model = require("./thing.model").getModel();
exports.register = function (socket, myEmitter) {
console.log("Registering Thing Socket!");
myEmitter.on(`${model.modelName.toLowerCase()}:save`, function (doc) {
console.log("Saved Thing: " + doc._id);
onSave(socket, doc);
})
myEmitter.on(`${model.mod... | true |
26e2135c8031d8a641e12f6bf832b9242a71997f | JavaScript | parklover/skryba | /web/essentialjs/JavaScript - EJ2/17.3.0.26/Web (Essential JS 2)/JavaScript/ej2-pdf-export/src/implementation/document/automatic-fields/automatic-field-info.js | UTF-8 | 3,268 | 2.625 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | /**
* PdfAutomaticFieldInfo.ts class for EJ2-PDF
* @private
*/
import { PointF } from './../../drawing/pdf-drawing';
import { PdfAutomaticField } from './automatic-field';
/**
* Represents information about the automatic field.
* @private
*/
var PdfAutomaticFieldInfo = /** @class */ (function () {
function Pd... | true |
a637b455fd94ab2fbc03986297995705875f5f5a | JavaScript | linxea/TapGame | /docs/js/index.js | UTF-8 | 1,686 | 3.125 | 3 | [] | no_license | /**
* DotGame stores the game state and handles the game lifecycle.
* It contains DotManager and ScoreBoard which update the game state.
*/
import ScoreBoard from "./ScoreBoard.js";
import DotManager from "./DotManager.js";
class DotGame {
constructor() {
this.state = {
isPlaying: false,
hasSwitc... | true |
c7143f8efc625ac8f5fb7035d09ad234e24137d4 | JavaScript | sam190314/angular | /web/js/simple.js | UTF-8 | 865 | 2.890625 | 3 | [] | no_license | "use strict";
$(document).ready(function() {
var currentPanel = 0;
var username = "";
var password = "";
$("#panel1").show();
$("#panel2").hide();
$("#button1").click(function() {
$("#panel1").hide();
$("#panel2").show();
username = $("#username").val();
passw... | true |
41b3bb24afd63987ace6cff6583853ec818eb9d8 | JavaScript | hao-wang/Montage | /js-test-suite/testsuite/db4acca094163b10bf8ab6327aefbeed.js | UTF-8 | 1,988 | 2.84375 | 3 | [
"MIT"
] | permissive | load("fcfbc86708bc3a4062c2091a062e13b6.js");
load("74295afcbe3851329365d06de2aa5a5e.js");
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at h... | true |
6513c4a19295f2d8df229d630a95b2d03c7d71f4 | JavaScript | wesuki/hamon-js | /src/input.js | UTF-8 | 910 | 2.890625 | 3 | [] | no_license | export default class InputHandler {
constructor(canvas, game) {
canvas.addEventListener("click", (event) => {
// console.log(event);
let pos = { x: event.offsetX, y: event.offsetY };
for (let stone of game.stones) {
if (stone.isPointInPath(pos)) {
stone.handleClick(event... | true |
bcd2268d4a4b6ff33b74264f8a09e6d50a301221 | JavaScript | RThevenoux/thot | /src/main/gui/muti-alphabet/alphabet-row-controller.js | UTF-8 | 1,985 | 3 | 3 | [] | no_license | class AlphabetRowController {
constructor(alphabet) {
this.formater = new Formater();
this.alphabetName = alphabet.name;
this.element = document.createElement("div");
this.element.className = "my-row";
this.cellName = document.createElement("div");
this.cellName.textContent = this.alphabetN... | true |
47bce04bb1c490a1ab116b0256551a9b7ac2f857 | JavaScript | inotom/sws-rating | /src/helpers/extractIntDeci.js | UTF-8 | 379 | 3.1875 | 3 | [
"MIT"
] | permissive | /**
* extract integer part and deciaml part.
*
* @param {Number} num
* @returns {Array}
*/
export default (num) => {
if (typeof num !== 'number') {
throw Error(`${num} is not a number`);
}
let i = (num > 0) ? Math.floor(num) : Math.ceil(num);
let sepNum = String(num).split('.');
let d = sepNum.lengt... | true |
78a8eee18777cf3dfff80dd7b80592904fd6f8aa | JavaScript | priyanshi31/bootstrap_assignmentq1 | /problem12/5.Compare.js | UTF-8 | 470 | 3.21875 | 3 | [] | no_license | var compare_dates = function(date1,date2)
{
if (date1>date2)
return ("Date1 > Date2");
else if
(date1<date2)
return ("Date2 > Date1");
else
return ("Date1 = Date2");
}
console.log(compare_dates(new Date('11/14/2013 00:00'), new Date('11/14/2013 00:00')));
console.log(compare_dates(... | true |
76cd35bf98db510d172378f19ee7ef64ad00558f | JavaScript | alinardz/memphisMania | /js/aux.js | UTF-8 | 2,237 | 3.640625 | 4 | [] | no_license | //CAMBIO DE COLOR BOTÓN
function buttonColor() {
setInterval(function() {
button.classList.toggle("color-button");
}, 500);
}
buttonColor();
//GENERAR OBJETOS MALOS
function generateObjects() {
if (!(frames % 100 === 0)) return;
var randomX = Math.floor(Math.random() * 200) + 600;
var rand... | true |
89f89b9e1c757c0f669e594819ffb17d0a6b0ed9 | JavaScript | sdbenezra/js-digital-clock | /index.js | UTF-8 | 1,215 | 3.171875 | 3 | [] | no_license | const setupButtons = () => {
$('button').click(function() {
const colorClass = $(this).html();
console.log(`You clicked on the ${colorClass} button`);
$('#clock').removeClass();
$('#clock').addClass(colorClass);
})
}
$(document).ready( () => {
const timeSet = () => {
const time = new Date(Da... | true |
4d9059b14bdad309f1904f44ed4e5061ec89118d | JavaScript | kag2004/jeju | /01/01.js | UTF-8 | 138 | 3.375 | 3 | [] | no_license | let name = [100,200,300,400,500];
// splice : 삭제
// 0~3번째 부터 다음 두개
name.splice(3,2)
console.log('name : ',name) | true |
e763c179aa2685749f2b25700d442f0921b08ba2 | JavaScript | leonW7/ReverseFile | /data/UBI/var/www/js/power.js | UTF-8 | 3,357 | 2.546875 | 3 | [] | no_license | /*
* File: power.js
* Created on 13th Dec 2012 - Laxmi
* Copyright (c) 2012 TeamF1, Inc.
* All rights reserved.
*/
$(document).ready(function(){
changePowerPlanMode('tf1_poweradjustmentModeManual');
});
function powerOnReset(frmId){
resetImgOnOff(frmId);
changePowerPlanMode('tf1_poweradjustmentModeManual'... | true |
4806f411cdff6399f91a27c3afe40661aabfebdb | JavaScript | CSIS-iLab/new-silk-road | /website/assets/apps/megamap/actions/apiactions.js | UTF-8 | 556 | 2.625 | 3 | [] | no_license | /* eslint-disable class-methods-use-this */
function createApiActions(Source) {
class ApiActions {
update(x) {
return x;
}
fetch(params) {
return (dispatch) => {
dispatch();
Source.fetch(params)
.then(response => response.json())
.then((json) => {
... | true |
e4d8be950d00077e407f19f82f5b95484a373208 | JavaScript | Taideptrai/ShoppingCartVanilla.github.io- | /ShoppingCart.js | UTF-8 | 5,783 | 3.171875 | 3 | [] | no_license | window.onload = function() {
var cart = document.getElementsByClassName("add-to-cart")
var cartarr = [...cart]
var dataset = [];
var total;
cartarr.map(item=>{addEventToButton(item)})
function addEventToButton(item,callback){
event.preventDefault();
item.addEventListener("click", function(){
... | true |
961b50145dbf850bd1b2d8e5369c338b43bb319c | JavaScript | AhanPande1078/ADV-81 | /main.js | UTF-8 | 817 | 2.796875 | 3 | [] | no_license | var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
ctx.beginPath();
ctx.strokeStyle = "grey";
ctx.lineWidth = 4;
ctx.rect(150, 143, 430, 200);
ctx.stroke();
ctx.beginPath();
ctx.strokeStyle = "blue";
ctx.lineWidth = 5;
ctx.arc(260, 225, 40, 0, 2*Math.PI);
ctx.stroke();
... | true |
dcb00763c9fabaac230a918838747d027a40974b | JavaScript | myiahm/reactDay4ClassWork | /ex11/ex11/src/DisplayAlien.js | UTF-8 | 528 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | import React, {Component} from 'react'
class DisplayAlien extends Component {
render(){
var alienArray = this.props.alien.map(
eachItem => {
return(
<div>
<p>Name: {eachItem.name} Planet: {eachItem.planet} Size: {eachItem.size} </p>
... | true |
e304986da2d3744fc86b84ad1c33bac26aa3d6ca | JavaScript | kiyo6318/Lunch_picker | /script.js | UTF-8 | 2,620 | 3.296875 | 3 | [] | no_license | var list = [
{ name: "コンビニ", fast: true },
{ name: "和飲", fast: true },
{ name: "インドとタイの料理", fast: false },
{ name: "大戸屋", fast: false },
{ name: "ロイヤルインディアンダイニング", fast: false },
{ name: "和幸 泉ガーデンタワー六本木一丁目店", fast: false },
{ name: "遠いところ(安い)", fast: false },
{ name: "ビーフン", fast: false },
{ name: "お好... | true |
89b85ee4a6810ec3a3542d940b005f279d114864 | JavaScript | Kuzia30/goit-js-hw-06 | /js/task-05.js | UTF-8 | 364 | 3.53125 | 4 | [] | no_license | const inputText = document.querySelector('#name-input');
const outputText = document.querySelector('#name-output');
inputText.addEventListener("input", onTextAdd);
function onTextAdd(event) {
if (event.currentTarget.value !== "") {
outputText.textContent = event.currentTarget.value;
} else {
ou... | true |
d2b2d6b05af967f9f3b8cdc9635c78a9f95f9043 | JavaScript | grommett/jira-connect | /lib/jira-connector.js | UTF-8 | 1,684 | 2.90625 | 3 | [] | no_license | var superAgent = require('superagent');
var config = require('../config');
/**
* Gets the connection type with defaults
* @param {string} type - verb.
* @param {string} url
*/
function getConnection(type, url) {
switch(type) {
case 'get':
return getRequestDefaults(superAgent.get(url))
break;
c... | true |
e6d8c2864640f4c9aa90a8e438c1f125934e8285 | JavaScript | Luisem11/codebreaker | /server/routes.js | UTF-8 | 1,013 | 3.09375 | 3 | [] | no_license | const express = require('express')
const router = express.Router();
var secret = 0;
router.get('/', function (req, res) {
res.status(200).json({
message: 'API codebreker'
});
});
router.get('/set-secret/:secret', function (req, res) {
secret = req.params.secret;
res.status(200).json({
... | true |