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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f68e8615f49415896b612596bd1035036ccc5475 | JavaScript | diego0020/cornerstoneTools | /src/stateManagement/imageIdSpecificStateManager.js | UTF-8 | 3,274 | 2.640625 | 3 | [
"MIT"
] | permissive | import * as cornerstone from 'cornerstone-core';
// This implements an imageId specific tool state management strategy. This means that
// Measurements data is tied to a specific imageId and only visible for enabled elements
// That are displaying that imageId.
function newImageIdSpecificToolStateManager () {
let ... | true |
4cd854e247ee54c920dfa415ed2b27a49d5a2eb0 | JavaScript | cboychinedu/NodejsMainLecture | /mongodb-connection/removingDocuments.js | UTF-8 | 1,263 | 2.71875 | 3 | [] | no_license | // Importing the necessary modules
const { ObjectId } = require('mongodb');
const mongodb = require('mongoose');
// Setting the mongodb URI path
const databaseURI = "mongodb://localhost/local_user";
// Connecting to the mongodb database
mongodb.connect(databaseURI)
.then((result) => { console.log('Connecte... | true |
5592fa2674b55c1272dc23dc917e769a4f0ad56b | JavaScript | cs165/homework4-ykwei0 | /app.js | UTF-8 | 845 | 3.28125 | 3 | [] | no_license | // This class will represent the music visualizer as a whole, similar to the
// role that the `App` class played in HW3.
//
// See HW4 writeup for more hints and details.
class App {
constructor() {
// TODO(you): Implement the constructor and add fields as necessary.
const menuElement = document.querySelector... | true |
793001bfbdee64a8eb244c686d68a873c1ef289a | JavaScript | jtandy123/jsnext-learning | /reflect/main.js | UTF-8 | 6,734 | 3.875 | 4 | [] | no_license | /*
1. 将Object对象的一些明显属于语言内部的方法(比如Object.defineProperty),放到Reflect对象上。从Reflect对象上可以拿到语言内部的方法
2. 修改某些Object方法的返回结果,让其变得更合理
3. 让Object操作都变成函数行为。某些Object操作是命令式,比如name in obj和delete obj[name],而Reflect.has(obj, name)和Reflect.deleteProperty(obj, name)让它们变成了函数行为
4. Reflect对象的方法与Proxy对象的方法一一对应,只要是Proxy对象的方法,就能在Reflect对象上找到对应... | true |
30ddeda84967987abf52cdd77ea2f793d197b7c6 | JavaScript | ggjjll/dataStructure | /stack/Stack.js | UTF-8 | 549 | 3.140625 | 3 | [] | no_license | let StackNode = require('./StackNode');
class Stack {
constructor() {
this.top = null;
}
isEmpty() {
return null === this.top;
}
// 入栈
push(value) {
let node = new StackNode(value);
if (this.isEmpty()) {
this.top = node;
} else {
node.next = this.top;
this.top = node... | true |
ed73a61c18f53ecda59ba3c3101bda1be122dfcc | JavaScript | Gozala/interactivate-dat | /src/reflex/Actor.js | UTF-8 | 3,384 | 2.609375 | 3 | [] | no_license | // @flow strict
import { nothing } from "./Basics.js"
import { Tagged } from "./Effect.js"
/*::
import type { Main, Port, ThreadID, Thread } from "./widget.js"
import type { Effect } from "./Effect.js"
export type {Effect}
*/
class Exit /*::<message, a>*/ {
/*::
thread:Actor<message>
reason:?Error
*/
cons... | true |
e89cefa962ad8a74394b9774c692f0a7797a0073 | JavaScript | aruncs/let-it-snow | /code.js | UTF-8 | 1,004 | 3.1875 | 3 | [] | no_license | function letItSnow(){
// document.getElementById("div1").classList.add("add-height")
setInterval(() => {
let ele = generateSnow()
setTimeout(()=>{
ele.style.top = '1000px'
},50)
},50)
setInterval(() => {
let ele = generateSnow()
setTimeout(()=>{
ele.style.top = '1000px'
},5... | true |
7f444edf087e3e694c9b1a65bd3c016a06a2f8c4 | JavaScript | aszanky/Javascript-Project-Collection | /Chucknoris Joke/index.js | UTF-8 | 1,530 | 3.640625 | 4 | [] | no_license | // document.getElementById('btnApi').addEventListener('click', loadData);
// function loadData(e) {
// const numThis = document.getElementById('number').value;
// console.log(numThis);
// fetch(`http://api.icndb.com/jokes/random/${numThis}`)
// .then(res => res.json())
// .then(data => {
// ... | true |
a9ec506309a422adea9e7d651484a61f0432f683 | JavaScript | BastinRobin/node.js-samples | /http-server.js | UTF-8 | 451 | 2.765625 | 3 | [
"Beerware"
] | permissive | var http = require('http'); // require the http module
// create a server
http.createServer(function (req, res) {
// call this function when a request is received
res.writeHead(200, {
'Content-Type': 'text/plain'
});
// send this as part of the response
res.end('Hello World\n');
}... | true |
8202e250c8588b4b2cb190b2969432d476f0e718 | JavaScript | appcelerator-forks/grantges.co.grantges.azure.adal | /co.grantges.azure.adal/controllers/widget.js | UTF-8 | 6,843 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive |
var _clientId, // <-- GUID supplied by Azure
_clientSecret, // <-- Azure calls this a Key in some places
_tenant, // <-- Your tenant GUID or domain (if you have one)
_responseType, // <-- Almost always going to be 'code' which is the default
_resourceId, // <-- The Resource your trying to ... | true |
5aa9b370d824457b968e2464af34407d76f610ab | JavaScript | johnptmcdonald/airpair_rails_angular_devise | /client/app/scripts/factories/todosFactory.js | UTF-8 | 477 | 2.53125 | 3 | [] | no_license | (function() {
'use strict';
angular
.module('clientApp')
.factory('todosFactory', todosFactory);
todosFactory.$inject = ['$http'];
function todosFactory($http) {
console.log("todosFactory loading")
var baseUrl = "/api/todos";
var service = {
getTodos: g... | true |
18d6df71a156bf3094a2446f922a878c750f1649 | JavaScript | cemozturan/intro-to-node-js-course | /2-modules/2-even-doubler-module-export.js | UTF-8 | 729 | 3.78125 | 4 | [] | no_license | var maxTime = 1000;
// Function that waits for a random amount time up to 1 second,
// then doubles the input if it is an even number, and errors if it an odd number.
var evenDoubler = function(number, callback){
var waitTime = Math.floor(Math.random()*(maxTime));
if (number % 2) {
setTimeout(() => {
cal... | true |
738279278a64b47472f8d8f361af9191d1f202bd | JavaScript | ippocratis/grmobiles | /commands/insult.js | UTF-8 | 710 | 2.765625 | 3 | [] | no_license | module.exports = (bot) => {
//thats a funny command that gives back a random insult as a reply . code snipset kangded from @TwitFace
const chars = {
'"': `"`,
'>': `>`,
'<': `<`,
'&': `&`,
};
const charsRegex = new RegExp(`(${Object.keys(chars).j... | true |
05eba2bd84e7d559e057082a46e15b7a59773bf1 | JavaScript | zellotec/Ext.ux.Ajax | /Ajax.js | UTF-8 | 3,203 | 2.640625 | 3 | [
"MIT"
] | permissive | /**
* @class Ext.ux.Ajax
* @author Vincenzo Ferrari <wilk3ert@gmail.com>
*
* A revisited Ajax class for ExtJS and Sencha Touch.
* It works with javascript promises (Ext.ux.Deferred).
*
* @singleton
*/
Ext.define ('Ext.ux.Ajax', {
singleton: true ,
requires: ['Ext.ux.Deferred', 'Ext.data.Connection'] ,
/*... | true |
dbe6b5760361fab7191f3aceb2b0c8989ff7f031 | JavaScript | nishino-naoyuki/asomaze | /asomaze/js/footer.js | UTF-8 | 4,867 | 2.921875 | 3 | [] | no_license |
function onDeviceReady() {
console.log("onDeviceReady");
}
//////////////////////////////////////
// 初期設定
//////////////////////////////////////
function bindEvents() {
console.log("bindEvents");
document.addEventListener("deviceready", onDeviceReady, false);
document.getElementById(... | true |
c14b6a1ecfd4d70a7614d169042d23d66c6ec28e | JavaScript | denisa99o/Projects | /HTML,CSS,JavaScript/pb5_1.4.5_operatii_matematice_jQuery/app.js | UTF-8 | 923 | 3.03125 | 3 | [] | no_license | var result=0;
function printValue(divId,value){
$("#"+divId).html(value);
}
printValue("result",0);
$("#add").on('click',add);
$("#sub").on('click',sub);
$("#div").on('click',div);
$("#mult").on('click',mult);
$("#mod").on('click',mod);
function add(){
result=parseInt($('#firstNumber'... | true |
a41e784bc996f21da7f55008ddd1c2793e11f53c | JavaScript | shiwani472/Time-Logger | /src/TimerForm.js | UTF-8 | 1,453 | 2.5625 | 3 | [] | no_license | import React, { useState } from "react";
import { v4 as uuidv4 } from 'uuid';
export default function TimerForm(props) {
const submitText= props.id?"Update":"Create";
const [title,setTitle]=useState("");
const [project,setProject]=useState("");
const handleTitleChange=(e)=>{
setTitle(e.target.value);
}
... | true |
fb9358c9adb2bac6aaef266f38b4055607dfd78f | JavaScript | drigoephesien/full-stack-open-2021 | /part4/bloglist/tests/blogs_api.test.js | UTF-8 | 6,568 | 2.578125 | 3 | [] | no_license | const mongoose = require('mongoose')
const supertest = require('supertest')
const helper = require('./test_helper')
const app = require('../app')
const Blog = require('../models/blog')
const User = require('../models/user')
const bcrypt = require('bcrypt')
const jwt = require('jsonwebtoken')
const api = supertest(app)... | true |
ee5e0859fddd763b1cf54a87178bf12d1e8561c5 | JavaScript | linux-lewis/intro-js-book | /The_Basics/question_9.js | UTF-8 | 251 | 2.59375 | 3 | [] | no_license | let pets = {Asta: 'dog', Butterscotch: 'cat', Pudding: 'cat',
Neptune: 'fish', Darwin: 'lizard'
};
console.log(pets['Asta']);
console.log(pets['Butterscotch']);
console.log(pets['Pudding']);
console.log(pets['Neptune']);
console.log(pets['Darwin']); | true |
1b6fc21a46a0681bbaa49143c6c77d7ca0e29ed3 | JavaScript | kyawtk/MERN-expense-tracker | /client/src/components/Addtransaction.jsx | UTF-8 | 1,697 | 2.578125 | 3 | [] | no_license | import React, { useState } from "react";
import { addTransaction, updateBalance } from "../redux/actions";
<<<<<<< HEAD
import {connect} from 'react-redux'
const mapDispatchToProps = (dispatch)=>{
return {
handlesubmit : (text, amount)=> {
dispatch(addTransaction({text,amount}))
... | true |
0a46ee913a9694266c03fcb4dbe76373f6f04ced | JavaScript | ruchirathakare/Algorithms-JS | /nthFromEnd-LinkedList.js | UTF-8 | 812 | 4.1875 | 4 | [
"MIT"
] | permissive | class Node {
constructor(data, next = null) {
this.data = data;
this.next = next;
}
}
class Linkedlist {
constructor() {
this.head = null;
}
nthFromEnd(n) {
let firstNode = this.head;
let secondNode = this.head;
for (let i = 0; i < n; i++) {
secondNode = secondNode.next;
}... | true |
3278e03e79ec24223bb5c5d97ef42156c193aa54 | JavaScript | tommasobratto/street-pacman-final-project | /public/js/characterController.js | UTF-8 | 915 | 2.84375 | 3 | [] | no_license | var player = new Player();
function setIcon() {
var icon = JSON.parse(localStorage.getItem('data'));
getIcon(icon);
}
function getIcon(icon) {
switch(icon) {
case 'Pacman': {
player.icon = '/images/mini_Pacman.png';
break;
}
case 'Shadow': {
player.icon = '/images/shadow-white.pn... | true |
1b8141c4687caa2883f3768f7db3a8bf5bb2777e | JavaScript | lalo1898developer/first_cv_backend | /controllers/CurriculumController.js | UTF-8 | 2,510 | 2.515625 | 3 | [
"MIT"
] | permissive | const { UserService, CurriculumService } = require('../service');
module.exports = {
create: async (req, res) => {
const { idUser } = req.params;
const { body } = req;
try {
const user = await UserService.readOne(idUser);
const curriculum = await CurriculumService.createOne(body);
const... | true |
842ee228a86d26f84b2d59514aadf04194a070a4 | JavaScript | llenroc/aurelia-resume | /server/models/experience.js | UTF-8 | 611 | 2.640625 | 3 | [] | no_license | class Experience {
constructor(id, employer, title, dates, bulletPoints) {
this.id = id;
this.employer = employer;
this.isClient = false;
this.title = title;
if (dates && dates.beginDate) {
this.beginDate = dates.beginDate;
}
if (dates && dates.en... | true |
89cf0eeb3064a97cedaf8acc463b98693327fc81 | JavaScript | Argzero/Granama | /js/robot/player/player.js | UTF-8 | 9,010 | 2.921875 | 3 | [] | no_license | /**
* Base constructor for player types
*
* @param {string} name - name of the robot's body sprite
* @param {Number} x - starting X-coordinate
* @param {Number} y - starting Y-coordinate
* @param {number} type - type ID of the robot (should be Robot.PLAYER)
* @param {Num... | true |
eaf058515ea4ab33480418551bbfc7882d414782 | JavaScript | Zoe6-tech/Meng_Z_ChatApp | /public/js/main.js | UTF-8 | 2,407 | 2.8125 | 3 | [
"MIT"
] | permissive | import ChatMessage from "./components/TheMessageComponent.js"
(() => {
console.log('fired');
//load socket library and make a connection
const socket = io();
//messager service event handling -> incoming from the manager
function setUserId({sID, message}) {
console.log('connected... | true |
edad7ae9497e7088031825f2c230bef1cbd23596 | JavaScript | ashishkumar68/notes-app | /middleware/ProcessUserRequest.js | UTF-8 | 6,131 | 2.578125 | 3 | [] | no_license | /**
* ProcessUserRequest JS file for Processing User Module related request.
*
* @Category Middleware
* @Author Ashish Kumar
*/
const dbConnect = require('./DbConnect');
const errorConstants = require('../constants/ErrorConstants');
const generalConstants = require('../constants/GeneralConstants');
const moment... | true |
3fd07496e346c07c22feb7010a7e15f6bca8331f | JavaScript | SanjeevBashyal/LichalStructures | /src/Components/Dropdown.js | UTF-8 | 1,761 | 2.640625 | 3 | [] | no_license | import React, { useState, useRef, useEffect } from 'react';
import './Dropdown.css'
const SearchDropdown = (props) => {
const {placeHolder, opts , id, onSelected } = props;
const [options, setOptions] = useState(opts);
const ulRef = useRef();
const inputRef = useRef();
useEffect(() => {
setOptions(opts)... | true |
f522cbfe06c2c6c88720757809a027137a89e070 | JavaScript | tumanjongbt/fullstack | /4.jQuery/1.jQueryFunctions/functions.js | UTF-8 | 1,202 | 2.859375 | 3 | [] | no_license | $(document).ready(function(){
$('#addClass button').click(function(){
$('#addClass p').addClass('red');
});
$('#toggleClass button').click(function(){
$('#toggleClass p').slideToggle("slow");
});
$('#appendClass button').click(function(){
$(this).append(" Button");
});... | true |
8618e0765b7f4f1711230a6a44b55d91fdf27cf9 | JavaScript | sam-mfb/interview | /InterviewExample.js | UTF-8 | 4,917 | 2.5625 | 3 | [] | no_license | import React, { useEffect, useState } from "react"
import PropTypes from "prop-types"
// withModal is a higher order component that makes a component modal
import { withModal, ConfirmWithModal } from "./Basic"
import IconButton from "./IconButton"
import "../styles/PostEditor.scss"
// postService handles constructing a... | true |
9e1bfa452a6f83fbc8ac80ce90b2b01842e9d7e7 | JavaScript | pippinbarr/cart263-2021 | /examples/the-webpage/transform-poem/js/script.js | UTF-8 | 3,178 | 4.15625 | 4 | [] | no_license | /**
Transform Poem
Pippin Barr
This program adds mouse interactions with specific words in the poem
displayed on the webpage. Some words fly away, some rotate, and one skews.
*/
"use strict";
// Use the helper function to add specific effects
// First argument is the class of the span around an element to interact w... | true |
41de11448d1c4f738a12675fe1d5722e7e66a8ad | JavaScript | fathurmh/Sistem.Antrian | /Simantri/wwwroot/js/site.js | UTF-8 | 1,118 | 2.953125 | 3 | [] | no_license | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your JavaScript code.
function initClock() {
function updateClock() {
var d = new Date(),
sec... | true |
c5b2dc245c50287a435906193f9dd3c42c7099e2 | JavaScript | kavoom2/toy-fall-guy | /scripts/main/consts.js | UTF-8 | 337 | 2.640625 | 3 | [] | no_license | const key = {
// ASCII KEY Index
A: 65,
D: 68,
SPACE: 32,
}
const isKeyUp = {
// 스페이스를 계속 누르고 있어도 점프가 되지 않도록 해야합니다.
// A 또는 D 가 입력되면 반대 방향으로 이동하면 안됩니다.
SPACE: true,
A: true,
D: true,
}
Object.freeze(key); | true |
b3d80bff603a4ab1c4fb72901d6735056017eccc | JavaScript | goozgooz/lab-08-rest | /notes/note-router.js | UTF-8 | 1,232 | 2.75 | 3 | [] | no_license | 'use strict';
const router = require('../lib/router.js');
const Note = require('./model.js');
const response = require('../lib/response.js');
const database = __dirname + '/../data/notes.dat';
const storage = require('../lib/storage.js')(database);
router.post('/api/notes', (req,res) => {
let note = new Note(req.bo... | true |
d203110b65121399dfddcbf9ff917a3d27849b8d | JavaScript | MattBokovitz1/workout-store | /client/src/components/WeightList.js | UTF-8 | 1,381 | 2.65625 | 3 | [] | no_license | import React, { Component } from "react";
import axios from "axios";
export default class WeightList extends Component {
constructor(props) {
super(props);
this.state = {
weights: [],
renderWeights: [],
};
}
componentDidMount() {
axios.get("https://exercise-be.herokuapp.com/weights").... | true |
275f92b2f6af56314d7467a5aee7b0300b791c8b | JavaScript | JonasMS/data-structures | /sprint-two/src/binarySearchTree.js | UTF-8 | 1,128 | 3.765625 | 4 | [] | no_license | var BinarySearchTree = function(value) {
var node = Object.create(binaryTreeMethods);
node.value = value;
node.left = null;
node.right = null;
return node;
};
var binaryTreeMethods = {};
binaryTreeMethods.insert = function (newVal) {
if ( newVal > this.value ) {
!this.right ? this.right = BinarySea... | true |
b3a26a389c5b6e2e6c9158c66ab6c569152ed02d | JavaScript | successful-lad/ESports-coach | /src/screens/FourthGameScreen/index.js | UTF-8 | 6,323 | 2.734375 | 3 | [] | no_license | import React, { useState, useEffect, useCallback } from "react";
import { setGameResult } from "../../api";
import triangleIcon from '../../assets/img/triangle.svg';
import './style.scss';
const FourthGameScreen = () => {
const [figureCoordinates, setFigureCoordinates] = useState([]);
const [timeCount, setTimeCou... | true |
7ef58b274f9dfdd78871948429dc01286e93ba9a | JavaScript | iPeng6/FE-code | /zfb-4.js | UTF-8 | 821 | 3.171875 | 3 | [] | no_license | const assert = require('assert');
/**
* --- 问题描述 ---
*
* 实现一个 arrange 函数,可以进行时间和工作调度
*
* --- 说明 ---
*
* - 本题需要自己实现测试用例
* - 具体功能参考下列示例
* - 在示例中调用到的方法都需要实现
* - 下面示例中 `>` 表示在控制台中输出 (console.log)
*
* --- 示例 ---
*
* 示例一:
* `arrange('William').execute();`
* > William is notified
*
* 示例二:
* `arrange('Willi... | true |
13c67f720539a814254a7fc4f7b4ba3f0021e987 | JavaScript | Kustikov/js_tasks_basic | /checkResult (gembling).js | UTF-8 | 1,676 | 4.125 | 4 | [] | no_license | // BEGIN (write your solution here)
const check = (a, b, c, d) => {
const winPrognos = a > b && c > d;
const lossPrognos = a < b && c < d;
const drawPrognos = (a === b) && (c === d);
if (a === c && b === d) {
return 2;
} else if (winPrognos === true || lossPrognos === true || drawPrognos === true) {
return 1;
... | true |
9bee3acc0627af02ddcaea455f54d2b7223fc622 | JavaScript | yanzhuowei/miniVue | /src/init.js | UTF-8 | 2,188 | 2.75 | 3 | [] | no_license | import {initState} from './state'
import { compileToFunction } from './compiler/index.js'
import {mountComponent,callHook} from './lifecycle.js'
import {mergeOptions} from './utils/index'
import {nextTick} from './utils/next-tick'
// 向vue原型上添加init方法
export function initMixin(Vue){
// 初始化流程
Vue.prototype._ini... | true |
6a36599c2984db78f15ef4147108a3c162f9fb27 | JavaScript | shysam11/UCIDataAnalytics | /Unit17/logic.js | UTF-8 | 4,675 | 3.359375 | 3 | [] | no_license |
//Using classcode samples - 3-Stu_GeoJSON,
// Store our API endpoint inside queryUrl
var queryUrl = "http://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2014-01-01&endtime=" +
"2014-01-02&maxlongitude=-69.52148437&minlongitude=-123.83789062&maxlatitude=48.74894534&minlatitude=25.16517337";
// ... | true |
a536ba3521f4e0b1c19eda160f5cfdd4f082f9bf | JavaScript | john77leblanc/Notes-Tool | /Old_Scripts/Retreive_Note.js | UTF-8 | 2,704 | 2.71875 | 3 | [] | no_license | ////////////////////////////////////////
// Retrieve Note
// ------------------------------------
// Retrieve player and notes info
////////////////////////////////////////
const $j = jQuery.noConflict();
const player = GetPlayer();
const title = player.GetVar("Module_Title");
const mod_num = player.GetVar("Modul... | true |
aba9e3c4e8b52119621330e3d17fa91c6264de18 | JavaScript | iolande/cruddyBooks | /test/unit/services/dataContext.spec.js | UTF-8 | 3,580 | 3.015625 | 3 | [] | no_license | import { DataContext } from 'src/services/dataContext';
class MockBookService {
validResponseObject = [{"_id":"56be607391d3d47315637a4a","author":"Frank Herbert","title":"Dune","genre":"Science Fiction","__v":0,"read":false,"links":{"self":"http://localhost:8000/api/books/56be607391d3d47315637a4a"}}];
getBooks = ... | true |
b2cddf5fdcdc272244810c5685424ee7ab731664 | JavaScript | jamesderrick/fp_pairs_assignment | /client/assets/js/index.js | UTF-8 | 893 | 3.03125 | 3 | [] | no_license | let searchBtn = document.querySelector('#search');
searchBtn.onclick = function(event){
let textInput = document.querySelector('#text-input');
if (textInput.value) {
location.href = `search?q=${textInput.value.toLowerCase()}`;
}
}
document.addEventListener("keyup", function(event) {
if (ev... | true |
7bab974e59e18b3b30062c6e670fc4ae9ed4be2a | JavaScript | POO-2020/tarea-02-encapsulacion-y-herencia-el-hospital-IvanGodinez21 | /hospital.js | UTF-8 | 2,109 | 3.0625 | 3 | [] | no_license | import Doctor from "./doctor.js";
export default class Hospital {
/**
* @param {string} nombre
* @param {direccion} direccion
*/
constructor (nombre, direccion) {
this._nombre = nombre
this._direccion = direccion
this._listadocs = new Array()
this._listacita = ne... | true |
beaf20c92ae2189f2091f11fcab38b01ca7a2bba | JavaScript | damiansk/js30challenge | /day3-css_variables/script.js | UTF-8 | 497 | 2.671875 | 3 | [] | no_license | /**
* Created by bumpMind on 12/12/2016.
*/
'use strict';
(function () {
const inputs = document.querySelectorAll( '.controls input' )
function handleUpdate() {
const suffix = this.dataset.sizing || '';
document.documentElement.style.setProperty( `--${ this.name }`, this.value + suffix );
... | true |
b00dfeddeaeffe05090e068eeadbff03c124c90a | JavaScript | LeozinLL/raise-tech-academy | /aulas/hello.js | UTF-8 | 1,233 | 3.484375 | 3 | [] | no_license | import genres from "./genres.js"
import { log } from "./log.js"
function choose(label, options) {
console.clear()
console.table(options)
const ultimo = options.length - 1
const option = prompt(label + ` (0 à ${ultimo} ou ENTER para voltar):`)
if (option === null) return null
if (Number.isNaN(+option)) re... | true |
420157582a840eb5e12c46598ce251741980d343 | JavaScript | rodrigolima2/back-integral-datas-em-js | /extra-06/script.js | UTF-8 | 577 | 3.328125 | 3 | [] | no_license | const getYear = require('date-fns/getYear');
const getDayOfYear = require('date-fns/getDayOfYear');
function promocao(dataInicio, dataCliente) {
let taValendo = false;
if (getYear(dataInicio) === getYear(dataCliente)) {
if (getDayOfYear(dataInicio) === getDayOfYear(dataCliente)) {
taValend... | true |
772c4d0b34ea3a0b1ddca00d7acd1a2816fdf9cd | JavaScript | hyu-likelion/licoding | /week6/정유리/calculator/function.js | UTF-8 | 221 | 3.484375 | 3 | [] | no_license | const input = document.querySelector("input")
function send(data){
input.value += data
}
function calculate(){
let result = eval(input.value);
input.value=result;
}
function reset(){
input.value="";
}
| true |
02fdd6b803d8146a621acb5649119b91433c97db | JavaScript | kamilakaioana/web-moderno | /fundamentos/destructuring1.js | UTF-8 | 503 | 3.65625 | 4 | [] | no_license | // novo recurso do ES2015
const person = {
name: 'Anne',
age: 25,
andress: {
logradouro: 'ABC Street',
number: 1000
}
};
const { name, age } = person;
console.log(name, age);
const { name: n, age: a } = person;
console.log(n, a);
const { surname, goodHumored = true } = person;
consol... | true |
16a1e58b69bb853ff003bb79fb60dcd6060e35f5 | JavaScript | IvanAlexisGarza/CodeWars | /Jasmine/spec/calculator.spec.js | UTF-8 | 631 | 3.3125 | 3 | [
"MIT"
] | permissive | // describe("calculator", function() {
// it("should add two numbers together", function() {
// expect(add(1,2)).toBe(3);
// });
// it("should ubstract two numbers", function() {
// expect(substract(3,1)).toBe(2);
// expect(substract(-10,-1)).toBe(-9);
// });
// it("should ... | true |
9e0eda189f3b62d20ce1d3683634b7ac544c9cfb | JavaScript | joaoMachado231/Drafter | /script.js | UTF-8 | 4,640 | 3.203125 | 3 | [] | no_license | var playersList = []
const Utils = {
resetApp(){
var players = document.querySelector('div#players')
var qttTeamsInput = document.querySelector('input#txtteams')
var qttPlayersInput = document.querySelector('input#txtqttplayer')
var inputPlayer = document.querySelector('input#txtpl... | true |
fab607f2dbac537595fa9f2406bad4c3e9bb8537 | JavaScript | component/annotate | /lib/annotation.js | UTF-8 | 1,885 | 2.828125 | 3 | [
"MIT"
] | permissive |
/**
* Module dependencies.
*/
var events = require('events')
, offset = require('offset')
, Rect = require('rect')
, css = require('css');
/**
* Expose `Annotation`.
*/
module.exports = Annotation;
/**
* Initialize an annotation on `el` with `rect`.
*
* @param {Element} el
* @param {Rect} rect
* @ap... | true |
4f0da034e15da3b0430725fffdb4aa3f51e29ec9 | JavaScript | jgallen23/ScribbleTasks | /www/ui/scripts/SwipeController.js | UTF-8 | 680 | 3 | 3 | [] | no_license | window.addSwipeHandler = function(element, callback) {
var startX = null;
var startY = null;
var dx = null;
var dy = null;
var touchStart = function(e) {
startX = e.touches[0].clientX;
startY = e.touches[0].clientY;
}
var touchMove = function(e) {
dx = startX - e.touches[0].clientX
dy = startY - e.tou... | true |
f0006a1d032cdfe43734b3ad123fee4f69332236 | JavaScript | junghy444/ja0-s-react | /library/api/book/book.ctrl.js | UTF-8 | 4,386 | 2.8125 | 3 | [] | no_license | const BookModel = require("../../models/book");
const mongoose = require("mongoose");
const UserModel = require("../../models/user");
// id 유효성 체크
const checkId = (req, res, next) => {
const id = req.params.id;
if (!mongoose.Types.ObjectId.isValid(id)) {
return res.status(500).end();
}
next();
... | true |
4cf875034114999e809b32ce717d94d0e0a57125 | JavaScript | mtsee/outils | /src/random/randomID.js | UTF-8 | 267 | 2.859375 | 3 | [
"MIT"
] | permissive | /**
* 生成随机ID
* @param {Number} randomLength 长度
* @return {String}
*/
function randomID(randomLength = 8) {
return Number(
Math.random()
.toString()
.substr(3, randomLength) + Date.now()
).toString(36);
}
module.exports = randomID; | true |
f680f8c15f6c455878b4901ba09eedbaf45ed04b | JavaScript | LuisMBobet/NodeJS-Scrape | /main.js | UTF-8 | 376 | 2.859375 | 3 | [] | no_license | var InputProcess = require("./local_modules/inputProcess.js");
var Scrape = require("./local_modules/scrape.js");
//Call from command line using 1 argument. For best results use a valid email address.
if (process.argv.length === 3){
var domain = InputProcess(process.argv[2]);
if(domain) Scrape(domain);
}else{
... | true |
7d2b4cbdef6e88960917affa48943ab16d68cb1d | JavaScript | chenlei65368/algorithm004-05 | /Week 6/id_115/LeetCode_1091_115.js | UTF-8 | 2,471 | 3.453125 | 3 | [] | permissive | /*
* @lc app=leetcode.cn id=1091 lang=javascript
*
* [1091] 二进制矩阵中的最短路径
*/
// @lc code=start
/**
* @param {number[][]} grid
* @return {number}
*/
var shortestPathBinaryMatrix = function (grid) {
if (!grid.length || grid[0][0] || grid[grid.length - 1][grid.length - 1]) return -1
let res = 1
let start = [[0... | true |
ba5cccc7327155e319eec8940312910d78f11815 | JavaScript | phamlam24/ss7-demo | /buttons.js | UTF-8 | 325 | 2.515625 | 3 | [] | no_license | function clearStorage(){
localStorage.clear()
alert("Cleared local storage")
}
function toLogin(){
window.location.href = "./login.html"
}
function toRegister(){
window.location.href = "./index.html"
}
function signOut(){
localStorage.removeItem("current_user")
window.location.href = "./login.ht... | true |
8a34d431534df02cc77e288e72d854f49dc45ea2 | JavaScript | eriklarko/safe-psyc | /app/src/services/exact-reference-point-service.js | UTF-8 | 1,918 | 2.921875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // @flow
import { log } from '~/src/services/logger.js';
import type { Emotion, Coordinates } from '~/src/models/emotion.js';
export class ExactReferencePointService {
_emotionPool: Array<Emotion>;
constructor(emotionPool: Array<Emotion>) {
this._emotionPool = emotionPool.filter(e => !!e.coordinates... | true |
9d9cd6bdfd7cd76f3f33074b681dac72f0c114ac | JavaScript | tranquocbinh1208/F5-PTHTTTHD | /File Thực Hiện/Template/js/naptien.js | UTF-8 | 6,426 | 2.546875 | 3 | [
"MIT"
] | permissive | //RÚT TIỀN
let isDebug = false
let emptyString = ''
let emptyObject = {}
let warning = 'alert-warning'
let success = 'alert-success'
let danger = 'alert-danger'
let info = 'alert-info'
let loggedUserId = 'NV001'
function isNullOrEmptyString(str) {
return (str == emptyString || str == undefined || str == null)
}
$... | true |
2ed700d9032b11af069fbe139ad2dec89308afff | JavaScript | SusanESmith/random-react-github-migration-app | /src/components/GitRepoWrapperComponent.js | UTF-8 | 1,083 | 2.6875 | 3 | [] | no_license | import React from 'react';
import GitRepoComponent from './GitRepoComponent';
import GoogleChartComponent from './GoogleChartComponent';
class GitRepoWrapperComponent extends React.Component {
constructor() {
super();
this.fetchRepos = this.fetchRepos.bind(this);
this.renderRepos = this.renderRepos.bind... | true |
f7c3a5953cca4097027340f334013520b9547b2e | JavaScript | koljn12345/brackets | /src/index.js | UTF-8 | 572 | 2.703125 | 3 | [
"MIT"
] | permissive | module.exports = function check(str, bracketsConfig) {
let objectBracketsConfig={};
let stack=[];
for (let i=0;i<bracketsConfig.length; i++) {
objectBracketsConfig[bracketsConfig[i][0]]=bracketsConfig[i][1];
}
for(let j=0;j<str.length; j++){
if(objectBracketsConfig[str[j]]==str[j] && str[j]==stack[stack.length-1]... | true |
6b00283a18b2157f0b014f46463b9267d18a1d4e | JavaScript | hncu/phonelib | /web-app/js/own/create.js | UTF-8 | 14,825 | 2.65625 | 3 | [] | no_license | function WriteYearOptions(YearsAhead)
{
line = "";
for (i=0; i<YearsAhead; i++)
{
line += "<OPTION>";
line += NowYear - i;
}
return line;
}
function DaysInMonth(WhichMonth, WhichYear)
{
var DaysInMonth = 31;
if (WhichMonth == "04" || WhichMonth == "06" || WhichMonth == "09" || WhichMonth == "11") ... | true |
93431fe8587a49b029f36a565e7cb3e802b4d161 | JavaScript | victorcrbt/frontend-meetapp-v2 | /src/pages/Meetup/View/index.js | UTF-8 | 3,274 | 2.515625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import { parseISO, format } from 'date-fns';
import { toast } from 'react-toastify';
import api from '~/services/api';
import history from '~/services/history';
import BannerInput from '~/components/BannerInput';
import TextInput from '~/components/TextInput';
impor... | true |
27596b038bfcd69417b3bd238ce073f25c1dc96b | JavaScript | turancaymaz/Java-Spring-Javascript-MySql-Web-Application-Pet-Clinic | /src/main/resources/static/js/product_detail.js | UTF-8 | 7,624 | 2.515625 | 3 | [
"MIT"
] | permissive | function allCategory(){
$.ajax({
url: '/category/list',
type: 'GET',
contentType: 'application/json; charset=utf-8',
success: function (data) {
createCategory(data)
},
error: function (err){
console.log(err)
}
})
}
allCategory()
f... | true |
a7e5a2f147ab5cafb135bf6cb60e026e106293ef | JavaScript | jimmyalcala/vendoycomprotodo.com | /server/api/categoria/categoria.controller.js | UTF-8 | 2,873 | 2.640625 | 3 | [] | no_license | 'use strict';
var _ = require('lodash');
var Categoria = require('./categoria.model');
function agregarHijos (na,cat) {
var nodos=[],
nn=[],
ch=0;
for (var x = 0; x < cat.length; x++) {
if (na._id.equals(cat[x].padre)) {
nodos.push(cat[x]);
ch++;
};
};
if (ch>0) {
for (var... | true |
b7d626766b50bb94484c0085752021a5ae28814a | JavaScript | bokhonok-t/yii2_e-shop | /web/js/amountPr.js | UTF-8 | 575 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive |
function check_symbol(event) {
event= event || window.event;
if ((event.keyCode > 57 || event.keyCode <48) && (event.keyCode<35 ||
event.keyCode>39) && event.keyCode!=8)
return false;
}
$(function() {
$('input').each(function() {
var $input = $(this);
$input.prev('a.minus').click(function() {
$inpu... | true |
4be23da88e742e70a42e9fa436afb9567f78e479 | JavaScript | Rezaforouzandeh/Apotheke | /script.js | UTF-8 | 252 | 2.59375 | 3 | [] | no_license | const btnShow = document.querySelector('.hamburger-menu');
const navLinks = document.querySelector('.nav-links');
btnShow.addEventListener('click', ()=> {
btnShow.classList.toggle('is-active');
navLinks.classList.toggle('is-inactive');
});
| true |
f2146b7eaa4cd25c4f8c13bed861557e08b73b37 | JavaScript | danielcomriebell/practice | /plus.js | UTF-8 | 239 | 3.109375 | 3 | [] | no_license | var plusOne = function(digits){
let str = '';
let resultArr = [];
for (var i = 0; i < digits.length; i++) {
str += digits[i];
}
// str = +str;
return str;
}
console.log(plusOne([6,1,4,5,3,9,0,1,9,5,1,8,6,7,0,5,5,4,3]));
| true |
35251e2d75b8c60967264efd71112074f992b37e | JavaScript | kng83/mocha_test | /rxjs/Operators/operators_2.js | UTF-8 | 861 | 4.03125 | 4 | [] | no_license | // tujest pokazene jak zrobic instancje operatora
const Rx = require('rxjs');
Rx.Observable.prototype.multiplyByTen = function multiplyByTen() {
let input = this;
return Rx.Observable.create(function subscribe(observer) {
input.subscribe({
next: (v) => observer.next(10 * v)
});
... | true |
eac8b25f5d6cd68d85bb5637cdac9ce87310d37a | JavaScript | MkodeLang/MkodeLang | /src/Error.js | UTF-8 | 515 | 2.796875 | 3 | [
"MIT"
] | permissive | import Token from "./Token.js"
const Errors = {
error: function (line, column, message) {
if (line instanceof Token) {
if (line.type === "EOF")
this.report(line.line, 0, " at end", message)
else
this.report(line.line, 0, " at '" + line.lexeme + "'", message)
} else
this.repo... | true |
fd9559fcc17fb25d29b46350aa3cc51184b43487 | JavaScript | LihanzUpenn/PennChat | /project557/src/components/getData.js | UTF-8 | 11,208 | 2.53125 | 3 | [] | no_license | /* eslint-disable consistent-return */
const axios = require("axios");
export const getUsers = async () => {
try {
const res = await axios.get("http://localhost:8080/users");
return res.data.data;
} catch (err) {
// console.log(err);
}
};
export const joinChat = async (user) => {
console.log("join... | true |
a8d669d59e4214c1955d9f12b8dc17ad6d41aace | JavaScript | Zephyr-Dinder/dinder | /client/components/MainContainer.jsx | UTF-8 | 5,496 | 2.515625 | 3 | [] | no_license | import React, { Component, useState, useEffect } from 'react';
import { useSelector, useDispatch } from "react-redux";
import axios from 'axios';
import key from '../../config/keys';
import ReactLoading from 'react-loading';
import _ from 'lodash';
const MainContainer = props => {
const dispatch = useDispatch();
c... | true |
d98d7016289ab5808de7903e75cb40b084dd90a2 | JavaScript | vessos/Js-Core-Archive | /JsCore/04.JS-functionAndLambda(lection-27.09.16)/palindrome.js | UTF-8 | 289 | 3.34375 | 3 | [] | no_license |
/**
*
* @param str
* @returns {boolean}
*/
function isPalindrome ([str]){
for(let i=0;i<=str.length/2;i++){
if(str[i]!=str[str.length-1-i]){
return false;
}
else{
return true;
}
}
}
console.log(isPalindrome (['abcba'])); | true |
45b056c39f7b207621d89fc19bcde539ac95753f | JavaScript | grimalschi/mathjs | /src/function/combinatorics/composition.js | UTF-8 | 1,529 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | 'use strict'
function factory (type, config, load, typed) {
const combinations = load(require('../probability/combinations'))
const add = load(require('../arithmetic/addScalar'))
const isPositive = load(require('../utils/isPositive'))
const isInteger = load(require('../utils/isInteger'))
const larger = load(... | true |
7b9ce94f570b660bc499e99bea2f47feafb27e1a | JavaScript | CoderDream/node-js-best-practise | /code/node-js-best-practise/chapter_08/hello.js | UTF-8 | 2,303 | 4.125 | 4 | [] | no_license | /**
* http://www.runoob.com/nodejs/nodejs-module-system.html
*
* Node.js模块系统
* 为了让Node.js的文件可以相互调用,Node.js提供了一个简单的模块系统。
* 模块是Node.js 应用程序的基本组成部分,文件和模块是一一对应的。
* 换言之,一个 Node.js 文件就是一个模块,这个文件可能是JavaScript 代码、JSON 或者编译过的C/C++ 扩展。
* 创建模块
* 在 Node.js 中,创建一个模块非常简单,如下我们创建一个 'main.js' 文件,代码如下:
* var hello = require('./... | true |
84434c7e88656119f5f0b0acce6e4e9faa246c0d | JavaScript | dhojo/lamzingclass | /Dhaja/JavaScript/class2.js | UTF-8 | 192 | 2.78125 | 3 | [] | no_license | document.write("hello this is me printed from an external JS");
window.alert("this is an alert from an external JS");
console.log("this will be printed in the console from an external JS"); | true |
8ae335ee6866fff212d5c7a08093dfbab407d294 | JavaScript | NovaJuan/first-Postgres-CRUD | /src/controllers/todo.controllers.js | UTF-8 | 1,444 | 2.5625 | 3 | [] | no_license | const {conn} = require('./db.connection');
async function addTodo(req,res){
const {title,description} = req.body;
try{
await conn.query('INSERT INTO todos (title,description) VALUES ($1,$2)',[title,description]);
return res.redirect('/');
}catch(e){
console.log(e);
res.send(... | true |
91de432408224c60377ab20dd4cecb5aa56af380 | JavaScript | Artiik/user-management-system | /app/controllers/users.controller.js | UTF-8 | 2,220 | 2.59375 | 3 | [
"MIT"
] | permissive |
//require dependencies
const User = require('../models/User'),
Group = require('../models/Group'),
path = require('path'),
usersData = require('../data/seedData.json').users;
//export controller
module.exports = {
getAll: getAll,
createSingle: createSingle,
getSingle: getSingl... | true |
d73b455d939800ca1fff74de27bd7a76830ba164 | JavaScript | annejhetson/todo_backbone_requirejs | /js/todos-router.js | UTF-8 | 956 | 2.515625 | 3 | [] | no_license | var TodoApp = Backbone.Router.extend({
routes: {
"todos": 'index', "todos/:description": 'show'
},
index: function(){
alert("got here");
var todoList = new TodoList();
this.todoList.fetch();
alert("got here");
var todoListView = new TodoListView({collection: todoList});
todoListView.render();
$('#c... | true |
e5fe2b668701d2962fd9078e8de847778063ec99 | JavaScript | zzuzsj/demo | /demo7 videoCamera/main.js | UTF-8 | 2,902 | 2.765625 | 3 | [] | no_license | /**
* Created by Administrator on 2016/10/10 0010.
*/
(function () {
var img;
var canvas1=document.getElementById('canvas');
var context1=canvas1.getContext('2d');
var canvas2=document.getElementById('canvas2');
var context2=canvas2.getContext('2d');
var roundX=0;
var roundY=0;
var im... | true |
77b255ac743db15f31f8d080281f86c37392b707 | JavaScript | AndriiSorokin/goit-react-hw-08-phonebook | /src/PhoneBook/Form.js | UTF-8 | 1,510 | 2.609375 | 3 | [] | no_license | import React, { useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { addToList } from '../redux/contactOperations/contactOperations';
import { getAllContact } from '../redux/contactSelector/contactSelector';
import style from '../PhoneBook/PhoneBook.module.css';
const initialState ... | true |
71c82d41eb33e296d70103126a421e9a0f42e769 | JavaScript | lisanet/homebridge-prowl-notification | /index.js | UTF-8 | 6,691 | 2.546875 | 3 | [
"BSD-2-Clause"
] | permissive | var https = require('https');
var querystring = require('querystring');
var fs = require('fs');
var format = require("util").format;
var package = require("./package.json");
var Accessory, Service, Characteristic, UUIDGen;
module.exports = function(homebridge) {
Accessory = homebridge.platformAccessory;
Servic... | true |
693480be7520ddb2c1e9e7efb3f1ed8c75f1b590 | JavaScript | robrich/es6-the-language-and-the-tools-workshop | /09.weird-external-libraries/demo/main.js | UTF-8 | 481 | 2.6875 | 3 | [] | no_license | /*global window:false */
import $ from 'jquery';
const Handlebars = window.Handlebars; // handlebars doesn't play well with webpack
let template = `<div>
<h2>Hello {{name}}</h2>
<p>Tweet me at <a href="https://twitter.com/{{twitterHandle}}">@{{twitterHandle}}</a></p>
</div>`;
let templateFn = Handlebars.compile(... | true |
6e18a35fca40a8031454c499520c041d4fc062b5 | JavaScript | enrtama/redux-websocket | /src/websocket.js | UTF-8 | 533 | 2.640625 | 3 | [
"MIT"
] | permissive | /* eslint-env browser */
/* @flow */
/**
* Formats args for creating the WebSocket instance
*/
const extractArgs = (config) => {
if (config.args) {
return config.args
}
return [config.url, config.headers]
}
/**
* Create a websocket object from the incoming config
*/
export const createWebsocket = (paylo... | true |
8dea105cc66b3f9a9f645ddaf27638fcb8c081ad | JavaScript | starozytny/portail | /assets/js/pages/functions/elements.js | UTF-8 | 950 | 2.796875 | 3 | [] | no_license | const Sanitaze = require("@dashboardComponents/functions/sanitaze");
function searchFunction(dataImmuable, search) {
let newData = [];
search = search.toLowerCase();
newData = dataImmuable.filter(function(v) {
if(v.name.toLowerCase().startsWith(search)){
return v;
}
})
... | true |
3a873c86e946830fe5cc4983ca31e3e5e5519118 | JavaScript | vanvoljg/data-structures-and-algorithms-js | /code-challenges/401/multipleArraySecondLargest/multiple-array-second-largest.js | UTF-8 | 1,619 | 3.234375 | 3 | [
"MIT"
] | permissive | 'use strict';
function secondLargestReverseSort(array) {
if (array.length < 2) return null;
let returnArray = array.sort((a, b) => {
return a > b ? -1 : 1;
});
return returnArray[1];
}
function secondLargestRecursive(array, largestSoFar, secondLargestSoFar) {
if (array.length < 2) return null;
if (... | true |
29c2c65460112b6c7212eef481c3c1862d181e5e | JavaScript | kasia-basia/greedy-bobby | /js/game.js | UTF-8 | 2,844 | 3.203125 | 3 | [] | no_license | const Bobby = require("./bobby.js");
const Coin = require("./coin.js");
function Game() {
this.board = document.querySelectorAll('#board div');
this.bobby = new Bobby();
this.coin = new Coin();
const scoreboard = document.querySelector('strong');
const over = document.querySelector('#over');
co... | true |
fc5e52257aef7ffbc334ee70c5b2f782a765cb83 | JavaScript | mjgumbs/thesis-phoenix | /assets/js/content_types/text_editor.js | UTF-8 | 1,243 | 2.9375 | 3 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | class TextEditor {
constructor (opts) {
this.editors = document.querySelectorAll('.thesis-content-text')
this.enabled = false
this.changed = this.changed.bind(this)
this.onChange = opts.onChange
}
enable () {
if (this.enabled) return
for (let i = 0; i < this.editors.length; i++) {
... | true |
b6fb0811f4bb6c9e40d0859e71e62959a9131dfb | JavaScript | idiotwithalaptop/toy-robot-node | /test/model/Robot.test.js | UTF-8 | 6,332 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | /* global describe, it, before, beforeEach */
const Robot = require('../../src/model/Robot')
const Direction = require('../../src/model/Direction')
const expect = require('chai').expect
describe('Robot', function () {
describe('constructor', function () {
let subject = null
before(function () {
subjec... | true |
556a1753484b0e7c1a8681ef5f5ff2dc70d38e47 | JavaScript | mmisztal1980/OOJS | /08.Pseudoclassical-Patterns.js | UTF-8 | 263 | 3.359375 | 3 | [] | no_license | var Car = function(loc) {
// this = Object.create(Car.prototype); // when using 'new'
this.loc = loc;
// return this; // when using 'new'
};
Car.prototype.move = function() {
this.loc++;
}
var amy = new Car(1);
amy.move();
var ben = new Car(9);
ben.move(); | true |
0cfb1554cfeb20031fbc3b2a2849621898fa2a78 | JavaScript | evanhook/quiz-practice | /js/scripts.js | UTF-8 | 1,139 | 2.84375 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
$("form#hogwartsQuiz").submit(function(event) {
event.preventDefault();
const favColor = parseInt($("input:radio[name=favColor]:checked").val());
const favAnimal = parseInt($("input:radio[name=favAnimal]:checked").val());
const favDrink = parseInt($("input:radio[name=favD... | true |
62d7b19611f8ef8873e675f771c521e269a11d4c | JavaScript | Frankenshtien/readme-generator | /utils/generateMarkdown.js | UTF-8 | 983 | 2.578125 | 3 | [
"Unlicense"
] | permissive | const renderLicenseSection = license => {
if (license === undefined) {
return ""
} else {
return `
## License:
[${license}](http://choosealicense.com/licenses/${license}/)
`;
}
}
// TODO: Create a function to generate markdown for README
// function generateMarkdown(data) {
// ret... | true |
ea300259bf19a8492f31f71358b920fe690d0689 | JavaScript | HiraNisar/hooks-practices | /src/UseEffect.jsx | UTF-8 | 570 | 2.9375 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
const UseEffect=()=>{
const[count,setCount]=useState(0);
//We can use multiple useEffects in your project with different functionalities
useEffect(()=>{
if(count>=1){
document.title=`Chats (${count})`;
}
else{
document.t... | true |
4c99f8a75ca277f86deaa76b2f3f073c3eeefdf1 | JavaScript | WorldVirus/algorithms-tasks | /leetcode/contest/biweekly/aprel_s.js | UTF-8 | 2,065 | 3.53125 | 4 | [] | no_license | function minStartValue (nums) {
let index = 1;
while(index){
let flag = true;
let buf = index;
for(let i = 0; i < nums.length; ++i){
buf += nums[i];
if(buf < 1){
flag = false;
break;
}
}
if(... | true |
05607eb775584cbb68bcb4e18d93b1f200814661 | JavaScript | UmaPK/JSworkspace | /su.js | UTF-8 | 728 | 2.890625 | 3 | [] | no_license | var fs = require("fs");
// Asynchronous read
fs.readFile('Indicators.csv', function (err, data) {
if (err) {
return console.error(err);
}
var jsonObj = [];
bufferString=data.toString();
arr = bufferString.split('\n');
var headers = arr[0].split(',');
headers[headers.length-1]=headers[headers.length-1].tr... | true |
5acd3af9200f2592089bae41c5472c88d5b1575e | JavaScript | matheusysd/Trybe | /exercises/8_1/exercise3.js | UTF-8 | 207 | 2.96875 | 3 | [] | no_license | 'use strict'
let btn = document.querySelector('#button')
let count = document.querySelector('#count')
btn.addEventListener('click', () => {
count.innerHTML = parseInt(count.innerHTML, 10) + 1;
}); | true |
553dd3697e8d4f33e4cf5b393a7cc9afbc7d9f62 | JavaScript | ddangal/react-aws-exam-website | /src/components/Question.js | UTF-8 | 9,150 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
import sweetAlert from 'sweetalert'
import { confirmAlert } from 'react-confirm-alert'; // Import
import 'react-confirm-alert/src/react-confirm-alert.css' // Import css
var post_api = "https://ujai96180i.execute-api.us-east-1.amazonaws.com/web-exam/ex... | true |
a58cbe4ef2d3b999cd7559be4522a6c11647d7e8 | JavaScript | PaulaJimenez7/hello-selenium-nodejs | /stackoverflow.js | UTF-8 | 1,068 | 3 | 3 | [] | no_license | #!/usr/bin/env node
const {Builder, By, Key, until} = require('selenium-webdriver');
(async function hello(){
let driver = await new Builder()
.forBrowser('firefox').build();
//Accedemos a la página stackoverflow
await driver.get('https://es.stackoverflow.com/');
//Realizamos busq... | true |