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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a60f9b0018247616f09e8b2302ac4d6e3e2a88e4 | JavaScript | edgar-code-repository/node-express-movies-rest-api | /src/controllers/genre.controller.js | UTF-8 | 3,371 | 2.828125 | 3 | [] | no_license | require('dotenv').config();
console.log("[Genre Controller][DATABASE_URL: " + process.env.DATABASE_URL + "]");
const db = require('knex')({
client: 'pg',
connection: process.env.DATABASE_URL
});
exports.test = function (req, res) {
res.send('This is the Genre controller!');
};
exports.getAllGenres = fun... | true |
be6a02b9984ef703deb876819804fb7081e0758e | JavaScript | bsmirnov12/Project-2 | /js/linechart.js | UTF-8 | 5,806 | 2.953125 | 3 | [] | no_license | // Associated elements.
// Make it global, because they are frequently used
var lineChart = d3.select('#line');
var lineWaiter = d3.select('#line-waiter');
var lineCard = d3.selectAll('.line-card');
lineCard.style('visibility', 'hidden');
// Revise endpoint for filtering parameters
function renderLineChart(year) {
... | true |
f33027d5fdfde2a31871733a709e0ce1f5e67736 | JavaScript | rjarv/contact-mgmt-client | /ViewModels/contactsViewModel.js | UTF-8 | 5,328 | 2.5625 | 3 | [
"MIT"
] | permissive | function ContactModel(){
var self = this;
self.id = ko.observable();
self.first_name = ko.observable();
self.middle_name = ko.observable();
self.last_name = ko.observable();
self.address1 = ko.observable();
self.address2 = ko.observable();
self.city = ko.observable();
self.st_province = ko.observable();
sel... | true |
6772c5f275e047a9e28bc173960aa0c77ebb0138 | JavaScript | raguayo/sous | /client/utils/quantityFuncs.js | UTF-8 | 2,269 | 3.046875 | 3 | [] | no_license | export function setDisplayUnitAndQuantity(ingObj) {
let conversionFactor = 1;
if (ingObj.unitMeasure === 'OZ') {
if (ingObj.quantity < 0.5) {
// convert to teaspoons
ingObj.displayUnit = 'TSB';
conversionFactor = 0.167;
} else if (ingObj.quantity < 2) {
// convert to tablespoons
... | true |
8c1eaee706bd9abb16cfa934cbf2d6723ad22e93 | JavaScript | diegoatnqn/shopwatch-react | /src/App.js | UTF-8 | 3,158 | 2.671875 | 3 | [] | no_license | import React from 'react';
import Product from './Product';
import './styles.css';
import estiloProd from './Product.module.css';
import Visualizador from './Visualizador';
import ProductDataDisplay from './Data';
import Header from './Header';
class App extends React.Component {
state = {
title: Product.ti... | true |
2c9dd576b53ff77cf9c5785c8a7eaec622618667 | JavaScript | FlacoMaccio/Py-MTH-React-JS | /src/components/Cart/Cart.js | UTF-8 | 2,871 | 2.625 | 3 | [] | no_license | import { useContext } from "react";
import CartContext from "../../Context/CartContext";
import { addOrder } from "../ItemListContainer/ItemData";
import CartForm from "./CartForm";
import "./Cart.css";
const Cart = () => {
const { getItemsCount, getCartTotal, cart, removeItem, clearCart } =
useContext(CartConte... | true |
ec677ab7600e3fc2e01605e9c83033475eb3e918 | JavaScript | KEVINYZY1/Hoz | /src/utils.js | UTF-8 | 436 | 2.90625 | 3 | [] | no_license | // 深拷贝
function deepCopy (obj) {
var newObj = null
if (typeof obj !== 'object' || obj === null) {
return
} else {
newObj = obj.constructor === Array ? [] : {}
for (let i in obj) {
if (i !== 'el') {
newObj[i] = typeof obj[i] === 'object' ? deepCopy(obj[i]) : obj[i]
} else {
... | true |
928929645e3dc0a562cdb5e189987fff157e154b | JavaScript | Maharramoff/30-seconds-of-code | /test/stableSort/stableSort.test.js | UTF-8 | 652 | 3.109375 | 3 | [
"CC0-1.0",
"CC-BY-3.0"
] | permissive | const test = require('tape');
const stableSort = require('./stableSort.js');
test('Testing stableSort', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof stableSort === 'function', 'stableSort is a Function');
//t.deepEqual(stable... | true |
199abecb2759ece9a3404fb1e46428b330a319b3 | JavaScript | fumalyson/Estudos-Javascript | /CursoJavaScript/aula12/ex013.js | UTF-8 | 592 | 3.859375 | 4 | [] | no_license | var agora = new Date()
var diaSemana = agora.getDay()
/*
0 Domingo
1 Segunda.
2 Terca
3 Quarta
4 Quinta
5 Sexta
6 Sabado
*/
console.log(diaSemana)
switch(diaSemana){
case 0:
console.log('Domingo')
break
case 1:
console.log('Segunda')
break
case... | true |
bc952f3086b2ae12430d2fcda59677f89288b86c | JavaScript | MIqbalFadillah/js-dts-learn | /for-loop.js | UTF-8 | 295 | 3.15625 | 3 | [] | no_license | // var objek = {
// nama : "Hello World",
// ID : "123345678"
// }
// var test = "1234"
// var arraytest = ["test1","test2","test3"];
// for (var x in arraytest){
// console.log(x);
// // console.log(arraytest);
// }
var i = 3;
for( i = 0; i < 5 ; i++){
console.log(i);
}
| true |
18b297bbbb25ecff71756a85ccca3fe4c336f556 | JavaScript | AlexisAlegria/Javascript-Events-Tutorial-Exercises | /exercises/04-hide-on-click/index.js | UTF-8 | 205 | 2.65625 | 3 | [] | no_license | window.myEventListener = function myEventListener()
{
//your code here
var divItems = document.querySelectorAll('div');
var arrayOfDivs = Array.from(divItems);
arrayOfDivs[0].style.display = 'none';
}
| true |
ecc2b10717d6e59a63d4c0dd4b8e11b3a13ce52c | JavaScript | coderlongren/Node-smile- | /Stream/main.js | UTF-8 | 429 | 3.0625 | 3 | [] | no_license |
var fs = require('fs');
var data = '';
//创建可读的流
var readerStream = fs.createReadStream('input.txt');
readerStream.setEncoding('UTF-8');
//处理流事件 --> data,end and error
readerStream.on('data',function(chunk){
data += chunk;
});
readerStream.on('end',function(chunk){
console.log(data);
});
readerStream.on('er... | true |
662832ccefbc95011a03b1edafc5a18160ffd82d | JavaScript | hsir05/react-project-package | /src/pages/db/db.js | UTF-8 | 2,069 | 2.6875 | 3 | [] | no_license |
const dbName = 'project', version = 1
let db
const DBOpenRequest = window.indexedDB.open(dbName,version)
DBOpenRequest.onerror = function() {
console.log('打开失败')
}
DBOpenRequest.onsuccess = function(e) {
db = DBOpenRequest.result
method.show()
}
DBOpenRequest.onupgradeneeded = function(e) {
let dbResult = ... | true |
c9b298867549c4768021fffcd2a8ade202b1d966 | JavaScript | ajasurbek/Celsius-to-fahrenheit-calculator | /js/scripts.js | UTF-8 | 496 | 3.03125 | 3 | [] | no_license | var ElForm = document.querySelector(".calc-form");
var ElNumber = document.querySelector(".calc-display");
var ElResult = document.querySelector(".result");
var ElBtn = document.querySelector(".calc-button");
ElForm.addEventListener('submit' , function(evt){
evt.preventDefault();
var ElFormas = parseFloat(ElNumber... | true |
465264cfbe078a1b40f3902b43ee9fd4581b4767 | JavaScript | Humza71/Redux | /Practice-redux/src/Store/reducers/counter.js | UTF-8 | 1,059 | 2.765625 | 3 | [] | no_license | import * as actionTypes from '../actions/actionTypes.js'
const initialState = {
counter:0
}
const reducer = (state = initialState,action) =>{
switch(action.type){
case actionTypes.INCREMENT :
// const newState = Object.assign({},state)
// newState.counter = state.counter +1
... | true |
fcd6cc49875dcd81c0384a369fa1f411bb1c8141 | JavaScript | adarshnanwani/es6-arrays-promises | /spread.js | UTF-8 | 735 | 4.3125 | 4 | [] | no_license | // Spread operator ---> ...
// Copy/Create a new object
const employee = {
name: 'Kevin',
designation: 'Accountant',
salary: 40000,
};
console.log('employee', employee);
// copy - Safely copy an object
const empCopy = { ...employee };
console.log('empCopy', empCopy);
// new
const empNew = { ...employee, nam... | true |
c607be4b9b8ae847bc237be6a4b1b3d8354143c9 | JavaScript | blackPeanut/ghostWriter | /ghostWriter.js | UTF-8 | 1,086 | 2.765625 | 3 | [
"MIT"
] | permissive | (function () {
this.GhostWriter = function () {
debugger;
this.method = null; //internal methods;
var defaults = {
str: "Hello, world!",
speed: 100,
fixedContainerSize: false,
containerClass: "ghostWriter",
color: null
}
if(arguments[0] && typeof arguments[0... | true |
cac78a8fce7280863e29443ad36b69f86ecbd58d | JavaScript | shuennhauc/nvd3 | /functions.js | UTF-8 | 4,070 | 3.25 | 3 | [] | no_license | //CHART 1
nv.addGraph(function () {
var chart = nv.models.lineChart() // Initialise the lineChart object.
.useInteractiveGuideline(true).margin({ // Add some CSS Margin to the chart.
top: 30,
right: 20,
bottom: 50,
left: 80
}) // Turn on interactive... | true |
b11fa33759bfb2f8bd9f6c4dbd3692a9615f710a | JavaScript | SivaKumar32521/Sorting-Visualizer | /scripts/index.js | UTF-8 | 2,116 | 3.375 | 3 | [] | no_license | const generate_new_array = document.getElementById("generate-array-btn");
const array_container = document.getElementById("array-container");
const array_size = document.getElementById("array-size");
const sorting_speed = document.getElementById("sorting-speed");
const bubble_sort_btn = document.getElementById("b... | true |
ee43f8a941b093a8f32b9c88cb3ad1c4447e6381 | JavaScript | agnieszka-f/javascript-memory-game | /js/script.js | UTF-8 | 3,844 | 2.96875 | 3 | [] | no_license | {
'use strict';
const select = {
templateOfBoard: '#template-board',
buttonNewGame: '#button-new-game',
divLock: '.lock',
divInfo: 'info',
optionBoardSize: '[name="option-board-size"]'
};
const templates = {
divCard: Handlebars.compile(document.querySelector(select.templateOfBoard).innerHTML)
};
... | true |
2e31f398cbb396a2cabae110270d35bd96fcd82f | JavaScript | Psiniy-programmer/rickandmorty | /src/store/charactersModule.js | UTF-8 | 1,531 | 2.515625 | 3 | [] | no_license | import axios from "axios";
import api from "@/utils/api";
import {CharactersModel} from "@/store/Models/CharactersModel";
export const charactersModule = {
/**
* @returns {{data: {}|CharactersModel, loading: boolean, error: string}}
*/
state: () => ({
data: {},
loading: false,
error: ''
}),
m... | true |
5136dbf4acbca92bcbe96817048e9bd390f287b6 | JavaScript | veilance/node-advanced-test | /readText.js | UTF-8 | 1,020 | 3.03125 | 3 | [] | no_license | const { Transform } = require("stream");
class ReadText extends Transform {
constructor(options) {
super({ objectMode: true });
this.obj = {
elapsed_time: 0,
total_length_in_bytes: 0,
number_of_lines: 0
};
this.start_time = new Date();
}
_transform(chunk, encoding, callback) {
... | true |
dcf4186e523a83135e65e5f602a50af58e571aca | JavaScript | bdmcarthur/lab-react-ironnutrition | /starter-code/src/components/addNew.js | UTF-8 | 2,026 | 2.59375 | 3 | [] | no_license | import React, { Component } from "react";
import Button from "react-bootstrap/Button";
import Form from "react-bootstrap/Form";
export default class AddNew extends Component {
constructor(props) {
super(props);
this.state = {
name: "",
calories: "",
image: ""
};
}
handleNameInput... | true |
dd9375c231fa979294b6869f4798647ec4e4f978 | JavaScript | tajinzzang/wecodeGitTest | /test.js | UTF-8 | 129 | 3.34375 | 3 | [] | no_license | function isEven() {
let arr= [];
for (let i=1; i <arr.length<=50; i++){
if (arr % 2 === 0){
return arr;
}
}
} | true |
ddb6917c4201b3ccee7b4c0706dfc4eac67968a4 | JavaScript | SergijBabich/-timer-for-your-site | /script.js | WINDOWS-1251 | 1,923 | 3.59375 | 4 | [] | no_license | //
let deadline = "2019-10-08";
// . () ,, .
function getTimeRemaning(endtime){
let t = Date.parse(endtime) - new Date(),
second = Math.floor((t/1000) % 60),
minute = Math.floor((t/1000/60) % 60),
hours = Math.floor((t/(1000*60*60)));
return {
'total':t,
'second' :second,
'minute' : mi... | true |
698871aa96850dad06c18b6bdfc5954a31ac7f7a | JavaScript | VujicGit/web | /WebContent/js/users.js | UTF-8 | 1,367 | 2.75 | 3 | [
"MIT"
] | permissive | $(document).ready(function () {
getAllUsers();
searchUsers();
isAdminLoggedIn();
});
function getAllUsers() {
$.ajax({
type: "GET",
url: "rest/users/getAll",
success: function (users) {
createTableData(users);
}
});
}
function createTableData(users)... | true |
e4bbe17ad0724b61a6709a6541ae91aeebb83f61 | JavaScript | SarahAlhabeeb/FeedReaderTesting-FEND | /jasmine/spec/feedreader.js | UTF-8 | 3,634 | 3.28125 | 3 | [] | no_license | /* feedreader.js */
$(function () {
/* This suite is all about the RSS feeds definitions */
describe('RSS Feeds', function () {
it('are defined', function () {
expect(allFeeds).toBeDefined();
expect(allFeeds.length).not.toBe(0);
});
it('has a URL defined and ... | true |
d6c6037fa33c6e01a13d8a7d49176e28dff8dbb5 | JavaScript | tectronics/angcalculator | /assets/scripts/App.js | UTF-8 | 14,670 | 2.515625 | 3 | [] | no_license | /* *
* abandon hope, all ye who enter here *
* author: gregory nicholas *
* uri: www.phasedreduction.com *
* *
* some scripts written specifically for *
* the angcalculator.appspot.com website ... | true |
302ded0bde028e454455ad901a08802151036ac0 | JavaScript | umeshraj/p5js | /9p15_2d_arrays/sketch.js | UTF-8 | 594 | 3.53125 | 4 | [] | no_license | let cols = 10;
let rows = 5;
let colors = [];
function setup(){
createCanvas(400, 300);
colors = make2DArray(rows, cols);
for(let r=0; r<rows; r++){
for(let c=0; c<cols; c++){
colors[r][c] = random(255);
}
}
}
function draw(){
background(51);
for(let c=0; c<cols; c++){
for(let r=0; r<ro... | true |
bb4bab3b0d636f30bc26d64acce4ad489ce4844f | JavaScript | Laura-VLN/BeCode | /js-season-1/01.Season-1/09-misc/05-worst-ui-three/script.js | UTF-8 | 812 | 2.921875 | 3 | [] | no_license | // 09-misc/05-worst-ui-three/script.js - 9.5: worst user interface (3) : phone slot
(() => {
let buttons = Array.from(document.querySelectorAll("button"));
let inputs = Array.from(document.querySelectorAll("input"));
buttons.forEach(button => {
button.addEventListener("click", () => {
... | true |
b3d6bec0d07704e3db2222d3250c9e84504a3663 | JavaScript | GiuseppeVigliaturo/js-lista-cognomi | /assets/js/main.js | UTF-8 | 713 | 3.8125 | 4 | [] | no_license | //creo una lista di cognomi non ordinata
var lista =["Rossi","Perri","Anastasio","Madia","Talarico","Campisano"];
//chiedo all'utente di inserire un cognome
var cognome = prompt("Ciao inserisci un cognome");
//stampo la lista non ordinata
document.getElementById("unordered").innerHTML = lista;
//inserisco il cognome... | true |
86e8a893cc19d8f8fd94ff71d47adcb0bdadb539 | JavaScript | caitlinboldt/inputNameAge | /js/main.js | UTF-8 | 417 | 3.78125 | 4 | [] | no_license | // input for both age and name
// take inputs and put the results on the page
function writeName() {
var welcomeMessage = document.getElementById('welcome')
var name = document.getElementById('name')
var age = document.getElementById('age')
// inputs message into blank <p>
welcomeMessage.innerHTML... | true |
91688e71af90b9a7f60b245470716e5d33f8b4d7 | JavaScript | frshup/f5-core | /models/InventoryItem.js | UTF-8 | 954 | 2.875 | 3 | [] | no_license | const Money = require('js-money');
const Item = require('./Item');
const Quantity = require('./Quantity');
class InventoryItem {
constructor(item, stockAvailable){
if (!(item instanceof Item)) {
throw Error("item should be of type Item");
}
if (typeof stockAvailable !== 'number' && stockAvailabl... | true |
745f4576e2edc739f965a1397ced0ecf526a99be | JavaScript | sandokan815/Booking-Website | /vliegdutch-desktop/app/scripts/services/helpers.service.js | UTF-8 | 2,539 | 2.734375 | 3 | [] | no_license | angular.module('vliegdutch').factory('Helpers', ['$filter', function ($filter) {
return {
/**
* @type function
* @param {{arrival_city}[]} array
* @description Rename arrival city name (special case).
*/
sanitizeArrivalName: function (array) {
array.... | true |
12ddfe1a1e41c0cd6a8de9f740dafff6175d7e86 | JavaScript | SaisriChodisetti/fwa13Chodisetti | /routes/compute.js | UTF-8 | 790 | 2.953125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var storeValue;
/* GET home page. */
router.get('/', function (req, res, next) {
fake_url = "https://fake.com/path" + req.url
const url = new URL(fake_url)
const search_params = url.searchParams
storeValue = Number(search_params.get("x"))
... | true |
5bdd3e0da487c34379230bca48be6a3d935954a3 | JavaScript | boza97/Ionic-ecommerce | /backend/controllers/orders.js | UTF-8 | 4,333 | 2.515625 | 3 | [] | no_license | const Product = require('../models/Product');
const Order = require('../models/Order');
const OrderItem = require('../models/OrderItem');
const { validationResult } = require('express-validator');
const sequelize = require('../util/database');
exports.index = async (req, res, next) => {
try {
const orders ... | true |
1a52338f2084e6d892cb859bde7225fe314b3a1b | JavaScript | barryntklc/ics415f15 | /IC/w4c2/process.js | UTF-8 | 1,071 | 3.3125 | 3 | [] | no_license | /**
* Created by Chunmeista on 9/17/2015.
*/
window.onload = function(a) {
displayElement();
}
function formArray() {
return location.search.slice(1).split('&');
}
function displayElement() {
var html = document.createElement("table");
var x = formArray();
for (a in x) {
var h = docume... | true |
a93d6151d96528c005ecbf0622c39d40b2c5e642 | JavaScript | BoardFellows/dummy-mongo-backend | /test/integration/users-test.js | UTF-8 | 3,193 | 2.625 | 3 | [
"MIT"
] | permissive | 'use strict';
const mongoose = require('mongoose');
const User = require(__dirname + '/../../backend/models/user.js');
const btoa = require('btoa');
const chai = require('chai');
const chaiHttp = require('chai-http');
chai.use(chaiHttp);
const expect = chai.expect;
const API_PORT = process.env.API_PORT || 8080;
... | true |
1477e07997d11a31daf2f2dd3be752cf2ff330b8 | JavaScript | vasasharath/AlgoCasts | /exercises/brokenCalc.js | UTF-8 | 1,088 | 4.3125 | 4 | [] | no_license | /*
On a broken calculator that has a number showing on its display, we can perform two operations:
Double: Multiply the number on the display by 2, or;
Decrement: Subtract 1 from the number on the display.
Initially, the calculator is displaying the number X.
Return the minimum number of operations needed to display ... | true |
e4acb2c8cf18a00ebd71cb7b7d274a3210701529 | JavaScript | dngur1278/javascript | /js/variable.js | UTF-8 | 691 | 4.53125 | 5 | [] | no_license | // variable.js
let age = 10;
console.log(age);
age = 20;
console.log(age);
const PI = 3.14; // 상수: 재할당이 불가능.
//PI = 3.2;
{
let age = 30;
console.log(age);
}
console.log(age);
let v1; // undefined
v1 = 'Hello'; //string
v1 = 100.45; // number
v1 = true; // boolean
v1 = null; // object
v1 = [... | true |
ae45398a89c96ac94fad756da1c3236976e996b1 | JavaScript | Chen-Gwan-Hua/MyWeb | /CSS/NewsAPI.js | UTF-8 | 2,722 | 2.859375 | 3 | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | /*const { default: axios } = require("axios");*/
/*GNews API KEY:51f3baf690408212bb314fb13198b18d */
/*NewsData*/
const toTop = document.querySelector(".to-top");
window.addEventListener("scroll", () => {
if (window.pageYOffset > 10) {
toTop.classList.add("active");
} else {
toTop.classList.rem... | true |
5c1e2a4e72208620dd3d694f74882b635ac3b5dd | JavaScript | cussatiih/desafio-m01-t04 | /12-caps-lock-on/index.js | UTF-8 | 408 | 3.921875 | 4 | [] | no_license | let input = "CAPS";
let output = "";
if (input[0] === input[0].toLowerCase() && input.substr(1, (input.length - 1)) === input.substr(1, (input.length - 1)).toUpperCase()) {
output = `${input.substr(0, 1).toUpperCase()}${input.substr(1, (input.length - 1)).toLowerCase()}`;
} else if (input === input.toUpperCase()) ... | true |
ec7c183a150bc2e544c5764110dd8351c62c5db5 | JavaScript | Alex-Kostov/SoftUni | /JS-Fundamentals/16.Arrays Advanced/04.sorting.js | UTF-8 | 666 | 4.0625 | 4 | [] | no_license | function sort(input) {
let inputCopy = input.slice();
let smallBig = input.sort((a, b) => a - b);
let bigSmall = inputCopy.sort((b, a) => a - b);
let result = [];
for (let i = 0; i < input.length / 2; i++) {
result.push(bigSmall[i]);
result.push(smallBig[i]);
}
console.log... | true |
d702befba1bf8281a143039690e9963df1ff44d3 | JavaScript | Raulcmm/testing_react | /src/__tests__/hooks/useForm.test.js | UTF-8 | 1,331 | 2.515625 | 3 | [] | no_license | import React from "react";
import { renderHook, act } from "@testing-library/react-hooks";
import useForm from "../../hooks/useForm";
describe("Test to useForm", () => {
const valueForm = {
name: "",
age: "",
lastName: "",
};
test("Debe regrear un formulario un objeto vacio si no se le manda nada", () => {
... | true |
0d67b0cb2c35d11c85899a0b3ace834452678398 | JavaScript | chancejewett/dataStructuresExercise | /dataStructuresExercise.js | UTF-8 | 773 | 3.3125 | 3 | [] | no_license | //1a
const jedi=[];
console.log(jedi)
//1b
jedi[0] = "luke";
console.log(jedi)
//1c
jedi.push("obi-wan kenobi");
//1d
jedi.unshift("yoda");
console.log(jedi)
//1e
console.log(jedi[1]);
console.log(jedi)
//1f
jedi.pop();
console.log(jedi);
//1g
jedi.shift();
console.log(jedi);
//2a
const sythlords=["Darth ... | true |
829bf10600f5ba775c803ba6de195217d48c4ef9 | JavaScript | chris979235/goingoveragain | /module5/bountyHunter/routes/bountyRouter.js | UTF-8 | 1,505 | 2.921875 | 3 | [] | no_license | const express= require("express")
const bountyRouter=express.Router()
const { v4: uuidv4 } = require('uuid');
const Bounties=[
{firstName:'maul', lasName:'darth', living:true, bounty:100,type:'sith', _id: uuidv4()},
{firstName:'sidious', lasName:'darth', living:true, bounty:100,type:'sith', _id: uuidv4()},
{firs... | true |
84eb39b4ff755635590b8aae439bd19d225c9d66 | JavaScript | burend/ASFA | /Javascripts/Source/People/personLouise.js | UTF-8 | 24,750 | 2.59375 | 3 | [] | no_license | /**************************************************************************
Louise
**************************************************************************/
function RepliesLouise(nR)
{
var bCharm = per.isCharmedBy();
var myName = per.getYourNameFor();
if (nR == 2600)
{
setPlaceKnown("CelesteRd");
setPlaceK... | true |
54ec24a36924cab94df0ec1a4f74e4f75d796d54 | JavaScript | ruju256/dashboard | /ui/js/app/login.js | UTF-8 | 1,268 | 2.734375 | 3 | [] | no_license | $("#login_form").submit(function(event) {
event.preventDefault();
var login_button = document.getElementById("login_button");
var login_email = document.getElementById("loginEmail");
var login_password = document.getElementById("loginPassword");
var error_text = document.getElementById("error_t... | true |
98b978a31573027c4b0b72e001d30f4d367e219d | JavaScript | vishnu242/reactapp | /src/Table.js | UTF-8 | 1,336 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react';
import DataTable from 'react-data-table-component';
import { Link } from 'react-router-dom';
//const data = [{ title: 'Conan the Barbarian', year: '1982' }];
const columns = [
{
name: 'Employee Id',
selector: 'id',
sortable: true,
},
{
name: 'First Name',... | true |
852e3fa8fe8e46cfa87aff6f1d86088c6a15d086 | JavaScript | dohzya/GetBackHome | /public/javascripts/alive/groups.js | UTF-8 | 2,445 | 2.625 | 3 | [] | no_license | app.factory("Groups", ["Survivors", "Memories", "Map", "Util", function (Survivors, Memories, Map, Util) {
"use strict";
function Group(args) {
this.survivors = args.survivors;
this.memory = Memories.create();
this.endurance = 0;
this.messages = this.memory.logs.messages;
}
Group.prototype.vis... | true |
9e0b64c525a15ba1467566cbe7b4b35ccf48e113 | JavaScript | SeHarlan/ProductShopping | /products/productData.js | UTF-8 | 1,986 | 2.859375 | 3 | [] | no_license |
//object temp
// id: ,
// name: ,
// image: ,
// description: ,
// category: ,
// price: ,
const plumbus = {
id: 'plumbus',
name: 'Perfect Pink Plumbus',
image: 'plumbus.jpg',
description: 'No need to explain what a plumbus does. It\'s a plumbus, explaining it is like makin... | true |
d0bba8d996a7e856908987ae198fd969710ebbce | JavaScript | aa-interview/nodeinterview_v2 | /4Algorithms/test/durstenfeldShuffleTests.js | UTF-8 | 506 | 2.640625 | 3 | [
"MIT"
] | permissive | const path = require('path');
const durstenfeldShuffle = require(path.join(__dirname, '..', 'algorithms', 'durstenfeldShuffle.js'));
const expect = require('chai').expect;
describe('Durstenfeld Shuffle Algorithm: durstenfeldShuffle(input)', () => {
it('Should return the input array with its indices\' values shuffled.... | true |
f3436f21352a5cc846e8c54178ff64787420515f | JavaScript | ansarovaa/preatmtasks | /Task3.js | UTF-8 | 467 | 3.53125 | 4 | [] | no_license | var happiness = {
"love": 1,
"life": 2,
"travel": 3,
"cats": 4,
"money": 5
}; //define object happiness with 5 properties and their priorities
function taskThree() {
sortProperties = Object.keys(happiness).sort(function (a, b) {
return happiness[b] - happiness[a]
}) //sort propertie... | true |
156a29923197c3fe13ce91406cae9d659575331b | JavaScript | regi87/Programacion | /Programacion/BASES_DATOS/Reto_Diagramas/JS/main.js | UTF-8 | 1,937 | 3.015625 | 3 | [] | no_license |
$.ajax({
type: "GET",
datatype: 'json',
url: '../PHP/Pagina_1.php',
success: function(data) {
var arrayNombres_Superficie = jQuery.parseJSON(data);
Init(arrayNombres_Superficie);
}
});
$.ajax({
type: "GET",
datatype: 'json',
url: '../PHP/Pagina_2.php',
success: function(data) {
var arr... | true |
0ea8fb0b9fdc257bd4c93c25466eac84f229f8a3 | JavaScript | 7h3730B/7hISSBot | /src/commands/isspass.js | UTF-8 | 1,888 | 2.59375 | 3 | [
"MIT"
] | permissive | const fetch = require("node-fetch");
module.exports.info = {
name: "isspass",
description: "calculates the passes of a given location",
explanation: "\"this will compute the next n number of times that the ISS will be overhead. Overhead is defined as 10° in elevation for the observer.The times are computed... | true |
332b5a2bdc21077fc3333a20ea8a181a9b6c8c1e | JavaScript | sanaanymoe/photo-N-text | /src/App.js | UTF-8 | 1,324 | 2.53125 | 3 | [] | no_license | import React, { useState } from "react";
import { ChromePicker } from "react-color";
import { base64encode } from "nodejs-base64";
import "./App.css";
function App() {
const [text, setText] = useState("");
const [color, setColor] = useState("");
// const encodedText = base64encode(text);
const encodedText = ... | true |
8fde120bbf7218d8ee9b667f4eeeebdad688ff87 | JavaScript | NadeemKhan99/project101 | /src/components/doctors/change_slots/add_doctor_slots.js | UTF-8 | 3,438 | 2.5625 | 3 | [] | no_license | import React, { Fragment, useState } from 'react'
import "./../../../index.css"
import DaySlots from './../../doctors/day'
function DocSlotsAlready({submit,set_data,back_slotss}) {
const [mondaySlots,setmondaySlots] = useState([])
const [tuesdaySlots,settuesdaySlots] = useState([])
const [wednesdaySlot... | true |
6e7048d24db31073ae58be509da60cd89a9a5b4b | JavaScript | dgaberger/fret-bored | /client/store/tuning.js | UTF-8 | 536 | 2.703125 | 3 | [] | no_license |
/**
* ACTION TYPES
*/
const GET_TUNING = 'GET_TUNING'
const EDIT_TUNING = 'EDIT_TUNING'
/**
* INITIAL STATE
*/
const initTuning = [7,0,5,10,2,7]
/**
* ACTION CREATORS
*/
export const getTuning = tuning => ({type: GET_TUNING, tuning})
export const editTuning = tuning => ({type: EDIT_TUNING, tuning})
/**
* RED... | true |
989e8a948b4999b5e5bab830f565cc94cdce0170 | JavaScript | hhayk/leetcode | /559. Maximum Depth of N-ary Tree.js | UTF-8 | 1,082 | 4 | 4 | [] | no_license | /*
Given a n-ary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
For example, given a 3-ary tree:
We should return its max depth, which is 3.
Note:
The depth of the tree is at most 1000.
The total number of nodes is ... | true |
0645342d32d967a03f227ff5d0f209a9e79510f6 | JavaScript | medleey/naofood | /backend/controllers/restau_controller.js | UTF-8 | 724 | 2.5625 | 3 | [] | no_license | const fs = require('fs');
const db = require('../models');
//POUR RECHERCHER TOUS LES RESTAU
exports.getAllRestau = (req, res, next) => { //req = request, res = response
let limit = parseInt(req.params.limit ?? 12);
db.restau.findAll({
limit,
})//find va chercher quelque chose, va chercher tous les restau... | true |
c012b125e6d3fc75dc1d66827549f52f79f9c0ed | JavaScript | MikhailKolomoitsev/goit-react-hw-04-hooks-feedback | /src/components/Feedback/Feedback.jsx | UTF-8 | 1,800 | 2.734375 | 3 | [] | no_license | // import PropTypes from "prop-types";
import styles from "./Feedback.module.css";
import React, { useState } from "react";
import FeedbackOptions from "./FeedbackOptions/FeedbackOptions";
import Statistics from "./Statistics/Statistics";
import Notification from "./Notification/Notification";
const shortid = require('... | true |
e592aaf16321e42f64943c919d5a9fd159381c80 | JavaScript | fahadaleem/Photo-Gallery-w-jQuery-Firebase-DB-Storage | /js/app.js | UTF-8 | 1,352 | 2.90625 | 3 | [] | no_license | $("#select-file").on("change", e=>{
const file = e.target.files[0];
const fileUrl= firebase.storage().ref("images").child(file.name).put(file);
fileUrl.on("state_changed", (snapshot)=>{
//progress
const progressPercentage = (snapshot.bytesTransferred / snapshot.totalBytes) *100;
$("... | true |
952f4630e998b0d4420769e41bccc60017d1a113 | JavaScript | rometz/Programming-Exercises | /eloquentJavascriptV3/ch4AList.js | UTF-8 | 735 | 3.640625 | 4 | [] | no_license | let list = {
value: 1,
rest: {
value: 2,
rest: {
value: 3,
rest: null
}
}
};
let anArray = [1, 2, 3];
function arrayToList(array) {
let list = null;
for (i = array.length - 1; i >= 0; i--) {
list = {value: array[i], rest: list};
}
retu... | true |
0eaf1c05cbf252e77447ac7f056d4ff5ec71e92a | JavaScript | ferrymanss/third-party-web | /lib/create-entity-finder-api.js | UTF-8 | 2,553 | 2.65625 | 3 | [
"MIT"
] | permissive | const DOMAIN_IN_URL_REGEX = /:\/\/(\S*?)(:\d+)?(\/|$)/
const DOMAIN_CHARACTERS = /([a-z0-9.-]+\.[a-z0-9]+|localhost)/i
const IP_REGEX = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/
const ROOT_DOMAIN_REGEX = /[^.]+\.([^.]+|(gov|com|co|ne)\.\w{2})$/i
function getDomainFromOriginOrURL(originOrURL) {
if (typeof originOrURL !=... | true |
2e72292d40cde667c8860ab52b71cc12a164b5c1 | JavaScript | Stanislav-Yordanov/JavaScriptCore_Fundamentals | /CaptureNumbers_6Ex.js | UTF-8 | 207 | 2.875 | 3 | [] | no_license | function captureNum(arr) {
let pattern=/[0-9]+/g;
console.log(arr.join('').match(pattern).join(' '));
}
captureNum(['The300' ,'What is that?', 'I think it’s the 3rd movie.' ,'Lets watch it at 22:45']); | true |
150a4457efbaf0bdada2f9ba13b3a1bc2571ad62 | JavaScript | NUKnightLab/sql-mysteries | /scripts/main.js | UTF-8 | 10,683 | 2.8125 | 3 | [
"MIT",
"CC-BY-SA-4.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | // Set up DB
function loadData(dbFile) {
if (!dbFile) { return; }
window.worker = new Worker("scripts/worker.sql.js");
var xhr = new XMLHttpRequest();
xhr.open('GET', dbFile, true);
xhr.responseType = 'arraybuffer';
xhr.onload = () => {
var uInt8Array = new Uint8Array(xhr.response);
worker.onmessage... | true |
9e0a9ee5cb56172e31e2aa9ecedd91dad36a32ed | JavaScript | inesmcferreira/weather-app-sheCodes | /script.js | UTF-8 | 4,410 | 3.421875 | 3 | [] | no_license | let apiKey = "121052a00f6df00e4ae65743dbad7c03";
function formatDay(timestamp){
let date = new Date(timestamp*1000)
let day = date.getDay();
let days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
return days[day];
}
function displayForecast(response){
let forecast = response.data.daily;
let for... | true |
649b5da53bd3598bbb5e2791f2e39f8ec428afab | JavaScript | SmilyanDichev/AlphaProgramTelerik | /itsTheFinalDSA/sum-three.js | UTF-8 | 2,260 | 3.21875 | 3 | [] | no_license | const getGets = (arr) => {
let index = 0;
return () => {
const toReturn = arr[index];
index += 1;
return toReturn;
};
};
// this is the test
const test = [
'6 7',
'5',
'UR 5',
'RD 2',
'DL 3',
'LU 6',
'DR 5',
];
const test1 = [
'2 2',
'10 ',
'... | true |
3cfe94addf74efd14b64f31a4ebeb9e7bb44a8e8 | JavaScript | cy-hironori-konuma/nodejs_lesson | /lesson8_browserify/main.js | UTF-8 | 218 | 2.578125 | 3 | [] | no_license | var validation = require('./lib/validation');
//var url = 'http://www.yahoo.co.jp/';
var url = 'hogehoge';
if (validation.isUrl(url)) {
location.href = url;
} else {
alert(url + 'はURLではありません。');
} | true |
d47b41dcc9a2cc3afb22736872c814c84ff80eaf | JavaScript | MrPreneur/MrPreneur | /assets/www/js/Classes/Skills/Skills.js | UTF-8 | 1,388 | 2.875 | 3 | [] | no_license | var Skills = Class.create({
//Constructor Method
initialize: function(){
},
//Properties:
//skills levels and experience
id:0,
construction:0,
constructionExp:0,
recruitment:0,
recruitmentExp:0,
negotiation:0,
negotiationExp:0,
marketing:0,
marketingExp:0,
//Methods:
myMethod:function(... | true |
8f53d397930439ef89f1e6519db8fc284f9390c4 | JavaScript | leslyto/precious-challenge | /static/js/components/app.js | UTF-8 | 3,429 | 2.78125 | 3 | [] | no_license | import React, { Component } from "react"
import Trip from "./trip"
import Basket from "./basket"
import $ from "jquery"
import "../../css/styles.scss"
export default class App extends Component {
constructor() {
super()
this.state = {
trips: [],
basket: [],
totalCost: 0,
selected: nu... | true |
5cfb741e084054b526e07fd690018ea00e07d998 | JavaScript | Digicrest/_books | /eloquent-js/Chapter 03 - Functions/Exercises/0_minimum.js | UTF-8 | 452 | 4.5 | 4 | [] | no_license | /*
The previous chapter introduced the standard function 'Math.min' that returns
its smallest argument.
We can do that ourselves now. Write a function 'min' that
takes two arguments and returns their minimum.
console.log(min(0, 10)); // -> 0
console.log(min(0, -10)); // -> -10
*/
let min... | true |
29ba487fa46b6207b2330e44b13a9e63e2253529 | JavaScript | microsoft/botframework-sdk | /parsers/LU/JS/packages/lu/src/parser/lufile/diagnostic.js | UTF-8 | 2,913 | 2.75 | 3 | [
"MIT"
] | permissive | /**
* Diagnostic class
*/
class Diagnostic {
constructor(range, message, severity = DiagnosticSeverity.ERROR) {
this.Message = message;
this.Range = range;
this.Severity = severity;
}
toString() {
if (this.Range === undefined) {
return `[${DiagnosticSeverity[th... | true |
f0a86c095da392a5040e0fda5222bac0478354cd | JavaScript | perches/ohapo | /frontend/src/reducers/weatherForecast.js | UTF-8 | 776 | 2.65625 | 3 | [
"MIT"
] | permissive | import {
FETCH_WEATHER_FORECAST,
FETCH_WEATHER_FORECAST_SUCCESS,
FETCH_WEATHER_FORECAST_ERROR
} from "../actions/fetchWeatherForecast";
const initialState = {
weatherForecast: null,
isLoading: false,
error: false
};
export default function weatherForecastReducer(state = initialState, action) {
switch (a... | true |
243413db373bf30d7fc3af47b0d7c28a4a2cd78e | JavaScript | nprapps/graphics-archive | /2014/01/quit_rates/js/graphic.js | UTF-8 | 6,180 | 2.78125 | 3 | [] | no_license | $(document).ready(function() {
var $graphic = $('#graphic');
var graphic_data_url = 'quits4.csv';
var graphic_data;
var parseDate = d3.time.format("%m/%d/%y").parse; // parsing date data
var formatTime = d3.time.format("%B %Y"); // display date format
function drawGraphic(width) {
var margi... | true |
4ed8cf0aa2efe467db126e3dbb319c56849fdf10 | JavaScript | hannahmre/portfolio | /scripts/responsiveprojects.js | UTF-8 | 276 | 2.59375 | 3 | [] | no_license | var width = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;
function responsive() {
if(width <= 950){
var element = document.getElementById("navv");
element.classList.remove("flex-column");
}
}
responsive(); | true |
9dc4d071f5e0efbe42c7aab3ee18d212db0ee922 | JavaScript | KangEunseo/2018-wsm-class | /Desktop/wsm 수업/1-4 강은서/JS/wsm/js/audio.js | UTF-8 | 260 | 2.921875 | 3 | [] | no_license | function play(){
var myAudio=document.getElementById("mp3");
myAudio.play();
}
function pause(){
var myAudio=document.getElementById("mp3");
myAudio.pause();
}
function reset(){
var myAudio=document.getElementById("mp3");
myAudio.currentTime=0;
} | true |
1ca08c30b952e37a601114d5b579677daf8c390b | JavaScript | panguixiang/cccs2 | /src/main/webapp/js/form2/createPeoples2.js | UTF-8 | 16,894 | 2.609375 | 3 | [] | no_license | function addRow(idstr){
var td_obj = document.getElementById(idstr);
var table_objs = td_obj.children;
var hidden_table = table_objs(0);
//alert(hidden_table.innerHTML);
//alert(hidden_table.tagName+","+hidden_table.style.display);
//var newObj = hidden_table.cloneNode(true);
var tmp_div = document.createElement... | true |
a26cb9a92d4b91f15854450f9836b166fc9ef1fc | JavaScript | C-N-G/cormacgudge.xyz | /macbot/commands/avatar.js | UTF-8 | 841 | 2.53125 | 3 | [] | no_license | module.exports = {
name: 'avatar',
aliases: ['icon', 'pfp'],
description: 'Provides a link to the users avatar.',
usage: '[user]',
cooldown: 5,
guildOnly: true,
execute(message, args) {
if (!args[0]) {
return message.channel.send(message.author.displayAvatarURL({format:'png', dynamic:true, size:40... | true |
c598fa3b3ceb5edc2823f62c2e18b19d9aba537f | JavaScript | HoneyBear8778/Personal-Library | /rountes/api.js | UTF-8 | 4,661 | 2.546875 | 3 | [] | no_license | /*
*
*
* Complete the API routing below
*
*
*/
'use strict';
var expect = require('chai').expect;
var MongoClient = require('mongodb').MongoClient;
var ObjectId = require('mongodb').ObjectId;
const MONGODB_CONNECTION_STRING = process.env.DB;
//Example connection: MongoClient.connect(MONGODB_CONNEC... | true |
670f6f4bf0d652096d6974aefc77799d80195be2 | JavaScript | ApolloTang/react-testing-library-crush-course-2020 | /src/02-intro-to-rtl/04-debug-rtl.test.js | UTF-8 | 691 | 2.71875 | 3 | [] | no_license | import React from 'react'
import {render} from '@testing-library/react'
const MyComponent = () => (
<div>I am a react component</div>
)
test('can debug in terminal', ()=>{
const { container, debug } = render(<MyComponent/>)
// *******************************
//
// You can debug in terminal:
//
de... | true |
c3dee04c2db53187a19656f5b5f82d14ca548241 | JavaScript | Clsmith2/Dominion-app | /js/services/searchvaluesservice.js | UTF-8 | 2,557 | 2.671875 | 3 | [] | no_license | // This service is used to store search data when the user leaves the page
angular.module("SearchValues", [])
.factory("CardSearchValues", function() {
CardSearchValues = {
// set initial values, to be later changed by user
/* search results should start displaying no cards (I have actually moved to preferri... | true |
0f197093c8da7a3c7490234a4b6fe77ddec18610 | JavaScript | Jestric-sys/nodeJS_2_1106 | /Students/Marina/lessons/3/cab-game/src/utils/number.js | UTF-8 | 1,162 | 3.46875 | 3 | [] | no_license | const max = 9999;
const min = 1000;
export default {
generateSecretNumber() {
let number;
do {
number = Math.floor(Math.random() * (max - min + 1)) + min;
console.log(`gen ${number}`);
} while (!this.isNumberCorrect(number));
return number;
},
isNumberCorrect(number) {
if (!Array.i... | true |
cbb0ba98dc10241eb8c2ad31780b04a7b60cd049 | JavaScript | iashupal/mckinley_projects | /lawFirm/src/components/Table/TableUtils.js | UTF-8 | 8,133 | 2.5625 | 3 | [] | no_license | import React from 'react';
import { R, RU } from 'helpers/ramda';
import Button from '../Button';
const { yearMonthDay } = RU;
export const IconButton = () => {
return (
<>
<Button size="square" icon="access_time" color="warning" />
<Button size="square" icon="border_color" color="success" />
... | true |
832069d9e9e84393a48ddde2b19d46396c9d9273 | JavaScript | stopcharla/CurrencyExchanger | /test/controllers/currency-controller-test.js | UTF-8 | 3,137 | 2.609375 | 3 | [] | no_license | const expect = require('chai').expect;
const Big = require('big-js');
const currencyCtrl = require('../../src/controllers').getCurrencyController;
const sampleResponse = {
date: '2018-12-08',
rates: [{ currency: 'USD', rate: new Big(1.1843) },
{ currency: 'EUR', rate: new Big(1) },
{ currency: 'JPY', r... | true |
a2c2592e55803106e2e30097681161552c14e5e6 | JavaScript | Slyph66/Functions | /封装函数.js | UTF-8 | 1,215 | 3.390625 | 3 | [] | no_license | //寻找elem的兄弟子元素//
function next(elem) {
do{ elem = elem.nextSibling ;
} while (elem && elem.nodeType !== 1) ;
return elem;
}
//寻找elem的第一个子元素//
function firstChild(elem) {
elem = elem.firstChild ;
return elem.nodeType === 1?elem : next(elem) ;
}
//解决绑定事件兼容性问题//
function addEvent(elem , type , handler) {
... | true |
30b4731f445ac833dd7323f38a1e8d8d7f75a3ba | JavaScript | vallabmandeep/fullstack-developer | /JS/constructor.js | UTF-8 | 1,947 | 3.578125 | 4 | [] | no_license | function movie(name,type,rating){
this.name=name;
this.type=type;
this.rating=rating;
}
let m = new movie("phokron",'bio',7.5);
let v = new movie('ratsason','fiction',8.0);
console.log(m);
// function properties
console.log(m.constructor);
console.log(movie.prototype);
console.log(movie.length);
movie.pr... | true |
289b78a1c81d34eb66ae7ada8225dfabc74a6ae4 | JavaScript | jongallucci/CISC322-Feature-Implementation | /popup/popup.js | UTF-8 | 807 | 2.625 | 3 | [] | no_license | // popup javascript
document.addEventListener("DOMContentLoaded", function(e) {
var f = document.getElementsByTagName('input');
console.log(f);
var fs = Array.prototype.slice.call(f);
console.log(fs);
for (var i = 0; i < fs.length; i++) {
fs[i].addEventListener('click', function(e) {
clickCheckbox... | true |
d8d166f08ee0358d2ffbc96260de186b09f68a06 | JavaScript | bash-of-the-wild/js_exercises | /examples_from_cheatsheet.js | UTF-8 | 249 | 3.84375 | 4 | [] | no_license | // var i = 0;
// while (i < 10) {
// console.log(i);
// i++;
// }
for(var i = 0; i < 50; i++) {
console.log(i);
}
// var x;
// function doSomething() {
// x = "Zebra";
// }
// doSomething();
// console.log(x); // x is "Zebra"
| true |
c3ac400c5e3d63732784dee98e41bda7669616a6 | JavaScript | Akhmedova-creator/Farzona | /spring_auth/src/main/resources/static/js/error.js | UTF-8 | 339 | 2.625 | 3 | [] | no_license | $(window).on("error", function(evt) {
console.log("jQuery error event:", evt);
var e = evt.originalEvent; // get the javascript event
console.log("original event:", e);
if (e.message) {
alert(e.message);
} else {
alert("Error:\n\t" + e.type + "\nElement:\n\t" + (e.srcElement || e.ta... | true |
ff75d89aa93460d167bebdd475fc06089a9d22ac | JavaScript | 9andresc/eloquent-javascript-3rd | /chapter-6/exercise-3.js | UTF-8 | 961 | 4.03125 | 4 | [] | no_license | // Iterable groups
class Group {
constructor() {
this.group = []
}
has(value) {
return this.group.includes(value)
}
add(value) {
if (!this.has(value)) this.group.push(value)
}
delete(value) {
this.group = this.group.filter(v => v !== value)
}
get(index) {
return this.group[ind... | true |
95c4ae3c598971e360fe53fc94aeea1de8d528cd | JavaScript | Hotteock3388/node-School | /Chap03/02.dramaServer.js | UTF-8 | 2,942 | 3.375 | 3 | [] | no_license | var http = require('http');
var querystring = require('querystring');
// 드라마 목록
var dramaList = [
{title: '나의 아저씨', actor: '아이유, 이선균'},
{title: '미스터 션샤인', actor: '김태리, 이병헌'}
]
// //#region 1. get 방식 처리
// var url = require('url');
// var server = http.createServer(function(req, res){
// console.log('r... | true |
f6784877342e150e1a0b0a6fcdd39baa669cd811 | JavaScript | Maheshkumar-novice/Etch-A-Sketch | /script.js | UTF-8 | 4,363 | 3.125 | 3 | [] | no_license | // ========
// Pixels - start - Pixel - Each Square in the grid
// ========
let pixelContainer = document.querySelector(".grid-container");
let slider = document.querySelector(".slider");
let pixelDimension = 50;
let noOfpixels;
let pixelBoxes;
// Create Initial Grid with Pixels of Dimension 50
createGrid(pixelDimensi... | true |
b99235676fbbc179f882cb912aadb4b7ca1065dc | JavaScript | juzen2003/Practice-JS | /binary search/69_sqrt.js | UTF-8 | 373 | 3.59375 | 4 | [] | no_license | /**
* @param {number} x
* @return {number}
*/
var mySqrt = function(x) {
let low = 0;
let high = Number.MAX_SAFE_INTEGER;
while(low <= high) {
let mid = parseInt((low + high) / 2);
if(mid > x / mid) {
high = mid - 1;
} else {
if((mid + 1) > x / (mid + 1)) {
return mid;
... | true |
2f5240401e006dcd53b37e505a60807e4af03d7e | JavaScript | benjamin-t-wilson/read-write-react-redux | /src/App.js | UTF-8 | 15,736 | 2.75 | 3 | [] | no_license | import React from "react";
import "./App.scss";
function App() {
return (
<section className="App">
<header>
<h1>Read & Write React-Redux</h1>
<p>Hello and welcome to my small fraction of the internet!</p>
<p>
The purpose of this quick web app is partially for me to rememb... | true |
04dbbd508d766996651a692e2e2a665398be361e | JavaScript | TomPrete/senior-enrichment | /app/reducers/campuses.js | UTF-8 | 2,052 | 2.984375 | 3 | [] | no_license | import axios from 'axios';
//ACTIONS
const GET_CAMPUSES = 'GET_CAMPUSES';
const REMOVE_CAMPUS = 'REMOVE_CAMPUS';
const CREATE_CAMPUS = 'CREATE_CAMPUS';
const UPDATE_CAMPUS = 'UPDATE_CAMPUS';
//ACTION CREATORS
const getCampuses = (campuses) => {
return {
type: GET_CAMPUSES,
campuses
}
}
const remove... | true |
492eb1238a58c1abdc33312e651b6bb8fcafb572 | JavaScript | elvz/FL-12 | /FL12_HW8/homework/js/countNumbers.js | UTF-8 | 478 | 3.421875 | 3 | [] | no_license | function countNumbers(string) {
let tmpStr = string.replace(/[^+\d]/g, '');
let tmpArr = [];
for (let s of tmpStr) {
tmpArr.push(s);
}
tmpArr.sort((a, b) => {
return a - b;
});
let count = {};
tmpArr.forEach(function(i) {
count[i] = (count[i] || 0) + 1;
});
return co... | true |
329a1d6ba48ddb287b5416c8d4ec47540ce42a39 | JavaScript | SajiburMunna/first_project | /javascript.js | UTF-8 | 1,139 | 3.796875 | 4 | [] | no_license | // // // // console.log(087);
// // // // console.log("sajiburmunna");
// // // // var m=10;
// // // // var n=12;
// // // // var c=m+n;
// // // // console.log(c);
// // // // console.log(typeof n);
// // // console.log(undefined == null);
// // // var age =18;
// // // if (age =>18){
// // // console.log('Yes... | true |
7bd9feb4aca9b2c4cacf6cedd83a3f6baa89b9cc | JavaScript | sbrew/cohort4 | /03-objects/src/scripts/index.js | UTF-8 | 3,220 | 2.765625 | 3 | [] | no_license | import ooStuff from './account.js';
import functions from './DOM.js';
let AccountController = new ooStuff.AccountController();
let i = 0;
window.addEventListener('click', function (event) {
console.log(event.target);
});
createAccount.addEventListener('click', function () {
if (accountName.value.length > 0 &... | true |
28b160a571a149f7004342b655c25af5f3e13988 | JavaScript | clindsey/screeps-scripts | /dist/entity.spawn.js | UTF-8 | 2,623 | 2.640625 | 3 | [] | no_license | const spawnStates = require('states.spawn');
const StateMachine = require('StateMachine');
const defaultCreepBody = [WORK, WORK, CARRY, MOVE, MOVE];
const baseEnergy = 350;
const harvesterPopulationSize = 2;
const upgraderPopulationSize = 2;
const builderPopulationSize = 2;
class SpawnEntity extends StateMachine {
... | true |