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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
63523a08465caeeadfae321abfbc78dc113be4df | JavaScript | CodyOps/Star-Wars-Quiz | /index.js | UTF-8 | 5,582 | 3.140625 | 3 | [] | no_license | //Code Quiz
//VARIABLE DECLARATION
var timer = document.querySelector("#timer");
var highScore = document.querySelector("#highScore");
var question = document.querySelector("#questionTitle");
var answers = document.querySelector("#questionChoices");
var currentQuestionsIndex = 0;
var secondsLeft = 120;
var Score = doc... | true |
668687abbab238db487e3e2b0ee5db8b942136d3 | JavaScript | Gr1n4/test-algorithms-js | /src/poland-notation.js | UTF-8 | 2,909 | 3.5 | 4 | [] | no_license | 'use strict';
/**
* 17:25 - 18:10
* 19:05 - 19:25
* 19:40 - 21:10 - закончена линейная нотация
* 21:35 - 21:55
* Принцип алгоритма таков.
* Когда натыкаешься на операцию в строке, ее нужно использовать
* для вычисления по предыдущим двум числам.
* Операции и числа разделяются пробелом.
* Так же необходимо сде... | true |
f371c3fab31f8e16310e037c3cb50960dd2ac5a2 | JavaScript | heporap/wicker | /concat/wm.js | UTF-8 | 10,663 | 2.734375 | 3 | [
"CC-BY-3.0",
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | /*! wicker.js modules - 2014-10-31
* (c) 2014 Wicker Wings
* License: MIT
****/
(function(window, undefined){
'use strict';
var Version = 'ajax 0.2';
function createXHR(){
if(window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if(window.ActiveXObject) {
try {
return new ActiveXObject('M... | true |
0a5d3b2d4645388f9eb0bd9c426366ac63542463 | JavaScript | CindyJS/CindyJS | /plugins/cindyprint/src/js/MeshGraph.js | UTF-8 | 3,702 | 3.59375 | 4 | [
"Apache-2.0"
] | permissive | /**
* Constructs a graph node.
*/
function GraphNode() {
// Contains the indices of all nodes connected by an edge
this.neighbors = [];
// All edges connecting this node with another node
this.edges = [];
// Whether this node was visited by a search algorithm
this.visited = false;
}
/**
* Constructs a grap... | true |
a252e21b88fbb0254be49f760302a9ed34346b66 | JavaScript | Yourstpdfrnd/Prototype | /js/main.js | UTF-8 | 1,708 | 2.8125 | 3 | [] | no_license | const items = Array.prototype.slice.call(document.querySelectorAll('.page__item'));
items.forEach((item) => {
const checkbox = item.querySelector('input[type=checkbox]');
const desc = item.querySelector('.page__item-description');
const card = item.querySelector('.page__label');
const caption = item.que... | true |
cafdd7b3c6a6cc1d1fe61ac8ee6fc6b8b388d20e | JavaScript | sgammon/js-datocms-client | /lib/wpImport/import/articles.js | UTF-8 | 14,176 | 2.515625 | 3 | [
"MIT"
] | permissive | 'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports['default'] = articles;
var _escapeStringRegexp = _interopRequireDefault(
require('escape-string-regexp'),
);
var _allPages = _interopRequireDefault(require('../utils/allPages'));
function _interopRequireDefault(obj) {
return... | true |
6df2c7a49696d88f47afb97782589b31971fd51d | JavaScript | kinaclover/finalProject | /findEat/WebContent/js/googleLogin.js | UTF-8 | 3,893 | 2.53125 | 3 | [
"MIT"
] | permissive | /**
* suggest javascript
*/
function onSignIn(googleUser) {
// 구글 사용자 데이터 가져옴
var profile = googleUser.getBasicProfile();
// The ID token you need to pass to your backend:
var id_token = googleUser.getAuthResponse().id_token;
console.lo... | true |
0dd1a7cedd942e78df708c0a957a25766ddd1600 | JavaScript | 4TWS3/collection-calculate-camp | /practices/collectionOperator/get_integer_interval.js | UTF-8 | 488 | 2.828125 | 3 | [] | no_license | 'use strict';
function get_integer_interval(number_a, number_b) {
let step = (number_b > number_a)? 1: -1;
let ret = [];
for(let num =number_a;num *step <= number_b *step; num+=step ){
ret.push(num); //
}
return ret;
//尾递归
/*
return (function get_iterger_interval_item(num,pre) {
pre.push(num... | true |
bffec07d6e95519f55dbd482445c7faca586d3b5 | JavaScript | SHejnas/Katas | /noBoringZeros.js | UTF-8 | 603 | 3.484375 | 3 | [] | no_license | function noBoringZeros(n) {
let nString = n.toString();
let zeroless = "";
if (n === 0) {return n;
} else {
for (let index = 0; index <= nString.length; index++) {
if (nString.charAt(index) != "0") {
zeroless += nString.charAt(index);
}
}
}
ret... | true |
80ea5c10ba72aad7bfcb132bcf85ac71e08ae76c | JavaScript | dankim93/writeLab_challenge | /src/App.js | UTF-8 | 2,010 | 2.59375 | 3 | [] | no_license | import React, { Component } from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import * as actions from './actions/data_actions';
import PieGraph from './components/pie';
class App extends Component {
constructor(props) {
super(props);
this.state = {
radio1: "c... | true |
006cf1a672497902ca694e3b9145807a020f3510 | JavaScript | varonow/javascript-projects | /js/basic_javascript_4.js | UTF-8 | 358 | 3.28125 | 3 | [] | no_license | function myDictionary() {
var person = {
firstName: "Victoria",
lastName: "Aronow",
city: "New York",
state: "NY"
}
delete person.state;
var str = person.firstName + " " + person.lastName + " lives in ";
str += person.city + ", " + person.state;
document.getElemen... | true |
8bf378d25be49dec78a3ad8de89d568241a6badb | JavaScript | alanstos/app-node | /client-mobile.js | UTF-8 | 475 | 2.5625 | 3 | [] | no_license | var http = require('http');
var configuracao = {
hostname: 'localhost',
port:3000,
path: '/produtos',
headers: {
'Accept':'application/json' //formato json
//'Accept':'text/html' //formato html
}
}
http.get(configuracao,function(res){
console.log(res.statusCode);
res.on... | true |
39c51be197845d1ba578b792f215fe559d475b15 | JavaScript | maggieswan/201609node | /22.mongodb/3.update.js | UTF-8 | 1,169 | 3.046875 | 3 | [
"MIT"
] | permissive | var mongoose = require("mongoose");
var db = mongoose.connect("mongodb://localhost:27017/maggiebase");//数据库名字随便起maggiebase
db.connection.on("error", function (error) {
console.log("数据库连接失败:" + error);
});
db.connection.on("open", function () {
console.log("数据库连接成功");
});
//数据库的集合之结构定义 定义一个骨架(字段的名字和类型)
var Pers... | true |
48a82e4b30f2aac76d4d0bb66ad8effd4bf98cc0 | JavaScript | shawnmuzick/PoRiver | /public/js/factory/create_node.js | UTF-8 | 567 | 2.890625 | 3 | [] | no_license | // create a node
export function create_node({
type = "div",
attributes = {},
properties = {},
cssClass = [],
children = [],
event = null,
}) {
const node = document.createElement(type);
// classes
node.classList.add(...cssClass);
// attributes
for (let a in attributes) {
node.setAttribute(a, ... | true |
4804546fd02025b9b3c9ce50211f653155f22097 | JavaScript | radekwilk/travel-agent-css-html-project | /js/script.js | UTF-8 | 441 | 3.234375 | 3 | [] | no_license | // Adding and removing change class when hamburger menu and close navbar are clicked
const mainContainer = document.querySelector('.container');
const hamburgerMenu = document.querySelector('.menu');
const navClose = document.querySelector('.nav-close');
hamburgerMenu.addEventListener('click', ()=> {
mainContainer... | true |
31e55765dad480d9ba79fa491182ee28d7d1c0ee | JavaScript | SergSmith64/react-practice | /work/src/App.js | UTF-8 | 2,235 | 2.796875 | 3 | [] | no_license | import React from "react";
// __ я добавил : __
// __ ПЕРЕНОШУ НИЖЕ API __
// import User from './User';
// __ я добавил : __
// __ ТЕПЕРЬ ОШИБКА: __ ERROR !!! ________________________
// 'photoJessica' is defined but never used no-unused-vars
// __ так как инфа и картинка грузится с сервера _________
import photoJess... | true |
c74921ee2ba5597ae9aadcb4d21d08842e8ac3ad | JavaScript | caravl/data-structures-I | /02_linkedlist/linkedlist.js | UTF-8 | 1,943 | 3.65625 | 4 | [] | no_license | function LinkedList() {
this.head = undefined;
this.tail = undefined;
this.addToHead = function(value) {
var node = new Node(value);
node.previous = null;
if (this.head) {
this.head.previous = node;
node.next = this.head;
} else {
this.tail = node;
}
this.head = node;
... | true |
1c4b05e021be5aa36cb3efafb2143cb9878d500d | JavaScript | AshotVoskanian/Lucy | /media/js/main.js | UTF-8 | 411 | 2.75 | 3 | [] | no_license |
var information = document.querySelectorAll(".information");
var spans = document.querySelectorAll(".block span");
for (var i = 0; i < information.length; i++) {
spans[i].id = i;
}
for (var i = 0; i < spans.length; i++) {
spans[i].addEventListener('click', function(event) {
information[event.target.id].styl... | true |
a3151e4591f0852f50b10a0d4a028d49574c2f74 | JavaScript | teamnykd/tedomi | /snake/game_snake.js | UTF-8 | 5,362 | 2.921875 | 3 | [] | no_license | var audioDie = new Audio('haha.mp3');
var audioHit = new Audio('oh.mp3');
var died = false;
function getWidth() {
return Math.max(
document.body.scrollWidth,
document.documentElement.scrollWidth,
document.body.offsetWidth,
document.documentElement.offsetWidth,
document.documentElement.clientWidth... | true |
44f5bde1f1d9eacd4fbdb39b589101f5a7e28c98 | JavaScript | Tyrone-web/JianShu | /src/pages/detail/store/actionCreators.js | UTF-8 | 473 | 2.53125 | 3 | [] | no_license | import axios from 'axios';
import { GETDETAILDATA } from './actionType';
const getDetailDataAction = (value) => ({
type: GETDETAILDATA,
value
})
export const getDetailDataActionAsync = (id) => {
return (dispatch) => {
axios.get(`/api/detailList.json?id=${id}`).then(res => {
... | true |
3e90aae1553796172399e17ae3ea96370c288053 | JavaScript | inushaM/ReactAndMongoCrud | /frontend2/src/component/Create.js | UTF-8 | 2,944 | 2.515625 | 3 | [] | no_license | import React, {Component} from 'react';
import axios from 'axios'
export default class Create extends Component {
constructor(props) {
super(props);
this.state = {
name : '',
code : '',
passMark : '',
lectureIncharge : ''
}
}... | true |
3c33644ac6e2074ad8c7281313840b063dc7b959 | JavaScript | Provokator86/Full-Repo | /hizmetuzmani/html/js/jquery.autofill.js | UTF-8 | 1,187 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | // $Id: jquery.autofill.js,v 1.1.4.1 2009/08/05 18:55:54 add1sun Exp $
// Auto-Fill Plugin
// Written by Joe Sak http://www.joesak.com/2008/11/19/a-jquery-function-to-auto-fill-input-fields-and-clear-them-on-click/
(function($){
$.fn.autofill = function(options){
var defaults = {
value:'',
//... | true |
378a3bf2168fdd084286c12fd60b1ca0fc535e64 | JavaScript | ngot/fibjs-delegates | /test/index.js | UTF-8 | 1,833 | 2.546875 | 3 | [
"MIT"
] | permissive | var test = require('test');
var delegate = require('index');
test.setup();
describe('.method(name)', function () {
it('should delegate methods', function () {
var obj = {};
obj.request = {
foo: function (bar) {
assert(this == obj.request);
return bar;
}
};
delegate(obj,... | true |
93ede2ee4951ff64ff7cc142b6427192b3b806f1 | JavaScript | Goroshik/auction_server | /repository/users.repository.js | UTF-8 | 1,059 | 2.578125 | 3 | [] | no_license | const { Users } = require('../models');
class UsersRepository {
constructor() {
this.users = Users;
this.attributes = ['id', 'firstName', 'lastName', 'email'];
}
getAll() {
return this.users.findAll({ attributes: this.attributes });
}
get(userID) {
return this.users.findOne({
where: {... | true |
a1d7f958ad4022df3faf358895f1e85a39c01cf7 | JavaScript | wale1454/Simple-Score-Keeper | /scorekeeper.js | UTF-8 | 1,036 | 3.640625 | 4 | [] | no_license | var Button1 = document.querySelector("#p1") ;
var Button2 = document.querySelector("#p2") ;
var reset = document.querySelector("#reset");
var p1Display= document.querySelector("#p1Display");
var p2Display= document.querySelector("#p2Display");
var p1Score = 0;
var p2Score = 0;
var gameOver = false ;
var win... | true |
58867d27d1e5d9a59aa7d7b390a3e662f5730c78 | JavaScript | xlreon/quiz_up | /src/reducers/index.js | UTF-8 | 1,263 | 2.53125 | 3 | [] | no_license | import { AppActions } from "../actions";
import { initialState } from "../store";
function reducer(state = initialState, action) {
const { type, payload } = action;
switch (type) {
case AppActions.UPDATE_QUESTION_NUMBER:
const isValidQuestion = state.question_and_answers.length > state.curr... | true |
b3e803bc5593a2a6416b63c91944f285751d255d | JavaScript | constantineoryshych/intertop-busket | /source/js/views/components/common/filterItem.jsx | UTF-8 | 2,336 | 2.515625 | 3 | [] | no_license | import React, { Component } from "react";
import _ from "lodash";
import { BrandParser } from "~/services/parsers";
import ItemFilter from "@/itemFilter.json";
class FilterItem extends Component {
constructor(props) {
super(props);
// Выбранные фильтры родительской категории этого элемента
const allCategorySel... | true |
71ddde62efddb0b439086582663be05318933fc8 | JavaScript | rajeetdel/webDevelopment | /functionThis.js | UTF-8 | 378 | 3.765625 | 4 | [] | no_license | function Person() {
var self = this; // Some choose `that` instead of `self`.
// Choose one and be consistent.
self.age = 0;
setInterval(function growUp() {
// The callback refers to the `self` variable of which
// the value is the expected object.
self.age++;
... | true |
f1c0cbb5258fabac5a933666e87900a0814cd337 | JavaScript | Jokara998/isa-psw | /team-47-project/src/main/resources/static/js/register.js | UTF-8 | 4,254 | 2.5625 | 3 | [] | no_license | Vue.component("register",{
data:function(){
return{
}
},
template:`
<body>
<form id="forma">
<table>
<div class="form-group">
<tr><td> <label for="exampleInputEmail1">Korisnicko ime:</label></td><td><input type="text" class="form-control" id="username" aria-describedby="emailHelp... | true |
84d5b16ed26e642e58aa0ecd70384ab74ce1e471 | JavaScript | baptistehonnay/Projet_JS_Frontend | /src/Components/RegisterPage.js | UTF-8 | 3,026 | 2.640625 | 3 | [] | no_license | "use strict"
import { RedirectUrl } from "./Router.js";
import Navbar from "./NavBar.js";
import {setUserSessionData} from "../utils/Session.js";
import {escapeHtml} from "../utils/Utils.js"
const registerPage=`
<form>
<div class="row mx-0">
<div class="col-lg-4 col-md-2"></div>
<div class="col-lg-4 col-md... | true |
6eb813ce9e371d71432dee4e31b99bb4545da210 | JavaScript | Th3Botanist/burning-airlines-client | /src/components/Nav.js | UTF-8 | 2,413 | 2.71875 | 3 | [] | no_license | import React, { Component } from 'react'
import { Link } from 'react-router-dom';
import Home from './Home'
import Search from './FlightSearch'
import List from './List'
import axios from 'axios'
const USERS_URL = 'https://burning-airlines-backend.herokuapp.com/users.json'
const Welcome = ({user, onSignOut})=> {
//... | true |
0399d00e973a865669482241e0d04a4590a693d9 | JavaScript | udhayakumark/IL-New | /agilenode/lib/util/folder.js | UTF-8 | 489 | 2.8125 | 3 | [] | no_license | var path = require('path');
var fs = require('fs');
exports.getValid = function(folder) {
if(!__util.strEndsWith(folder, path.sep)) {
folder = folder + path.sep;
}
if(_isValid(folder)) {
return folder;
}
return null;
};
exports.isValid = function(folder) {
return _isValid(folder);
};
exports.cre... | true |
28992308026d27e4be80e7502bf977c94dc789af | JavaScript | olivblad/laCapsule-Pendu | /script.js | UTF-8 | 4,181 | 4.03125 | 4 | [] | no_license | let solution = "";
//Add Event Listener to our Button when clicked : will fire our initializeGame function
//& make our GuesserContainer visible
const btnGuess = document.getElementById("btn-guess");
btnGuess.addEventListener("click", () => {
initializeGame();
if (solution.length === 0) {
alert("Please enter a... | true |
5531cb66b0959f4eb588fe9b944025d497d50d8c | JavaScript | natrajvanamala/BOOKS__API | /requirement.js | UTF-8 | 840 | 2.859375 | 3 | [] | no_license | // requirement of project
// we are a book management company
// BOOKS
// ISBN , title , publication date , language , number of pages, authors, category
// AUTHORS
// id , name , books[]
// PUBLICATIONS
// id , name , books[]
// we have to design and code an API over this
// 1) Books
// we ... | true |
88478b4a4f32e787174a649916ec251051c269ba | JavaScript | a-yasko/Coursework | /frontend/js/crm.js | UTF-8 | 31,767 | 2.703125 | 3 | [] | no_license | (() => {
// Константы
const tbody = document.querySelector('.table tbody'),
theads = document.querySelectorAll('.table thead tr th'),
loading = document.querySelector('.loading'),
inputSearch = document.querySelector('#search'),
btnCreate = document.querySelector('.btn-create'),... | true |
20b5c65142f8f64bd61c676ed3cb1e0db639e782 | JavaScript | hayeun7777/prehistoric_assignment | /controller/prehis.js | UTF-8 | 1,352 | 2.78125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var fs = require('fs'); //access to file system
var preHisData = fs.readFileSync('prehistoric_creatures.json');
preHisData= JSON.parse(preHisData);
router.get('/', function(req, res){
var typeFilter = req.query.typeFilter;
if(typeFilter){
var filtere... | true |
f56b9a894db1ae15f49b1db2265e0f6c0184f21c | JavaScript | JoselynDRF/react-redux-jest-boilerplate | /src/reducers/message-reducer.js | UTF-8 | 294 | 2.59375 | 3 | [] | no_license | import * as types from '../constants/actions-types';
// EXAMPLE: Update message
const message = (state = 'Hello World!', action) => {
switch (action.type) {
case types.UPDATE_MESSAGE: {
return action.message;
}
default:
return state;
}
};
export default message;
| true |
bcb596576b600b503d4674899492fa51e9d9754d | JavaScript | Fedakope/cryptonode | /server.js | UTF-8 | 1,594 | 2.5625 | 3 | [] | no_license | // Require class et DAO
const exchange = require("./Metier/exchange.js");
const asset = require("./Metier/asset.js");
const dao_asset = require("./Metier/DAO_Asset");
const dao_exchange = require("./Metier/DAO_Exchange");
// Require node package
const argv =require("yargs").argv;
const mysql = require('mysql2');
const... | true |
5e3c4b4696bbfc2d118151acd6908fe7ed58aaf2 | JavaScript | esmarti/rorschach-um | /app/assets/javascripts/sheets.js | UTF-8 | 5,672 | 2.796875 | 3 | [] | no_license | //function for colour areas when mouse is over button in "area selector"
$( document ).on('turbolinks:load',function(){
//mostrar un area al pasar con el mouse sobre el areaButton
$("#areaButtons button").mouseenter(function() {
//buscar el boton sobre el que ocurrio el event hover y guardar el attr "arr_zones".
... | true |
a506187789777ab35c4e008dbb8c7576ff701d23 | JavaScript | totherain155/practice_react_hooks | /src/useClick/index.js | UTF-8 | 705 | 2.765625 | 3 | [] | no_license | import React, { useState, useEffect, useRef } from "react";
import ReactDOM from "react-dom";
// , useRef, useEffect 사용
const useClick = (onClick) => {
const element = useRef();
useEffect(() => {
if (element.current) {
element.current.addEventListener("click", onClick);
}
});
... | true |
990d8e7d74953b87460358be37fb99fbae2ecb7b | JavaScript | o7planning/webexamples | /node-ecmascript/classhistory/object-example2.js | UTF-8 | 457 | 3.703125 | 4 | [] | no_license |
var tom = {
name: "Tom",
country: "USA"
};
// Delete property - country
delete tom["country"]; // Same as: delete tom.country;
// Add property - gender
tom["gender"] = "Male"; // Same as: tom.gender = "Male";
// Access:
console.log( tom.name ); // Tom
console.log( tom["name"] ); // Tom
console.log( tom["coun... | true |
0487db5bb337bcf30dc67fffe110c24acd6df0f2 | JavaScript | khosravi11/fortnite | /server.js | UTF-8 | 1,279 | 2.734375 | 3 | [] | no_license | let express = require('express');
let bodyParser = require('body-parser');
let request = require('request');
let async = require('async');
let userDetails = new Array();
let PORT = 3000;
// Initialize Express
let app = express();
// Configure middleware
app.set('view engine', 'ejs');
app.use(bodyParser.urlenc... | true |
8f948dcf1fcc991ed85fbda5eab8891c86918178 | JavaScript | paperschool/DDParty | /app/socket.js | UTF-8 | 1,677 | 2.546875 | 3 | [
"MIT"
] | permissive |
module.exports.socket = null;
// call back for new connections
module.exports.onConnect = () => null;
// setter for new connection callback
module.exports.registerConnection = (callback) => {
module.exports.onConnect = callback;
}
// generic on message type callback
module.exports.registerOn = (message,hook) => {... | true |
3316e53867527f278d1af7e1a402f21fb6b4d04c | JavaScript | markosolopenko/Frontend | /JS_code_wars/algoritms/total_amount_of_points.js | UTF-8 | 284 | 3.625 | 4 | [] | no_license | function points(games) {
let points = 0;
for(let i = 0; i < games.length; i++) {
if(Number(games[i][0]) > Number(games[i][2])) {
points += 3;
}else if(Number(games[i][0]) === Number(games[i][2])) {
points += 1;
}
}
return points;
} | true |
f3cda57cc178e3a20dd651ee978f32ba0e6335ac | JavaScript | PEMTR/nursery | /bin/oss.js | UTF-8 | 2,075 | 2.53125 | 3 | [
"MIT"
] | permissive | "use strict"
// package.
// @package
const fs = require("fs")
const util = require("util")
const oss = require("ali-oss")
// Object storage.
// @class
module.exports = class Oss {
// @constructor
constructor ({ redis, configure }) {
this.store = new oss(configure.oss)
this.configure = configure.oss
... | true |
01bf0cfd427f54a8f7d21747a48ca7a9b695dd76 | JavaScript | JorgeVidales/VTODM | /PasosVentaODM/wwwroot/js/paso3/wsConfirmacion.js | UTF-8 | 4,376 | 2.75 | 3 | [] | no_license | function wsConfirmacion() {
//// CHECAMOS SI EL VIAJE ES REDONDO //////
let datosRegreso = JSON.parse(localStorage.getItem('datosRegreso'));
let regreso2 = datosRegreso[0].length;
//console.log(datosRegreso[0].length);
//let btnSolicita = $("#btnSolicita").text();
let adulto = $(".adu... | true |
e7d41762d2dd059293fd8bf0906f47309f02aedc | JavaScript | anshuman725/React | /Lecture3/src/Person/Person.js | UTF-8 | 573 | 2.546875 | 3 | [] | no_license | import React from 'react';
// import Radium from 'radium';
// npm install radium
class Person extends React.Component {
render() {
const style = {
backgroundColor: 'red',
margin: '20px',
border: '1px solid black',
padding: '20px',
width: '200px'... | true |
79d523d13668ee9b3854b295432f9199f52032e5 | JavaScript | Shuarz/Programacion-Laboratorio-III | /TypeScript-main/Clase 1 - TypeScript/Ejercicios/Ejercicio10/app.js | UTF-8 | 700 | 4.09375 | 4 | [] | no_license | /*
Definir una funcion que muestre informacion sobre una cadena de texto
que se le pasa como argumento. A partir de la cadena que se le pasa,
la funcion determina si esa cadena esta formada sólo por mayúsculas,
solo por minúsculas o por una mezcla de ambas.
*/
function DefinirCadena(cadena) {
if (cadena == cadena.t... | true |
c01c675f37215adc41c45a1b3126f4e75ba09e2c | JavaScript | mkok1019/angular-health-app | /scripts/components/plan-panel/plan-panel.controller.js | UTF-8 | 2,245 | 2.515625 | 3 | [
"MIT"
] | permissive | class PlanPanelController {
constructor(MacroPlan, MacroGoal, AlertService) {
this._MacroPlan = MacroPlan;
this._MacroGoal = MacroGoal;
this._AlertService = AlertService;
this.init();
}
init() {
this.weekdays = moment.weekdays();
this.isExpanded = true;
this._MacroGoal.list()
... | true |
dfa7dc526b0b28eea4523826f8b213a8391a90fc | JavaScript | thtauhid/result-system | /backend/routes/student.js | UTF-8 | 643 | 2.546875 | 3 | [] | no_license | const router = require('express').Router()
let Student = require('../models/student.model')
// List all student
router.route('/list').get((req, res) => {
Student.find()
.then(result => res.json(result))
.catch(err => res.staus(400).json('Error: ', +err))
})
// Add New Student
router.route('/add')... | true |
db84180ccae800ce3a55420bc18ea332d41e6696 | JavaScript | studioTeaTwo/studioTeaTwo.github.io | /components/about.js | UTF-8 | 2,967 | 2.84375 | 3 | [
"MIT"
] | permissive | export default class AboutComponent extends HTMLElement {
static get observedAttributes() {
return ['active'];
}
get active() {
return this.hasAttribute('active');
}
set active(val) {
if (val) {
this.setAttribute('active', '');
} else {
this.removeAttribute('active');
}
}
... | true |
05816f872a507ccbbad5755e9150185102523cc9 | JavaScript | coolinmc6/d3-react | /src/d3/old/D3Two.js | UTF-8 | 2,390 | 2.796875 | 3 | [] | no_license | import React, { useRef, useState} from 'react';
import * as d3 from 'd3';
import './d3two.css';
import { useEffect } from 'react';
const D3Two = ({ data }) => {
const [myData, setMyData] = useState([ 10, 40, 30, 50, 20 ])
// const [myData, setMyData] = useState(data)
const circleSpacing = 50;
const transitionD... | true |
216f22c425e5cda9cae258a00475aa97f1d3f349 | JavaScript | anaymark/node-greeting-app | /greeting.js | UTF-8 | 272 | 2.703125 | 3 | [] | no_license | exports.greetingEnglish = function() {
console.log('Hello');
}
exports.greetingJapanese = function() {
console.log('Konichiwa');
}
exports.greetingSpanish = function() {
console.log('Holla');
}
exports.greetingIcelandic = function() {
console.log('Góðan daginn');
} | true |
5b9674335ea127d5faab4ff9278b161772d67d0a | JavaScript | Zarina2222/Multimedia_Project | /rail.js | UTF-8 | 1,741 | 2.953125 | 3 | [] | no_license | function Rail(x,y,type){
this.x = x|0;
this.y = y|0;
this.collisionArray = [];
this.tileIndexX = ~~(this.x/spriteWidth);
this.tileIndexY = ~~(this.y/spriteHeight);
this.type = type|0;
this.hitBox = {left:this.x,right:this.x+spriteWidth,top:this.y,bottom:this.y+spriteHeight}
this.hitBox.centerX = (this.h... | true |
ce5fe612728c7c073c239574007f49df1c68553b | JavaScript | motyar/dharmmotyar | /js/dragable_div.js | UTF-8 | 1,061 | 2.59375 | 3 | [] | no_license | //<DIV style="cursor: move;position:absolute;"
// onmousedown="startdrag(this, event);"
//><img src="http://mail.google.com/mail/images/2/5/logo1.png" ></DIV>
function startdrag(t, e) {
if (e.preventDefault) e.preventDefault(); //line for IE compatibility
e.cancelBubble = true;
window.document.onmousemoveOld =... | true |
d902e07d03f2afa58e36508db6c31f4351fffd8d | JavaScript | Dorence/hustau-site-material-miniapp | /miniprogram/app.js | UTF-8 | 4,480 | 2.515625 | 3 | [
"MIT"
] | permissive | // app.js
const CFG = require("./config.js");
App({
globalData: {
rule: `
1. 请至少提前两天准备好活动策划,在${CFG.appFullName}小程序上申请借用教室,并将策划电子版以“36号楼教室借用+协会名称+日期”的方式命名发送至办公室公邮${CFG.contactEmail}。审批情况可在小程序上查询,审批通过方可使用;
2. 使用教室的当天须将手机上教室借用确认单给阿姨查看,并在36号楼教室借用登记表上进行借用登记;
3. 建议申请前先查询教室是否空闲,查询方式: [场地借用]-[教室借用查询];
4. 房间钥匙请找阿姨... | true |
802e8fea628eef8cdede3bb585854e961a429d50 | JavaScript | jlaumon/old-blogbd | /src/blop/public/pingus/pingus.js | UTF-8 | 5,663 | 2.78125 | 3 | [] | no_license | // pingus.js - v1.0
//
// Copyright 2009 Jérémy Laumon <j.laumon@lavache.com>
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What The Fuck You Want
// To... | true |
eb9e65050769420a213ef9cd7c78d796c4305ddf | JavaScript | Daymond-Blair/js-mortgage-calculator | /js/app.js | UTF-8 | 5,316 | 3.296875 | 3 | [] | no_license | // declare state of form, this holds all current information like memory card
let state = {
price: getNumber(document.querySelectorAll('[name = "price"]')[0].value),
loan_years: document.querySelectorAll('[name = "loan_years"]')[0].value,
down_payment: document.querySelectorAll('[name = "down_payment"]')[0].value,
... | true |
1d058b46853ca41570990a89b54b78faffd9a79c | JavaScript | craigkehl/craigkehl.github.io | /scratch/soda_springs_event.js | UTF-8 | 2,003 | 3.296875 | 3 | [
"MIT"
] | permissive | const requestURL = 'https://byui-cit230.github.io/weather/data/towndata.json';
// Load the array with the towns you wish to pull data about
const tList = ['Soda Springs'];
fetch(requestURL)
.then(function (response) {
return response.json();
}) // Retrieve and convert to json
.then(function (jsonObject) {
... | true |
6bb1615c7bf9acdc867204bb94fa08606db17724 | JavaScript | riomontana/WebDevelopment | /Inlämningsuppgifter/Inlämningsuppgift2/showmedia.js | UTF-8 | 4,565 | 2.625 | 3 | [] | no_license | // Användaren kan välja mellan att visa endast bilder, video, ljud eller alla typer
$("#drop-down-showfiles").change(function () {
// kallar på funktion som tar bort media-element
emptyMedia();
// om alla typer ska visas hämtas alla filer
if ($(this).val() == "all") {
getImages();
getV... | true |
e1e5b93dcc426c2e8b63e3865742a4d54a369fee | JavaScript | IT2810/it2810-webutvikling-h18-prosjekt-2-gruppe--12 | /gruppe12-p2/src/components/tab.jsx | UTF-8 | 3,849 | 2.921875 | 3 | [
"MIT"
] | permissive | import React, { Component } from "react";
import Sound from "./sound";
import Jsontexts from "./jsontexts";
class Tab extends Component {
state = {
initalRender: false,
image: ""
};
componentDidMount() {
this.setState({
initalRender: true
});
}
componentWillReceiveProps(nextProps) {
... | true |
b1ea30aa367420b0bd5e1b6613e04bec0ba3b743 | JavaScript | hannahrobot/algorithms | /dynamicProgramming.js/longestStrChain.js | UTF-8 | 4,445 | 3.953125 | 4 | [] | no_license | /**
* @param {string[]} words
* @return {number}
*/
var longestStrChain = function (words) {
let longestChain = 0;
const memo = {};
words.sort((a, b) => a.length - b.length);
const DFS = function (index) {
//basecase
if (index === words.length - 1) {
return 1;
}
//we've already visit... | true |
562c62bc04ff7fc84a75e33ebdee36a0f8f4c753 | JavaScript | serbittan/SERNtask | /serntask-server/logic/update-task.spec.js | UTF-8 | 4,658 | 2.578125 | 3 | [] | no_license | require('dotenv').config()
const { expect } = require('chai')
const { mongoose, models: { User, Project, Task } } = require('serntask-data')
const { env: { TEST_MONGODB_URL } } = process
const { random } = Math
const updateTask = require('./update-task')
describe('updateTask', () => {
// status será true o false... | true |
49465aaf90867da1cd5b842a684a9e79f486f587 | JavaScript | dpolzl/pokemonsearch | /src/reducers/pokemonReducer.js | UTF-8 | 643 | 2.59375 | 3 | [] | no_license | import { FETCHING_DATA,
FETCHING_DATA_SUCCESS,
FETCHING_DATA_FAILURE
} from '../constants/index'
const initialState = {
data : [],
isFetching : false,
error : false
}
const pokemonReducer = (state = initialState, action) => {
switch(action.type) {
case FETCHING_DATA :
return {
...state,
... | true |
35271b26cb071e727db23e50b520728249ef5762 | JavaScript | ThatTallProgrammer/BoidsBirds | /position.js | UTF-8 | 481 | 3.171875 | 3 | [] | no_license | class Position {
constructor(x, y) {
this.x = x;
this.y = y;
}
distanceTo(p) {
return Math.sqrt(
(p.x - this.x) ** 2 +
(p.y - this.y) ** 2
);
}
getDistanceInfo(p) {
const distance = this.distanceTo(p);
const d_x = (this.x - p.x) / distance;
const d_y = (this.y - p.y) / distance;
return {
... | true |
e4cc682ed27eb96c4d798ac509a4e777936b8a82 | JavaScript | CodecoolGlobal/city-statistic-react | /citystatistic/src/components/CompareCity.js | UTF-8 | 4,950 | 2.53125 | 3 | [] | no_license | import React, { useState, useEffect, useContext } from "react";
import LeftStat from "../components/LeftStat";
import Score from "../components/Score";
import Salary from "../components/Salary";
import LeftSalary from "../components/LeftSalary";
import axios from "axios";
import { AllCitySlugContext } from "../context/... | true |
138b754eb6ad9472c2cd8d2d06a45fde7225718b | JavaScript | RemoteControlFisher/CorpsesForeverGame | /long_floorsandwalls.js | UTF-8 | 3,929 | 2.53125 | 3 | [] | no_license | class long_floorsandwalls {
constructor(game, startX, startY, lengthX, lengthY, type) {
Object.assign(this, { game, startX, startY, lengthX, lengthY, type });
//Alias's to reduce the typing needed to make a level.
if (type == "p")
this.type = "thinPlatform"
if (type == "wl")
this.type = "wleft"
if (typ... | true |
29835f5fae0580ff96caa309afb2b635a406f16e | JavaScript | rdkcmf/rdk-injectedbundle | /ServiceManager.js | UTF-8 | 5,591 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | /*
* If not stated otherwise in this file or this component's Licenses.txt file the
* following copyright and licenses apply:
*
* Copyright 2017 RDK Management
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain ... | true |
c7e68008a93906d9dde0a5b394b623a8c5fafb97 | JavaScript | jjdelacruz1/simpleservers | /countingserver.js | UTF-8 | 591 | 3.03125 | 3 | [] | no_license | const express = require('express')
const app = express()
const path = require('path')
const PORT = process.env.PORT || 5000
var counter = 0
app.use(express.static(path.join(__dirname, 'public')));
app.post('/increment', function (req, res, next) {
counter++
res.send(`${counter}`)
})
app.post('/decrement', funct... | true |
2e74d1e6318dbdcfb3cb589142f2080e4a2f7505 | JavaScript | ilnurYalal/react-gainlife | /src/components/AddLifestyleDialog/index.js | UTF-8 | 1,489 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
import { Form, TextArea, Button } from 'semantic-ui-react'
import './style.css';
export class AddLifestyleDialog extends Component {
constructor(props) {
super(props);
this.state = {
isDisabledBtn: true,
lifestyleDescription: ''
};
this.textArea =... | true |
feedc42dc9b2327c18f16348e8a02131623ae339 | JavaScript | kbarov/SoftUniExamsAndExercises | /JS-Core/JS Applications/Lab AJAX/04.Phonebook/phonebook.js | UTF-8 | 1,364 | 2.828125 | 3 | [
"MIT"
] | permissive | /* global $ */
(() => {
const baseUrl = 'https://phonebook-ac204.firebaseio.com/'
const phonebook = $('#phonebook')
$('#btnLoad').click(loadContacts)
$('#btnCreate').click(createContact)
function createContact () {
let contact = JSON.stringify({
person: $('#person').val(),
phone: $('#phone')... | true |
a4fc42de786ecd2fdb436324dfd689f24c34f4a5 | JavaScript | OpenDSA/OpenDSA-stable | /AV/PL/interpreters/version1.06/scripts/absyn.js | UTF-8 | 5,659 | 2.65625 | 3 | [
"MIT"
] | permissive | /* global SLang : true */
(function (){
"use strict";
var exports = {};
function createProgram(e) {
return ["Program", e];
}
function isProgram(e) {
return e[0] === "Program";
}
function getProgramExp(e) {
if (isProgram(e)) {
return e[1];
} else {
throw new Error("Interpreter error: " +
"T... | true |
1b895d4b7cc346d384483ef1e82bbe4272eebc95 | JavaScript | kasbah/tonal | /modules/array/index.js | UTF-8 | 9,071 | 3.53125 | 4 | [
"MIT"
] | permissive | import { asPitch, isPitch, strPitch, pitch } from 'tonal-pitch'
import { tr } from 'tonal-transpose'
import { distance, distInSemitones } from 'tonal-distance'
import toArr from 'as-arr'
// utility
var isArr = Array.isArray
function hasVal (e) { return e || e === 0 }
/**
* Convert anything to array. Speifically, spl... | true |
325ee69f7ce0ed294ff88e5bd93c34ec8124b577 | JavaScript | aaazureee/JStest | /JavaScript test/matrixsum.js | UTF-8 | 1,426 | 4.125 | 4 | [] | no_license | /* The building is represented by a rectangular matrix of rooms, each cell containing an integer - the price of the room.
Some rooms are free (their cost is 0), but that's probably because they are haunted, so all the bots are afraid of them.
That is why any room that is free or is located anywhere below a free room ... | true |
1ffa415ed609f0dcb554a7cf5f9e34a00de17e98 | JavaScript | sneppa/i40-testbed | /dockers/server/functions/command_args.js | UTF-8 | 2,171 | 2.71875 | 3 | [
"MIT"
] | permissive | // Durchgehen der Paramater
function format(param)
{
// param += "=sad";
console.log("param: >"+param+"<");
var tiles = param.match(/\-([a-zA-Z]+)\=([a-zA-Z0-9\ \_]+)$/);
if (tiles !== null)
{
return([tiles[1], tiles[2]]);
}
else
return false;
}
var args = {
params: [],... | true |
589f60548f4e91641ca2f11891284fa794fd57b2 | JavaScript | cupyong/pv-front | /js/baseData.js | UTF-8 | 4,074 | 2.59375 | 3 | [
"MIT"
] | permissive | 'use strict'
//日期html
function setDataHtml() {
var str = multiline(function(){/*
<span class="wstxt">开始日期:</span><input type="text" class="datainp wicon" id="inpstart" readonly>
<span class="wstxt">结束日期:</span><input type="text" class="datainp wicon" id="inpend" readonly>
<button type="button" style=... | true |
ac7ca947962d558bc4d92acccb38df9d51e4a691 | JavaScript | proteamjobs/Wake-Up-Server | /controllers/exam.js | UTF-8 | 3,802 | 2.515625 | 3 | [] | no_license | const db = require("../models");
const passport = require("passport");
const checkStatus = (data, status) => {
for (item of data) {
if (item.status === status) {
return {
status: item.status,
testScore: item.test_score,
testResult: item.test_result
};
}
}
return null;
... | true |
fb7500533bf632c8b7d5bcc2187d9f8dd8eaacdf | JavaScript | juandomingo/nodeProperty | /handler/propertyGetter.js | UTF-8 | 858 | 2.53125 | 3 | [] | no_license | module.exports = function() {
var zooplaHandler = require('./zooplaHandler.js');
var rightmoveHandler = require('./rightmoveHandler.js');
var propertyGetter = {
"getPropInPostCode" : function(postcode, radius, days,callback){
//add more handlears whenever you need.
var properties = [];
... | true |
bde530b54301cfb711e1c9b92000d1c5ff905508 | JavaScript | flow-ree/node-dash-wunderlist | /index.js | UTF-8 | 2,289 | 2.59375 | 3 | [
"MIT"
] | permissive | 'use strict';
//warning this may trigger multiple times for one press
//...usually triggers twice based on testing for each press
var conf = require('./conf.js')
var dash_button = require('node-dash-button')
var dash = dash_button("00:bb:3a:a0:e5:ac", null, null, 'all') //address from step above
import Wunderlist from ... | true |
9760eb0c5d5f5429405434fece04067faf032fad | JavaScript | decojs/qvc-node | /constraints/NotEmpty.js | UTF-8 | 338 | 2.953125 | 3 | [] | no_license | function NotEmpty(message){
this.message = message;
}
NotEmpty.prototype.constraint = function(){
return {
message: this.message
};
};
NotEmpty.prototype.isValid = function(value){
if(value == null) return false;
if(typeof value == "string" && value.length == 0) return false;
return true;
};
module.e... | true |
4fb41f94da5458e29a254c08ada015f33803ee45 | JavaScript | AkyunaAkish/angular-calculator-and-todo-application | /js/services/mathService.js | UTF-8 | 549 | 2.5625 | 3 | [] | no_license | (function() {
'use strict'
angular.module('CalcTodo')
.service('MathService', MathService)
MathService.$inject = [
]
function MathService () {
this.calculate = function(numberOne, numberTwo, operator) {
switch (operator) {
case '*':
return numberOne * numberTwo
break
... | true |
0b65d2bab4f9bc3856945c6249572dd038876f62 | JavaScript | Dozor-Dn/homework1 | /homeworkjs1-2/1st part/script.js | UTF-8 | 251 | 3.78125 | 4 | [] | no_license | function pow(x, n) {
var result = x;
for (var i = 1; i < n; i++) {
result *= x;
}
return result;
}
var x = prompt('Укажите число', 1);
var n = prompt('Укажите степень', 1);
console.log('result = ', pow(x, n));
| true |
e79074162558a5a18b823c8f8b34f3167297be12 | JavaScript | RoamingTugboat/JS-DamageSimulator | /src/weaponDatabase.js | UTF-8 | 498 | 2.828125 | 3 | [] | no_license | "use strict";
const Weapon = require("./weapon.js");
let weapons = [];
module.exports = {
getWeapons: function() {
return weapons;
},
importWeapons(url, callback) {
importWeapons(url, callback);
}
}
function importWeapons(url, callback) {
console.log("Importing weapons from "+url+"...");
fetch(ur... | true |
3800e969562d0996c091ba6a2de2e4722615433b | JavaScript | yw229/VCFDB | /public/piechart.js | UTF-8 | 6,294 | 2.5625 | 3 | [] | no_license |
PieChart = function(eltid, options) {
var self = this;
this.chart = document.getElementById(eltid);
this.cx = this.chart.clientWidth;
this.cy = this.chart.clientHeight;
this.options = options || {};
this.data = options['data'];
this.rng = options['rng'] || [new Date(), new Date(new Date()-new Date(1000... | true |
43e62c833e186dbfce68d03ad6c192110dbf1744 | JavaScript | weimengtsgit/webgps | /webgps/web/js/validate.js | UTF-8 | 28,882 | 2.59375 | 3 | [] | no_license |
// ******************* The main methods starts here ******************************//
/*
ignoreObjects is a array ,there are some form fields object inside, which should ignore validation.
if you do not need this parameter you could still call this function like this "
commonValidateForm(form)
"
*/
functio... | true |
9297e128daae24aa2881d4f9aca63b0c613cdcff | JavaScript | AhmedAlaa1998/menuproject | /script.js | UTF-8 | 1,290 | 3.359375 | 3 | [] | no_license | let leftArrow = document.getElementById("left-arrow");
let rightArrow = document.getElementById("right-arrow");
let slider = document.getElementById("slider");
let stopSlider = document.getElementById("stop-slider");
let images = ["1.jpg", "2.jpg", "3.jpg", "4.jpg"];
let counter = 1;
let startSlide = window.s... | true |
b6ecb53ff681a7003030f7f784e47cb03e08e96a | JavaScript | JohSil/MuistipeliDemo | /src/components/createCards.js | UTF-8 | 358 | 2.921875 | 3 | [] | no_license | export default function createCards(int) {
let id=0;
let card=[];
let cards=[];
int = int/2;//2 jokaista korttia
for (let i=0; i<int; i++) {
for (let j=0; j<2; j++) {
card={key: id, id: id, cardNumber: i, type: i, isFlipped: false}
cards.push(card);
id=id+... | true |
6bff08a1a36883ec00dddbb012ed7aa3199af39a | JavaScript | Jonekee/redux-persist-transform-encrypt | /src/ProgressiveCryptor.js | UTF-8 | 1,169 | 2.71875 | 3 | [
"MIT"
] | permissive | var CryptoJS = require('crypto-js');
var Stream = require('readable-stream');
export default class ProgressiveCryptor {
constructor(state, secretKey) {
var salt = CryptoJS.lib.WordArray.random(8);
var cipher = CryptoJS.kdf.OpenSSL.execute(secretKey, 8, 4, salt);
this.state = state;
this.key = Crypto... | true |
ac13fcbe2242b2161d4a6da05066ee43b1df0799 | JavaScript | katherfrain/tiles-of-gnome | /src/components/HealthBar.js | UTF-8 | 1,020 | 2.53125 | 3 | [] | no_license | import React, { useState } from 'react';
import {useDispatch, useSelector} from 'react-redux';
import {takeDamage, takeHeal} from '../redux/actions'
export default function RenderHpBar(props) {
// const props = useSelector((state) => state)[props.id];
// const dispatchEvent = useDispatch();
// const... | true |
863ac1f83648476ae7947a9edc34c92d271b758d | JavaScript | William-Charles/assignment_recursion_sprint_node | /factorial.js | UTF-8 | 1,024 | 4.1875 | 4 | [] | no_license | function factorial(n) {
if (n < 1) {
return 1;
} else {
return factorial(n - 1) * n;
}
}
console.log("expect 1 to equal: ", factorial(1));
console.log("expect 2 to equal: ", factorial(2));
console.log("expect 6 to equal: ", factorial(3));
console.log("expect 24 to equal: ", factorial(4));
console.log("ex... | true |
95803eab77c9daaba3a1d81e2000eec11b9665a4 | JavaScript | neilrussell6/cash-register-react | /src/reducers/keypad.js | UTF-8 | 1,424 | 2.71875 | 3 | [] | no_license | import {KEYPAD_CLEAR, KEYPAD_SET_POINT, KEYPAD_UPDATE} from "../actions";
export const KEYPAD_DEFAULT_STATE = {
integerPart: 0,
fractionalPart: 0,
hasPoint: false,
amount: 0,
};
function _calculatePartAmount(current_amount, value) {
return parseInt(current_amount.toString() + value.toString(), 10);
}
funct... | true |
a6b64a60639979c2f13eb3a2746b8c3a02160888 | JavaScript | fenoh3ry/JS | /script_5.js | UTF-8 | 3,076 | 3.0625 | 3 | [] | no_license | //Bibliothécaire
console.log("Exercice 5:Bibliothécaire")
const books = [
{ title: 'Gatsby le magnifique', id: 133712, rented: 39 },
{ title: 'A la recherche du temps perdu', id: 237634, rented: 28 },
{ title: 'Orgueil & Préjugés', id: 873495, rented: 67 },
{ title: 'Les frères Karamazov', id: 450911, rented: 5... | true |
46340b2c9aa331908845aba73115357685af3277 | JavaScript | nishana007/expressresponse | /send.js | UTF-8 | 2,412 | 2.65625 | 3 | [] | no_license | const express=require('express');
const cors = require('cors');
const app = express();
const path=require('path');
const fs=require('fs');
const bodyParser = require('body-parser');
//const xml2js = require('xml2js');
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(cors... | true |
1dca97f960c65a0cd6f7a0d2d4c5101fae81fbc3 | JavaScript | OpheliaLYJ/MUSA611-CPLN692-week3 | /note.js | UTF-8 | 1,442 | 3.796875 | 4 | [] | no_license | for (var i = 0; i <= schools.length; i++) {
debugger
}
var sum = function(num, num2) {
console.log(arguments)
return num+num2
}
var addOne = function (num){return num+1 }
/////////////////////////
var returnAddFunction = function(num1) {
var theFunction = function(num2){
return num1 + num2
}
return ... | true |
21be70cd394c171c13152690a9247c680ebae1b0 | JavaScript | marianafinamori/the-economist-scraper | /public/js/app.js | UTF-8 | 3,538 | 2.953125 | 3 | [] | no_license | //Scrape and update list
$(".scrape-btn").on("click", (event) => {
$.ajax({
method:"GET",
url: "/articles"
})
.then((data) => {
setTimeout(() => { window.location = "/articles"}, 4000);
})
let wait = document.querySelector("#wait-div")
wait.classList.add('wait-msg');
... | true |
0e5075ee934fbf925668c66567acb1f9d6251f1b | JavaScript | Jorvict/Neon_Led_Store | /public/js/finalizarcompra.js | UTF-8 | 1,274 | 2.875 | 3 | [] | no_license |
let formulario=document.getElementById("formulario")
let detalles=document.getElementById("detalles")
formulario.addEventListener("change",(e)=>{
console.log(e.target)
let y_content=document.getElementById("yape__content")
let t_content=document.getElementById("transferencia__content")
if(e.target.id==="yape"){
... | true |
22818bc74d95797be664ff06204b2bb6c5ff1452 | JavaScript | zyxyuanxiao/RoomRun | /bin-debug/game/comment/MyButton.js | UTF-8 | 1,747 | 2.515625 | 3 | [] | no_license | var __reflect = (this && this.__reflect) || function (p, c, t) {
p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var __extends = this && this.__extends || function __extends(t, e) {
function r() {
this.constructor = t;
}
for (var i in e) e.hasOwnProperty(i) &&... | true |
e24955e0120e1e78cea64e51322461cda29868ba | JavaScript | kenfield93/Algorithms | /alienLang_AlphaOrder.js | UTF-8 | 1,744 | 3.8125 | 4 | [] | no_license |
//assumes no repeated words
function getAlphaOrder(words, numOfLetters){
var order;
var graph = initAdjList(numOfLetters);
var addEdge = setGraphToAddEdge(graph);
// Set up edges of graph
var word;
for(var i = 0, j = 1; i < words.length-1 && j < words.length; i++, j++){
word1 = words[i];
word2 = words[j];
... | true |
b270fb773c9c4a8f328bfeb9ebd8912c97411b5b | JavaScript | alexm323/code_wars | /7kyu/sortByLength.js | UTF-8 | 353 | 3.703125 | 4 | [] | no_license | function sortByLength (array) {
let result = []
let lenArr = array.map(e => e.length).sort((a,b) => a-b )
for(let i =0; i < array.length; i++){
result.push((array.filter(ele => ele.length === lenArr[i]))[0])
}
return result
// Return an array containing the same strings, ord... | true |
cf6dfa869468fbc4e660ac25d1e5200b0f4817b8 | JavaScript | LauraPietsch/MOBS | /V5_JavaScript.js | UTF-8 | 4,432 | 2.8125 | 3 | [] | no_license | // Buttons verstecken und Inhalt darstellen
const pushButton_fuel = document.querySelector(".Button_fuel");
function clearAndshow_fuel (){
document.getElementById("Buttons").style.display ="none";
var temp_fuel = document.getElementsByClassName("template_fuel")[0];
var clon_fuel = temp_fuel.content.cloneN... | true |