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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
79fe22b5c7adc2a497cd131e4306cef3bbe5cfec | JavaScript | elastos/Elastos | /CR.CyberRepublic/back-end/scripts/convert_elip_json_to_md.js | UTF-8 | 897 | 2.515625 | 3 | [] | no_license | // MAKE SURE YOU RUN BUILD BEFORE THIS
// this should be run from the parent back-end folder, not scripts
// this is what sets the process.env
// node scripts/convert_elip_json_to_md.js
require('../dist/src/config')
const convertJsonToMd = require('./convert_json_to_md')
;(async () => {
const db = await require('..... | true |
57b898d19203ec9d59b7f6e0b5fe4f499ccc3b86 | JavaScript | alien200020/wikipedia-viewer | /myscript.js | UTF-8 | 822 | 2.71875 | 3 | [] | no_license | $('document').ready(function() {
$('#search').click(function() {
var searchTerm = $('#searchTerm').val();
var url = 'https://en.wikipedia.org/w/api.php?action=opensearch&search=' + searchTerm + '&format=json&callback=?';
console.log(url);
$.ajax({
type: "GET",
url: url,
async: false,
... | true |
9186038d1eca75324149cfac1971d59cb728ab30 | JavaScript | noah1234j/servicepublisher | /src/js/modules/encode.js | UTF-8 | 1,748 | 2.71875 | 3 | [] | no_license | const config = require('../../../settings.json')
const fs = require('fs')
var cp = require('child_process')
var $ = require('jquery')
//Sets up the encode
module.exports = encode
async function encode(title) {
//Starts the encoder
cp.exec(config.encoder)
//Now we check when it's started
var star... | true |
6c5d6cf1beadda01a350a9d5b543885c66881e57 | JavaScript | philholden/song-display | /src/rough-bounds-to-true-bounds.js | UTF-8 | 2,045 | 2.75 | 3 | [
"CC0-1.0"
] | permissive |
import canvasGetBounds from './canvas-get-bounds'
import Transform from './transform'
//Takes a song that has been meta info about verse metrics and renders
//each verse to a canvas. w and h is the desired width and height
//the function has two passes the first pass renders larger than
//desired size in order to get... | true |
7ab482288afa0fea04f95e3e812bdf2f56b02d68 | JavaScript | rmisca/hangman-game | /js/util.js | UTF-8 | 1,862 | 2.984375 | 3 | [] | no_license | let blink;
function loadPage(href) {
const xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", href, false);
xmlhttp.send();
return xmlhttp.responseText;
}
function loadLoginPage() {
document.getElementById("content").innerHTML = loadPage("template/login.html");
const logButton = document.getE... | true |
12ed8fe41555e3109720717f0e6960bf8c3f3d0d | JavaScript | hunteryun/vue-blog | /src/scripts/admin/write/category.js | UTF-8 | 3,351 | 2.640625 | 3 | [
"MIT"
] | permissive | //category.js
import { ref } from "vue";
import {ElMessage, ElNotification} from "element-plus";
const categoryRef = ref(null)
// 选择的值
const categoryValue = ref('')
// 标题及按钮居中
const centerDialogVisible = ref(false)
// 分类标题
const categoryText = ref('')
// 分类介绍
const categoryDescription = ref('')
// 分类图片
const categor... | true |
2fe5e9ee7f60e55b6793f28ef6cecd33b0cea15f | JavaScript | Ro5635/myUniGreggs | /frontend/interactivity.js | UTF-8 | 796 | 2.953125 | 3 | [] | no_license | $( document ).ready(function() {
$.getJSON( "high_value_data.json", function( json ) {
// dump json to leaderboard
const data = json;
const sortedData = data.sort((gregg1, gregg2) => gregg1.greggsDensity > gregg2.greggsDensity ? -1 : 1)
const leaderboard = document.getElementById("le... | true |
b26dcff4367ce513b5d330a5118e5234bc78bb67 | JavaScript | Heso113/ComputerStore | /computer.js | UTF-8 | 467 | 2.609375 | 3 | [] | no_license | class Computer {
constructor(name, desc, features, img, price) {
this.name = name;
this.desc = desc;
this.features = features;
this.img = img;
this.price = price;
}
getName() {
return this.name;
}
getDesc() {
return this.desc;
}
getF... | true |
410d90a11f354632d318d9a35c2698b09684edb9 | JavaScript | amrutaneo/neosoftreacttraining | /src/Signup.js | UTF-8 | 4,265 | 2.765625 | 3 | [] | no_license | import {Component} from "react";
import axios from "axios";
class Signup extends Component{
constructor() {
super()
this.state = {
onlineUsers:0
}
}
user = {}
getEmail = (event)=>{
console.log("event is",event.target.value)
this.user.email = event... | true |
af49e8c5d3f55a09bbfac0fbe60e6842aabc3919 | JavaScript | hayataka/samples | /tetrisWebSocket/webContent/js/index.js | UTF-8 | 1,282 | 2.578125 | 3 | [] | no_license | /// <reference path="../libs/lz-string.js" />
/// <reference path="../../typings/jquery/jquery.d.ts" />
/// <reference path="../../typings/underscore/underscore-1.7.0.d.ts" />
/// <reference path="config.js" />
/// <reference path="websocket.js" />
/// <reference path="tetris.js" />
/// <reference path="view.js" />
/... | true |
6d3d238aff4aa3421ebc21d9668d8f6a2882d6d2 | JavaScript | mrjared16/memnote | /frontend/src/api/noteAPI.js | UTF-8 | 2,536 | 2.90625 | 3 | [] | no_license |
let key = 0;
const createNote = () => {
return {
id: `id${key}`,
title: `title${key++}`,
};
};
const listNote = () => {
// const note = (id, title) => ({id, title});
return [createNote(), createNote()];
}
const listTag = () => {
let tag = 0;
const createTag = () => ({
... | true |
38d99916931c96af107013a155fc80d693c5ffcd | JavaScript | deafilion/CemeteryMania | /app.js | UTF-8 | 1,524 | 2.546875 | 3 | [] | no_license |
/**
* Module dependencies.
*/
var express = require('express');
var map = require('map');
var app = module.exports = express.createServer(), io = require('socket.io').listen(app);
function testData()
{
var x = Math.floor(Math.random()*11);
var y = Math.floor(Math.random()*11);
return { X: x, Y: y };
}
// ... | true |
3f2c93a1fa52ed11c73ebf19cf0cfc30149b5187 | JavaScript | marianashawky/tasks.Nti | /task2-main/jen.js | UTF-8 | 1,538 | 2.90625 | 3 | [] | no_license |
const fs = require("fs")
const yargs=require ("yargs")
readFileData = function(){
try {
data=fs.readFileSync("nots.json")
if(data.toString().length==0) throw new Error("errr")
data =JSON.parse(data.toString())
if(!Array.isArray(data))throw new Error(" ")
} catch (e) {
data=[]
fs.writeFileSync("not... | true |
1469294126488c05817f7716cf9dbfa3b5bef19b | JavaScript | ynonp/javascript-testing-course-examples | /20-mastermind-pt3/src/logic/bpnumber.js | UTF-8 | 872 | 3.09375 | 3 | [] | no_license | export default class BPNumber {
constructor(val) {
val = String(val);
this.valAsString = val;
if (isNaN(Number(val))) {
throw new Error('Only numeric values allowed:' + val);
}
if (val.charAt(0) === '0') {
throw new Error('Leading zeros not allowed:' + val);
}
this.val = val.... | true |
dd6e9de2252059ea1244c86c4c1877d2ade06cb7 | JavaScript | ioogustavo/RickAndMorty | /src/components/favs/FavPage.js | UTF-8 | 1,222 | 2.59375 | 3 | [
"MIT"
] | permissive | import React, { useEffect, useState } from 'react'
import styles from './favs.module.css'
import Card from '../card/Card'
import { connect } from 'react-redux'
function FavPage({ characters = [0] }) {
const [count, setCount] = useState();
useEffect(() => {
if (!characters.length) {
let f... | true |
f95f48c306cb8ed901bf46d3aa092b578e256254 | JavaScript | nealthom/indieweb | /src/components/scripts/phi.js | UTF-8 | 1,170 | 2.78125 | 3 | [
"MIT"
] | permissive | /* eslint-disable no-multi-assign */
/* eslint-disable no-param-reassign */
// We'll ride the spiral to the end and may just go where no one's been
// Spiral out, keep going ...
export default p => {
const phi = 1.6180339
p.state = []
p.dispatch = () => {}
let color = [p.random(140, 200), p.random(1... | true |
741467eeaa3463fa9d5c1104e89525baa6f7555f | JavaScript | kornalius/trafficker | /app/js/mixins/state.js | UTF-8 | 1,927 | 2.984375 | 3 | [
"MIT"
] | permissive | export default {
init () {
this._states = []
this._state = null
this.rollStates = false
},
get state () { return this._state },
get states () { return this._states },
set state (value) { this._state = value },
set states (value) { this._states = value },
get hasState () { return this._stat... | true |
acdc907ab08d556ce25bd14ec9adf2dd9fc64a5c | JavaScript | JessicaBarnett/tetris | /scripts/tetris/board/board.js | UTF-8 | 1,930 | 3.0625 | 3 | [] | no_license | /*
Generates a board, which is just an object in this format:
board: {
rows: _,
cols: _,
squares: []
}
*/
define([ 'lodash', 'utility/debug'], function(_, debug){
var newBoard = function(rows, cols) {
return {
rows: rows,
cols: cols,
squares... | true |
8a84c860f6ec464e04416028a4bb68530a751de4 | JavaScript | Downeastrussell/Bitcoin-Buddy | /src/components/home/home.js | UTF-8 | 4,337 | 2.625 | 3 | [] | no_license | import React, { Component } from "react"
// import btc from "../../importedMedia/bitcoin.png"
import btc1 from "../../importedMedia/blackBTC1.png"
import "./home.css"
export default class HomePage extends Component {
render() {
/*
Using the route parameter, find the animal that the
... | true |
7677014f8e68948bb3f7e993cbb6c4062a230a52 | JavaScript | micaorfali/App | /www/generala2/assets/js/generala.js | UTF-8 | 17,153 | 3 | 3 | [] | no_license | var contenedorDados = document.getElementById("contenedorDados");
var p1 = Storage.get("jugador1");
var p2 = Storage.get("jugador2");
var estadoDelJuego = {
dados: [],
dadosSeleccionados: [],
jugador: Math.floor(Math.random() * 2) + 1,
contTiros: 0,
puntajes: [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, ... | true |
469e5bb2e13e0575c4d4885b812e6680a7d9eec4 | JavaScript | IDMNYU/DM2193SP2015 | /awesome-web-class/javed_shahzaib/web/WebFinal/scripts/scripts.js | UTF-8 | 25,563 | 3.671875 | 4 | [] | no_license |
// global variables for the the scene selection and which line to display
var scenceSelection = "scene1";
var scene = 1;
var line = 0; // keeps track of line number
// this is scence 1
// will use global line variable
function scene1()
{
var dialogue = ["Arrow: This is a slow night",
"Felicty: Maybe your name i... | true |
4b370354cc5741a80cbc24fdc457137ff8fa5aa8 | JavaScript | mhtrmkholis/h8-p0-w2 | /exercise-6.js | UTF-8 | 1,821 | 4.125 | 4 | [] | no_license | // 1. Melakukan Looping Menggunakan While
// LOOPING PERTAMA
var while1 = 2
while (while1 <= 20) {
console.log (while1 + " - I love coding ");
while1 += 2;
}
// LOOPING KEDUA
var while2 = 20
while (while2 >= 2) {
console.log (while2 + " - I will become fullstack developer ");
while2 -= 2;
}
//----------... | true |
21880240c342b2d09e5ff83fcb8747a11c30f766 | JavaScript | ColeHorner/capstone-website | /src/TypeQuestion.js | UTF-8 | 1,441 | 3.34375 | 3 | [
"MIT"
] | permissive | import React from 'react'
class TypeQuestion extends React.Component{
constructor(props) {
super(props);
this.state = {value: '', answered: null}
this.handleChange = this.handleChange.bind(this)
this.handleSubmit = this.handleSubmit.bind(this)
this.colorChange = this.colorChange.bind(this)
}
... | true |
3146a9aa71c9c7076a2c0727e9a4f7c3ce0efed0 | JavaScript | hemendra2001/usermanagement | /server/controller/controller.js | UTF-8 | 2,183 | 2.703125 | 3 | [] | no_license | // Here Our GetUser API
const userModel = require("../model/userModel")
const getUser = async (req, res) => {
try {
const userget = await userModel.find();
res.status(200).json(userget);
}
catch (err) {
console.log(error);
res.status(500).json({ Error: "Internal Error" });
... | true |
09d9c092f2576bddc3fb49d077e4c681744c17be | JavaScript | wilsonneto-dev/RN_Redux_Hooks_Example_Bakery | /src/widget/fixedCosts/index.jsx | UTF-8 | 2,888 | 2.625 | 3 | [] | no_license | import React, { useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { Creators as FixedCostActions } from '../../store/ducks/fixedCosts';
import CurrencyInput from 'react-currency-input';
import Row from '../../layout/row';
import Col from '../../layout/col';
import './style.css'... | true |
ff910479c2ca1f3dc06f030c4ec77785d7a81f87 | JavaScript | telerik/kendo-react-inputs | /e2e/interaction.jsx | UTF-8 | 1,830 | 2.59375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | /* eslint max-params: [2, 5] */
const aMouseEvent = (type, x, y) =>
new MouseEvent(type, {
bubbles: true,
cancelable: true,
view: window,
clientX: x,
clientY: y
});
const aTouch = (el, x, y, id) =>
new Touch({
identifier: id,
... | true |
6b512e43854f88a67a2a6191f949514994426843 | JavaScript | nyc-wolves-2016/MackOverflow | /app/assets/javascripts/components/App.es6.jsx | UTF-8 | 405 | 2.546875 | 3 | [] | no_license | class App extends React.Component {
constructor() {
super();
this.state = {
searchBox: ''
}
this.onSearchChange = this.onSearchChange.bind(this)
}
onSearchChange(event) {
this.setState({ searchBox: event.target.value })
}
render() {
return(
<SearchBoxView onSearchChange=... | true |
5e8584c38c4286e1c12d072ba613d192da9c9f34 | JavaScript | nikolenkoanton92/victory-core | /test/client/spec/victory-util/prop-types.spec.js | UTF-8 | 10,445 | 2.671875 | 3 | [
"MIT"
] | permissive | /* global sinon */
/* global console */
import {PropTypes} from "react";
import {PropTypes as CustomPropTypes} from "src/index";
describe("prop-types", () => {
/* eslint-disable no-console */
// Directly lifted from https://github.com/react-bootstrap/react-prop-types
// And then adapted to work with our linter,... | true |
52653816baee35beb520c1b6c0bfc1ad1cb2183e | JavaScript | nerds-odd-e/react-clean-code-exercise | /src/components/Profile.js | UTF-8 | 2,052 | 2.71875 | 3 | [] | no_license | import React from 'react'
import merge from 'lodash/merge'
import Api from "../api";
export default class Profile extends React.Component {
state = {
profile: {
name: '',
birthday: {
year: 1980,
month: 1,
day: 1
}
}
}
handleNameChange(event) {
this.setState(... | true |
6a38d236f274dd2c87dd195528626fcb4fed80b3 | JavaScript | qaifikhan/VideoWatchPage | /index.js | UTF-8 | 3,967 | 2.78125 | 3 | [] | no_license | $(function () {
// var cardGrid = document.getElementById("card-grid");
var cardGrid = $("#card-grid");
// var progressBar = document.getElementById("progress-bar");
var progressBar = $("#progress-grid");
function createVideoCard(data) {
// <div class="playlist-card active-card">
// <a href="./watc... | true |
ae696f8323425eadcb67e9a494aa7449cfab8af9 | JavaScript | amillion3/jsObjectsFunctions | /functions.js | UTF-8 | 2,825 | 4.15625 | 4 | [] | no_license | console.log("functions rule");
//2 types of functions:
//function expressions
var a = function() {
console.log("a", 3);
};
//function declaration
function b() {
console.log("b ", 2)
}
var num = 3;
function numPrinter(monkeyButt) {
console.log(monkeyButt);
}
//function should do one thing and one thing only
//mo... | true |
1f2c27d7fb7f9ce6625cfc8f105db474ea684236 | JavaScript | benbrunton/Tetristeroids | /src/js/explosion.js | UTF-8 | 899 | 2.71875 | 3 | [
"MIT"
] | permissive | define(function(){
var MAX_AGE = 35;
function Explosion(pos, size){
this.age = 0;
this.isAlive = true;
this.size = size * 2;
this.location = pos.slice();
}
Explosion.prototype.getView = function() {
return {
location: this.location.slice(),
... | true |
fb0eca155e0d2ee1e2208c477f48c45e73b2eea1 | JavaScript | alwice/SabahTCM_000 | /lang/cn/file.js | UTF-8 | 1,394 | 3.015625 | 3 | [] | no_license | <script>
var input=document.querySelector('input');
var preview-document.getElementById('preview');
//var preview=document.querySelector('.preview');
input.style.opacity=0;
input.addEventListener('change',updateImageDisplay);
function updateImageDisplay(){
while(preview.firstChild){
preview.removeChild(prev... | true |
9588fa4037a9519e753181ed0c504bb89b47737c | JavaScript | Damonkala/relearnreact | /app.js | UTF-8 | 499 | 2.765625 | 3 | [] | no_license | import React, { Component } from 'react';
import { render } from 'react-dom';
import MyInput from 'components/input.js'
class Greeting extends Component {
constructor(props){
super(props);
this.state = { greeting: "GGello World"};
}
changeGreeting(value){
this.setState({ greeting: value })
}
render(){
r... | true |
a6ef45931ad9ca5fc73cb8361a382df787e62082 | JavaScript | minhphan2603/algorithm-exercises | /leetcode/70.js | UTF-8 | 348 | 3.65625 | 4 | [] | no_license | /**
* @param {number} n
* @return {number}
*/
var climbStairs = function (n) {
let result = 0;
for (let i = 0; i * 2 <= n; i++) {
const steps = n - i * 2 + i;
let temp = 1;
for (let j = 1; j <= i; j++) {
temp = (temp * (steps - j + 1)) / j;
}
result += temp;
}
return result;
};
co... | true |
c73395f2cf3ab803d71ab57c98dc3bc9cdeaa97c | JavaScript | SMSteen/MEAN-Assignments | /mongoDB/quoting_dojo/server/config/routes.js | UTF-8 | 604 | 2.65625 | 3 | [] | no_license | // require controllers.js file for all logic
const quotes = require('../controllers/quotes.js')
//export our file as a function to be used with app as paramater
module.exports = function(app){
//put all our routes here
// root request
app.get('/', function(request, response) {
quotes.index(request... | true |
068a1616c05919bafac47e1f0ca84a85487fa106 | JavaScript | Shreko62/Shrekulatrice | /js/calc.js | UTF-8 | 997 | 3.296875 | 3 | [] | no_license | let input = "";
let buttons = document.getElementsByClassName("button");
for (let i = 0; i < buttons.length; i++) {
buttons[i].addEventListener("click", showValue);
}
let clear = document.getElementById("reset");
clear.addEventListener("click", reset);
let skip = document.getElementByI... | true |
8d2507dba5d0eaabcb8f869363ec1c0e5852a17d | JavaScript | drwrose/doctors | /html/doctors_2_4_1_configure.js | UTF-8 | 1,910 | 2.53125 | 3 | [] | no_license | function makeOption(keyword, label, options) {
var role = "slider";
if (options) {
role = "select";
} else {
options = [[0, 'Off'], [1, 'On']];
}
document.write('<div data-role="fieldcontain"><label for="' + keyword + '">' + label + '</label><select name="' + keyword + '" id="' + keyword + '" data... | true |
ec808c12ba09af2e8b2c8c1b3a6840d4a0d79aed | JavaScript | kirkhenf/careerpear | /src/helpers/Date.js | UTF-8 | 295 | 2.859375 | 3 | [] | no_license | const DateHelpers = {
getNearestDay: function () {
let d = new Date();
let day = d.toLocaleString(window.navigator.language, { weekday: 'long' });
if(day == 'Saturday' || day == 'Sunday') return 'Monday';
else return day;
}
}
export default DateHelpers;
| true |
de03aede326a7ae38469896a49ac01b33831d1a9 | JavaScript | aaryaparekh/AccessPass | /server/models/schedules2018-2019.js | UTF-8 | 3,032 | 2.578125 | 3 | [] | no_license | const mongoose = require('mongoose');
const validator = require('validator');
const jwt = require('jsonwebtoken');
const _ = require('lodash');
const bcrypt = require('bcryptjs');
const moment = require('moment');
moment().format();
var ScheduleSchema = new mongoose.Schema({
date:{
type:String,
require:true,... | true |
e65d5055d9d8a9a2278417a2f3bcb974c1a6b315 | JavaScript | pasindupiumal/Library-Application | /public/components/AddBook.js | UTF-8 | 4,064 | 2.921875 | 3 | [] | no_license | import React, {Component} from 'react';
import axios from 'axios';
export default class AddBook extends Component{
constructor(props){
super(props);
this.state = {
authors: []
}
this.componentDidMount = () => {
fetch('/api/authors', {method: 'GET'}).then(... | true |
881e21b58bfef4af3e2b51cb0408764c0cff8324 | JavaScript | Fabian-Luque/giveaways-bot | /services/http.service.js | UTF-8 | 599 | 2.703125 | 3 | [
"MIT"
] | permissive | const fetch = require('node-fetch');
function requestHTTPS(method, url, headers, body) {
return new Promise((resolve, reject) => {
fetch(
url,
{
method,
body,
headers,
}
)
.then(res => res.json())
.then(json => resolve(json));
});
}
function execute(ur... | true |
ba7e9dd3c76faf2455156f6e2e641ecb5492d5c8 | JavaScript | vta/modeify | /test/server/location.js | UTF-8 | 898 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | var base = '/api/locations';
var supertest = require('./supertest');
var loc = {
address: '1111 Army Navy Drive, Arlington, VA 22202',
name: 'Home',
type: 'residence'
};
var agent = supertest.agent();
describe(base, function() {
before(function(done) {
agent
.get('/api/login-anonymously')
.ex... | true |
a518238b98c82e48240d7ea628b10c80bb0d00ab | JavaScript | raphaellopes/the-road-to-react | /src/App.test.js | UTF-8 | 3,449 | 2.546875 | 3 | [] | no_license | import { render, screen, fireEvent, act } from '@testing-library/react';
import axios from 'axios';
import App from './App';
import { stories } from './mockedTests';
jest.mock('axios');
describe('App', () => {
test('succeeds fetching data', async () => {
const promise = Promise.resolve({
data: {
h... | true |
bc258c82577ad677df10eb1d6626b72cc5374604 | JavaScript | FodorLaszlo86/react-calculator | /src/containers/Calculator/Calculator.js | UTF-8 | 6,083 | 2.828125 | 3 | [] | no_license | import React, { Component } from 'react';
import * as math from 'mathjs';
import classes from './Calculator.css';
import Buttons from '../../components/Buttons/Buttons';
import Display from '../../components/Display/Display';
import Header from '../../components/Header/Header';
class Calculator extends Component {
... | true |
17bf7e441bab5ae66b7eafffa39aec996c87c27d | JavaScript | focusaurus/white-glove | /src/type.js | UTF-8 | 279 | 2.53125 | 3 | [] | no_license | var ObjectID = require('mongodb').ObjectID
var tipe = require('tipe')
function type (value) {
var theType = tipe(value)
if (theType !== 'object') {
return theType
}
if (value instanceof ObjectID) {
return 'objectid'
}
return theType
}
module.exports = type
| true |
83b2a9a5388c7ffae22b3ccdb46fc78847f462e0 | JavaScript | kmkipta/AlgoProblems | /217ContainsDup.js | UTF-8 | 297 | 3.578125 | 4 | [] | no_license | /**
* @param {number[]} nums
* @return {boolean}
* RT: O(1) * n
*/
var containsDuplicate = (nums) => {
// use Set
const charSet = new Set()
for (let i = 0; i < nums.length; i++) {
const n = nums[i]
if(charSet.has(n)) return true
else charSet.add(n)
}
return false
}; | true |
33cfbbe006fe81d57a93176b07fded2f09f1c9a4 | JavaScript | jadenpadua/ACM-LeetCode-Tracker | /leetcode-tracker-FE/src/components/Question.js | UTF-8 | 4,165 | 2.65625 | 3 | [] | no_license | import React, { Component } from "react";
import Form from "react-bootstrap/Form";
import Button from "react-bootstrap/Button";
import axios from 'axios';
import Test from "./Test.js"
import './index.css'
import { Redirect } from "react-router-dom";
class Question extends Component {
constructor(props) {
super(p... | true |
920d2e31cff09a79cb8cce9717b3252b190a0d5f | JavaScript | Montana-Code-School/reactWeatherApp | /src/iconWidget/IconWidget.js | UTF-8 | 2,240 | 3.34375 | 3 | [] | no_license | import React, { Component } from 'react';
var FontAwesome = require('react-fontawesome');
// This exercise is getting building a component different from the weather table
// that will utilize the api data. Based on weather description found in the
// api response, render the following icons:
// http://fontawesome.i... | true |
c1c2f8c4a7356beaf5f0dd0b4ecdf2f719b270e0 | JavaScript | ECSBT/ConCoin | /conChain/main.js | UTF-8 | 1,753 | 2.671875 | 3 | [] | no_license | const {Blockchain, Transaction} = require('./blockchain');
const EC = require('elliptic').ec;
const ec = new EC('secp256k1');
const myKey = ec.keyFromPrivate('01b653d6c724491c23dfd2fe7c49394f953af5a686c957a8f74895cbaa35e18f');
const myWalletAddress = myKey.getPublic('hex');
let conCoin = new Blockchain();
/*
cons... | true |
03423e6683edcd4ac9f023f6548f35cac55972b3 | JavaScript | dedaMazai/github_parser | /src/components/paginator/paginator.js | UTF-8 | 3,360 | 2.515625 | 3 | [] | no_license | import React, {Component} from 'react';
import { connect } from 'react-redux';
import {selectBut, upButtons, lowerButtons, upButtonsThree, lowerButtonsThree} from '../../actions';
import './paginator.css';
class Paginator extends Component {
render() {
let {pageSize, totalCount, paginatorCount, selectBut... | true |
fe7f572a59a8f45cd5d7b820fe57982a66860a7f | JavaScript | x-mad/react-weather | /src/middlewares/map_data.js | UTF-8 | 1,535 | 2.671875 | 3 | [] | no_license | import { FETCH_CURRENT_FORECAST, FETCH_HOURLY_FORECAST, FETCH_FORECASTS} from '../actions';
export default store => next => action => {
switch (action.type) {
case FETCH_CURRENT_FORECAST:
action.payload.data = mapCurrentForecastData(action.payload.data[0]);
break;
case FETCH_HOURLY_FORECAST:
... | true |
50d9b98ccd096a8ed6e13365f0a0e3ded91adc47 | JavaScript | martinheidegger/mapslice | /test/util/pow2roundup.js | UTF-8 | 402 | 2.578125 | 3 | [
"MIT"
] | permissive | 'use strict'
const test = require('tap').test
const pow2roundup = require('../../lib/util/pow2roundup')
const tests = {
0: 1,
1: 1,
2: 2,
3: 4,
4: 4,
5: 8,
8: 8,
9: 16,
15: 16,
16: 16,
17: 32
}
for (const key in tests) {
test(`Rounding up to the next power of two should result in ${tests[key]} ... | true |
5e94b62c1048aaf91cc55a8f2a88a88a62be0ff2 | JavaScript | oshancsedu/bengalServer | /public/js/addArea.js | UTF-8 | 1,111 | 2.59375 | 3 | [
"MIT"
] | permissive | $('document').ready(function(){
$('#btadd').click(function(){
var areaCode=$('#area_code').val();
var areaName=$('#area_name').val();
var distributorName=$('#distributor_name').val();
var rsoName=$("#rso_name").val();
var MSID=$("#ms_id").val();
if(areaName=="" || ar... | true |
577db1fe36eaa6d7c2d4393495b7ed22cad0368a | JavaScript | AdrianaPineda/training | /hackerrank/easy/ice-cream-parlor.js | UTF-8 | 2,222 | 3.890625 | 4 | [] | no_license | // Complete the icecreamParlor function below.
// https://www.hackerrank.com/challenges/icecream-parlor/problem
function icecreamParlor(money, iceCreamCosts) {
const costIndexesDict = getIceCreamCostIndexes(iceCreamCosts);
const selectedIndexes = getSelectedIceCreamsIndexes(money, costIndexesDict)
return se... | true |
08bf3a023d54eb07c0465afcb422cf86de7c8a8e | JavaScript | SaintRock/SaintRock | /app/assets/javascripts/rotate.js | UTF-8 | 514 | 2.53125 | 3 | [] | no_license | var selected = 0;
function scroll_scaffolds(delta, speed) {
selected = selected+delta;
$('#wrapper').animate({scrollLeft: 268*selected}, speed);
}
$(document).ready(function() {
$('#rotate-arrow-left').click(function () {
if (selected <= 2) {
scroll_scaffolds(gallery_count, 0);
}
scroll_scaffold... | true |
e5fc78af358daf45820aeed4509f0375976d171f | JavaScript | dn190187kaj/whalesoft_finish | /Task 3/js/main.js | UTF-8 | 3,063 | 2.71875 | 3 | [] | no_license | $(function(){
//Создаем первый taglist
function createList(arr){
var list = [];
for (var i = 0; i < arr.length; i++) {
list.push('<li class="tag">'+ arr[i]+'<span class="delete-tag glyphicon glyphicon-remove hide"></span></li>');
}
list.push('</ul>');
list.unshift('<ul>');
list = list.join('');
$('.t... | true |
63cbadf9ea4c8f8c453ab8f35acbab7a362c4492 | JavaScript | johnny-morrice/crimemap | /crimemap/static/script.js | UTF-8 | 6,178 | 2.796875 | 3 | [] | no_license | var datamap;
// crimeReports is global variable to enable popupTemplate.
var crimeReports = {};
$(document).ready(function() {
drawMap();
loadDateRange();
});
// Alternatively with jQuery
$(window).on('resize', function() {
if (datamap != null) {
datamap.resize();
}
});
function drawMap() {
// D... | true |
7693a72ede080cde6cdd95fe48ec5c52ee14d258 | JavaScript | Jonathanhovland/weather-application | /src/Components/Weather.js | UTF-8 | 1,078 | 2.5625 | 3 | [] | no_license | import React from "react"
const Weather = ({ weatherData }) => {
return weatherData.map((dailyData, i) => {
return(
<React.Fragment>
<div className="flex-container">
<div className="list-group">
<div className="list-group-item" key={i... | true |
a52945984a4c21963b6af9bb1ed53c005919f514 | JavaScript | tjcarskadon/recast.ly | /src/lib/searchYouTube.js | UTF-8 | 596 | 2.6875 | 3 | [] | no_license | var searchYouTube = (options, callback) => {
// TODO
// console.log("Options: ", options);
var APIURL = `https://www.googleapis.com/youtube/v3/search?part=snippet&key=${options.key}&q=${options.query}&maxResults=${options.max}`;
$.ajax({
// This is the url you should use to communicate with the parse API ser... | true |
cd9457fc40dbd34680946d6030f541d0f9768d09 | JavaScript | notablemind/manager | /index.js | UTF-8 | 3,321 | 2.5625 | 3 | [
"MIT"
] | permissive |
var _ = require('lodash')
module.exports = Manager
function Manager(options) {
this._pending = {}
this._map = {}
this._on = {}
options = options || {}
if (options.genId) this.genId = options.genId
if (options.defaultNode) this.defaultNode = options.defaultNode
if (options.handleError) this.handleError ... | true |
8c0a7b85b101ac4c12fc660fc904714014d7b6bc | JavaScript | Kush19974/ticker-tape-backend | /apis/exectuedOrder.js | UTF-8 | 5,095 | 2.796875 | 3 | [] | no_license | const moment = require('moment');
async function exectuedOrder(executedOrderList, tickerTape, currentOrder) {
try {
let tick = currentOrder.tick;
let type = currentOrder.type;
if (type == 'buy') {
// get the latest order for the opposite side i.e Sell side
let to... | true |
b4c65435ccb01c8ffd7e640a37492dcbce3de42a | JavaScript | linkorb/tweakjs | /src/tweak.js | UTF-8 | 4,199 | 2.515625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | (function (w, d) {
var t = {
debug: false,
setDebug: function() {
this.debug = w.tweakDebug || this.debug
},
log: function (data) {
if (this.debug) console.log(data)
},
getHandler: function (action) {
return typeof t.handlers[action] === 'function' ? t.handlers[action] : null... | true |
db67d7f03f54ccd12fb421229bf457228c301c36 | JavaScript | craft-ai/alpes | /src/transfomers/rateLimit.js | UTF-8 | 935 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | const { transduceToStream } = require('./transduce');
const delay = require('../basics/delay');
function createRateLimitTransformer(interval) {
return (reducer) => {
let minNextEventTime = 0;
return (accumulation, event) => {
if (event.error || event.done) {
return reducer(accumulation, event)... | true |
4612cdb2263888818de17e0cefef979da539bedf | JavaScript | kamilr96/randomTasks | /codewars/javascript/7kyu_findTheNthDigitOfANumber.js | UTF-8 | 981 | 4.46875 | 4 | [] | no_license | /*
Complete the function that takes two numbers as input,
num and nth and return the nth digit of num (counting from right to left).
Note
If num is negative, ignore its sign and treat it as a positive value
If nth is not positive, return -1
Keep in mind that 42 = 00042. This means that findDigit(42, 5) would r... | true |
7dae9d08f4697c5cdab4d3041a6b603734c5f56b | JavaScript | CrgioYalux/memory_game | /src/helpers/ArrayUtilities.js | UTF-8 | 845 | 3.5625 | 4 | [] | no_license | export const range = (size, startAt = 0) => {
return [...Array(size).keys()].map((i) => i + startAt);
};
export const arrayOfLetters = (size) =>
characterRange('A', getCharFromInt((size ** 2 - 1) / 2));
export const characterRange = (startChar, endChar) => {
return String.fromCharCode(
...range(
endChar.charC... | true |
0bed76bab41d04ff5b9a0b47e74419e42d736b76 | JavaScript | nesherson/confessions-clone-frontend | /src/util/helpers.js | UTF-8 | 187 | 2.71875 | 3 | [
"MIT"
] | permissive | export const parseDate = (date) => {
const options = {
year: 'numeric',
month: 'long',
day: 'numeric',
};
return new Date(date).toLocaleDateString('en-GB', options);
};
| true |
6ece118d8138a5cd230c437c615f32fc1e8eb60e | JavaScript | yangrenmu/IFE-2016 | /第二阶段/task18/js/main.js | UTF-8 | 1,606 | 3.09375 | 3 | [] | no_license | window.onload=function(){
var button=document.getElementsByClassName('button');
var numInput=document.getElementById('num-input');
var ul=document.getElementById('show');
var text="";
button[0].addEventListener('click',function(){
var input=numInput.value.trim();
if(!input.matc... | true |
94dbfc2556356af71f458281a63908f2064d191c | JavaScript | sssharkie1/gall-test | /gallant-grapes-BACKUP/assets/javascript/brew.js | UTF-8 | 6,185 | 3.125 | 3 | [] | no_license | $(document).ready(function() {
// Variables
var brewery = []; // holds all brewery info
var counter = 0;
var beerCount = 0;
// User selected ranges
var srmMin = 0,
srmMax = 100,
ibuMin = 0,
ibuMax = 100,
abvMin = 0,
abvMax = 100
// Firebase
var config = {
apiKey: "AIzaSyBl1DC0XlwyV4UkPh0dyOD... | true |
6a634f5c2bafd6a05e68153aa748130b669dae94 | JavaScript | Nakuln23/theHackingSchool | /DSAlgos_Practice/fizzBuzz.js | UTF-8 | 250 | 3.5 | 4 | [] | no_license | function fizzBuzz(num){
for (var i = 1; i <= num; i++){
if(i % 15 === 0) console.log("FizzBuzz")
else if(i%5 === 0) console.log("Buzz")
else if(i % 3 === 0) console.log("fizz")
else console.log(i)
}
}
fizzBuzz(30) | true |
9e4f57dfefc7d4e0af3028bb4c018802698ab152 | JavaScript | kprakobkit/pos | /src/reducer.js | UTF-8 | 664 | 2.671875 | 3 | [] | no_license | import constants from '../src/constants';
import _ from 'underscore';
const INITIAL_STATE = {
isLoading: true
};
function setState(state, newState) {
return _.extend({}, state, newState);
}
export default function reducer(state = INITIAL_STATE, action) {
switch (action.type) {
case constants.SET_STATE:
r... | true |
7c1e1ee4c0a93948fe18e6affb6546548377d213 | JavaScript | zladuric/simple-odm | /test/unit/type.test.js | UTF-8 | 5,286 | 2.65625 | 3 | [
"MIT"
] | permissive | import { expect } from 'chai';
import Types from '../../src/types';
import typeFunctions from '../../src/type-functions';
import { ObjectID } from 'mongodb';
describe('type', function () {
describe('.isValidType(value)', () => {
it('should check if value is a type object.', () =>
{
exp... | true |
07995d0f7e9c2293d489ef4c20580724cbc5173c | JavaScript | mickyginger/angular-satellizer | /api/app.js | UTF-8 | 5,780 | 2.546875 | 3 | [] | no_license | var express = require('express');
var morgan = require('morgan');
var mongoose = require('mongoose');
var bodyParser = require('body-parser');
var cors = require('cors');
var jwt = require('jsonwebtoken');
// request is used to make requests to external servers like facebook and twitter's APIs
var request = require('re... | true |
e040280c2954466c31785a74eb11a50b44060e08 | JavaScript | TristanMngr/apiJerseyV2 | /src/main/webapp/js/eventos/alarm.js | UTF-8 | 1,171 | 2.515625 | 3 | [] | no_license | $(document).ready(function () {
$("#btnSubmitCrearAlarmas").hide();
$("#btnSubmitCreateAlarm").click(function () {
alert("Create Alarm. Not yet implemented");
createAlarm();
$("#btnSubmitCrearAlarmas").hide();
});
});
function createAlarm() {
var codigo = $("#codigo").val();
... | true |
283e7a28e7825fbd1af77fa86c9578c677defdc9 | JavaScript | danetomseth/Blink1.5 | /browser/js/position/position.factory.js | UTF-8 | 7,067 | 2.6875 | 3 | [] | no_license | // Analysis of tracker positions
core.factory('PositionFactory', function(ConstantsFactory) {
let browThreshold = 15;
let diffZeroL = 0;
let diffZeroR = 0;
let browZero = [];
let pupilZeroArray = [0, 0];
let xDiffAvg = [0, 0, 0];
let yDiffAvg = [0, 0, 0];
let xDiff = 0;
let yDiff = 0... | true |
4f72472376e4261fad812ed10ded0329e2e1d162 | JavaScript | thinkful-ei18/christina-hot-or-cold | /src/components/game.js | UTF-8 | 2,402 | 2.921875 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | import React from 'react';
import Header from './header';
import GuessSection from './guess-section';
import GuessCount from './guess-count';
import GuessList from './guess-list';
import './game.css'
export default class Game extends React.Component {
constructor(props) {
super(props)
this.stat... | true |
247b5dfd33a06d20390051127997498dd76f92b5 | JavaScript | RobSIM37/js-basics-1 | /password.js | UTF-8 | 522 | 3.125 | 3 | [] | no_license | const readline = require('readline');
const reader = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
reader.question("Please enter a password with at least 10 characters: ", function(input){
if (input.length >= 10) {
console.log("You have entered a valid password.")
... | true |
1b72c54912d069a06129f83966f0815e37a0df17 | JavaScript | Marco-Jardim872/URI-DESAFIOS-PAG02 | /1045 - Tipos de Triângulos.js | UTF-8 | 987 | 3.53125 | 4 | [] | no_license | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = input.split(' ');
let x = parseFloat(lines.shift());
let y = parseFloat(lines.shift());
let z = parseFloat(lines.shift());
let arr=[];
arr.push(x,y,z);
arr.sort((a,b)=>b-a);
let A = arr[0];
let B = arr[1];
let C = arr[2];
let QA ... | true |
916be3916811b197454c98ffe2cf8df5d760387f | JavaScript | dd395/lab5 | /code.js | UTF-8 | 445 | 3.46875 | 3 | [] | no_license | $(document).ready(function(){
$("form").submit(enterName);
function enterName(event) {
//prevent form from flashing and resetting
event.preventDefault();
var rank = $("input[name=rank]:checked").val();
var firstName = $("#fname").val();
var lastName = $("#lname").val... | true |
e0e7e73ae4d9ddcb6daaf37e099f33259ee0176c | JavaScript | FaustoAricoma/Sistema-Web-Proyecto | /privada/proveedores/js/validar_proveedores.js | UTF-8 | 559 | 3.171875 | 3 | [] | no_license | "use strict"
function validar(){
var nombre = document.formu.nombre.value;
var direccion = document.formu.direccion.value;
var telefono = document.formu.telefono.value;
if ((nombre == "")){
alert("Ingrese nombre el campo esta vacio");
document.formu.nombre.focus();
return;
}
if ((!v22.test(telefono)) |... | true |
38bb7f8e4a395d37b3f5a48ccc7eaf5004d6ab63 | JavaScript | unblevable/monster-tower-defense | /src/monster.js | UTF-8 | 3,298 | 2.796875 | 3 | [] | no_license | define(function (require, module, exports) {
var Monster = function (id) {
this.id = id;
this.hp;
this.speed;
this.attack;
this.specialAttack;
this.defense;
this.specialDefense;
this.primaryType;
this.secondaryType;
this.range;
... | true |
1393a09967d8282504ab2cb646299bc3b4f2482c | JavaScript | reiyama622/ITM352_F2020_repo | /A#/public/product_data.js | UTF-8 | 1,940 | 2.5625 | 3 | [] | no_license | var red =[
{
"product":"Apples",
"price": 1.32,
"image": "./Images/apple.jpg"
},
{
"product":"Strawberries",
"price": 2.40,
"image": "./Images/strawberry.jpeg"
},
{
"product":"Watermelons",
"price": 0.33,
"image": "./Images/watermelon.jpeg"
},
{
... | true |
baea4653ffeb2762131613c3c1c923c1dc0df29e | JavaScript | drmeloy/data-structures-and-algorithms | /challenges/fifoAnimalShelter/fifoAnimalShelter.js | UTF-8 | 765 | 3.1875 | 3 | [] | no_license | class Node {
constructor(value){
this.value = value;
this.next = null;
}
}
class Queue {
constructor(){
this.front = null;
this.last = null;
}
enqueue(val){
const node = new Node(val);
if(!this.front) this.front = node;
else this.last.next = node;
this.last = node;
}
deq... | true |
b5555ccfb08b18144322dab52badd6cd0dd0a011 | JavaScript | makhmudov-kay/JS-Homework5 | /script.js | UTF-8 | 2,930 | 4.28125 | 4 | [] | no_license | /* Задание: (База пользователей)
Создаёте пустой объект.
В цикле от 1 до 3 при помощи prompt заполняете объект на 3 человек с именем и возрастом
Значение итератора это id пользователя | id не может быть равен 0
В этот id записываются данные пользователя: имя и возраст
... | true |
a17ed99c7314db77e9189eb8100a902f62a4aef3 | JavaScript | Roharui/Tensorflow_Server | /static/js/modelLayerDesign.js | UTF-8 | 1,251 | 2.546875 | 3 | [] | no_license |
function layerAsType(layer){
let result = $('<div class="p-3 mb-2 bg-primary text-white"></div>')
result.attr('xid', layer.id)
result.append($(`<h5>${layer.name}</h5>`))
if(layer.id == 'input' || layer.id == 'output')
{
result.attr('class', "p-3 mb-2 bg-success text-white")
re... | true |
8628ac5046bce70ede9d9f4c5b992f070b8ae9a8 | JavaScript | valerydeleon/exCarrousel | /assets/js/app.js | UTF-8 | 1,316 | 3.359375 | 3 | [
"MIT"
] | permissive | //almacenar carrousel en variable
var carrousel = $("#carrousel");
//almacenar botones de siguente y anterior
var next = $("#btn-next");
var previo = $("#btn-prev");
//metodo insert affter - inserta un elemento despues del elemento indicado
//mueve la ultima imagen al principio
$("#carrousel div:last").insertBefore("#... | true |
11e84ae3cc3e89f3bf011961807631c307b92280 | JavaScript | clairelee0414/cht_react | /lab3_react_start/src/components/Person.js | UTF-8 | 803 | 2.796875 | 3 | [] | no_license | import React, { useState } from "react";
import "./Person.css"
const Person = (props) => {
const [xxx, yyy] = useState({
publisher: "Marvel University",
studio: "Disney",
});
const switchVenderHandler = () => {
yyy({ publisher: "DC Universe", studio: xxx.studio });
};
const show = () => {
con... | true |
f4a32a90e9bd0d53e183c35cde18a22af2b60642 | JavaScript | rithmschool/udemy-js-data-structures-algorithms | /problem-solving/construct-note.js | UTF-8 | 448 | 3 | 3 | [] | no_license | function constructNote(message, letters) {
var frequency = {};
var frequencyM = {};
for (let i = 0; i < letters.length; i++) {
frequency[letters[i]] = ++frequency[letters[i]] || 1;
}
for (let i = 0; i < message.length; i++) {
frequencyM[message[i]] = ++frequencyM[message[i]] || 1;
}
for (let k ... | true |
2e18b36deabbd2a20ea3178ce993ef2b8cc56dec | JavaScript | troylmadsen/CIS_367_Project_1 | /model/Ghost.js | UTF-8 | 8,985 | 2.96875 | 3 | [] | no_license | /**
* Troy Madsen
*/
class Ghost extends ObjectGroup {
/**
* Create a ghost of specified color with body as the center
*
* @param gl {Object} gl the current WebGL context
* @param props props with the following keys
* required : radius (body radius), numTails (tails hanging below... | true |
0afa5d245e13f0c943a26d59f8ef00605e1bec09 | JavaScript | kamirt/react-subscribe-form | /src/Components/DropList.js | UTF-8 | 1,171 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
export default class CityList extends Component {
constructor(props){
super(props)
this.state = {
profList: []
}
}
componentWillReceiveProps (props) {
// "selects" text by bolder font
let profInput = props.profInput;
let profList = props.p... | true |
c9970255fb2a220279f21be8cf87f145f463c475 | JavaScript | avneet007/cardgame | /js/randomizeArray.js | UTF-8 | 312 | 2.71875 | 3 | [] | no_license | function randMyArray(arrData,arrGame){
var l= Math.floor (Math.random()*arrData.length)
arrGame.push(arrData[l])
arrData.splice(l,1)
// console.log(name1)
//console.log(k)
if (arrData.length>0)
{
randMyArray(arrData,arrGame);
}
else {
// calling2();
console.log(arrGame);
}
}
| true |
157c8f8b04cde3a4e40562fe174b87577b9a64bf | JavaScript | arlac77/config-expander | /src/expander.mjs | UTF-8 | 7,554 | 2.53125 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | import os from "os";
import { readFile } from "fs/promises";
import { createCipheriv, createDecipheriv, scryptSync, randomBytes } from "crypto";
import { dirname, resolve } from "path";
import { spawn } from "child_process";
import { createContext } from "expression-expander";
import { ConfigParser } from "./grammar.mj... | true |
ac0b38f29780b6ec96d1f89969df8d64d17ad05e | JavaScript | Jeka95/HW_Jeka_16 | /JS/main.js | UTF-8 | 4,502 | 3.296875 | 3 | [] | no_license |
//Годинник
function currentTime() {
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
let hour = date.getHours();
let min = date.getMinutes();
let sec = date.getSeconds();
let milisec = date.getMilliseconds();
document.querySelector('.y... | true |
6f2d423ddc859fe22a21943295c10a5a3d0aff00 | JavaScript | TheCodeWizard27/UntitledMultiplayerWebGame | /src/client/ControllerListener.js | UTF-8 | 6,085 | 2.75 | 3 | [] | no_license | "use strict";
const CONST = require("../../src/core/Const.js");
const Functions = require("../core/Functions.js");
/**
* This Listener triggers events, when something happens on a phisical game controller.
* Start the listening period with the {@link ControllerListener.start()} method
*/
module.exports = class Con... | true |
74332fe65d5cc8337e56779a0cbfa16a8e3d1809 | JavaScript | adriaburton/Modulo-3 | /Ejercicio 4/Ejercicio 4/scripts/app.js | UTF-8 | 87 | 2.578125 | 3 | [] | no_license | function hello ()
var a = 3
var b = -1
var c ;
console.log("Hello world")
c= a + b | true |
6e661b5e00991a119573e03f2ff7127725c7d17d | JavaScript | m2mathew/advent-of-code-2015 | /day05.js | UTF-8 | 755 | 4.1875 | 4 | [] | no_license | /*
* Advent of Code 2015
*
* Day 5
*
*/
var input = document.querySelector('pre').textContent.trim().split('\n');
function findNaughtyOrNice (str) {
var nice = 0;
var naughty = 0;
str.forEach(function(oneString){
var vowels = oneString.match( /[aeiou]/g );
var doubles = oneString.match( /([a-z])\1/ );
... | true |
120ac64520062f670c3991d86291a368b6e26192 | JavaScript | DarekXLR/MyCV-Darius-Ilcevic | /src/components/retunrTop.js | UTF-8 | 528 | 3.046875 | 3 | [] | no_license | const icon = document.querySelector('.scroll-icon')
const screenHight = window.innerHeight;
const handleScrollIcon = () => {
const scroll = window.scrollY;
if (scroll >= screenHight / 2) {
icon.style.display = ('block')
} else {
icon.style.display = ('none')
}
};
const returnToTop = () => {
window.... | true |
02344f3aea0be3c223a8a129a072c4f9641eb58d | JavaScript | sebastienmichaut/exo_javascript | /exo15/app.js | UTF-8 | 1,017 | 3.9375 | 4 | [] | no_license |
// ----------------- ÉNONCÉ -----------------
// Créez un Algorithme qui vous informe si les lettres(second arguments),
// correspondent à la fin du mot(premier argument).
// Créez une fonction qui se nomme finSimilaire
// Si elles correspondent, retournez "La fin est similaire"
// Sinon "La fin ne correspond pas".
... | true |
ed51a0e4755dc971a5f60805c913c6089c4d5459 | JavaScript | Sebbben/GameHub | /Games/ColorMemory/script.js | UTF-8 | 2,500 | 3.28125 | 3 | [] | no_license | const topLeft = document.getElementById("top-left");
const topRight = document.getElementById("top-right");
const bottomLeft = document.getElementById("bottom-left");
const bottomRight = document.getElementById("bottom-right");
var colors = [];
var colorDup = [].concat(colors)
var score = 0;
var currentIndex = 0;
var p... | true |
55fd504ed70b0d297c0c8c91364d6f9c5d80a224 | JavaScript | SuryaKrishnaMoorthy/react-router-tech-buddy | /src/components/profiles/ProfileForm.js | UTF-8 | 1,664 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react'
class ProfileForm extends Component {
constructor (props) {
super(props)
this.state = {
username: '',
avatar: '',
email: ''
}
}
onChange = (event) => {
this.setState({
[event.target.name]: event.target.value
})
}
onSubmit ... | true |