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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f967ac4b46ab3abd3c40fcdbd9a2c7021185a638 | JavaScript | yoonjonglyu/algorithmTestEX | /leetcode/1~100/1.TwoSum.js | UTF-8 | 1,006 | 3.84375 | 4 | [
"MIT"
] | permissive | /**
* @param {number[]} nums
* @param {number} target
* @return {number[]}
*/
const twoSum = function(nums, target) {
for(let int = 0; int < nums.length; int++){
for(let int2 = int + 1; int2 < nums.length; int2++){
if(nums[int] + nums[int2] === target){
return [int, int2];
... | true |
21969fd2271c9aa067c4d4f2771cd147e416ec2e | JavaScript | ForestLin2020/MoviesList | /src/utils/paginate.js | UTF-8 | 280 | 2.625 | 3 | [] | no_license | import _ from "lodash";
export function paginate(items, pageNumber, pageSize) {
const startIndex = (pageNumber - 1) * 4;
// _.slice(startIndex, endIndex)
// or _.slice(startIndex).take(size)
items = _(items).slice(startIndex).take(pageSize).value();
return items;
}
| true |
bfaa4446449f4a708ab310ff70b7f5e2c08500db | JavaScript | wojiaoyueyongxiang/wojiaoyueyongxiang.github.io | /benoitchalland/js/index.js | UTF-8 | 1,034 | 2.671875 | 3 | [] | no_license | function rollFun(){
var wheel = document.getElementById('wheel');
var content = document.getElementById('two');
var timing = document.getElementsByTagName('timing');
var lis = document.getElementsByTagName('li');
var imgs = content.getElementsByTagName('img');
var bgcl = document.getElementById('bgcl');
var cl=[... | true |
9cb56cb38e01507bfbc091e4c4567af865ee8782 | JavaScript | asascience/react-component-lib | /src/components/TagInput/TagInput.js | UTF-8 | 3,463 | 2.78125 | 3 | [] | no_license | import React, {Component} from 'react';
import PropTypes from 'prop-types';
import ChipInput from 'material-ui-chip-input';
/*
* A tag input field that allows users to pick several tags out of a set of suggestions.
*/
class TagInput extends Component {
/**
* @param {object} props - the text box's props.
* @par... | true |
88219fb5d7d4ab2e8426a7722270e996c3ffd8e6 | JavaScript | mathycoder/seating-chart-native3 | /src/reducers/studentsReducer.js | UTF-8 | 3,250 | 2.875 | 3 | [] | no_license | import { combineReducers } from 'redux'
const studentsReducer = combineReducers({
byId: studentsById,
allIds: allStudents,
loading: loading
})
export default studentsReducer
function studentsById(state = {}, action) {
switch(action.type) {
case 'FETCH_STUDENTS':
return {
...normalizedObjec... | true |
e8963342a6a9b468b6d94db0f926fd6c3cdae6b5 | JavaScript | cloudyar/learningJS | /node.js/express/server_static.js | UTF-8 | 1,075 | 2.6875 | 3 | [] | no_license | var express = require('express');
var app = express();
var birds = require('./birds'); //require birds mini-app
app.set('view engine', 'jade');
app.use('/birds',birds); //learn express.Router
//app.use(express.static('public'));
app.get('/', function(req,res) {
res.render('index', {title: 'Hey', message: 'Hello the... | true |
ee622abbf0ff8c91015742c0516d5dc8bea8733a | JavaScript | DesignMP/Embraco_VymenaRobotaUR_A2021002 | /Temp/Transfer/Config1/AB2_CPU/FilesToTransfer/AddonsData/IAT_Data/wwwRoot/BRVisu/widgets/brease/common/libs/redux/view/HTMLView/HTMLView.js | UTF-8 | 2,077 | 2.609375 | 3 | [] | no_license | define([
'widgets/brease/common/libs/BoxLayout'
], function (BoxLayout) {
'use strict';
var HTMLView = function (props, parent) {
this.render(props, parent);
};
var p = HTMLView.prototype;
p.render = function render(props, parent) {
this.el = $(BoxLayout.createBo... | true |
fb4822373c5944a8b3fb1204dbbbd2105754e6e0 | JavaScript | SajiburMunna/rProject1 | /src/components/Cart/Cart.js | UTF-8 | 1,162 | 2.640625 | 3 | [] | no_license | import React from 'react';
import './Cart.css'
import Product from '../Product/Product';
const Cart = (props) => {
const Cart =props.cart;
// const total=Cart.reduce((ttotal,prd)=>ttotal+prd.price,0);
// const vat=(totalPrice*0.075) ;
// const fTotal= (totalPrice + vat) ;
let total= 0;
fo... | true |
3899adfe926410b4214ea7a73f48604fcb8ee130 | JavaScript | themud2001/eCommerce | /frontend/src/reducers/authReducer.js | UTF-8 | 891 | 2.765625 | 3 | [
"MIT"
] | permissive | const INITIAL_STATE = {
isLoggedIn: null,
error: null,
user: null
};
const authReducer = (state=INITIAL_STATE, action) => {
switch(action.type) {
case "CHANGE_LOGGED_IN":
return { ...state, isLoggedIn: action.payload };
case "LOGIN_ERROR":
return { ...state, erro... | true |
716f3c9f6b46d468f1c71d32ddc8026d63bfd476 | JavaScript | vaaPo/eh_training | /understand_this/understand-javascript-s-this-keyword-in-depth/08-egghead-this-in-class-bodies/script_part2.js | UTF-8 | 725 | 4.15625 | 4 | [] | no_license | // Part 2
// class
/**
* My Node version doesn't support class fields yet, so I'm first going to compile my code using 'Babel',
* npm run babel in the terminal. As you can see, the class field has been transformed
* into a property assignment in the constructor.
* I can now pipe that code into Node. Everything... | true |
7fcc9e2579d73a1cc6bb6417ce0ea74322933eb4 | JavaScript | guzmang/Master-Javascript-Bases | /poo-y-typescript/js/01-clase-json.js | UTF-8 | 278 | 2.90625 | 3 | [] | no_license | var bicicleta = {
color: "Rojo",
modelo: "BMX",
frenos: "De disco",
velocidadMaxima: "60km",
cambiaColor: function(nuevoColor) {
// bicicleta.color = nuevo.color;
this.color = nuevoColor;
console.log(this);
}
}
console.log(bicicleta);
bicicleta.cambiaColor("Azul"); | true |
e7cc2fbd026f2396dabbdb30789bba285eb5b500 | JavaScript | cn-d/browser-painter | /popup.js | UTF-8 | 2,263 | 3.125 | 3 | [] | no_license | function getCurrentTabUrl(callback) {
let queryInfo = {
active: true,
currentWindow: true
};
chrome.tabs.query(queryInfo, (tabs) => {
let tab = tabs[0];
let url = tab.url;
console.assert(typeof url == 'string', 'tab.url should be a string');
callback(url);
... | true |
d91ae1496b2f48b940813ea719871a2c415e2e32 | JavaScript | Rebecca70/arcade-game | /js/app.js | UTF-8 | 3,739 | 3.890625 | 4 | [] | no_license | /* General instance of variable Enemy */
var Enemy = function(x, y, speed) {
this.x = x;
this.y = y;
this.width = 50;
this.height = 50;
this.speed = speed;
this.sprite = 'images/enemy-bug.png';
};
/* Single Enemy start position and speed */
var enemy1 = new Enemy (0, 60, 150);
var enemy2 = new Enemy (0, 14... | true |
ea886abd5c8e089476e360da6ee9d1b65f25ec81 | JavaScript | JesseE/data-entry | /assets/frontend/scripts/controllers/articleController.js | UTF-8 | 4,869 | 2.515625 | 3 | [] | no_license | var articleDataName = [];
var articleDataScore = [];
//spa routing with angular
var app = angular.module('myApp', ["ngRoute"]).
config(['$routeProvider', '$locationProvider',
function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true).hashPrefix('!');
$routeProvider
.when... | true |
0d565ed1228ff69736b0692d1eea43c8f6932f74 | JavaScript | BrandonTaft/DigitalCrafts | /week-10/friday/activity/src/App.js | UTF-8 | 409 | 2.921875 | 3 | [] | no_license |
import React,{useState} from 'react'
function App(){
const [count, setCount] = useState(99)
const handleIncrement = () => {
setCount(count + 1)
}
const handleDecrement = () => {
setCount(count - 1)
}
return(
<div>
<h1>{count}</h1>
<button onClick = {handleIncrement}>Increment</button>
... | true |
140a97986b8f44d71497d0c2db5c6154062a56bb | JavaScript | MiltonLiquinchana/SistemaGestionComunitariaNewDesign | /build/web/Vista/js/factura/JSfactura.js | UTF-8 | 3,157 | 2.53125 | 3 | [] | no_license | var ref_input = document.querySelectorAll('input');
window.addEventListener("load", inicioJsFactura);
function inicioJsFactura() {
var cookieValor = document.cookie.replace(/(?:(?:^|.*;\s*)consumo\s*\=\s*([^;]*).*$)|^.*$/, "$1");
var data = new FormData();
data.append("accion", "buscarDatosFactura");
da... | true |
38d3e7f7ae06732fd2d02aad8defa2d9cb8cb81d | JavaScript | beyondme121/guigu-managment-react | /src/learn/router/product-detail.jsx | UTF-8 | 950 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react'
export default class ProductDetail extends Component {
state = {
detail: []
}
componentDidMount () {
// 请求数据, 更新状态
setTimeout(() => {
const result = [
{ id: 1, name: 'sanfeng', salary: 999 },
{ id: 2, name: 'lisi', salary: 888 },
... | true |
f68844d13f991eb13aaf3fcbf9fd884c4d65b727 | JavaScript | eichners/SAVI_6 | /School_WebProject/2_SchoolSize_2006-2015/js/SchoolSizeScript.js | UTF-8 | 22,020 | 3.140625 | 3 | [] | no_license | // FINAL PROJECT SCHOOL SIZE CHANGES: 2006 - 2015 MAP
// BASED ON CLASS 12: EXAMPLE WTIH ANNOTATION
// D3.js PIE CHART and LEAFLET and BOOTSTRAP
// Goal: to create map showing growth and decline of public and charter schools over the last ten years
// - separate and show data for charters and public
// - use differen... | true |
f7559688c41c3aa0cd64a5cbd0130cca9957b7f1 | JavaScript | Warm-men/my-project-from-company | /LT毕业版-wechat-web/wechat-web/src/app/reducers/brands_reducer.js | UTF-8 | 1,188 | 2.609375 | 3 | [
"MIT"
] | permissive | const PER_PAGE = 50
const initialState = {
brands: [],
isMore: true,
isLoading: true,
page: 1
}
// production
const unusedBrands = [
'delete',
'wrong1',
'yystyle',
'naersi-selected',
'cloris-meet',
'innaeydn',
'lnnns',
'max-studio',
'axs'
]
const storeBrands = (state, action) => {
let old... | true |
b8d191c3dc8c79b5bfd5ecb88083c453925ca8bf | JavaScript | ErickAi/2019-11-otus-spring-aytkulov | /hw-13-book-library-acl/frontend/src/services/BookDataService.js | UTF-8 | 609 | 2.546875 | 3 | [] | no_license | import http from "../http";
class BookDataService {
getAll() {
return http.get("/books");
}
get(id) {
return http.get(`/books/${id}`);
}
findByAuthor(authorName) {
return http.get(`/books/author/${authorName}`);
}
findByGenre(genreName) {
return http.get(`... | true |
adc9fdef6af65b6dae4fb636f7ebf3dffd7c8b90 | JavaScript | beedu18/marks | /calc.js | UTF-8 | 781 | 3.125 | 3 | [] | no_license | var sessional;
var min = [95,85,75,60,50,40];
const gr = (5/3);
var lines;
function calc(sessional) {
lines = '';
lines += '<tr><th colspan = "6" id="top">Minimum marks required (out of 100) for respective grades</th></tr>';
lines += '<tr id="mid"><th>O (10)</th><th>E (9)</th><th>A+ (8)</th><th>A (7)</th><t... | true |
39b6a28ad76217d44dcc8b863af6ff089908264e | JavaScript | Chukalov816/Fundamentals | /MathPower.js | UTF-8 | 254 | 3.390625 | 3 | [] | no_license | function math(number,power){
console.log(mathPower(number,power));
function mathPower(x,y){
let result=1;
for (let i = 0; i <y; i++) {
result*=x;
}
return result;
}
}
math(2,8) | true |
5c82293b48e7eaf98c7e081177a0a05e88239f37 | JavaScript | AmanDubey10198/sorting_app | /src/utils/SortingAlgorithms/sortFunction.js | UTF-8 | 598 | 2.625 | 3 | [] | no_license | const {BubbleSort} = require('./BubbleSort');
const {InsertionSort} = require('./InsertionSort');
const {SelectionSort} = require('./SelectionSort');
const {QuickSort} = require('./QuickSort');
const {MergeSort} = require('./MergeSort');
function sortFunction(algoName){
switch(algoName){
case "Bubble Sort"... | true |
7caf7747e7cc9274d8aff241b0f876b016ddd4b8 | JavaScript | learn-co-students/SENG-LIVE-062821 | /Phase-1/06-fetch-p2/src/index.js | UTF-8 | 2,546 | 3.84375 | 4 | [] | no_license | //Will run callback after dom has loaded
document.addEventListener('DOMContentLoaded', () => {
fetchAllPokemon()
})
//Render ------------------------------------------------------------
function renderSinglePokemon(pokemon){
//Using Create Element
let divContainer = document.createElement('div')
let divFrame =... | true |
eda1ab18a25b45b3ba869835308f29f7fe5ede5d | JavaScript | Caarloh/PolloRobot | /js/scriptablero.js | UTF-8 | 8,284 | 2.53125 | 3 | [] | no_license | //variables
let tareaArrastrable;
let numeroTarea = 1;
let dropzones = document.querySelectorAll('.dropzone');
let nombre;
let descripcion;
let prioridad;
let fecha;
// Tituos de las Tableros y colores
let dataColors = [
{color:"gray", title:"Pendiente"},
{color:"green", title:"En Proceso"},
{color:"blue",... | true |
ac7d3497885d8a00f704a18c74c97039e7cddc1b | JavaScript | Ahuang0107/Front-Tech-Learning | /js/LeetCode/初级算法/数组/LC 删除排序数组中的重复项.js | UTF-8 | 441 | 3.46875 | 3 | [] | no_license | /**
* @param {number[]} nums
* @return {number}
*/
var removeDuplicates = function(nums) {
let i=0,len=nums.length;
while(i<len){
if(nums[i]===nums[i+1]){
nums.splice(i+1,1);
len--;
}else{
i++;
}
}
return nums.length;
};
let test = [];
test... | true |
84758597f883aeafe6aa45b8c33529f3a3053a16 | JavaScript | MLobanov/BrightBoxTask | /Site/Login.js | UTF-8 | 785 | 2.53125 | 3 | [] | no_license | var Login = function (callback) {
var html = '<div id="LoginDiv">Логин: <input id="Login"><br/>Пароль: <input id="Password" type="password"><br/><button id="btnLogin">Вход</button></div>'
var loginForm = $(html);
loginForm.find('#btnLogin').click(function () {
$.getJSON('Login.ashx', { Login: $... | true |
b21c5c3975598da3a2c9876d36b8fcefe8ce52a2 | JavaScript | blackbeardev/design_agency_website | /js/script.js | UTF-8 | 2,474 | 3.40625 | 3 | [] | no_license | $(document).ready(function() {
//Declare variables
var category,
title,
desc,
overlay;
//Set up an event listener for when the user clicks on a nav item
$("nav a").on("click", function() {
//Remove the "current" class from all nav items
$("nav li.current").removeClass("curre... | true |
171b233d25d73d9e214ec6e3ce52c8cb6ac3da0a | JavaScript | papawattu/dongle | /src/bridge/outgoing.js | UTF-8 | 662 | 2.796875 | 3 | [] | no_license | export default class Outgoing {
constructor ({net,host,port,receive}) {
this.host = host;
this.port = port;
this.net = net;
this.receive = receive;
this.socket = null;
}
connect(cb) {
console.log('Connecting to : ' + this.host + ' : ' + this.port);
thi... | true |
9ab0df25acfbd50de8f9d198d91d4fa31d69ac91 | JavaScript | gallardolopezmiguel/connections | /MONGODB/app/controllers/commentsController.js | UTF-8 | 1,667 | 2.515625 | 3 | [] | no_license | const Comment = require('../models/commentsModel');
const User = require('../models/userModel');
const addComment = (req, res) => {
const saveComment = new Comment(req.body);
saveComment.save()
.then(comment => {
User.populate(comment, {path: 'user'}, (err, data) => {
if (err) {
... | true |
13f9cc0043552526a21e422b536ed6c8b4b00eb9 | JavaScript | cqlql/svg-draw | /src/lib/draw-arc.js | UTF-8 | 902 | 3.046875 | 3 | [] | no_license |
/**
* 画弧
*
* 容器120,圆半径50,10为居中偏离值
*
* @param {number} startRadian
* @param {number} endRadian
*
*
*
* 返回路径 path d 值
* */
export default function drawArc({
startRadian = 0,
endRadian
}) {
// 圆的顶点坐标(圆最高的点),基础起始点,以此点作为起始画圆
let ognY = 10 // 根据容器可能会有所调整,目前容器 120
let ognX = 50 + ognY
... | true |
ce2cdf5677b3be1f12fe99862febfd73e6e0777e | JavaScript | yoannyalvarez/yoannyalvarez.github.io | /discount.js | UTF-8 | 973 | 3.84375 | 4 | [] | no_license | function calculator() {
// INPUT: Getting the subtotal, that the user has entered and store it in a variable and using .getDay to get current day.
let subtotal = parseFloat(document.getElementById('subtotal').value);
let dayOfWeek = new Date().getDay();
/*
PROCESSING:
Declaring a variable that ... | true |
0464ed3ecfec1ac74e4b26b3935269f8ebc0cf3d | JavaScript | humu2009/webgl-nature-scene | /src/transform.js | UTF-8 | 2,470 | 2.703125 | 3 | [] | no_license | /**
@preserve Copyright (c) 2011 Humu humu2009@gmail.com
This file is freely distributable under the terms of the MIT license.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without re... | true |
476a968fb4f1a3bc5cc28ebf008f0819151c3481 | JavaScript | bodok2/javascript | /js/5-datatypes.js | UTF-8 | 465 | 4.15625 | 4 | [] | no_license | /*let liczba = 50;
let tekst = "Tu będzie tekst - string";
let trueFalse = true;
let tablica = [1,2,3].length; //tablica[0]
let object = {
klucz: "Monika" //object["klucz"] lub object.klucz
};
console.log(typeof object.klucz);*/
//console.log( object.klucz);
//ES5
let number = 10;
let zdanie = "wyświetl" + numb... | true |
3187f70ed3f0aa9dcc31cf503cea6fd586a3240a | JavaScript | truongginjs/CheckInJavascript | /script.js | UTF-8 | 897 | 3.46875 | 3 | [] | no_license | var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
var latitude = 10.8308996, longitude = 106.778896;
function showPosition(po... | true |
b87cff196741f1e356caacc7f48956290c41e1c8 | JavaScript | raadu/js-problem-solving | /Sorting/test.js | UTF-8 | 455 | 3.703125 | 4 | [] | no_license | function bubbleSort(a) {
let arr = [...a];
let arrayLength = arr.length;
while(arrayLength) {
for(let i=0; i<arrayLength; i++) {
if(arr[i] > arr[i+1]) {
let temp = arr[i];
arr[i] = arr[i+1];
arr[i+1] = temp;
}
}
... | true |
e30b8600bbccb1fe40bcb056e5f37267cd2dfee6 | JavaScript | davidmfreese/React-GestureRecognizerMixin | /examples/gestureRecognizer-PanAndTap/example.js | UTF-8 | 5,061 | 2.65625 | 3 | [
"MIT"
] | permissive | var gestureRecognizer = ReactGestureRecognizer;
var PanGestureRecognizer = gestureRecognizer.Recognizers.PanGestureRecognizer;
var TapGestureRecognizer = gestureRecognizer.Recognizers.TapGestureRecognizer;
var GestureRecognizerMixin = new gestureRecognizer.GestureRecognizerMixin();
var GeometryModels = gestureRecogniz... | true |
02c875b527adef38e0064bd0b35ad54cf859bbf2 | JavaScript | MalishenkoSV/884319-keksobooking-17 | /js/util.js | UTF-8 | 2,312 | 3.484375 | 3 | [] | no_license | // util.js
'use strict';
(function () {
var DEBOUNCE_INTERVAL = 500; // ms
/**
* Создает рандомное число
* @param {number} min — минимальное число
* @param {number} max - максимальное число
*/
var getRandomFromInterval = function (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + m... | true |
c993930120d37210094e9ee84e9b8df4622b9b54 | JavaScript | riyanhax/Demi3D | /tools/solver.js | UTF-8 | 2,239 | 2.578125 | 3 | [
"MIT"
] | permissive | var srcPath = process.argv[2];
if (srcPath == undefined){
console.log("Please specify the expression file.");
process.exit(1);
}
var win = process.argv[3];
var fs = require('fs')
String.prototype.endWith=function(str){
if(str==null||str==""||this.length==0||str.length>this.length)
return false;
if(this.substrin... | true |
2303fae148649ee518aabf28de9a54fbd926c1a0 | JavaScript | SimoneCarnio/string-template-js | /index.js | UTF-8 | 1,660 | 3.21875 | 3 | [
"MIT"
] | permissive | /**
* String templating utility that creates new string literals based on templates and embedded expressions (or values).
* A template is given as a string, which similar to the `ES6 Literal Templates` contains
* placeholders that will be replaced with actual values or expressions, whereas the actual values or
* ex... | true |
8e3443340f6bd0a959904c598f84b74e5b4c4b62 | JavaScript | mocon/svg-constellations-react | /src/components/Constellation.js | UTF-8 | 1,604 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Star from './Star';
import Connector from './Connector';
import { randomIntBetween } from '../helpers/random';
class Constellation extends Component {
renderLines = () => {
const { starCoords } = this.props;
const... | true |
365a5ba39f36376f21480d475641b7f3b85b426e | JavaScript | kukuu/Apps-WebServices | /AJAX/js/json.js | UTF-8 | 730 | 4.125 | 4 | [] | no_license |
//Simple Object
var myCat = {
"name":"Meaosalot",
"species":"cat",
"favfood":"tuna"
}
//Acessing an Object
// to access favfood
myCat.favfood;
// to access nmae
myCat.name;
//2. Acessing simple Array
var myFavColors = ["blue","green","purple"];
//Acessing list in an array using indexes. Zero based
myFavColors[... | true |
410347326325e736dd637da2b3a78f299b6a02dc | JavaScript | DDavi23/JSOpenSourceLibrary | /Jstutorial/1.61_arrays_loops.js | UTF-8 | 255 | 3.734375 | 4 | [] | no_license | //use a for loop to process each item
var rainbowColors = ['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Indigo', 'Violet'];
for (var i = 0; i < rainbowColors.length; i++) {
console.log(rainbowColors[i]);
}
//prints out each colors
| true |
9e28cb396631d944b8845e77a602e66248e42281 | JavaScript | draganabogicevic/BIT-PP | /ExamStatistics/js/exam.js | UTF-8 | 415 | 2.921875 | 3 | [] | no_license |
export default class Exam {
constructor(subject, student, grade) {
this.subject = subject,
this.student = student,
this.grade = grade
}
getExamInfo() {
return `${this.getSubjectName()}${this.getStudentData()}`
}
hasPassed() {
let hasPassed = true;
if... | true |
6a77857a6678ddc72ac102a204e1feb5094920b7 | JavaScript | thitoribeiro/programming | /modern-javascript/section 1-3/aula17/index.js | UTF-8 | 135 | 3.21875 | 3 | [] | no_license | //Funções
function saudacao(nome) {
console.log(`Bom dia ${nome} !`);
}
saudacao('Thito');
saudacao('Silvia');
saudacao('Sophia'); | true |
3aad35d50aa6fbec23244702a676e2da69e1e909 | JavaScript | jaimeirazabal1/tesis-mejorada | /models/user.js | UTF-8 | 1,945 | 2.5625 | 3 | [] | no_license | var client = require("../db")();
var md5 = require("MD5");
var user = function(){
var respuesta;
var obj = {};
obj.find = function(callback){
client.query('SELECT * from "usuario"',function(err,result){
if (err) {
console.log(err)
};
callback(result,err)
});
}
obj.findById = function(id,callback){... | true |
e040dd42544577ec4b3ea39098770031957d45c1 | JavaScript | 2824760019/bi | /src/page/utils/utils.js | UTF-8 | 985 | 2.5625 | 3 | [] | no_license | // 项目配置文件
const {config} = require('../../../config');
import axios from 'axios'
let util = {};
/**
* @description 获取网络数据
* @param path 请求路径
* @param params 请求参数
* @param fail 失败回调 失败在前为约束一定要处理错误情况
* @param success 成功后回调
*/
// post请求
util.postData = (path, params, fail, success, token = '', complete) => {
axios... | true |
ed8d493b0d17ca85f121937442ba85f04b45ef10 | JavaScript | aherreDev/hw_8 | /models/Product.js | UTF-8 | 541 | 2.78125 | 3 | [] | no_license | class Product{
constructor(code, name, description, amount, price){
let canContinue = this._productParams(code, name, description, amount, price)
if(!canContinue) throw "Invalid product params"
this.code = code
this.name = name
this.description = description
this.amount = amount
this.price... | true |
0b6eaf0a4df9b305b4959fa35e742494faaf0b02 | JavaScript | paulguevarra/favorite-things | /js/scripts.js | UTF-8 | 360 | 2.71875 | 3 | [] | no_license | $(document).ready(function() {
$(formOne).submit(function(event) {
var person1Input = $("input#person1").val();
var colorInput = $("input#color").val();
var animalInput = $("input#animal").val();
var blanks = [person1Input, colorInput, animalInput];
$("#blanks").text(blanks);
blanks.splice(... | true |
02e4343351516816324b6105d9bc2197901d1e70 | JavaScript | rvalim/mlk-hackerrank | /src/greedy/dijkstra.js | UTF-8 | 1,552 | 3.078125 | 3 | [] | no_license | //https://www.hackerrank.com/challenges/dijkstrashortreach
// Complete the shortestReach function below.
export function shortestReach(nodes, edges, s) {
const edgesMapper = {};
const distances = new Array(nodes + 1).fill(Infinity); // create with 1 more item to avoid index calcs
const previousNodes = new ... | true |
d3da8d5207607ec7a53a74bc8478d15c3d2463ea | JavaScript | Kavin0016/CM_task_4 | /js/script2.js | UTF-8 | 1,081 | 2.734375 | 3 | [
"MIT"
] | permissive | window.addEventListener('load',toggle);
document.querySelector('#register').addEventListener('click',store);
function toggle(){
document.querySelector('#error').classList.toggle('visibility');
document.querySelector('#incorrect').classList.toggle('visibility');
}
function store(event){
event.preventDefault();
if(... | true |
addb43ced99402263f97b206e8c08577207d3073 | JavaScript | iproha94/bmstu-simulation | /lr2/app/src/kernel.js | UTF-8 | 1,208 | 3.28125 | 3 | [] | no_license | function erfc(x) {
// constants
var a1 = 0.254829592;
var a2 = -0.284496736;
var a3 = 1.421413741;
var a4 = -1.453152027;
var a5 = 1.061405429;
var p = 0.3275911;
// Save the sign of x
var sign = 1;
if (x < 0) {
sign = -1;
}
x = Math.abs(x);
// A&S form... | true |
398b0f11d19d998b0b450c3cc095c2b22a83e13d | JavaScript | SanDiegoCasey/SureLifeData-Front | /src/reducers/policyReducer.js | UTF-8 | 725 | 2.53125 | 3 | [] | no_license | import { GET_POLICIES, ADD_POLICY, DELETE_POLICY, ITEMS_LOADING } from '../actions/types';
const initialState = {
items: [],
loading: false
}
export default function (state = initialState, action) {
switch (action.type) {
case GET_POLICIES:
return {
...state,
items: action.payload,
... | true |
3167ed69099e4580295ac6bcca843f65b34713b4 | JavaScript | adecapite/TeamProfile-Generator | /lib/Engineer.js | UTF-8 | 614 | 3.40625 | 3 | [] | no_license | // including Employee class
const Employee = require("./Employee");
// Engineer class extending Employee class used to return employee name, id, email, github
class Engineer extends Employee {
// passing through arguments
constructor(name, id, email, github) {
// passing through original arguments from Employe... | true |
c946f219702b5856623589990a89e690338ab3a2 | JavaScript | raphaelbruno/laravel-vue | /public/js/multiple-upload.js | UTF-8 | 3,719 | 2.546875 | 3 | [] | no_license | var MultipleUpload = (function (name, addedItems) {
var files = addedItems ? addedItems : new Array();
var element = document.querySelector('#multiple-upload-' + name);
document.addEventListener("dragenter", function (event) {
Object.values(document.getElementsByClassName('drop-here')).forEach(func... | true |
98ebaba2022f41f5379d155ee13401fbb9430124 | JavaScript | ripliveit/riplive.it | /public/js/app/services/search-service.js | UTF-8 | 2,738 | 2.5625 | 3 | [
"MIT"
] | permissive | 'use strict';
angular.module('riplive')
/**
* Implements business logic to
* related to the user's search operation.
*
* @param {Object} $injector
* @return {Object}
*/
.service('searchService', function searchService($injector) {
var Search = $injector.get('search');
/**
* A configuration object
... | true |
7b53dce153cb1f704d381a5b8e9fb9407e4d2147 | JavaScript | panbr/run2code | /app/projects/draw/js/main.js | UTF-8 | 2,678 | 3.484375 | 3 | [] | no_license | /**
* 你画我猜
* @author panbr
* @time 2018-05-09 01:15:00
*/
// 配置
let op = {
isWrite: false, // 是否在写
writeWidth: 6, // 画笔粗细
writeColor: '#000', // 画笔颜色
}
// 定义绘画类
class Draw {
constructor(id) {
this.canvas = document.getElementById(id);
this.ctx = this.canvas.getContext("2d");
this.initStyle(... | true |
d3492f82719843d743c1a66eb85f402ef8dd0ad9 | JavaScript | dcb9/loom-pet-shop-tutorial | /src/components/Pets.js | UTF-8 | 1,458 | 2.65625 | 3 | [] | no_license | import React, { Component } from 'react';
import Pet from './Pet.js';
import './Pets.css';
import Contract from '../contract'
const pets = require('../pets.json')
class Pets extends Component {
constructor(props) {
super(props)
this.contract = new Contract()
this.state = {
adopters: {},
}
}... | true |
b1cdab3e8dd2fb8e0b43d71b55d93c2220eba042 | JavaScript | KevinPagliuca/Googlon | /src/utils/getVerbs.js | UTF-8 | 940 | 3.40625 | 3 | [] | no_license | const fooType = ['s', 'j', 'n', 'c', 'q'];
export async function getVerbs(text) {
const splitedTxt = await text.split(' ', text.length);
const Verbs = [];
const firstPerson = [];
splitedTxt.map(txt => {
if (txt.length >= 7) {
while (
txt.substr(txt.length - 1, 1) !== 's' &&
txt.subst... | true |
e9189212fc0b48d5ccbea0daf7787e258e183210 | JavaScript | PRudge/test_algorithms | /oranges-and-apples.js | UTF-8 | 984 | 3.4375 | 3 | [] | no_license | const assert = require('assert');
const numHits = function(s, t, a ,b, apples, oranges) {
let distance = 0;
let hits = {};
let fruitCount = 0;
let fruit = "";
getDistanceCount("appleHits",hits, apples, a, s, t);
getDistanceCount("orangeHits",hits, oranges, b, s, t);
return hits;
}
const getDistanceCo... | true |
18d576bf851e39511c7befe5d83df8239047a709 | JavaScript | zhestkov/epmlab_node | /01-blackjack/app.js | UTF-8 | 4,749 | 3.15625 | 3 | [] | no_license | const fs = require('fs');
const prompt = require('prompt');
const colors = require('colors/safe');
const LOG_FILE = 'log.txt';
const FILE = process.argv[2] || LOG_FILE;
const GOAL_POINTS = 21;
const DEALER_MINIMAL_POINTS = 17;
const YES = 'yes';
const NO = 'no';
const START_GAME = 'Start the game?';
const TAKE_CARD = ... | true |
5c732316d0cd689c81ee763ffb22553ca36de727 | JavaScript | yoogchu/yoogchu.github.io | /scripts/loader.js | UTF-8 | 858 | 2.90625 | 3 | [] | no_license | function attach(element,listener,ev,tf){
if(element.attachEvent) {
element.attachEvent("on"+listener,ev);
}else{
element.addEventListener(listener,ev,tf);
}
}
function fadeOut(element,startLevel,endLevel,duration,callback){
var fOInt;
op = startLevel;
fOInt = setInterval(function() {
if(op<=e... | true |
d1a54f60822533675baded4536c082b43c55f64d | JavaScript | indiumsoftware1/zupervisor | /static/js/likelihoodslider.js | UTF-8 | 2,068 | 2.84375 | 3 | [] | no_license |
var sheet = document.createElement('style1'),
$rangeInput = $('.range2 input'),
prefs = ['webkit-slider-runnable-track', 'moz-range-track', 'ms-track'];
document.body.appendChild(sheet);
//likelihood slider
var getTrackStyle = function (el) {
var curVal = el.value,
val = (curVal - 1) * 24.666666667,
style1 = ''... | true |
e801f99200dc4486fcafbcac58134c694c33d1f9 | JavaScript | tronderiklarsen/pe2-tel-omega | /js/cart.js | UTF-8 | 2,227 | 3.0625 | 3 | [] | no_license | import { getCartItems } from "./components/cartFunctions.js";
const cart = getCartItems();
const container = document.querySelector(".cart-container");
if (cart.length === 0) {
container.innerHTML = "You have nothing in the cart";
}
const priceTotal = document.querySelector(".cart-total");
let total = 0;
cart.fo... | true |
277063c7b48efa715a6b0e265d95ccb2435c6c2d | JavaScript | Mogushkov/ahj-sse-ws | /src/js/app.js | UTF-8 | 1,731 | 2.578125 | 3 | [] | no_license | import Chat from './Chat';
const ws = new WebSocket('wss://ahj-sse-ws-serv.herokuapp.com');
const chat = new Chat(document.querySelector('.container'));
const form = document.querySelector('.form');
const textarea = document.querySelector('.textarea');
let nickname = null;
form.addEventListener('submit', (e) => {
... | true |
af29edc91812a931b5506cb5477c29129f7de875 | JavaScript | ruderngespra/logit-js | /tmp/old/selectScope.js | UTF-8 | 940 | 2.78125 | 3 | [
"MIT"
] | permissive | // Ein Modul, mit dessen Hilfe der Bereich ausgewählt wird, der danach
// von logit umgeschrieben werden soll.
module.exports = function(codeString, { start, end }) {
const startRegEx = new RegExp('\\w*//\\s' + start + '\\s*\\n');
const endRegEx = new RegExp('\\w*//\\s' + end + '\\s*\\n');
if (
cod... | true |
7cf900aca0d1ddc44a9290584cfa665a78720cc9 | JavaScript | fgridley/art-of-generation-sketches | /noise/noise-steps-animated.js | UTF-8 | 834 | 3.34375 | 3 | [] | no_license | const xInc = 0.006;
const yInc = xInc;
const numSteps = 10;
const zInc = 0.007;
let zOffset;
function setup() {
createCanvas(300, 300);
pixelDensity(1);
zOffset = 0;
}
function draw() {
loadPixels();
let xOffset = 0;
for (let x = 0; x < width; x++) {
yOffset = 0;
for (let y = 0... | true |
3cd57c240d2ce0ff2f559b7d7b5a1b4656dde4cb | JavaScript | solvikarlstefansson/solvikarlstefansson.github.is | /Verkefni06-Skjaskipting/sketch.js | UTF-8 | 844 | 3.15625 | 3 | [] | no_license | var h=180;
var s=0;
var j = 180;
var r = 0;
function setup() {
createCanvas(400,400);
background(0,0,0);
colorMode(HSB);
rectMode(CENTER);
}
function draw(){
if(!mouseIsPressed){
if(mouseX<200&&mouseY<200){
fill(h,100,100)
h++
if(h>=360){
h=180
}
elli... | true |
a5d7aea1997d1e7376ef75ca7aaeb39b23684ff1 | JavaScript | manjunathva2018/calculator | /public/assets/custom.js | UTF-8 | 406 | 3.125 | 3 | [] | no_license | $(document).ready(function(){
var matrix=[1,2,8,9,1,4,7,2,12,1,15,0];
var result=[];
for(var i=0;i<matrix.length;i++){
let index=0;
let num = matrix[index];
if(i<index+3){
let res= matrix[i+1]+num;
if(res>=10){
result.push(0)
}
else{
result.p... | true |
b66c18fbdad06c66eb1743871edfbc960a86bf66 | JavaScript | jialongshi1994/javascript-challenge | /StarterCode/static/js/app.js | UTF-8 | 2,193 | 3.25 | 3 | [] | no_license | // from data.js
const tableData = data
// YOUR CODE HERE!
const $datetime = document.getElementById('datetime')
const $city = document.getElementById('city')
const $state = document.getElementById('state')
const $country = document.getElementById('country')
const $shape = document.getElementById('shape')
const $ufoT... | true |
723d305945329d593958e22949d54f20e619bd2d | JavaScript | everscalecodes/freeton-notification-service | /public/js/messages.js | UTF-8 | 1,432 | 2.671875 | 3 | [] | no_license | $(document).on('change','#customerId',function(){
});
$(document).on('change','#secret',function(){
document.cookie = "secret=" + $(this).val()
});
$( document ).ready(function() {
$('#secret').val(getCookie('secret'));
});
function getCookie(name) {
let matches = document.cookie.match(new RegExp(
"... | true |
1928c67368b0d5f13a0e35cb209b54d0da47125f | JavaScript | AnNOtis/annotis.github.io | /scripts/new-article.js | UTF-8 | 1,414 | 2.703125 | 3 | [] | no_license | 'use stricts'
const fs = require('fs')
const inquirer = require('inquirer')
const v = require('voca')
const dateFns = require('date-fns')
const currentTime = new Date()
const date = dateFns.format(currentTime, 'YYYY-MM-DD')
const time = dateFns.format(currentTime, 'YYYY-MM-DD HH:mm:ss ZZ')
const prompts = [
{
... | true |
a77b1540eb7ad1dc2ad0407dba4231cedb8115b5 | JavaScript | k-ivan/canvas-noise | /src/noise.js | UTF-8 | 2,395 | 3.09375 | 3 | [
"MIT"
] | permissive | class Noise {
constructor(container = document.body, options) {
if (document.getElementById('canvas-noise')) return;
this.canvas =
this.ctx =
this.canvasData =
this.ctxData =
this.imageData = null;
this.container = container;
this.settings = Object.assign({
size: ... | true |
e2cfc0df37ea868a1c1eaa741f1b64da5126a83f | JavaScript | DGS-2/taskr-java | /client/src/actions/taskActions.js | UTF-8 | 2,830 | 2.5625 | 3 | [] | no_license | import axios from "axios";
import { GET_TASK, GET_TASKS, ADD_TASK, DELETE_TASK, GET_ERRORS, TASK_LOADING, ADD_SUB_TASK, REPLY_TO_THREAD } from "./types";
// Add a task
export const addTask = taskData => dispatch => {
axios.post('/tasks', taskData)
.then(res => dispatch({
type: ADD_TASK,
payload: res... | true |
88cee00cdaa480e53412f13df3a3c08fb1018683 | JavaScript | dearwendy714/web-231 | /week-5/Portillo-exercise-5.3.js | UTF-8 | 1,011 | 3.84375 | 4 | [] | no_license | /*
============================================
Title: Exercise-5.3.js
Author: Wendy Portillo
Date: June 27, 2019
Description: Object Collections
===========================================
*/
// Load additional JavaScript file
var header = require("../header.js");
// Outputs the header to the console
console.... | true |
0cb187d151531b7b14c95e3198186c8b50a2cdfb | JavaScript | TamaraMarr/web-apps | /unitTests/appModule.js | UTF-8 | 251 | 2.75 | 3 | [] | no_license | var add = function(a, b) {
return a + b;
}
var doSomethingVerySlow = function(){
setTimeout(function() {
callback("done");
}, 5000);
}
module.exports.add = add;
module.exports.doSomethingVerySlow = doSomethingVerySlow; | true |
b79f5ba522d33f35fc9968b719f5a6cd7b301e57 | JavaScript | swc-project/swc | /crates/swc_ecma_minifier/tests/fixture/issues/7402/input.js | UTF-8 | 418 | 3.453125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | export function mutate(out) {
out[0] = 1;
out[1] = 2;
out[2] = 3;
return out;
}
export const myFunc = (function () {
const temp = [0, 0, 0];
return function (out) {
const scaling = temp;
mutate(scaling);
out[0] = 1 / scaling[0];
out[1] = 1 / scaling[1];
... | true |
50405e4ff557a98921f1b7be3377d7972b990822 | JavaScript | MaryMaks88/JS | /L22_test/L22_HW.js | UTF-8 | 2,503 | 3.125 | 3 | [] | no_license | //-------------------
let data = new Promise(function(resolve, reject){
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if(this.readyState != 4) return;
resolve(this.responseText);
}
xhr.open('GET', '/data.json');
});
data
.then(resp => {
resu... | true |
5333c960b3c5ab5e9c58db1c582c5bb8cc25d4eb | JavaScript | alex-wilmer/june-26-lhl-lecture | /src/index.js | UTF-8 | 476 | 2.53125 | 3 | [] | no_license | import React from "react";
import { render } from "react-dom";
import "./index.css";
let ctx = new AudioContext();
let osc = ctx.createOscillator();
osc.connect(ctx.destination);
osc.start();
window.onmousemove = event => {
document.body.style.backgroundColor = `hsl(${event.clientX}, 60%, 60%)`;
osc.frequency.... | true |
4f67dee2828846bb76a32efe6451cda9cff26bd5 | JavaScript | jlg-formation/njs-mars-21 | /public/main.js | UTF-8 | 999 | 2.875 | 3 | [] | no_license | /* eslint-disable no-undef */
console.log('main start');
window.getDetails = function (id) {
console.log('id: ', id);
window.location = `/details/${id}`;
};
const selectedArticleIds = new Set();
window.toggle = function (id) {
console.log('toggle id: ', id);
if (selectedArticleIds.has(id)) {
selectedArti... | true |
cb5a59e5aa586f5e197de1307356ec11a0bce239 | JavaScript | Al3nMicL/js-basics-online-shopping-lab | /index.js | UTF-8 | 3,001 | 3.578125 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | var cart = [];
function getCart() {
return cart;
}
function setCart(c) {
cart = c;
return cart;
}
function addToCart(item) {
let makePrice = () => Math.floor(Math.random() * 100); // assigns a random price
// prepare the object format
let newObj = new Object;
let tempObj = Object.assign(
newObj,
... | true |
12216fc9ba302b7e354f017cac020fff441cffe8 | JavaScript | Milda-Grabyte/modulo-2-evaluacion-intermedia-Milda-Grabyte | /js/main.js | UTF-8 | 2,381 | 3.9375 | 4 | [] | no_license | "use strict"
// Simplify class selection process
function selectClass(className) {
return document.querySelector(className);
}
// Console log function
function feedback(element) {
return console.log(element);
}
const hint = selectClass(".js-hint");
// hint.setAttribute("autocomplete","off"); // des not work, he... | true |
a74443316081ff4c12a63f1b09a60162a58c4953 | JavaScript | Dorely/CIT261Team | /JHSandbox/RPG/scripts/animationStuff.js | UTF-8 | 5,322 | 2.953125 | 3 | [] | no_license |
function enterGameAnimation(){
var topImageUnder = document.getElementById("topImageUnder")
var bottomImageUnder = document.getElementById("bottomImageUnder")
var topButton = document.getElementById("topClassButton")
var middleButton = document.getElementById("middleClassButton")
var bottomButt... | true |
0b5948dd9c23834bb319e64f4cd4eb8671956d63 | JavaScript | Mr-menace/school | /js/sample.js | UTF-8 | 235 | 2.71875 | 3 | [] | no_license | $(document).ready(function(){
$("#txtHint").keydown(function(){
$("#txtHint").css("background-color", "yellow");
});
$("#txtHint").keyup(function(){
$("#txtHint").css("background-color", "pink");
});
});
| true |
cf2a04b6851206b2dc889048adc88485d091dacb | JavaScript | shinnn/restore-npm-cache | /index.js | UTF-8 | 2,659 | 2.53125 | 3 | [
"ISC"
] | permissive | 'use strict';
const {promisify} = require('util');
const {resolve} = require('path');
const {info, stream} = require('npcache').get;
const inspectWithKind = require('inspect-with-kind');
const isPlainObj = require('is-plain-obj');
const mkdirp = require('mkdirp');
const pump = require('pump');
const {Unpack} = requir... | true |
1cbb5660990b4450ed3d3b3a82a59f1a5ff556d2 | JavaScript | Alucard-bit-gif/Clase4 | /Funciones/Ejercicio_2/ejercicio2.js | UTF-8 | 708 | 3.8125 | 4 | [] | no_license | //Declarar variables.
let Juan;
let Aberto;
let Ana;
let Madre;
//Leer datos
Juan= Number(prompt('¿Cual es tu edad Juan?'));
//Procedimiento.
edadAlberto(Juan);
edadAna(Juan);
edadMadre(Juan);
function edadAlberto(Juan){
Alberto= (Juan*2)/3
return Alberto;
}
function edadAna(Juan){
Ana= (Juan*4)/3
... | true |
fd225560ff046da4825b184d1547a5e456a624b6 | JavaScript | AlaminMJ/Problem-Solving-challenge-100 | /array object property and return a array.js | UTF-8 | 714 | 3.65625 | 4 | [] | no_license | /*
*Array object propert and return a object
*author : Alamin hossain
*Date: 12/08/21
*/
const persons=[
{
id: 1001,
name:'Alamin',
age:20
},
{
id: 1002,
name:'Rakib',
age:22
},
{
id: 1003,
name:'Jihad',
age:24
},
{
id: 1004,
name:'Naim... | true |
abd06914bfa79c9f605b8f098b91330ab2112379 | JavaScript | fijiwebdesign/fijiwebmail | /public/js/mail.keyboardshortcuts.js | UTF-8 | 884 | 2.609375 | 3 | [] | no_license | /**
* Keyboard shortcuts for mail app
* @param {Object} $ jQuery object
*/
(function($) {
// domReady
$(function() {
// bind functionality to keyup events
$(window).bind('keyup', function(event) {
// configuration of keyCodes mapped to urls to go to
var keyMap = {
'Inbox' : { keyCode: 73, url: '?ap... | true |
095609148e65a2ee06ec8efbf8055de1ca374ee8 | JavaScript | eduardo-haddad/admin.videobrasil.online | /v2/public/assets/proposta-comercial/js/plugin/Instagram Developer Documentation_files/2ccc68edcffd.js | UTF-8 | 824 | 2.53125 | 3 | [
"MIT"
] | permissive | // Image Fallback
function imageFallback(el) {
var fallbackURL = "//instagram-static.s3.amazonaws.com/bluebar/images/default-avatar.png";
if(el.parentNode.className.indexOf("img-") > -1 && el.parentNode.tagName.toLowerCase() == 'span')
{
el.parentNode.setAttribute("style", el.parentNode.getAttrib... | true |
aae8530456a22783f27ae0231c5e7ddf9fa0a8bc | JavaScript | uidezignlab/servicehunt | /js/scroll.js | UTF-8 | 379 | 2.53125 | 3 | [] | no_license | var pxShow=600;
var scrollSpeed=500;
var topEl = $('.back-top');
var topElChild = $('.back-top a');
$(window).scroll(function(){
if($(window).scrollTop()>=pxShow){
topEl.addClass('visible');
}else{
topEl.removeClass('visible');}
});
topElChild.on('click',function(){
$('html, body').a... | true |
7db49a9444dc1da67069c3a13c8e62f1386c2a85 | JavaScript | ayubwisesa/latihan | /exercise/week2/exercise6.js | UTF-8 | 1,083 | 4 | 4 | [] | no_license | //soal no 1
console.log("LOOPING PERTAMA");
var x = 0;
while (x < 20) {
x += 2;
console.log(x + " - I love coding");
}
console.log("LOOPING KEDUA");
var x = 20;
while (x >= 2) {
console.log(x + " - I will become fullstack developer");
x -= 2;
}
//soal no 2
console.log("LOOPING PERTAMA");
for (var x ... | true |
1c5c6d9c69aa4988fdbdd4c140921182e4979f77 | JavaScript | dfrankland/threejs-water | /dist/js/CausticsInfo.js | UTF-8 | 1,638 | 2.671875 | 3 | [
"MIT"
] | permissive | /*
* sydneyzh 2016
*/
function CausticsInfo(params){
this.renderer = params.renderer;
// texture dimension
var w = params.w;
var h = params.h;
this.debug = params.debug;
var targetOptions = {
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter,
type: THREE.FloatType,
ste... | true |
f620c2bde75216643a935a4d8ee68ab545deb2c0 | JavaScript | guilhermealvesc/Web-Dev-2021 | /mongodb/nodeJs/mongoose/app.js | UTF-8 | 467 | 2.90625 | 3 | [] | no_license | //jshint esversion:6
const peopleCollection = new (require("./db/people"))();
async function run() {
try {
const person = {
name: "John",
age: 26,
};
await peopleCollection.deleteAll();
await peopleCollection.insertPerson(person);
const p = await peopleCollection.findPerson({ name: "... | true |
99ac34c247122ad72b8c5feccf5b50dbb6a07b9e | JavaScript | gwacamaya/e-commerce-appli | /frontend/src/actions/commande-list.js | UTF-8 | 548 | 2.578125 | 3 | [] | no_license | export function commande_list_GET() {
return fetch('http://localhost:8000/commande-list', {
mode: "cors",
method: "GET",
headers: {
"Accept": "application/json"
},
cache: "no-store"
})
.then(response => {
if (response.status >= 200 && res... | true |
e756eb03be2e9c89e339a1220e6c081f6ab053c7 | JavaScript | lezhumain/frsons | /src/Design/InitializrBundle/Resources/public/js/responsive_menu.js | UTF-8 | 456 | 2.640625 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | /*
Utilisation:
Ajouter la class "menu-responsive" a ul
Ajouter un noeud ' <div class="menu-small">
<img src="img/bandes_menu.png"/>
</div> '
avant votre ul, dans le même wrapper
Ajouter l'image dans le dossier img
*/
$(document).ready(function()
{
$('.menu-small').click(function()
{
if( $('.m... | true |
f7f3962cd5329e0c89d06dcf035e028269e4b7ab | JavaScript | EzeRebasa/node-03-bases | /multiplicador/logica.js | UTF-8 | 290 | 2.8125 | 3 | [] | no_license | const colors = require('colors/safe');
const logica = (base, limite) => {
let resultado = '';
for (let i = 1; i <= limite; i++) {
resultado += base + colors.red('*') + i + colors.magenta('=') + base * i + '\n';
}
return resultado;
}
module.exports = {
logica
} | true |
c5250618daee810b1bac973a7b1d7074b6971bf1 | JavaScript | DakotaDong/tol-p3 | /node/main.js | UTF-8 | 5,962 | 3.25 | 3 | [
"MIT"
] | permissive | /* Get questions & options */
var questionList = [];
var optionList = [];
function readJson(path, next) {
$.ajax({
type: 'GET',
url: path,
dataType: 'json',
success: function(data) {
console.log(data);
next(data);
}
});
}
/* Generate quiz */
var currentIndex = 0;
// pick feedback t... | true |
51fa29fdade9e17caf902dab16c22f9447cf781b | JavaScript | mpw5/fq-scores-mike | /src/datastore.js | UTF-8 | 7,779 | 3.078125 | 3 | [
"MIT"
] | permissive | //
// This is a library file implementing functions for storing and working with data in your MongoDB.
//
"use strict";
var mongodb = require('mongodb');
// Standard URI format: mongodb+srv://dbuser:dbpassword@host/dbname?retryWrites=true&w=majority, details set in .env
// eg mongodb+srv://mpw5:<password>@fq-scores-t... | true |
7ebce587731530379a853f9fa9a1c78b953ecdda | JavaScript | web-monsters/food-market | /core/utilities/strings/translator/Translator.js | UTF-8 | 1,061 | 2.5625 | 3 | [] | no_license | import Strings from "~/core/utilites/strings";
class Translator {
constructor() {
this.helperText = {
plural: {
review: ["отзыв", "отзыва", "отзывов"],
days: ['день', 'дня', 'дней'],
hours: ['час', 'часа', 'часов'],
minutes: ['минута', 'минуты', 'минут'],
seconds: ['... | true |
95119c1033e69486e16c93639ec7fe42c7d6c887 | JavaScript | Maryucha/EstudosJavaScript | /MóduloE/while.js | UTF-8 | 509 | 3.453125 | 3 | [] | no_license | console.log('---------------------')
console.log("1 Tudo bem?")
console.log("2 Tudo bem?")
console.log("3 Tudo bem?")
console.log("4 Tudo bem?")
console.log("5 Tudo bem?")
console.log("6 Tudo bem?")
console.log('---------------------')
var cont = 1, frase,idade=0
frase = 'Tudo bem?'
while (cont <= 6) {//teste no ini... | true |