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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8d0a293de6774fd678122250158a9dc06f03bd3c | JavaScript | jamarcus/qmachine | /src/browser-client/ie.js | UTF-8 | 1,853 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | //- JavaScript source code
//- ie.js ~~
//
// This code "encourages" users of Internet Explorer (IE) to install Google's
// Chrome Frame. I'm not sure if this code is necessary now that I'm using the
// "HTML5 Shiv" that Twitter Bootstrap requires, but this code is definitely
// not being used right now ...
//
// ... | true |
ce0d2da96d6d9a64ec440aa603fd2ff373f00429 | JavaScript | dbarbar/dive-actions-for-google | /app.js | UTF-8 | 3,086 | 2.515625 | 3 | [] | no_license |
'use strict';
process.env.DEBUG = 'actions-on-google:*';
let Assistant = require('actions-on-google').ApiAiAssistant;
let express = require('express');
let bodyParser = require('body-parser');
let request = require('request');
let app = express();
app.use(bodyParser.json({type: 'application/json'}));
// API.AI act... | true |
40b6e1314d1dbaf6dc58aa8a4a60fd96257f6b37 | JavaScript | joraanbe82/project2 | /routes/api.js | UTF-8 | 6,657 | 2.53125 | 3 | [] | no_license | var express = require("express");
var router = express.Router();
let jwt = require("jsonwebtoken");
let mongo = require("mongodb");
var md5 = require("md5");
const secret = "mysecret";
//funcion para authenticar usuarios
router.post("/auth", (request, response) => {
const query = global.dbo.collection("alumnos").fi... | true |
7a2097558a7679a023d43930d8158eaac68647bb | JavaScript | nguyenvanthucframgia2016/server | /app/controllers/user.js | UTF-8 | 3,056 | 2.765625 | 3 | [] | no_license | var User = require('../models/user.js');
exports.create = function (req, res) {
try {
var user = new User({
firstName: req.body.first_name,
lastName: req.body.last_name,
gender: req.body.gender,
address: req.body.address,
birthdate: req.body.birth... | true |
64f5bf8ff4e461804ee3164c476a43f0bbef5528 | JavaScript | jackofsporks/blockit | /lib/langs/html/blocks.js | UTF-8 | 18,720 | 2.734375 | 3 | [] | no_license | "use babel"
export default class HTMLBlocks {
constructor () {}
getBuild (symbol) {
let funct = null
switch (symbol) {
case ">": funct = this.closeAngle; break;
case "<": funct = this.openAngle; break;
// quotes only matter inside opening tags?? Help closing quotes in text??
// cas... | true |
ee7e7f441efbc2a760af0aee09f1f8f3d4b7b3d9 | JavaScript | iirvine/render-queue-stream | /index.js | UTF-8 | 1,558 | 2.671875 | 3 | [] | no_license | var Writable = require('stream').Writable;
module.exports = function(fn) {
var rate = 500,
queue = [],
threshold = rate * 100,
requestID = null,
stream = Writable({ objectMode: true });
stream.on('finish', onFinish);
stream.once('queued', render);
stream._write = function(chunk, endcoding, cb) {
queue ... | true |
154907dda3ecf8a9f68d1e45cdb320debf2a79ef | JavaScript | Stone1231/js-sample | /tests/updateDict.test.js | UTF-8 | 334 | 3.078125 | 3 | [] | no_license |
const joinDict = function (d, input) {
for (var i in input) {
var datum = input[i];
d[i] = datum;
}
return d;
}
test('join dict', () => {
let someDict = { a: "a", b: "b" }
someDict = joinDict(someDict, { a: "aa", c: "c" })
for (let i in someDict) {
console.log(someDict[... | true |
11a8996cad3f94ba98ea8a6c51f5ba805ea5e1bf | JavaScript | tykavanaugh/WeekOnePrep | /W1Q3.js | UTF-8 | 350 | 3.734375 | 4 | [] | no_license | function FibonacciChecker(num) {
var seq = [0,1,1]
var i = 1
do {
var n = seq[seq.length - 1] + seq[seq.length - 2]
seq.push(n)
} while (seq[seq.length - 1] < num);
if ( seq[seq.length - 1] == num) {
return "yes"
} else {
return "no"
}
}
// keep this function call here
console.log(F... | true |
8ed1191c0df4e12bdfb77344696438de42d6bc60 | JavaScript | SergeyNaumenko/basic-js | /src/dream-team.js | UTF-8 | 405 | 2.75 | 3 | [
"MIT"
] | permissive | const CustomError = require("../extensions/custom-error");
module.exports = function createDreamTeam(members) {
if (!Array.isArray(members) || members.length === 0) {
return false;
}
const str = members.reduce((acc, userName) => {
if( typeof userName === "string"){
acc += userName.trim().toUpperCa... | true |
3c1eeb077d6d1eb5ec5389c1861a9a2a0d78c34e | JavaScript | Cimo02/Oasis | /OasisApp/scripts/fireflies.js | UTF-8 | 1,783 | 3.359375 | 3 | [] | no_license | let lightArr = [];
function setup() {
var cnv = createCanvas(windowWidth - 50, windowHeight);
var x = (windowWidth - width) / 2;
var y = (windowHeight - height) / 2;
cnv.position(x, 0);
for (i = 0; i < 20; i++) {
lightArr.push(new LightObj(random(0, 5), random(0, 5)));
}
noStroke();
// noLoop();... | true |
e3d311426ae3ccaa2bae9b3020ac918503ef6919 | JavaScript | drunkSh/node-chat-app | /server/utils/user.js | UTF-8 | 1,162 | 3.28125 | 3 | [] | no_license | // class Person {
// constructor (name,age) {
// this.name = name ;
// this.age = age ;
// }
// getUserDesription(){
// return `${this.name} age is${this.age}`;
// }
// }
// //adduser(id,name,room)
// //remove user(id)
// //getuser(id)
// //getUserlist(room)
// var me = new Person("ankit",23) ;
//... | true |
26199627d876b51e758d583f1eedeecf142eb4d5 | JavaScript | tenzor7/maxcdn-chrome | /assets/js/script.js | UTF-8 | 4,736 | 2.671875 | 3 | [] | no_license | var oauth, options
options = {
requestTokenUrl: 'https://rws.netdna.com/oauth/request_token',
authorizationUrl: 'https://rws.netdna.com/oauth/authorize',
accessTokenUrl: 'https://rws.netdna.com/oauth/access_token'
}
var storageLocals = [
'MaxConsumerKey'
, 'MaxConsumerSecret'
, 'MaxCompanyAlias'
]
/*gl... | true |
431c64d1a1bd1c041f34a7a2c5da294198b4a44a | JavaScript | MyPublicGitHub/Test | /app/test/TestPicker.js | UTF-8 | 1,989 | 2.671875 | 3 | [] | no_license | "use strict"
import React, { Component } from 'react'
import {
AppRegistry,
View,
Text,
Picker,
StyleSheet
} from 'react-native'
// 网络获取的数据,内容必须是简单数据,不可是对象
export default class Test extends Component {
constructor(props) {
super(props)
this.state = {
pickerValue:... | true |
606583f829bfdde9aa46db4a3eae405c0d7b618f | JavaScript | npmcdn-to-unpkg-bot/vagabond | /public/modules/queue.js | UTF-8 | 1,569 | 2.8125 | 3 | [] | no_license | var express = require('express');
var queue = express.Router();
var jsonParser = require('body-parser').json();
var cookieParser = require('cookie-parser')();
var users = require('../data/users.js');
queue.use(jsonParser);
queue.use(cookieParser);
queue.put('/put', function(req, res) {
var country = req.body.countr... | true |
aa5964786591692033be5a2f0efe3722ec0f939d | JavaScript | pan0202/pan0202.github.io | /lab2/js/gasket-triangles.js | UTF-8 | 10,757 | 2.671875 | 3 | [] | no_license | "use strict";
const { vec3 } = glMatrix;
var canvas;
var gl;
var shape="2D";
var points = [];
var colors = [];
var numTimesToSubdivide = 4;
var theta;
var radius=1.0;
var rotate;
function init(){
canvas = document.getElementById( "gl-canvas" );
gl = WebGLUtils.setupWebGL( canvas );
if( !gl ){
... | true |
cdb7836632a173ba55af204d3e41d2fa691ee63c | JavaScript | lburdock/js-test-examples | /react-testing-library/jest-dom/to-have-class.test.js | UTF-8 | 1,061 | 2.671875 | 3 | [] | no_license | import React from "react";
import { render, screen } from "@testing-library/react";
describe("toHaveClass", () => {
test("element with classes", () => {
render(<h1 className="btn extra btn-danger">Example</h1>);
const el = screen.getByRole("heading");
expect(el).toHaveClass("extra");
expect(el).toH... | true |
15c341b5c832544a1c1ebbff6923be1d0ae7622c | JavaScript | lhorneta/hrtest | /src/game/reducers/gameReducer.js | UTF-8 | 2,179 | 3.390625 | 3 | [] | no_license | import { EvaluateRound, PickCard, StartGame } from "../actions";
/**
* Terminology used in the instructions:
*
* Game - a series of rounds where players are taking cards from the deck one by one. Game continues until there
* are any cards in the card deck
*
* Round - two consecutive turns made by players ... | true |
67664aaa7e142a4c21ffad81665b86fd556eaad4 | JavaScript | railslove/roadtrip | /src/lib/acm.js | UTF-8 | 2,129 | 2.578125 | 3 | [
"MIT"
] | permissive | import AWS from 'aws-sdk'
const debug = require('debug')('roadtrip:lib:acm')
const acm = new AWS.ACM({ apiVersion: '2015-12-08' })
export async function getCertificateForDomain(domain) {
const params = {
CertificateStatuses: ['PENDING_VALIDATION', 'ISSUED']
}
const data = await acm.listCertificates().promis... | true |
50ee1ab7d74bf7bc5297cbc6ac7903605d2d046d | JavaScript | dannyhvalenz/Travel-Agency | /TravelAgency/assets/js/hoteles.js | UTF-8 | 37,169 | 2.515625 | 3 | [] | no_license | let precio;
let cliente;
var hotelL = "";
function convertDestimo() {
return (window.localStorage.getItem('destino') === 'NYC-EU') ? 'NYC' : 'CDMX';
}
function consultarHotelesInicio() {
var ciudad = (window.localStorage.getItem('destino')) ? convertDestimo() : document.getElementById("ciudadInicio").value;
... | true |
6f4d65ce54215aebb84b3db33acc08f83280e998 | JavaScript | nnoco/learning-slack-with-heroku-node | /index.js | UTF-8 | 1,469 | 2.53125 | 3 | [] | no_license | const express = require('express')
const path = require('path')
const PORT = process.env.PORT || 5000
const { WebClient } = require('@slack/web-api');
// OAuth & Permissions 설정 페이지에서 생성된 Bot User OAuth Access Token
const token = 'xoxb-1038587720594-1054538620592-ofkQOwxmb12n3qaKoFpRqqDr';
const web = new WebClient(to... | true |
2efbf65d69d343f09b5390faa4639d58f462fdb1 | JavaScript | chyang0107/BobTaborJS | /date.js | UTF-8 | 1,037 | 3.53125 | 4 | [] | no_license | let today = new Date();
let bob = new Date('December 7, 1969 07:01:23');
// let bob = new Date('1969-12-07T07:01:23');
// let bob = new Date(1969, 11, 6);
// let bob = new Date(1969, 11, 6, 7, 1,23);
// var elapsedTime = today - bob;
// console.log(elapsedTime);
//get parts
//
// console.log(bob.getTime());
let f... | true |
e7db9dbaf98d9468899489a6cb0ee1507f17b967 | JavaScript | daniobiols/fid-laravel | /public/js/reg.js | UTF-8 | 3,041 | 2.96875 | 3 | [
"MIT"
] | permissive | // window.onload = function (){
// }
var form = document.querySelector('form#reg');
var nombre = document.querySelector('form#reg input[name="name"');
var lastname = document.querySelector('form#reg input[name="lastname"');
var email = document.querySelector('form#reg input[name="email"');
var password = document.quer... | true |
2e925c6de6ccc62a38f19fa11a97839f076cb3bd | JavaScript | OscarBrunelle/website | /projects/casino/main.js | UTF-8 | 2,172 | 3.265625 | 3 | [
"MIT"
] | permissive | let deck = new Deck();
let players = [];
let dealer;
function again() {
}
function pick() {
players[0].pick();
if (players[0].score >= 21) {
stay();
}
}
function stay() {
const pick_button = document.getElementById("pick");
pick_button.setAttribute("disabled", true);
ai_pick();
getWinner();
}
let ai_s... | true |
0afefd6788bccbbd9e11306f0f69bb49a2c6f1d1 | JavaScript | MicaelStahl/All-Assignments | /front-end/src/Components/Assignment 10 - Identity/User/All Users/SignIn.jsx | UTF-8 | 6,214 | 2.59375 | 3 | [] | no_license | import React, { Component } from "react";
import { Link } from "react-router-dom";
import { connect } from "react-redux";
import Title from "../../../UI/Title";
import * as actionIdentity from "../../../Actions/Assignment 10/actions/identityActions";
class LoginScreen extends Component {
state = {
userName: "",... | true |
756b6863be9f28a8668187d737a8fc2c0ea41920 | JavaScript | Stong-chen/chen-doc | /src/lunar-calendar/js/common.js | UTF-8 | 823 | 2.578125 | 3 | [] | no_license | $(function(){
//表单验证
function biTian() {
var $name=$("#name").val();
var $phone=$("#phone").val();
var $birth=$('#birth').val();
var reg=/^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
if($name==""){
alert("请输入您的姓名!");
return fa... | true |
0f709614de80390564041764fc680a223f74b2fc | JavaScript | mcs2515/data_viz_catalogue | /js/partition.js | UTF-8 | 1,105 | 2.578125 | 3 | [] | no_license | function makeChart(dataset) {
let w = 700;
let h = 350;
var colors = ['#f99c92', '#92BCF9', '#92f9cf', '#92f0f9'];
var color = d3.scaleOrdinal().range(colors);
let chart = d3.select('#partitionchart')
.attr('width', w)
.attr('height', h);
var root = d3.hierarchy(dataset).count();
var partition = d3.pa... | true |
41c45f0660f487da5723f656acacb2e170fdbf81 | JavaScript | amallen22/JS-exercices | /02-more-steps/03_reverse.js | UTF-8 | 434 | 4.53125 | 5 | [] | no_license | // Define a function reverse() that computes the reversal of a string. For example, reverse("jag testar") should return the string "ratset gaj".
/* Way 1 */
function reverse( text ) {
var aChars = text.split('')
var reversedString = []
aChars.forEach( function(char) {
reversedString.unshift(char)
})
ret... | true |
c2002f445fa7ca909636e69b192404f0d62420a2 | JavaScript | galina-dimitrova/JSAdvanced | /06.1.DOMManipulations-Lab/Dart Game/app.js | UTF-8 | 1,600 | 2.71875 | 3 | [] | no_license | function dart(){
const colorMapping = {
firstLayer: 0,
secondLayer: 1,
thirdLayer: 2,
fourthLayer: 3,
fifthLayer: 4,
sixthLayer: 5,
}
let isHome = true;
$('#playBoard').on('click', 'div', onPlayBoardClick)
function onPlayBoardClick(e) {
e.stopPropagation();
let points = getScore(e.target.id);
... | true |
9898fc022fcd36b718f2ee3c0dc543d24baa6497 | JavaScript | GLambermont/Retron | /examples/base-setup/js/main.js | UTF-8 | 1,963 | 2.890625 | 3 | [
"MIT"
] | permissive | const renderLayers = {
background: new retron.RenderLayer({ className: 'background' }),
midground: new retron.RenderLayer({ className: 'midground' }),
foreground: new retron.RenderLayer({ className: 'foreground' })
}
const renderer = new retron.Renderer({
layers: renderLayers,
className: 'game-renderer',
wi... | true |
b065dfd979786a2cc4da4e111730005741dd4260 | JavaScript | DenysMakarov/All_Lessons | /function_ES6.js | UTF-8 | 1,141 | 4.125 | 4 | [] | no_license | 'use strict';
//=================== стрелочные функции ES6
//
// var x = 5;
// var y = 3;
// var c;
// c = function add() {
// return x + y;
// };
// console.log(c());
//====================
// var x = 5;
// var y = 3;
// var c;
// c = (a,b) => a+b;
// console.log(c(x,y));
//==================== //
//
// var x ... | true |
afcd3d4f092a8250617de403722d5ed109259c7f | JavaScript | Marco-25/Consumindo-dados-de-uma-API | /public/js/edita-cliente.js | UTF-8 | 971 | 3.21875 | 3 | [] | no_license | const pegaUrl = new URL(window.location);
const id = pegaUrl.searchParams.get('id');
const inputCpf = document.querySelector('[data-cpf]');
const inputNome = document.querySelector('[data-nome]');
detalhaCliente(id).then(dados => {
inputCpf.value = dados[0].cpf
inputNome.value = dados[0].nome
});
const formE... | true |
153d7b2e2885b1179c7916c9998e48feeba66f1d | JavaScript | kpeluso/score-keep | /imports/utils.js | UTF-8 | 505 | 2.90625 | 3 | [] | no_license | // contents will be manually exported
// all modules with utils.js as dependency
// will be updated whenever utils.js is updated
// console.log('log from /imports/utils.js');
//
// export let greetUser = function(){
// return 'Hello!';
// };
//
// export let name = 'Kenny P'; // another named export
//
// //export... | true |
0457f676a37e0a96e09d1a229ef54e2f3597a2b6 | JavaScript | brandaspt/book-store | /src/components/SingleComment/SingleComment.jsx | UTF-8 | 1,484 | 2.546875 | 3 | [] | no_license | import { Component } from "react"
import { ListGroup, Button } from "react-bootstrap"
const URL = "https://striveschool-api.herokuapp.com/api/comments/"
const TOKEN = process.env.REACT_APP_API_TOKEN
class SingleComment extends Component {
state = {
isLoading: false,
isDeleted: false,
}
deleteComment = a... | true |
62813995760f0549afe06a7298d44c2425e42e8e | JavaScript | a2772/JS-001-UniversidadJS | /Leccion004/04-01-SecuenciasControl.js | UTF-8 | 255 | 2.78125 | 3 | [] | no_license | let condicion = true;
if(condicion){//Cómo es una sola instrución se pueden omitir las llaves, sin embargo las agregaremos de aquí en adelante por buenas prácticas
console.log("Condición verdadera");
}else{
console.log("Condición falsa");
} | true |
56c305dca1cb9954de80e0074d5841ea9b5bfc0f | JavaScript | woshick/Tetris | /js/Block.js | UTF-8 | 489 | 2.546875 | 3 | [] | no_license | (function(){
//砖块类
//row的合法值是0~19
//col的合法值是0~11
//color的合法值是0~6
var Block = window.Block = function(row,col,color){
this.row = row;
this.col = col;
this.color = color;
//这个图片
// this.pic = g.blockPic;
}
//渲染
Block.prototype.render = function(){
// g.ctx.drawImage(this.pic , 122 * this.color , 0 , 1... | true |
60435b7ceb008220f814896a9586a6e85368f236 | JavaScript | danilofeijo/nodeJsAdventures | /webModernoJavaScript/03fundamentals/14variablesConts.js | UTF-8 | 207 | 3.046875 | 3 | [] | no_license | var orange = 3;
let banana = 4;
var orange = 30;
banana = 40;
console.log(orange, banana);
laranja = 300;
orange = 400;
console.log(orange, banana);
const apple = 2;
// apple = 20;
console.log(apple);
| true |
0e2be6461b4ca49e7c42a0c86bea83bc31049e89 | JavaScript | leclm/CeV-JavaScript | /ex018.js | UTF-8 | 184 | 3.71875 | 4 | [
"MIT"
] | permissive | // estrutura de repetição com variável de controle
for(c = 1; c <= 3; c++) {
console.log('oi bobo')
}
var c = 1
while(c <= 3) {
console.log('oi chato')
c++
} | true |
48c70bb2fe7e05626ec825e26646e6a8637e8bc3 | JavaScript | Kupavtsev/JS-Examples | /_base_JS/Functions/CallBacks/button_textarea.js | UTF-8 | 269 | 2.828125 | 3 | [] | no_license | 'use strict';
/*
let addPost = function() {
let text = document.getElementById('new-post').value;
alert(text)
};
*/
let addPost = () => {
//debugger;
let text = document.getElementById('new-post').value;
alert(text)
};
window.addPost = addPost; | true |
828330f04445c67177668e671da8aaafbc6f1167 | JavaScript | rupesh1999/time-stamp-api | /server/utils/convert.js | UTF-8 | 754 | 2.984375 | 3 | [] | no_license | const moment = require('moment');
function convert(time) {
let object;
let timeString = time.toString();
if(moment(time , "M-D-YYYY" , true).isValid()) {
let unix = moment(timeString, "M-D-YYYY").valueOf();
let utc;
object = {
unix: unix,
utc: moment(time).f... | true |
cc28e35a10f65e847c3ab4fa006964dd2623175d | JavaScript | trustvox/ember-cli-accounting | /addon/unformat.js | UTF-8 | 1,941 | 3.546875 | 4 | [
"MIT"
] | permissive | import { number } from "./settings";
/**
* Takes a string/array of strings, removes all formatting/cruft and returns the raw float value
* Alias: `accounting.parse(string)`
*
* Decimal must be included in the regular expression to match floats (defaults to
* accounting.settings.number.decimal), so if the number u... | true |
7fd4fda38c1851a0a3a34186f9dff8e48f621c55 | JavaScript | sanazez/myproject | /app.js | UTF-8 | 1,489 | 2.671875 | 3 | [] | no_license | const express = require("express");
const app = express();
const fs = require("fs");
app.use(function(request, response, next) {
let days = ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'];
let now = new Date();
let day = now.getDay();
let date = now.getDate()
let hour = now.getHours() + "";
if (hour.... | true |
3f4273edbe58e7ad2ecb65aae280f5d7fb8ec41f | JavaScript | chiquyet199/react-class | /testing-react-features/src/App.js | UTF-8 | 601 | 2.859375 | 3 | [] | no_license | import React, {useState} from 'react';
import './App.css';
function App() {
let counter = 1
const [count, setCount] = useState(0)
const onBtnClick = () => {
counter = count + 1
setCount(counter)
}
return (
<div className="App">
<header className="App-header">
<Child/>
<h1... | true |
1097409eab66e2035f4cb7388a3ae8e5025e3d11 | JavaScript | Alisa-InWonderland/react-ci-sample | /src/App.test.js | UTF-8 | 1,988 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | import { render, screen, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event'
import App from './App';
describe('<App/>', () => {
const addPlayer = playerName => {
userEvent.type(screen.getByLabelText('playerNameInput'), playerName)
screen.getByTestId(/add/i).click();... | true |
0de0af5a5d54fe24a6f3a7a0234c6b1cba8a14bf | JavaScript | thinkful-ei21/sonya-noteful-v1 | /test/server.test.js | UTF-8 | 7,242 | 2.703125 | 3 | [] | no_license | 'use strict';
const app = require('../server');
const chai = require('chai');
const chaiHttp = require('chai-http');
const expect = chai.expect;
chai.use(chaiHttp);
describe('Reality check', function () {
it('true should be true', function () {
expect(true).to.be.true;
});
it('2 + 2 should equal 4', fun... | true |
e3231388f30e945c2b6e76050024d067d115ee03 | JavaScript | MingjingPang/Apparel-Station | /testapp.js | UTF-8 | 2,025 | 2.65625 | 3 | [] | no_license | // Firebase configuration
var firebaseConfig =
{
apiKey: "AIzaSyAabP0_wNf6rRz4q_YFjwPps4MOA0jZpiM",
authDomain: "apparel-station.firebaseapp.com",
databaseURL: "https://apparel-station.firebaseio.com",
projectId: "apparel-station",
storageBucket: "apparel-station.appspot.com",
messagingSender... | true |
007139703b86418c5b3b020f58c3b69870c33fee | JavaScript | krzysztofowsiany/socialspeedway | /www/js/Game/Synchronization/ProfileSynchronize.class.js | UTF-8 | 1,754 | 2.578125 | 3 | [] | no_license | function ProfileSynchronize(sock){
var _this_ = this;
this.socket = sock;
this.socket.on('syncProfileResultData',resultData);
this.socket.on('syncProfileCheckResult',checkResult);
/**
* result Data
*/
function resultData(profile) {
CORE.LOG.addInfo("PROFILE_SYNCH:resultData");
gameData.data.... | true |
c3d6080d93d1f4ba2ec6cd801b7558d2f6339242 | JavaScript | mohoto/covid-app | /src/reducer/reducer.js | UTF-8 | 422 | 2.703125 | 3 | [] | no_license | export const initialState = {
countryCode: "worldwide"
}
export const actionTypes = {
SET_COUNTRY_CODE: 'SET_COUNTRY_CODE'
}
const reducer = (state, action) => {
switch (action.type) {
case actionTypes.SET_COUNTRY_CODE:
return {
...state,
countryCode: ac... | true |
ecb8397f36a08455f49b85c10efbbc45f1597457 | JavaScript | Tenukki/MetropoliaApi | /Kämäri/Käyttöliittymä(10-20)/src/App.js | UTF-8 | 2,681 | 3.046875 | 3 | [] | no_license | import React, {useState,useEffect} from 'react';
import Connect from "./connect"
function App() {
const [events, setEvents] = useState([])
const [eventsDate, setEventsDate] = useState([])
const [eventName, setEventsName] = useState("")
const [location, setLocation] = useState("")
const [date, setDate] = us... | true |
9f956b87dc6adb132f25e6d2dc04d242c99af6fb | JavaScript | dzgcsmthmt/react | /fiber.js | UTF-8 | 2,457 | 3.140625 | 3 | [] | no_license | class FiberNode {
constructor(vnode) {
this.vnode = vnode;
this.name = this.vnode.tag;
this.child = null;
this.sibling = null;
this.return = null;
this.render();
}
render() {
let children = this.vnode.children || [];
this.child =... | true |
429faefc47d5cc4eb9e03847da3c7011f18b877e | JavaScript | vetalxpro/portfolio | /source/js/modules/generate-slider-text.js | UTF-8 | 1,212 | 2.828125 | 3 | [] | no_license | module.exports = function (container, element) {
function init(){
container.empty();
splitCharacters();
setAnimation();
}
function splitCharacters() {
var text;
if (container.hasClass('slider__main-subtitle')) {
text = element.data('title');
}
if (container.hasClass('slider__tec... | true |
0a636ed2312a8b97b4e1dbc22b0527044691b517 | JavaScript | Abdullko/Abdullah_pwc_1 | /workspace/Day1/Numbers.js | UTF-8 | 211 | 3.3125 | 3 | [] | no_license | console.log(1 + 1); // 2
console.log(1 + 1.5); // 2.5
console.log(3 / 2); //1.5
console.log(1.5E5); // 150000
console.log(1.5E-5); // 0.000015
console.log(1 / 0); // Infinity
console.log((1 / 0) * 0); // NaN | true |
988eaa8e32661a900e00bd591316453401cf0b30 | JavaScript | dootMaster/DSAMasterclassChallenges | /Array Challenges S6/findLongestSubString.js | UTF-8 | 429 | 3.125 | 3 | [] | no_license | function findLongestSubstring(str) {
let duplicateHash = {};
let counter = 0;
let maxLength = 0;
for(let i = 0; i < str.length; i++) {
if(duplicateHash[str[i]] === undefined) {
duplicateHash[str[i]] = i;
counter++;
if(counter > maxLength) maxLength = counter;
}
else {
... | true |
1c4f13017aba8535591c0dbe20705ed1d5e9a000 | JavaScript | hjxgit1/Huawei | /portal/show/src/main/webapp/js/Test01.js | UTF-8 | 192 | 2.671875 | 3 | [
"MIT"
] | permissive | window.onload=function(){
var js=document.getElementById("js");
js.onclick=function(){
var txt=document.getElementById("txt").value;
alert(txt)
}
}
| true |
ad458be4254fcefd954284d94f400c489ef26a20 | JavaScript | acannon1/Calculator-Reactjs | /src/Calculator.js | UTF-8 | 3,322 | 3 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import Pad from './Pad.js'
import Display from './Display.js'
const Calculator = () => {
const [display, setDisplay] = useState('');
const [history, setHistory] = useState('');
const [op, setOp] = useState('');
const [v1, setV1] = useState('')... | true |
78d079f5206b2108164980041512c2b07ef96a6c | JavaScript | yun-cn/Shop-extension | /dub_j_supreme_v2.js | UTF-8 | 1,800 | 2.90625 | 3 | [] | no_license | // Photo Name of item
var target = 'CVsY6ESWH2w'
// Your size
var preferredSize = "Medium"; // "Small", "Medium", "Large", "XLarge"
$('#container article div img').each(function() {
var href = $(this).attr('src');
//console.log(href.match(target));
if (href.match(target)) {
$(this)[0].click();
}... | true |
f5aedc8ae9200c8a5df8bd1428a0424af4b3500b | JavaScript | eaverdeja/react-udemy | /components-exercise/src/App.js | UTF-8 | 713 | 2.609375 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import UserInput from './User/UserInput/UserInput'
import UserOutput from './User/UserOutput/UserOutput'
class App extends Component {
state = {
username: 'anderson silva'
}
changeUsername(newUsername) {
this.setState({
username: newUse... | true |
d4ff9dc84377f3b3875d88b3740db0e85442b5fb | JavaScript | courtneydowns/jsFundamentals | /ClassRoomChallenges/Day4/forInLoops/forInLoops.js | UTF-8 | 4,396 | 4.28125 | 4 | [] | no_license | //forInLoops are primarily used for objects
//forOutLoops are primarily used for arrays
let student = {
name: "Tony", //use quotes because it's a string
//"name" is a property (key), "Tony" is the value
awesome: true, //don't put in quotes because it's a boolean
certification: "JavaScript",
week: 1... | true |
4033f1ff176ae0227e9196975637213bd570f373 | JavaScript | Andrii87/K2_test_project | /fetch.js | UTF-8 | 4,839 | 3.296875 | 3 | [] | no_license |
var i; //global variable for index
//-----------this is initial fetch----------//
fetch('https://my-json-server.typicode.com/TomaszJaworski/test-api/news')
.then(response=>{
return response.json();
})
.then(data =>{
... | true |
1669be78f1ff2cfae49045d021373f3bd8638651 | JavaScript | jianghong/gifter | /routes/user.js | UTF-8 | 2,270 | 2.53125 | 3 | [] | no_license | var twitter = require('ntwitter'),
WordPOS = require('wordpos'),
natural = require('natural'),
twit = new twitter({
consumer_key: 'ApwwcXIDaoSUiFawySFVw',
consumer_secret: '0EWiins2F69SQASZfFd8kragMkfjeVzrKOFgMP00Ls',
access_token_key: '850257398-sajSlk0nV0R2yIDXtP8dpkvYKbJEIwOvnmgQvNVp',
access_token_sec... | true |
b42e396012d8484d8cc3ac26965488705144e6a5 | JavaScript | juancarlosagreda/SoftwareProject | /SE2020_D2_T1/webapps/HelpHunters/js/registerClient.js | UTF-8 | 1,484 | 2.921875 | 3 | [
"MIT"
] | permissive | function registerUser(){
console.log("Iniciando el registro", " el nombre es ", fisrtname.value, " el apellido es ", lastname.value, " el género es ", female.checked, " y no es ", male.checked, " el email es ", email.value, " el password1 ", password1.value, " el password2 es ", password2.value);
// Completar o... | true |
3097bf60b2cfd420b00cf18cf810ac290021170f | JavaScript | crstffr/tessel-cross | /public/app/class/instrument.js | UTF-8 | 156 | 2.6875 | 3 | [] | no_license | export class Instrument {
constructor (name, input, color) {
this.name = name;
this.input = input;
this.color = color;
}
} | true |
8303b09d9f718b5b2a44a549e556f83d062e51db | JavaScript | CrazyMatt/QuickUpCompiler | /scripts/compiler.2.0.js | UTF-8 | 6,770 | 2.859375 | 3 | [
"MIT"
] | permissive | /*
THIS COMPILER VERSION IS NOW DEFUNCT. TO ENSURE PROPER EXECUTION, USE QUICKUP COMPILER SCRIPT 2.1.
QuickUp Compiler Script 2.0
Copyright (c) 2016 Crazymatt.net
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Soft... | true |
dce6aa4eb14b0048c5ff173fa0792b62ba97d659 | JavaScript | kweedagama/neurooms-scraper | /src/db/database.js | UTF-8 | 895 | 2.59375 | 3 | [] | no_license | require("dotenv");
let mongoose = require("mongoose");
const server = process.env.MONGO;
const db = "neu-rooms";
/**
* Class to create and close mongodb connection and mongoose instance.
*/
class Database {
constructor() {
this._connect();
}
_connect() {
if(!server || !db) {
throw new Error("Mon... | true |
61f6cc31c09e4113d6f9e315f173ba314d31d552 | JavaScript | Peter-Gemmell/Unit6-01 | /script.js | UTF-8 | 220 | 3.234375 | 3 | [] | no_license | function getRndInteger(min, max) {
return Math.floor(Math.random() * (min + max));
}
let c = +document.getElementById('demo').value
let i = +document.getElementById('x1').value
if (c === i) {
alert= ("correct");
}
| true |
66b58477d1a0b065baff4e4975b7ca18dc56c82a | JavaScript | Irisjunior/curso_javascript | /aula14/aula14.js | UTF-8 | 98 | 3.203125 | 3 | [] | no_license | //AULA DE LOOP DE REPETIÇÃO
for(let c = 1; c<=10; c++){
console.log(c);
}
console.log('fim') | true |
665d85832fb39f0f9e85ec093238c18312f26e42 | JavaScript | matush97/sinusCosinus | /script.js | UTF-8 | 1,231 | 3.078125 | 3 | [] | no_license | var number = 1;
var data=[
{y:[], mode:'lines', name: "sin"},
{y:[], mode:'lines', name: "cos"}]
if(typeof(EventSource) !== "undefined") {
var source = new EventSource("http://vmzakova.fei.stuba.sk/sse/sse.php");
// http://vmzakova.fei.stuba.sk/sse/sse.php
source.addEventListener("message", funct... | true |
2570800c3a84846c7dc27a82a6ff1ea002bdf641 | JavaScript | tracy-tucker/counter-assignment | /src/components/Counter.js | UTF-8 | 1,930 | 3.765625 | 4 | [] | no_license | import React from 'react';
class Counter extends React.Component {
//Method called BEFORE anything else when component is initialized.
//Setting initial state
//super(props) - Referecing the parent class constructor, assigning this to props
constructor(props) {
super(props);
this.stat... | true |
b5f02eb28ca01d316502335c6a56d60e2dca78d3 | JavaScript | retq/AR-Protect | /AR-protect/template/template-help.js | UTF-8 | 1,392 | 2.53125 | 3 | [
"MIT"
] | permissive | const settings = await Guild.findOne({
guildID : message.guild.id
}, (err, guild) => {
if(err) console.error(err)
if(!guild){
const newGuild = new Guild({
_id: mongoose.Types.ObjectId(),
guildID: message.guild.id,
... | true |
4f3d1d0a0b930a185698aca13bb21f9e5a0db303 | JavaScript | RaZeSloth/Coin-Flipper | /src/commands/currency/lottery.js | UTF-8 | 4,485 | 2.5625 | 3 | [
"MIT"
] | permissive | const Discord = require('discord.js');
const alphabet = require(`${__dirname}/../../tools/constants`).normalCharacters;
const send = require(`${__dirname}/../../tools/send`);
module.exports = {
name: "lottery",
description: "Buy a lottery ticket for 20 cents and you might even win!",
argument: "None",
perms: "Emb... | true |
3d6718e471b46bca96d3b9ede6db8694caae9373 | JavaScript | rythmE/gua.game.js | /editor/scene/main/paddle.js | UTF-8 | 674 | 2.53125 | 3 | [] | no_license | class Paddle extends GuaImage {
constructor(game) {
super(game, 'paddle')
this.setup()
}
setup() {
this.x = 100
this.y = 250
this.speed = 15
}
update() {
this.speed = config.paddle_speed
}
moveLeft() {
this.x -= this.speed
if (t... | true |
1c355ac236aea4aae82bb0a377a9c5cfbf226a4c | JavaScript | Srey1234/project_c-80 | /main.js | UTF-8 | 935 | 2.578125 | 3 | [] | no_license | function Pragraph1() {
var display_Paragraph_array = [];
for (var j = 1; j <= 4; j++)
{ var paral_input_box_array = document.getElementById("paral_input_box_"+j).value;
console.log(paral_input_box_); paral_input_box_array.push(paral_input_box_); }
console.log(paral_input_box_);
... | true |
bf410b6633ddf033efb0d129786b9aa3f65bdd8b | JavaScript | brunoventura/automata-music | /lib/interceptors/audio.js | UTF-8 | 933 | 2.53125 | 3 | [] | no_license | 'use strict';
import scale from '../scales/minor';
import { triad } from './chord';
const synth = new Tone.PolySynth(4, Tone.Synth).toMaster();
const time = 4;
let currentProgression;
const progression = [
[0, 4, 5, 3],
[0, 3, 4, 0],
[0, 3, 0, 4],
[0, 3, 4, 0],
[3, 4, 0, 2],
[3, 4, 0, 5],
... | true |
96649226f3b38590a9f8e0accfbae169a2678568 | JavaScript | BreGoNunez/tarea1TallerVue | /tallerTarea1/funciones.js | UTF-8 | 1,025 | 3.65625 | 4 | [] | no_license | class persona {
obtener() {
var usu = document.getElementById("Usuarios").value; //obtengo valor del usuario del txtfield
var contra = document.getElementById("Contrasenas").value; //obtengo valor de la contrasena del txtfield
this.f(usu, contra); //llamo a la funcion sin nombre que verifica si la... | true |
8d2be80c59cac0049e079fd4902fb5c2601bd812 | JavaScript | LtCodename/algorithms-and-data-structures | /Algorithms/BubbleSort.js | UTF-8 | 417 | 3.34375 | 3 | [] | no_license | let bubbleSort = (inputArr) => {
let length = inputArr.length;
for (let i = 0; i < length; i++) {
for (let j = 0; j < length; j++) {
if (inputArr[j] > inputArr[j + 1]) {
let tmp = inputArr[j];
inputArr[j] = inputArr[j + 1];
inputArr[j + 1] = t... | true |
d434fb5dc6eda4e1e63ad5419c31f5a6321a7ee5 | JavaScript | coolguy206/marvel-app | /my-app/src/SetObj.js | UTF-8 | 3,517 | 2.953125 | 3 | [] | no_license | import { Api } from './Api';
const setObj = (data, storage, str, $this) => {
// console.log(data);
data = data.map((val, i) => {
//get ids
var dataId = val.resourceURI;
return dataId;
});
// console.log(data);
// matchObj is for setting the character state
var matchObj = [];
// leftOverObj... | true |
2a3315ac0e9e23aeb3c7d8527e56246c72f7a567 | JavaScript | drzax/scraper-bechdel | /index.js | UTF-8 | 3,790 | 2.671875 | 3 | [] | no_license | var cheerio, sqlite, Promise, request,
$, q, db;
cheerio = require('cheerio');
sqlite = require('sqlite3').verbose();
Promise = require('promise');
request = require('request');
queue = require('queue-async');
const bechdel = 'http://bechdeltest.com/?list=all';
var fields = [
{name: 'id', type: 'TEXT PRIMARY KEY'}... | true |
32030b18b19b05faedffe7d21370ced4355dd963 | JavaScript | Steamforge/codex-effect-vscode | /demo/sample.js | UTF-8 | 481 | 3.734375 | 4 | [
"MIT"
] | permissive | const variableString = 'string';
const variableNumber = 42;
const variableArray = ['string', 1];
const variableObject = {
key1: 'value1',
key2: 100
};
const functionArrow = param => {
for (let i = 0; i < variableArray.length; i++) {
console.log(variableArray[i]);
}
};
const functionNoArrow = function(par... | true |
027ee2dd8af97ad614693889b1412e5fa26a162d | JavaScript | Harish-H-C/Register | /src/AWSDashboards/Deviation.js | UTF-8 | 681 | 2.703125 | 3 | [] | no_license | import React, { Component } from 'react';
import DeviationDisplay from './DeviationDisplay';
const url="http://localhost:8900/deviation";
class Deviation extends Component{
constructor(){
super()
this.state={
deviation:''
}
}
render(){
return(
<div>
<DeviationDisplay... | true |
30de26da47a1fc087af757541fc2d63126403bda | JavaScript | EvaLappski/Cohort2 | /src/components/queue.test.js | UTF-8 | 384 | 2.640625 | 3 | [] | no_license | import Queue from './queue'
test('test the class queue', () => {
const test = new Queue();
expect(test.getLength()).toEqual(0);
expect(test.push('Eva')).toEqual(['Eva']);
expect(test.getLength()).toEqual(1);
expect(test.push("Shane")).toEqual(['Eva', 'Shane']);
expect(test.getLength()).toEqual(2)
expect(test.sh... | true |
c9613ea9c0145c38d5c05fb74f81b778d2c774ad | JavaScript | hellom/blog | /42算法学习/_selection_sort.js | UTF-8 | 624 | 4.03125 | 4 | [] | no_license | /**
* 选择排序,时间复杂度O(n*n)
*/
function findSmallestIndex(array) {
var smallestElement = array[0];
var smallestIndex = 0;
for (var i = 0; i < array.length; i++) {
if (array[i] < smallestElement) {
smallestElement = array[i];
smallestIndex = i;
}
}
return smallestIndex;
}
function selectionSo... | true |
b6ba3840e78936d429cde5dd374482962623d8d5 | JavaScript | RSTeam02/Pascal-s-Triangle | /mvc/filewriter.js | UTF-8 | 518 | 2.84375 | 3 | [] | no_license |
//class for download as plain text
export class Filewriter {
setContent(input) {
this.blob = new Blob([input], { type: 'text/plain' });
}
createFile() {
let fileName = "result.txt";
let link = "";
link = document.getElementById("download");
link.downl... | true |
f3ad70ecc66b613f8af61820f7530f26609b22fa | JavaScript | amcarlso/hmrx | /src/components/TimeClock/TimeClock.js | UTF-8 | 3,430 | 2.578125 | 3 | [] | no_license | import React, {Component} from 'react';
import NavLoggedIn from '../NavLoggedIn/NavLoggedIn';
import './TimeClock.css'
import {Link} from 'react-router-dom';
import backButton from '../../images/back.png';
import axios from 'axios';
import moment from 'moment';
import Swal from 'sweetalert2';
import TimePunch from '../... | true |
b156473139084a19e5b685b41adee7044c5a1dad | JavaScript | nfwyst/sifrr | /packages/browser/sifrr-dom/src/dom/simpleelement.js | UTF-8 | 1,488 | 2.640625 | 3 | [
"MIT"
] | permissive | const template = require('./template');
const update = require('./update');
const { collect, create } = require('./ref');
const creator = require('./creator');
function sifrrClone(newState) {
// this = content
const clone = this.cloneNode(true);
clone.root = this._root;
clone._refs = collect(clone, this.stateM... | true |
21d05e9be9d14a0a6aacb556f5a7fdd0c164bc40 | JavaScript | jicool91/Undefined | /repeatStr.js | UTF-8 | 336 | 3.40625 | 3 | [] | no_license |
function repeatString(cnt, word) {
return word.repeat(cnt);
}
function repeatStr(cnt, word) {
var res = '';
for(var i = 0; i < cnt; i++) {
res += word;
}
return res;
}
function RepeatStr(cnt,word) {
var res = Array.apply(null, Array(10)).reduce(function(result) {
return result += word;
}, '')... | true |
db842fc0d727d847c98e51ae1128f46fdde5fd68 | JavaScript | TokiTheCurious/MamaMia_Recipe_Service | /api/recipe/index.js | UTF-8 | 812 | 2.5625 | 3 | [] | no_license | const Recipe = require('../models/recipe-model')
const recipeService = require('../service/recipe-service')
module.exports = async (req, res) => {
switch(req.method.toLowerCase()){
case 'get':
return await recipeGetRequests(req, res)
case 'post':
return recipeService.createR... | true |
40131b04f3a6b9272af9e9cd3400e9f760f02a46 | JavaScript | spagno/tanzu-framework | /pkg/v1/tkg/web/src/app/shared/contextual-help/build-script/build.js | UTF-8 | 1,603 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | const fs = require('fs');
const fm = require('html-frontmatter');
const removeHtmlComments = require('remove-html-comments');
const elasticlunr = require('elasticlunr');
const docsPath = 'src/contextualHelpDocs';
const lunrIndex = elasticlunr(function() {
this.addField('tags');
this.setRef('title');
this.... | true |
b6467bf8274661f51fa4960d1a1289163b5cc558 | JavaScript | OppositeVector/CanvasDrawing | /includes/js/FreeHandDrawing.js | UTF-8 | 1,817 | 3.140625 | 3 | [] | no_license |
function FreeHandLine(mp, c) {
this.points = [ mp ];
var lastPoint = mp;
var color = ToColor(c);
this.invalid = false;
this.AddPoint = function(mp) {
this.points.push(mp);
lastPoint = mp;
this.invalid = true;
}
this.Draw = function(image) {
for(var i = 1; i < this.points.length; ++i) {
DrawLine(th... | true |
c37d9a58b479c5fc6be818bbd6cb863b1a33ba93 | JavaScript | brenno-calado/trybe-exercises | /exercises/M2/15.1/testes-react/src/App.test.js | UTF-8 | 1,291 | 2.546875 | 3 | [] | no_license | import React from 'react';
import { render, screen, fireEvent } from '@testing-library/react';
import App from './App';
describe('Testing email input:', () => {
it('checks if email input is rendered', () => {
render(<App />);
const inputEmail = screen.getByLabelText('Email');
expect(inputEmail).toBeInThe... | true |
1878a308279fa1c3532470747fc93f8d3f208f7a | JavaScript | mateusz-wojcikjs/JS | /Regex/script.js | UTF-8 | 727 | 3 | 3 | [] | no_license | // .exec
const p = document.querySelector("p");
// const regex1 = new RegExp("\\w+@(\\w+\\.\\w{2,4})", "g");
const regex = /\w+@(\w+\.\w{2,4})/g;
// let search = regex.exec(p.textContent);
var search,
domains = [];
// search = regex.exec(p.textContent);
while ((search = regex.exec(p.textContent))) {
domains.pus... | true |
536751be0527e4b2367be79b07b09f7bba918b78 | JavaScript | IliaIliev94/SoftUni-Work | /JS Advanced/09. JS-Advanced-DOM-Manipulations-Lab/07. Dynamic-Validation/app.js | UTF-8 | 403 | 2.96875 | 3 | [] | no_license | function validate() {
console.log('TODO:...');
const emailFormat = /\w+@\w+.\w+/g;
let email = document.getElementById("email");
email.addEventListener("change", function() {
let emailText = email.value;
if(!emailText.match(emailFormat)) {
email.classList.add("error");
... | true |
410f14682f15f429673fc4c5af4ca4ba2d9fb5d8 | JavaScript | dishondavis/Rock-Paper-Scissors- | /main.js | UTF-8 | 1,022 | 3.609375 | 4 | [] | no_license | document.querySelector("button").addEventListener("click", function(){
let inputValue = document.querySelector("input").value;
console.log(inputValue)
randomPick()
userWeapon()
})
function randomPick(){
let randomChoice = Math.random()
if(randomChoice === "rock"){
alert("rock")
document.getEl... | true |
8df56db5ad9d5e00c4f25dab325db661a63f9bb8 | JavaScript | farzanemgh2020/Person-manager | /frontend/src/pages/HomePage.js | UTF-8 | 679 | 2.515625 | 3 | [] | no_license | import React, { Component} from 'react';
//import ReactMarkdown from 'react-markdown';
import marked from "marked";
class HomePage extends Component {
constructor(props) {
super(props);
this.state = { terms: null }
}
componentDidMount() {
const readmePath = require("../README.md");
fetch(rea... | true |
137c09e6ddc850b2c01250959c1dfcb399a65495 | JavaScript | harismn/App | /App.js | UTF-8 | 4,369 | 2.734375 | 3 | [] | no_license | /**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, {Component} from 'react';
import {
Platform,
StyleSheet,
Text,
View,
TextInput,
TouchableHighlight,
ScrollView
} from 'react-native';
export default class App extends Component {
co... | true |
e1aa88b0628a89fda626043de8732d1838ccda1b | JavaScript | bhatia2akshit/StudentService | /front-end/src/App.js | UTF-8 | 1,980 | 2.640625 | 3 | [] | no_license | import React, { Component } from "react";
import { Container, Table } from "reactstrap";
class App extends Component {
constructor(props){
super(props);
this.state = {students: []};
}
showForm = () => {
const Students = this.state.students;
return (
<div>
<form id= "add-app">
<Tab... | true |
a43588a71a7110def4efcadc8a30c4eeacc64aa3 | JavaScript | maxxiaobao/LIFE | /step2/task21/index.js | UTF-8 | 3,263 | 3.28125 | 3 | [] | no_license | /* 定义数组,保存信息 */
var textArray = new Array();
var tagArray = new Array();
/* 绑定事件处理程序 */
function addHandler(element,type,Handler){
if(element.addEventListener){
element.addEventListener(type,Handler,false);
}else if(element.attachEvent){
element.attachEvent(type,Handler);
}else{
element['on' + type] = Handle... | true |
30b5817b868bb4fb2fc1d5ea04d33f1c0c238cdd | JavaScript | dzheng24/data-structures-and-algorithms | /code-challenges/feb-2020/plus-one/__test__/plus.test.js | UTF-8 | 415 | 2.78125 | 3 | [
"MIT"
] | permissive | 'use strict';
const plusOne = require('../plus').plusOne;
describe('testing the plus one function', () => {
it('can add one to the integer', () => {
expect(plusOne([2,3,4])).toEqual([2,3,5]);
})
it('can add one to the integer when the last digit is 9', () => {
expect(plusOne([9])).toEqual([1,0]);
e... | true |
6f0b6023463dc7845114b0f91144835ebe22939b | JavaScript | Gimorgadom/tcc_mobile | /src/operators/bindComponent.js | UTF-8 | 888 | 2.53125 | 3 | [] | no_license | export function bindComponent(component) {
return (source) => source.lift(new BindComponentOperator(component));
}
class BindComponentOperator {
constructor(component) {
this.component = component;
}
call(subscriber, source) {
const subscription = source.subscribe(subscriber);
if... | true |
6b76866823ab07be03ea3f5fdade37b739884ff8 | JavaScript | saulvo/edabit | /.vscode/Total Volume of All Boxes/index.js | UTF-8 | 229 | 2.890625 | 3 | [] | no_license | function totalVolume(...boxes) {
return [...boxes].reduce((a, b) => {
return a + (b.reduce((c, d) => {
return c * d;
}, 1))
}, 0)
}
console.log(totalVolume([4, 2, 4], [3, 3, 3], [1, 1, 2], [2, 1, 1])); | true |
6d3e9401423286ce5872152d300f54972e5d195b | JavaScript | Mohit001/react_expencify_app | /src/reducers/expences.js | UTF-8 | 918 | 2.75 | 3 | [] | no_license | const expencesReducersDefaultState = []
export default (state = expencesReducersDefaultState, action) => {
switch(action.type){
case 'SET_EXPENSES':
return action.expenses;
case 'ADD_EXPENCE':
return [...state, action.expence]
case 'REMOVE_EXPENCE':
return... | true |
fc0043b619df7ae767aab32a7b88d934a2ee1bc3 | JavaScript | meboHQ/mebo | /test/Inputs/BaseText.js | UTF-8 | 2,494 | 2.796875 | 3 | [
"MIT"
] | permissive | const assert = require('assert');
const Mebo = require('../../src');
const BaseText = Mebo.Inputs.BaseText;
describe('BaseText Input:', () => {
it('Input should start empty', () => {
const input = new BaseText('input');
assert.equal(input.value(), null);
});
it('String value should be valid', () => ... | true |