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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b542445a2640508cf5c7df2f10eeceac1191264e | JavaScript | Magic15/tim2 | /src/main/resources/static/app/average.controller.js | UTF-8 | 493 | 2.546875 | 3 | [] | no_license | (function () {
'use strict';
angular
.module('app')
.controller('myCtrl', function($scope, $http){
$scope.number = 5;
$scope.items = [];
$scope.getAvg = getAvg;
function getAvg(numberList)
{
var url ="/average/" + num... | true |
be577250cd64e7c268a2dd3a883f57b81eb1c2ac | JavaScript | annakuzniak/meet_our_team | /app.js | UTF-8 | 377 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive |
let mySwiper = new Swiper('.swiper-container', {
direction: 'horizontal',
loop: true,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
})
function slide(i){
mySwiper.slideTo(i, 1)
};
for (let i = 1; i <= 10; i++) {
document.querySelector('#person... | true |
0c86d521730a49f33875bdce5b0ce80a3ff9bcfa | JavaScript | LucasChlz/Contador-de-caracteres | /script.js | UTF-8 | 1,031 | 3.265625 | 3 | [
"MIT"
] | permissive | function contador(){
setInterval(function(){
var txt = document.getElementById("msg");
var txtcont = document.getElementById("txtcont");
var valor = txt.value;
var result1 = valor.length;
txtcont.innerHTML = result1;
txt.addEventListener("keydown",contador);
},000... | true |
30525f8d2664d8db714fb7c6d7d94b16982d1572 | JavaScript | ThalisVicente/drugStore | /Node/server.js | UTF-8 | 2,431 | 2.71875 | 3 | [] | no_license | //Setting dependencies
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const mysql = require('mysql');
const PORT = 3000;
const app = express();
app.use(cors());
// parse requests of content-type - application/json
app.use(bodyParser.json());
// parse req... | true |
72c09e33167e61cd7c3c047fbf4aeb8c3ec106a5 | JavaScript | ValeriiaStepanchenko/goit-js-hw-03 | /task-3.js | UTF-8 | 1,323 | 4.03125 | 4 | [] | no_license | /*
Поиск наибольшего значения среди свойств объекта
Напиши функцию findBestEmployee(employees), которая принимает объект сотрудников и возвращает
имя самого продуктивного (который выполнил больше всех задач).
Сотрудники и кол-во выполненных задач содержатся как свойства объекта в формате "имя":"кол-во задач".
*/
con... | true |
30a29ae0b490e5ffcf8f1011a2127cb3659e49f1 | JavaScript | MVytautas/Checkers_atoms | /movements.js | UTF-8 | 928 | 3.25 | 3 | [] | no_license | // function onReady(){
// totalTiles = 64;
// tileHTML = '';
//
// for (i = 0; i < totalTiles; i++) {
// tile = '<div id="tile-'+ i +'" class="tile-'+ i +' template-tile"></div>';
// tileHTML += tile;
// }
//
// alert($('#board').html());
//
// $('#board').html(tileHTML);
// }
function onReady(){
r... | true |
6d810f9febf88ea9f38e01bf8b21c4fd3e45c613 | JavaScript | esjs/svg-mixer | /packages/svg-mixer/lib/utils/calculate-symbol-position.js | UTF-8 | 2,912 | 3.0625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | const { create: spriteValue } = require('../sprite-value');
/**
* @typedef {Object} SpriteSymbolPosition
* @property {SpriteValue} width
* @property {SpriteValue} height
* @property {SpriteValue} aspectRatio
* @property {SpriteValue} left
* @property {SpriteValue} top
* @property {Object} bgSize
* @property {S... | true |
c4127647eeb70d8fb5f5c66eb45bd8fda2a44252 | JavaScript | gyban/photo-tagger | /platforms/android/assets/www/js/cameraAccess.js | UTF-8 | 2,826 | 2.9375 | 3 | [] | no_license | //Add a listener and wait for the device to be ready
document.addEventListener("deviceready", onDeviceReady, false);
//Define a global variable
var db;
var image;
//When successfull do things
function onDeviceReady() {
// Now safe to use device APIs
console.log(navigator.camera);
//console.log(sqlitePlugin.... | true |
f51b6d5eee0d9274f85bf293f8e3c137ac4e1d72 | JavaScript | rybrennan/recast.ly | /src/components/App.jsx | UTF-8 | 2,708 | 2.828125 | 3 | [] | no_license | class App extends React.Component {
constructor(props) {
super(props);
this.state = {
videos: [],
currentVideo: null
};
this.handleClick = this.handleClick.bind(this);
this.setVideos = this.setVideos.bind(this);
this.handleTextInput = this.handleTextInput.bind(this);
// this.d... | true |
1c6da709125cfef48e4ed6d48b9d6a3e884e37d4 | JavaScript | Did-You-Do-The-Reading/Did-You-Do-the-Reading- | /client/store/currentGame.js | UTF-8 | 1,160 | 2.609375 | 3 | [] | no_license |
import firebase from '../../server/firebase'
/* ----------------- ACTIONS ------------------ */
const SET_GAME_ON_STATE = 'SET_GAME_ON_STATE'
/* ------------ ACTION CREATORS ------------------ */
export const setGameOnState = game => ({type: SET_GAME_ON_STATE, game})
/* ------------ THUNK CREAT... | true |
21838f82713f3d0782c8f420955af8cb99f42586 | JavaScript | 26medias/n-body-problem | /apps/demo.js | UTF-8 | 1,355 | 2.921875 | 3 | [] | no_license | /*
Basic proof of concept
*/
var engine = new Engine({
renderer: {
objects: $('.simulator>#objects'),
gravity: $('.simulator>#gravity')
}
});
engine.add('Earth', 0, 0, {
radius: 6371,
mass: 5.97237e+24
});
engine.add('Moon', 356500, 33, {
radius: 1737,
mass: 7.342e+22
});
engine.add('Spaceship', 50000, 1... | true |
0ce70e09c488e7855be4edab5bfb74314ec88ab8 | JavaScript | Huzhangjie/qs_html5_lesson | /zhihu/src/index.js | UTF-8 | 1,361 | 3.5 | 4 | [] | no_license |
let canvas = document.getElementById('canvas');
let ctx = canvas.getContext('2d');
// canvas绘图
// es6 声明变量用let let 具有块级作用域
// offset 内容宽度
console.log(canvas.width);
console.log(canvas.offsetHeight);
let w = canvas.width = canvas.offsetWidth;
let h = canvas.height = canvas.offsetHeight;
let circles = [];
let current_... | true |
50118c89ac058074c409b6b32fa4c66d8ccfc833 | JavaScript | Gortega713/Capstone_Form | /html5/js/main.js | UTF-8 | 2,328 | 2.984375 | 3 | [
"MIT"
] | permissive | window.addEventListener("load", function(){
document.getElementById("display").addEventListener("click", changeText);
checkLogin();
});
function changeText(){
document.getElementById("display").innerHTML = "Show Less";
document.getElementById("display").removeEventListener("click", changeText)
d... | true |
9e07624e5392fe276f95d3dbd2042f8ea8e45edd | JavaScript | AlexandrLagun/Tasks | /2.JS/scripts2/dateFormat.js | UTF-8 | 10,739 | 3.25 | 3 | [] | no_license |
function createDate(date, formatIn) {
var dateInput;
var restr1 = [ /DDMMYYYY/,/DD\.MM\.YYYY/, /DD\-MM\-YYYY/,
/DD\/MM\/YYYY/, /DD\ MM\ YYYY/, /YYYY\.MM\.DD/,
/YYYY\-MM\-DD/, /YYYY\/MM\/DD/, /YYYY\ MM\ DD/,
/YYYYMMDD/ ];
if (restr1... | true |
ca4e908102db67f49891e4c3e56a0fa0a9a57300 | JavaScript | manjarb/jasmine-cookbook | /spec/spy/custom_spy_method/custom_spy.spec.js | UTF-8 | 3,576 | 3.15625 | 3 | [] | no_license | /*
Scenario - 1: The jasmine.any function should be applied successfully for comparing types of arguments.
Scenario - 2: The jasmine.objectContaining should match / compare objects corresponding to actual key / value pairs.
Scenario - 3: The jasmine.objectContaining should be applied successfully to compa... | true |
c7317926ce1b0b952e4173c071f3f0d068948519 | JavaScript | DianaKol/frontend-SS | /Рекурсия. Чет.нечет/recursia.js | UTF-8 | 317 | 3.765625 | 4 | [] | no_license | let m = prompt("Введите число");
function isEven (k){
if (k < 0)
k=Math.abs(k);
if (k == 0)
return console.log(" Данное число четное");
if (k == 1)
return console.log("Данное число нечетное" );
else
return isEven(k - 2);
}
console.log(isEven(m)); | true |
b86b672d9d8b67934bd190feadf9fd2a553086de | JavaScript | Lexdamian/Practica-Front-End-Wantsome | /JS/Saptamana 8/closure.js | UTF-8 | 6,327 | 4.25 | 4 | [] | no_license | // /Ex1
//Vreau sa am o functie care sa-mi calculeze suma dintre 2 numere daca ele sunt diferite iar daca sunt egale sa-mi imulteasca suma lor cu 5
//ex myFunction(10, 5) - output 15 // myFunction(10,10) - output 100
function sumAndMultiply(firstNumber, secondNumber) {
firstNumber !== secondNumber ? console.log(firs... | true |
c0111cfac25d2ef8e9182591669bc1f90b602034 | JavaScript | Manishthakur1297/TypeScript-Assignment | /arrowdemo.js | UTF-8 | 595 | 3.578125 | 4 | [] | no_license | function add1(x, y) {
return x + y;
}
var add2 = function (x, y) {
return x + y;
};
var add3 = function (x, y) { return x + y; };
console.log(add3(11, 22));
var User = /** @class */ (function () {
function User() {
var _this = this;
this.name = "Manish";
/*var self = this;
se... | true |
3d30572ee7333f8cb29dade9bb750585f08f5934 | JavaScript | oliviagardiner/green-fox-projects-oliviaisarobot | /week-07/day-01/42.js | UTF-8 | 209 | 3.5625 | 4 | [] | no_license | 'use strict';
function factorial(a) {
var output = 1
for (var x = 1; x <= a; x++) {
output *= x
}
return output
}
console.log(factorial(5))
// create a function that returns it's input factorial
| true |
eeac6d407b9885d36c335c5e1e7a3f7b831a034c | JavaScript | swetha-5689/parking-manager | /PricingAdmin/routes/api/getprice.js | UTF-8 | 1,800 | 2.65625 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const PriceModelClass = require('../../services/PriceModelClass.js');
//Object with connection to the Live Price Model for calculations
const LivePriceModel = require('../../models/LivePriceModel');
//@route GET api/getprice
//@desc Generates a pric... | true |
21c749a08b6efe6c1efebb05d16a57334d4fdc43 | JavaScript | AntonioZelisko/Serie-02 | /Ex-01/Ex-01.js | UTF-8 | 457 | 2.8125 | 3 | [] | no_license | const cap = document.querySelectorAll("span");
cap[0].addEventListener("click", function() {
cap[0].innerHTML = "Paris";
})
cap[1].addEventListener("click", function() {
cap[1].innerHTML = "Rome";
})
cap[2].addEventListener("click", function() {
cap[2].innerHTML = "Washington";
})
cap[3].addEventListener("c... | true |
91cc2f19bd3d5e630356b24ef6f5484a76bea959 | JavaScript | stevo-300/moralrpg | /src/enemies/Lizard.js | UTF-8 | 1,721 | 2.9375 | 3 | [
"MIT"
] | permissive | import Phaser from "phaser";
const Direction = {
UP: 0,
DOWN: 1,
LEFT: 2,
RIGHT: 3
}
export default class Lizard extends Phaser.Physics.Arcade.Sprite {
constructor(Scene, x, y, texture, frame) {
super(Scene, x, y, texture, frame)
this.anims.play('lizard-run')
this.direction... | true |
8fdf6d6ccc8db4f0490ddf130fda9e9e9df8e829 | JavaScript | neelureddy/jquery-ui | /src/js/personobj1.js | UTF-8 | 257 | 3.390625 | 3 | [
"MIT"
] | permissive | var school = new Object();
school.name = "City School";
school.location = "Delhi";
school.established = 1995;
school.displayinfo= function(){
document.write(this.name + "was established in " + this.established + "at" + this.location)
}
school.displayinfo();
| true |
73020b15998b33a69b085bade159516bdd84da83 | JavaScript | iancarlo-lab/javascript-calculator | /src/components/ButtonsPad.js | UTF-8 | 1,806 | 2.59375 | 3 | [] | no_license | import React from 'react';
class ButtonPad extends React.Component{
render(){
return(
<div id="num-buttons">
<button id="add" value="+" onClick={e => this.props.onClick(e.target.value)}> + </button>
<button id="subtract" value="-" onClick={e => this.props.onClick(e.target.value)}>-</button>... | true |
ebc1ad11a4a51d664309caa610d8500d7702dd55 | JavaScript | BLZbanme/leetcode | /0001-0100/0001-0050/0036ValidSudoku/demo.js | UTF-8 | 5,519 | 3.390625 | 3 | [] | no_license | /**
* @param {character[][]} board
* @return {boolean}
*/
var isValidSudoku = function(board) {
for(let i = 0; i < 9; i++){
let arr = new Array(10).fill(0);
for(let num of board[i]){
if(num === "."){
continue;
}else{
if(arr[num] == 0){
... | true |
b5560040efb77d31a8b5eca623d92fe8388f98ae | JavaScript | CaliZam/skylab-bootcamp-202004 | /staff/juandavid-omen/arrays/arroz/arroz.prototype.find-index.spec.js | UTF-8 | 1,321 | 3.640625 | 4 | [] | no_license | "use strict";
describe("Arroz.prototype.find-index", function() {
it("returns the index of the first element in the provided array that satisfies the provided testing function", function () {
var array = new Arroz(5, 12, 8, 130, 44);
var result = array.findIndex(function(element) {
return element > 10... | true |
615a0b3bd0632de8262d859f773d5e48dff06f89 | JavaScript | Jess-White/three-roads-app | /src/App.test.js | UTF-8 | 8,002 | 2.828125 | 3 | [] | no_license | // import { render, screen } from '@testing-library/react';
import React from 'react'
import Enzyme, { shallow } from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
import isEqual from 'lodash.isequal'
import { createQuizArray, randomizeQuestions, getTriviaRound, reformatQuestions } from './Services/QuestionFu... | true |
294c61d90a196dd5eca57220d3031be947916878 | JavaScript | ncrodriguez206/Burger-Queen | /src/firebaseEntrarPedido.js | UTF-8 | 1,227 | 2.734375 | 3 | [] | no_license | import firebase from "./firebase";
const db = firebase.firestore();
export const entrarItem = async () => {
let id = localStorage.getItem('itemId')
const docRef = db.collection("Pedidos").doc(id);
return docRef.get().then(function(doc) {
if (doc.exists) {
console.log(... | true |
5a3d38830c862e3a454c70d45ea5f554b3db8f0a | JavaScript | justwiner/JS_Tools | /lib/Queue.js | UTF-8 | 635 | 2.90625 | 3 | [
"MIT"
] | permissive | let Queue = (() => {
const items = new WeakMap()
class Queue {
constructor () {
items.set(this, [])
}
enqueue (element) {
let item = items.get(this)
item.push(element)
}
dequeue () {
let item = items.get(this)
return item.shift()
}
front () {
let item ... | true |
533d191f1af7df8ef0fee648653f19e934eaf267 | JavaScript | rifkiharbiawali/G2Academy_BootCamp_Tugas | /Tugas 2/js/tabel.js | UTF-8 | 1,191 | 3.15625 | 3 | [] | no_license | // Fungsi Isi Tabel
function buattabel(data) {
var baris = "";
for (var i = 1; i < data.length; i++) {
baris += `
<tr>
<td>${i}</td>
<td>${data[i].nama}</td>
<td>${data[i].hobi}</td>
<td><button id='btn_delete' onclick='hapus(${i})'>Delete</button></td>
</tr>
`;... | true |
933a58888e2cf52614648c02101073c7c32c5566 | JavaScript | iqzone/APYA | /public/js/ips.textEditor.js | UTF-8 | 31,533 | 2.609375 | 3 | [] | no_license | /**
* Wrapper for CKEditor based goodness
* Written by Matt Mecham for his sins.
* (c) 2011 IPS, Inc.
*/
ipsTextArea = {
/**
* Insert text at the cursor position
* Some code from
* @link http://bytes.com/topic/javascript/answers/149268-moving-cursor-end-textboxes-text
* @param editorId
* @param text
*... | true |
8f10d98b817e732f55c634f558c6053a2f5c66d9 | JavaScript | muddybarefeet/pirateStocks | /workers/startMatches.js | UTF-8 | 1,401 | 2.828125 | 3 | [] | no_license | //sweep through the matches for the day and update status and check if the winner needs to be updated
//Daily_Update
var moment = require('moment');
module.exports = function (services) {
setTimeout(function () {
//in the schedule table have a Daily_Update key in the table
//check this every hour
// services... | true |
36e31814789b14c344b5d5d172da6ed34b307e9a | JavaScript | zhuang11001/JSRESTful | /demo/js/ajax-1.0.0.js | UTF-8 | 2,146 | 3.296875 | 3 | [
"MIT"
] | permissive | /**
* 封装简单的ajax 函数
* @param url 请求地址
* @param method 请求方法 get||post;默认同步
* @param async 是否异步 true 异步 || false 同步;默认异步
* @param data 发送数据,只支持post方式
* @param Callback 回调函数(数据,对象)
* @param type 回调数据类型 text
*/
function ajax(url, data, callBack) {
//设置参数默认值
method = "post";
async = true;
data = d... | true |
f0f2f36624b5e2d33e0925aad3340a27dcee7b9b | JavaScript | kostadinlambov/JavaScript-Advanced | /13. JS-Advanced-Classes-and-Members-Exercises/p02_Tickets.js | UTF-8 | 1,533 | 3.34375 | 3 | [
"MIT"
] | permissive | function ticketManager(ticketDescriptionArr, sortingCriteria) {
let resultArr = [];
class Ticket {
constructor(destination, price, status) {
this.destination = destination;
this.price = price;
this.status = status;
}
}
for (let element of ticketDescr... | true |
2c8dfd4a045c8be1978ab2015a6d50eb85a3f1ab | JavaScript | hiten36/Generate_random_bg_color | /script.js | UTF-8 | 310 | 3.1875 | 3 | [] | no_license | const setBg = () => {
const randomColor = Math.floor(Math.random()*16777215).toString(16);
document.body.style.backgroundColor = "#" + randomColor;
document.querySelector('.code').innerHTML = `<h2>#${randomColor}</h2>`;
}
document.querySelector('.box1').addEventListener("click", setBg);
setBg() | true |
7d24396db65fb752309eaec65e1f952275c6106f | JavaScript | club-de-software-espe/testProjectsMocha | /test/functions/list/list.js | UTF-8 | 696 | 2.90625 | 3 | [] | no_license | const {
length,
evenList
} = require ("../../../functions/list/list");
const assert = require('assert');
describe('List', function() {
describe('#length(array)', function() {
it('should return the length of array [1,2,3,4] = 4', function() {
assert.equal(length([1,2,3,4]),4);
});
it('should retur... | true |
798c9aaa6998d966f9ea205eb71bfcb5bf70d9ed | JavaScript | cxTs/snowShooter | /utils/Vehicle.js | UTF-8 | 9,374 | 3.578125 | 4 | [
"Unlicense"
] | permissive | class Vehicle {
location;
velocity;
acceleration;
size;
maxSpeed;
maxForce;
arrivingZone;
avoidingZone;
avoidSpeed;
neighborZone;
color = "rgba(127, 127, 127, .8)";
constructor(x, y, size) {
this.location = new Vector(x, y);
this.velocity = new Vector(0,... | true |
3ca5e36235946f4ccf53ad2f7374011b949883a9 | JavaScript | Wait-ly/reviews_wluk37 | /database/postgresql/psqlSeed.js | UTF-8 | 3,369 | 2.890625 | 3 | [] | no_license | const faker = require('faker');
const fs = require('fs');
const fakeRNG = (num) => faker.random.number({min: 1, max: num});
const fakeReview = () => faker.lorem.paragraph(fakeRNG(3));
const fakeBool = () => faker.random.boolean();
const fakeDate = () => faker.date.past(5).toLocaleString().split(' ')[0];
const fakeName... | true |
6e42638ed56f0b0141cfee9133157db71d80990a | JavaScript | MrMogul/mortgage | /calculators/amortize.js | UTF-8 | 4,652 | 2.8125 | 3 | [] | no_license | function clearLoanOnClick(){
document.loan_form.loan_amt.value="";
document.loan_form.rate.value="";
document.loan_form.months.value="";
document.loan_form.extra.value="0";
document.getElementById("amount").innerHTML = "";
document.getElementById("rate").innerHTML ="";
document.getElementById("mos").inne... | true |
76039e402a1d873df4a7955adfeffec3dc4126b3 | JavaScript | Sev40/MegaShooter-GT | /main.js | UTF-8 | 4,421 | 2.734375 | 3 | [] | no_license | var canvas = document.getElementById("gameCanvas");
var context = canvas.getContext("2d");
var startFrameMillis = Date.now();
var endFrameMillis = Date.now();
// This function will return the time in seconds since the function
// was last called
// You should only call this function once per frame
function getDeltaT... | true |
4c6681d5e292d4db6ed93c57135f367e7153bf2e | JavaScript | rahulkandikatla/react-app | /src/components/CountriesDashboardApp/SelectRegion.js | UTF-8 | 1,052 | 2.609375 | 3 | [] | no_license | import React from 'react';
class SelectRegion extends React.Component{
constructor(props){
super(props);
this.state={
selectedRegion:"all",
}
}
onChangeSelectedRegion=(e)=>{
const region=e.target.value;
this.setState({
selectedRegion:... | true |
30c6d578568787910f8795895f919af1e1be68a8 | JavaScript | ShrimpTang/testJasmine | /app/controllers/pie-controller.js | UTF-8 | 1,539 | 2.53125 | 3 | [] | no_license | /**
* Created by ShrimpTang on 2015/11/13.
*/
angular.module('pie', []).controller('PieController',
['$scope',
function ($scope) {
$scope.slices = 8;
$scope.lastRequstedFlavor;
$scope.nutritionalValue = {calories: 500, fat: 200, carbs: 100};
$scope.warning =... | true |
4c03c0dc23b37a67588de75a3c7bc5f7f650754c | JavaScript | naovillaj/repaso-final | /assets/js/app.js | UTF-8 | 409 | 2.5625 | 3 | [] | no_license | window.addEventListener('load', function(){
var registrarse = document.getElementById("registrarse");
var iniciarSesion = document.getElementById("inicioSesion");
registrarse.addEventListener('click', function(e){
e.preventDefault();
window.location = "registrate.html";
});
iniciarSesion.addEventListener('cl... | true |
5344fedb5996b09619af2b156f192c93189317cd | JavaScript | Guillermogarcia01/formulario | /main.js | UTF-8 | 6,199 | 3.25 | 3 | [] | no_license |
function validarFormulario(){
//var expresionRegularNombre = new RegExp('[0-9]');
var nombre = document.getElementById("nombre").value;
var apellido = document.getElementById("apellido").value;
var email = document.getElementById("email").value;
var contratacion = document.getElementById("cont... | true |
7d9a5c29c847e5a9b3377fa7f744539f2964f195 | JavaScript | pankaj-saxena/mytest | /routes/users.js | UTF-8 | 795 | 2.609375 | 3 | [] | no_license | var express = require('express');
var url = require('url');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res, next) {
var q = url.parse(req.url, true).query;
var txt = q.locale + " " + q.channel;
res.send('responded with users via GET:' + txt);
});
/* POST user. */
rout... | true |
c51f13f3f077cd0500d163f86d9f30c0d26d16c3 | JavaScript | samprasdsouza/temp-node-tut | /1-intro.js | UTF-8 | 153 | 3.3125 | 3 | [] | no_license | const amount =1
if(amount < 10)
{
console.log('small number');
}
else{
console.log('big number');
}
console.log(`Hey its my first node app`);
| true |
d8962634640a345bf3ef965939add745c28709ba | JavaScript | njina/practice | /b_coding/k_jquery/js/src/jq_silde_banner_02.js | UTF-8 | 3,350 | 2.5625 | 3 | [] | no_license | //jq_silde_banner_02.js
//'문서에 대한 설명'
(function($){
var miniP = $('#miniProduct');
var miniIndi = miniP.find('.indicator');
var miniIndiLi = miniIndi.find('li').children('a');
var miniPlist = miniP.find('.product');
var miniParea = miniPlist.children('ul');
var timed = 700;
miniPlist.css({'overflow':'hidden... | true |
9bd94b1260842b83539a80e32aaa305988cc2a5f | JavaScript | RobertLigman/tip-calculator | /index.js | UTF-8 | 1,143 | 3.390625 | 3 | [] | no_license | const amount = document.querySelector("[name=amount]");
const btn = document.querySelector("#calculate");
const output = document.querySelector(".output");
const outputAmount = document.querySelectorAll(".output h3")[1];
const numberOfPeople = document.querySelector("[name=number-of-people]");
const optionNameToNumber ... | true |
8750df35410e5c40a393b2c62cb08a3ea532d42f | JavaScript | zackrt/Regalia | /public/javascripts/homescreen.js | UTF-8 | 2,492 | 2.640625 | 3 | [] | no_license | $(function(){
function createURLObject(){
let string = window.location.search.substring(1);
let arr = string.split('&');
let returnObj = {};
for(let i = 0; i < arr.length; i++){
let miniArr = arr[i].split("=")
returnObj[miniArr[0]] = miniArr[1]
}
return returnObj;
}
$_GET = createURLObject();
i... | true |
6208ed5673b2fbe2975b2932ebcf4be0c6152378 | JavaScript | sorgloomer/carmageddon-tdr2000-asset-viewer | /web/static/script.js | UTF-8 | 16,435 | 2.546875 | 3 | [] | no_license | var camera, scene, renderer;
var geometry, defaultMaterial, mesh;
var controls, urlParams;
function init() {
urlParams = parseUrlParams();
if (!urlParams.map) {
window.location.href = "?map=HollowoodMesh";
return;
}
camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.in... | true |
842eb8420e316b5d4540af55a5eafe25c8f0fc94 | JavaScript | rhammonds/Angular1StarWars | /lib/StarWarsSample1.js | UTF-8 | 1,176 | 2.75 | 3 | [] | no_license | (function(){
var StarWarsController = function($scope, $http){
var onUserComplete = function(response){
//console.log(response.data);
//$scope.users = [response.data];
//$scope.users = response.data.results;
let items = response.data.results.filter( item =>
ite... | true |
e072f14a61a46d4d16f41288801cf6b2ad69e49f | JavaScript | wleonardo/socks-proxy | /reqinfo.js | UTF-8 | 1,517 | 2.765625 | 3 | [] | no_license | const dns = require('dns');
const TypeList = {
IPv4: 0x01,
DomainName: 0x03,
IPv6: 0x04,
};
const reqinfoData = {
type: '',
dest: '',
port: 80
};
function dnsToIp(domain) {
return new Promise(function(resolve, reject) {
dns.lookup(domain, (err, address, family) => {
resolve(address);
con... | true |
3141f8fa012ab58bb5071a2f02575383a02282e0 | JavaScript | ClearlightY/React-learn | /src/react-learn/ComponentLearn.js | UTF-8 | 635 | 3.203125 | 3 | [] | no_license | // 1. 导入包
import React from 'react'
// -------------------------------------------------
// 第一种创建组件的方式
// 在构造函数中, 使用 props 形参, 接受外界传递过来的数据
function Hello(props) {
// 如果 在一个组件中 return 一个null. 则表示此组件是空的, 什么都不会渲染
// return null
// 在组件中, 必须返回一个 合法的JSX虚拟DOM元素
return <div>这是Hello组件:{props.name},{props.age},... | true |
0808c4290e8182aa6e32620be26765fbfc715a6b | JavaScript | BongoHive/javascript-phase-1-blessedjasonmwanza | /variables.js | UTF-8 | 503 | 3.390625 | 3 | [] | no_license | // you solution should be here
let birthYear = 1998;
let futureYear = 2025;
let futureAge = futureYear - birthYear;
console.log(`by the year ${futureYear}, i'll be ${futureAge} years old \n\n`);
let currentAge = new Date().getFullYear() - birthYear;
let numOfDaysPerYear = 365;
let maxAge = 120;
let perDayUse = 2;
cons... | true |
744487aed54b1b14c05998f96a15322fcd97ecbb | JavaScript | piercus/lowpass | /lib/getBPM.js | UTF-8 | 1,937 | 2.6875 | 3 | [] | no_license | var spawn = require('child_process').spawn;
var fs = require('fs');
var lame = require('lame');
var wav = require('wav');
var filename = process.argv[2];
var getBPM = function(file, cb){
var extension = file.split(".")[1]
if(extension === "wav"){
return getWavBPM(file, cb);
} else if(extension === "mp3"){... | true |
e2d4357bf0797affe02110dabb278ad4aabca650 | JavaScript | areebimtar/hive | /shared/modules/etsy/bulkEditOps/validate/tags.js | UTF-8 | 1,976 | 2.53125 | 3 | [] | no_license | import _ from 'lodash';
import XRegExp from 'xregexp';
import { MAXIMUM_TAG_LENGTH } from '../../bulkOpsConstants';
const nonEmptyString = (value) => {
return _.isString(value) && !_.isEmpty(value);
};
const onlyAllowedCharacters = (value) => {
const reg = XRegExp('[^\\p{L}\\p{Nd}\\p{Zs}\'-]');
return !reg.tes... | true |
4214cf1f0f5e3ad6fd85babb3a360dbd4331ec45 | JavaScript | enginecode/Frontend-01-Template | /week02/StringRegExpTest.js | UTF-8 | 319 | 2.65625 | 3 | [] | no_license | const StringRegExp = require("./StringRegExp");
console.assert(StringRegExp(`"测试"`) === true, `测试不是合法的String`);
console.assert(StringRegExp(`"测试\n "`) === true, `测试\n 不是合法的String`);
console.assert(StringRegExp(`"测试\n \u00a9"`) === true, `测试\n \u00a9不是合法的String`);
| true |
9a51f6fa926d4f335c3cfe2afc48cbcf1ca45c88 | JavaScript | VictorTigris/Pruebas | /function.js | UTF-8 | 1,894 | 3.59375 | 4 | [] | no_license | let bata, orin, dent, camp, total;
bata = document.getElementById("shopping__1");
orin = document.getElementById("shopping__2");
dent = document.getElementById("shopping__3");
camp = document.getElementById("shopping__4");
total = document.getElementById("totalPriceDiv");
let num1, num2, num3, num4;
num1 = doc... | true |
e2a00c9f4cb3ac9991125bd0e9f70265869dd11b | JavaScript | ShubhamJat/kart | /src/components/Shop.js | UTF-8 | 2,754 | 2.59375 | 3 | [] | no_license |
import React, { useState } from "react";
import Grid from '@material-ui/core/Grid';
import Divider from '@material-ui/core/Divider';
import RightPanel from './rightPanel';
import LeftPanel from './leftPanel';
const Shop = (props) => {
const { items } = props
const [cart, setCart] = useState([]);
//consol... | true |
1da2967799e5726ffe321cac22f81c2786abfdd3 | JavaScript | keishaunwes/ajava | /ajd1/ajd1.js | UTF-8 | 487 | 3.359375 | 3 | [] | no_license |
let fruits = ['apple', 'pen', 'pine'];
//let favFruit;
function printFruits() {
let favFruit = fruits[2];
let leasFav = fruits[0];
let item = fruits[1]
console.log(fruits[1]);
printFavFruit();
function printFavFruit() {
console.log(favFruit,leasFav);
console.log(leasFav,i... | true |
5f9f7a501ba52b643d97f8ee982f80d7da53e32a | JavaScript | ShwangShwing/trap-cards | /app/controllers/errors/errors.controller.js | UTF-8 | 721 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | class ErrorController {
constructor(logger) {
//this.logger = logger;
}
handleError(err, req, res, next) {
let error;
try {
error = JSON.parse(err.message);
} catch (e) {
//this.logger.log(err.message);
return res.send(err.message);
... | true |
5ced366cfaa61e25fc8b5aaad271e4302ac3c3dd | JavaScript | TessACraig89/express-ejs-views | /routes/quotes.js | UTF-8 | 818 | 2.921875 | 3 | [] | no_license | //sets up express
const express = require('express');
//sets up router
const quoteRoutes = express.Router();
//require quotes from database
const quotesData = require('../db/quotes');
//when routed to home page render quotes-index.ejs passing in db quotes
quoteRoutes.get('/', function(req, res) {
res.render('quotes/... | true |
b5f1a678cb90a5328284d08e824fa71e188478a9 | JavaScript | techtangents/fewtile | /dist/test/t/test_layout.js | UTF-8 | 2,723 | 2.828125 | 3 | [] | no_license | define(['guts/ui/layout', 'guts/struct/tile', 'underscore', 'guts/struct/maybe', 'guts/mashing/util'], function(layout, tile, _, maybe, util) {
var some = maybe.some;
var none = maybe.none;
var narrow = util.narrow;
return function(assert) {
var assertArrayOfTilesEq = function(expected, actual) {
va... | true |
2314d5f9e7fd1fe6dd05fe2eed7f1704ec332057 | JavaScript | aniiKhachunts/weather-hooks-react | /src/List.js | UTF-8 | 854 | 2.578125 | 3 | [] | no_license | import React from "react";
import Daily from "./Daily";
const List = () => {
const fetchWeather = () => {
fetch(
"https://api.openweathermap.org/data/2.5/forecast?q=Yerevan&units=metric&appid=14ca610487746041595c5f39ee261b14"
)
.then(response => {
return response.json();
})
.t... | true |
a9f68a309f522f96c42fbbf366b586d02fe4bfcb | JavaScript | huksjh/vanilla_js | /clock_load.js | UTF-8 | 597 | 3.265625 | 3 | [] | no_license | const clockArea = document.getElementById("jsClockArea");
const clockView = clockArea.querySelector("h1");
function loadClock() {
const date = new Date(),
Year = date.getFullYear(),
Month = date.getMonth(),
days = date.getDate(),
hour = date.getHours(),
min = date.getMinutes(),
sec = date.get... | true |
9b9b4fce41f9ccee2e56cfd8aec5f0318b48112e | JavaScript | JeanmarieJackman/woof-woof-js-practice-nyc01-seng-ft-051120 | /src/julyfour.js | UTF-8 | 2,993 | 3.53125 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive |
// When a user clicks on a pup's `span` in the dog bar, that pup's info (`image`, `name`, and `isGoodDog` status) should show up in the `div` with the id of `"dog-info"`.
// When you have the pup's information, the dog info `div` should have the following children:
// - an `img` tag with the pup's image url
// - an ... | true |
f1b8f4c955fd1c2d858733180a7de22df1db666a | JavaScript | rashier/lab-mongoose-movies | /starter-code/bin/seed.js | UTF-8 | 1,185 | 2.578125 | 3 | [] | no_license | const mongoose = require("mongoose");
const Celebrities = require("../models/Celebrity");
mongoose
.connect("mongodb://localhost/starter-code", { useNewUrlParser: true })
.then(x => {
console.log(
`Connected to Mongo! Database name: "${x.connections[0].name}"`
);
start();
})
.catch(err => {
... | true |
3a0c547f7575baca19c50c7f620ffb73f0e5ecbd | JavaScript | kudoo-cloud/cloud-functions | /node/createapp/index_old.js | UTF-8 | 8,372 | 2.703125 | 3 | [
"MIT"
] | permissive | // Imports the Google Cloud client library
const Firestore = require('@google-cloud/firestore');
const { DNS } = require('@google-cloud/dns');
var request = require("request");
var recursive = require("recursive-readdir");
var http = require('http');
var fs = require('fs');
var unzipper = require('unzipper')
// This w... | true |
e9917dacc748f30c5e04a7810e56efd1fb5a1332 | JavaScript | pafirmin/battleships | /src/components/__tests__/GameBoard.test.js | UTF-8 | 645 | 2.921875 | 3 | [] | no_license | import GameBoard from "../GameBoard";
const board = GameBoard();
test("Adds a ship", () => {
board.addShip(["A1", "A2", "A3"]);
expect(board.ships.length).toBe(1);
});
test("ships get hit", () => {
board.addShip(["A1", "A2", "A3"]);
board.recieveHit("A1");
expect(board.ships[0].coords).toEqual(["x", "A2", ... | true |
6c80c283132eec588e734eaa3f338e2c0c036635 | JavaScript | RomanBumburyak/Creating_a_user_directory | /routes/index.js | UTF-8 | 6,013 | 2.875 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const User = require('../models/user');
const mongoose = require('mongoose');
const passport = require('passport');
const bcrypt = require('bcryptjs');
mongoose.connect("mongodb://localhost:27017/Creating_a_user_directory");
function login(req, re... | true |
f34b1c6a5b3167ca98cdd274e5375be5739701a3 | JavaScript | blin432/react-prop-exercise | /tweets/App.js | UTF-8 | 1,922 | 3.203125 | 3 | [] | no_license | // Render the tweets using React!
const App = (props) => {
let { tweets } = props;
return (
<span>
{
tweets.map((tweet,i)=>{
return <div key={i} style={{width:'500px',height:'200px' ,border:'1px solid black',margin:'10px'}}>
... | true |
e622dd831fd4e267100160b8174625cdbd1eb66a | JavaScript | shinfan/brickbreaker | /js/board.js | UTF-8 | 9,524 | 2.859375 | 3 | [] | no_license | var board = function () {
// elements on the board
// paddle
var paddle = function () {
// basic attribution
var height, width, x, y, dx;
var img = new Image();
img.src = "./imgs/paddle.png";
var reset = function () {
this.height = config.paddle... | true |
9024c297dcb9988c31f29b25be33a7d51e74dd69 | JavaScript | e-e-e/hyperdb-stage | /lib/join-iterator.js | UTF-8 | 2,524 | 2.796875 | 3 | [] | no_license | var nanoiterator = require('nanoiterator')
function sort (a, b) {
if (!a && !b) return 0
if (!a && b) return 1
if (a && !b) return -1
const ahash = a[0].path.join('')
const bhash = b[0].path.join('')
if (ahash < bhash) return -1
if (ahash > bhash) return 1
if (bhash === ahash && a[0].key !== b[0].key) ... | true |
78d75b45b583420e5e0a9285918782f5466cd3fa | JavaScript | 2006NodeDev/Runtime-Chic | /client/src/components/PostMessageBoard.jsx | UTF-8 | 1,953 | 2.515625 | 3 | [] | no_license | import React, { useState } from "react";
import Nav from "./Nav";
import { Link } from "react-router-dom";
import { useDispatch } from "react-redux";
import { Message } from "../models/Messages";
import { postMessageActionMapper } from "../action-mappers/postMessage-action-mapper";
const PostMessage = () => {
let [m... | true |
c95e73394504755b26bbc29de479233fa0d06ce9 | JavaScript | LukaszSarzynski/CodeCombat-solutions | /mountain/bone-dance.js | UTF-8 | 492 | 3.96875 | 4 | [
"MIT"
] | permissive | // Soothe the skeletons when they get too close.
// This function is useful to compare float numbers.
function almostEqual(a, b) {
return Math.abs(a - b) < 1;
}
while(true) {
var skeleton = hero.findNearestEnemy();
// Find the radius of the skeleton circle.
var radius = hero.distanceTo(skeleton);
... | true |
102c75de17d36bb99d52a3ad1bd7470ef6c0ba51 | JavaScript | azu/promises-book | /Ch4_AdvancedPromises/src/sequence/promise-sequence-xhr.js | UTF-8 | 576 | 2.515625 | 3 | [
"MIT",
"CC-BY-3.0",
"CC-BY-NC-4.0",
"CC-BY-4.0"
] | permissive | "use strict";
const sequenceTasks = require("../../lib/promise-sequence").sequenceTasks;
const fetchURL = require("../../../Ch1_WhatsPromises/src/xhr-promise").fetchURL;
const request = {
comment() {
return fetchURL("https://azu.github.io/promises-book/json/comment.json").then(JSON.parse);
},
people... | true |
54ae41116aee5779d4dcc71ad7e79372363191ae | JavaScript | kazi0/virtual-pet-2 | /sketch.js | UTF-8 | 2,134 | 3.03125 | 3 | [] | no_license | var database;
var dog, happyDogImg,feedMeDogImg
//var foodS, foodStockReference;
var fedTime, lastFed;
var feedPetButton, addFoodButton;
var foodObj;
function preload()
{
happyDogImg = loadImage("images/happilyFed.png");
feedMeDogImg = loadImage("images/feedMe.png");
}
function setup() {
database = firebase.d... | true |
8e3222f4827ee1b02fb7dad3bfd0afcc6cc636f0 | JavaScript | hellwst/weather_app | /src/app.js | UTF-8 | 4,390 | 3.15625 | 3 | [] | no_license | const API_KEY = '89a6e20f6592b6aeeebfeeb6b1a16947';
const ROOT_URL = ``;
// Zmienne z elementami DOM
const searchInput = document.getElementById("js_search-input");
const searchButton = document.getElementById("js_search-btn");
const searchResults = document.querySelector(".results__header");
const errorMsg = document... | true |
3b1ac3e4c8d265123b670476655c8f821366a124 | JavaScript | rolortizg/skateGame | /main.js | UTF-8 | 11,288 | 2.875 | 3 | [] | no_license |
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
//constants
var interval;
var frames = 0;
var images = {
bg:"./images/pixil-frame-1.png",
skater1:"./images/Sprite1.png",
skater2:"./images/Sprite2.png",
skater3:"./images/Sprite3.png",
doggy1:"./images/doggy3.png",
doggy2... | true |
919a9e00357b44a5fd314d2f754574ddfb505619 | JavaScript | kenneth-rebello/Six-Sigma | /client/src/components/stats/stacked/getChartData.js | UTF-8 | 3,170 | 2.828125 | 3 | [] | no_license | const config = {
chart: {
type: 'bar'
},
title: {
text: 'Compare User Statistics'
},
subtitle:{
text: ''
},
xAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},
yAxis: {
min: 0,
title: {
text: 'Number ... | true |
ff36ff0bb923d5a88246dee5491696ed754c9a7d | JavaScript | ilyakooo0/ilyakooo0.github.io | /javascript/internet.js | UTF-8 | 406 | 2.5625 | 3 | [
"MIT"
] | permissive | function update() {
$("input").each(function() {
let r = Math.random() >= 0.5;
$(this).prop("checked", r);
})
}
window.onload = function() {
$("input").each(function() {
$(this).change(function () {
let w = $(this).prop("checked")
update()
$(this).prop("checked", w);
$("#telegram").prop("checked",... | true |
b65114ab683cb53f024e31887a1091ba40071782 | JavaScript | hsw1111/prison | /src/store/modules/menuModule.js | UTF-8 | 2,538 | 2.578125 | 3 | [] | no_license | import * as types from '../types.js'
import staticRoute from '../../router/staticRoute.js'
const state = {
items:[],
isLoadRoutes: false,
staticRoute
}
const mutations= {
[types.ADD_MENU](state ,authList){
if(authList == null || authList.length === 0){
state.items = []
}else{... | true |
9f76cce04fc3b6936bb8a1451c384b4ad18ae16a | JavaScript | anvk/TweetGeoViz | /client/src/reducers/tweets.js | UTF-8 | 1,358 | 2.625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /* global google */
import * as types from '../constants/actionTypes.js';
const initialState = {
uuid: undefined,
isSearching: false,
tweets: [],
selectedTweets: [],
searchString: ''
};
function getTweetsHTML(tweets, searchString) {
let result = [];
const keywords = searchString.split(','... | true |
fbb32a521f971ce5df220cdb1f81efdd9dc18f6d | JavaScript | padamshrestha/leetCodeEveryday | /230_kthSmallest.js | UTF-8 | 1,125 | 4.46875 | 4 | [] | no_license | // Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.
// Note:
// You may assume k is always valid, 1 ≤ k ≤ BST's total elements.
// Example 1:
// Input: root = [3,1,4,null,2], k = 1
// 3
// / \
// 1 4
// \
// 2
// Output: 1
// Example 2:
// Input: root = [... | true |
f991cd1e30278c2b454517259feed5ef5f95736b | JavaScript | yogurt1/magic | /js/ap.js | UTF-8 | 205 | 2.546875 | 3 | [] | no_license | const ap = (fn, ...args) => (...nextArgs) => fn(...args, ...nextArgs)
const add = (...args) => args.reduce((a, b) => a + b, 0)
const test = ap(ap(add, 1, 2), 3, 4)(5)
ap.test = test
module.exports = ap
| true |
b5c24fc2e9046b2b599da503b8b5787626ac1a01 | JavaScript | Quejao/flight-of-death | /src/boss.js | UTF-8 | 1,670 | 2.6875 | 3 | [] | no_license | class Boss extends Phaser.Sprite {
constructor(game, x, y, img, bulletKey, sound) {
super(game, x, y, img)
this.scale.setTo(1, 1)
this.y = -200
this.SPEED_X = config.BOSS_VELOCITY
this.SPEED_Y = config.BOSS_VELOCITY
this.anchor.setTo(0.5, 0.5)
game.physics.arc... | true |
bd435227f37b40774d0ef419a2a58ba2e761d484 | JavaScript | kmh11/kmh.zone | /music-visualizer/visualizer.js | UTF-8 | 5,506 | 2.59375 | 3 | [] | no_license | var analyser;
var freqData;
var canvas;
var draw;
var cX;
var cY;
last = (new Date()).getTime();
function add(a,b) {return a+b}
function randomNum(max, min = 0) { return Math.random() * (max-min) + min; }
freezeCircle = false;
var circleX;
var circleY;
function toggleCircle() {
if (!freezeCircle) {freezeCircle = tru... | true |
e8d22ed7fba31961bf700064f4a371138652ad98 | JavaScript | vyankovs/underscoreLibrary | /chai/index2.js | UTF-8 | 17,128 | 3.875 | 4 | [
"MIT"
] | permissive | // The comment are for my personal education purposes
// if needed to be deleted I will do it
var _ = {};
let arrNumbers = [4, 5, 6, 19, 58, 4, 85, 8, 699, 4];
let obj = {
testObjOne: 5,
testObjTwo: 10,
testObjThree: 90,
};
let arrayString = ['one', 'two', 'three', 'four'];
let extendDefaultsTest = {};
// Ne... | true |
9df511bf6947bfbb65333b525854897071588878 | JavaScript | wurzy/DAW2020 | /T5/api.js | UTF-8 | 10,675 | 2.828125 | 3 | [] | no_license | function badRequest(req,res){
res.writeHead(200,{'Content-Type': 'text/html; charset=utf-8'})
res.write("<p> Pedido não suportado: " + req.method + ", " + req.url + "</p>")
res.end()
}
function parseLink(data) {
var arrData = data.split("link:")
data = arrData.length == 2? arrData[1]: data;
var... | true |
455fa443b485c4e436b576b7b228addf51f0d623 | JavaScript | mattiasrunge/mqtt2can-bridge | /lib/mqttmanager.js | UTF-8 | 1,867 | 2.546875 | 3 | [
"MIT"
] | permissive | "use strict";
const EventEmitter = require("events");
const mqtt = require("mqtt");
class MqttManager extends EventEmitter {
constructor(configuration, protocol) {
super();
this.config = configuration;
this.protocol = protocol;
this.mqttmessagelist = {};
}
connect() {
... | true |
4e01e3e99329e64103221cfae953ef924c79dfbe | JavaScript | tanwar1998/fe-docker | /react/src/js/components/@dexter/dexterui-tools/lib/utils/lang/isNullish.js | UTF-8 | 942 | 3.265625 | 3 | [] | no_license | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/**
* @method isNullish
* @desc More specific t... | true |
6991c1359a16320a7f14d6fdd61c1b7bd9a9e0a0 | JavaScript | Zipexpo/ngl | /build/js/src/chemistry/interactions/refine-contacts.js | UTF-8 | 8,842 | 2.53125 | 3 | [
"MIT"
] | permissive | /**
* @file Refine Contacts
* @author Alexander Rose <alexander.rose@weirdbyte.de>
* @private
*/
import { Vector3 } from 'three';
import { Debug, Log } from '../../globals';
import { defaults } from '../../utils';
import { ContactDefaultParams, isMasterContact } from './contact';
// also allows intra-residue contac... | true |
e5333fbec1b0a63c9e9bbb74d57c098ca3581d55 | JavaScript | phoboPT/one_fork_back | /routes/tax.js | UTF-8 | 1,706 | 2.546875 | 3 | [] | no_license | const express = require('express');
const Tax = require('../models/Tax');
const router = express.Router()
router.get('/', async (req, res) => {
try {
const user = await Tax.findAll()
res.status(200).send(user)
} catch (error) {
res.status(400).send(error)
}
})
router.get('/id/:id'... | true |
056f1f92ee18dad0b3498a523ac18f8c5491980a | JavaScript | zeenotheinventor/algorithms-and-datastructures | /linked-list.js | UTF-8 | 1,899 | 3.6875 | 4 | [] | no_license | class Node {
constructor(data) {
this.data = data;
this.next = null;
}
}
class LinkedList {
constructor() {
this.head = null;
}
/**
* Add data to this list
* @param {any} data
*/
append(data) {
if (!this.head) {
this.head = new Node(data);
return;
}
let curren... | true |
b4382611cff7a295a596181aca56ca40e5a2edab | JavaScript | iminemantis/old-site | /old sites/site 1/components/header.js | UTF-8 | 888 | 2.53125 | 3 | [] | no_license | class Header extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
this.innerHTML = `
<style>
.header {
background-color: #444444;
padding: 20px 20px 20px 20px;
margin: 0px;
text-align: center;
z-index: 1;
}
.header a {
text-decoration: none;
... | true |
56657dc8422c3b75e46aebc0bb29fc6e44334d94 | JavaScript | cmcculloh/greek | /public/questions.js | UTF-8 | 15,933 | 2.8125 | 3 | [] | no_license | // const additionQuestion = (number) => {
// let sub = Math.floor(Math.random() * number);
// if (sub === 0) sub = 1;
// const theirAnswer = prompt(`${sub} + ${number - sub} =`);
// return theirAnswer * 1 === number * 1;
// }
// const BLOCKS = {
// D: { type: 'dirt', test: () => additionQuestion(5) },
// T: { ... | true |
40b96cf044256d9e38d197b28d73efe6dff78fd4 | JavaScript | readwarn/algo-task | /app.js | UTF-8 | 1,665 | 4.375 | 4 | [] | no_license | // TASK 1
const convertFahrToCelsius = (fahrenheit)=>{
let fahr = Number(fahrenheit);
let celcius;
if(!isNaN(fahr) && typeof fahrenheit !=="boolean"){
celcius = ((fahr - 32) / 1.8).toFixed(4);
}
else if(Array.isArray(fahrenheit)){
celcius = `${JSON.stringify(fahrenheit)} is not ... | true |
ad2fc1bbdeabea0de21aa79407b1f976e7c9a2bc | JavaScript | williambrunos/RocketSeat-JavaScript | /src/fudamentals/Functions.js | UTF-8 | 3,582 | 4.6875 | 5 | [
"MIT"
] | permissive | /* Function Statement - Declaração de função:
function name(parameters) {
code
.
.
.
return variable
}
Funtion invoque - Invocar a função:
name(args)
*/
/*
Por quê funções?
- Separação das responsabilidades do código => Dar significado ao código... | true |
a4037f66fb5d746be1c5a6a94a725fec7f9b1ae5 | JavaScript | ichg4354/catchMyMind | /src/socketController.js | UTF-8 | 3,466 | 2.65625 | 3 | [] | no_license | import events from "./events.js";
import express from "express";
import { chooseRandomWord } from "./words.js";
import { restart } from "nodemon";
const GAMERUNTIME = 30000;
let sockets = [];
let gameStatus = false;
let leader = null;
let word = null;
let timeOutId = null;
export const handleSocketConnection = (sock... | true |
41c3781fe6f61c422c7322c5b5d07bd9879ec745 | JavaScript | magicxin/deepstudy | /typescript/index.js | UTF-8 | 747 | 3.265625 | 3 | [] | no_license | let val = 'aaavvvv';
let num = val.length;
let num1 = val.length;
function printLabel(labelObject) {
console.log(labelObject.label);
}
let myObj = { size: 10, label: "Size 10 Object" };
printLabel(myObj);
;
function printLabel1(labelObject) {
console.log(labelObject.label);
}
printLabel1(myObj);
;
function crea... | true |