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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
e52e7d399720cf348181a41ff33f189966e61f80 | JavaScript | AivisReinholds/AivisReinholds.github.io | /3D_animation/sketch.js | UTF-8 | 558 | 2.640625 | 3 | [] | no_license | let r = 1;
let img;
let box1;
let size = 20;
function setup(){
createCanvas(windowWidth, windowHeight,WEBGL);
img = loadImage("https://images2.minutemediacdn.com/image/upload/c_crop,h_2367,w_4209,x_0,y_0/f_auto,q_auto,w_1100/v1554989622/shape/mentalfloss/527175-istock-514622028.jpg");
box1 = new Cube(size);
}
f... | true |
418649f924530e8adc1f31e1c99582212d14fb10 | JavaScript | bgoonz/UsefulResourceRepo2.0 | /MY_REPOS/bash-commands-walkthrough/steps/3-clean-up-fluf/DS-ALGO-OFFICIAL-master/CONTENT/DS-n-Algos/SANDBOX/shuffle-an-array.js | UTF-8 | 1,050 | 3.671875 | 4 | [
"CC-BY-NC-SA-4.0",
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | // Source : https://leetcode.com/problems/shuffle-an-array/
// Author : Bryan Guner
/**
* @param {number[]} nums
*/
var Solution = function (nums) {
this.nums = nums;
};
/**
* Resets the array to its original configuration and return it.
* @return {number[]}
*/
Solution.prototype.reset = function () {
return... | true |
b178d3e3f9a75b31efab1c4c0e82d8739941cc42 | JavaScript | vladimirkroupa/MI-NUR | /xforms/src/main/js/ui/sortIndicator.js | UTF-8 | 946 | 2.671875 | 3 | [] | no_license | //TODO remove
function SortIndicator (jQuery, jSortContainer) {
this.jQ = jQuery;
this.jSortContainer = jSortContainer;
}
SortIndicator.prototype.setOn = function () {
this.getOnRadioJ().prop("checked", true);
this.getOffRadioJ().prop("checked", false);
};
SortIndicator.prototype.setOff = function ()... | true |
231d323498edbbc1d32a8dfd7455bcf321569fa0 | JavaScript | mperceval/qbe-sales-tax | /src/server/services/calc-tax.js | UTF-8 | 696 | 2.953125 | 3 | [] | no_license |
const isMedicine = ({ info }) => info.medicine;
const isBook = ({ info }) => info.book;
const isFood = ({ info }) => info.food;
const isImported = ({ info }) => info.imported;
const calculateTax = (rate, preTaxPrice) => (rate * Number(preTaxPrice)) / 100;
export const calculateTaxPayableForProduct = (product) => {
... | true |
7c81eaa955ea8d10e6fedc7c93c1eefb9ee8f0ae | JavaScript | frenby52/Avito-Safedeal-Test-assignment | /src/models/card.js | UTF-8 | 409 | 2.6875 | 3 | [] | no_license | export default class Card {
constructor(data) {
this.id = data[`id`] || ``;
this.url = data[`url`] || ``;
this.comments = data[`comments`] || [];
}
toRAW() {
return {
'id': this.id,
'url': this.url,
'comments': this.comments
};
}
static parseCard(data) {
return new... | true |
0d4ce5580c13b828437646aa026447254eb710f0 | JavaScript | gnavas/dom_lab | /app.js | UTF-8 | 1,251 | 3.203125 | 3 | [] | no_license | window.addEventListener("load",function(){
//1. change the greeting from "Hello, World!" to "Hello, Planet Earth!".//
var greetingF = document.getElementById("greeting");
greetingF.innerHTML = "Hello, Planet Earth!";
console.log(greetingF);
//2. set the `backgroundColor` of each `<li>` to `yellow`.//
var colorY = docu... | true |
d513ac4d9285c34c3e215bb629c8de37aa1425d2 | JavaScript | McKlobasa/delujoca-kosarka | /app/components/ExpressTest.js | UTF-8 | 633 | 2.734375 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
class App extends Component {
state = {
data: null
};
componentDidMount() {
this.callBackendAPI()
.then(res => this.setState({ data: res.express }))
.catch(err => console.log(err));
}
callBackendAPI = async () => {
const response = await fetch(... | true |
981816fe706a241f21651994440cad23171c58d5 | JavaScript | adinfinit/diy-visuals | /06_examples/ld39/src.js | UTF-8 | 9,385 | 3.0625 | 3 | [
"Unlicense"
] | permissive | "use strict";
const canvas = document.getElementById('view'),
/** @type {CanvasRenderingContext2D} */
context = canvas.getContext("2d");
const TAU = Math.PI * 2;
const PHI = 1.61803398874989484820;
let Time = 0.0;
const Scale = 10.0;
function Vector(x, y) {
this.X = +x || 0.0;
this.Y = +y || 0.0;
}
... | true |
47b4762575f184fe657cd147afd1c4c70626e8ba | JavaScript | RookiePrime/tech-blog | /controllers/api/user-routes.js | UTF-8 | 3,638 | 2.609375 | 3 | [
"MIT"
] | permissive | const router = require('express').Router();
const { User } = require('../../models');
// Get all users
router.get('/', (req, res) => {
User.findAll({
attributes: { exclude: ['password'] }
})
.then(dbUserData => res.json(dbUserData))
.catch(err => {
console.log(err);
... | true |
fd3e49adb8c53ccbb395e68510efe3c8f1cf26ed | JavaScript | S3len3Ch4vz/JavaScript | /Sesion_11/Js/script.js | UTF-8 | 4,607 | 4.46875 | 4 | [] | no_license | /* ------------------------- Funciones Constructoras ------------------------ */
//es la versión de JavaScript de una clase.
const person = {
name:'Yo',
apellido: 'Soy'
}
/*En buenas practicas para las funciones constructoras se utiliza
mayuscula al incio del nombre de la función*/
function Persona (name,lastn... | true |
d7f821b6ba75d26fdd7bb0e6275a22cc05634ce9 | JavaScript | human-money/human-money-wallet | /web/static/js/request.js | UTF-8 | 441 | 2.515625 | 3 | [] | no_license | import store from 'store';
import { receiveErrors } from './actionsCreators';
function parseJSON(response){
return response.json().then(json => {
if(response.ok) {
return json
} else {
return Promise.reject(json);
}
});
}
function onError(error) {
store.dispatch(receiveErrors(error));
}
... | true |
a96cd3ac6d6bdd9c01b3165e981deaea2323f304 | JavaScript | matiasjgoitea/simple-react-app | /src/api.js | UTF-8 | 754 | 3.015625 | 3 | [] | no_license | export const getItems = () => (
new Promise(resolve => {
resolve(JSON.parse(localStorage.getItem('marketList')) || [])
})
)
export const addItem = str => (
new Promise((resolve, reject) => {
if(!str) reject(new Error('You need to pass a valid string to add an item'))
getItems().then(items => {
... | true |
a6c4e45659a353852f0470d61e693df60cf6374e | JavaScript | warptrail/day-04-array-methods | /app.js | UTF-8 | 3,563 | 4.15625 | 4 | [] | no_license | 'use strict';
// forEach
let animals = [
{species: 'Hog', weight: 204 },
{species: 'Moose', weight: 620 },
{species: 'Goose', weight: 9 },
{species: 'Raccoon', weight: 12 }
];
for (let i = 0; i < animals.length; i++) {
console.log(`${animals[i].species}`);
}
animals.forEach(function (animal) {
console.l... | true |
7175a5925050123cf0c419d018e79f162818db51 | JavaScript | ArielMoi/Appleseeds-Bootcamp | /React Exercises/Exercises/src/all exercises/19.4-refactor_chack_norris.js | UTF-8 | 1,376 | 2.9375 | 3 | [] | no_license | import axios from "axios";
import React, { useState, useEffect } from "react";
import ReactDOM from "react-dom";
import "./index.css";
function OptionsBoard(props) {
const [options, setOptions] = useState("");
useEffect(async () => {
const { data } = await axios.get(
"https://api.chucknorris.io/jokes/ca... | true |
3360c7d5b69fa4182850a0b7af83c6a7b368477a | JavaScript | NikhilVerma/k-means-workshop | /image-example/index.js | UTF-8 | 745 | 2.71875 | 3 | [
"MIT"
] | permissive | import getPixelsFromSrc from './get-pixels-from-src';
import getImageClusters from './get-image-clusters';
import './index.css';
import '../index.css';
const imageSrc = require('../images/example1.webp');
document.querySelector('.sample-image').src = imageSrc;
getPixelsFromSrc(imageSrc, pixels => {
const cluster... | true |
6479c52bb027c783bda1a21d81360b8e280affa2 | JavaScript | openpipekit/opk-cli--fido | /push | UTF-8 | 4,664 | 2.796875 | 3 | [] | no_license | #!/usr/bin/env node
/*
* This cli places a file in your home directory named `~/.fido-<name>`, where `<name>` is the value you give to the `name` option.
*
* This file is crucial for maintaining state of the CLI between start and stops.
* Understanding the file:
* File with a value means the program has started ... | true |
95a556e50d90e55f8b09b26fb2b95fc25f48a02a | JavaScript | nanoutils/nanoutils | /lib/path/path.js | UTF-8 | 167 | 2.515625 | 3 | [
"MIT"
] | permissive | export default (arr, obj) => {
var value = obj
for (var i = 0; i < arr.length; i++) {
if (value == null) return
value = value[arr[i]]
}
return value
}
| true |
35ee1398e82818b7044bdaf7ecb25cf0f3284e79 | JavaScript | arakitakashi/2021-9_high-speed-light-trail | /src/classes/CarLights.js | UTF-8 | 2,959 | 2.59375 | 3 | [] | no_license | import * as THREE from "three";
import fragmentShader from '../shaders/Light/fragmentShader.glsl'
import vertexShader from '../shaders/Light/vertexShader.glsl'
export default class CarLights {
constructor() {
this.bind()
}
init(scene, options, color, speed) {
this.scene = scene
this.color = c... | true |
9532de956f5b14390093c84c457f76c9603156df | JavaScript | amanuelMecha/cs301 | /lesson2/relational_operators.js | UTF-8 | 408 | 3.328125 | 3 | [] | no_license | let foo = 5;
let bar = "five";
let x = "5";
console.log(foo<7); // true
console.log(foo<=5); // true
console.log(foo>5); // false
console.log(foo>=5); // true
console.log(foo==x); // true
console.log(foo==bar); // false
console.log(foo===x); // false
console.log(bar < "f... | true |
65bcbd41ebec9201016a11399ea7c7a76f2b6b2d | JavaScript | mosterbox/mosterbox.github.io | /js/script.js | UTF-8 | 1,585 | 3.671875 | 4 | [] | no_license | function templ() {
let exer = document.getElementById('exe');
let first = Math.floor(Math.random()*10);
let second = Math.floor(Math.random()*10);
if(!first) first = Math.floor(Math.random()*10);
if(!second) second = Math.floor(Math.random()*10);
exer.innerHTML = `${first}*${second}`;
localStorage.setIte... | true |
4d79bd307c9805e0406df3b78adf385fd5ef7a41 | JavaScript | terrybrown/learnyounode | /learnyounode/11.js | UTF-8 | 647 | 2.5625 | 3 | [] | no_license | (function () {
'use strict';
var http = require('http');
var fs = require('fs');
var server = http.createServer(function (request, response) {
response.writeHead(200, { 'Content-Type': "text/plain" });
//fs.readFile(process.argv[3], function (err, data) {
// if (err) {
... | true |
3202e44b2e4fbe2d7b934c7a0dd248ada1b20364 | JavaScript | EstibalizFernandez/lab-javascript-all-times-movies | /starter_code/src/movies.js | UTF-8 | 3,250 | 3.75 | 4 | [] | no_license | //Ejercicio 1
function turnHoursToMinutes(movies) {
var allMinutes = movies.map(function(movie) {
movie = Object.assign({}, movie);
var durationSplit = movie.duration.split(' ');
var hoursToMin = 0;
var newMin = 0;
if (durationSplit[0].indexOf("h") !=-1){
hoursToMin = Number(durationSplit... | true |
95fdaa39a774858aefe4623cfe25cca7e34e3a71 | JavaScript | pronebel/funclib.js | /test/function.spec.js | UTF-8 | 898 | 2.828125 | 3 | [
"MIT"
] | permissive | describe('Function Methods:', function () {
describe('#debounce()', function () {
it.skip(`fn.debounce(200,function(){return true}) should return true`, function (done) {
let num = 0
fn.interval('debunce', 20, function () {
fn.debounce(500, function () {
num++;
assert(num =... | true |
0de6b6e00933327c37de87b438b0b25c6705ed64 | JavaScript | lightster/nodeschool | /promise-it-wont-hurt/08_an_important_rule.js | UTF-8 | 521 | 3.21875 | 3 | [] | no_license | 'use strict';
var q = require('q');
function throwMyGod() {
throw new Error('OH NOES');
}
function iterate(argument) {
console.log(argument);
return argument + 1;
}
var count = 1;
q.fcall(iterate, count)
.then(iterate, count)
.then(iterate, count)
.then(iterate, count)
.then(iterate, co... | true |
a43ac5ca5a76e5ef3e624ad09d7e35c683e4d918 | JavaScript | vvvb-github/- | /js/renderer.js | UTF-8 | 1,913 | 2.71875 | 3 | [] | no_license | // This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
const ipcRenderer = require('electron').ipcRenderer
const {dialog} = require('electron').remote
const fs = require("fs");
class Renderer {
cons... | true |
9755e3d38ca852b8101554494ba0ac76e7318852 | JavaScript | danilexx/Stormy2.0 | /src/js/components/sobre.js | UTF-8 | 749 | 2.734375 | 3 | [] | no_license | let btns = document.querySelectorAll(".tab")
const changeSelected=(index)=>{
console.log(index)
setTranslate(`${index}00%`);
setColor(index, "white")
}
const setTranslate=(value)=>{
document.querySelectorAll('.btn-switcher, .txt-content').forEach(e=>{
e.style.setProperty('--translateX',... | true |
e2b93550392e8390774e69952a71f8a33996d239 | JavaScript | robyafrizal/learn-express | /controllers/movies.js | UTF-8 | 1,329 | 2.703125 | 3 | [] | no_license | let { movies } = require("../models/movies");
module.exports = {
getMovies: (req, res) => {
res.status(200).send(movies);
},
getMoviesById: (req, res) => {
const idParams = req.params.id;
const movie = movies.find(data => data.id == idParams);
res.send(movie);
},
postMovies: (req, res) => {
... | true |
280ed2f280dfd7e7b9e4831a4608402b6450357f | JavaScript | Eshankuthu/Moder-Web-Application-Assignment | /day3/homework/express/index.js | UTF-8 | 963 | 2.5625 | 3 | [] | no_license | const express = require("express");
const app = express();
const path = require("path");
const fetch = require('node-fetch');
app.set("env", "development");
app.set("view engine", "ejs");
app.set("x-powered-by", false);
app.enable("case sensitive routing");
app.set("trust proxy", true);
app.set("views", path.join(__... | true |
6eade45fcaa3dd8bb67af99ab43abb980dcb23b0 | JavaScript | hi-manshu-kumar/Nodejs-Revision | /4-Asynch nodejs (weather app)/weather app/playground/promise.js | UTF-8 | 239 | 3.03125 | 3 | [] | no_license | var somePromise = new Promise( (resolve, reject) => {
resolve("hey. It worked");
reject("unable to fulfill");
});
somePromise.then( (data) => {
console.log('success', data);
}, (data ) => {
console.log('Error' ,data);
});
| true |
b485d1ca380071623ae5f8e0da37bcbb0318d4cf | JavaScript | CarlaCrandall/React-Calendar | /src/js/components/event.jsx | UTF-8 | 3,434 | 3.03125 | 3 | [
"MIT"
] | permissive | import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
/**
* Event
* Description: Displays the information for a single event.
* @prop {object} data - Contains the required information for the event, including the start time, end time, name, and location
*/
export default clas... | true |
d5d7c3b46219d8d26e08bb5cfbc2ebb3633acb8d | JavaScript | EmilioLucena/HJ-frontend | /src/components/StageCard.jsx | UTF-8 | 1,291 | 2.671875 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import getData from "../services/useAPI";
import ReactCardFlip from "react-card-flip";
import CardFrontSide from "./CardFrontSide";
import CardBackSide from "./CardBackSide";
import "./StageCard.css";
const logo = "logo.png";
export default function StageCard({ st... | true |
42595242d59b175b13bc5ef45f34a2d4b7729ecc | JavaScript | zhangfengjin258/mmmApp | /my mmmAPP/js/common.js | UTF-8 | 515 | 3.265625 | 3 | [] | no_license | function getLocation(k) {
// 获取地址栏参数
var str = location.search;
// 解码
str = decodeURI( str );
// 切割去除?[slice切割字符串]
str = str.slice( 1 );
console.log(str);
// 将字符串分割为数组【split()】
var arr = str.split('&');
var obj = {};
// 遍历数组获取键值
arr.forEach(function(v,i) {
... | true |
6cfb84fa90866d2865f0f92f4594e3576fef8e17 | JavaScript | klaurtar/Speaker-Hover-Box | /minified.js | UTF-8 | 4,060 | 2.6875 | 3 | [] | no_license | <script type="text/javascript">
const GenieList = [
{
name: 'Ben Price',
imageUrl: 'https://geniecast.com/wp-content/uploads/2017/10/ben-price.jpg',
genieInfoUrl: 'https://geniecast.com/genie/?genies=3428',
},
{
name: 'Johnny Cupcakes',
imageUrl:
'https://geniecast.com/wp-content/upload... | true |
c4bbd2c510aaeddfffeaae42f7732645161f5175 | JavaScript | PolinaKoziarchuk/Calculator | /js/js_01.js | UTF-8 | 114 | 3.203125 | 3 | [] | no_license | let a = prompt("Please enter a");
let b = prompt("Please enter b");
let c = parseInt(a) + parseInt(b);
alert(c);
| true |
6f088f3a7842eb4d2071cda6f72a7066d77b52e8 | JavaScript | muleforge/iBeans | /ref-implementation/examples/facebook-web/src/main/webapp/utils.js | UTF-8 | 4,818 | 2.828125 | 3 | [] | no_license | function getCookie(c_name) {
if (document.cookie.length > 0) {
c_start = document.cookie.indexOf(c_name + "=");
if (c_start != -1) {
c_start = c_start + c_name.length + 1;
c_end = document.cookie.indexOf(";", c_start);
if (c_end == -1)
c_end = document.cookie.length;
return unescape(document.cookie... | true |
51e1f2ce1407f45d052615e9c272b2caf7d7db54 | JavaScript | JakeKahana/ialwayswantedtobe | /server/server.js | UTF-8 | 1,075 | 3.421875 | 3 | [] | no_license | //create an array of objects
//create empty array
//structure data with Title, description as keys
// var alljobs = [
// { "title": "Doctor",
// "description": "My mom was a doctor"
// },
// { "title": "Barbie",
// "description": "Ken. Obviously."
// }
// ]
//function to populate Demodata
//go through eac... | true |
b043e257020fcb254367c30f2eadf0c418628061 | JavaScript | jevanty/Ajax | /movieSearch/showmovie.js | UTF-8 | 892 | 3.078125 | 3 | [] | no_license | let url = new URLSearchParams(window.location.search);
console.log(window.location.search);
url = url.get('id');
const showMovie = (e) => {
fetch(`http://www.omdbapi.com/?apikey=a49f54f4&i=${url}`)
.then(response => response.json())
.then(parsedData => afficheTonFilm(parsedData));
};
const af... | true |
8b568007c943a22f19c053c2d2993682496fa45b | JavaScript | davidleecodes/Redux-Exercise | /mood.js | UTF-8 | 259 | 2.734375 | 3 | [] | no_license | function setMood(e) {
store.dispatch({ type: "setface", payload: e.target.value });
const mood = store.getState().mood;
$("#emoji").text(mood);
}
$("button").on("click", setMood);
window.onload = function () {
$($("button")[0]).trigger("click");
};
| true |
167e45cc0dfe1bbd8bd472486e01a7048f4236de | JavaScript | mishahrokhola/onetime-pay-video | /js/index.js | UTF-8 | 601 | 2.875 | 3 | [] | no_license | /** JS */
const isPlayedKey = "is-played-2";
const isPlayed = Boolean(localStorage.getItem(isPlayedKey));
window.addEventListener("load", () => {
const video = document.querySelector("video");
const btnPlay = document.querySelector(".btn-play");
document.addEventListener("contextmenu", event => event.preventDef... | true |
0f74feb455b4e7a5ca77301925cf42081aa37aa1 | JavaScript | winner07/json-search | /js/main.js | UTF-8 | 2,777 | 3.265625 | 3 | [] | no_license | /*
* Search objects in JSON file by search request
*
* @param {string} jsonurl
*/
function jsonSearch(jsonurl){
var jsonObjects;
return {
search : function(value, callback){
// Expect words for search
var expectWords = value.replace(/"/g, "").split(/\s+/);
// Except words not for search
var except... | true |
5cd895a556a108b1ffdcae090a9018c5534485ba | JavaScript | hoangvuHY/React | /bai22_lifecycle/src/App.js | UTF-8 | 1,220 | 2.609375 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import Props from './Props';
class App extends Component {
constructor(props) {
super(props);
this.state = {
trangthai: "Khoi tao",
trangthai2: "Khoi tao 2"
}
}
componentWillMount() {
console.log('componentWillMount Đang... | true |
d8ba6659d65fd89bd80692bc04d67abbae2c1c3c | JavaScript | darocha/handsfree | /src/calculations/Z.js | UTF-8 | 1,725 | 3.078125 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* calculations/XY.js
*
* 🧙 CAUTION HERO, FOR 🐉 HERE BE DRAGONS 🐉
* !!! The following code works by pure coincidence, please help improve it !!!
*
* Contains methods for calculating different the X/Y position on screen
*
* @NOTE The following pose keypoint indexes mean the following: (@SEE https://github.... | true |
33cad2a59832dc06f4259e400f6e0df9e9ee81b5 | JavaScript | Danimal-63/ClaysFunGame | /JellyBeans.js | UTF-8 | 1,191 | 3.140625 | 3 | [] | no_license | var jellyBeanPic = new Image();
jellyBeanPic.src='Sounds/jellyBean.png';
function addJellyBean (x,y)
{
GAME.jellyBean.push(new JellyBean(x,y));
}
function JellyBean (x,y){
this.x = x;
this.y = y;
}
jellyBeanAddTimer = 30;
function RenderJellyBeans(context){
if(GAME.over==true)return;
else{
context.fi... | true |
72b8455e5ff6ef5b7ebe34caacce72cc56af4337 | JavaScript | dpollak44/class | /javascript/76/ant.js | UTF-8 | 3,279 | 3.203125 | 3 | [] | no_license | (function () {
'use strict';
const canvas = document.getElementById('theCanvas');
const context = canvas.getContext('2d');
const ANT_SIZE = 2;
function resizeCanvas() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
}
resizeCanvas();
window.addEv... | true |
61f527ff91f41885ab7d5c848f37c9ac407b471e | JavaScript | larasantos8/women-can-code | /aula6/twitter-clone/appTweets.js | UTF-8 | 696 | 3.40625 | 3 | [] | no_license | // instancio a classe de noticias e crio o objeto de noticias
const objetoTweets = new Tweets()
// instancio a classe Card e crio o objeto dos Cards
const objetoCardTweets= new CardTweets()
// aqui rola a ~mágica~
// uso meu objetoNoticia e chamo o método buscaNoticia que
// existe dentro de noticas para dar o fetch... | true |
afbf3422849d3524bb68e1f4af86b39a3ff044ba | JavaScript | wayne214/typescriptDemo | /interfaces.js | UTF-8 | 356 | 3.328125 | 3 | [] | no_license | // 实现接口
var customer = {
firstName: 'Tom',
lastName: 'hanks',
sayHi: function () { return 'Hi, tom'; }
};
console.log('customer对象');
console.log(customer.firstName);
var drummer = {
age: 12,
instrument: 'drums',
};
var drummer1 = {};
drummer1.age = 18;
drummer1.instrument = 'll';
console.log('drumme... | true |
194bc6c052c4dcde94bfd39ba102d700c7f9573f | JavaScript | 13aer/GreyGooseCLI | /lib/frontend/menus/edit/select.js | UTF-8 | 6,199 | 2.765625 | 3 | [
"ISC"
] | permissive | const collector = require('../../../data/interface')
module.exports = {
run: function (slug) {
initialize(collector.getStructureObject(slug));
}
}
// MODELS
const Termin = require('../../../data/structure/models/Termin')
// ENQUIRER & INQUIRER
const {Select} = require('enquirer');
const {Input} = requ... | true |
b0dafb52ccd9bed2620e6c25b10208871e3a099e | JavaScript | shubham860/Nodejs_Basics | /Sec7-expressApi-mongoDB(mongoose)/controllers/WithoutErrorHandledTourController.js | UTF-8 | 4,986 | 2.734375 | 3 | [] | no_license | const Tour = require('../models/tourModels');
const APIFeatures = require("../utils/ApiFeatures");
// Middleware for top 5 cheap tours
exports.aliasTopTour = (req, res, next) => {
req.query.limit = '5';
req.query.sort = '-ratingsAverage,price'
next();
}
// get All tours refactored
exports.getAllTours = a... | true |
84ba8e51b5b85054fa1d5bbcdeba6adef0fe57ab | JavaScript | redeyed-archive/TTRPG-Battlemap | /src/Components/Grid/Grid.js | UTF-8 | 2,896 | 3.15625 | 3 | [
"MIT"
] | permissive | import React, { useMemo, useContext } from "react";
import "./Grid.css";
import Tile from "../Tile/Tile";
import Character from "../Character/Character";
import Resizer from "../Resizer/Resizer";
import { GameContext } from "../../State/Context.js";
function Grid() {
//Gets state from context
const { state } = use... | true |
30580c7175dd4211879840c6a3f2da989d4c8cb8 | JavaScript | fauziacharuna/pos_expres_react | /backend/controller/Item.js | UTF-8 | 2,264 | 2.8125 | 3 | [] | no_license | // Import model Item
import Item from "../models/Item.js";
// Get semua product
export const getItems = async (req, res) => {
console.log(res.data);
try {
const item = await Item.findAll();
res.status(200).json({
success: true,
data: item,
message: "Get All It... | true |
2f7a6a05c2908a8fbdafa0378fca443591c35aa3 | JavaScript | Catrieona/love-triangle | /src/index.js | UTF-8 | 663 | 3.03125 | 3 | [
"MIT"
] | permissive | /**
* @param preferences - an array of integers. Indices of people, whom they love
* @returns number of love triangles
*/
module.exports = function getLoveTrianglesCount(preferences = []) {
let count=0
let arr=[""].concat(preferences)
for (i=0; i<arr.length; i++) {
if (isNaN(arr[i])) { continue
} els... | true |
3555b431e6fc85d0d685c0e869cc0992989331d4 | JavaScript | AaronStarrett/GitbookEducation | /Class challenge/jsFundies.js | UTF-8 | 1,382 | 3.8125 | 4 | [] | no_license | // sports = {
// contact: "football",
// sissySport: "soccer",
// };
// classmate = {
// firstName: "A-A-Ron",
// secondName: "MuFnStarrett"
// }
// function swap (obj, property1, property2) {
// let newObj = obj[property1]
// obj[property1] = obj[property2]
// obj[property2] = newObj
// };
// swap(... | true |
4eb5e8dafe97469d09550af2bad47242179ed1e8 | JavaScript | seemajune/space01 | /public/src/js/utils/storage.js | UTF-8 | 2,109 | 2.828125 | 3 | [] | no_license | /*
PWG.Storage.set({ currentLevel: 9, savedStatus: ["u","u","u","u","u","u","u","u","u","u"] });
PolyworksGame.currentLevel = 9;
*/
PWG.Storage = (function() {
var _listeners = [];
var storage = {
get: function(prop) {
if(_available) {
return localStorage[prop];
}
},
set: function(params) {
if(_a... | true |
a5d7ca284f1bf6002408919f9a73c662da630249 | JavaScript | E-Utils/e-utils | /src/intersection.js | UTF-8 | 597 | 2.953125 | 3 | [] | permissive | /**
* two of array to cross,
*
* @since 1.1.0;
* @category array;
* @author fl2294;
* @param firstArr {array} the first array incoming;
* @param secondArr {array} the second array incoming;
* @return {array};
* @create_date 2018/07/19;
* @modify_date 2018/07/19;
* @example
*
* intersection([1, 3, 5, 6], [8... | true |
66ad45021417e6cde61ee4ef8fac070eca3b388e | JavaScript | nge6427/tradesatoshi-js | /index.js | UTF-8 | 1,344 | 2.53125 | 3 | [
"MIT"
] | permissive | const crypto = require("crypto");
const request = require("request-promise-native");
var publicApiRequest = function (endpoint, params) {
let uri = "https://tradesatoshi.com/api/public/" + endpoint;
if(typeof params === 'object')
params = Object.entries(params).map(([key, val]) => `${key}=${val}`).join... | true |
dfdca8997652948e2dd12b164c7fed308d086d5d | JavaScript | iamsurajsingh/Blogs | /src/Components/NewBlogComponent.js | UTF-8 | 1,898 | 2.578125 | 3 | [] | no_license | import React, {useState}from "react";
import { useHistory } from "react-router";
import { useDispatch } from "react-redux";
import { createDataAction } from "../action/createDataAction";
import '../styles.css';
const NewBlogComponent = () => {
const dispatch = useDispatch();
const history = useHistory();
co... | true |
79281742430bc589befc99eabee6d4a0c9967a20 | JavaScript | shubham16598/Udacity-Frontend-Projects | /Project-02 Pics Art Maker(Upated Nanodegree Project)/designs.js | UTF-8 | 738 | 2.84375 | 3 | [] | no_license | // Select color input
// Select size input
$(document).ready(function () {
var table = $("#pixel_canvas");
$("#submit").on("click",function(){
table.find('*').remove();
$makeGrid();
$changeColor();
return false;
});
$makeGrid = function (){
var row = $("#input_height").val();
var ... | true |
09b9130cd3966617ac508c8878d0aefde044b2ec | JavaScript | prid/OSA | /input/js/fileUpload.js | UTF-8 | 1,572 | 2.515625 | 3 | [] | no_license | function handleFileUpload(file,parentFolder){
insertFile(file,afterUpload,parentFolder)
}
function afterUpload(param){
document.querySelector('#imageUploadContainer').setAttribute('data',JSON.stringify(param));
appendPre("File Uploaded");
}
function insertFile(fileData, callback,parentFolder) {
const bounda... | true |
78f326f04954a145f3d9d73f85c9f66eb5f10d99 | JavaScript | iaman0004/covid19trackerz | /public/serviceworker.js | UTF-8 | 803 | 2.578125 | 3 | [
"MIT"
] | permissive | const CACHE = 'CACHE';
const urlToCache = ['index.html', 'offline.html'];
var self = this;
self.addEventListener('install', e => {
e.waitUntil(
caches
.open(CACHE)
.then(cache => {
return cache.addAll(urlToCache);
})
.catch(err => console.log(err)),
);
});
self.addEventListener('f... | true |
ecff29671dc11b890d0013718fd697b0d1461906 | JavaScript | ach206/highline_cs_club | /js/index.js | UTF-8 | 1,419 | 2.9375 | 3 | [] | no_license | // Last Edited By: A. Camille Hall
// Created By: A. Camille Hall
// Date: 02.16.2019
// Filename: index.js
// shows or hides the drawer depending on the navIcon
$(".fa-bars").click(function(event){
$("#navLinks").attr("class", "showDrawer");
$(".menuLinks").attr("class", "showMenuLinks");
... | true |
b1d2dc888f0fcfb60d99e1f30993ca93231ef6b8 | JavaScript | Lunerr/Congress | /src/types/BillTypeReader.js | UTF-8 | 692 | 2.546875 | 3 | [
"MIT"
] | permissive | const patron = require('patron.js');
const bills = require('../singletons/bills.js');
class BillTypeReader extends patron.TypeReader {
constructor() {
super({
type: 'bill'
});
}
async read(command, message, argument, args, input) {
const parsed = parseInt(input);
if (Number.isNaN(parsed))... | true |
5803e10e10e2715320700a707848c1f7026642bc | JavaScript | nathalav/cewp-339-winter-2021-code | /class3/create_table.js | UTF-8 | 727 | 2.765625 | 3 | [] | no_license |
var myTableDiv = document.getElementById("myDynamicTable");
var table = document.createElement('TABLE');
table.border='1';
var tableBody = document.createElement('TBODY');
table.appendChild(tableBody);
for (var i=1; i<=10; i++){
var tr = document.createElement('TR');
... | true |
97acd82f97e2abdc155d4fd9546c1dfa88b5bfcc | JavaScript | codejie/poplar-logger | /lib/placeholder.js | UTF-8 | 275 | 2.53125 | 3 | [] | no_license | 'use strict'
class Placeholder {
constructor (format, args) {
this.format = format;
this.args = args;
}
output () {
return {
format: this.format,
args: this.args
};
}
}
module.exports = Placeholder; | true |
c9bd58749ec260ac06fd7792b45589cd2d0ae319 | JavaScript | 1985-Michael/Notetaker.github.io | /server.js | UTF-8 | 2,648 | 2.546875 | 3 | [] | no_license | const path = require("path");
const express = require("express");
const fs = require("fs");
const app = express();
const PORT = 3000;
const Directory = path.join(__dirname, "public");
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(express.static(path.join(__dirname, "public")));
a... | true |
25fc6181e07bca8555833e4c4452a88c6d939bca | JavaScript | joonseoan/getting-node.js-started | /app.js | UTF-8 | 1,072 | 3.078125 | 3 | [] | no_license | var express = require('express');
var app = express();
//it is a location of static file
//localhost/apiData.png
app.use(express.static('public'));
app.get('/', (req, res) => {
res.send("Hell, node.js"); // send something to the user.
}); //When the user access home "/", the functions executes.
app.use('/dynam... | true |
d65f0fdd5525e448af184f04aa2078b9c98a38ec | JavaScript | brianneisler/stutter | /src/lang/toNumber.test.js | UTF-8 | 598 | 2.875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | import toNumber from './toNumber'
describe('toNumber', () => {
test('converts number to itself', () => {
expect(toNumber(3.2)).toBe(3.2)
})
test('converts MIN_VALUE to 5e-324', () => {
expect(toNumber(Number.MIN_VALUE)).toBe(5e-324)
})
test('converts Infinity to Infinity', () => {
expect(toNumb... | true |
ea18578c0ce845e03c803adcdcb5db00a5204648 | JavaScript | AncientGear/prefix | /app/utils/prefix.js | UTF-8 | 1,926 | 3.359375 | 3 | [] | no_license | /**
* @description return the value of the operation
* based in the hierarchy
* @param {String} operator - it's the operator
* to evaluate
* @returns {Int} value based in the hierarchy
*/
function hierarchy(operator) {
let resp = 0;
if(operator.match(/^[\(|\)]$/)){
resp = 1;
}else if( operator... | true |
a578f06745ccdcbe7cf2617e628be4c94a601e3f | JavaScript | ManuelaScotto/superHeros | /src/component/Todo.js | UTF-8 | 1,007 | 2.6875 | 3 | [] | no_license | // CREO IL COMPONENTE TODO PER POTER GESTIRE I SINGOLI ELEMENTI
import React from 'react'
const Todo = props => {
console.log(props)
return (
<div className="todo" style={{ display: props.todo.remove ? 'none' : '' }}> {/* se remove è true cancella altrimenti non fare niente */}
<h3 style={... | true |
af6da33deb5b4c44b1833b88adeb94071f6eaa11 | JavaScript | Mark65537/guessnum | /index.js | UTF-8 | 1,789 | 2.90625 | 3 | [] | no_license | const express = require("express");
const bodyParser = require("body-parser");
const app = express();
const urlencodedParser = bodyParser.urlencoded({extended: false});
app.get("/", urlencodedParser,function(request, response){
response.sendFile(__dirname + "/main.html");
});
app.use("/game", functio... | true |
965d66a758098dcde57f50d7d728fac4c3355da7 | JavaScript | MankalMR/node-chat-app | /server/server.js | UTF-8 | 3,335 | 2.640625 | 3 | [] | no_license | const path = require('path');
const express = require('express');
const socketIO = require('socket.io');
const http = require('http');
const {isRealString} = require('./utils/validation');
const {Users} = require('./utils/users');
const publicPath = path.join(__dirname, '../public');
const app = express();
const port ... | true |
ae610bd5a716fb276e8639d1e6fc406b24c3e9fb | JavaScript | sharmajyo/LLD-samples | /ds-sample/strings/time-difference.js | UTF-8 | 1,030 | 3.1875 | 3 | [] | no_license | const toMinute = (t) => {
const a = t.split(":");
return (parseInt(a[0])) * 60 + parseInt(a[1]);
}
var findMinDifference = function (timePoints) {
let diff;
let times = [];
for (let i = 0; i < timePoints.length; i++) {
times.push(toMinute(timePoints[i]));
}
for (let i = 0; i < times.length; i++) {
... | true |
2ea2deb66aaf7061046d4f12ca739b237f8faea4 | JavaScript | weijia0208/JS-advanced-lessons | /LS13/demo9.js | UTF-8 | 447 | 3.734375 | 4 | [] | no_license | //添加属性
var obj = {
x:1,
y:2
};
//1.直接添加,其特性默认值都为true
obj.z = 3;
for(var k in obj){
console.log(k,obj[k]);
}//x 1 y 2 z 3
//2.通过defineProperty 除了手动修改之外其他默认值都为false
Object.defineProperty(obj,"w",{value:456,configurable:true});//writable,enumerable没有指定,所以默认为false
for(var k in obj){
console.log(k,obj[k])... | true |
2037474770b0499f2845624f47806573a1442573 | JavaScript | sarahschuetz/JavaScript30 | /01 - JavaScript Drum Kit/js/AudioController.js | UTF-8 | 964 | 2.71875 | 3 | [] | no_license | import InputHandler from './InputController.js';
import { checkArgument, requireNonNull, isIterable } from './util.js';
import HtmlAudioSample from './HtmlAudioSample.js';
class AudioController extends InputHandler {
// private class field (ES2019)
#map = new Map();
// this should be private when using static f... | true |
366f03171d34f03c9ed1d82e3a660658aff024e5 | JavaScript | Wallgau/olfa-react-app | /src/Vote.js | UTF-8 | 1,007 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react';
import Question from './Question.js';
import firebase from './firebase.js';
class Vote extends Component {
constructor(props) {
super(props);
this.state = {
count: 0
}
}
componentDidMount() {
// if count is not defined, I don't want to update the state with unde... | true |
3e2cd4dafecb3f69baa41c89cbf353f8a7700631 | JavaScript | Zein1/leplateau | /accueil_societe.js | UTF-8 | 1,487 | 2.5625 | 3 | [] | no_license | //OPACITE DU MENU
$( document ).ready(function() {
$("#cartes").mouseenter(function () { $("#cartes").css("opacity", "0.5");});
$("#cartes").mouseleave(function () { $("#cartes").css("opacity", "1");});
});
$( document ).ready(function() {
$("#ambiance").mouseenter(function () { $("#ambiance").css("opacit... | true |
0f88bffbac0ffe0a68002c99742a84091f1f8b67 | JavaScript | lechpoznan/kurs | /B/2017_wrzesień_03_gr_B/math.js | UTF-8 | 2,184 | 3.6875 | 4 | [] | no_license | /*var pi = Math.PI;
console.log(pi);
//pierwiastek
var pierwiastek = Math.sqrt(25);
console.log(pierwiastek);
var a = 13.2;
var b = 28.5;
var c = 30;
var minimalna = Math.min(a,b);
console.log(minimalna);
var maksymalna = Math.max(a,b,c);
console.log(maksymalna);
var zaokraglenie = Math.round(b); //... | true |
1151562e21b88d5200d346501e879a3a7baa2939 | JavaScript | PlyutoP/TaskMap | /script.js | UTF-8 | 1,500 | 2.953125 | 3 | [] | no_license | $(function(){
addPoint();
addImages('firstImg', "askold");
addImages('secondImg', "armalit");
addImages('thirdImg', "burevestnik");
addImages('fourthImg', "skbk");
showImages('firstImg', 5000);
showImages('secondImg', 9000);
showImages('thirdImg', 13000);
showImages('fourthImg', 174000);
});
function ... | true |
da8c7de061eb83aa4b75c9088b56f1924553def8 | JavaScript | bodavid/bodavid.github.io | /sampSzLab.js | UTF-8 | 9,152 | 2.828125 | 3 | [] | no_license | /**
* Visualizing sample sizes dependency on even Fourier transforms with noise.
*
* Basis function periodicity can be 2*pi or rational. Rational might seem easier but has the disadvantage of being
* specific on borders on a computer architecture. Basis functions can be unspecified in and around discontinuities.
*... | true |
b265e1b7baccde4e360aac3f0fabc19e3a3834de | JavaScript | joysaur/advent_of_code_2020 | /day_3.js | UTF-8 | 1,641 | 3.40625 | 3 | [] | no_license | const fs = require('fs')
fs.readFile('./files/day_3_input.csv', 'utf8' , (err, _data) => {
if (err) {
console.error(err)
return
}
const forest = _data.split('\n').filter(Boolean)
// part one
const totalTrees = treesEncounteredSlopes(3,1,forest)
console.log('trees', totalTrees)
// answer = 218... | true |
7d2a8fb3d7b8594b680a27a0838e4ea212ddd851 | JavaScript | MishoMihaylov/BindKraft | /Scripts/inprogress/chains/ProcessingChainContext.js | UTF-8 | 1,982 | 2.546875 | 3 | [
"MIT"
] | permissive | /*var ProcessingChainOperation = {
ABORT: 1,
COMPLETE: 1,
NEXT: 2
};*/
/*Default processing context*/
function ProcessingChainContext(chain, context, datas) {
BaseObject.apply(this, arguments);
//set the default metadata values
this.$context= context || "generic";
this.$status= Processing... | true |
156e54398088a3dad72b9620f06d1788d7cd12a0 | JavaScript | SarahDierckens/waterschildpadden.be | /routes/pages.js | UTF-8 | 4,492 | 2.625 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var navigations = require('../data/navigation.json');
var navigationTree = navigations.navigationTree;
module.exports = {
getRouter: function (randomNavigations) {
return getRouter(randomNavigations);
}
};
//---------------------------... | true |
4ee690c077e32041da16155973dc65793562fece | JavaScript | liposo/Sheeturl | /js/options.js | UTF-8 | 1,684 | 2.84375 | 3 | [
"MIT"
] | permissive | var linkList = document.querySelector("#link-list");
var refresh = document.querySelector("#refresh");
var gScriptUrl =
"https://script.google.com/macros/s/AKfycbxmlPDQHBSTcrBHKlin3-8-K-m3BYdgKjWWZBNXKkKK2jEIEuZF/exec";
window.addEventListener("load", function() {
if (
localStorage["sheetUrl"]
) {
docume... | true |
367ed972ebe083cf3bdbd1942ebaa1f60e7e30f7 | JavaScript | Sandy4321/1000.event | /public/js/payuniteller.js | UTF-8 | 1,947 | 2.5625 | 3 | [] | no_license | $(document).ready(function() {
/**
* Обработка событий в балансе
*/
$('#buy-card')
.on('click', '.data .plans .list label', function() {
//alert('ads');
var price = $(this).data('price');
var amount = $(this).data('amount');
$('#buy-card-price').text(price);
$('.btn-buy-card b').text($(this).te... | true |
7b27bbefdea7971f158850709316748ef1cf9dfa | JavaScript | PhilippeG85/Cookbook | /client/src/components/index/userRecipes.js | UTF-8 | 1,076 | 2.53125 | 3 | [] | no_license | import React, { useEffect, useState, useContext } from 'react';
import { UserContext } from '../../logInContext';
import axios from 'axios';
import Recipe from './recipeCard';
export default function UserRecipes() {
const [recipes, setRecipes] = useState(null);
const userName = useContext(UserContext);
us... | true |
ca908993cf39552019f15a3aa7a4b99bec880f1a | JavaScript | jeremielodi/PHPExcelJs | /lib/util.js | UTF-8 | 1,946 | 3.421875 | 3 | [] | no_license | class Util {
/**
* Translates a Excel cell represenation into row and column numerical equivalents
* @function getExcelRowCol
* @param {String} str Excel cell representation
* @returns {Object} Object keyed with row and col
* @example
* // returns {row: 2, col: 3}
* getExcelRowCol('C2')
*/
... | true |
f30f75b5cb958f557f7490e975efba0c3c48a55e | JavaScript | useonglee/Algorithm_Study | /Code_Sharing/Data_Structure/19_[GCD]_ChocolateStick/juhyeon.js | UTF-8 | 852 | 3.53125 | 4 | [] | no_license | function divideChocolateStick(A, N) {
let primeArr = [];
let smallNum = A;
let arr = [];
let result = [];
// 입력 받은 수 중 작은 수 찾기
if (A > N) {
smallNum = N;
}
// 최대공약수 찾기
let GCD = 0;
for (let i = smallNum; i > 0; i--) {
if (A % i === 0 && N % i === 0) {
GCD = i;
break;
}
}
... | true |
b3650b2a624c4051ab08f45b3dc603903831eaaf | JavaScript | lovelydaidai/lovelydaidai.github.io | /scripts/car_hover.js | UTF-8 | 614 | 2.796875 | 3 | [] | no_license | function car_hover() {
var head_card_car =document.getElementById('head_card_car');
var car_hover = document.getElementById('car_hover');
head_card_car.onmouseover=function () {
car_hover.style.display='block';
};
head_card_car.onmouseout = function () {
car_hover.style.display = 'no... | true |
11ab0d4cbe648452abb85fd489da7503bd342292 | JavaScript | kapppa-joe/leetcode-practice | /daily/20200919-sequential-digits.js | UTF-8 | 777 | 3.546875 | 4 | [] | no_license | /**
* @param {number} low
* @param {number} high
* @return {number[]}
*/
var sequentialDigits = function(low, high) {
let result = [];
const build = (digits, next = 1, prefix = '') => {
if (digits > 9 - next + 1) {
return '';
} else if (digits === 1) {
return prefix ... | true |
492098b0a458ad510eccd679aa6fe6c23bb96622 | JavaScript | lInvisible/Doc | /asd.js | UTF-8 | 2,238 | 3.09375 | 3 | [] | no_license | const rivers = ['Ganga','Yamuna','brahmaputra Assam','Mahanadi','godaяvari','Kris-hna','Na-rmada','Ta12pti','gomti','Ko3shi','Gaїnga','Gand45aki','Mahi','Ganga','123o','Betwa','Son','Sutlej','Ravi','Beas','Chenab','Jehlam','Ghaggar','Hugli','Damodar','Indus'];
//SORT
const newarr = rivers => rivers.sort(functi... | true |
88a09696b20d4295b6db428cac0e1fd898c07260 | JavaScript | lbvertical/seo_prioritization_tool | /client/src/App.js | UTF-8 | 1,758 | 2.75 | 3 | [] | no_license | import React, { Component } from 'react';
import { Container } from 'semantic-ui-react';
import axios from 'axios';
import ItemList from './components/Items/ItemList';
import Hero from './components/Hero/Hero';
import ItemForm from './components/Items/ItemForm';
class App extends Component {
state = { items: [] }
... | true |
e49a6845a0f24a4dcd911a11710d643fc2efe893 | JavaScript | brndng/chess-club | /client/src/components/ChallengeCreator.jsx | UTF-8 | 3,942 | 2.53125 | 3 | [] | no_license | import React, { Component } from "react";
import { connect } from "react-redux";
import { withRouter } from "react-router-dom";
import adapter from "../adapter";
import Modal from "./Modal.jsx";
import { genRandomColor } from "../../../rules/utilities";
class ChallengeCreator extends Component {
constructor(props) {... | true |
be295d9ef01093e6f2391a5f5b3e00de4b84e285 | JavaScript | jmicahc/John-MultiLine | /MultiLine.backup.js | UTF-8 | 4,791 | 3.03125 | 3 | [] | no_license | //This script implements the following features:
// 1. Names of countries must appear next to the lines as in Multi-Series Line Chart.
//
// 2. Each line should be interpolated using "basis" or some other interpolation
// mechanism appropriate to the data (Reference [3]). (1 point)
//
// 3. Color associated wi... | true |
45a965e2e6b73a2e65247451140cd4f7582a019c | JavaScript | 3web1/ANGULAR_jS | /assignments/assignment1/assignment1-starter-code/app.js | UTF-8 | 863 | 2.9375 | 3 | [] | no_license | (function () {
'use strict';
angular.module('DishCount', [])
.controller('CountController', CountController);
CountController.$inject = ['$scope'];
function CountController($scope) {
$scope.string = "";
$scope.count = "";
$scope.style = "";
$scope.g... | true |
c68d8b8420e9b47e4f5e021cef50f3b0fd327490 | JavaScript | IvanVinel/typical-arrays-problems | /src/index.js | UTF-8 | 553 | 3.203125 | 3 | [
"MIT"
] | permissive |
exports.min = function min (array) {
if (!array || array.length === 0) {
return 0;
}
else {
return minValue = Math.min.apply(null,array);
}
}
exports.max = function max (array) {
if (!array || array.length === 0) {
return 0;
}
else {
return maxValue = Math.max.apply(null,array);
}
}
ex... | true |
38b4444f1afb829c920eaf7b53aadd379e6940a2 | JavaScript | javadkh2/binary-search | /binary-search.js | UTF-8 | 1,011 | 3.4375 | 3 | [] | no_license | function binarySearch(compare) {
return function search(
sortedArray = [],
needle,
start = 0,
end = sortedArray.length - 1
) {
if (start > end) return null;
const middle = Math.floor((start + end) / 2);
switch (compare(sortedArray[middle], needle)) {
case 0:
return sortedAr... | true |
1e97c1a0e5c2f0ffc9075d8bc5fdd49b280de24f | JavaScript | Ryanbarker0/js-looping-and-iteration-map-lab-london-web-091718 | /index.js | UTF-8 | 342 | 3.421875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | // Code your solution in this file.
function lowerCaseDrivers(array) {
return array.map(el => el.toLowerCase())
}
function nameToAttributes(object) {
return object.map(d => ({ firstName: d.split(' ')[0], lastName: d.split(' ')[1] }))
}
function attributesToPhrase(object) {
return object.map(d => `${d.name} is f... | true |
e5804a7e70c772800c59302d0cd467b9cef0cfcb | JavaScript | karanilow/Advanced_node_auth | /models/User.js | UTF-8 | 2,572 | 2.5625 | 3 | [] | no_license | const crypto = require("crypto");
const mongoose = require("mongoose");
const bcrypt = require("bcryptjs");
const jwt = require("jsonwebtoken");
const UserSchema = new mongoose.Schema({
username: {
type: String,
required: [true, "Please provide a username"],
},
email: {
type: String,
required: [t... | true |
1ddc1140ccf96380772d305a1bf461b6f91dd425 | JavaScript | CodecoolBPwswp/wswp-proman-magic-mongooses | /static/js/data_handler.js | UTF-8 | 4,760 | 2.921875 | 3 | [] | no_license | // this object contains the functions which handle the data and its reading/writing
// feel free to extend and change to fit your needs
// (watch out: when you would like to use a property/function of an object from the
// object itself then you must use the 'this' keyword before. For example: 'this._data' below)
let ... | true |
39d2dd32615258b095cc2b9d03181c9fb8d5e62f | JavaScript | shoaib6174/red-onion | /src/Components/AddToCart/AddToCart.js | UTF-8 | 3,421 | 2.515625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import { useLocation } from 'react-router-dom'
import { addToDatabaseCart, getDatabaseCart, removeFromDatabaseCart } from '../../utilities/databaseManager';
const AddToCart = (props) => {
let [quantity, setQuantity]= useState(0);
let [q , setQ] = useSta... | true |
7296555e2f953ad0a1e4798ac02d075f5fb6d12f | JavaScript | semrh/chatSyTW | /public/js/user.js | UTF-8 | 180 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | (function() {
setInterval(
function(){
$.get('/user',
function(response) {
$('#user').replaceWith(response);
}
);
},
1000);
})();
| true |