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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7ebe9035ea5b00febf6020f8c09f12cf24ece9a4 | JavaScript | abidRahim/Javascript-practice | /Day-wise-AltCampus-javascript-projects/Day 3/Project/practice.js | UTF-8 | 8,150 | 4.3125 | 4 | [] | no_license | // Write a function named tellFortune that:
// takes 4 arguments: number of children, partner's name, geographic location, job title.
// outputs your fortune to the screen like so: "You will be a X in Y, and married to Z with N kids."
let job = prompt("Enter your job title");
let children = prompt("Enter the number of... | true |
c14f77f780527ab968ad5ef43ac60512f3a2b2e8 | JavaScript | Artozey/qwertymol.github.io | /MergeClicker/js/engine.js | UTF-8 | 2,692 | 3.59375 | 4 | [] | no_license | var elems = [] // прямой порядок, в то время как els - обратный
function clickElem (n) {
var els = document.getElementById("elems")
elem = els.childNodes[elems.length - n - 1]
if(elems[n].currClicks < elems[n].elem.clicksNeeded) {
elems[n].currClicks++
elem.childNodes[0].childNodes[1].innerHTML = elems[n].curr... | true |
675f341634b81ff84d51fe13c2421c1dcdefc1b0 | JavaScript | igortrinidad/serranatural | /resources/assets/js/prototypes.js | UTF-8 | 3,808 | 2.921875 | 3 | [] | no_license | Number.prototype.format = function(n, x) {
var re = '\\d(?=(\\d{' + (x || 3) + '})+' + (n > 0 ? '\\.' : '$') + ')';
return this.toFixed(Math.max(0, ~~n)).replace(new RegExp(re, 'g'), '$&,');
};
// numero.formatMoney('2', ',', '.')
Number.prototype.formatMoney = function(c, d, t){
var n = this,
c = isNaN(c... | true |
8b2b145c2da0356c400bd065f431cf5b8152d466 | JavaScript | JavFr/spotify-app | /src/redux/reducers/reducer.js | UTF-8 | 477 | 2.5625 | 3 | [] | no_license | import { SEARCH_IS_LOADING, SEARCH_UPDATE_RESULTS } from '../actions/actionTypes';
const initialState = {
resultOfSearch: null,
searchIsLoading: false
}
export const reducer = (state = initialState, action) => {
switch (action.type) {
case SEARCH_UPDATE_RESULTS: return { ...state, resultOfSearch: ... | true |
916063c9993f69ea7dfe5ff65fecd4584b4157d9 | JavaScript | alexskreen/Triangle-Tracker-Test | /__tests__/triangle.test.js | UTF-8 | 989 | 3.09375 | 3 | [] | no_license | import { Triangle } from './../src/triangle.js';
describe ('Triangle', () => {
test ('should correctly create a triangle object with three lengths', () => {
var triangle = new Triangle(2,4,5);
expect(triangle.side1).toEqual(2);
expect(triangle.side2).toEqual(4);
expect(triangle.side... | true |
ed87b78e655b7331ccb1c34aedcd56e74abb84b2 | JavaScript | Financial-Times/n-conversion-forms | /utils/app-banner.js | UTF-8 | 766 | 2.609375 | 3 | [] | no_license | class AppBanner {
constructor(window) {
if (!window) {
throw new Error('Please supply a Window object');
}
this.$banner = window.document.querySelector('.ncf__app-banner');
if (!this.$banner) {
throw new Error('Please include the app banner partial on the page');
}
this.$androidAction = this.$bann... | true |
bf757dfab9d1aa214883d23ab9a8b8f71191fac0 | JavaScript | liorix/riot-skeleton | /jspm_packages/npm/6to5@3.5.3/lib/6to5/generation/position.js | UTF-8 | 492 | 3.296875 | 3 | [
"MIT"
] | permissive | /* */
"use strict";
module.exports = Position;
function Position() {
this.line = 1;
this.column = 0;
}
Position.prototype.push = function (str) {
for (var i = 0; i < str.length; i++) {
if (str[i] === "\n") {
this.line++;
this.column = 0;
} else {
this.column++;
}
}
};
Position... | true |
66042055a28b712cbdf2c60c1fba74063c2a326c | JavaScript | yeony1011/2019script_ex | /select/select.js | UTF-8 | 1,320 | 3.265625 | 3 | [] | no_license | "use strict";
(function(){
var regionSelect = document.querySelector(".opt_comm");
var selectedRegion = document.querySelector(".btn_selected"); //querySelector, getElementById : dom list 출력
var txtChoice = document.querySelector(".txt_choice");
var valRegion = document.querySelector("#valRegion");
... | true |
9a1d02dbe95e4f528ba0e3412b25d0eb4ea61f31 | JavaScript | charleshenryhugo/japan-map-puzzle-v2 | /js/views/mapContainerView.js | UTF-8 | 2,537 | 2.796875 | 3 | [] | no_license | import PuzzlePiece from './puzzlePiece';
class MapContainerView {
constructor() {
this._parentElement = document.querySelector('.map-container');
this._whiteMap = this._parentElement.querySelector('svg');
this._whiteMapInnerFrame = this._whiteMap.getElementById('inner-frame');
this._whiteMapOuterFram... | true |
0c95b43a1ebfa46b0deffcd471b37186ce8106c8 | JavaScript | brigand/NodeWorld-OpenShift | /operations.js | UTF-8 | 18,600 | 3.6875 | 4 | [] | no_license | /*
* Operations do minor calculations,
* have safeguards against unexpected arguments,
* and always return an expected result.
*/
// Capitalize first letter of a string, and return the resulting string.
function upperFirst(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
// Shorthand for Object.... | true |
b2f30a381085abc1a3f4c7f716a74d9a62a46e58 | JavaScript | Yordan432/JS-Core | /2.JS Advanced/05.Excercise - Jquery/incrementCounter.js | UTF-8 | 727 | 2.984375 | 3 | [] | no_license | function increment() {
let wrapper = $('#wrapper');
let textArea = $('<textarea class="counter" value="" disabled="">');
textArea.val(0);
$('#wrapper').append(textArea);
let incrementBtn = $('<button class="btn" id="incrementBtn">Increment</button>')
.on('click', function(){
let increme... | true |
72c25cfa4fa0ef5c457d39d93f1f841b13d6dc10 | JavaScript | amaas-fintech/amaas-core-sdk-js | /src/core/AMaaSModel/AMaaSModel.js | UTF-8 | 953 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | /**
* Class representing a AMaaSModel.
* This is the base class for almost every other class.
* @memberof module:core
*/
class AMaaSModel {
/**
* Construct new AMaaSModel object
* @param {object} params - AMaaSModel creation options:
* @param {string} [params.createdBy] - ID of the user that created the ... | true |
66611abf3a409560c406290010a5576d7741c1cb | JavaScript | jscomponents/NavigationJS | /js/BuildNavigations.js | UTF-8 | 4,201 | 2.703125 | 3 | [
"MIT"
] | permissive | /**
* BuildNavigationActions
*/
var BuildNavigations = {
init: function() {
this.createMainNavigation();
this.createSecMenuNavigation();
this.createGuideMenuNavigation();
},
/**
* Create main menu navigation
*/
createMainNavigation: function() {
var actions = [], action = {};
var log = document... | true |
e1afb2f5deaca450ca0b663e57df20a2c80b4e67 | JavaScript | evanmags/snippets | /modules/list.js | UTF-8 | 351 | 2.90625 | 3 | [
"MIT"
] | permissive | /**
* prints a list of all user snippets to the console.
* @param {User} user
*/
async function listSnippets({ snippets }) {
snippets.forEach(({ title }, i) => {
process.stdout.write(`${title}\t`);
if ((i + 1) % 5 === 0)process.stdout.write('\n');
});
process.stdout.write('\n');
process.exit(0);
}
... | true |
106d308bf084a5efee8d73d7c46c1f687c379869 | JavaScript | elanalynn/express_templating_warmup | /server.js | UTF-8 | 841 | 2.78125 | 3 | [] | no_license | const express = require('express')
const app = express()
const port = 8000
const pokemons = require('./pokemon_list')
app.use(express.static('public'))
app.set('view engine', 'ejs')
app.get('/pokemon', (req, res) => {
res.render('index', {data: pokemons})
})
app.get('/pokemon/:id', (req, res) => {
var ancestor... | true |
1587c2f7041b9a9cc5d2ece489aac56a6e562501 | JavaScript | Tzota/playground | /sc-decisions-digraph/src/lib.js | UTF-8 | 6,964 | 2.828125 | 3 | [] | no_license | if (typeof module !== 'undefined' && module.exports) {
(global||window).ko = require('knockout');
}
//----------------BCL----------------------
class EdgedDigraph {
constructor() {
this._adj = new Map(); //список смежности, vertex -> edge[]
this._v = 0;
this._e = 0;
}
/**
... | true |
4309b2c93dbac4bbef35dbde6f0e4a4b5a1b23bc | JavaScript | qubick/mechanicalPlotter | /plotter/sketch.js | UTF-8 | 1,954 | 3.046875 | 3 | [] | no_license | var paused = false
,portName = '/dev/cu.usbmodem421'
,SerialPort = require("serialPort").serialPort
function setup() {
createCanvas(710, 400)
button1 = createButton('Pause')
button1.position(20, 100)
button1.mousePressed(toggle)
button2 = createButton('Resume')
button2.position(button1.x + button... | true |
c87ff67cae97840562a3e2a2570e18271aa5f83a | JavaScript | dacoolman/Periodic | /main.js | UTF-8 | 2,313 | 2.859375 | 3 | [] | no_license | var elementMap = [
'G',1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,
1,'H','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','He',
2,'Li','Be','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','B','C','N','O','F','Ne',
3,'Na','Mg','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','Al',... | true |
9851a3095c49b62192013a843d9b2f893774dc1d | JavaScript | bartecko/js-algorithms | /opposite number.js | UTF-8 | 419 | 3.71875 | 4 | [] | no_license | //algorithm for opposite number
function opposite(number) {
var finalNum;
if (number>0) {
finalNum = "-" + number;
finalNum = Number(finalNum);
}
else if(number==0){
finalNum = number;
}
else{
finalNum = number.toString();
finalNum = finalNum.s... | true |
c6dab44dce6293ea38decaa37e602773addc4b7c | JavaScript | SimonRichardson/squishy-pants | /src/check.js | UTF-8 | 7,241 | 3.5625 | 4 | [
"MIT"
] | permissive | //
// # QuickCheck
//
// QuickCheck is a form of *automated specification testing*. Instead
// of manually writing tests cases like so:
//
// assert(0 + 1 == 1);
// assert(1 + 1 == 2);
// assert(3 + 3 == 6);
//
// We can just write the assertion algebraicly and tell QuickCheck to
// automaticaly ... | true |
6a5f55af060854419df640b9964fdebd5696c63b | JavaScript | kinolag/kodolag | /src/frontend/components/gallery-get.js | UTF-8 | 3,314 | 2.859375 | 3 | [] | no_license | //import React not necessary as this is just a function
import poster001 from '../img/pugni_in_tasca.jpg';
import poster002 from '../img/eclisse.jpg';
import poster003 from '../img/americano_a_roma.jpg';
import poster004 from '../img/hable_con_ella.jpg';
import poster005 from '../img/ottoemezzo_02.jpg';
import poster0... | true |
beb4fb83d1225bd7a5662aeaee3386047de810f9 | JavaScript | Nav2607/Fighter-Jets | /js/Form.js | UTF-8 | 4,391 | 2.84375 | 3 | [] | no_license | class Form{
constructor(){
this.input = createInput("");
this.button = createButton('Play');
this.greeting = createElement('h2');
this.greeting1 = createElement('h2');
//this.title = createElement('h1');
this.intructions = createElement("h2");
this.intructions1 = cre... | true |
5551a6b3990de405810491cb20fa4d9c9a407baf | JavaScript | sebastiansandqvist/s-valid | /zipCode.js | UTF-8 | 480 | 3.5625 | 4 | [] | no_license | 'use strict';
// ----- zip code
// -- 1. input must be a string
// -- 2. check number
// -- 3. perform regex test
// ---------------------------------------
module.exports = function(str) {
// [1] throws here if not a string
str = str.toLowerCase();
// [2] every zip code begins with a number, and none are < 00... | true |
ad0d9ea16a4b57383815f4e23a44cc7d8adbb4ea | JavaScript | happy-Mary/FD2 | /L9 - Cookie Storage-Drink/TCookieStorage.js | UTF-8 | 1,857 | 2.921875 | 3 | [] | no_license | function TCookieStorage(name, timeMS) {
var self = this;
self.name = String(name);
self.timeMS = parseFloat(timeMS);
var StorageH = {};
// getting ready to work with Storage
self.Reset = function() {
if(name) {
StorageH = JSON.parse(getCookie(name));
// console.log(getCookie(name));
// console.log(J... | true |
77f8492876d1c0d93aa196d0be16822cfda7dd95 | JavaScript | Jeordins-Bois/CardSmart | /src/components/Deck/Question.js | UTF-8 | 2,121 | 2.59375 | 3 | [] | no_license | //Specific Question
import React, { useState } from "react";
import "./Deck.css";
import { makeStyles } from "@material-ui/core/styles";
import { Container, Card, CardContent } from "@material-ui/core";
const useStyles = makeStyles(theme => ({
root: {
display: "flex",
flexDirection: "column",
justifyCont... | true |
b3b1e1dd5fdf3cbbd5a950ed5895374941f807aa | JavaScript | imwalrus/myweb | /js/js.js | UTF-8 | 734 | 3.40625 | 3 | [] | no_license | var name = document.getElementById('show').innerHTML;
console.log(name);
document.getElementById('show').innerHTML = 'World';
var divTag = document.createElement('div');
divTag.innerHTML = 'Nice'; // <div>Nice</div>
document.getElementById('show').append(divTag);
console.log('---------------------------------------')... | true |
d0ada670ae4fc24273be589f3292dd41e5b72bb9 | JavaScript | Antoine-D/project-Space-X | /app.js | UTF-8 | 6,193 | 2.515625 | 3 | [] | no_license | var restify = require ('restify');
var builder = require('botbuilder');
var SpaceXAPI = require('SpaceX-API-Wrapper');
var SpaceX = new SpaceXAPI();
//server
var server = restify.createServer();
server.listen(process.env.PORT || 3978,function(){
console.log("%s listening to %s",server.name,server.url);
});
var con... | true |
d91ad1c2d501f08621afde5f5f72c2e3a3b241fd | JavaScript | Lane235/scalable-maintainable-js-training | /js/modules/module-result.js | UTF-8 | 1,169 | 2.75 | 3 | [] | no_license | define(['jquery', 'underscore','app'], function($, _, APP) {
var results = [
{
"to": 16,
"status": "Диплом бакалавра"
},
{
"to": 23,
"status": "Диплом магистра"
},
{
"to": 30,
"status": "Диплом доктора"
}
];
var defaults = {
... | true |
8c774c33c1216244b3fc369b88d55a4a9f32e4a7 | JavaScript | LexiHH/JavaScript-Training | /for.js | UTF-8 | 120 | 3.296875 | 3 | [] | no_license | for(var i=1; i<=10; i++) {
console.log(i);
if(i%2 == 0) {
console.log("even");
}
else {
console.log("odd");
}
} | true |
78b540f18fe0366768c7b9bed25ae01dad22a7c1 | JavaScript | ThisuraThejith/online | /script.js | UTF-8 | 2,078 | 2.6875 | 3 | [] | no_license | /**
* Created by thisura on 6/22/17.
*/
var app = angular.module("myApp",[]);
app.controller("myCtrl",function ($scope,$http){
$scope.departments = [];
$http.get("http://localhost:8080/departments").then(function (response) {
$scope.departments = response.data;
});
function refreshDepartmen... | true |
04d3f5b7d1d5b7642e6af28a1fbd307de4bd65fc | JavaScript | VarsPtz/ahj-homework-in-memory-sorting | /src/js/app.js | UTF-8 | 3,829 | 3.125 | 3 | [] | no_license | class LoadingSorting {
constructor() {
this.dataJSON = [
{
id: 26,
title: 'Побег из Шоушенка',
imdb: 9.3,
year: 1994,
},
{
id: 25,
title: 'Крёстный отец',
imdb: 9.2,
year: 1972,
},
{
id: 27,
title: 'Крёст... | true |
2272347875582039967a0502569f5a6eeec90ebf | JavaScript | black1ava/Hooks | /useMemo/src/index.js | UTF-8 | 916 | 2.921875 | 3 | [] | no_license | import React from 'react'
import ReactDOM from 'react-dom'
function App(){
const [number, setNumber] = React.useState(0)
const [bg, setBg] = React.useState(true)
function increment(){
setNumber(prevNumber => prevNumber + 1)
}
const time2 = React.useMemo(() => {
return slow(number)
}... | true |
064bf757c22543002f186ba1f82a6ca85203fd0f | JavaScript | damusix/riot | /src/utils/dom.js | UTF-8 | 785 | 2.75 | 3 | [
"MIT"
] | permissive | import {IS_DIRECTIVE} from '../globals'
import {dashToCamelCase} from './misc'
import {get as getAttr} from 'bianco.attr'
/**
* Get all the element attributes as object
* @param {HTMLElement} element - DOM node we want to parse
* @returns {Object} all the attributes found as a key value pairs
*/
export function ... | true |
50a2e8d1c6281afe449dcb90aa4b73319370ba01 | JavaScript | brandon932/js-earnings-calculator | /js/utility.js | UTF-8 | 593 | 3.125 | 3 | [] | no_license | var Calculate = function(valuesArr, tipArr ) {
this.mealPrice = parseInt(valuesArr[0]);
this.taxRate = valuesArr[1];
this.tipPercetage = valuesArr[2];
this.totalTips = tipArr;
};
Calculate.prototype.subTotal = function(){
subTotalPrice = this.mealPrice + (this.mealPrice*(this.taxRate));
return subTotalPrice... | true |
0300dab7cefa19ee58adeb4c34a6e4a18a073686 | JavaScript | iordanbogdanov/softUni | /JSbook/2.2.1.js | UTF-8 | 280 | 3.1875 | 3 | [] | no_license | function solve(args) {
let l = Number(args[0]);
let w = Number(args[1]);
let columns = Math.floor(l / 1.2);
let rows = Math.floor((w - 1) / 0.7);
let totalDesks = (columns * rows) - 3;
console.log(totalDesks);
}
solve([15, 8.9]);
solve([8.4, 5.2]);
| true |
c38176c4614d18b6885f1d040806c88c9d268924 | JavaScript | rainner/binance-watch | /src/modules/viewport.js | UTF-8 | 2,777 | 2.546875 | 3 | [
"MIT"
] | permissive | /**
* Viewport Object.
* Helper for working with viewport data.
*/
const _w = window || {};
const _s = window.screen || {};
const _d = document.documentElement || {};
const _b = document.body || {};
export default {
screenWidth: function() {
return Math.max( 0, _s.width || _s.availWidth || 0 );
},
screenH... | true |
def88d33b663bc58447a313d0846d522941a9e99 | JavaScript | ckyambitny/7balls | /app/scripts/game.js | UTF-8 | 1,774 | 2.640625 | 3 | [] | no_license | 'use strict';
import Configuration from './configuration';
import CollectingState from './states/collecting-state';
import EnemyPresentationState from './states/enemy-presentation-state';
import GameOverState from './states/game-over-state';
import LanguageState from './states/language-state';
import MealState from '... | true |
1754b14e64c30534125d80669f211b07da7c7b37 | JavaScript | freefaller69/DojoAssignments | /WebFundamentals/Javascript/Objects and the DOM/studentsAndInstructors2.js | UTF-8 | 815 | 3.09375 | 3 | [] | no_license | var users = {
'Students': [
{first_name: 'Michael', last_name : 'Jordan'},
{first_name : 'John', last_name : 'Rosales'},
{first_name : 'Mark', last_name : 'Guillen'},
{first_name : 'KB', last_name : 'Tonel'}
],
'Instructors': [
{first_name : 'Michael', last_name : 'Choi'},
{f... | true |
244b2fb2166b9e5d67aee532f48a0b192e0d4c79 | JavaScript | popingalov/tasks | /opi.js | UTF-8 | 5,244 | 3.3125 | 3 | [] | no_license | /* const a = ['a', 'b', 'c'];
const b = [1, [2, 3]];
const c = 0; */
/* const bb = b.pop().concat(b.shift()); */
/* const bbb = b.shift(); */
/* const bb = [b[0]].concat(b[1]);
const asd = [[1, 2, 3, 4]];
console.log(...[...asd]);
const a = ['a', 'b', 'c'];
const b = [1, [2, 3]];
let c = [...b[(1, 1)].concat(b[0])];... | true |
1923dc6fd56b876eec3624518e73613bb0318973 | JavaScript | 2511921-110/wp_dev | /wordpress/wp-content/themes/basic/themify/js/bigvideo.js | UTF-8 | 7,086 | 2.546875 | 3 | [
"GPL-2.0-only",
"MIT"
] | permissive | /*Themify Background Video*/
(function ($, window, document) {
var pluginName = 'ThemifyBgVideo',
isInitialized = false,
defaults = {
url: false,
autoPlay: true,
doLoop: false,
ambient: false,
id: '',
... | true |
b2f22e245afa7bc82191bb8a82903837f3776eb6 | JavaScript | ubc-vsp19/classroom | /lectures/lecture-4/activity4.js | UTF-8 | 301 | 3.125 | 3 | [] | no_license | function addClickListeners (buttons){
for (var i = 0; i < buttons.length; i++){
buttons.addEventListener(“click”, function(){
alert(“Clicked Button ” + i);
});
}
return buttons;
};
var btns = document.getElementsByTagName(“button”);
addClickListeners(btns);
| true |
b8fbef9bfa1081fb4204b7dd6320a860cfcf9eac | JavaScript | kclaka/FullstackOpenUni | /part2/dataforcountries/src/components/Display.js | UTF-8 | 1,278 | 2.5625 | 3 | [] | no_license | import React from 'react'
const DisplayLang = (props) => {
return(
<>
{props.language.map((lang, i) =>(
<ul key={i}>
<li>
{lang.name}</li>
</ul>
))}
</>
)}
c... | true |
038e699437586aef5b020c0ea8ea28ba959d78e6 | JavaScript | giuliano-sider/chrome-extension-experiments | /background_script.js | UTF-8 | 1,596 | 2.546875 | 3 | [] | no_license | chrome.browserAction.onClicked.addListener((tab) => {
chrome.windows.getCurrent({}, (currentWindow) => {
// TODO: Make the coordinates approximately match the active tab.
const top = currentWindow.top;
const left = currentWindow.left;
const height = currentWindow.height;
const width = currentWindo... | true |
ffce08ebfbeb7185008eeddd63df69d1566329ec | JavaScript | calvinmetcalf/liar | /test/test.js | UTF-8 | 30,868 | 2.890625 | 3 | [
"MIT"
] | permissive | 'use strict';
var promise = require('../lib');
require("mocha-as-promised")();
var chai = require("chai");
chai.should();
var chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
describe("Use with Chai as Promised", function() {
it(".should.be.fulfilled", function() {
return promise.resolve().... | true |
db76981c3717f93f5591ba7d15766d28fc71400f | JavaScript | mjb527/winter-sports | /src/Pages/Sports/Layout/index.js | UTF-8 | 631 | 2.546875 | 3 | [] | no_license | // create the two parts of the screen if the sport exists, otherwise return the 404 for sports
import React from 'react';
import { useParams } from 'react-router-dom';
import SportWrapper from '../SportWrapper';
import SportNotFound from '../../PageNotFound';
function Sport() {
const { sport } = useParams();
... | true |
6a61707285a29257b3d58cc44e2f07ab1c13f748 | JavaScript | Jarda8/expenses-manager-server | /categorization.js | UTF-8 | 5,599 | 2.5625 | 3 | [] | no_license | var mysql = require('mysql');
var hasher = require('./hasher');
var pool = mysql.createPool({
host: process.env.HOST || 'localhost',
port: process.env.DB_PORT || '3306',
user: process.env.USER || 'expenses-manager',
password: process.env.PASSWORD || 'Expmngapp9/9',
database: process.env.DATABASE || 'expense... | true |
ed9bb0943f98d9ea8d32c6cc7c135cda8770123e | JavaScript | SatLibRe/react-async-gif-search-lab-nyc-web-010620 | /src/containers/GifListContainer.js | UTF-8 | 1,400 | 2.734375 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import React from 'react'
import GifList from "../components/GifList.js"
import GifSearch from "../components/GifSearch.js"
export default class GifListContainer extends React.Component {
state = {
gifs: [],
searchTerm: ""
}
componentDidMount(){
fetch(`https://api.giphy.com/v1/gif... | true |
d72857f89d973af6a89ebeac26f6ed9a96c7ad7d | JavaScript | KaterynaLikhvar/Online-zoo | /pages/map/script.js | UTF-8 | 5,875 | 2.703125 | 3 | [] | no_license | const mapImg = document.getElementById('map');
const wrapper = document.getElementById('map-container');
const header = document.getElementById('header');
const footer = document.getElementById('footer');
const btnZoomOut = document.getElementById('zoomOut');
const btnZoomIn = document.getElementById('zoomIn');
let co... | true |
cfc69920c5f26c2f349333b404addf3f3c023c4f | JavaScript | matths/blazer | /receiver/grid.js | UTF-8 | 1,061 | 2.90625 | 3 | [] | no_license | "use strict";
if (!window.matths) window.matths = {};
window.matths.grid = (function () {
var _grid;
var _width;
var _height;
var _initGrid = function (w, h) {
_grid = [];
_width = w;
_height = h;
var x = 0;
var y = 0;
while (x <= w) {
_grid[x] = [];
while (y <= h) {
_grid[x][y] = false;
... | true |
e29ba175148237b4d88e8fa55f8db217683ff376 | JavaScript | yurykozhenov/computer-graphics-classes | /polyhedron/canvas.js | UTF-8 | 395 | 2.609375 | 3 | [
"MIT"
] | permissive | export const canvas = document.getElementById('canvas');
export let canvasXCenter = canvas.width / 2;
export let canvasYCenter = canvas.width / 2;
export function setCanvasSize() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
canvasXCenter = canvas.width / 2;
canvasYCenter = canvas.he... | true |
c4c53e01c3d68984ac3121fa07cbabcb470f645f | JavaScript | ilyauts/ProjectEuler | /Problem17.js | UTF-8 | 2,498 | 4.15625 | 4 | [] | no_license | /* Problem 17
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?
NOTE: Do not count spaces or hyphens. For exam... | true |
22b52ba29fad11bb638064f380102a70ef0825c5 | JavaScript | EasonLin0716/Leetcode_Algorithm_Solution | /0532_K-diffPairsinanArray.js | UTF-8 | 1,016 | 3.703125 | 4 | [] | no_license | /**
* @param {number[]} nums
* @param {number} k
* @return {number}
*/
// var findPairs = function (nums, k) {
// /**
// * Approach-1
// *
// */
// let res = 0;
// let hashMap = {};
// for (let i = 0; i < nums.length; i++) {
// for (let j = i + 1; j < nums.length; j++) {
// const a = num... | true |
2c350253a7ded3f600ac319b29c8f7f2136040eb | JavaScript | richdouglasevans/mumtaz | /src/mumtaz/games/support/removeAt.js | UTF-8 | 109 | 2.59375 | 3 | [] | no_license | export function removeAt(index, o) {
const xs = Object.values(o);
delete xs[index];
return xs;
}
| true |
8e1f9d3ed6eb3b1bdafd0220e1167b68bb549b02 | JavaScript | ErwanLent/Kotatsu | /pageNumbers.js | UTF-8 | 4,978 | 2.78125 | 3 | [] | no_license | /* ==========================================================================
Variables
========================================================================== */
const LEADERBOARD_TABLE_PAGES_COUNT = 5;
const LEADERBOARD_PAGES_NAVIGATION_COUNT = 3;
/* ====================================================... | true |
69cfd4564c02475f8aa92155a50ded2051192b63 | JavaScript | jlabedzki/lotide | /flatten.js | UTF-8 | 502 | 3.46875 | 3 | [] | no_license | const flatten = (nestedArray) => {
//* Can use the single return statement below to replace the entire function. Built the function for learning recursion.
// return nestedArray.flat(Infinity);
let output = [];
nestedArray.forEach(e => {
if (Array.isArray(e)) {
let temp = flatten(e);
temp.for... | true |
75f78e40296e4510fd66ac60587d52267a867e98 | JavaScript | dlaststark/machine-learning-projects | /Programming Language Detection/Experiment-2/Dataset/Train/JavaScript/abundant,-deficient-and-perfect-number-classifications-2.js | UTF-8 | 267 | 2.71875 | 3 | [] | no_license | for (var dpa=[1,0,0], n=2; n<=20000; n+=1) {
for (var ds=1, d=2, e=Math.sqrt(n); d<e; d+=1) if (n%d==0) ds+=d+n/d
if (n%e==0) ds+=e
dpa[ds<n ? 0 : ds==n ? 1 : 2]+=1
}
document.write('Deficient:',dpa[0], ', Perfect:',dpa[1], ', Abundant:',dpa[2], '<br>' )
| true |
0738a60ca1d0d3673b844efb613d20d1fdddfd57 | JavaScript | stellastella/second_test | /app/library.js | UTF-8 | 552 | 2.640625 | 3 | [] | no_license | module.exports = {
words: function (string) {
var pattern = /\w+/g,s
matchedWords = string.match( pattern );
var counts = matchedWords.reduce(function ( count, word ) {
if ( count.hasOwnProperty( word ) ) {
count[ word ] = count[ word ] + 1;
} else {
count[ wor... | true |
deb25e2ffaaf769ceefb2cb1278f5f2d0675b3e2 | JavaScript | YanikCeulemans/DotaPicks | /public/js/main.js | UTF-8 | 1,678 | 2.671875 | 3 | [] | no_license | /**
* Created with JetBrains PhpStorm.
* User: yanikceulemans
* Date: 16/12/13
* Time: 00:21
* To change this template use File | Settings | File Templates.
*/
$(function(){
var heroes = $('.hero-container img');
/**
* Get hero images based on a collection of objects that have an id property
*... | true |
21579b30535df8946fa477e8bb748a91b11f9f8e | JavaScript | angelacaterina/js-jsnacks-blocco-1 | /JSnack blocco 4/assets/js/jsnack3.js | UTF-8 | 610 | 3.421875 | 3 | [] | no_license | // 1. Creare un oggetto che rappresenti un triangolo rettangolo, con le seguenti proprietà: base e altezza.
var triangoloRettangolo = {
base : 9,
altezza : 12
}
console.log(triangoloRettangolo);
// 2. Calcolare perimetro e area. (ripassiamo il Teorema di Pitagora ;D )
for(key in triangoloRettangolo){
var base = ... | true |
0060d4a8bdaef9bb9c282c8c2ce9beca02cb831f | JavaScript | SeanMombo/GrokkingCodePatterns | /Leetcode/encoded-string.js | UTF-8 | 668 | 3.703125 | 4 | [] | no_license |
const isChar = (c) => {
if (c.toUpperCase() === c) {
return false;
} else {
return true;
}
}
var decodeAtIndex = function(S, K) {
//variables
//output string
let output = "";
//loop
for (let i = 0; i < S.length; i ++) {
let cur = S[i];
if (isChar(... | true |
5a0715435ae117d40c3d36fcb0baa2dffe384186 | JavaScript | syncrocat/ld43 | /graphics.js | UTF-8 | 21,154 | 2.78125 | 3 | [] | no_license | graphics = {}
graphics.CardObj = function() {
this.animateFrame;
this.sprite;
this.position;
this.interactable;
this.card;
this.destroyCounter;
this.regTexture;
this.hoverTexture;
this.selectedTexture;
this.isHovered;
this.transpText;
this.borderSprite;
this.init = f... | true |
7e665a498661fee1bef28737c8c8f2b3843df3a4 | JavaScript | zeniavilla/checked-rails-app | /app/assets/javascripts/chores.js | UTF-8 | 1,710 | 2.609375 | 3 | [] | no_license | function Chore(attributes) {
this.title = attributes.title;
this.id = attributes.id;
this.frequencyAmount = attributes.frequency_amount;
this.frequencyInterval = attributes.frequency_interval;
this.durationEndDate = attributes.duration_end_date;
this.user = attributes.user;
this.category = a... | true |
b8683ea344926fea71d8d47ceb93cf0340fbc925 | JavaScript | Nikoleta-R/react-pet | /src/components/Pet/Petdetails/PetDetails.js | UTF-8 | 769 | 2.671875 | 3 | [
"MIT"
] | permissive | import React, { useEffect, useState } from 'react';
const PetDetails = ({
match
}) => {
const [pet, setPet] = useState([]);
const id = match.params.id
useEffect(()=>{
fetch(`http://localhost:5002/pets/${id}`)
.then(res => res.json())
.then(res=>setPet(res));
... | true |
c6449ce85649faa6c05b9ab5860532cb951e0197 | JavaScript | crazywsp/Vue-Project | /Vue-Project/vue-project01/src/store/store.js | UTF-8 | 1,090 | 2.546875 | 3 | [] | no_license | import Vue from 'vue'
import Vuex from 'vuex'
// 引用vuex
Vue.use(Vuex)
const state = {
count: 42
}
const getters = {
count: state => {
return state.count += 0
}
/* 等同于如下代码: */
/* count: function(state) {
return state.count += 1000
} */
}
// mutations类似于事件,对状态进行更改,调用方式: $store.c... | true |
b2891088c9a0e13fb78d5931ae1ad875bf2d7705 | JavaScript | GabrielaLucia667/README-TriviaIntelecto | /script1.js | UTF-8 | 1,215 | 3.890625 | 4 | [] | no_license | let correctas = 0; // Contador para respuestas correctas
let incorrectas = 0; // Contador para respuestas incorrectas
function pregunta1(){
let ansText = document.getElementById('pregunta1').value;
if(ansText === 'b'){
document.getElementById('result1').innerHTML = 'Respuesta Correcta!';
correctas+=1;
}else{
... | true |
9848bc40c4420b9897930da8e69262f3b5f09deb | JavaScript | northdark/generator-reactbase | /app/templates/src/index.js | UTF-8 | 443 | 2.71875 | 3 | [] | no_license | import React from 'react';
let App = React.createClass({
render(){
return (
<p>Hello World</p>
);
}
});
React.render(
<App />,
document.body
);
/*
//CMD模式
var React = require('react');
var App = React.createClass({
render:function(){
retu... | true |
0418d9544cf044a597937c48745bfe0f0aabe6b2 | JavaScript | Schwarzam/usvirtualobservatory | /usvao/prototype/operations/projects/notification/trunk/src/topleveldir/js/tools.js | UTF-8 | 6,028 | 2.65625 | 3 | [] | no_license | function datehandler(string)
{
var caldate = document.getElementById("DPC_edit1_YYYY-MM-DD");
var caldateb = document.getElementById("DPC_editnew_YYYY-MM-DD");
arraymonths = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
array ... | true |
3511a40eaa4516580611c92727c93e39a51101f5 | JavaScript | Wayne-Bai/AST-normalize | /data/GoogleChrome/news-reader-app/app/javascripts/vendor/backbone.eventdata.js | UTF-8 | 1,213 | 2.6875 | 3 | [] | no_license | //= require backbone
(function(){
// Cached regex to split keys for `delegate`.
var eventSplitter = /^([^\s\[\]]+)(\[([^\[\]]+)\])?\s*(.*)$/;
// Set up all inheritable **Backbone.View** properties and methods.
_.extend(Backbone.View.prototype, {
delegateEvents: function(events) {
if (!(events || (events = ge... | true |
c9bab10611594c32c649c6e647b9c185500674ac | JavaScript | fiqriabd/tugas4-rsbk-kelompok34 | /src/learn-useReducer/Index.js | UTF-8 | 1,675 | 2.84375 | 3 | [] | no_license | import React, { useReducer } from "react";
import "./Index.css"
function reducer(state, action) {
switch (action.type) {
case 'increment':
return {count: state.count + 1};
case 'decrement':
return {count: state.count - 1};
case 'type':
return {firstName: action.firstName, count: state.c... | true |
032201a1f86e68999058197ac107c6040f0a5678 | JavaScript | elilemons/js-objects-social-media-post | /main.js | UTF-8 | 1,083 | 2.9375 | 3 | [] | no_license | class SocialMediaPost {
constructor(caption, image, hashtags, platform) {
this.caption = caption;
this.image = image;
this.hashtags = hashtags;
this.platform = platform;
}
listOutHashtags() {
let longHashTagString = "";
for (let hashtag of this.hashtags) {
... | true |
0af150fd0f556c12abe0c05896f9d34c03319276 | JavaScript | kdabug/express-react-university-model-lab | /server.js | UTF-8 | 3,124 | 2.609375 | 3 | [] | no_license | const express = require("express");
const bodyParser = require("body-parser");
const logger = require("morgan");
const cors = require("cors");
const { Student, Instructor } = require("./models");
const PORT = process.env.PORT || 3002;
const app = express();
app.use(logger("dev"));
app.use(bodyParser.json());
app.use... | true |
3c8f51b1c93a0b49458420db6a1de1ca6e1d62da | JavaScript | ly774508966/planetG.js | /engine/module/pwge/entity.js | UTF-8 | 16,804 | 2.53125 | 3 | [
"MIT"
] | permissive | define("pwge/entity", ["pwge/spriteManager", "pwge/util", "util/PubSub", "util/easing"], function(spriteManager, util, PubSub, easing){
/**
* entity module
* construct an Entity object.
* An Entity represent one drawable object by canvas with a sprite image or DOMRenderer.
* It should be created... | true |
ae69d2cea5ec6ef4801fe9f0e16f3e3a9f667c61 | JavaScript | tautvydascoding/2019-05-kurso-medziaga | /dirbame_cia/diena_6/Jolita/50f_ju/js/main.js | UTF-8 | 1,774 | 3.671875 | 4 | [] | no_license | var vardas = "Tomas";
function setVardas1(name) {
vardas = name + "1";
}
setVardas1("Tomas"); // sugalvoti vis kita zodi
function getVardas1() {
return vardas + "1";
}
var x = getVardas1(); // arba console.log( getVardas1() );
console.log( x ); // isveda: Tomas11
function setVardas2(name) {
vardas =... | true |
63ec5c11074f07421093d0e32653391a2a1b9ef6 | JavaScript | HelloWallet/ember-data.model-fragments | /packages/model-fragments/tests/unit/store_test.js | UTF-8 | 995 | 2.65625 | 3 | [
"MIT"
] | permissive | var env, store, Person, Name;
QUnit.module("unit/fragments - DS.Store", {
setup: function() {
Person = DS.Model.extend({
name: DS.hasOneFragment("name"),
});
Name = DS.ModelFragment.extend({
first : DS.attr("string"),
last : DS.attr("string")
});
env = setupEnv({
person... | true |
abfc688345a0524ffbe37efa737dbfa05fff1e59 | JavaScript | codylindley/learnjs | /public/javascripts/edition3/Ch06/PrototypeChainingExample01.js | UTF-8 | 928 | 3.609375 | 4 | [] | no_license | //https://github.com/nzakas/professional-javascript/blob/master/professional-javascript3/Ch06/PrototypeChainingExample01.htm
//Prototype Chaining Example
function SuperType(){
this.property = true;
}
SuperType.prototype.getSuperValue = function(){
return this.property;
};
function SubTy... | true |
709b17ddd09ecc17cc7181ee46ad106398d7d4df | JavaScript | NahomKibreab/typewriter | /typewriter.js | UTF-8 | 315 | 3.375 | 3 | [] | no_license | let sentence =
"Hello there! Try typing anything after 'node typewriter.js _____' \n";
sentence =
process.argv.length > 2 ? process.argv.slice(2).join(" ") + "\n" : sentence;
let counter = 0;
for (const char of sentence) {
setTimeout(() => {
process.stdout.write(char);
}, counter);
counter += 50;
}
| true |
938ae3fb3aa2bd35a4463e278548999b90708825 | JavaScript | krasimir/code-assembly-line | /test/12_run.test.js | UTF-8 | 33,821 | 2.53125 | 3 | [
"MIT"
] | permissive | 'use strict'
const
chai = require ('chai')
, expect = chai.expect
, CodeAssemblyLine = require ( '../src/index' )
, showError = require ( '../src/errors' )
;
describe ( 'Run', () => {
it ( 'Process has error', () => {
const
... | true |
67f5646e7b62106fb6ca5513e55014e2ea98b84f | JavaScript | Lfritze/node-api1-project | /my-app/src/App.js | UTF-8 | 559 | 2.734375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | import React, { useEffect, useState } from "react";
import axios from "axios";
import "./App.css";
function App() {
const [person, setPerson] = useState([]);
useEffect(() => {
axios
.get("http://localhost:8000/api/users")
.then(res => {
console.log(res.data);
setPerson(res.data);
... | true |
8e228d2321ba2126dbe11274ee8cbf07949fd314 | JavaScript | isao/scanfs | /tests/errors.js | UTF-8 | 1,710 | 2.5625 | 3 | [
"MIT"
] | permissive | var test = require('tape'),
Scan = require('../');
test('bad path emits "error" event', function (t) {
t.plan(3);
var scan = new Scan();
scan.on('error', function (err, pathname, stat) {
t.same('ENOENT', err.code);
t.same(' does not exist ', pathname);
t.same(undefined, stat)... | true |
edb40cb00e70885c383f6027d88bda6ee94d2cd4 | JavaScript | DorinR/Politisense | /src/firebase/model/builder/BillBuilder.js | UTF-8 | 730 | 2.546875 | 3 | [
"MIT"
] | permissive | const Bill = require('../Bill').Bill
class BillBuilder {
constructor (id) {
this.id = id
this.text = ''
}
withNumber (number) {
this.number = number
return this
}
withTitle (title) {
this.title = title
return this
}
withText (text) {
this.text = text
return this
}
... | true |
9ccb2077324dba75f7680cb9cd1f75e1fda28429 | JavaScript | scps960740/The-future-of-4han-react | /src/John/highspeed/components/Main/Selector.js | UTF-8 | 2,356 | 2.75 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import "./index.css";
import { STATION_API } from "../../global/constant";
const Selector = ({ tool }) => {
const [date, setDate] = useState("");
const [start, setStart] = useState("");
const [end, setEnd] = useState("");
const [allStation, setAllStation] = ... | true |
ce33c9736c332719b368f90aa788270849da12a5 | JavaScript | webdev0415/LeafSheets | /leafsheets-react/src/reducers/companies.js | UTF-8 | 893 | 2.546875 | 3 | [] | no_license | // Imports
import {
GET_COMPANIES,
DELETE_COMPANY,
ADD_COMPANY,
UPDATE_COMPANY,
LOGOUT_SUCCESS
} from '../actions/types';
// Reducers
const initialState = {
companies: [],
};
export default function(state = initialState, action) {
switch (action.type) {
case GET_COMPANIES:
return {
.... | true |
bd09e5a4828babe445b9da57381a3b5a07fd623c | JavaScript | John-S-P/encryption | /resources/js/scripts.js | UTF-8 | 689 | 3.34375 | 3 | [] | no_license | $('#submitButton').click( function() {
scanForCheckedBoxes();
});
/**
* return (object literal) - returns an object of database columns
* and their values depending on what the client selected
*/
function scanForCheckedBoxes() {
const json = {
}
$('input:checked').each(function() {
... | true |
fce4b3f6f981e11e7af9baca639f3fb9b20a6cb5 | JavaScript | OrionZ32/Express_Server | /server.js | UTF-8 | 550 | 2.671875 | 3 | [] | no_license | //jshint esversion:6
const express = require("express");
const app = express();
app.get("/", function(req, res) {
res.send("Hello");
});
app.get("/contact", function(req, res) {
res.send("orion@mail.com");
});
app.get("/about", function(req, res) {
res.send("Hello my name is Orion, a Web Developer");
}... | true |
243ae6b8347e65d1f20c717294f4b75287d7eefe | JavaScript | Cygnusfear/unity-builder | /src/jest.setup.js | UTF-8 | 1,132 | 2.984375 | 3 | [
"MIT"
] | permissive | expect.extend({
toBeOfType(received, expectedType) {
const type = typeof received;
const pass = type === expectedType;
const message = () => `
Expected value to be of type ${this.utils.printExpected(expectedType)},
but received ${this.utils.printReceived(type)}`;
return {
message,
... | true |
ea6cc77086927947a8425b96995b111c33576b0d | JavaScript | seth-macpherson/shoebox | /cfml/kaiser/scripts/.svn/text-base/default.js.svn-base | UTF-8 | 4,674 | 2.6875 | 3 | [] | no_license | /*
Assumptions:
#footer height: 50px
body has browser class assigned (firefox,ie6,etc.)
*/
var footerHeight,fixMinHeight,fixedElement,properHeight;
$(function() { // JQUERY DOCUMENT.READY FUNCTIONS
// HIDE ALL DIALOG BOXES
$('.dialog').hide();
// RENDER GLOBAL-NAV
$("ul.subNav").parent().prepend(... | true |
bc1b3cb7517945c2cb8daabebe0a685e87583c0e | JavaScript | naidraikzir/react-movies | /src/store/reducer.js | UTF-8 | 1,265 | 2.53125 | 3 | [] | no_license | const initialState = {
search: '',
page: 0,
movies: [],
preview: null,
error: '',
};
const reducer = (state = initialState, { type, payload }) => {
switch (type) {
case 'SET_PAGE':
return {
...state,
page: payload,
};
case 'RESET_PAGE':
return {
...state,
... | true |
3ee6e465d57a94517a24e72946059dd1b1e0bb16 | JavaScript | grantyli94/React-Card-Effects | /src/CardArea.js | UTF-8 | 407 | 2.546875 | 3 | [] | no_license | import Card from "./Card";
import React from "react";
/** CardArea: Displays a container holding each card in the
* array of cards, mapped to the Card component.
*
* cards: [{id, image}, ... ]
*
* CardApp --> CardArea --> Card
*/
function CardArea({ cards }) {
return (
<div>
{cards.map(card => ... | true |
c590cad4c43f727b172dd42d9d8390ee569ce663 | JavaScript | JoRiviera/pirpletut-nodejs | /lib/helpers.js | UTF-8 | 1,513 | 3.421875 | 3 | [] | no_license | /*
* HELPERS FOR VARIOUS TASKS
*/
// Depencies
const crypto = require('crypto');
const config = require('./config');
var helpers = {};
// Create a SHA256 hash
helpers.hash = function(string){
if(!(typeof(string) == "string" && string.length > 0)){
return false;
} else {
var hash = crypto.crea... | true |
e3666069a4ced17e4983188c9e350375d6ff013e | JavaScript | LennyCC/Algoritmia | /exl.js | UTF-8 | 627 | 3.3125 | 3 | [] | no_license | // Data to test
state_capitals = [{state: 'Maine', capital: 'Augusta'}];
mixed_capitals = [
{
"state": 'Maine',
capital: 'Augusta'
},
{
country: 'Spain',
"capital" : "Madrid"
},
// delete later
{
country: 'Spain',
capital: 'Madrid'
}
]
const capital = (x) => x.map(i ... | true |
5503994855e1699503180ef93e96dffa1616798a | JavaScript | icebreaker/jsip | /2k.js | UTF-8 | 2,709 | 2.890625 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | var AudioContext = window.AudioContext || window.webkitAudioContext;
var requestAnimationFrame = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame... | true |
d300be1f5b0e4e6f361b1c5250b1b48758dc900c | JavaScript | green-fox-academy/peterhencz | /macrotis-orientation-exam-master/static/script.js | UTF-8 | 2,514 | 2.90625 | 3 | [] | no_license | let url = 'http://localhost:8080/tourist';
const formData = document.querySelector('form');
const tbody = document.querySelector('tbody');
function createTable(attractions) {
attractions.forEach((e) => {
const row = document.createElement('tr');
const tableDataName = document.createElement('td');
... | true |
a4bc2351cf6fa139464df529e6a49c22b06b8f73 | JavaScript | ellensantos/livrariales | /src/main/webapp/js/frete.js | UTF-8 | 2,253 | 2.65625 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
$('#cepEndEntrega1').change(function() {
console.log("TO AQUI");
$.ajax({
url : 'http://localhost:8080/ellentex-livrariales/Frete',
data : {
cepEndEntrega1 : $('#cepEndEntrega1').val(),
idEndEntregaSelecionado : ... | true |
c842f6cbc5f28bf1c706a3365f59868c3a7e31ae | JavaScript | CarlosViniMSouza/JavaScript-Basic | /ProgramasJS/Curso - Curso em Video/ModuloB/Aula07JS.js | UTF-8 | 573 | 4.1875 | 4 | [] | no_license | // Operadores em JS (parte01)
/*
Operadores Aritméticos: 5 + 2 = 7
soma: 5 + 2 = 7
subtracao: 5 - 2 = 3
multiplicacao: 5 * 2 = 10
divisao: 5 / 2 = 2.5
resto da divisao: 5 % 2 = 1
exponenciacao: 5 ** 2 = 25
*/
// a matematica das expressoes numericas sao validas aqui no JS
/*
Simplificaç... | true |
c98fe4e4036d2bb2681fe3720eda493a38433d3e | JavaScript | keattiwut/react-playground | /src/component/VisibleElement.jsx | UTF-8 | 783 | 2.90625 | 3 | [] | no_license | import React from 'react';
class VisibleElement extends React.Component {
constructor(props) {
super(props);
this.state = {
visibility: false
};
}
toggleVisibility() {
console.log('toggle!!');
this.setState((prevState) => {
return {
visibility: !prevState.visibility
... | true |
5fc6655e2504c0a15d9b7557dbe0bbc4b3d33c11 | JavaScript | JestVA/daily-quest | /increment-array.js | UTF-8 | 93 | 3.0625 | 3 | [] | no_license | // get the numbers from 1 - 9
Array(9).fill().map((_, i) => i + 1).reduce((a, c) => a += c)
| true |
3fc163b362d4558b2b03db0adc09da2d04dd5b9a | JavaScript | mrdoob/three.js | /examples/jsm/loaders/BVHLoader.js | UTF-8 | 9,019 | 2.703125 | 3 | [
"MIT"
] | permissive | import {
AnimationClip,
Bone,
FileLoader,
Loader,
Quaternion,
QuaternionKeyframeTrack,
Skeleton,
Vector3,
VectorKeyframeTrack
} from 'three';
/**
* Description: reads BVH files and outputs a single Skeleton and an AnimationClip
*
* Currently only supports bvh files containing a single root.
*
*/
class B... | true |
ed8ced5fba844de65ae1c5ab2b95a9d228c083ef | JavaScript | PyjamaWarrior/JS-Homework | /JS/homework-8/script.js | UTF-8 | 7,658 | 3.3125 | 3 | [] | no_license | // - Дана textarea.
// В неё вводится текст.
// Сделайте так, чтобы после захода на эту страницу через некоторое время, введенный текст остался в textarea.
// const textarea = document.getElementById('textarea');
// textarea.value = localStorage.getItem('text');
//
// textarea.oninput = () => {
// localSto... | true |
55c240ac5fa9a84c99581568b4b7e46c3a3f79ac | JavaScript | benjaminmwilson/cordova-plugin-downloader | /www/download.js | UTF-8 | 6,593 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | /** @namespace cordova **/
function Download() {
this.Settings = {
fileSystem : cordova.file.dataDirectory,
folder: "folder",
unzip: false,
remove: false,
timeout: 0,
headers: []
};
}
/**
* Initialize module
* @param {object} settings Properties: .fileSystem (... | true |
c5332e4f5de25df6862f130254792f226292cbda | JavaScript | sinduap/Camptastic | /app2.js | UTF-8 | 4,002 | 2.578125 | 3 | [] | no_license | const express = require("express"),
app = express(),
bodyParser = require("body-parser"),
publicDir = require("path").join(__dirname, "/public"),
mongoose = require("mongoose");
mongoose.connect('mongodb://localhost/camptastic', { useNewUrlParser: true, useUnifiedTop... | true |