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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1e674307565bea0ce37489d883023e3815234545 | JavaScript | amayro/g_js1 | /hw_04/script_3.js | UTF-8 | 6,332 | 3.75 | 4 | [] | no_license | "use strict";
//3**. Реализовать игру «Кто хочет стать миллионером?».
// Т.е. у вас должен быть главный объект содержащий всю логику игры, который будет иметь
// методы, например метод run, возможно метод init и т.д.
// В игре должны быть заранее подготовлены список вопросов и ответов (как минимум 5 вопросов).
// Игра... | true |
fcc3c89c99170196068ec3105f725005bff880b0 | JavaScript | pelias/openstreetmap | /stream/document_constructor.js | UTF-8 | 2,142 | 2.625 | 3 | [
"MIT"
] | permissive |
/**
The document constructor is responsible for mapping input data from the parser
in to model.Document() objects which the rest of the pipeline expect to consume.
**/
const through = require('through2');
const Document = require('pelias-model').Document;
const peliasLogger = require( 'pelias-logger' ).get( 'open... | true |
22b7892553af23687489717d4c198d04d6249cf5 | JavaScript | sedc-codecademy/sedc7-04-ajs | /g2/Class3/Exercise/Bootstrap/script.js | UTF-8 | 2,583 | 3.453125 | 3 | [
"MIT"
] | permissive | $(document).ready(()=>{
let countryInput = document.getElementById("countryInput");
let getDataBtn = document.getElementById("getData");
let table = document.getElementById("table");
let message = document.getElementById("message");
function populateTable(table, response){
console.log(table);
table.s... | true |
2f69379cf0a61699e627527596eceb907e81534b | JavaScript | shuaiyongyong/hbsyqzjx | /syqzjx/src/main/webapp/js_en/index_en.js | UTF-8 | 896 | 2.734375 | 3 | [] | no_license | // JavaScript Document
window.onload =function () {
var dome=document.getElementById("dom");
var dome1=document.getElementById("dom1");
var dome2=document.getElementById("dom2");
var speed=20; //设置向左滚动速度
dome2.innerHTML=dome1.innerHTML; //复制dome1为dome2
function moveLeft(){
if(dome2.offsetLeft<=dome.scrollLef... | true |
bc5143ce4b9c56fb5b03afe67bd498ee08b9bdd2 | JavaScript | twandylue/AppWorksSchoolWorking | /00_side_project/util/util.js | UTF-8 | 805 | 2.640625 | 3 | [] | no_license | const { TOKEN_SECRET } = process.env; // 30 days by seconds
const jwt = require("jsonwebtoken");
const authentication = () => {
return async function (req, res, next) {
let accessToken = req.get("Authorization");
if (!accessToken) {
res.status(401).send({ error: "Unauthorized" });
... | true |
a0194f76c120c80cee7b44f22c0eefcf8f63003b | JavaScript | RealVansh42069boifakelol/math_quiz-3 | /GAMEplay.js | UTF-8 | 673 | 2.78125 | 3 | [] | no_license | console.log("test");
function Send()
{
var number1 = document.getElementById("number1").value;
var number2 = document.getElementById("number2").value;
var actualAnsMulti = parseInt(number1)*parseInt(number2);
questionNumber = "<h4>"+number1+" x "+number2+"<h4>";
inputBox = "<br>Answe... | true |
fdd30b8da826110e087f70b16b0cd1c5599ca207 | JavaScript | Yujei-Chou/Medicine_Notification | /dist/js/setTime.js | UTF-8 | 1,033 | 2.5625 | 3 | [] | no_license | function clock() {
new Rolldate({
el: '#hour',
lang: {
title: '選擇時間',
cancel: 'Cancel',
confirm: 'Confirm',
hour: '時'
},
value: '',
format: 'hh'
})
new Rolldate({
el: '#min',
lang: {
titl... | true |
4b017a836e62d24159f4b28c11ac793164eee2a9 | JavaScript | maxran/mogujie | /js/mgj_userLogin.js | UTF-8 | 116 | 2.828125 | 3 | [] | no_license | //点击<返回上个页面
var p = document.querySelectorAll('p')[0];
p.onclick = function(){
history.back();
} | true |
a05053e5d31f946da15471c15c29091d922387ea | JavaScript | dan-dr/react-fittext | /src/FitText.js | UTF-8 | 2,450 | 2.84375 | 3 | [
"MIT"
] | permissive | /*
* React FitText v0.2.0
* https://github.com/kennethormandy/react-fittext
* Kenneth Ormandy
*
* A rewrite of https://github.com/gianu/react-fittext (MIT)
* …which is based on the FitText jQuery plugin
* http://github.com/davatron5000/FitText.js
*
*/
import React from 'react'
import PropTypes from 'prop-typ... | true |
67cf0666470265cd9f02bac54ba0cc7165bc7faf | JavaScript | shuaiadong/debounce-save | /_demo/appStore.js | UTF-8 | 1,853 | 2.59375 | 3 | [
"MIT"
] | permissive | import {observable, action, reaction} from 'mobx'
import autoSave from 'debounce-save'
import axios from 'axios'
import moment from 'moment'
function save () {
return new Promise((res, rej) => {
setTimeout(()=> {
res({status: 200})
}, 1000)
})
}
export default class Sto... | true |
2e9eb45168b52d747b0ef201b24120ec6d89ca2b | JavaScript | IvanMigov/image_search | /src/components/search/reducer.js | UTF-8 | 605 | 2.59375 | 3 | [] | no_license | import * as ActionTypes from "./constants";
const initialState = {
queryString: '',
images: null,
error: null
};
export default function(state = initialState, action) {
const { type, data } = action;
switch (type) {
case ActionTypes.SET_IMAGE_REQUEST_STR:
return {
...state,
... | true |
ec563b6173db73e1431177bc8b4efc62f3eea6ea | JavaScript | anton-lytvyniuk/socket-test-task | /public/javascripts/main.js | UTF-8 | 599 | 2.703125 | 3 | [] | no_license | $(document).ready(function() {
$('#add-new-room').on('click', () => {
const room = $('#new-room').val();
if (!room) return window.alert('Please enter room name');
$.post({
url: '/rooms',
dataType: 'json',
contentType: 'application/json',
d... | true |
9706eeeb539150e2228525523771f28d770da0f7 | JavaScript | BO-HAI/ad-txt | /src/js/drawImage.js | UTF-8 | 5,754 | 2.609375 | 3 | [] | no_license | class DrawImage {
constructor (id, width, height, data, illustrationData, imgSizeIndex, validateFn) {
this.id = id;
this.$canvas = $(id);
this.canvas = this.$canvas[0],
this.context = this.canvas.getContext('2d');
this.width = width; // 不带单位
this.height = height; // 不... | true |
69fd147225c6cc8dde9987dfbbdc213c3ffad0bc | JavaScript | omarbranez/react-components-as-routes | /src/index.js | UTF-8 | 2,597 | 2.671875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom'; // dont forget to add NavLink!
import Home from "./Home"
import About from "./About"
import Login from "./Login"
import Navbar from './Navbar'
// const Home = () => {
// return (... | true |
66edf0e9f1eeed3d7021cf3e62f6a28b785b460d | JavaScript | itprogrammer2/ignition | /api/models/users.js | UTF-8 | 1,004 | 2.640625 | 3 | [] | no_license | var db = require('../db.js')
exports.create = function(username, password, done) {
//var values = [username, text, new Date().toISOString()]
var values = [username, password]
db.get(db.WRITE, function(err, connection){
if(err) return done('Database problem');
connection.query('INSERT INTO accounts (us... | true |
d82e23b26891721675c0ebb02c243599608e5cad | JavaScript | Ljuelch/Udemy | /udemy/Document Object Model I/Die style-Eingenschaft/main.js | UTF-8 | 445 | 3.265625 | 3 | [] | no_license | "use strict";
let jumbo = document.querySelector(".jumbotron");
// CSS_Style-Declaration-Objekt ausgeben
console.log(jumbo.style);
//Inline-Styles auslesen
console.log(jumbo.style.backgroundColor); // Eigenschaft abfragen
// Inline-Stles verändern
// Eigenschaften immer in Strings angeben
jumbo.style.backgroundColo... | true |
3f3a3c6b841bd639cf2cef33209d2f55e9df6bbc | JavaScript | y920075/AQUA | /client/src/components/class/SellerClassComponents/EditClassDataContent.js | UTF-8 | 15,860 | 2.625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import SweetAlert from './Sweetalert2'
/*
傳入參數
classId = 課程編號
SellerClassDetailData = 課程詳細資料(包含教練資訊及報名者資料)
cityData = 全台城市資料
distData = 依據選擇的城市得到相對應地區資料
typeData = 類型資料
levelData = 依據選擇的類型得到相對應等級資料
editClassDataResponse = 編輯資料之後,後端傳送過來的... | true |
29a310db44535bdad3c0f34d13483407d7d5e208 | JavaScript | SanjayDookhoo/Teleois-Code-Jam-2015-DregHIS | /test/controllers.js | UTF-8 | 4,310 | 2.640625 | 3 | [] | no_license | app.controller('MainCtrl', ['$scope', function($scope){
$scope.hello = 'HELLOWORLD';
}])
.controller('LogInCtrl', ['$scope', function($scope){
$scope.hello = 'HELLOWORLD';
$scope.user = {
email: "",
password: ""
};
var myData = new Firebase("https://codejam.firebaseio.com/");
$sc... | true |
43e3c11d461fdd238717710f46eef69cbc53f589 | JavaScript | kellydinneen/rancid-tomatillos | /cypress/integration/dashboard-spec.js | UTF-8 | 4,659 | 2.515625 | 3 | [] | no_license | describe('Dashboard UI', () => {
beforeEach(() => {
cy.fixture('testMovies.json')
.then((testMovies) => {cy.intercept('GET', 'https://rancid-tomatillos.herokuapp.com/api/v2/movies', {
statusCode: 200,
body: testMovies
})})
cy.fixture('testMovies.json')
.then((testMovie) => {c... | true |
a1db40ba2f5beaa26fd4fe04906c2bfb0006189a | JavaScript | Rococo448/Rococo | /createuser.js | UTF-8 | 2,112 | 2.796875 | 3 | [] | no_license | //Initializing Firebase
var config = {
apiKey: "AIzaSyBYFOuocBhI3ZMa34HTQQ3OG5iDfItdSS4",
authDomain: "mywebapp-7bc86.firebaseapp.com",
databaseURL: "https://mywebapp-7bc86.firebaseio.com",
projectId: "mywebapp-7bc86",
storageBucket: "mywebapp-7bc86.appspot.com",
messagingSenderId: "8589616542... | true |
f814baaca450d321c384894f628d4857a45803df | JavaScript | daouloccol88/react-todo-list | /src/components/Timer.js | UTF-8 | 2,334 | 2.90625 | 3 | [] | no_license | import React, { Component } from 'react';
export default class Timer extends Component {
constructor(props) {
super(props);
this.state = {
timerStarted: false,
timerStopped: true,
hours: 0,
minutes: 0,
seconds: 0,
}
}
hand... | true |
ec974c95299394b9575d881396d01c938db0109c | JavaScript | Otmak/chatX | /app/public/index.js | UTF-8 | 818 | 3.203125 | 3 | [] | no_license | let socket = io();
let form = document.getElementById('m-form');
let textInfo = document.getElementById('textInfo');
let textBody = document.getElementById('textBody');
//Defining Time
let d = new Date();
let h = d.getHours();
let m = d.getMinutes();
let s = d.getSeconds()
let timeStamp = `${h}:${m}`;
form.addEventLis... | true |
574762f414cd16c96af3cbde6b0f0f396a933187 | JavaScript | mullaned/react-init | /src/components/Persons/Person/Person.js | UTF-8 | 1,133 | 2.515625 | 3 | [] | no_license | import React, {Component} from "react";
import classes from './Person.css';
import Aux from '../../../hoc/Auxilary';
import PropTypes from 'prop-types'
import AuthContext from '../../../context/auth-context'
class Person extends Component{
constructor(props) {
super(props);
this.inputElementRef = React.crea... | true |
7e17cbc3f10fa22963cf1545ff199f452dbeda0f | JavaScript | aliEssoudani/warmUp | /warmUp10/warmUp-10.js | UTF-8 | 1,283 | 4.40625 | 4 | [] | no_license | // 1-Write a function that takes a string as an input and returns the reverse of each letter
//followed by a number starting from zero(solve it using while loop).
// example: reverseStr('hello'); "o1l2l3e4h"
// this function will reverse the string first , than put the reverse splited one on an array, than i... | true |
6f3fa9f95dd193e5828489fa575ddc0190952551 | JavaScript | FrauHausschuh/extension | /src/main/js/app/extension/CahootsStorage.js | UTF-8 | 4,837 | 2.875 | 3 | [
"MIT"
] | permissive | /**
* cahoots extension
*
* Copyright Cahoots.pw
* MIT Licensed
*
*/
(function () {
'use strict';
var getCurrentTimestamp = function () {
return Math.floor(Date.now() / 1000);
};
var CahootsStorage = function (storageObject, providerMerger, configService) {
if (arguments.length <... | true |
4150762148594ff0d4c84bb0ae3c2827b75b36c5 | JavaScript | thetrung2411/bluedit-project | /project-function/functions/handlers/posts.js | UTF-8 | 8,571 | 2.796875 | 3 | [] | no_license | const { db } = require("../util/admin");
//Post a new post
exports.post = (req, res) => {
//check if the post body is emty or not
if (req.body.body.trim() === "") {
return res.status(400).json({ body: "Post cannot be empty" });
}
//Prepare the information contained in the post
const newPost = {
body:... | true |
c7a5dbe9a449095674729ce4c9981e5487623edf | JavaScript | nevetsmik/problems | /temperature-tracker/TempTracker.js | UTF-8 | 1,024 | 3.8125 | 4 | [] | no_license | /*
Design a solution that keeps track of average, mode, max and min temps. O(1)
time for max, min, mode and average.
*/
const TempTracker = function() {
this.tempSum = 0;
this.countTemps = 0;
this.max = null;
this.min = null;
this.mode = null;
this.temps = [];
};
TempTracker.prototype.insert = function(te... | true |
728da6cd0631351e18576827c03f2f7786e6aaa0 | JavaScript | AntonioBarrios/fizzbuz | /fizzbuzz.js | UTF-8 | 198 | 3.671875 | 4 | [] | no_license | //Resolviendo FizzBuz
for(let i=1; i<=100; i++){
let resultado= '';
if (i % 3 == 0){
resultado+= 'Fizz';
}
if( i % 5 == 0){
resultado+= 'Buzz';
}
console.log(resultado || i);
}
| true |
cfa962bee29327d693eccb4c00807e0a1ac5d721 | JavaScript | shuyancang/FE_learnings | /javascript/es5/array.js | UTF-8 | 220 | 2.53125 | 3 | [] | no_license | 'use strict';
// 数组的方法: indexOf ,lastIndexOf, forEach, some, every, map, filter等常用方法. reduce;
Array.isArray();
// Array.isArray('no u'); Array.isArray([1, 2, 3]) 判断是否数组
// TypedArray: | true |
a29b10494c121b091b0b56e8873496a2dc8306bc | JavaScript | Always-beginner/Vanila-javascript-postMaster-clone- | /vanila javascript/postman Api/main.js | UTF-8 | 3,860 | 2.84375 | 3 | [] | no_license | // creation postman clone api
let paraBox = document.getElementById('parametersBox')
paraBox.style.display = 'none';
let parametersBox = document.getElementById('paramsRadio');
let jsonBox = document.getElementById('jsonRadio')
parametersBox.addEventListener('click', () => {
document.getElementById('requestJson... | true |
0c3db47d58cf31c444880054f10f2b7e39679d7c | JavaScript | AlexLMiddleton/MARKET-READY.IO | /src/components/lighthouseAudit.js | UTF-8 | 902 | 2.796875 | 3 | [
"MIT"
] | permissive | // import lighthouse from 'lighthouse'
// import chromeLauncher from 'chrome-launcher'
// function launchChromeAndRunLighthouse(url, opts, config = null) {
// return chromeLauncher.launch({chromeFlags: opts.chromeFlags}).then(chrome => {
// opts.port = chrome.port;
// return lighthouse(url, opts, config).the... | true |
02f2f31d6516b45ed7cfbf9743687f17461e2fc7 | JavaScript | hgoodman/yahoo-pre-draft | /spec/pdr_players_spec.js | UTF-8 | 3,837 | 2.90625 | 3 | [
"MIT"
] | permissive |
var PDRPlayers = require('../extension/pdr_players.js');
describe('PDRPlayers', function () {
describe('namesMatch()', function () {
it('will match the same name to itself', function () {
var name = 'Clayton Kershaw';
expect(PDRPlayers.namesMatch(name, name)).toBe(true);
expect(PDRPlayers.name... | true |
5bd08ded494313d0e60acefab35124d67efe9b28 | JavaScript | GitHubJian/study | /KOA/dependence/koa-convert.js | UTF-8 | 1,436 | 2.609375 | 3 | [] | no_license | 'use strict';
const co = require('co');
const compose = require('koa-compose');
function convert(mw) {
if (typeof mw !== 'function')
throw new TypeError('middleware must be a function');
if (mw.constructor.name !== 'GeneratorFunction') {
return mw;
}
const converted = function(ctx, nex... | true |
43feeb6b204282dca316f782d3f86953e2b7ac62 | JavaScript | decadentka/decadentka.github.io | /cart/js/scripts.js | UTF-8 | 1,022 | 2.671875 | 3 | [
"MIT"
] | permissive | $(function(){
$('ul.cart__companies__tabs').on('click', 'li:not(.active)', function() {
$(this)
.addClass('active').siblings().removeClass('active')
.closest('section.cart__companies').find('div.cart__companies__list__wrapper').removeClass('active').eq($(this).index()).addClass('active');
});... | true |
738e2425330555c877b86924fa0dc9d5e71c71ea | JavaScript | prestonalexwebster/pure-js | /src/components/todo/todo.js | UTF-8 | 2,186 | 3.109375 | 3 | [] | no_license |
const styleContext = {
todo: 'todo',
text: 'text',
button: 'button',
primary: 'primary',
danger: 'danger'
};
function getElementByRef(parent, refName){
return parent.querySelector(`[data-ref=${refName}]`);
}
function template(d){
return (
`<div class="${styleContext.todo}">
<p... | true |
657d2931f6c51716709b5f487285ffe812665ad8 | JavaScript | wangyouzhan/typescript | /angularjs/HelloAngular_Directive.js | UTF-8 | 885 | 2.703125 | 3 | [] | no_license | /**
* Created by wangyouzhan on 2016/12/24.
*/
var helloModule = angular.module('bookapp',['CommonController','Controller2','Controller1']);
helloModule.controller('helloNgCtrl',[
'$scope',function ($scope) {
$scope.greeting = {
text: 'Hello'
};
}
]);
// var myModule = angular... | true |
0ada61a21a17af859572be7efe6d6f601ad88a79 | JavaScript | madimov/Grass-Roots-Game | /simulations-prototype/PowerBasis/Coercion.js | UTF-8 | 1,147 | 2.828125 | 3 | [] | no_license | 'use strict';
const PowerBasis = require('./PowerBasis');
// https://en.wikipedia.org/wiki/French_and_Raven%27s_bases_of_power
/* Coercive power uses the threat of force to gain compliance from another.
Force may include physical, social, emotional, political, or economic means.
Coercion is not always recognized by ... | true |
b75bb43e5ce9eb17630958b7d8185b1f5f0b94a8 | JavaScript | SpiderWacho/etch_a_sketch | /script.js | UTF-8 | 2,215 | 3.671875 | 4 | [] | no_license | const boardHolder = document.querySelector("#board")
function createBoard(size) {
for (let i = 0; i < size; i++){
for (let j = 0; j < size; j++) {
const newDiv = document.createElement("div");
newDiv.classList.add("boardDiv")
boardHolder.appendChild(newDiv);
}
}
boardTiles = document.q... | true |
2e47a9e31c484b05b89327d01c07bd15dc21144e | JavaScript | chenmianhan/React-counter | /src/Components/Counter/index.jsx | UTF-8 | 1,464 | 2.703125 | 3 | [] | no_license | import React from 'react';
const INCREASE="INCREASE";
const DECREASE="DECREASE"
class Counter extends React.Component {
constructor(props) {
super(props)
this.state = { number: 0 }
}
onClickAdd = () => {
this.setState((preState) => {
return {
number: preS... | true |
947bb812bba661d59e011b9b5d06a7eeba5e1ab5 | JavaScript | prwelber/cbt_react | /src/components/TraitQuestions/TraitQuestions.js | UTF-8 | 2,982 | 2.765625 | 3 | [] | no_license | import React from 'react';
import TraitQuestionHeader from './TraitQuestionHeader';
import TraitQuestionAnswers from './TraitQuestionAnswers';
var data = [
{
name: 'humility',
description: "True humility is to have a modest or even low view of one's own importance: manifestations of this include gratefulness... | true |
2b24ca21c8dcf5aa6a132b50c9950b6acac766b2 | JavaScript | codingdojo-pna-july-2019/Anam_assignments | /Alogs/week1/to_do1/whatdo_youknow.js | UTF-8 | 252 | 3.703125 | 4 | [] | no_license | //Your function will be given an input parameter incoming. Please console.log this value.
function you_know(incoming) {
sum = 0;
for (var i = 1; i < 20; i++) {
sum += i;
}
return sum;
}
console.log(you_know(40));
| true |
b8fbed531db66a12e78f406b2950e5c94b9fd9d5 | JavaScript | flynnwebdev/github-lms | /utils/auth.js | UTF-8 | 1,019 | 2.578125 | 3 | [] | no_license | const isAuthenticated = (req, res, next) => {
return req.isAuthenticated()
? next()
: res.status(403).send('Not authorised - Authentication');
}
const hasRole = (roles) => {
return (req, res, next) => {
isAuthenticated(req, res, () => {
const { role } = req.user;
if (!roles.includes(role)) ... | true |
9523acf4620ea6730d774b681eeac142a4a05f8b | JavaScript | ChenHzt/appleseed-fullstack-bootcamp | /exercises/js/2.3-circle-area/index.js | UTF-8 | 263 | 3.546875 | 4 | [] | no_license | function circleArea(radius) {
return radius ** 2 * Math.PI;
}
const r = 2;
console.log(`circle radius is: ${r}`);
const area = circleArea(r);
console.log(`circle area is: ${area}`);
console.log(`circle area rounded to two decimal places: ${area.toFixed(2)}`);
| true |
a4b26579697ed759fa694c99f87ed79c69ec0924 | JavaScript | Haydn0230/ToDoList | /frontend/src/classes/projectAdd.js | UTF-8 | 4,403 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
import { connect } from 'react-redux';
import { validation } from '../utils'
class ProjectAdd extends Component {
constructor() {
super()
this.state = {
projectTitle: '',
projectCompletionDate: '',
... | true |
afe5de5a02dfab5357aea9a48a426a83c7b19b62 | JavaScript | msharibahmed/anime-api | /Api/search.js | UTF-8 | 2,216 | 2.703125 | 3 | [] | no_license | //herokuUrl: https://anime-rest-api.herokuapp.com/
const express = require('express');
const router = express.Router();
router.get('/:keyword', async (req, res) => {
var keywordParam = req.params.keyword;
console.log(keywordParam);
try {
const puppeteer = require('puppeteer');
(async ... | true |
9569579a9593f280d40ba5e421eb1f4e593e9f3b | JavaScript | SDBoahen/022221-React-Welcome-To-The-Jungle | /src/lifecyclesInTheJungle.js | UTF-8 | 2,885 | 3.0625 | 3 | [] | no_license | import React from "react"
// class LifecyclesInTheJungle extends React.Component { render(){ return(<></>); }
// }
// export default LifecyclesInTheJungle
// !! // fog/fade
// mounting > update > unmounting
// creation > "updation" > deletion
// WITHOUT HOOKS - Only Clas... | true |
710353f8d8a0b3d6330804e355ff6affd774c555 | JavaScript | nhlong9697/codegym | /bootcampprep/week2/9.Conditional-Operator-2/exercise/practice-conditional-operator/part2.js | UTF-8 | 2,452 | 4.0625 | 4 | [] | no_license | function exercise1(celcius) {
let fahrenheit = (celcius * 9) / 5 + 32;
alert(fahrenheit);
}
function exercise2(meter) {
let feet = meter * 3.2808;
alert(feet);
}
function exercise3(side) {
let squareArea = side ^ 2;
alert(squareArea);
}
function exercise4(height, width) {
let rectangleArea = height * w... | true |
5e11a09e7c9c6ebf5dad9a51e7ace1d620b11cf9 | JavaScript | bsasscer/my-reads | /src/Book.js | UTF-8 | 2,380 | 2.609375 | 3 | [] | no_license | import React, { Component } from 'react'
import * as BooksAPI from './BooksAPI'
class Book extends Component {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
}
handleChange(e) {
this.props.updateShelf(this.props.book, e.target.value);
... | true |
375edd939e6b458b6b59bdba85265722daac9c16 | JavaScript | SabeelNasir/vue-chat-app | /client/src/store/auth.js | UTF-8 | 700 | 2.609375 | 3 | [] | no_license |
const state = {
count: 0,
token: localStorage.getItem('token'),
username: localStorage.getItem('username'),
userId: localStorage.getItem('userId')
}
const mutations = {
increment(state) {
state.count++
},
setToken(state, { token, userId, username }) {
state.token = token
... | true |
1af10e889c7e4d0b5219538fac1f52ee50efb41a | JavaScript | anlena/learn-javascript | /原生js/廖雪峰/2.函数/js/9.generator.js | UTF-8 | 616 | 4.375 | 4 | [] | no_license | // 要编写一个产生斐波那契数列的函数,可以这么写:
function fib(max) {
var
t,
a = 0,
b = 1,
arr = [0, 1];
while (arr.length < max) {
t = a + b;
a = b;
b = t;
arr.push(t);
}
return arr;
}
console.log(fib(20));
// 一次返回一个数
function* fib1(max){
var
t,... | true |
fb5dfa8fc39e5ee13c83f95d15c734c0d497ae37 | JavaScript | junseinagao/js-VendingMachine | /main.js | UTF-8 | 2,830 | 3.765625 | 4 | [] | no_license | const buttonTea = document.getElementById("button-tea");
const buttonCoke = document.getElementById("button-coke");
const displayLotTea = document.getElementById("lot-tea");
const displayLotCoke = document.getElementById("lot-coke");
const displayPriceTea = document.getElementById("price-tea");
const displayPriceCoke... | true |
db5cc348ad4e38dcf1052b4710a503c46596c6d8 | JavaScript | doctor-glitch/todo-mongodb-express-postman | /fs-sample.js | UTF-8 | 195 | 2.53125 | 3 | [] | no_license | const fs = require('fs');
console.log("started");
const data = fs.readFile('./sample.txt', (err, data) => {
if (err) throw err;
console.log(data.toString());
});
console.log("completed");
| true |
632e9746637f05243fd9d57cc8ac9f9779f0a442 | JavaScript | front-end-by-rimantas/17-grupe-js-intro | /js/bigNum.js | UTF-8 | 1,478 | 3.34375 | 3 | [] | no_license | "use strict";
function bigNum( list ) {
if ( !Array.isArray( list ) ) {
return 'ERROR: duotas ne sarasas';
}
if ( list.length < 1 ) {
return 'ERROR: tuscias sarasas';
}
let big = -Infinity,
size = list.length;
// randame kuris is atrinktuju yra didziausias
for ... | true |
a73637524bab9f74b8a1d47af10ef57ec680fa0b | JavaScript | Justin179/K3_AngularJSManagingClient | /app.js | UTF-8 | 577 | 2.546875 | 3 | [] | no_license | var express = require('express');
var app = express();
// tell express i will use ejs as my view engine (template engine)
app.set('view engine', 'ejs');
// setup static resource(empty files)
app.use('/assets', express.static(__dirname + '/public'));
var people = [
{name:'John Doe'},
{name:'Jane ... | true |
7daa233710e2069d6e2e16083a3243be8368b5d5 | JavaScript | gregor-gh/project-exercisetracker | /server.js | UTF-8 | 2,760 | 2.734375 | 3 | [] | no_license | const express = require('express');
const app = express();
const cors = require('cors');
require('dotenv').config();
const bodyParser = require("body-parser");
const urlencodedParser = bodyParser.urlencoded({ extended: false });
// cosmos db
const db = require("./db.js")
db.createDb(); // create if required
const use... | true |
7a3f44e1274d63628de155f5c333cd6cbe4ab7be | JavaScript | Morgantheplant/tincan | /src/views/SideNavView.js | UTF-8 | 3,262 | 2.640625 | 3 | [] | no_license | define(function(require, exports, module) {
var View = require('famous/core/View');
var Surface = require('famous/core/Surface');
var Transform = require('famous/core/Transform');
var StateModifier = require('famous/modifiers/StateModifier');
var EventHandler = require('famous/core/EventHandler');
var... | true |
e46b269df138791961db69b074fbcb1c7d4c3f53 | JavaScript | InesTlili/guestbook | /src/js/store/index.js | UTF-8 | 770 | 2.78125 | 3 | [] | no_license |
import { createStore } from "redux";
import rootReducer from "../reducers/index";
// load function for the state
export const loadState = () => {
try {
const serializedState = localStorage.getItem("state");
if (!serializedState) return undefined;
else return JSON.parse(serializedState);
} catch(err)... | true |
16a00b6469b60d761b5f0c881699405d2ab07143 | JavaScript | vilmosioo/Sky-Watch | /client/scripts/services/converter.js | UTF-8 | 2,269 | 2.78125 | 3 | [] | no_license | 'use strict';
angular.module('ngApp')
.factory('Converter', function ($rootScope, $timeout, Time) {
var converter = {
/**
* Given a set of objects, update the local coordinates every second
* @param items
*/
convertAll: function(items){
for (var i = items.length - 1; i >= 0; i--){
var localP... | true |
fb44aeeed3450697a3df001749694748e36a33a3 | JavaScript | nataliasabadysh/Flow-JavaScript | /examples/3.js | UTF-8 | 294 | 3.171875 | 3 | [] | no_license | /* @flow */
/**
* Автоматическое выведение типов можно ограничивать.
*/
const add = (operand1: number, operand2: number): number => {
return operand1 + operand2;
};
const result1 = add(3, 4);
const result2: string = add('hello ', 'world!');
| true |
69afbf1a2a338d84dca76a4b2a72415e78816dab | JavaScript | funduval/repl2 | /trie.js | UTF-8 | 2,891 | 3.359375 | 3 | [] | no_license | const fs = require('fs');
const { promisify } = require('util')
const readFileAsync = promisify(fs.readFile);
class Node {
constructor(){
this.children = new Map();
this.end = false;
this.setEnd = function() {
this.end = true;
};
this.isEnd = function() {
return this... | true |
26f58559067a639026ddab6c65694056504d6621 | JavaScript | whereareyo/whereareyo.github.io | /kintum/js/main.js | UTF-8 | 9,839 | 2.515625 | 3 | [] | no_license | $(document).ready(function() {
const londonTIme = new Date().toLocaleString("en-US", { timeZone: "America/New_York" })
const date = new Date(londonTIme)
const yesterdayTMS = date.setDate(date.getDate() - 1)
const yesterdayDate = new Date(yesterdayTMS)
const pricesbtc = (async () => {
... | true |
c87f6daa9eb9ecda23f03be456ca02c3945ed65e | JavaScript | xperiments/ts-embed | /dist/ts-embed-polyfills.js | UTF-8 | 6,484 | 2.84375 | 3 | [
"MIT"
] | permissive | // https://github.com/ttaubert/node-arraybuffer-slice
// (c) 2014 Tim Taubert <tim@timtaubert.de>
// arraybuffer-slice may be freely distributed under the MIT license.
(function (undefined) {
"use strict";
function clamp(val, length) {
val = (val|0) || 0;
if (val < 0) {
return Mat... | true |
fc10a646f3d6ad1884ed59ed3ec2a56ee6d17f1c | JavaScript | christopherdani/Lift-Stat | /util/database.js | UTF-8 | 1,214 | 2.625 | 3 | [] | no_license | const mongodb = require('mongodb');
const MongoClient = mongodb.MongoClient;
const path = require('path');
const PropertiesReader = require('properties-reader');
const properties = PropertiesReader(path.join(__dirname, '../dbconfig.properties'));
// only use this locally
let _db;
// This is run once when we start ser... | true |
bdc685ee547f3e6ec33c9cbb73355ed1d92b3286 | JavaScript | farhax/SnekBot | /index.js | UTF-8 | 1,149 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | // load configuration
const { prefix } = require('./config.json');
const { token } = require('./token')
// require the discord.js module
const Discord = require('discord.js');
const SnekName = require('./snekname');
// create a new Discord client
const client = new Discord.Client();
// when the client is ready, r... | true |
a5e48a1f2efbaa4aee4146020686805d8c5f5315 | JavaScript | wangchengjiang6666/mydemo | /react/three/3-webpack/src/components/Hello.jsx | UTF-8 | 588 | 2.703125 | 3 | [] | no_license | import React, { Component } from "react";
import { withRouter } from "react-router-dom";
// withRouter 是个高阶函数,
// 他接受一个组件做为参数,返回一个新的组件,并且这个新的组件中包裹着传递的那个组件,并且传递的组件中会收到3个prop数据,就是路由相关的那三个prop
class Hello extends Component {
render() {
return (
<div>
<h1 onClick={this.handleToHome}>Hello</h1>
</... | true |
aaf4cc43b69514cc88ed69e4cee3a8922d18c13e | JavaScript | B3NT0X/React-todo-app | /app/components/TheTodo.js | UTF-8 | 2,301 | 2.71875 | 3 | [] | no_license | import React, { useState, useContext, useEffect } from "react"
import DispatchContext from "../DispatchContext"
import StateContext from "../StateContext"
function TheTodo() {
const [todoValue, setTodoValue] = useState("")
const globalDispatch = useContext(DispatchContext)
const globalState = useContext(S... | true |
ce14f980d7a8b049ca79294c08c6b2ac7106ffd8 | JavaScript | hunsoo/senior-enrichment | /app/reducers/studentsFromCampus.js | UTF-8 | 865 | 2.71875 | 3 | [] | no_license | import axios from 'axios';
// action types
const GOT_STUDENTS_FROM_SELECTED_CAMPUS = 'GOT_STUDENTS_FROM_SELECTED_CAMPUS';
//action creators
const gotStudentsFromSelectedCampus = (studentsFromSelectedCampus) => {
return {
type: GOT_STUDENTS_FROM_SELECTED_CAMPUS,
studentsFromSelectedCampus,
}
};
// thunks
... | true |
a55db677dd600e5d623bb4a23a386c62ca510f87 | JavaScript | timeforvic/profile | /script.js | UTF-8 | 610 | 3.328125 | 3 | [] | no_license | let about = document.getElementById("about");
about.addEventListener("click", whenClicked);
about.addEventListener("mouseover", whenHovered);
about.addEventListener("mouseout", whenNotHovered);
let bodyArray = document.getElementsByTagName("BODY");
let body = bodyArray[0];
function whenClicked(){
let newHeading = d... | true |
ad114526480dd2ee510aa49ac94c1dd8cb8108a8 | JavaScript | f/erste.js | /src/lib/goog.js | UTF-8 | 12,269 | 2.515625 | 3 | [
"MIT"
] | permissive | // Copyright 2006 The Closure Library Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless requ... | true |
3b736986f49b2aa1a3ffd07026369a2ae44b4d79 | JavaScript | zulwaran/cryptonSW | /src/components/FavoritePage/FavoriteContainer.js | UTF-8 | 3,700 | 2.53125 | 3 | [] | no_license | import React from 'react'
import { useEffect, useState } from 'react'
//Components
import HeroList from '../Reusable/HeroList'
import Filter from '../Reusable/Filter'
//Redux
import { useDispatch, useSelector } from 'react-redux'
import { setFilterAction, setGenderAction } from '../../actions/FilterActions'
const Fa... | true |
bcbf0b6a8807d2be4684d8832b1eaca6f7f17e9c | JavaScript | nergi-r/GraphVisualizer | /graph.js | UTF-8 | 11,626 | 3.109375 | 3 | [] | no_license | /*
Graph Object
A Force-Directed Graph Layout created using d3js.v4 library
- Construct graph based on input data
- Dynamically insert a new node anywhere
- Dynamically insert a new link between any node
- Support weighted & unweighted graph
- Support directed & undirected graph
- Support dynamic & stat... | true |
6bee9fa7bc43a3adbfde7eb3900e32451c20f282 | JavaScript | Mediacauseagency/wp-starter | /html/wp-content/themes/impact/client/js/helpers/data/swapText.js | UTF-8 | 1,894 | 2.984375 | 3 | [] | no_license | const style = require('../style')
const replaceText = (text, parent) => {
const child = document.createElement('div')
child.innerText = text
style(child, {
position: 'absolute',
left: 0,
top: 0
})
child.className = 'js-swap-text-child'
const previousChild = parent.querySelector('.js-swap-text-c... | true |
88e706c40616915c6f48e22fe8376dbcce032baa | JavaScript | TrevorSeitz/javascript-arrays-lab-bootcamp-prep-000 | /index.js | UTF-8 | 1,404 | 4 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | const app = "I don't do much."
const kittens = ['Milo', 'Otis', 'Garfield'];
function destructivelyAppendKitten(name) {
kittens.push(name);
//kittens[3] = ('Ralph');
console.log(kittens);
return kittens;
}
destructivelyAppendKitten();
function destructivelyPrependKitten(name) {
kittens.unshift(name);
//k... | true |
3465558200a4f31cb48721734047b4028b0916f8 | JavaScript | Dilly-Dev/FirstProject | /js/codingQuiz.js | UTF-8 | 3,502 | 3.359375 | 3 | [] | no_license | //Variables
var questions = [
{
question: 'What state do you live in?',
choices: ['Florida','Alabama','California','Georgia'],
answer: 'Florida'
},
{
question: 'Who is your favorite person in the world?',
choices: ['Emma Dill', 'The Pope', 'Mother Theresa', 'Otis'],
answer: 'Emma... | true |
aacfc518bfb8c9d2363a11760af8d128418a7f63 | JavaScript | iweb/Salon-Carriere-TI-2012 | /pokerhands-20120402/spec/PokerHandsSpec.js | UTF-8 | 2,167 | 3.40625 | 3 | [] | no_license | describe("PokerHand", function(){
it("exists", function () {
expect(function(){ new PokerHand();}).toThrow("Invalid hand");
});
describe("parses a full hand", function () {
it("values", function () {
var pokerHand = new PokerHand("2H 3D 5S 9C KD");
expect(pokerHand.c... | true |
3096ee118dc06baf3d9ce3b0d2fc59315cef831a | JavaScript | CodeJusto/learnyounode | /04_my_first_async_io.js | UTF-8 | 233 | 2.796875 | 3 | [] | no_license | var fs = require('fs');
fs.readFile(process.argv[2], 'utf-8', function(err, data) {
if (err) {
return console.log(err);
}
var length = data.split('\n').length
if (length>0) {
length -=1;
}
console.log(length)
})
| true |
8d7383378c3fa2e3c50ec014b3fedf0671485014 | JavaScript | BayLadyCoder/FCCIntermediateAlgo | /SumAllOddFibonacciNumbers.js | UTF-8 | 825 | 4.5 | 4 | [] | no_license | // Sum All Odd Fibonacci Numbers
// Given a positive integer num, return the sum of all odd Fibonacci numbers that are less than or equal to num.
// The first two numbers in the Fibonacci sequence are 1 and 1. Every additional number in the sequence is the sum of the two previous numbers. The first six numbers of the ... | true |
a02ab1b347a3677b1878402c2063147f9a9ed933 | JavaScript | liusimin0206/Front-end-Learning | /test1/441.排列硬币.js | UTF-8 | 484 | 2.84375 | 3 | [
"ISC"
] | permissive | /*
* @Author: your name
* @Date: 2020-11-24 15:59:35
* @LastEditTime: 2020-11-24 16:24:35
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \test1\441.排列硬币.js
*/
/*
* @lc app=leetcode.cn id=441 lang=javascript
*
* [441] 排列硬币
*/
// @lc code=start
/**
* @param {number}... | true |
f273985e4177aed93617d5605af9ee5d7d83af88 | JavaScript | carons-cr/groupTour | /out/artifacts/grouptour_war_exploded/js/writeNote.js | UTF-8 | 3,077 | 2.84375 | 3 | [] | no_license | var id = 0;
var imgHeight = 120;
window.onload=function () {
var userName = sessionStorage.getItem("userName");
if (userName != null) {
var authorNode = document.createElement("input");
authorNode.className = "author";
authorNode.name = "author";
authorNode.value = userName;
... | true |
9830046468563c64087e9a31a2ea08bbe8daf113 | JavaScript | anzelcapparelli/password_generator | /script.js | UTF-8 | 5,060 | 3.625 | 4 | [] | no_license | // Assignment Code
var generateBtn = document.querySelector("#generate");
var lwrcase = "abcdefghijklmnopqrstuvwxyz";
var upprcase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var special = " !\"#$%&\'()*+,-./:;<=>?@[]\\^_`{|}~";
var num = "0123456789";
var do_num = false;
var do_uppr = false;
var do_special = false;
function g... | true |
5179a34054ff004311a088a68c599f0a9df1f700 | JavaScript | noordeep-p/lotide | /test/middleTest.js | UTF-8 | 748 | 3.171875 | 3 | [] | no_license | const middle = require('./../middle');
const assert = require('chai').assert;
describe("#middle", function() {
it('should return [] for inputs [1]', function() {
let result = middle([1]);
assert.deepEqual(result, []);
});
it('should return [2] for inputs [1,2,3]', function() {
assert.deepEqual(middle... | true |
49990bca2c00af6ed0e0bd46a7850c1dc324e8ad | JavaScript | sseebald/bitstarter | /econ.js | UTF-8 | 507 | 2.828125 | 3 | [] | no_license | #!/usr/bin/env node
var commander = require("commander");
commander.prompt('Price per unit: ',Number, function(x) {
if (x <= 100) {
console.log("Amount must be > $100 to make them billz, son");
process.exit();
} else {
var y = 1000000/(x-100);
}
var b = (20 * y);
var c = (70 * y);
var a = (10 ... | true |
ea22ea34b14682be0878e7dce282d1d639d72ac3 | JavaScript | beaugunderson/xregexp-lookbehind | /xregexp-lookbehind.js | UTF-8 | 2,192 | 2.640625 | 3 | [] | no_license | 'use strict';
// modified from https://gist.github.com/slevithan/2387872
exports.prepareLb = function (lb) {
// Allow mode modifier before lookbehind
var parts = /^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*)\)$/.exec(lb);
return {
// $(?!\s) allows use of (?m) in lookbehind
lb: this(parts ? parts[1] + '(?:... | true |
617b6625edd31fbddfc7700a3b7bcfd59391f765 | JavaScript | saransh-khobragade/javascript_basic_for_react | /5.object_array/main.js | UTF-8 | 1,340 | 4.1875 | 4 | [] | no_license | //Object
const a = {
"name": "saransh",
"age": 23,
"company":{
"name":"infosys"
}
}
//Object adding key
a.suranme = "khobragade"
//a.min-salary=1222
a["min-salary"]=12222
console.log("1",a)
console.log("2",a.name)
console.log("3",a.company.name)
//Object methods
var c = Object.keys(a)
var d =... | true |
2aca9750c4dbfc68a0d7b91a5b2d60c830a7d999 | JavaScript | Axiverse/Mathematics.js | /test/LatLon.test.js | UTF-8 | 1,451 | 2.734375 | 3 | [] | no_license | const LatLon = require( '../source/LatLon' );
const ε = 0.01;
UnitTest = {
distance( test ) {
// setup
var p1 = new LatLon( 52.205, 0.119 );
var p2 = new LatLon( 48.857, 2.351 );
// act
var d = LatLon.distance( p1, p2 ); // 404.3 km
// validate
test.ok( Math.abs( d - 404279.1639 ) < 1 );
test.expect... | true |
ed693f67bac1ede8e926130d9deef13ca161c871 | JavaScript | wangchengye-zone/letaotao | /Project/js/register.js | UTF-8 | 3,456 | 2.9375 | 3 | [] | no_license | // // 注册
// class Register{
// constructor(){
// this.url="http://www.icodeilife.cn/ctrl/register.php";
// this.btn=$(".please");
// this.user=$(".f2");
// this.pass=$(".pass");
// this.bomb=$(".bomb");
// // console.log(1);
// this.init();
// }
// init(){
// var that=this;
// ... | true |
e45cb1e108eb458ade8ddab3fc019ce05edd1f40 | JavaScript | Dlumior/test | /src/components/Form.js | UTF-8 | 1,227 | 2.96875 | 3 | [] | no_license | import React, { useState } from "react";
import Post from "../Networking/Post.js";
const Form = () => {
const [texto, setTexto] = useState("");
const [cuerpo, setCuerpo] = useState("");
const [res, setRes] = useState({
title: "texto",
body: "cuerpo",
userId: -1,
});
const handleTexto = (e) => {... | true |
0183fced4353b17cd611785c63f7819122ddb8e1 | JavaScript | hamst/MediaCaptureInsertableStreams | /js/frame-source.js | UTF-8 | 3,925 | 2.96875 | 3 | [] | no_license | 'use strict';
const IMG_WIDTH = 1920;
const IMG_HEIGHT = 1080;
function _imageDataWithText(text) {
const canvas = new OffscreenCanvas(IMG_WIDTH, IMG_HEIGHT);
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, IMG_WIDTH, IMG_HEIGHT);
ctx.font = '148px serif';
ctx.... | true |
6081b2cc02d69743a7842710046eeaeb322eccea | JavaScript | stylus/stylus | /lib/token.js | UTF-8 | 913 | 2.96875 | 3 | [
"MIT"
] | permissive |
/*!
* Stylus - Token
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var inspect = require('util').inspect;
/**
* Initialize a new `Token` with the given `type` and `val`.
*
* @param {String} type
* @param {Mixed} val
* @api private
*/
var Token = ex... | true |
a80620532f9babda7a1fd63f5ccada227fa1764c | JavaScript | GuilhermeRossato/Web-Image-Processing | /Classes/StateMachine.js | UTF-8 | 1,325 | 3.734375 | 4 | [
"Unlicense"
] | permissive | /*
* Guilherme Rossato - June 2017
*
* A class to simplify a state machine with state and lastState property.
* The input must contain a transition list.
*
* Examples of usages:
* new StateMachine({transitions: [last:"*", next:"idle", event:()=>console.log("initialize!")]);
* new StateMachine({state: "idle", tr... | true |
314e46e6bd50cb1046ca5b9d748102711305b4d6 | JavaScript | idnaninitesh/FBICrimeDataVisualization | /crimeStats.js | UTF-8 | 31,377 | 2.796875 | 3 | [] | no_license | var current = "TotalCrimes"; // default view
var totalcounts, property, violent, robbery, murder, burglary, larceny, rape, aggravatedassault, motorvehicletheft;
// use a d3 map to make a lookup table for the string in the chart title
var chartLabels = d3.map();
chartLabels.set("TotalCrimes", "Total Crimes");
chartLabel... | true |
b3a57e064bfe8031d82bd13f0d7500ef6c229617 | JavaScript | dazld/tblend | /lib/picker.js | UTF-8 | 1,496 | 2.9375 | 3 | [] | no_license | var getRGBA = require('./get-rgba');
function createColorPicker(seedRgb, cb) {
var pickerBase = document.createElement('input');
var r = pickerBase.cloneNode();
var g = pickerBase.cloneNode();
var b = pickerBase.cloneNode();
var cvalue = [];
function onChange() {
var vals = [r, g, b].... | true |
57f72a2c2d5591cfa2ec53c44d37d5c304b442e2 | JavaScript | jaspreetsingh2701/roster-scheduler | /src/components/Roster.js | UTF-8 | 608 | 2.546875 | 3 | [] | no_license | import React from 'react';
const dates = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28"];
function Roster() {
return (
<div style={{ display: 'flex', flexDirection: 'row', flexBasis: "100%", ... | true |
f929c8f9bd0feffe30c69afd944cbe0f0b600dd3 | JavaScript | alaethiadvoracek/CRUD-Up-Pet-Hotel | /server/routes/hotel.router.js | UTF-8 | 3,142 | 2.71875 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const pool = require('../modules/pool');
router.get('/', (req, res) => {
const queryString = 'SELECT * FROM owners';
pool.query(queryString)
.then(result => {
console.log('Getting Owners Names');
res.send(resu... | true |
8e3205f2bd33fc08680e1eb8260f0daa25180232 | JavaScript | destup09/Portfolio | /script.js | UTF-8 | 4,998 | 2.5625 | 3 | [] | no_license | (function () {
const menu = document.querySelectorAll(".port-menu");
const rowWebsites = document.querySelector(".row-websites");
const rowDesign = document.querySelectorAll(".row-graphic");
const projectsWrapper = document.querySelector("#portfolio");
let prev = menu[0];
menu.forEach(function (item) {
... | true |
e7ce1cfbac218ce36c800f389e4d766c44c06f44 | JavaScript | BrianFs04/holbertonschool-web_front_end | /0x0C-Javascript_advanced/10-prime.js | UTF-8 | 643 | 3.890625 | 4 | [] | no_license | // Execution stack and timing execution
function countPrimeNumbers() {
let count = 0;
for (let i = 2; i <= 100; i++) {
let prime = true;
for (let j = 2; j < i; j++) {
if (i % j === 0) {
prime = false;
break;
}
}
if (prime) {... | true |
fe077f08b2dbc8e7c649813b9d860f9ac39ffbaa | JavaScript | judelt/Caesars | /public/scripts/helperfunctions.js | UTF-8 | 753 | 3.234375 | 3 | [] | no_license |
// function updateCartTotal() {
// let cartItemContainer = document.querySelector('.cart-all-items');
// let cartRows = cartItemContainer.querySelectorAll('.cart-item');
// let total = 0
// for (let i = 0; i < cartRows.length; i++) {
// let cartRow = cartRows[i]
// let priceElem... | true |
3048383b8a528f996a95fda777b8b6bb948d6904 | JavaScript | RobertPurc/Js-Basics | /Js-Basics/scriptChallange2.js | UTF-8 | 2,382 | 3.875 | 4 | [] | no_license | var JohnFirstGame = 89;
var JohnSecondGame = 127;
var JohnThirdGame = 103;
var MikeFirstGame = 116;
var MikeSecondGame = 94;
var MikeThirdGame = 123;
var MarryFirstGame = 97;
var MarrySecondGame = 134;
var MarryThirdGame = 102;
var avgJohn = (JohnFirstGame + JohnSecondGame + JohnThirdGame) / 3;
console.log(avgJohn)... | true |
914a723b3680ba857916a236943a80b025493d1c | JavaScript | tribou/reddit-reader | /web/react/stores/RedditStore.js | UTF-8 | 2,658 | 2.515625 | 3 | [
"MIT"
] | permissive | import AppDispatcher from '../utils/AppDispatcher.js';
import { Actions, ViewFilters } from '../utils/AppConstants.js';
import { EventEmitter } from 'events';
const CHANGE_EVENT = 'change';
// Could be replaced with ImmutableJS or Immutability helpers:
// https://facebook.github.io/react/docs/update.html
let _store =... | true |
f739b9aa9adeccb0635a0350b30a301aa6e96b95 | JavaScript | akirchner333/party-game | /app/javascript/packs/components/player_root.jsx | UTF-8 | 594 | 2.515625 | 3 | [] | no_license | import React from 'react';
import { connect } from 'react-redux'
class PlayerDisplay extends React.Component{
constructor(props){
super(props);
}
render(){
return (
<div>
<h1>{this.props.name}</h1>
<div>
You have {this.props.score} points. Good work.
</div>
... | true |