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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
68baf150e6922246b6d06485f69c8d56f7e881ae | JavaScript | isherep/Coderbyte-practice-js | /Easy/vowelCount.js | UTF-8 | 1,005 | 3.859375 | 4 | [] | no_license | function VowelCount(str) {
// code goes here
// create object that has keys as vowels and vals counts
let counts = {}
for (var char of str) {
char = char.toLowerCase();
if (char === 'a' || char === 'e' || char === 'i' || char === 'u' || char === 'o') {
if (counts[char] ==... | true |
6cccc2238234071636661ddd0cbffc2c94718a21 | JavaScript | yukihirai0505/my-google-apps-script | /instagram/none-api/post/check-post.gs | UTF-8 | 2,196 | 2.546875 | 3 | [
"MIT"
] | permissive | var BK = SpreadsheetApp.getActiveSpreadsheet(),
POST_CHECK_SHEET = BK.getSheetByName("check post"),
CAMPAIGN_SHEET = BK.getSheetByName("campaign data"),
CAMPAIGN_RANGE = CAMPAIGN_SHEET.getRange(3, 1, CAMPAIGN_SHEET.getLastRow(), 4),
CAMPAIGN_DATA = CAMPAIGN_RANGE.getValues();
/***
* Set Instagram data
*/
fun... | true |
9cdc25f75cd93a6b90231b527e521b2b04273719 | JavaScript | OSU-CS290-Sp2017/final-project-pitchin | /server.js | UTF-8 | 4,125 | 2.71875 | 3 | [] | no_license |
/*
* Write your Express server in this file as described in README.md.
*/
var path = require('path');
var fs = require('fs');
var express = require('express');
var exphbs = require('express-handlebars');
var bodyParser = require('body-parser');
var people = require('./peopleExamples');
var pitches = require("./pit... | true |
72e4186a0b12df60a198bc71ef0f7d87cd00d0f7 | JavaScript | chentianming11/demo | /src/main/resources/js学习/java执行js代码/array.js | UTF-8 | 365 | 3.609375 | 4 | [] | no_license | var IntArray = Java.type("int[]");
var array = new IntArray(5);
array[0] = 5;
array[1] = 4;
array[2] = 3;
array[3] = 2;
array[4] = 1;
try {
array[5] = 23;
} catch (e) {
print(e.message); // Array index out of range: 5
}
array[0] = "17";
print(array[0]); // 17
array[0] = "wrong type";
print(array[0]); // ... | true |
8d30d1ba088b84d5678de82de96cdafe6023c801 | JavaScript | mohmohmoh2/Graduation-project-of-the-fourth-flags-of-Cairo | /EN/js/script.js | UTF-8 | 595 | 2.65625 | 3 | [] | no_license | // toggle menu
let togglebtn = document.querySelector(".toggle-menu");
let tlinks = document.querySelector(".links");
togglebtn.onclick = function() {
// toggle class on button
this.classList.toggle("menu-active");
//toggle class on Links
tlinks.classList.toggle("open");
};
// toggle menu
let toggleb... | true |
74013c0b6c17859345c1b1717e119b15ba670220 | JavaScript | prototypal-io/untitled-ui | /lib/server-middleware/styleguide-server.js | UTF-8 | 2,292 | 2.546875 | 3 | [
"MIT"
] | permissive | function StyleguideServer(options) {
this.themeCore = options.themeCore;
}
StyleguideServer.prototype.addServerMiddleware = function(startOptions) {
var app = startOptions.app;
var themes = themesFor(this.themeCore);
app.get('/__ui/themes', function(req, res, next) {
res.set('Content-Type', 'application/j... | true |
e69014504a34f5f59c0dacf4fb76e5a54d12bf15 | JavaScript | NikolaiMishev/Telerik-Academy | /Module-1/06.JavaScript Fundamentals/JS-Operators and Expressions/Problem 1. Odd or Even.js | UTF-8 | 277 | 4.28125 | 4 | [
"MIT"
] | permissive | //Write an expression that checks if given integer is odd or even.
var array = [3,2,-2,-1,0];
for(var i = 0; i < array.length; i++){
if(array[i] % 2 == 0){
console.log(array[i] + ' - ' + false);
}
else{
console.log(array[i] + ' - ' + true);
}
} | true |
550c30a74561d9027e7be3ca2f326056d103d2d7 | JavaScript | mdnyc2017/tripplanner-1 | /start/client/index.js | UTF-8 | 2,271 | 3.046875 | 3 | [] | no_license | const mapboxgl = require("mapbox-gl");
const buildMarker = require("./marker.js");
mapboxgl.accessToken = 'pk.eyJ1IjoiZXhkZWF0aCIsImEiOiJjajhicWxuaG4wMHFjMzBvMHpkdzRtYnZyIn0.kNonHRsejLn91odCmMXQzA';
const map = new mapboxgl.Map({
container: "map",
center: [-74.009, 40.705], // FullStack coordinates
zoom: 12, //... | true |
f9a74c9cdb9c723441bd4c769d8738bcf5e8bd1c | JavaScript | rvmladenov/JS-Design-Patterns | /Behavioral/observer/observableTask.js | UTF-8 | 1,461 | 2.859375 | 3 | [] | no_license | var Task = require('./task');
function ObserverList(){
this.obeserverList = [];
}
ObserverList.prototype.add = function(obj) {
return this.obeserverList.push(obj)
};
ObserverList.prototype.get = function(index) {
if(index > -1 && index < this.obeserverList.length) {
return this.obeserverList[index]... | true |
e37c07a36d038950f3667dc212414fa1c8c1e6c2 | JavaScript | mwatson86/text-file-words | /test/helpers/index.spec.js | UTF-8 | 1,460 | 2.984375 | 3 | [] | no_license |
import { expect } from 'chai';
import * as helpers from 'helpers';
describe('helpers', () => {
context('replace without space, if', () => {
const expected = 'here is';
const testCases = ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')', ',', '.', '?', '"', '\'', ':', '{', '}', '|', '<', '>'];
testC... | true |
a3bb37e440fc512d0a80051b891848c98c76aded | JavaScript | djovercash/node-course | /section-three/part-nine/app.js | UTF-8 | 377 | 3.0625 | 3 | [] | no_license | // fs = 'File System'. Best practice to use fs in naming convention.
const fs = require('fs');
// So writeFile and the writeFileSync methods are responsible for writing data to a file.
// If the file doesn't exist, it will be created.
// If the file does exist, its content will be overwritten with the new provided mes... | true |
015b0470c98b302a9bd2c77e09d8fd5ca6ad9380 | JavaScript | dball1126/Coding_problems | /sumEvenNumsAfterQueries.js | UTF-8 | 500 | 3.484375 | 3 | [] | no_license | var sumEvenAfterQueries = function(A, queries) {
let sums = [];
for (let i = 0; i < queries.length; i++) {
let ele = queries[i]
A[ele[1]] = A[ele[1]] + ele[0];
sums.push(sum(A))
}
return sums;
};
function sum(A){
let sum = 0;
for (let i = 0; i < A.length; i++) {
... | true |
0e4a4ba9aa38fd44ef17ea81b2e5945ddbe77e2e | JavaScript | johnnyutah00/schoolProject_Saskatoon_Summer_Players | /public/js/show.js | UTF-8 | 648 | 2.5625 | 3 | [] | no_license | $(document).ready(function () {
// Hide or show shows based on user's click
$('#futureShowsBtn').on('click', function (){
$('.currentShow').hide();
$(".pastShow").hide();
$('.futureShow').show();
});
$('#currentShowsBtn').on('click', function () {
$(".futureShow").hide... | true |
f3a9c60f1d2fa9abd0ebf0ca1626b3b97fec0c08 | JavaScript | pvitale/js-date | /src/main/javascript/field/BasicField.js | UTF-8 | 467 | 2.59375 | 3 | [
"MIT"
] | permissive | goog.provide("BasicField");
goog.require("Field");
/**
* JSDoc here
*
* @author Victor Polischuk
* @class Class description
*
* @param {FieldType} type
* @param {number} value
* @constructor
* @public
* @extends Field
*/
var BasicField = function (type, value) {
BasicField.superClass_.... | true |
35db58b2f6e6de447d51278590960f2248d6d45a | JavaScript | Zeddyjere/asokoinsight | /financeapp-client/src/components/dataform.js | UTF-8 | 9,888 | 2.828125 | 3 | [] | no_license | import React, { Component } from 'react';
class DataForm extends Component {
constructor(props) {
super(props);
this.state = {
revenue: {
inputValue: '',
basecurrencysymbol: "$"
},
profit: {
inputValue: '',
basecurrencysymbol: "$"
},
grossincome: {
inputValue: '',
basecurr... | true |
fcae60f1070484eb6aaaf9654fb1e36e13e4b3fa | JavaScript | jack01310131/dbphp | /第四組專題/js/homeli.js | UTF-8 | 671 | 2.890625 | 3 | [
"MIT"
] | permissive | $(function(){
// 先取得 #abgne-block-20110111
var $block = $('#abgne-block-20110111');
// 幫 #abgne-block-20110111 .title ul li 加上 hover() 事件
$('#abgne-block-20110111 .title ul li').hover(function(){
// 當滑鼠移上時加上 .over 樣式
$(this).addClass('over').siblings('.over').removeClass('over');
}, function(){
// 當... | true |
562b8c4e2cd42710952dda55c2bbd42baa50abc8 | JavaScript | jsstar522/javascript_basic | /05_DesignPattern/mediator.js | UTF-8 | 663 | 3.15625 | 3 | [] | no_license | var Translator = (function(){
function Translator(){
this.participants = [];
}
Translator.prototype.register = function(participant){
this.participants.push(participant);
};
Translator.prototype.deliver = function(sender, message){
this.participants.forEach(function(participant){
i... | true |
a8974a00e182c73cbb91e3fe13456ab4d046596b | JavaScript | gakf38/MobileFlashcards | /components/DeckList.js | UTF-8 | 1,757 | 2.546875 | 3 | [] | no_license | // React Imports
import React, { Component } from 'react'
// React Native Imports
import { Text, View, TouchableOpacity, FlatList, StyleSheet } from 'react-native'
// React Redux Imports
import { connect } from 'react-redux'
// Action Creators Imports
import { receiveDecks } from '../actions'
// AsyncStorage Helpe... | true |
7c539db54199feecae26c99f5c82c3c5dba2b75a | JavaScript | gobb/webfilez | /assets/js/queueprocessor.js | UTF-8 | 4,619 | 2.5625 | 3 | [] | no_license |
/**
* Process the Queue
*/
function queue_process() {
//Get the next item in the queue. If FALSE, then stop processing the queue
if (get_queue_state() != 'cancelling') {
set_queue_state('processing');
$('upload_start').hide();
}
var queue_item = queue_shift();
if (queue_item != false && ge... | true |
972d264c38bc74dc57c96eac3b1da85ca84c4179 | JavaScript | uark-backend-class/capstone-rachelkwaynick | /back-end/controllers/calculate.controller.js | UTF-8 | 3,561 | 2.828125 | 3 | [] | no_license | const Budget = require('../db').Budget;
const Category = require('../db').Category;
const Item = require('../db').Item;
const Transaction = require('../db').Transaction;
//Item Level
exports.calculateTransactionSum = async (req, res) => {
// let transactions = await Transaction.findAll({where: {itemId: req.params.id... | true |
0f74405522dbe6629fe2091430413b6ff9de15de | JavaScript | arnemart/react-dom-wrapper | /test/tests.js | UTF-8 | 3,031 | 2.734375 | 3 | [
"MIT"
] | permissive | var buster = require('buster');
var DOM = require('../');
var React = require('react');
buster.testCase('React DOM element generation', {
'simple DOM element': function() {
var element = DOM(['span', 'hello']);
buster.assert.equals(element.type, 'span');
buster.assert.equals(element.props.children, 'hell... | true |
594de98856a00899207a443a26e9a092e16d5558 | JavaScript | PlamenMichev/SoftUni | /06.JS-Advanced/04.DOMManipulations-Еxercise/04. Sections/script.js | UTF-8 | 553 | 3.328125 | 3 | [] | no_license | function create(words) {
let divToAppend = document.getElementById('content');
for (let word of words) {
let currentDiv = document.createElement('div');
let curreptP = document.createElement('p');
curreptP.innerHTML = word;
curreptP.style.display = 'none';
currentDiv.appendChild(cur... | true |
010141d6fe337e6b4901f732833146705d6bc910 | JavaScript | franciscojsf99/human-computer-interaction | /iGo/js/images.js | UTF-8 | 1,945 | 3.296875 | 3 | [] | no_license | class ImagesManager
{
constructor() {
this.images = [ "images/dogs01.png",
"images/dogs02.png",
"images/dogs03.png",
"images/dogs04.png",
"images/dogs05.png",
"images/dogs06.png",
"images/dogs07... | true |
1198d625b4ff1fe94f894e36257f786ead75e753 | JavaScript | bylh/current | /code/node-demo/test-node/moment-emp.js | UTF-8 | 1,467 | 2.890625 | 3 | [] | no_license | let moment = require('moment');
let timeC = new Date();
// console.log(moment(timeC).utcOffset());
// console.log(timeC.toUTCString());
// var s = '2013-01-01T00:00:00-13:00';
// console.log(moment("2013-01-01T00:00:00-13:00").utcOffset());
// var formatTime02 = moment(dUNIX).format('YYYY-MM-DD hh:mm:ss'); // 输出指定格式的时间... | true |
4c9ca2eaca3b98f63d3ad5852667a99e52c01b3d | JavaScript | zdsherlock/HtmlCssLearn | /js/JavaScriptDay10/.history/6_20210525222742.js | UTF-8 | 60 | 2.75 | 3 | [] | no_license | //函数提升
bar();
function bar(){
console.log(1);
} | true |
bbeea14e24517e4c5c75e56d75fcd21624778de1 | JavaScript | CritJen/js-deli-counter-js-apply-000 | /index.js | UTF-8 | 637 | 3.453125 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | function takeANumber (nowLine, newPerson) {
nowLine.push(newPerson);
const position = nowLine.length;
return `Welcome, ${newPerson}. You are number ${position} in line.`
}
function nowServing (katzDeliLine) {
if (katzDeliLine[0]) {
return `Currently serving ${katzDeliLine.shift()}.`;
} else {
return ... | true |
a77100aa836375c5d2a288b5da858b6dfc6c2c0d | JavaScript | zachdeibert/scheduler | /src/Collection.js | UTF-8 | 799 | 3.21875 | 3 | [] | no_license | export default class Collection {
constructor() {
this.array = [];
this.onUpdate = null;
this.onRemove = null;
}
fireUpdate() {
if (this.onUpdate) {
this.onUpdate();
}
}
fireRemoval(i) {
if (this.onRemove) {
this.onRemove(i);
... | true |
8dbc69ed2b9ed191962833e58684ee046480511f | JavaScript | Jorbreezy/kiosk-client | /client/js/add.js | UTF-8 | 3,948 | 2.5625 | 3 | [] | no_license | var v;
var pressed = false;
var chars = [];
$("#barcode").change(function(e) {
//$("#barcode").keyup(function(e) {
if (e.which >= 48 && e.which <= 57) {
chars.push(String.fromCharCode(e.which));
/*
9780374530716
9780689839559
... | true |
ad67299acd8ab22541a558f44e03308c9b96771c | JavaScript | splashley/project-m5-e-commerce | /client/src/components/reducers/Purchase.js | UTF-8 | 1,794 | 2.671875 | 3 | [] | no_license | const initialState = {};
export const purchaseReducer = (state = initialState, action) => {
switch (action.type) {
case 'BEGIN-PURCHASE-PROCESS': {
return {
...state,
[action.item.id]: {
...action.item,
quantity: action.qua... | true |
19c1ccc0c11d63fb120c31afb5319cdafed8cb15 | JavaScript | Jojoreoli/Front-End-Alura | /JavaScript/Primeiros-Passos/8-loops.js | UTF-8 | 927 | 3.953125 | 4 | [
"MIT"
] | permissive | console.log(`Trabalhando com loops`);
const listaDeDestinos = new Array (
`Salvador`,
`São Paulo`,
`Rio de Janeiro`
)
//Declarando variáveis
const idadeDoComprador = 10;
const estaAcompanhada = true;
let temPassagemComprada = false;
const destino = "Salvador";
let destinoExiste = false;
//Imprimindo o array
co... | true |
048c73bc6635f3ed621bccda799531d791b68bb2 | JavaScript | julianfortune/unjumble | /anagram.js | UTF-8 | 1,989 | 3.34375 | 3 | [] | no_license | var wordDictionary = {}
function onLoad() {
filePath = "enable1.txt"
var rawFile = new XMLHttpRequest();
rawFile.open("GET", filePath , true);
rawFile.send(null);
rawFile.onreadystatechange = function (){
if (rawFile.readyState === 4) {
if (rawFile.status === 200 || rawFile.sta... | true |
f6f3bc06725837d0e0e8a8c0e630f24a4f9e0c8c | JavaScript | gpsinghsandhu/promise-wander | /retry/index.js | UTF-8 | 924 | 3.265625 | 3 | [] | no_license | 'use strict';
let promiseRetry = require('./promiseRetry.js');
function delayedRejectedPromise(time) {
return new Promise((resolve, reject) => {
setTimeout(() => reject('rejected'), time);
});
}
function delayedResolvedPromise(time) {
return new Promise((resolve, reject) => {
setTimeout((... | true |
29e4320dd17f6e94671bc2596a374f0ea326984b | JavaScript | dailybruin/elections2012-static | /static/exitpolls.js | UTF-8 | 3,352 | 2.578125 | 3 | [] | no_license | google.load('visualization', '1.0', {'packages':['corechart']});
google.setOnLoadCallback(drawVisualization);
function drawVisualization() {
//president
var query = new google.visualization.Query('https://docs.google.com/a/media.ucla.edu/spreadsheet/tq?key=0AmAw65rH5ARAdGtNbnRwWnRVVG1UM05yYWpVb20zUVE&gid=1&range=H%... | true |
94eba54671127cc4b8ac2505e9bd7b8a0253b716 | JavaScript | reactioncommerce/api-utils | /lib/graphql/getMongoSort.js | UTF-8 | 870 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | const sortOrderEnumToMongo = {
asc: 1,
desc: -1
};
/**
* Note that this uses the object format rather than the array format because our in-memory db
* for tests expects object format. The Node `mongodb` package allows either.
* Technically an array would be better because JS does not guarantee preservation of o... | true |
75b2cdf1737da4b5dcffc3f90510ccef61cc28f2 | JavaScript | nachos5/skoli | /tleikjaforritun/breakout/update.js | UTF-8 | 3,059 | 3.078125 | 3 | [] | no_license | // GENERIC UPDATE LOGIC
// The "nominal interval" is the one that all of our time-based units are
// calibrated to e.g. a velocity unit is "pixels per nominal interval"
//
let NOMINAL_UPDATE_INTERVAL = 16.666;
// Dt means "delta time" and is in units of the timer-system (i.e. milliseconds)
//
let g_prevUpdateDt = nul... | true |
439150469c6809c5424590c326d63579e1bb1ed1 | JavaScript | cowang4/HackTechValleyStefani | /timetravel.js | UTF-8 | 7,701 | 3.171875 | 3 | [
"MIT"
] | permissive | 'use strict';
(function (root, factory) {
// Module export pattern
// https://github.com/umdjs/umd/blob/master/returnExports.js
/* global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof exports === 'object') {
// Node... | true |
52c54b3edda74a9839d6a85ded42798a0a0c4368 | JavaScript | MirageOwl/mirageowl.github.io | /script.js | UTF-8 | 1,082 | 3.21875 | 3 | [] | no_license | let locationBlock = document.getElementsByClassName('location')[0]
let locations = [
document.getElementById('war1'),
document.getElementById('war2'),
document.getElementById('war3'),
document.getElementById('war4')
]
let locationtexts= [
"Empty worn down streets in bright daylight",
"Gray metalic atmospher... | true |
56937d51fc7825fad73410ff6dd7e5fa44c23b1f | JavaScript | msinoplis/Week3HW4 | /script.js | UTF-8 | 6,419 | 3.59375 | 4 | [] | no_license | //set vars
// var x = document.getElementsByClassName('box');
var player = document.getElementById('playerTurn');
var reset = document.getElementById('reset');
//var to see which player plays
var xturn=true;
//dumb way of creating the vars
var box0 = document.getElementById('0');
var box1 = document.getElementById('1... | true |
c2bc2d934528868c907a0948fbc31f8b463d8823 | JavaScript | sricheta92/PhaserJS_CMPE202_Game | /Learning_Code/Jessie/js/map2.js | UTF-8 | 1,550 | 2.75 | 3 | [] | no_license |
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.tilemap('mymap1', 'assets/Layer1.csv', 'test.csv', Phaser.Tilemap.CSV);
game.load.tilemap('mymap2', 'assets/Layer2.csv', 'test.csv', Phaser.Tilemap.CSV... | true |
a0fd25c705a056277eb1c8392e11ba8de4f3cf0a | JavaScript | afraawael/cookie-stand1 | /js/app.js | UTF-8 | 11,420 | 3.203125 | 3 | [
"MIT"
] | permissive | 'use strict';
function randomValue(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}
let container=document.getElementById('locations');
let table=document.createElement('table');
container.appendChild(table);
let hours = ['6am', '7am', '8am', '9am', '10am', '11am', '12pm', '1pm', '2pm', '3p... | true |
50f5fbad03b93c3c33b54ce7c60d965039086346 | JavaScript | WotaDeveloper/My-Oshi | /static/js/main.js | UTF-8 | 812 | 2.859375 | 3 | [] | no_license | let audioPlay = (audio,status) => {
if(audio.paused) {
audio.play()
status.innerHTML = "isPlaying..."
}
else {
audio.pause()
status.innerHTML = ""
}
}
let natherine = () => {
let audioNatherine = document.getElementById("natherinemp3")
let natherineplay = documen... | true |
df79bf5412067da0bfce28cc7f22f4579e29a6b8 | JavaScript | juliehutchinson001/backend-mindgame | /utils/get-game-status.js | UTF-8 | 1,338 | 3.15625 | 3 | [] | no_license | const getTimeLeft = require('./get-time-left');
const { CORRECT, INCORRECT, PARTIAL } = require('./constants').feedback;
const { ACTIVE, WON, LOST } = require('./constants').gameStatus;
/**
* Computes the guess of the user to determine the game status
* @param {String} guess The number the user guessed
* @param {St... | true |
b695e4024afb1f71378a8cb647f3d09879cc8589 | JavaScript | radtek/GlsunView | /GlsunView/scripts/lib/jQuery.Tooltip.js | UTF-8 | 1,765 | 2.703125 | 3 | [
"MIT"
] | permissive | /*
鼠标悬浮提示文本
*/
(function($){
if(!$) return;
$.fn.tooltip = function(options){
var settings = {
text: ''
};
$.extend(settings, options);
//this是一个jQuery对象
var $elem = this;
var span = document.createElement('span');
span.innerText = settings.te... | true |
877c0561a5189f1c29987b49a026abea38a17819 | JavaScript | ZzysGithub/erluoshifangkuai | /js/tetris.js | UTF-8 | 8,725 | 3.03125 | 3 | [] | no_license | window.$=function(selector){
return document.querySelectorAll(selector);
}
var tetris={
RN:20,//行数
CN:10,//列数
CELL_SIZE:26,//单元格高宽
pg:null, //背景元素
IMG_OVER:'img/game-over.png',//游戏结束图片
IMG_PAUSE:'img/pause.png',//游戏暂停结束
IMGS:
{//方块图片
O:'img/O.png',
I:'img/I.png',
T:'img/T.png',
J:'i... | true |
ac06a14a4dafd4adcd9c23c0553b754dc3a0b9b9 | JavaScript | Btate712/react-container-components-lab-online-web-sp-000 | /src/components/SearchableMovieReviewsContainer.js | UTF-8 | 1,159 | 2.671875 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import React from 'react';
import 'isomorphic-fetch';
import MovieReviews from './MovieReviews'
const NYT_API_KEY = 'dGpQ5OmGP2SgfvZimlpCUoF4iOag9qzZ';
const URL = 'https://api.nytimes.com/svc/movies/v2/reviews/search.json?'
+ `api-key=${NYT_API_KEY}`;
// Code SearchableMovieReviewsContainer Here
class Se... | true |
0cefdb9abf7ae593ccc0e9d497e00d117e543bbf | JavaScript | SometimesTheFur/javascript-exercises | /sumAll/sumAll.js | UTF-8 | 700 | 3.390625 | 3 | [] | no_license | const sumAll = function(min, max) {
if (min < 0 || max < 0) return "ERROR";
//if (isNaN(min) || isNaN(max)) return "ERROR"; This only worked for the string test, but not the last test that included an object.
if (typeof min !== 'number' || typeof max !== 'number') return "ERROR";
if (min > max) {
... | true |
6ae62c249edb11300ed5a2077cdfbc936641caaf | JavaScript | JustForkin/uil | /examples/js/math.js | UTF-8 | 11,092 | 3.40625 | 3 | [
"MIT"
] | permissive | 'use strict';
// performance.now
var now;
(function(w){
var perfNow;
var perfNowNames = ['now', 'webkitNow', 'msNow', 'mozNow'];
if(!!w['performance']) for(var i = 0; i < perfNowNames.length; ++i){
var n = perfNowNames[i];
if(!!w['performance'][n]){
perfNow = function(){return... | true |
463e0255723da745948668ddc7c537ed8fe00858 | JavaScript | foreverhot1019/Mes | /Mes.Client/Mes.Client.Web/Script/forms/mpr/jquery.forms.entity.js | UTF-8 | 6,722 | 2.921875 | 3 | [] | no_license |
/* 实体类 */
//参数
function Param(key, value) {
this.key = key;
this.value = value;
};
//顶点
function Vertex(x, y, z, bulge, width) {
var z = IsNullOrEmpty(z) ? 0.0 : z;
var bulge = IsNullOrEmpty(bulge) ? 0.0 : bulge;
var width = IsNullOrEmpty(width) ? 1.0 : width;
this.strX = ("");
this.... | true |
f2e141650d8dd9273858b4ba1cbdea869eebf0c5 | JavaScript | rafarc97/smallProjects | /swagger/service/DefaultService.js | UTF-8 | 2,906 | 2.609375 | 3 | [] | no_license | 'use strict';
/**
* Permite obtener la lista de todas las políticas
*
* id String Código de la política
* amountInsured Float Suma asegurada
* email String Email de la política
* inceptionDate date Fecha de inicio
* installmentPayment Boolean Pago
* clientId String Id cliente enlazado
* returns List
**/
exp... | true |
83084536d38ddeca5c586c413db802b2a1b993ff | JavaScript | rsdesoto/friend-finder | /app/routing/apiRoutes.js | UTF-8 | 794 | 2.859375 | 3 | [] | no_license | // Dependencies
var connection = require("./connection.js");
/**
* Methods for export:
*/
module.exports = function(app) {
/**
* Basic "get" route for pulling up all data from the database.
*/
app.get("/api/friends", function(req, res) {
connection.query("SELECT * FROM friends", function(err, data) {
... | true |
961ea6f721622bddf889c3245bee61f4494540d0 | JavaScript | anvaka/common-words | /data-extract/extract_words.js | UTF-8 | 2,923 | 2.5625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env node
var fs = require('fs');
var ignore = require('./ignore/index.js');
var spawn = require('child_process').spawn;
var getWords = require('./lib/getWords.js');
var extension = (process.argv[2] || 'go').split(',').map(x => '"' + x + '"').join(',');
var fileName = encodeExtension(extension);
var bucketNa... | true |
d29aa993bd20b5d43d2d82e8b384467508e4c257 | JavaScript | iKirankumarp/iKirankumar | /js/main.js | UTF-8 | 3,260 | 3.015625 | 3 | [] | no_license | var testimonials = [1, 2, 3];
var active = 1;
var canvas, ctx;
console.log("Hello o/");
// got this detectIE() from this amazing codepener
// you should check him out, https://codepen.io/gapcode/pen/vEJNZN
function detectIE() {
var ua = window.navigator.userAgent;
// Test values; Uncomment to check result …
//... | true |
4fe310e40213550152830608ec1efb4fbad12b1a | JavaScript | alvaroolt/sitioWebDWEC | /tema2/ejercicios1a7/ejercicio3/codigo.js | UTF-8 | 507 | 3.8125 | 4 | [
"MIT"
] | permissive | //array que almacena los 12 meses del año
let meses = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"];
//muestra el nombre de cada mes
console.log(meses[0]);
console.log(meses[1]);
console.log(meses[2]);
console.log(meses[3]);
consol... | true |
bfcad52c5ec04087c419f35559ec3b42c1c31bf5 | JavaScript | osynkad/mandatory-advanced-js1 | /src/Chat.js | UTF-8 | 2,014 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
import Message from './Message';
import io from 'socket.io-client';
class Chat extends Component {
constructor (props) {
super(props);
this.socket = io('http://ec2-13-53-66-202.eu-north-1.compute.amazonaws.com:3000/');
this.state = {messages: []};
}
componen... | true |
d3c3dc5668fc06b31b5bdbb7926f9563f18a5c7f | JavaScript | derUbermenk/rock-paper-scissors | /scripts/script.js | UTF-8 | 2,031 | 3.9375 | 4 | [] | no_license | function playGame(){
let choices = ["Rock", "Paper", "Scissor"],
userScore = 0,
computerScore = 0,
gamesPlayed = 0,
matchWinner;
while (gamesPlayed< 5){
let matchWinner = playMatch(choices); // will add + 1 to winner
switch (matchWinner){
case 'user... | true |
d60f8dee6c1111357a0d04045c427c893618519e | JavaScript | supwitdat/gitBranchExercise | /script.js | UTF-8 | 430 | 3.875 | 4 | [] | no_license | for <var i =0; i <30; i++) {
if (i% 5=== 0 && i % 3 === 0) {
console.log('fizzbuzz');
} else if (i % 5 === 0){
console.log('buzz');
} else if (i % 3 === 0){
console.log('fizz');
}else {
console.log(i);
}
function isPal(word) {
var ogWord = word;
if(ogWord === word.split('').reverse... | true |
943484f2f9fb84db9bec0db4dd0267313a7d28b8 | JavaScript | Fishfaceeast/nemo | /htdocs/public/js/legacy/validator.js | UTF-8 | 1,609 | 2.765625 | 3 | [
"MIT"
] | permissive | /**
* Created by yuqian on 16/6/3.
*/
~function($) {
'use strict'
function Validator(form, option) {
this.$form = $(form)
this.option = option || {}
this.patterns = {
number: /^\-?(?:[1-9]\d*|0)(?:[.]\d)?$/
}
this.after = option.after || function() {
return true;
}
this.$items = this.captureIt... | true |
6f7217992ee444909d7f48a953dc66383f994424 | JavaScript | build-dad-jokes/back_end | /users/users-model.js | UTF-8 | 2,116 | 2.75 | 3 | [] | no_license | const db = require("../data/dbConfig");
module.exports = {
get,
getSavedJokes,
add,
find,
findBy,
findById,
update,
remove,
getUserJokes,
saveJoke,
intToBoolean,
convertBoolean
};
function intToBoolean(int) {
return int === 1 ? true : false;
}
function convertBoolean(jokes) {
const result... | true |
aa8230885df253ce75bad03a406134553f69b0a7 | JavaScript | wwren/freeCodeCamp-Javascript | /9. Intermediate algo/2. diff-two-arrays.js | UTF-8 | 268 | 3.328125 | 3 | [] | no_license | function diffArray(arr1, arr2) {
var arr2Filter = arr2.filter(ele => !arr1.includes(ele));
var arr1Filter = arr1.filter(ele => !arr2.includes(ele));
var newArr = arr1Filter.concat(arr2Filter);
return newArr;
}
diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
| true |
0c8c5c519f8056776cdf71b3520eef217750dcb9 | JavaScript | Colin6618/Demos | /Nodejs/ORM/demo1.js | UTF-8 | 761 | 2.625 | 3 | [] | no_license | var Sequelize = require('sequelize');
var sequelize = new Sequelize('demo_schema', 'root', '', {
host: 'localhost',
dialect: 'mysql',
pool: {
max: 5, min: 0, idle: 10000
}
});
var User = sequelize.define('user', {
firstName: {
type: Sequelize.STRING,
field: 'first_name' // Will result in an attri... | true |
2fdd3194d37dcd3c8313f1e0306cf8473b561bf4 | JavaScript | xXJasonMXx/nodewinnipeg | /JS/ex_141/index.js | UTF-8 | 179 | 3.203125 | 3 | [] | no_license | const tripExpenses = [130, 90, 65];
let buget = tripExpenses.reduce(function(accumulator, currentValue) {
return accumulator + currentValue;
})
console.log('Buget: $'+buget) | true |
2e7b10bfef7936dcd992d86f73bcf85400fdf7e2 | JavaScript | abbas-samadani/portfolio | /frontend/src/component/dashboard/AddPortfolio.jsx | UTF-8 | 2,744 | 2.546875 | 3 | [] | no_license | import React, { useState } from 'react'
import { useHistory } from 'react-router-dom';
import { GetPortfolios } from '../../services/AxiosData';
import { post } from '../../services/HttpClient';
export default function AddPortfolio() {
const [file, setFile] = useState(null)
const history = useHistory();
... | true |
b246aad837e79b417d9cde7ff08edafd45420281 | JavaScript | papondum/HHLite | /www/js/fn.js | UTF-8 | 528 | 3.21875 | 3 | [] | no_license | function strcmp(a, b) {
return a > b ? 1 : a < b ? -1 : 0;
}
function natcmp(a, b) {
var x = [], y = [];
a[0].replace(/(\d+)|(\D+)/g, function($0, $1, $2) { x.push([$1 || 0, $2]) })
b[0].replace(/(\d+)|(\D+)/g, function($0, $1, $2) { y.push([$1 || 0, $2]) })
while(x.length && y.length) {
... | true |
b148d2ca75b18fb191f785082a31b1dc75ac633d | JavaScript | morkro/atom-emoji-syntax | /language-tests/jsx.jsx | UTF-8 | 487 | 2.609375 | 3 | [
"MIT",
"CC-BY-4.0",
"OFL-1.1"
] | permissive | import React, { Component } from 'react'
class Example extends Component {
constructor (props) {
super(props)
this.doSomething = this.doSomething.bind(this)
this.state = { active: props.active }
}
doSomething (event) {
console.log(event)
}
render () {
return (
<header>
<h1... | true |
7883ec4bb2e562a271eece8733008b4f1515fdb8 | JavaScript | Mulaza/Grade-Calculator | /src/js/main.js | UTF-8 | 1,230 | 3.546875 | 4 | [] | no_license |
//
export default class GradeCalculator {
constructor(values) {
this.values = values;
this.weights = this.values.map((item) => {
return item.weight
});
this.grades = this.values.map((item) => {
return item.grade;
});
this.total_weight = ... | true |
a17c5e5680263c36b140de39e87a769178bd7226 | JavaScript | displaygreat/react-redux-tutorial | /src/RouterApp/components/Posts/Posts.jsx | UTF-8 | 730 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
import { Container } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import './Posts.css';
class Posts extends Component {
state = {
data: [],
}
componentDidMount() {
fetch('https://jsonplaceholder.typicode.com/posts/')
.then(res=> res.json(... | true |
3711335c894d17a9792fb0b254399e24fe3485f7 | JavaScript | chrismclaughlan/stupo-kiosk | /admin/backend/SessionRouter.js | UTF-8 | 4,391 | 2.65625 | 3 | [] | no_license | const bcrypt = require('bcrypt');
const { json } = require('express');
const auth = require('./Auth');
const utils = require('./Utils');
const {CONSOLE_RED, CONSOLE_YELLOW, CONSOLE_GREEN} = utils;
class SessionRouter {
constructor(app, db) {
this.login(app, db);
this.logout(app, db);
this... | true |
27492592e101a55dccdfc336d6a10ce63d75a4de | JavaScript | aurerua/goals-tracker-mvc | /models/goal.js | UTF-8 | 870 | 2.65625 | 3 | [] | no_license | var db = require('./db'),
getSlug = require('speakingurl')
// Insert a new goal in the database and return its id.
exports.create = function(description, callback) {
var goal = {
description: description,
slug: getSlug(description),
successes: [],
failures: []
}
db.insert(goal, callback)
}
// Get all goal... | true |
e9ed32de5531413338bc002604ecc050a4496bd0 | JavaScript | abaticle/screeps | /Buildings.js | UTF-8 | 22,087 | 2.875 | 3 | [] | no_license | function Buildings(room) {
this.room = room;
}
Buildings.prototype.maxConstructionSites = 50;
/*
* Get building config for each levels
*/
Buildings.prototype.getConfig = function() {
return {
levels: [{
level: 1,
extensions: 0,
towers: 0,
containers... | true |
1741c0cbd20219b2089e11cc2a8b532d3914d2d1 | JavaScript | laomagege/movieslist-vue | /src/testUnderscore.js | UTF-8 | 377 | 3.03125 | 3 | [] | no_license | var _ = require('underscore')
var objTest = [{id: 1, val: 11}, {id: 2, val: 22}, {id: 3, val: 33}, {id: 4, val: 44}]
// _.map to an array obj
console.log(_.map(objTest, function (value) {
return value.id
}))
// _.object convert to an hashmap(=object)
var newobj = _.object(_.map(objTest, function (value, index, lis... | true |
5e724f2d7c9154e3d2aec640cb72000566d0907b | JavaScript | mguldberg/burger | /controllers/burgers_controller.js | UTF-8 | 1,545 | 2.859375 | 3 | [] | no_license | var express = require("express");
var router = express.Router();
// Import the model (burger.js) to use its database functions.
var burger = require("../models/burger.js");
// Create all our routes and set up logic within those routes where required.
//call on initial page load (leveraged also on reload in the main... | true |
0b22771ed9b99bf43e642e81ea3e0c312fd3a70e | JavaScript | TalyaGabso/AppleSeeds-JS-Exercises | /ex5.4-To_Weird_Case.js | UTF-8 | 846 | 4.59375 | 5 | [] | no_license | // Ex5.4 - To Weird Case
/*
Write a function toWeirdCase (weirdcase in Ruby) that accepts a string, and returns the same string with all even indexed characters in each word upper cased, and all odd indexed characters in each word lower cased.
The indexing just explained is zero based, so the zero-ith index is even, t... | true |
b5c8334366060102727f68475326162431a427b3 | JavaScript | jamisoncozart/Reddit-Miner | /app.js | UTF-8 | 5,948 | 2.640625 | 3 | [] | no_license | const axios = require('axios');
const MongoClient = require('mongodb').MongoClient;
const keys = require('./keys.js');
const url = keys.url || "mongodb://localhost:27017"
const nodemailer = require('nodemailer');
//initially runs main() when program is called
main();
//runs main() every 6 hours
setInterval(function(){... | true |
36cf8bda64801f71d94605a82959abbca6093bb9 | JavaScript | tinrist123/social_be | /src/backup/migration/Passion.js | UTF-8 | 678 | 2.6875 | 3 | [] | no_license | const { Passion } = require("../../models");
const passions = require("../data/passion.json");
const migratePassion = async () => {
let length = 0;
const { data } = passions;
const createPassion = async (passion) => {
const PassionModel = new Passion({
name: passion.name,
fake_id: passion.id,
... | true |
3429d80b86d6d1da49cc539a2500d1d944ad33c0 | JavaScript | AoiYamada/Ag4MBQQOCAAIBg0PBAINAQ | /lib/RateRequester.js | UTF-8 | 3,168 | 3.140625 | 3 | [] | no_license | 'use strict';
/** Notes
* https://www.xe.com/currencyconverter/convert/?Amount=1&From=HKD&To=USD
* rate is $('.uccResultAmount').text()
* It could be wrong when the frontend changed
*/
const cheerio = require('cheerio');
const https = require('https');
const url = require('url');
const BASE_URL_OBJECT = {
proto... | true |
81166a364265da08cd5d4fff979eee3326163195 | JavaScript | RupamShaw/CrudRouting-ReactNode | /public/components/ContactItem.js | UTF-8 | 1,054 | 2.5625 | 3 | [] | no_license | // contact list component
var ContactItem = React.createClass({
propTypes: {
id: React.PropTypes.string.isRequired,
name: React.PropTypes.string.isRequired,
email: React.PropTypes.string.isRequired,
description: React.PropTypes.string,
},
render: function() {
// I wrap mult-line... | true |
0a7ecd999dc61a9fc8ccb21d4399bd4b49d43cf1 | JavaScript | Matrixbirds/fin | /index.node.test.js | UTF-8 | 402 | 2.609375 | 3 | [] | no_license | const fin = require(".");
const url = "zangai://family.com";
const log = (msg, ...args) => console.log([msg, "#"].join("") + " [" + args +"]")
// catch error
try {
fin()
} catch (err) {
log("catch", err);
}
// work fine
let f = new fin(url);
f.once("connect", function (socket) {
log("socket", socket.name)... | true |
0c25348d858d3437936044b784f1ecbc29664525 | JavaScript | CalvinLeeC7E/leetcode | /初级/链表/合并两个有序链表.js | UTF-8 | 1,025 | 3.734375 | 4 | [] | no_license | /**
将两个有序链表合并为一个新的有序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。
示例:
输入:1->2->4, 1->3->4
输出:1->1->2->3->4->4
*/
var mergeTwoLists = function (l1, l2) {
let current1 = l1;
let current2 = l2;
let head = null;
let newCurrent = null;
function ListNode (val) {
this.val = val;
this.next = null;
}
function mak... | true |
37f39b109446bc9580ff7258a65b6011e9789dc1 | JavaScript | Colin787/Chatty-App | /src/App.jsx | UTF-8 | 2,731 | 2.890625 | 3 | [
"MIT"
] | permissive | import React, {Component} from 'react';
import ChatBar from './ChatBar.jsx';
import Message from './Message.jsx';
import MessageList from './MessageList.jsx';
import Navbar from './NavBar.jsx';
class App extends Component {
constructor(props) {
super(props);
this.state = {
currentUser: { name: 'Bob' },... | true |
8d2e3cb1e1657360dbbd41212c40dc6e5720b972 | JavaScript | wizard88mc/CVI-UniPD | /HTML/helpMe/js/TouchEventsManager.js | UTF-8 | 3,170 | 2.609375 | 3 | [] | no_license |
// PageX e pageY di event sono valori interessanti
var touchManagerNamespace = {
touchStart: function(event, ui) {
if (gameManager.packetWithResults.FIRST_RESPONSE_TIME == 0) {
gameManager.packetWithResults.FIRST_RESPONSE_TIME = new Date().getTime() - gameManager.startTimeObjectOnScreen;
... | true |
53aa436d2ea9e54162edfd9b3d5ed3c5fc495615 | JavaScript | kimmiec/delights-backend | /server.js | UTF-8 | 1,485 | 2.703125 | 3 | [] | no_license | // ============ DEPENDENCIES ============
require('dotenv').config();
const { PORT = 4000, MONGODB_URL } = process.env;
const express = require('express');
const app = express();
const mongoose = require('mongoose');
const cors = require('cors');
const morgan = require('morgan');
// ============ CONNECTIONS ==========... | true |
3e8b96d6a0a89a9d34e5c4c9ba4c8d8a6146d282 | JavaScript | pavankumarhb/task-22-02-2021 | /obj.js | UTF-8 | 986 | 3.796875 | 4 | [] | no_license | //testing objects
var myobj={
g:"pop",
a:"oop",
b:"ysag",
} ;
function my(check){
if(myobj.hasOwnProperty(check)){
return myobj[check];
}else{
return "not found";
}
}
console.log(my("g"));
//manipulating complex objects
var mymusic={
"var1": {
"a":"po... | true |
c65d9cc2c0359dc4a6d8a897a17a8c63fe6904b1 | JavaScript | SekyuShin/FinalProject_saveFile | /Module_test_0501/main.js | UTF-8 | 978 | 2.796875 | 3 | [] | no_license | var net = require('net');
const cron = require('node-cron');
function Cron_Scheduler(date_str,socket) {
return new Promise((resolve,reject)=>{
cron.schedule(date_str, async function () {
socket.write('haha');
}).start();
});
}
var server = net.createServer(function(socket) {
//서버를 생성
console.... | true |
8fc04d6cfcf72db083c92645560e0904297ebd6b | JavaScript | frazeal/cursoJQuery1 | /alura-typer/public/js/principal.js | UTF-8 | 248 | 2.984375 | 3 | [] | no_license | var frase = $(".frase").text();
var palavrasFrase = frase.split(" ");
var numeroPalavras = palavrasFrase.length;
var tamanhoFraseTag = $("#tamanho-frase");
tamanhoFraseTag.text(numeroPalavras);
console.log(frase);
console.log(palavrasFrase.length); | true |
d81b08e41aab0ada2a309aeff2767485382331ea | JavaScript | johnmorenov/grability_test | /public/js/fnAjax.js | UTF-8 | 892 | 2.765625 | 3 | [] | no_license | /*
* Funciones AJAX
*/
//Toma los parametros del formulario y devuelve el resultado de la consulta (Query)
function runCubeQuery() {
if(runInputValidation()) {
resetInputValidation();
var parametros = {
'cubeDimensions': parseInt($('#cubeDimensions').val()),
'query': $('#query').val().trim... | true |
53ef8ad249027751e36a6a7432b8fcb534874a8d | JavaScript | mangeshdase/AWP | /AWP-Lab -Practise/prompt.js | UTF-8 | 237 | 2.890625 | 3 | [] | no_license | function readvalue(){
console.log("success");
let enterdata=document.getElementById('data').value;
console.log(enterdata);
if(enterdata !== 0 || enterdata==" ")
{
alert("enter data is successful...!");
}
} | true |
221caf8038e9735a8c8f686e513f45868bc9a3e9 | JavaScript | shree20/monthly-budget-app | /src/playground/destructuring.js | UTF-8 | 612 | 3.96875 | 4 | [] | no_license | //object destructuring
// const person = {
// name: 'A',
// age: '30',
// location: {
// city: 'Boston',
// temp: 100
// }
// }
// const {name, age} = person
// console.log(`${name} is ${age}`)
// const book = {
// title: 'All os well',
// author: 'Ryan',
// publisher: ... | true |
fa92c3140a3f219b6d082e8440ab38a99a4d2893 | JavaScript | Faraj-Qdwry/MyFinance-web-app | /routes/index.js | UTF-8 | 4,521 | 2.546875 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var Comment = require('../models/Comment');
var Goal = require('../models/Goals');
var Daily = require('../models/Daily');
// Get Homepage
router.get('/', ensureAuthenticated, function (req, res) {
res.render('index');
});
// post comments
router.po... | true |
a4f62757a8310783e7da17c3a1838cecd0cc2c43 | JavaScript | DmDespert/Campus-Numerique_NPM | /weather.js | UTF-8 | 331 | 2.796875 | 3 | [] | no_license | var weather = require('weather-js');
// Options:
// search: location name or zipcode
// degreeType: F or C
weather.find({search: 'San Francisco, CA', degreeType: 'C'}, function(err, result) {
if(err) console.log(err);
console.log(result[0].current.temperature + "°");
console.log(result[0].current.sky... | true |
43d2a98e95e957fb1de4b4d9398ca95261b4396e | JavaScript | blackmida/IT_Bootcamp | /Domaci/5_Domaci_5.2.20/script.js | UTF-8 | 806 | 3.578125 | 4 | [] | no_license | // Pretvaranje litara u galone i obrnuto
const odnos = 3.785;
let galon = prompt("Unesite koliko imate galona kako bi izvrsili konverziju:");
console.log(`Uneta kolicina od ${galon} galona jednaka je kolicini od ${galon*odnos} litara`);
let litar = prompt("Unesite koliko imate litra kako bi izvrsili konverziju:");
con... | true |
51145e112954c822d28dd326036d48521aff8da4 | JavaScript | wxywr/homework | /当当网项目/dangdangwang/js/qiyezhuce.js | UTF-8 | 2,453 | 2.75 | 3 | [
"MIT"
] | permissive | var dj=document.querySelector('.submits');
var input=document.querySelectorAll('.he');
var shu=document.querySelectorAll('.shu-ru');
console.log(shu)
console.log(input)
console.log(dj);
var kong=document.querySelectorAll('form .kong');
console.log(kong);
console.log(kong.length);
dj.onclick=function(){
for(v... | true |
1f7e5588f7c817b74d54818105398ab5a18bc97a | JavaScript | tkbremnes/beer-recipe-app | /src/Components/BruiWizard/Nav/index.js | UTF-8 | 1,375 | 2.546875 | 3 | [] | no_license | import React, { Component } from "react";
class BruiWizardNav extends Component {
_handlePreviousButtonClick() {
this.props.onPrevious && this.props.onPrevious();
}
_handleNextButtonClick() {
this.props.onNext && this.props.onNext();
}
render() {
function renderSteps(_numb... | true |
96ca92415513d9220a6d0baaa5c28df358d15e87 | JavaScript | alexurumov/JS-Applications | /Lab 7/07. JS-Applications-Templating-Exercise-Resources/01. List Towns/app.js | UTF-8 | 441 | 2.828125 | 3 | [] | no_license | const URL = 'https://restcountries.eu/rest/v2/all';
(async() => {
const templateSrc = await fetch('./countries-template.hbs').then((r) => r.text());
const template = Handlebars.compile(templateSrc);
const countriesData = await fetch(URL).then((r) => r.json());
const resultHTML = template({countries... | true |
afa7558be18a6ee8eb5337adffc2efd30093c163 | JavaScript | iversontb/testtese | /smail/www/plugins/node-mail/index.js | UTF-8 | 2,861 | 2.71875 | 3 | [] | no_license | /* Высокоуровневая библиотека для отправки почты с сайта с помощью node.js */
var fs = require('fs');
var path = require('path');
var nodemailer = require('nodemailer');
var Mustache = require("mustache");
// запись резервной копии
var _writeBackup = function(options, body, cb) {
var file_bkp = path.join(options.bk... | true |
5c1934798900b53d554aee700493ab1891fe1e63 | JavaScript | Stoaree/stoaree_frontend-- | /src/pages/EditStoryPage/EditStoryPage.js | UTF-8 | 1,339 | 2.625 | 3 | [] | no_license | import React from "react";
import axiosAPI from "../../api/stoareeAPI";
import StoryForm from "../../components/StoryForm/StoryForm";
import fileUpload from "../../services/fileUpload";
class EditStoryPage extends React.Component {
state = {
story: {},
updateSuccess: false
}
componentDidMount() {
ax... | true |
bc674cc48715334f7c5ace19f6edcbc7a5834da4 | JavaScript | maciejkowalski/appengine-jruby | /demos/livechat/public/javascripts/application.js | UTF-8 | 7,656 | 2.546875 | 3 | [] | no_license | var Template = {
apply: function(string, parameters) {
return string.replace(/#\{(.+?)\}/g, function(_, key) {
return parameters[key];
});
}
};
function MessageQueue(opts){
this.chatId = opts.chatId;
this.lastMessageId = opts.lastMessageId;
this.lastMessageSequence = op... | true |
95e82a2ddb159baf3d4f1f3452690bd709ea7344 | JavaScript | eels911/task-manager | /components/TaskInput.js | UTF-8 | 2,387 | 2.640625 | 3 | [] | no_license | import React, { useState } from 'react'
import { View, Button, StyleSheet, TextInput, Modal } from 'react-native'
import Colors from '../constants/Colors'
import axios from 'axios'
const TaskInput = props => {
const [enteredTask, setEnteredTask] = useState('')
function taskInputHandler(enteredText) {
setEnte... | true |
23f4d4007a3d86e5d480c690f13a7b4a7485e0a2 | JavaScript | Ardnived/ApeMaze | /client/utility.js | UTF-8 | 1,363 | 2.96875 | 3 | [] | no_license | // This function will handle inheritance.
function extend(base, sub) {
// Avoid instantiating the base class just to setup inheritance
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create
// for a polyfill
// Also, do a recursive merge of two prototypes, so we don't ... | true |
038ae7da05c938ae99f82bbeaea4fe5af8c666df | JavaScript | kanishkgupta19/VisitorManagementSystem | /script.js | UTF-8 | 1,677 | 2.9375 | 3 | [] | no_license | function checkin()
{
var visitorname=document.getElementById('visitor_name').value;
var visitoremail=document.getElementById('visitor_email').value;
var visitorcontact=document.getElementById('visitor_contact').value;
var hostid=document.getElementById('visitor_host').value;
var checkout="00-00-0000 00:00:00"... | true |
a0ee182e950ded958b70ebf9708674c918be74ce | JavaScript | ccarr23/ccarr23.github.io | /restaurant3/restaurant.js | UTF-8 | 610 | 3.171875 | 3 | [] | no_license | function validateForm() {
let name = document.getElementById("name").value;
let email = document.getElementById("email").value;
let phone = document.getElementById("phone").value;
if (name == "" || email == "") {
alert("Please enter your name.")
document.getElementById("name").focus();
alert("Please enter a vali... | true |