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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
70a9ffdcc91e9c6ba25edefd7111753509a6c565 | JavaScript | mhamann/micro-mw | /test/index.js | UTF-8 | 4,317 | 2.71875 | 3 | [
"MIT"
] | permissive | const test = require('ava');
const { applyMiddleware, createSet, getSet, stopRequest } = require('../lib');
const httpMocks = require('node-mocks-http');
const { run } = require('micro');
function reqUserMiddleware(req, res) {
req.user = { id: 'foobar' };
}
async function asyncMiddleware(req, res) {
return ne... | true |
875e56c218b821e3c197394a055e8d7acb1f6675 | JavaScript | avanbtech/Dating | /dating/public/js/update_profile.js | UTF-8 | 1,247 | 2.765625 | 3 | [] | no_license | onload = function(){
var label_message = document.getElementById('error_display');
label_message.style.display = 'none';
var updateBtn = document.getElementById('update');
updateBtn.onclick = updateUserProfile;
function updateUserProfile(){
let serverURL = '/users/profile/update';
... | true |
e32d038334240e7a6148b6b6b49bf6191da3f37a | JavaScript | NafisMolla/react-weather-app-hooks | /src/components/getWeatherData.js | UTF-8 | 1,147 | 2.765625 | 3 | [] | no_license | import axios from 'axios';
const baseUrl = 'http://api.openweathermap.org/data/2.5/weather?';
const getWeatherData = async (city,country,setObject,setTemp,setDis,setLocation,setImg) => {
// const result=await axios.get(`http://api.openweathermap.org/data/2.5/weather?q=${city},${country}&APPID=180941f68139fba12f16... | true |
a507f4c9c67bb69917b0d79bcc63ad0a379d4a69 | JavaScript | chitranjanB/pundraherbs.com | /js/json.js | UTF-8 | 4,824 | 2.65625 | 3 | [] | no_license | function updateMetaSections(data){
$("meta[name=keywords]").attr("content",data.meta.keywords);
$("meta[name=description]").attr("content",data.meta.description);
}
function updatePageTitle(data){
$("title").text(data.pageTitle);
}
function updateProductImage(data){
//alert(data.productImg.src+"\n"+da... | true |
aa9a51244715ff38e33f46cfb0eec400a36e4298 | JavaScript | lixiaoyanSTAR/ES6 | /map/app.js | UTF-8 | 835 | 4.625 | 5 | [] | no_license | // 场景1 假定有一个数值数组(A),将A数组中的值以双倍的形式放到B数组
var numbers=[1,2,3];
var doubleNumbers=[];
// es5
for(var i=0;i<numbers.length;i++){
// doubleNumbers.push(numbers[i]*2);
}
// console.log(doubleNumbers);
for(var i=0;i<doubleNumbers.length;i++){
// console.log(doubleNumbers[i])
}
// es6 map
var doubled=numbers.map(functio... | true |
2a386be8596193bf99b4f248675ae06d1c9182fc | JavaScript | justincarlson7/GifTastic | /assests/javascript/app.js | UTF-8 | 6,163 | 3 | 3 | [] | no_license | $(document).ready(function() {
//create array for initial themes
var topics = ["tennis", "rugby", "croquet"];
//Loops through array to make the buttons
for (i = 0; i < topics.length; i++) {
$("#searchDiv").prepend(
"<button class='resultsButton' data-topic=" +
topics[i] +
">" +
... | true |
66d321a24da9abe146b2dc269a5a6b6ae6f59255 | JavaScript | usamasadiqus/react-bmj-assignment2 | /src/index.js | UTF-8 | 876 | 2.859375 | 3 | [] | no_license | import React, { useState } from "react";
import ReactDOM from "react-dom";
import "./index.css";
const App = () => {
let [count, setCount] = useState(0);
let [isDay, setDay] = useState(true);
return (
<div className={`container ${isDay ? "dayColorYellow" : "dayColorGrey"}`}>
<h1>Counter + Change Backgr... | true |
b7962ecefb55c4f590ca3583eed24fb6914cbdd6 | JavaScript | neznayer/pure-nodejs-server | /lib/data.js | UTF-8 | 3,434 | 3.015625 | 3 | [] | no_license | /*
* Library fir storing and editing data
*
*/
//Dependencies
const fs = require("fs");
const path = require("path");
const helpers = require("./helpers");
//Container foir the module to be exported
const lib = {};
//Base directory of the data folder
lib.baseDir = path.join(__dirname, "/../.data/");
//Write dat... | true |
3daa7941ec6faea946a5ac308532283e7633152d | JavaScript | albertogm88/Libreria | /src/main/webapp/js/altaLibro.js | UTF-8 | 1,437 | 3.203125 | 3 | [] | no_license |
function altaLibro(){
var nombre = document.forms["altaLibro"]["nombre"].value;
var autor = document.forms["altaLibro"]["autor"].value;
var editorial = document.forms["altaLibro"]["editorial"].value;
var fecha = document.forms["altaLibro"]["fecha"].value;
var numPags = document.forms["altaLibro"]["numPags"].val... | true |
5d37d4088d9f6869c05d07d46844bc7dfde639e4 | JavaScript | asilluron/ODataQueryJS | /dist/odq.js | UTF-8 | 4,122 | 2.734375 | 3 | [
"MIT"
] | permissive | /**
* @license
* ODataQueryJS 0.0.0
* Copyright 2014 Andrew Silluron
* Exporting based on Lo-Dash.js 2.4.1, Copyright 2012-2014 The Dojo Foundation
*/
;
(function () {
/**
* Parses the queryStr and returns an array of query params
* @method queryParser
*
* @param queryObj {Object} A set of query
* @param qu... | true |
c519618992b5bd189a73cda25efc7168bb9ffead | JavaScript | afbarrerav/Argos | /auditoria/js/admin_campanas.js | UTF-8 | 1,387 | 2.609375 | 3 | [] | no_license | /*
* @author: FABIAN ANDRES MOJICA ALFONSO
* ingmojica@hotmail.com
* @version:1.0.0
* @fecha: Marzo de 2011
*
* */
// HACE LA VALIDACION DEL FORMULARIO PARA GUARDAR CAMPANA
function guardar_campana()
{
var nombre = document.getElementById('nombre').value;
var cli_codigo = document.getElementById('sclient... | true |
8511e24207bbabcdb51acc028b5c0bf2f15c04f9 | JavaScript | shelleyyz/WDi28-Homework | /caleb_rivers/week_01/day_03/arrays/js/arrays.js | UTF-8 | 2,545 | 4.4375 | 4 | [] | no_license | const rainbowColors = [];
rainbowColors.push("orange");
rainbowColors.unshift("red");
rainbowColors.push("yellow");
rainbowColors.push("green", "blue", "indigo", "violet");
console.log(rainbowColors.length);
console.log(rainbowColors[1]);
console.log(rainbowColors[rainbowColors.length - 1]);
console.log(rainbowColors[... | true |
90e0fbcdb8e5afb1ea9d725cd4015b7d7c5822d0 | JavaScript | xinleiye/LeetCode | /双周赛 2021/第 58 场双周赛/5826. 删除字符使字符串变好/javascript/ac_v1.js | UTF-8 | 431 | 3.75 | 4 | [
"Apache-2.0"
] | permissive | /**
* @param {string} s
* @return {string}
*/
var makeFancyString = function(s) {
const stack = [];
const length = s.length;
if (length < 3) {
return s;
}
stack.push(s[0]);
stack.push(s[1]);
for (let i = 2; i < length; i++) {
if (s[i] !== stack[stack.length - 1] || s[i] !... | true |
88136680b77b8d0197a666cd8ad340fe18889473 | JavaScript | jim-2000/JavaScript-Model | /script.js | UTF-8 | 362 | 2.6875 | 3 | [
"MIT"
] | permissive | const openbtn = document.querySelector('.modal-open-btn')
const closebtn = document.querySelector('.modal-close-btn')
const overley = document.querySelector(".model_overlay")
openbtn.addEventListener("click", function() {
overley.classList.add("open_modal")
})
closebtn.addEventListener("click", function() {
... | true |
78a700b8ae8b49222b9b971899cdc78ba9468112 | JavaScript | dely2p/MagicSpells | /Server/routes/main.js | UTF-8 | 3,131 | 2.59375 | 3 | [] | no_license | module.exports = function(app, fs) {
app.get("/", function(req, res) {
res.render("index", {
title: "Magic Spells",
length: 5
});
});
app.get("/list", function(req, res) {
fs.readFile(__dirname + "/../data/spells.json", "utf8", function(err, data) {
console.log(data);
res.end(... | true |
c225221a2a801bcba74bf70a6655351355570d76 | JavaScript | EBojilova/JavaScriptAdvanced | /Demos-Homeworks-Exams/3. Prototype-Chain-and-Inheritance/03. prototypal-inheritance.js | UTF-8 | 1,116 | 3.890625 | 4 | [] | no_license | var personPrototype = {
init: function constructor(name, age) {
this.name = name;
this.age = age;
return this;
},
introduce: function introduce() {
return "I'm " + this.name + ", Age: " + this.age;
}
};
var studentPrototype = Object.create(personPrototype);
studentPrototype.init = function studentConstru... | true |
399c1bdd545732af50442dfad803bfec7b8e5d17 | JavaScript | mubat/pikabu_hotkeys_for_reddit | /script.js | UTF-8 | 2,594 | 3.25 | 3 | [
"MIT"
] | permissive |
function getPosts() {
return document.getElementsByClassName('Post');
}
document.onkeydown = function(e) {
let currentPosition = document.documentElement.scrollTop;
switch(e.keyCode) {
case 68: console.log('D pressed'); scrollOnElement(getPostByPosition(currentPosition)); break;
case 87: consol... | true |
0aa563e70308089a3eaefa08cc1dc752213a12ef | JavaScript | mile40/projet_CSL | /nantes_prison_manager/src/view/prisoner.js | UTF-8 | 3,972 | 3.0625 | 3 | [] | no_license | import React from 'react';
// Retourne 1 prisonier
function ReactPrisoner(props){
return(
<tr id={props.index}>
<td><input type="checkbox" onChange={props.onChange}></input></td>
<td><p>{props.name}</p></td>
<td><p>{props.firstname}</p></td>
<td><p>{props.dob}</p></td>
... | true |
954374fa441bcfc6f9b251daf54256bab0a7c8f0 | JavaScript | TheMshary/Foundations-SU21 | /JavaScript/iterationMethods.js | UTF-8 | 438 | 3.96875 | 4 | [] | no_license | const foods = ["🍔", "🍕", "🧇", "🥞", "🍟", "🍟"];
["🍔🥛", "🍕", "🧇", "🥞", "🍟"];
// .forEach() , .map(), .filter() , .find()
foods.forEach((food) => console.log(food));
const allFoods = foods.map((food) => `${food}🥛`);
console.log(allFoods);
const hatePizza = foods.filter((food) => food !== "🍕");
console.... | true |
4ae9875ed4fe417502654f6d69cb7a32bbac5de0 | JavaScript | ArmandoChindoy/my_anime_list | /src/api/animeAPI.js | UTF-8 | 259 | 2.53125 | 3 | [
"MIT"
] | permissive | const API_URL = "https://api.jikan.moe/v3";
// api.jikan.moe/v3/search/anime?q=bleach
export const getAnimeByQuery = (query) => {
return fetch(`${API_URL}/search/anime?q=${query}`)
.then((response) => response.json())
.catch((error) => error);
};
| true |
0f1e70514b1e4f36b1e7f068bb8de274d63461e2 | JavaScript | ThilinaPrasad/MORAGPA | /js/style.js | UTF-8 | 757 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | var isFull = true;
var $analogClock = document.getElementById("clock");
var $mainWrapper = document.getElementsByClassName('wrapper')[0];
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
document.body.style.b... | true |
a1c648af5621032be833619825dbdae2c5fb8809 | JavaScript | SarahRector/lab-06-e-commerce-site | /test/render-wares.test.js | UTF-8 | 1,167 | 3.15625 | 3 | [] | no_license | // IMPORT MODULES under test here:
// import { example } from '../example.js';
import { renderWares } from '../products/render-wares.js';
const test = QUnit.test;
QUnit.module('Render Wares');
test('renders a ware', (expect) => {
//Arrange
// Set up your arguments and expectations
const whaleShark = {
... | true |
4346026485eb4dc34ce5a90267627dd0c1bd0873 | JavaScript | IngloriousCoderz/inglorious-portfolio | /20-js-array-methods/tasks/map-to-object.js | UTF-8 | 505 | 3.671875 | 4 | [
"MIT"
] | permissive | let john = { name: 'John', surname: 'Smith', id: 1 };
let pete = { name: 'Pete', surname: 'Hunt', id: 2 };
let mary = { name: 'Mary', surname: 'Key', id: 3 };
let users = [john, pete, mary];
let usersMapped = users.map(({ id, name, surname }) => ({
id,
fullName: `${name} ${surname}`,
}));
/*
usersMapped = [
{ ... | true |
7c7e6b170e2f3356544dc2d04d182ec6e82b2a86 | JavaScript | bblsnake/yudao | /JS/reg/reg.js | UTF-8 | 422 | 3.40625 | 3 | [] | no_license | // // 一个字符
// let phoneReg = /(1[3-9][0-9])[0-9]{8}/;
// let str = "我的号码是13888888888,收下吧";
// // 得到手机号,判断服务商
// console.log(str.match(phoneReg));
// // console.log(phoneReg.test("13888888888"));
// 2925141441@qq.com 邮箱服务商
// +表示匹配一次或者多次(至少一次)
let emailReg = /^[0-9a-zA-Z]+@[0-9a-zA-Z]+\.[0-9a-zA-Z]+$/;
console.log(... | true |
5874497bb0ff4a0e76c479f2e4c291c3b2ef77b6 | JavaScript | Masamune42/js_grafikart | /17-webcomponents/part3/components/Datepicker.js | UTF-8 | 472 | 2.859375 | 3 | [] | no_license | // On fait étendre la class de HTMLInputElement car c'est un élément dérivé de type input
export default class Datepicker extends HTMLInputElement {
// Effectue l'action suivante quand l'élément est connecté
connectedCallback() {
this.calendar = flatpickr(this)
this.classList.add('form-control')... | true |
7bab4f5ba0013b5877bb07dd60135d6ea86e6330 | JavaScript | AlexanderVC0123/Proyecto-Applergic-MERN | /cliente/src/components/RegistroContacto/RegistroContacto.js | UTF-8 | 5,955 | 2.640625 | 3 | [] | no_license | import React, { useState } from 'react';
import './RegistroContacto.scss'
export const RegistroContacto = function(props){
const perfil = props.perfil
const change = props.change
let aseg = perfil.aseguradora !== "" && perfil.poliza !== "" ? `${perfil.aseguradora} / ${perfil.poliza}` : ""
const [nomPol... | true |
54b43a83c839d08fe66427e4eb3d24a4ff7da28a | JavaScript | dla1635/Woong_Server | /Woong_Server/src/controller/historyController.js | UTF-8 | 1,755 | 2.578125 | 3 | [] | no_license | const dbConnection = require('lib/dbConnection')
const historyModel = require('models/historyModel')
const Joi = require('joi')
const { respondJson, respondOnError } = require('../lib/response')
const post_location_history = async (req, res) => {
const { user_id } = req.user
const { history_name } = req.body
co... | true |
ac4f04fad2aab3550d38f74b6cafeac663981da1 | JavaScript | javipege5/Ultimo-Tag | /Otros motores/Mejor-Motor/Gestor/animacion.js | UTF-8 | 1,308 | 3.078125 | 3 | [] | no_license | function Animacion(){
this.frames = 0;
this.mallas = [];
this.frame_actual = 0;
nombre = null;
}
Animacion.prototype.pushMalla = function(mesh_frame, tex) {
console.log("meto el siguiente frame de la animación " + this.frames)
malla = new MallaGestor();
malla.cargarFichero(mesh_frame)
if(tex != null){
m... | true |
986a0eaf77267c07c9e889dc1c041a2d79c69d9d | JavaScript | zhangfuyuan/guide | /angular/angular-base/bulid/static/js/all.js | UTF-8 | 6,172 | 2.53125 | 3 | [
"MIT"
] | permissive | var app = angular.module('starkapp', [
// 'ngMaterial',
// 'ngMessages',
'ngRoute',
'controllers',
'services'
]);
// init submodule
angular.module('controllers', []);
angular.module('services', []);
app.config(
['$routeProvider',
function($routeProvider) {
$routeProvider... | true |
b7565feebc34835926b9f34c42a48a12b96a81f7 | JavaScript | PetriHirvonen/react-demo-petri | /src/components/joke.js | UTF-8 | 1,178 | 2.890625 | 3 | [] | no_license | import React from 'react';
function Joke (props) {
console.log(props.question);
return (
<div className="todocss">
{/* Peruskysymysrenderöinti: */}
{/* <h6>Question: {props.question} </h6> */}
{/* Seur. tekee että jos ei ole kysymystä ollenkaan... | true |
e2a78e4f6b8351810e94982b8f1c4901fd740c51 | JavaScript | randywick/Bloomy | /lib/hashes/murmur.js | UTF-8 | 1,623 | 2.953125 | 3 | [
"MIT"
] | permissive | 'use strict';
/**
* Murmur module. Not quite there yet...
*/
exports = module.exports;
/**
* @private
*
* MurmurHash. Implementation doesn't appear to be quite working at present.
* seeing some duplication...
*
* @see {@link https://en.wikipedia.org/wiki/MurmurHash}
* @see {@link https://github.com/garyc... | true |
0a0ae27d14024583bf559204c5babdc471386d1b | JavaScript | pedropbazzo/trivago | /src/components/DeckSlider.js | UTF-8 | 3,361 | 2.53125 | 3 | [] | no_license | import React, {Component} from 'react';
import "../deck.css";
import {TweenMax, Power2} from "gsap";
export default class DeckSlider extends Component {
constructor(props) {
super(props);
const collection = [];
for (let x in props.collection) collection.push(props.collection[x]);
this.state = {
... | true |
7f60abe6dc7be2902d17d2678572715264a5ea64 | JavaScript | pepdbm7/skylab-bootcamp-201809 | /staff/judith-gongora/js-arrays/reverse.test.js | UTF-8 | 1,160 | 3.28125 | 3 | [] | no_license | console.log('TEST reverse');
var tests = [];
// Demo comprobation
tests.push(function () {
console.log('should reverse and array of elements');
// setup
var array = ['one', 'two', 'three'];
var arraycopy =[]
for (var i = 0; i<array.length;i++) arraycopy[i]=array[i];
// test
reverse(array);
... | true |
c57d6c04ef3ce6bd0f5ad0cece12b55b23932e24 | JavaScript | bengHak/Stock_Info | /src/js/text_selection.js | UTF-8 | 3,259 | 2.9375 | 3 | [] | no_license | document.body.addEventListener('mouseup', function (e) {
var selected = getSelection();// call getSelectionText() to see what was selected
console.log(selected.toString().trim().length);
if (selected.toString().trim().length > 0) { // if selected text length is greater than 0
var copysuccess = copyS... | true |
90072575216f587621c6c738921101fde9c27ace | JavaScript | khanmdv/YGrab | /main.js | UTF-8 | 1,638 | 2.75 | 3 | [] | no_license | /**
* The below methods help render the grabbed images and present them on the plugin screen.
*/
var POPUP = (function(){
if ($){
/**
* Method to fire request to content scripts to get the DOM data.
*
* @param actionString The information request.
* @param success Function to handle success.
* @... | true |
a95ee25f4e3acf2b86f281519e2f9ff503125ce5 | JavaScript | skyman149/JS_newDailyChallanges | /.includes() -- .match() -- d+/Even more katas/Check three and two.js | UTF-8 | 968 | 4.875 | 5 | [] | no_license | /*
Given an array with exactly 5 strings "a", "b" or "c" (chars in Java, characters
in Fortran), check if the array contains three and two of the same values.
Examples
["a", "a", "a", "b", "b"] ==> true // 3x "a" and 2x "b"
["a", "b", "c", "b", "c"] ==> false // 1x "a", 2x "b" and 2x "c"
["a", "a", "a", "a", "a"... | true |
1be214375be5680c436c6081e4ccd624f37ab2c7 | JavaScript | SongYunSeop/exercism.io | /ecmascript/beer-song/beer-song.js | UTF-8 | 1,046 | 3.59375 | 4 | [] | no_license | const verse = (beer) => {
if ( beer == 0 ) {
return `No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.
`
} else if ( beer == 1) {
return `1 bottle of beer on the wall, 1 bottle of beer.
Take it down and pass it around, no more bottles ... | true |
6ab0c12e43e426b26e16dbe2638393084ac5392b | JavaScript | OSU-CS493-Sp18/final-project-team-13 | /api/albums/index.js | UTF-8 | 8,635 | 2.578125 | 3 | [] | no_license | const router = require('express').Router();
const validation = require('../../lib/validation');
const albumSchema = {
title: { required: true },
artist: { required: true },
genre: { required: true },
year: { required: true },
streaming_sites: { required: true}
};
// ROUTE: /albums
// PARAMS:
// QUERIES:
ro... | true |
94efd5b1367d97a5014715ab6065d4c466c1b083 | JavaScript | KarolisLuko/JS-05 | /2/index.js | UTF-8 | 493 | 2.859375 | 3 | [] | no_license |
"use strict";
let masyvas = [];
for (let i=0; i<100; i++) {
let objektas = {
id:i +1,
vardas:"vardas"+(i+1)
};
masyvas[i]=objektas;/// i=> obijekta
let div = document.createElement("div")... | true |
4a5d109059417386bbae74bf9afb5eb039b89b60 | JavaScript | llh911001/cash | /src/collection.js | UTF-8 | 846 | 2.546875 | 3 | [
"MIT"
] | permissive |
cash.fn.extend({
each: function(callback){
cash.each(this, callback);
},
eq: function(index){
return $(this[index]);
},
filter: function(){
if(typeof arguments[0] === "string") {
var selector = arguments[0];
return Array.prototype.filter.call(this, function(e){
return cash.... | true |
1240ac3bfea001328e8659e7eb4aceb5be7dbfa7 | JavaScript | guchengjie/SDDDD | /common/contextMenuCom.js | UTF-8 | 7,199 | 2.6875 | 3 | [
"MIT"
] | permissive | var changeBgcolor = []; // 修改后的表格坐标集合
var handsontableCallback = {
callback: function(key, options) {
var handData = this.getData();
/***********向后内插*****************/
if (key === 'after') {
let _start_index = [options.start.row, options.start.col];
let _end_index = [op... | true |
217045acd15bc96c3cafa0ca6e4547484cfb1d13 | JavaScript | hl343169728/huanglei | /_bjsxt/Extjs_2/WebRoot/002/extstatic.js | UTF-8 | 8,028 | 3.625 | 4 | [] | no_license | // Ext code Ext.Object & Ext.Function & Ext.Array
Ext.onReady(function(){
//********************** Ext.Object <static method> *************************//
/**
* Ext.Object.each(object , fn , scope)
* object: 要进行枚举的对象
* fn : key 关键字 , value 值 , myself 函数本身
* scope : 为可选参数 表示为函数... | true |
aae983facc5c72f80da6c381e243c1e6246b8e41 | JavaScript | andreboekhorst/fashion-tech-dictionary.github.io | /src/components/singleComponent.js | UTF-8 | 2,166 | 2.6875 | 3 | [] | no_license | import React from 'react';
import CrumbComponent from './crumbComponent.js';
import {
BrowserRouter as Router,
Link,
useParams
} from "react-router-dom";
function getItemBySlug(termArr, slug){
return termArr.find( term => term.url == slug );
}
function getRandom(arr, x){
let newArr = []... | true |
9f45c0dd78c9cae7f34a0552058b566931477481 | JavaScript | patni-harsh5/STDemoProj | /TestDriveProj/WebContent/js/script1.js | UTF-8 | 780 | 2.96875 | 3 | [] | no_license | function validateCustomer(){
var valid = true;
var message = "Login successfull!";
var custName = document.forms.myform.cname.value;
var licNum = document.forms.myform.dlc.value;
if (hasNumber(custName)){
valid = false;
message = "Please enter name with out numbers.";
}
if (alphanumeric(licNum) == fals... | true |
09aaa9476f5c76ce58fc85049caa109954a2f1ef | JavaScript | yimpetit/baekjoon | /sesson3/js/n2581.js | UTF-8 | 1,076 | 3.9375 | 4 | [] | no_license | //var input = require('fs').readFileSync('/dev/stdin').toString().split(' ');
var input = require('fs').readFileSync('../txt/n2581.txt').toString().split(' ');
var tc1 = input[0]*1;
var tc2 = input[1]*1;
var list = [];
var sum = 0;
for(var i=tc1;i<=tc2;i++){
console.log(i);
}
/*
소수
문제
자연수 M과 N이 주어질 때 M이상 N이하의... | true |
1040d298f779f0c889a34a43b1f852fc3abdea3d | JavaScript | hamstercat007/PurrCity | /library/library.js | UTF-8 | 2,459 | 3.078125 | 3 | [
"MIT"
] | permissive |
function catSpeaks(msg) {
var el = document.createElement("div");
el.setAttribute(
"style",
"position:absolute;top:27%;left:65%;background-color:white; font-size:35px; max-width:250px; text-align:center"
);
$(el).addClass("speech");
el.innerHTML = msg;
setTimeout(function() {
el.parentNode.removeChi... | true |
f95e274040b3927b0622b953d81073a400cdd3fc | JavaScript | BrVenturaU/first-node-practice | /program1.js | UTF-8 | 649 | 3.28125 | 3 | [] | no_license | const readline = require("readline");
class Program1{
#interface;
constructor(){
this.#interface = readline.createInterface({
input: process.stdin,
output: process.stdout
});
}
makeQuestion(question, isClosable=true){
//"Escriba lo que desee: "
... | true |
0114c31053557e6de5cdc3de073bfba035992691 | JavaScript | amgava/unit-4-game | /assets/javascript/game.js | UTF-8 | 2,410 | 3.453125 | 3 | [] | no_license | $(document).ready(function () {
var valueArray = [];
var matchNum = 0;
var playerNum = 0;
var wins = 0;
var losses = 0;
// ------------------------------------Function Declarations------------------------------------------- //
// random number generator
function getNum(min, max) {
... | true |
c297c538e3a274b3ebf412eafc8f5e442bcb35e0 | JavaScript | edwindvinas/ULAPPH-Cloud-Desktop | /static/js/syntree.js | UTF-8 | 11,996 | 2.765625 | 3 | [
"MIT"
] | permissive | // By Miles Shang <mail@mshang.ca>
// MIT license
var debug = true;
var margin = 15; // Number of pixels from tree to edge on each side.
var padding_above_text = 6; // Lines will end this many pixels above text.
var padding_below_text = 6;
function Node() {
this.value = null;
this.step = null; // Horizontal distan... | true |
c6d263e499e986f1f4514057daeb9153caa15375 | JavaScript | karamshadid/nodeExcsecises | /arrays/arrays.js | UTF-8 | 2,940 | 3.546875 | 4 | [] | no_license | function logArray(array) {
array.forEach((element) => {
console.log(element)
})
}
//logArray(arr);
function cloneArray(array) {
let newArr = array.slice();
return newArr;
}
//cloneArray(arr);
function firstElement(array) {
return array[0];
}
//console.log(firstElement(arr));
function lastElement(array)... | true |
b703facbe68e0f470a5cd32c2bde166d5fe459a3 | JavaScript | Aryan-Motwani/learn-viz | /src/TheoryPage.js | UTF-8 | 1,907 | 3.234375 | 3 | [] | no_license | import React, { Component } from "react";
export default class TheoryPage extends Component {
render() {
let heading = "hot"
console.log(this.props);
return (
<div>
<h3>{heading}</h3>
{/*<p>
Bubble sort, sometimes referred to as sinking sort, is a simple
sorting... | true |
5578e64dc3ecd5fa640d150addc27f4c30788d6a | JavaScript | siddharth-lakhara/eval4-backend | /routes/updateDB.js | UTF-8 | 1,850 | 2.5625 | 3 | [] | no_license | const firstAPIHandler = require('./Handlers/firstAPI');
const secondAPIHandler = require('./Handlers/secondAPI');
const Models = require('../models');
module.exports = [{
method: 'GET',
path: '/updatedb',
handler: (req, reply) => {
const returnObject = [];
const PromiseArray = [];
const url1 = 'https... | true |
080703710cbc802c43482516106f9f42ea5d59a7 | JavaScript | canwei/web | /js/demo.js | UTF-8 | 3,235 | 2.78125 | 3 | [
"MIT"
] | permissive | var canvasWidth, canvasHight, canvas, context;
var isMouseDown = false;
var LastLoc = { x: 0, y: 0 };
var scolor= "black";
function windowToCanvas(x, y)//x,y为距离屏幕的距离
{
var bbox = canvas.getBoundingClientRect();//canvas距离屏幕的距离
return { x: Math.roun... | true |
839e5babe23395f75b1ea9d990bfadd412795a59 | JavaScript | Marty42Martinez/functions | /number-manipulator.test.js | UTF-8 | 375 | 3.140625 | 3 | [] | no_license | const numberManipulator = require('./number-manipulator.js');
describe('numberManipulator tests', () => {
it('takes a number (n) and returns (n ** n) - n', () => {
const expected = 24;
const input = 3;
const mockCallback = jest.fn(n => (n ** n) - n);
const result = numberManipulator(mockCallback, in... | true |
7e4276680848e2c2e0e4441f3e055eecf660447b | JavaScript | leonardootoni/totus | /tests/Deque.test.js | UTF-8 | 8,803 | 3.484375 | 3 | [
"MIT"
] | permissive | /**
* Deque Implementation Test Set
*
* @author Leonardo Otoni <leonardootoni@gmail.com>
*/
const Deque = require( '../src/Deque' );
describe( 'Deque Date Structure Tests', () => {
const MAX_DEQUE_SIZE = 15;
describe( 'Instance Tests', () => {
test( 'Check DEque Instance Object', () => {
... | true |
68a72c33a011cc803526cb89d0f2bb881509f094 | JavaScript | HenrikJoreteg/is-fhir-date | /src/is-fhir-date.spec.js | UTF-8 | 835 | 2.703125 | 3 | [
"MIT"
] | permissive | import test from 'tape'
import isFhirDate from './is-fhir-date.js'
const tests = [
['1982', true],
['1982-3', false],
['12/29/82', false],
['1982', true],
['1982-12', true],
['1982-12-14', true],
['2010-02-01', true],
['2021-01-12', true],
['23-01-12', false],
// invalid months
['1998-00-12', fal... | true |
b706373a87285950423bc2bd26048229d3a75e42 | JavaScript | joaojmendes/react-stylish-gallery | /src/utiles/selectNextImage.js | UTF-8 | 722 | 2.78125 | 3 | [
"MIT"
] | permissive | // @flow
import { fromJS } from 'immutable'
import getIndex from './getIndex'
export default (images: Object, selectedImage: Object, infinite: boolean, order: string) => {
images = fromJS(images)
const selectedId = selectedImage.get('id')
const index = getIndex(images, selectedId) // Get the index of the curre... | true |
447533818264414b1888d265d4691e68f7c7d598 | JavaScript | hfitzwater/flyingflipphone | /src/index.js | UTF-8 | 1,260 | 2.875 | 3 | [
"MIT"
] | permissive | import GameState from 'states/GameState';
import Level1 from 'states/Level1';
import Level2 from 'states/Level2';
import Level3 from 'states/Level3';
import Level4 from 'states/Level4';
import Level5 from 'states/Level5';
import Level6 from 'states/Level6';
import Win from 'states/Win';
class Game extends Phaser.Game ... | true |
649eafc07d83768718f514e39d0bdb411cc674e1 | JavaScript | vantoantran/-Bai_Tap-_Phat_Trien_Ung_Dung_Nho_Mo_Phong_Cau_Chuyen_Adam_Va_Eva | /Apple.js | UTF-8 | 365 | 3 | 3 | [] | no_license | class Apple {
weight;
constructor() {
this.weight = 0;
}
decrease() {
this.weight--;
}
isEmpty(){
if(this.weight > 0){
return alert("con "+this.weight +" mieng tao")
}else {
return alert("het con me no tao roi")
}
}
getW... | true |
ff650098ba32030a39749ec1872c6d93568ff222 | JavaScript | HamedHejjo/JavaScript-Core-1-Coursework-Week1 | /exercises/K-functions-parameters/exercise4.js | UTF-8 | 164 | 4.34375 | 4 | [] | no_license | // Declare your function first
function add(x, y) {
return x + y;
}
// Call the function and assign to a variable `sum`
let sum = add(13, 124);
console.log(sum);
| true |
2dde637c7e37b83b659d7f0bf5f73870983d4045 | JavaScript | CwickWalt/Randomized-Color-Changer | /script.js | UTF-8 | 2,220 | 3.71875 | 4 | [] | no_license | //variables
var currentColor = document.getElementById("current-color");
var isClicked = false;
var a = pickRandomSquare();
var colors = [];
var squares = document.querySelectorAll(".square");
//make all squares clickable
//for loop with a closure to ensure that the function is called during the loop and not after.
fo... | true |
87196124350bf87bcb3fd00261df3bf3745a0435 | JavaScript | apurvaaa/toys | /SortsAndSearch/eightSorts.js | UTF-8 | 5,731 | 3.59375 | 4 | [] | no_license | /* implementing 8 different sorts that I know */
const selectionSort = (arr) => {
const ansArr = arr.slice(0);
for (let i = 0; i < ansArr.length - 1; i++) {
let small = i;
for (let j = i; j < ansArr.length; j++) {
if (ansArr[j] < ansArr[small]) {
small = j;
}
}
let swapTemp = an... | true |
be61da93479f2cc14c5557f6b1bc0b3e26a6d0b5 | JavaScript | MartinSobel/React-Dashboard | /src/components/Category.js | UTF-8 | 1,387 | 2.640625 | 3 | [] | no_license | import React, {Component} from 'react'
class Category extends Component {
constructor(props){
super(props);
this.state = {
categories: [
{}
]
}
}
apiCall(url, consecuencia){
fetch(url)
.then(
response => re... | true |
d7e596516f43ad66ee5298e33817b36603ae0015 | JavaScript | junron/hwboard | /controllers/homework.js | UTF-8 | 6,135 | 2.609375 | 3 | [
"MIT"
] | permissive | const xss = require("xss");
const {Sequelize,Homework} = require("../models");
const {getUserChannels} = require("./admin");
const {CI:testing} = require("../loadConfig");
//Map emails to names
const {getStudentById} = require("../students");
let tables = {};
//Mitigate XSS
async function removeXss(object){
for (l... | true |
36c93b1be64d734ae893cd46a85a4504abaddf44 | JavaScript | RamyaPayyavula/LeetCode | /LeetCode_ExtraPrep/Number_of_Provinces.js | UTF-8 | 614 | 3.203125 | 3 | [] | no_license | /**
* @param {number[][]} isConnected
* @return {number}
*/
//using depth first search
var findCircleNum = function (isConnected) {
let visited = new Set()
let count = 0;
dfs = (i) => {
for (let j = 0; j < isConnected[0].length; j++){
if (isConnected[i][j] === 1 && !visited.has(j)) {
... | true |
3c2390e637c866dbec31737e248a4d68dd215a37 | JavaScript | ImaneHarz/exercices | /ex01.js | UTF-8 | 153 | 4.03125 | 4 | [] | no_license | ex01.js:
Ecrivez un programme qui affiche tous les nombres de 0 à 100.
let number = 0;
while (number <= 100) {
console.log(number);
number += 1;
}
| true |
e1a2fccc66daaac7a3fcb75668c49891084468b1 | JavaScript | brandonguzman/EscuelaOffline | /static/js/Laberintos/labs.js | UTF-8 | 97,253 | 3.359375 | 3 | [] | no_license | var labs1 = []; //laberintos predefinidos
var labs2 = [];
var labs3 = [];
function preLabs(){
//laberintos nivel 1
labs1.push( setLab_1_1 );
labs1.push( setLab_1_2 );
labs1.push( setLab_1_3 );
//laberintos nivel 2
labs2.push( setLab_2_1 );
labs2.push( setLab_2_2 );
labs2.push( setLab_2_3 );
//laberintos nivel... | true |
fe05785bd01fee3e679e5b9734efb2bc1fde6efa | JavaScript | Fajar3108/othello-canvas | /src/scripts/Game.js | UTF-8 | 1,631 | 3.5625 | 4 | [] | no_license | class Game {
constructor(canvas){
this.init(canvas);
}
init(canvas) {
this.canvas = canvas;
this.size = 8;
this.black = 1;
this.white = 2;
this.board = [];
this.setCanvas();
this.setBoard();
this.chipState = this.black;
this.bl... | true |
755c92e4af635cee1bb389a58ec49ec9844e93ab | JavaScript | ishagadekar/RefresherPrograms | /JavaScriptRefresherProbems/WebContent/Arrays.js | UTF-8 | 1,740 | 3.84375 | 4 | [] | no_license | var index = 0;
var tripEntries = new Array();
function addPerson() {
var name = document.getElementById("name").value;
if(name.length === 0 || !name.trim() || !name) {
alert("Please enter your name");
return;
}
tripEntries[index] = name;
alert("Congratulations! " + tripEntries[index] + " has been added to th... | true |
5139d39cb8d2ca47637e9d50f736d4fc448a51a2 | JavaScript | samirkumar1989/javamelody | /javamelody-core/src/main/resources/net/bull/javamelody/resource/monitoring.js | UTF-8 | 1,283 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | function showHide(id){
if (document.getElementById(id).style.display=='none') {
if (document.getElementById(id + 'Img') != null) {
document.getElementById(id + 'Img').src='?resource=bullets/minus.png';
}
try {
document.getElementById(id).style.display=='inline';
Effect.SlideDown(... | true |
e70443d31155f9368f5469408dd1006bf589ff59 | JavaScript | adriadria/client | /src/Visuals/Components/SearchBarPro/Helper.js | UTF-8 | 1,647 | 3.3125 | 3 | [] | no_license | export function Filter(obj,arr){
const {name,profesion, country, likes} = obj
if(name){
let nameResult = name.split(' ').map(e => e.charAt(0).toUpperCase() + e.slice(1)).join( ' ');
let nameResultReverse = nameResult.split(' ').reverse().join(' ')
let arrOne = name.split(' ').map(e => e.... | true |
2c6a46e7a19d5c4710872b826630aee2fbb60f29 | JavaScript | stamp-web/stamp-webservices | /test/fielddefinition-test.js | UTF-8 | 1,827 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | var country = require("../app/model/country");
var album = require("../app/model/album");
var preference = require("../app/model/preference");
describe('Field definition tests', () => {
describe('Country field definition tests', () => {
it("Validate with all required specified", () => {
var c =... | true |
75682029e3c2a699e5d27b7fb11ea52e04311eb7 | JavaScript | tomgallagher/typed-charts | /src/chartComponents/gameOfLife.js | UTF-8 | 2,282 | 2.78125 | 3 | [] | no_license | import React, { useEffect, useRef } from 'react';
import { select } from 'd3';
import { useResizeObserver } from '../hooks/useResizeObserver';
export const GameOfLife = ({ data }) => {
const svgRef = useRef();
const wrapperRef = useRef();
const dimensions = useResizeObserver(wrapperRef);
// w... | true |
3982d38a481334a85b03212e9492d9be02ad2530 | JavaScript | KDraxler/vaksinasimalang | /main.js | UTF-8 | 2,544 | 2.828125 | 3 | [] | no_license | const sections = document.querySelectorAll('section');
const navLi = document.querySelectorAll('nav .nav-items .menu ul li');
const menuTogle = document.querySelector('.menu-togle input');
const nav = document.querySelector('nav ul');
const overlay = document.querySelector('#overlay');
menuTogle.addEventListener('clic... | true |
8dc8f229d31ef671d05a3ed5c2599467cf6abb66 | JavaScript | ngrybird/Articles | /PrblmStmnt/Prblm2/Prblm2.js | UTF-8 | 835 | 3.0625 | 3 | [] | no_license | const passwrd = "An12";
function checkPasswordSthrength(pwd) {
let numberOfRequiredChar = 0;
//Check for numbers
const rgForNumber = new RegExp(/^(?=.{6,20}$)\D*\d/);
if (!rgForNumber.test(pwd)) {
numberOfRequiredChar++;
}
//check for uppercase
const rgForUpperCase = new RegExp(/^([A-Z]+)$/);
if (... | true |
9908fe2e857dcf8f6307444f8696bd6d322b28a3 | JavaScript | BobNobrain/projectile | /types/int.js | UTF-8 | 1,073 | 2.65625 | 3 | [] | no_license | module.exports = function (Field) {
class IntField extends Field {
constructor(bytes = 4, signed = true) {
super('int');
this.bytes = bytes;
this.signed = signed;
}
checkValue(i) {
if (typeof s !== typeof 0) return false;
// overflo... | true |
3d5f12b151d53837569b9abd0fd8a8436ba03c90 | JavaScript | sharkwang/Star-Citizen-WebGL-Map | /src/helpers/xhr-promise.js | UTF-8 | 662 | 2.6875 | 3 | [
"MIT"
] | permissive | import RSVP from 'rsvp';
export default function( url )
{
return new RSVP.Promise( ( resolve, reject ) => {
var request = new XMLHttpRequest();
request.onreadystatechange = function () {
if ( this.readyState === this.DONE ) {
if ( this.status === 200 ) {
// Success
resolve... | true |
83805d6b0198b836c8dec09cc6b45f8b9e0cece9 | JavaScript | javisantana/javisantana.com | /kotar/static/lap.js | UTF-8 | 2,844 | 3.046875 | 3 | [] | no_license |
function lap() {
}
function distance(p0, p1) {
var dx = p1.x - p0.x;
var dy = p1.y - p0.y;
return Math.sqrt(dx*dx + dy*dy);
}
lap.geoJSONLaps = function (laps) {
return {
"type": "FeatureCollection",
"features": laps.map(function(l) {
return {
type: "Feature",
geometry: la... | true |
d111a5c48978522938994ca8ebebcf01c709de57 | JavaScript | DevDave0/quote-maker-react-lab-wdc01-seng-ft-060120 | /src/reducers/quotes.js | UTF-8 | 795 | 2.8125 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | export default function quotes(
state = [],
action
) {
let index;
let newState;
switch(action.type) {
case "ADD_QUOTE":
return[...state, action.quote]
case "REMOVE_QUOTE":
return state.filter(quote => quote.id !== action.quoteId)
case "UPVOTE_QUOTE":
index = state.findIndex(quot... | true |
2ccc8270e27bf7d7ae02b487f1c23c497f36c71e | JavaScript | jiajiafan/JS | /resource/node-js/cookie,express/express/6.static.js | UTF-8 | 935 | 2.71875 | 3 | [
"MIT"
] | permissive | var express = require('express');
var path = require('path');
var mime = require('mime');
var app = express();
//使用静态文件中间件 指定静态文件的存放目录
// /index.html
app.use(static(path.join(__dirname,'public')));
app.use(static(path.join(__dirname,'app')));
var path = require('path');
var fs = require('fs');
function static(root)... | true |
6a2ae1afdc0096f3c7680b734fb543910c0567e0 | JavaScript | osukaru16/Proyecto_Final_OODO | /ongakuin/js/PartituraJson.js | UTF-8 | 1,713 | 3.078125 | 3 | [
"MIT"
] | permissive |
function PartituraJson(jsonRawString, nombreArchivo){
this.jsonRawString = jsonRawString;
this.jsonRaw;
this.partitura = [];
this.arrayObjectNotas;
this.titulo;
this.nuevoStringJson;
this.nombreArchivo = nombreArchivo;
}
PartituraJson.prototype.getTitulo = function(){... | true |
9af6cc903a157cbe8f055e2209927fbce8839632 | JavaScript | yuanliwei/yuanliwei.github.io | /src/test/three.js/particle/Particle.js | UTF-8 | 1,693 | 3.328125 | 3 | [] | no_license | class Particle {
constructor(scene, x, y, z, hueG) {
this.scene = scene
this.x = x
this.y = y
this.z = z
this.position = new THREE.Vector3(this.x, this.y, this.z)
this.direction = new THREE.Vector3(Math.random(), Math.random(), Math.random()).subScalar(0.5).normalize... | true |
f6fa51c67f2aeafec0389e484168c2d830c117e9 | JavaScript | wiliamtaesunglee/codeWars | /multiply.js | UTF-8 | 149 | 3.703125 | 4 | [] | no_license | function factorial(n)
{
let resp = 1
for (let i = 1; i <= n; i++) {
resp *= i
}
console.log(resp)
return resp
}
factorial(5) | true |
ef0bd9628e9b3ef7f59499f69a741bd61e97d557 | JavaScript | charlehl/project-two-bikeshare | /cyntia_folder/static/js/app.js | UTF-8 | 7,173 | 3.15625 | 3 | [] | no_license | // Set the margins
var margin = {top: 60, right: 60, bottom: 60, left: 60},
width = 900 - margin.left - margin.right,
height = 400 - margin.top - margin.bottom;
// Parse the month variable
var parseWeekday = d3.timeParse("%A");
var formatWeekday= d3.timeFormat("%A");
// Set the ranges
var x = d3.scaleBan... | true |
54f67c39852f6ab70a707ab62750930103d30625 | JavaScript | aaditya-prog/unistore-django-ecommerce | /static/assets/js/cart.js | UTF-8 | 920 | 2.859375 | 3 | [
"MIT"
] | permissive | $(document).ready(function () {
$('.item-qty').change(function () {
var cartRows = document.getElementsByClassName("cart-border");
total_price = 0;
for (var i = 0; i < cartRows.length; i++) {
total = 0
total_quantity = 0
var cartRow = cartRows[i]
... | true |
11eae576a70ae97832002672e3029a012afde509 | JavaScript | Mqasim0/React_Mirage_Basics | /src/App.js | UTF-8 | 1,604 | 2.75 | 3 | [] | no_license | import React,{useState, useEffect} from 'react';
import logo from './logo.svg';
import './App.css';
function App() {
const [books, setBooks] = useState([])
const [author, setAuthor] = useState('')
const [title, setTitle] = useState('')
const fetchBooks = async()=>{
const res = await fetch('/api/books')
... | true |
010d5fba002bc48c9d9d24b961db18d05ba76de6 | JavaScript | baxri/code | /2018/hacker-rank/Mixed/staircase.js | UTF-8 | 259 | 3.578125 | 4 | [] | no_license |
function staircase(n) {
let empty = n;
let str_empty = " ";
let str_starcase = "#";
while( empty > 0 ){
empty--;
console.log(str_empty.repeat(empty) + "" + (str_starcase.repeat(n-empty)));
}
}
console.log(staircase(6)); | true |
be14a124491a29539a6c4df615c2ea61b6337cc7 | JavaScript | Supanut1911/Nodejs | /Loop_callback.js | UTF-8 | 462 | 3.703125 | 4 | [] | no_license | //การใช้ map
//map จะใช้ในกรณี เจอ array และ callback
var arr = [1,2,3,4,5,6,7,8,9,10]
arr.map( (value) => {
console.log("data :"+value);
})
//การใช้ foreach
//forEach จะใช้กับ object และ callback
var person = {
name : "Supanut",
lname : "Laddayam",
id : "5935512049",
fac : "CoE"
}
Object.keys(person).forE... | true |
ae29bdc793c1c230a8e72dd66fe8b517905cda5e | JavaScript | buenjybar/SVG-Canvas | /datasource.js | UTF-8 | 1,326 | 3.03125 | 3 | [] | no_license | class DataSource {
constructor() {
this.freq = 250; // Hz
this.raw = null;
this.keys = [];
this.timer = null;
this.timeout = 20;// ms
this.index = 0;
this.maxLength = 0;
}
set data(data) {
this.raw = data;
this.keys = Object.keys(data)... | true |
6cf83d336f4bd417fe170b5dae778c0f07413a69 | JavaScript | 274336317/weibo | /services/weibo.js | UTF-8 | 2,631 | 2.515625 | 3 | [] | no_license | const sequelize = require('../shared/sequelize');
const PublishType = require('../models/weibo').PublishType;
const Weibo = sequelize.import('../models/weibo');
const User = sequelize.import('../models/user');
// 发表微博
exports.publish = async function (userId, content) {
return Weibo.create({
userId,
... | true |
5ec9d0bf93846536e58aa9d8ef75768aa31d8a61 | JavaScript | wayde22/qdev | /first-react-api/src/App.js | UTF-8 | 1,084 | 2.828125 | 3 | [] | no_license | import React from 'react';
import './App.css';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
whatever: '',
}
}
myFunction = () => {
fetch('https://api.kanye.rest/')
.then(response => response.json())
.then(json => this.setState({whatever:... | true |
97ac35903915a88fa2a31bfd149cd4d751d9a694 | JavaScript | fragoso94/appCourse | /src/screens/CounterScreen.js | UTF-8 | 1,807 | 2.71875 | 3 | [] | no_license | import React, {useState, useReducer} from 'react';
import { View, StyleSheet } from 'react-native';
import {Text, Button} from 'react-native-elements';
const reducer = (state, action)=>
{
//state: {count: number}
//action {type: 'increment' || 'decrement'}
switch (action.type) {
case 'increment':
... | true |
3334b8b02a75c2b9d0ad9c50056df9a5bbd28f95 | JavaScript | alsricha/EventSmash | /scripts/seatgeek.js | UTF-8 | 8,252 | 2.75 | 3 | [] | no_license | $(document).ready(function () {
$(".datepicker").datepicker({});
$("input.autocomplete").autocomplete({
data: {
concerts: null,
sports: null,
music: null,
comedy: null,
},
});
});
// hide load page
setTimeout(hideLoadPage, 2500);
setTimeout(showLandingPage, 2500);
function hideL... | true |
0ab3589f6ce3d47473c9f8c5373c457100447067 | JavaScript | tamicristina/boom-game | /main.js | UTF-8 | 978 | 3.265625 | 3 | [] | no_license | const buttonInitGame = document.querySelector(".btn-init-game");
buttonInitGame.addEventListener("click", function () {
buttonInitGame.remove();
initGame();
});
function initGame() {
setInterval(createBalloon, 1000);
}
const balloonsContainer = document.querySelector(".container-balloons");
function createBal... | true |
ddadf3cb59a07062645d33bdd86b4aec23433586 | JavaScript | Shreya-chakra123/Git-Profile-Compare | /src/App.js | UTF-8 | 1,664 | 2.59375 | 3 | [] | no_license | import React, { useState } from 'react';
import Axios from "axios"
import './App.css';
import {
Row,
Container,
Col,
Input,
Button,
InputGroup,
InputGroupAddon
} from "reactstrap";
import 'bootstrap/dist/css/bootstrap.min.css';
import UserCard from "./UserCard";
const App = () => {
//const myapp = [... | true |
87b8a7fbd7bf4e56e2322025a3c7db5b29866049 | JavaScript | BhargaviM/garden-guru | /src/pages/Help.js | UTF-8 | 5,555 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react';
import Names from './form-components/Names';
import UserEmail from './form-components/UserEmail';
import TextArea from './form-components/TextArea';
import SaveButton from './form-components/SaveButton';
import SaveStatus from './form-components/SaveStatus';
import axios from '... | true |
224be8f8f020dab252fea273ebb0651f50ef20fc | JavaScript | TrojanerHD/Songrequestbot-Old | /html/js/index.js | UTF-8 | 2,906 | 2.734375 | 3 | [] | no_license | const { ipcRenderer } = require('electron')
const $ = require('jquery')
let playing = false
// create youtube player
let player
let currentlyPlaying
function refresh () {
const data = ipcRenderer.sendSync('refresh')
const song = data['song']
const alertMessage = data['alert']
if (alertMessage != null) alert(a... | true |
c6002df377eb92fddb160a61bd6c4080529ae0b7 | JavaScript | kadensungbincho/Online_Lectures | /treehouse/front_end_development/JS_LoopArrayObject/S11_test/js/students.js | UTF-8 | 1,403 | 3.78125 | 4 | [] | no_license | var html = "";
var search = "";
var students = [
{
name: 'Dave',
track: 'Front End Development',
achievements: 158,
points: 14730
},
{
name: 'Jody',
track: 'iOS Development with Swift',
achievements: '175',
points: '16375'
},
{
name: 'Jordan',
track: 'PHP Development',... | true |
074e931452ab1b677eeda5d8126aa4943d22d426 | JavaScript | etzau01/comp20-etzau | /mbta/mbta.js | UTF-8 | 8,119 | 2.8125 | 3 | [] | no_license | function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 12,
center: {lat: 42.352271, lng: -71.05524200000001}
});
// check geolocation
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var pos = {
lat: positi... | true |
9afaf6021590e7f9f8147a23581767e41301609d | JavaScript | sjr765/dom_ghost_counting | /javascript.js | UTF-8 | 699 | 3.65625 | 4 | [] | no_license | function firstFunction(){
var x = document.getElementsByTagName("p");
alert("There are " + x.length + " ghosts on this page!" )
}
function secondFunction(){
var x = document.getElementById("paragraphOne");
var y = x.getElementsByTagName('p');
alert("There are " + y.length + " pink ghosts on this... | true |