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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a68ad3fac8e34ac2cf8408fa77c193e9c648343a | JavaScript | AikArutunian/WEIGHT_CONTROL | /js.js | UTF-8 | 3,717 | 2.96875 | 3 | [] | no_license | // Load the Visualization API and the piechart package.
google.load('visualization', '1', {'packages': ['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(function () {
drawChart(mainArray)
});
var mainArray = [
['date', 'Айк'],
["27/... | true |
db5f7789ff83059ee2b6275bb508e97fdcd0f040 | JavaScript | FedorovNikita/Javascript-Hero | /homework10/main.js | UTF-8 | 5,076 | 2.9375 | 3 | [] | no_license | let ul = document.querySelector('.list-group');
let form = document.forms['addTodoItem'];
let inputText = form.elements['todoText'];
let notificationAlert = document.querySelector('.notification-alert');
function listTemplate(task) {
// create list item
let li = document.createElement('li');
li.className = 'lis... | true |
069876a80eb4e2abd464378ab1411d1aafc1ffa4 | JavaScript | GeorgeWL/datepicker-ui | /src/components/TextArea.jsx | UTF-8 | 1,012 | 2.59375 | 3 | [] | no_license | // import PropTypes from 'prop-types';
import classNames from "classnames";
import React, { useState } from "react";
import * as classes from "./textarea.module.scss";
const TextArea = ({
columns = 4,
rows = 6,
divider = "/",
maxChars = 500,
maxCharsLabel = "characters"
}) => {
const [text, setTe... | true |
7bd9870da8ce049580b2d347ecab6dd5cde78883 | JavaScript | pankajsinghal/IVRSecurity | /src/main/webapp/js/viewservices.js | UTF-8 | 1,499 | 2.609375 | 3 | [] | no_license | $(function(){
// add multiple select / deselect functionality
$("#selectall").click(function () {
$('.case').attr('checked', this.checked);
});
// if all checkbox are selected, check the selectall checkbox
// and viceversa
$(".case").click(function(){
if($(".ca... | true |
0ce1362f420c59cb8c85045da25177d96d45e559 | JavaScript | naptr/FrontEnd-Dev-curriculum | /sprint4-HTML_DOM/topiknya/yet-another-calc/js/calc.js | UTF-8 | 1,489 | 3.171875 | 3 | [] | no_license | // Calc
export const input = document.getElementById('main-input');
export function insertNum(n) {
// console.log(`insertNum(${n}) Clicked!`)
input.value = n;
}
export function opKey() {
console.log("opKey() Clicked!")
}
export function eqKey() { // equal key -> result
console.log("eqKey() Clicked!");
}
exp... | true |
141d7116c79954fc18156980050543cfdaa6c02b | JavaScript | PiotrDabkowski/Js2Py | /tests/test_cases/built-ins/String/prototype/slice/S15.5.4.13_A1_T2.js | UTF-8 | 849 | 2.796875 | 3 | [
"MIT"
] | permissive | // Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: String.prototype.slice (start, end)
es5id: 15.5.4.13_A1_T2
description: >
Arguments are function call and x, and instance is Boolean. x is
undefined variable
---*/
va... | true |
002a788e18299bd80323bc80174978c0b3bf5b84 | JavaScript | zhuban/react-navigation | /src/Actions/limitedAction.js | UTF-8 | 1,317 | 2.671875 | 3 | [] | no_license | "use strict";
// 访问登录接口 根据返回结果来划分action属于哪个type,然后返回对象,给reducer处理
var P = {
param(a){
let s = [];
for(let i in a){
s[s.length] = encodeURIComponent(i) + '=' + encodeURIComponent(a[i]);
}
return s.join('&').replace(/%20/g,'+');
}
}
export function request(page) {
// alert(page);
// alert("请... | true |
e62699e7a6276ee71be8b256be3a29aa2bf92efe | JavaScript | SamChan1204/leetcode_in_javascript | /0020.js | UTF-8 | 868 | 3.75 | 4 | [] | no_license | /**
* 栈实现
*/
var isValid = function(s) {
const map = {
')': '(',
'}': '{',
']': '['
};
const stack = [];
for (let i = 0, l = s.length; i < l; i++) {
const cur = s[i];
if (['(', '{', '['].indexOf(cur) >= 0) {
stack.push(cur);
} else if (stack.pop() === map[cur]) {... | true |
88cda7b2d50c405d17cfd5622befbd2754bfb1a1 | JavaScript | renbaydev/video_bg_test | /app/scripts/main.js | UTF-8 | 965 | 2.609375 | 3 | [] | no_license | console.log('\'Allo \'Allo!');
// Uncomment to enable Bootstrap tooltips
// https://getbootstrap.com/docs/4.0/components/tooltips/#example-enable-tooltips-everywhere
// $(function () { $('[data-toggle="tooltip"]').tooltip(); });
// Uncomment to enable Bootstrap popovers
// https://getbootstrap.com/docs/4.0/components... | true |
71b23ae16f09901a1b477d1e8d033f6df3cd2e4b | JavaScript | Jiasm/notebook | /labs/demo/node/learning-koa/router-http.js | UTF-8 | 544 | 2.59375 | 3 | [] | no_license | const http = require('http')
const serverHandler = (request, response) => {
// default
let responseData = '404'
if (request.url === '/') {
if (request.method === 'GET') {
responseData = 'Hello World'
} else if (request.method === 'POST') {
responseData = 'Hello World With POST'
}
} els... | true |
3b065dda4f44beec825acef152213a966fe330b8 | JavaScript | TwoDoomedPenguins/Learn-JS | /DS_Playground/DS_Tools.js | UTF-8 | 1,590 | 2.9375 | 3 | [] | no_license | //@ts-check
function GetCookie(cookieName) {
cookieName = cookieName.trim();
cookieName += "=";
var decodedFullCookie = decodeURI(document.cookie);
var cookieArray = decodedFullCookie.split("; ");
for (var i = 0; i < cookieArray.length; i++) {
if (cookieArray[i].length >= cookieName.length ... | true |
d95dc089ad64021070a3c9f6fabb42f6d3bfc787 | JavaScript | favish/cfas | /js/cfas--build-slideshow.js | UTF-8 | 4,877 | 2.546875 | 3 | [] | no_license | (function ($, Drupal, window, document, undefined) {
Drupal.behaviors.buildSlideshow = {
attach: function (context, settings) {
var pluginName = 'flickrAlbumSlideshow';
var defaults = {
galleryWidth: 900
};
function FlickrAlbumSlideshow(element, options) {
this.element =... | true |
97857bb8fc9b7f058251728a0db88dda2d5093b7 | JavaScript | charliemonnone/WebGL2-Sandbox | /src/utils/FileSys.js | UTF-8 | 1,964 | 2.9375 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
/*
NOTE: I think in regards to hotloading changes to the glCanvas I have two options:
1. write changes to a temporary copy of the shader
2. pipe the string value of the shader to glCanvas
With option 1 I'll have to either setup the canvas to poll for file changes, or implement a funct... | true |
f347cdcb6a5d345b6b6a716aab36df031e65e9d3 | JavaScript | PhilTerz/Tarot-Journal | /src/components/Page-list.js | UTF-8 | 1,075 | 2.65625 | 3 | [] | no_license | import React, { Component } from 'react'
class PageList extends React.Component {
constructor(props) {
super(props)
this.state = { value: '' }
}
componentWillReceiveProps = nextProps => {
if (this.props.activePage && nextProps) {
if (
JSON.stringify(this.props.activePage.id) !==
... | true |
f75c0f889008012a279eed7846ff0c3ec2a21aa8 | JavaScript | nsocrates/react-sound | /src/scripts/reducers/entities.js | UTF-8 | 805 | 2.5625 | 3 | [] | no_license | /**
* https://github.com/rackt/redux/blob/master/examples/real-world/reducers/index.js
*/
import merge from 'lodash/merge'
// Updates an entity cache in response to any action with response.entities:
const initialState = {
playlists: {},
tracks: {},
users: {}
}
export default function entities(state = initia... | true |
de5d3915093518dca4f13fd6b9ec300b3def78ce | JavaScript | SourCreamCulture/TomorrowBotV2 | /commands/owneronly/kahootspam.js | UTF-8 | 1,459 | 2.640625 | 3 | [] | no_license | const { MessageEmbed } = require('discord.js');
const kahootSpam = require('kahoot-spam');
const api = kahootSpam;
module.exports = {
aliases: ['kspam'],
description: 'Spam a kahoot live',
category: 'BotOwnerOnly',
guildOnly: true,
ownerOnly: true,
cooldown: '5s',
callback: async ({ message, args, text, ... | true |
1b2ab99b87786d6b6735545c1580e0787089e0de | JavaScript | ervinne13/academica | /public/js/pages/enrollment/index.js | UTF-8 | 5,955 | 2.65625 | 3 | [
"MIT"
] | permissive |
/* global baseURL, utilities */
(function () {
var studentListItemTemplate;
var studentTemplate;
var studentSelectionTemplate;
$(document).ready(function () {
initializeTemplates();
initializeView();
initializeEvents();
loadAndDisplayEnrolledStudents();
});
... | true |
af91289d572062ea56a1be2bddafdd7f3c9ec383 | JavaScript | java-wendaoyu/hksys02 | /src/main/resources/static/js/teach.js | UTF-8 | 2,784 | 2.578125 | 3 | [] | no_license | $().ready(function () {
var program = {
courseId: 0,
courseName: "",
discription: "",
teacherId: "",
className: "",
term: "",
means: "",
start: 0,
rows: 20,
queryCourse: function () {
$.ajax({
type: "post",
... | true |
4ecb29f820650712618456c4572fb469479bc0af | JavaScript | MaYD323/FBFLX | /project1/WebContent/movies.js | UTF-8 | 2,043 | 3.5 | 4 | [] | no_license | /**
* This example is following frontend and backend separation.
*
* Before this .js is loaded, the html skeleton is created.
*
* This .js performs two steps:
* 1. Use jQuery to talk to backend API to get the json data.
* 2. Populate the data to correct html elements.
*/
/**
* Handles the data retu... | true |
e1ec959cdd77acda87e5289b8e129d946fcb6fb5 | JavaScript | worldveil/p5-stuff | /trees/object_oriented_v2/sketch.js | UTF-8 | 1,225 | 3.359375 | 3 | [] | no_license | // https://github.com/CodingTrain/website/tree/54fc9979a77120bc8ac4a23cd6a38df4798d5751/CodingChallenges/CC_015_FractalTreeArray/P5
var len;
var tree = [];
var leaves = [];
var mouseCount = 0;
function setup() {
// create our canvas to be 400x400
createCanvas(400, 400);
len = 100;
var start = createVector(wid... | true |
43002bfad1860cbb75c872bcfc8c1f873903372c | JavaScript | Ahmad-Sawalqeh/elevatus-template | /src/components/about/index.js | UTF-8 | 2,215 | 2.6875 | 3 | [
"MIT"
] | permissive | /**
* imoprting React librara to work with JSX format,
* importing useContext hook to get website state from context-api (state managment system)
*/
import React, { useContext } from "react";
/**
* importing the react-player package to work with videos as components
*/
import ReactPlayer from 'react-player'
/**
... | true |
deea6aadd367a55821bbe95c5621d9eeb550476b | JavaScript | mayconrralves/meetupmobile | /src/store/modules/auth/reducer.js | UTF-8 | 664 | 2.546875 | 3 | [] | no_license | import { produce } from 'immer';
const INITIAL_STATE = {
signed: false,
csrf: null,
msgFailure: ''
}
export default function auth (state=INITIAL_STATE, action){
switch(action.type){
case '@auth/SIGN_SUCCESS':
return produce(state, draft=>{
draft.signed = true;
draft.csrf = action.payload.csrf;
dr... | true |
77c8c6ae7a9105a3c91aa7a6f04449cef7c00081 | JavaScript | swong452/HW12SQLEmpTracker | /sqlTask/connection.js | UTF-8 | 594 | 2.765625 | 3 | [] | no_license | const mysql = require("mysql");
const util = require("util");
var connection = mysql.createConnection({
user: "root",
password: "password",
host: "localhost",
port: "3306",
database: "employeeDB"
})
connection.connect();
// Later on, certain query needs to be asynchronously executed first,
// wh... | true |
c03c4e970a6690cf32c1fcd68e6fab4cd5edf611 | JavaScript | Moussaddak/holbertonschool-web_back_end | /0x11-ES6_data_manipulation/2-get_students_by_loc.js | UTF-8 | 224 | 2.796875 | 3 | [] | no_license | export default function getStudentsByLocation(arrayOfStudentIds, city) {
return (Array.isArray(arrayOfStudentIds) && typeof city === 'string')
? arrayOfStudentIds.filter((student) => student.location === city) : [];
}
| true |
51f8ad60ece2fbe66e9a34c8b8d6037bcf29de28 | JavaScript | Mooon1/web-thread-generator | /assets/js/func/commandCreation.js | UTF-8 | 2,364 | 2.5625 | 3 | [] | no_license | function createCommandFormWithValues(command, desc, perm) {
$("#commands-form").append('<div class="col-12">\n' +
' <input type="text" id="command-' + COMMANDS + '" value="' + command + '" style="width:100%;">\n' +
' <input type="text" id... | true |
5856e14d11f1367d4e037f53d7f75f862e3a1352 | JavaScript | bkoczo/100_vanillajs_projects | /proj44_todolist_x/app.js | UTF-8 | 2,142 | 3.46875 | 3 | [
"MIT"
] | permissive | const input = document.getElementById('todo-input');
const btn = document.getElementById('add-item');
const list = document.getElementById('list');
let itemList = [];
(function(){
displayLocalStorage();
//localStorage.clear();
})()
btn.addEventListener('click',function(e){
e.preventDefault();
let chec... | true |
fee41b7ef5617431c2fcbf68a290bb965c495518 | JavaScript | YakushenkoES/React_Udemy | /_lessons/Section2_ES2019/classProperties.js | UTF-8 | 853 | 3.796875 | 4 | [] | no_license | // ES 2019
class Counter {
count = 0;
inc = () => {
this.count += Counter.incrementStep;
console.log('this.count :', this.count);
}
static incrementStep = 2;
static incrementAll = function (arr) {
arr.forEach(с => c.inc());
}
}
const cnt = new Counter();
cnt.inc();
cnt... | true |
d369350a3a5f683d423f4f274f2382730ba93952 | JavaScript | swamyrevoju/Samplecode | /src/employee/edit.component.js | UTF-8 | 6,116 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
export default class Edit extends Component {
constructor(props) {
super(props);
this.onChangeEmployeeName = this.onChangeEmployeeName.bind(this);
this.onChangeEmployeeId = this.onChangeEmployeeId.bind(this);
this.onChangePhoneNumbe... | true |
f2220c5e018dae75638939ecd2d4fa89ad1e5651 | JavaScript | Yahuizhang/Effects-and-functions | /列表/js/shiyan81.js | UTF-8 | 817 | 2.65625 | 3 | [] | no_license | window.onload=function(){
var dians=document.getElementsByName('dian');
var nv=document.getElementById("gril");
var zu1=document.getElementById("zu1");
var zu2=document.getElementById("zu2");
var zu3=document.getElementById("zu3");
var zus=document.getElementsByName("zu");
for (var i = 0; i < dians.length; i... | true |
5bf776084026120c2ee5a533f57f7430ffbfc135 | JavaScript | jauharnotes/complete-reactjs-tutorial | /chapter-01/strong-fundation/spreadOperator.js | UTF-8 | 1,542 | 3.765625 | 4 | [] | no_license | // combine the two array into one
const peaks = ["Tallac", "Ralston", "Rose"];
const canyons = ["Ward", "Blackwood"];
const combine = [...peaks, ...canyons];
console.log(combine);
console.log(combine.join(", "));
//We could use the Array.reverse method to reverse the array in combination with array destructuring
cons... | true |
0afea26cbeb56064edeb0504dd18b7de033804b7 | JavaScript | gnoesiboe/javascript-playground | /src/js/store/slideStore.js | UTF-8 | 2,455 | 2.625 | 3 | [] | no_license | var appDispatcher = require('./../utility/appDispatcher'),
actionConstants = require('./../constants/actionConstants'),
slideFactory = require('./../utility/slideFactory'),
idGenerator = require('./../utility/idGenerator');
/**
* @type {Array}
*
* @private
*/
var _slides = [];
/**
* @type {Array}
*
... | true |
35e6cb5f9d584128c46c0a75b9b766a2f5221426 | JavaScript | Jotabustos/Nodepop | /lib/hasher.js | UTF-8 | 736 | 2.8125 | 3 | [] | no_license | const crypto = require('crypto');
// Create password hash using Password based key derivative function 2
function hashPassword(password) {
const salt = crypto.randomBytes(16).toString('hex');
const hash = crypto.pbkdf2Sync(password, salt, 2048, 32, 'sha512').toString('hex');
return [salt, hash].join('$');
... | true |
2ac4c7eb30aba1408c94f59c406ff164ff1a2778 | JavaScript | olleromo/Udacity-fastform | /src/fastform/js/organize.js | UTF-8 | 7,836 | 2.546875 | 3 | [] | no_license |
var eventStartHandlerFlag = false;
var eventEndHandlerFlag = false;
function eventStartHandlerSignal () {
eventStartHandlerFlag = true;
};
function eventEndHandlerSignal () {
eventEndHandlerFlag = true;
};
(function ($) {
var progressCount = 0;
var fieldCount = 11;
var progressPercent = 0;
... | true |
a4b5dbc9a9207f4de1f3277f950113fa2c023b76 | JavaScript | NinaKong/LeetCode-JavaScript | /118-PascalTriangle.js | UTF-8 | 895 | 4.1875 | 4 | [] | no_license | //Method 1
var generate = function(numRows) {
var pascalTriangle = [];
for (var i = 0; i < numRows; i++) {
pascalTriangle[i] = new Array(i+1);
for (var j = 0; j < i+1; j++) {
if (j === 0 || j === i) {
pascalTriangle[i][j] = 1;
} else {
... | true |
27fc7329bc209650471efdd1c825cce36787956c | JavaScript | lijingying91/typescript-demo | /study/chapter03.js | UTF-8 | 403 | 2.921875 | 3 | [] | no_license | // 类型推论
// 如果没有明确的指定类型,那么 TypeScript 会依照类型推论(Type Inference)的规则推断出一个类型
// let myFavoriteNumber = 'seven';
// myFavoriteNumber = 7;
// 如果定义的时候没有赋值,不管之后有没有赋值,都会被推断成 any 类型而完全不被类型检查
var myFavoriteNumber;
myFavoriteNumber = 'seven';
myFavoriteNumber = 7;
| true |
e3e173fd242e58048f5a74e67282a9354e05065d | JavaScript | ryan1002/wdi-fundamentals-memorygame | /starter-code/main.js | UTF-8 | 1,778 | 4.40625 | 4 | [] | no_license | var cards = ['queen', 'queen', 'king', 'king'];
// represents the cards in play
var cardsInPlay = [];
// find the board and set it to a variable
var board = document.getElementById('game-board');
// function that will create your board
function createBoard() {
// loop through your cards array to create card element... | true |
2f47c0ff19c91c3f8545ea60a5d31fef9673478f | JavaScript | pannchat/1day1commit | /js/nts2.js | UTF-8 | 333 | 3.109375 | 3 | [] | no_license | function solution(N, K, charges) {
var answer = [];
const arr = new Array(N).fill(0);
let res = 0
charges.forEach((e,i)=>{
// console.log(i)
if(i===K-1){
res = arr.indexOf(Math.min(...arr));
}
arr[arr.indexOf(Math.min(...arr))] += e;
})
return [res+1... | true |
a6f2249fc7d08068b7fd7fe34e7c91d9a2db1edb | JavaScript | andrewbeattie180/Open-Air-Quality-API | /air-quality-app/src/App.js | UTF-8 | 2,501 | 2.78125 | 3 | [] | no_license | import React, { Component } from 'react';
import Header from './components/header';
import Card from './components/card';
import API from './api/api'
import './App.css';
class App extends Component {
constructor(){
super();
this.state={
list:[],
inputText:'',
loading: false,
cityCard... | true |
6fdde066f32328416dee585bca817a7708922acb | JavaScript | monkeyozZ/vue-admin | /src/filters/index.js | UTF-8 | 1,775 | 2.796875 | 3 | [] | no_license | export const parseTime = (time, cFormat) => {
if (arguments.length === 0) {
return null
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if (('' + time).length === 10) time = parseInt(time) * 1000
date = new Date(parseInt(tim... | true |
82054d72adf323295e8875f04f51de48ee3cf0d2 | JavaScript | tomatoua/task11 | /server.js | UTF-8 | 8,535 | 2.625 | 3 | [] | no_license | var http = require("http");
var url = require("url");
var qs = require('querystring');
var base = {
'ukraine' : {
'luxaryhotel':'best',
'midlehotel':'notbad',
'onestar':'verypurehotel'
},
'vietnam' : {
'luxaryhotel':'best',
'midlehotel':'notbad',
'onestar':... | true |
ada1d9ae742190db4525c72218f1a5fb0c37cf26 | JavaScript | bcollazo/itinerus-prototype | /models/lpcode.js | UTF-8 | 1,083 | 2.703125 | 3 | [] | no_license | // var lpsolve = require('lp_solve');
// var Row = lpsolve.Row;
// var solve = function(places, timearray) {
// var lp = new lpsolve.LinearProgram();
// var variables = [];
// for (var i in places) {
// console.log("Adding "+places[i].title);
// var xis = lp.addColumn('x'+i+'s');
// var xie = lp.addColumn('x... | true |
57eb51b0794cf51a30d1911ad012e0cf541ad3c4 | JavaScript | nurnobimiraj00/API-JSON-Server-Data_load-dynamic_website-http | /1st-quiz.js | UTF-8 | 88 | 2.53125 | 3 | [] | no_license | if('false'){
console.log("i am not fales");
}
else{
console.log("i am fales");
} | true |
8cca0193de2a4057e74607567e6878c531987d60 | JavaScript | ogbrewer/FriendFinder | /app/data/friend.js | UTF-8 | 1,726 | 2.65625 | 3 | [] | no_license |
const friends= [{
"name":"Ahmed",
"photo":"https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/6/005/064/1bd/3435aa3.jpg",
"scores":[
]
},
{
"name":"Micheal",
"photo":"https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/6/005/064/1bd/3435aa3.jpg",
"scores":[
]
}... | true |
60a9e2c2ce2ed513b3eea0e6b73fe0edcf9e985c | JavaScript | rqlromo/redux-marketplace | /src/reducers/listFavourites.js | UTF-8 | 1,373 | 2.515625 | 3 | [] | no_license | import {
ADD_PRODUCT_TO_FAVOURITES,
DELETE_PRODUCT_FROM_FAVOURITES,
DELETE_ALL_PRODUCTS,
} from "../constants";
const initialState = {
listFav: []
};
export default function contentReducer(state = initialState, action) {
switch (action.type) {
case ADD_PRODUCT_TO_FAVOURITES:
return {
...st... | true |
63fe06629ad1c31d9c7bf28861b56f309baeac44 | JavaScript | renanbastos93/steamlytics-es6 | /index.js | UTF-8 | 2,625 | 2.765625 | 3 | [
"MIT"
] | permissive | const request = require('request');
Promise = global.Promise || Promise;
class ApiSteam {
constructor(version, key){
this.url = "http://api.csgo.steamlytics.xyz/"
this.version = "v1" || version;
this.key = "" || key;
this.headers = {
"User-Agent" : "request",
"Content-Type" : "application/json"
}
t... | true |
7d9cb57e0af534452453a9d10efb82adc33f20ce | JavaScript | adarshm07/bmi-calc-javascript | /script.js | UTF-8 | 1,330 | 3.359375 | 3 | [] | no_license | const isHeightRange = document.getElementById("isHeightRange");
const isWeightRange = document.getElementById("isWeightRange");
const isHeight = document.getElementById("isHeight");
const isWeight = document.getElementById("isWeight");
const btnBMI = document.getElementById("btnBMI");
isHeight.value = isHeig... | true |
5ba33d106dca88e676e16f9995957726f46966f5 | JavaScript | josiepera/finance-app | /controller/transaction-controller.js | UTF-8 | 1,835 | 2.53125 | 3 | [] | no_license | const Finance = require('../model/transaction-models');
const transactionController = {};
transactionController.index = (req, res) => {
Finance.findAll()
.then(transactions => {
res.json({
message: 'ok',
data: transactions,
});
})
.catch(err => {
console.log(err);
... | true |
7f22040d2b4cc3ac6e9bc35108e918cfa324bf82 | JavaScript | SaswatPadhi/W15_CS237A | /EXTRA - HW6/prettyPrint.js | UTF-8 | 2,844 | 3.171875 | 3 | [
"MIT"
] | permissive | JS.prettyPrintValue = function(x) {
return x instanceof Program || x instanceof Rule || x instanceof Clause || x instanceof Var ?
L.prettyPrintAST(x) :
String(x);
};
// --------------------------------------------------------------
L.prettyPrintValue = function(iter) {
if (!iter || !iter.next) {
throw... | true |
554e8d808744455eb86a1430b34a3dc86f609635 | JavaScript | JukkaLehikoinen/verkkokauppa | /src/components/Ostoskori.js | UTF-8 | 1,366 | 2.75 | 3 | [] | no_license | import React, { useState } from 'react';
import List from './List';
import ShowOstoskori from './ShowOstoskori';
function ShoppingList () {
const [ostoskori, lisaaOstoskori] = useState(0);
const [maara, lisaaMaara] = useState(0)
const [tila, setTila] = useState(0);
const [a, setA] = useState([]);
... | true |
5b623477fe2e64df85b2decc084c9dc13f29827d | JavaScript | Yuyahase/react-weather-sample | /src/App.js | UTF-8 | 2,041 | 3.109375 | 3 | [] | no_license | import Form from "./components/Form"
import Loading from "./components/Loading"
//useStateのインポート, ステートフックを使う為に必要
import { useState } from "react"
import axios from "axios";
import './App.css';
import Weather from "./components/Weather"
function App() {
// Declare a new state variable, which we'll call "city"
//sta... | true |
0fbf929dfc78aad4df416bd51464109f266ad098 | JavaScript | LucianoRamos06/curso_js | /exercicios-js/fundamentos/nullOuUnderfined.js | UTF-8 | 250 | 2.984375 | 3 | [] | no_license | /**
* Diferenã entre nulo e indefinido
*/
//underfine, significa que a variavel não foi inicializada
let a
console.log(a)
//Nulo, significa que a varialvel foi inicializada mais não aponta para nenhum endereço
a = null
console.log(a) | true |
eb3712b8959355d22b5960d65182a19b60bec292 | JavaScript | GamesDoneQuick/donation-tracker | /spec/matchers.js | UTF-8 | 1,000 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | beforeEach(() => {
jasmine.addMatchers({
toExist: function () {
return {
compare: function (actual) {
if (!actual.exists) {
throw new Error(`Expected ${actual} to have an 'exists' method`);
}
const passed = actual.exists();
return {
pa... | true |
0c34bfa977341eb6e74c6a9b83d4f1a5ce3253b9 | JavaScript | abdulrafayn001/register-login-with-cards-ReactJS | /src/components/signin.js | UTF-8 | 2,774 | 2.546875 | 3 | [] | no_license | import React from "react";
import logo from './logo.png';
import { Redirect } from 'react-router';
import classes from "./classes.module.css";
class SignIn extends React.Component
{
constructor(props){
super(props)
this.state = {
email:'',
pwd:'',
id:-1,
... | true |
1da6f2697c2a804cf60b95e4090f158237b2116d | JavaScript | FoozBarakat/rebktn1-toy-problems | /rockPaperScissors/rockPaperScissors.js | UTF-8 | 1,060 | 4.1875 | 4 | [] | no_license | /*
* Write a function that generates every sequence of throws a single
* player could throw over a three-round game of rock-paper-scissors.
*
* Your output should look something like:
* ["RRR",
* "RRP",
* "RRS",
* "RPR",
* ...etc...
* ]
*
* Extra credit:
* - Make your function return answers for any n... | true |
1f4aa45d0ebd08546d98aaea6cb6ed10f8826660 | JavaScript | thetno/JSFeb2017 | /reference.js | UTF-8 | 91 | 2.671875 | 3 | [] | no_license | "use strict";
let obj = {};
let another = obj;
obj.value = 99;
console.log(another.value);
| true |
781dc06e36f77e8e2670deb79fd22c710e8ae94d | JavaScript | clementdessoude/game-of-life-dojo | /src/services/grid-helper.js | UTF-8 | 631 | 3.34375 | 3 | [] | no_license | export const getCellIdFromIndex = function(cellIndex, columnsCount) {
const row = Math.floor((cellIndex - 1) / columnsCount)
const column = (cellIndex - 1) % columnsCount
return getCellId(row, column)
}
export const getCellId = function(row, column) {
return `R${row}C${column}`
}
export const getRandomizedMa... | true |
cdfd20f051550659a3e2199d20a3c84a9543e49e | JavaScript | hpinsley/Html5Explorations | /JSWebPlay/Scripts/Home/FibonacciTests.js | UTF-8 | 1,011 | 2.953125 | 3 | [] | no_license | ///<reference path="CalcLib.js"/>
module("Fibonacci tests");
test("Fibonacci of one", function () {
var n = 1;
var expected = 1;
var actual = CalcLib.fib(n);
equal(actual, expected, "fib(1) is 1");
});
test("Fibonacci of two", function () {
var n = 2;
var expected = 1;
var actual = CalcL... | true |
580b28154cf5af42d98b15e614ed5d003b7464a3 | JavaScript | drakmail/radio-lor | /js/chat.js | UTF-8 | 1,823 | 2.828125 | 3 | [] | no_license | var message_input = $('#message');
var latest_time = 0;
var messages_count = 0;
// add lead zero
function format_time(time) {
time = time + "";
if (time.length == 1) {time = "0" + time;}
return time;
}
// clear oldest message
function clear_message() {
$(".messages").children("div:first").remove();
}
// add ... | true |
a238b4fd1dc74f9985301b463a279d387bb06f72 | JavaScript | iths-anna-boberg/hamsterwars | /index.js | UTF-8 | 1,030 | 2.5625 | 3 | [] | no_license | const express = require('express');
const app = express();
require('dotenv').config();
app.use(express.static('public')); //serva en enkel htmlsida for now
app.use(express.json());
//AUTH
app.use((req, res, next)=>{
if(req.method !== 'GET'){
const APIKey = process.env.API_KEY;
... | true |
99e4b583b690c0ec5459db6b17bb6760763441e3 | JavaScript | armandouv/algorithms-clrs | /Chapter 8/bucketSort.js | UTF-8 | 763 | 3.84375 | 4 | [] | no_license | "use strict"
const {mergeSort} = require("../Chapter 2/mergeSort.js");
function bucketSort(arr)
{
const bucketsArr = [];
for (let el of arr)
{
bucketsArr.push([]);
}
for (let el of arr)
{
bucketsArr[Math.floor(arr.length * el)].push(el);
}
const sortedArr = [];
for... | true |
4622ab78c4a093f14e40daac1cc360cb98ee04e9 | JavaScript | pratamanidhi/id_backend_service | /controllers/bookingList/booking.js | UTF-8 | 2,208 | 2.546875 | 3 | [] | no_license | import {getBookings, insertBookings, getBookingsById, updateBookings, deleteBookings, getBookingsDetail,
getBookingsByUserID, getBookingsByPartnerID} from "../../models/booking/bookingModel.js"
export const showBooking = (req, res) =>{
getBookings((err, results) =>{
if(err){
res.send(err)
... | true |
68bc5d07e022c29ca517a4446b8e753786d3e49b | JavaScript | mrozowski/Portfolio | /src/Pages/web.jsx | UTF-8 | 1,920 | 2.875 | 3 | [] | no_license | import React from 'react';
function Main(){
return(
<div className="page">
<h2>Web Development</h2>
<p>I started my programming world like most programmers with creating websites. I have to say till now I find this very pleasant. Especially after I found <b>React</b>. It’s a l... | true |
2de4c45656c103419bc9a6f1c8235343c5d5562b | JavaScript | yuefei92/note | /examples/tools/babel/plugin-transform-runtime/output-corejs3.js | UTF-8 | 920 | 3.015625 | 3 | [] | no_license | 'use strict';
var _interopRequireDefault = require('@babel/runtime-corejs3/helpers/interopRequireDefault');
var _defineProperty2 = _interopRequireDefault(
require('@babel/runtime-corejs3/helpers/defineProperty'),
);
const arrowFunc = () => {
const obj = {
a: 1,
b: 2,
c: 3,
};
const { a, ...rest }... | true |
a809b56603abdc122c0cbdf7c5ecc297fcfe281f | JavaScript | kkuberra/P3-Client | /frisbee-golf/src/components/CommentForm.js | UTF-8 | 1,122 | 2.625 | 3 | [] | no_license | import React from 'react'
const baseUrl = "https://frisbee-golf.herokuapp.com/comments";
class CommentForm extends React.Component{
constructor(props) {
super(props)
this.state = {comment: '', location_id:0}
this.handleSubmit = this.handleSubmit.bind(this)
}
handleChange=(event)=>{
thi... | true |
701a236db303f0d55d1efd55851e4911bcfe0cdc | JavaScript | vy3191/Autherization-Friends | /friends/src/reducers/Friends.js | UTF-8 | 3,624 | 2.53125 | 3 | [] | no_license | import {FETCHING_FRIENDS_START,
FETCHING_FRIENDS_SUCCESS,
FETCHING_FRIENDS_ERROR,
FETCHING_SINGLE_FRIEND_START,
FETCHING_SINGLE_FRIEND_SUCCESS,
FETCHING_SINGLE_FRIEND_ERROR,
SAVING_FRIENDS_START,
SAVING_FRIENDS_SUCCESS,
SAVING_FRIENDS_ERROR,
UPDATI... | true |
2d965869eb375ea0af036a8e92536930cd755e74 | JavaScript | ameseee/game-time | /lib/Powerup.js | UTF-8 | 3,582 | 2.921875 | 3 | [] | no_license | const GamePiece = require('./GamePiece');
class Powerup extends GamePiece {
constructor(x, y) {
super(x, y);
this.moveY = 1.3;
this.width = 30;
this.height = 12;
this.radius = 8;
this.currentPowerup = '';
this.currentPowerupAlpha = 1;
}
draw(context) {
this.y += this.moveY;
... | true |
4fdb15bc8b1811c377d3b3b82080e0048dfa6e31 | JavaScript | jvbbott/porpoise | /photos_data.js | UTF-8 | 1,292 | 3 | 3 | [
"MIT"
] | permissive | var photo_data = require('./db/photos.json');
var photo_arr = photo_data.photos;
var round_funcs = require('./rounds_data.js');
exports.get_photo = function(photo_id) {
console.log(photo_data);
for (var i=0; i<photo_arr.length; i++) {
if (photo_arr[i].id == photo_id) {
return photo_arr[i];
}
}
return null... | true |
6f7907e6aa049f72ed0304141e01a3749e80a2b3 | JavaScript | dwchung2/thesignsoftime | /server.js | UTF-8 | 1,503 | 2.53125 | 3 | [] | no_license | const http = require("http");
// load express and helper for post data
const express = require("express");
const bodyParser = require("body-parser");
const fs = require("fs");
const port = 8080;
const ip = "localhost"
const app = express();
// load existing json file
const messages = require("./messages.json");
con... | true |
a332d6e6eb8bb135dfac84b03aafa145af7bf784 | JavaScript | Zinchenkoipad/React-Redux-Route | /Components/Users.js | UTF-8 | 762 | 2.6875 | 3 | [] | no_license | import React from 'react';
class Users extends React.Component{
constructor(){
super()
this.state={
users:[]
}
}
componentDidMount(){
var users=[];
for(var i=1;i<10;i++){
users.push(
<img key={'women'+i} className='m-1 rounded' src={'https://randomuser.me/api/portraits/wo... | true |
f8898159cd6d705edee9b56b8d1a20a9dff71bc4 | JavaScript | hotoo/markline | /timeline.js | UTF-8 | 5,674 | 2.78125 | 3 | [
"MIT"
] | permissive |
var $ = require("jquery");
var offset_left = 30; // offset left for group name.
var offset_top = 20; // offset top for date header.
var year_width = 100; // width per date (year).
function Markline (element, data) {
this._element = $(element);
this.title = data.title || "";
this.meta = data.meta || {};
this... | true |
416fa1178e94c4a84d77e0d329639b65cb034ee2 | JavaScript | EmmanoelCoutinho/profile-picker | /src/components/App.js | UTF-8 | 1,477 | 2.640625 | 3 | [] | no_license | import React, { useState } from 'react';
import { Link } from 'react-router-dom'
//styled components
//import { AppSC } from '../styles/AppSC';
//importing styles
import '../styles/main.css'
import '../styles/App.css';
import logo from '../styles/assets/logo.png';
//use redux to take the input.value
import { useSele... | true |
c409b1e4c0ee3de33c0def54c13dfc03af83702b | JavaScript | c-afanasyev/reactjs_codeacademy | /src/2_jsxAdvanced/pi/app.js | UTF-8 | 430 | 3.375 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
// Write code here:
let math =<h1>2 + 3 = 2 + 3</h1>;
ReactDOM.render(math, document.getElementById('app'));
// use curly brackets {} to inject JS
let math =<h1>2 + 3 = {2 + 3}</h1>;
ReactDOM.render(math, document.getElementById('app'));
const theBestStr... | true |
4f5fba2a0fc9d7bc90014f40acb469023ccece9f | JavaScript | Youjingyu/vue-hap-tools | /utils/logger.js | UTF-8 | 729 | 2.765625 | 3 | [] | no_license | const chalk = require('chalk')
let currentFile = ''
const log = console.log
module.exports = {
info (msg, position) {
log(chalk.green(formatMsg('INFO', msg, position)))
},
warn (msg, position) {
log(chalk.rgb(255, 250, 120).bold(formatMsg('WARN', msg, position)))
},
error (msg, position) {
log(c... | true |
784d11c8aacd19560869e8f4c06ff4cc925c5abf | JavaScript | steven-hedrick/stevenhedrick.github.io | /HTMLCSSPreWork/JavaScript - Library/JavaScript-Basics/05-conditionals.js | UTF-8 | 377 | 3.703125 | 4 | [] | no_license | //1
var isOn = true;
//2 //3
if(isdOn == true) {
console.log("The light is on."); //4
}
var isOn = true;
//1
if(isOn) { // same as if (isOn === true)
console.log("The light is on. It's bright.");
}
war weather = 75;
if(weather > 70{
console.log(Wear shorts today! It's going to be hot! It going to b... | true |
1fdde46e4597faaaed91577a27f2d7a6ed384397 | JavaScript | josegerstner/arena-tp-pokemon-algo3 | /src/main/webapp/js/app/services/EntrenadorService.js | UTF-8 | 2,252 | 2.65625 | 3 | [
"MIT"
] | permissive | class EntrenadorService{
constructor($http){
this.$http = $http
}
findEntrenador(callback){
this.$http.get('http://localhost:9000/entrenador/logeado').then(callback)
}
getUbicacion(callback){
this.$http.get('http://localhost:9000/entrenador/ubicacion').then(callback)
... | true |
b5452faa2748da930f95a436d785a6c420cbf72f | JavaScript | rabinniroula/NepCalConv | /src/bsToAd.js | UTF-8 | 908 | 2.6875 | 3 | [] | no_license | const { bsData, adStart, bsStart } = require('./data')
const { getday } = require('./helper')
function bsToAd(year, month, day) {
let daysDiff = 0
// Calculate the days difference from the start of 1978 to the current Bikram Sambat
let i = 0
for (i; i < year - 1978; i++) daysDiff += bsData... | true |
a32ed5055e6575dbeb10961940426ddc88c7e495 | JavaScript | ranggaardi/text-input-and-picker-react-native | /App.js | UTF-8 | 2,347 | 3 | 3 | [] | no_license | import React from 'react';
import { StyleSheet, Text, View, Button, TextInput, TouchableOpacity, Picker } from 'react-native';
//2. Create
class App extends React.Component {
state ={
text : '',
done : 'OnProgress',
todo : [] //menampung hasil input
}
tambahTodo = () => {
//ambil dari nilai in... | true |
19910bb63ca26461e43ff44eb43670fce53cba7a | JavaScript | Xaraxx/jsExerc | /clases_objects.js | UTF-8 | 212 | 3.859375 | 4 | [] | no_license | class Person {
constructor (name){
this.name = name
}
getName(){
return this.name
}
}
const person = new Person("Jorge")
let personName = person.getName()
console.log(personName) | true |
0635ca6930cd0a9fd135960167e1573e6155e3eb | JavaScript | JjGesulgon/pirple-course-requirements | /keeping-up-with-the-javascripts-es6/homework-assignments/08-events/events.js | UTF-8 | 1,494 | 3.6875 | 4 | [] | no_license | const gameBoard = document.getElementById("game-board");
const boxCollection = gameBoard.querySelectorAll("span");
const winConditions = [[0,1,2], [3,4,5], [6,7,8], [0,3,6], [1,4,7], [2,5,8], [0,4,8], [2,4,6]];
let oMarked = true;
const gridArray = [];
for(const box of boxCollection){
box.addEventListener("click", ... | true |
9f73f68f51cf68cfe51f01ffa0a5024f8308d3bf | JavaScript | saraheulie/A2SarahEulie.appstudio | /forms/ifElse/ifElse.js | UTF-8 | 974 | 3.8125 | 4 | [] | no_license | //set variables
let name = ""
name = prompt("Enter your name.")
let state = ""
state = prompt("Enter the capitalized abbreviation of your state.")
let temp = ""
temp = prompt("Enter the current temperature.")
let message = ["Wear a warm coat, hat, scarf and gloves",
"Wear a warm coat but you won't need a hat, sc... | true |
ea4a84aec5723392d417961a7b8d761a35ba81f3 | JavaScript | jinchi2013/node-js-practical-pattern | /II-Stream-Pattern/2-time-efficiency/gzipReceive.js | UTF-8 | 593 | 2.703125 | 3 | [] | no_license | "use strict";
const http = require('http');
const fs = require('fs');
const zlib = require('zlib');
let server = http.createServer((req, res)=>{
let filename = req.headers.filename;
console.log(`File request received ${filename}`);
req.pipe(zlib.createGunzip())
.pipe(fs.createWriteStream(filename... | true |
fc73f9a10df5d4428484f9127a8583efd5d907df | JavaScript | coderiderlin/towersummary | /TowerSummary.js | UTF-8 | 4,530 | 2.546875 | 3 | [] | no_license | function init()
{
console.log('-- TowerSummary 1.0 --');
$(".todolist-toolbar").prepend("<div class='btn btn-mini btn-summary'>清单</div>")
$(".btn-summary").click(genSummary)
}
function genSummary()
{
//clean
$("#rbstyle").remove()
$(".rbcontext").remove()
//inject style
$("head").prepend('<sty... | true |
35b6daa624c2b8512ea163ed78017b173f4452f0 | JavaScript | phillipsun/shelfie | /server/controller.js | UTF-8 | 1,914 | 2.671875 | 3 | [] | no_license | module.exports = {
// CREATE PRODUCT
createProduct: (req, res) => {
console.log('Got POST request!')
const db = req.app.get('db')
const { product_name, product_imgurl, product_price } = req.body
console.log(req.body)
db.create_product([ product_name, product_imgurl, product_price ])
.th... | true |
f4f9bb3016ad475185ae4d1e243661b55f22cb65 | JavaScript | andrehigher/ac-parking-front | /src/reducers/garage.js | UTF-8 | 987 | 2.53125 | 3 | [] | no_license | import {
REQUEST_CURRENT_WEEK,
RECEIVE_CURRENT_WEEK,
REQUEST_NEXT_WEEK,
RECEIVE_NEXT_WEEK,
} from '../constants/garage';
const INITIAL_STATE = {
isFetching: false,
spots: [],
to: null,
from: null,
};
const garage = (state = INITIAL_STATE, action) => {
switch (action.type) {
case REQUEST_CURRENT_... | true |
b8e91c4e5e0510c2ccff17e5c7ab0ad7fb4650a0 | JavaScript | JaredHunterTafe/ServiceNSWLesson4 | /FunctionsExercises.js | UTF-8 | 1,238 | 4.4375 | 4 | [] | no_license |
// // Q1 Create a function that takes 3 parameters called floor, ceiling and num. All 3 parameters should be numbers. Return true if num is between floor and ceiling. Otherwise return false
// function findMiddle (floor, ceiling, num){
// if (floor > num && ceiling < num) {
// return true}
// else {
// retu... | true |
ec06fb8bc1372654f73710a711b4f38a11faeb0b | JavaScript | j-w0ng/break_tracker | /background.js | UTF-8 | 1,805 | 2.859375 | 3 | [] | no_license | var clicks = 0;
var extensionStatus = false;
var onBreak = true;
chrome.runtime.onMessage.addListener(function updateClicks(msg, sender, sendResponse) {
console.log(msg.message);
console.log(clicks);
if (msg.message === "updateCounter")
{
clicks += 1;
}
}
);
ch... | true |
d50ee4e90ef62172e839f04ef49b950a7203c6fe | JavaScript | mijoda/App-Inventor-Gallery | /frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Gui.js | UTF-8 | 14,898 | 2.515625 | 3 | [] | no_license | /**
* Copyright (c) 2011 Derrell Lipman
*
* License:
* LGPL: http://www.gnu.org/licenses/lgpl.html
* EPL : http://www.eclipse.org/org/documents/epl-v10.php
*/
/**
* The graphical user interface for the individual application pages
*/
qx.Class.define("aiagallery.module.dgallery.appinfo.Gui",
{
type : "s... | true |
77a3c19d23201dc0511e275b2dd5e9c9a093e722 | JavaScript | mfrye/challenge | /app/main/main_controller.js | UTF-8 | 3,069 | 2.671875 | 3 | [] | no_license | (function(){
'use strict';
angular.module('challenge-main',['ngRoute'])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'main/main.html',
controller: 'MainCtrl'
});
})
.controller('MainCtrl', function ($scope, $famous, $timeout) {... | true |
d4ea9aa00e4f49ce271500d7b5a2af92a02610d4 | JavaScript | smith713/learn-javascript | /myapp.js | UTF-8 | 7,440 | 3.9375 | 4 | [] | no_license | // Console.log
/*
console.log("Hello World");
console.log(200);
console.log(true);
console.log(null);
var num = 50;
console.log(num);
console.log("string", 10.11, true, false, null, num);
*/
// Functions
/*
function makeCoffee(sugar, milk) {
var instructions = "Boil water,";
instructions += "pour into cup,";
i... | true |
aeade71110d0b5cf347d0b15886da81acb1845d3 | JavaScript | thsvr/Microverse-602-TicTacToe | /public/js/index.js | UTF-8 | 2,938 | 3.34375 | 3 | [] | no_license | const cells = document.getElementsByClassName('cell');
const scores = document.getElementsByClassName('player-score');
const namesDisplay = document.querySelectorAll('.name');
const message = document.querySelector('.msg');
const print = (element) => {
const domElement = element;
element.addEventListener('click', ... | true |
19ff2b195ff97e2ef91e6612782e3098c4b14909 | JavaScript | udaramadhushan/dashboard-bootstrap | /index.js | UTF-8 | 1,911 | 2.65625 | 3 | [] | no_license |
$(document).ready(function(){
$searchbar = $("#search-bar");
$titles = $('.title');
$.getJSON("icon_data.json",function( json ) {
fillIcons('.student-services',json.studentServices)
fillIcons('.staff-services',json.staffServices)
fillIcons('.account-management',json.accountManagement)
... | true |
3594fa6538229a1ba5d62ee68aaedc4d2669906a | JavaScript | terrierscript/chunkwhat | /test/index.js | UTF-8 | 6,745 | 2.59375 | 3 | [] | no_license | var chunkwhat = require("../index.js")
var parser = require("CSSwhat")
var assert = require("assert")
describe("string", function(){
var assertion = function(selector, expect){
var result = chunkwhat(selector)
//console.log(require("util").inspect(result, {depth:null}))
result.forEach(function(subSelector... | true |
97f83bfddc359776a757c0ba3e311e5e25b0b851 | JavaScript | wogh002/carrot | /src/field.js | UTF-8 | 2,542 | 3.34375 | 3 | [] | no_license | 'use strict';
import * as sound from './sound.js';
export const ItemType = Object.freeze({
carrot: 'carrot',
bug: 'bug'
});
const CARROT_SIZE = 80;
export class Field {
constructor(carrotCount, bugCount) {
//this={}
this.carrotCount = carrotCount;
this.bugCount = bugCount;
th... | true |
80b5b837ed5800a2a729d5cf2220e18e37440e30 | JavaScript | AndrzejKunicki/react-hw-02-feedback | /src/components/Feedback/Feedback.js | UTF-8 | 1,909 | 2.671875 | 3 | [] | no_license | import React, { Component } from "react";
import Statistics from "./Statistics";
import FeedbackOptions from "./FeedbackOptions";
import Section from "./Section";
import Notification from "./Notification";
class Feedback extends Component {
state = {
good: 0,
neutral: 0,
bad: 0,
};
incr... | true |
efd89355b1f1145018a843b39610af6112b4b0d2 | JavaScript | acheinu1/JSON-AJAX-call | /assets/js/app.js | UTF-8 | 999 | 3.84375 | 4 | [] | no_license |
var button = document.getElementById("btn")
var display = document.getElementById("animal-info")
var pageCounter = 1
// we made the var pageCounter so we could increment the url animals-1.json
button.addEventListener ("click", function (){
var ourRequest = new XMLHttpRequest();
//XMLHttpRequest(); lives in the b... | true |
f698e02cc8b1a5c30765e72d02b685f824057595 | JavaScript | senyboy10/TODO-LIST-APP | /asset/js/main.js | UTF-8 | 991 | 3.15625 | 3 | [] | no_license | //checked specific todos by clicking
$("ul").on("click","li", function(){
$(this).toggleClass("completed");
});
//click x to delete todos
$("ul").on("click","span", function(event){
$(this).parent().fadeOut(500, function(){
$(this).remove();
});
event.stopPropagtion();// this will ensure the fadeout
... | true |
6f956b6fc3c9fa7f56a6e9ef3cd28d1f744b3dfe | JavaScript | Danielortizz/TFG-Daniel-Ortiz-Jimenez- | /SpanishArmy/js/validacion.js | UTF-8 | 12,910 | 3.4375 | 3 | [] | no_license | /*aqui llamamos a todos los id del html y los guardamos en una constante*/
const usuario = document.getElementById('usuario');
const password = document.getElementById('password');
const nombre = document.getElementById('nombre');
const apellido1 = document.getElementById('apellido1');
const apellido2 = document.g... | true |
61e33fd52b09eff393214b058e2da64b17a022c2 | JavaScript | RodiLop/tracking-doc | /src/pages/RegisterPage.js | UTF-8 | 1,431 | 2.59375 | 3 | [] | no_license | import React, { Component } from 'react'
import '../App.css'
import fire from '../config/fire'
import RegisterForm from '../components/RegisterForm'
class RegisterPage extends Component {
constructor (props) {
super(props);
this.state = {
email: "",
password: "",
... | true |
0a6e5686edeb2986d6c4827ca09e793059e49c8d | JavaScript | TheThirdOne/gold-rush | /src/http.js | UTF-8 | 13,456 | 2.8125 | 3 | [
"MIT"
] | permissive | /**
* Copyright (c) 2013 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found a thttps://github.com/GoogleChrome/chrome-app-samples/blob/master/LICENSE.
**/
var http = function() {
var socket = (chrome.experimental && chrome.experimental.s... | true |
751b8c06f2aa31a1c982e8d025c1afe1a4e19e5b | JavaScript | vsprog/fs_frontend | /packages/search-field/search-field.jsx | UTF-8 | 2,690 | 2.59375 | 3 | [] | no_license | const React = require('react');
const PropTypes = require('prop-types');
const { apiKey, page } = require('core/constants.js').omdbapi;
const propTypes = {
findMovie: PropTypes.func.isRequired,
loadingProcess: PropTypes.func.isRequired,
};
class SearchField extends React.Component {
constructor(props) {
sup... | true |