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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7f143c67f48f4ce56e58117d1257e9c5e5a464b4 | JavaScript | Tchoupie/JeuxNodeJs | /public/js/client.js | UTF-8 | 7,804 | 2.796875 | 3 | [] | no_license | (function($)
{
var socket = io({transports: ['websocket'], upgrade: false});
var players = [];
var obstacles = [];
var idPlayer = '';
var goalBall;
if(idPlayer == "Tchoupie")
{
$('#resetform').show();
}
else
{
$('#resetform').hide();
}
$('#loginform').submit(function(e)
{
e.preventDefault()... | true |
a9ce03b1f82231eb39217e3672d7be14be99845b | JavaScript | thanhftu/advanced-javascript | /Binary-search-tree/BinarySearchTree.js | UTF-8 | 2,191 | 3.96875 | 4 | [] | no_license | function BTS(value) {
this.value = value;
this.left = null;
this.right = null;
}
BTS.prototype.insert = function(value) {
if (value <= this.value) {
if (!this.left) this.left = new BTS(value);
else this.left.insert(value);
} else if (value > this.value) {
if (!this.right) this.right = new BTS(val... | true |
5ffd12bd72274be1aaf990d44dc65a2f403f2bbc | JavaScript | olga-kulevich/test-2019-02-28 | /src/task-4.js | UTF-8 | 502 | 3.828125 | 4 | [] | no_license | function getDimensionalArray(arr, n) {
if (!arr.isArray()) {
throw new Error('Array expected');
}
if (typeof (n) !== 'number') {
throw new Error('Unknown type of n');
}
let start = 0;
let end = n;
const result = [];
const groupsNumber = Math.ceil(arr.length / n);
for (let i = 0; i < groupsNum... | true |
5284c22375f8b69e6dfb8e052a29d6d91cd8bc79 | JavaScript | GregWow005/vue | /vue-cli-3/lists-users/src/store/index.js | UTF-8 | 2,030 | 2.578125 | 3 | [] | no_license | import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
export default new Vuex.Store({
state: {
status: "init",
list_users: [],
list_unactive: [],
list_active: []
},
mutations: {
// Order table
SetDataUsers: (state, payload) => {
//console.log("DATA: ", payload);
stat... | true |
11d8b1226078a59bf58bf0f2a5c3d39e99632f4b | JavaScript | MagicznyCzarodziej/spyfall | /Location.js | UTF-8 | 522 | 2.828125 | 3 | [] | no_license | class Location {
constructor(locationsPack) {
const locations = require('./lib/locations.js');
const locationsCount = locations[locationsPack].length;
const location = locations[locationsPack][Math.floor(Math.random() * locationsCount)];
this.place = location.place;
this.roles = location.roles;
... | true |
4d74721e124ab2f388fb48f4f3ed4f8b5d11d797 | JavaScript | PaoloTorregroza/QuoteGardenClient | /src/webComponents/card.js | UTF-8 | 335 | 2.734375 | 3 | [] | no_license | function card(category, content, author) {
return `
<div class="card-container">
<h3 class="quote-category">${category.replace(/^\w/, (c) => c.toUpperCase())}</h3>
<p class="quote-content">${content}</p>
<p class="quote-author">${author}</p>
</div>
`;
}
expor... | true |
4d6002817b97b967a19d648324ded3dc2717f62d | JavaScript | stekhn/german-elections-correlations | /src/js/chart.js | UTF-8 | 4,721 | 2.65625 | 3 | [
"MIT"
] | permissive | (function () {
'strict';
// Settings
var width = 170;
var height = 170;
var margin = {
top: 10,
right: 20,
bottom: 20,
left: 25
};
(function init() {
d3.queue()
.defer(d3.csv, 'data/btw17-results.csv')
.defer(d3.csv, 'data/btw17-stats.csv')
.await(function (error... | true |
560192db6ed5c79c6dc75619dab2e2b3e08c02d4 | JavaScript | gibanez/resume | /Tango/Modules/FileSystem/File.js | UTF-8 | 537 | 2.75 | 3 | [] | no_license | var fs = require('fs');
var File = function(path)
{
var self = this;
self.read = function ()
{
return new Promise(function(resolve, reject)
{
fs.readFile(path, function (err,data) {
if (err) {
reject(err);
}
res... | true |
3ccde2ef858249f265f994ec36351a946c257013 | JavaScript | sekR4/java-programming | /20201110.js | UTF-8 | 2,005 | 3.921875 | 4 | [] | no_license | function someConditions(x) {
if (x > 0) {
console.log("I feel good :).");
} else {
console.log("I feel bad :)");
}
}
someConditions(1)
someConditions(-3)
// https://www.coursera.org/learn/duke-programming-web/supplement/xApiL/programming-exercise-modifying-images
// PART I
var img = new ... | true |
e6ba80eeeafdf52def167df1d4b5a8da735095aa | JavaScript | JasperLeungGit/Brainblast | /src/Helpers/ValidationController.js | UTF-8 | 1,141 | 2.921875 | 3 | [] | no_license |
import ValidationSystem from "../Helpers/ValidationSystem";
import axios from 'axios';
const urlBackend = 'https://brainblast-be.herokuapp.com';
function ValidationController(username,scoreContext){
var validate = ValidationSystem(username);
if (validate !==1){
if (validate ===2){
... | true |
b2ba1588a310a9f47f8b6d125690753cc44c353b | JavaScript | kyakaze/rj-todoapp | /src/App.js | UTF-8 | 1,227 | 2.765625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import './App.css';
import Welcome from './components/Welcome';
import InputTodo from './components/InputTodo';
import TodoList from './components/TodoList';
import "react-datepicker/dist/react-datepicker.css";
const sortDay = array => {
array.sort((b, a) => {
... | true |
61bde30870e73ea9a58273f569698c3395cd2a38 | JavaScript | aarigela/RateMe | /models/Seller.js | UTF-8 | 3,316 | 2.53125 | 3 | [] | no_license | //Author -
//Model file to interact with seller_records table in the database using Sequelize
var express = require('express');
var app = express();
var path = require('path');
//Declaring a variable of Sequelize
var Sequelize = require('sequelize');
var sequelize = new Sequelize('mysql://b7f2b0155047a9:7b23ad76@us-... | true |
d081fcdc12dd64340051a4a991ef29095537e4fc | JavaScript | d-easton/culina | /beta/culina/src/components/pages/Search/RowCard.js | UTF-8 | 6,731 | 2.609375 | 3 | [] | no_license | import React, { useState, useEffect, useCallback } from "react";
import "./css/RowCard.css";
import * as bs from "react-bootstrap";
const axios = require("axios");
const updateRecipeURL =
"https://cors-anywhere.herokuapp.com/http://35.193.28.175:8085/updateRecipe";
const RowCard = (props) => {
const [modalShow, s... | true |
81ed5d6559b7c55ff4cbebb3d365f06163598254 | JavaScript | albatrosary/Angular1.4oWebapp | /test/spec/components/home/home.spec.js | UTF-8 | 1,188 | 2.546875 | 3 | [] | no_license | (function(){
'use strict';
describe('Controller: HomeController', function () {
beforeEach(module('todos.home'));
var HomeCtrl;
beforeEach(inject(function ($controller) {
HomeCtrl = $controller('HomeController');
}));
describe('addTodo',function() {
it('todos追加後のtodosリスト件数', fun... | true |
ec91155ff32de8fe2894e28fb9562966e7cb90da | JavaScript | khgriffi259/Quizzler | /server/seed.js | UTF-8 | 2,126 | 2.796875 | 3 | [] | no_license | const db = require('./models');
const users = [
{ firstName: 'username', lastName: 'username', username: 'username', password: 'password' },
{ firstName: 'kyle', lastName: 'griffin', username: 'kyle@gmail.com', password: 'password' },
];
const questions = [
{
question: 'Which is a JavaScript framework',
... | true |
3d4980f4d82d84851bc8714112c0d954213b6688 | JavaScript | huangguokuan/gxx_caseAnalyses | /src/lib/gis/extras/layers/ClusterLayer.js | UTF-8 | 12,758 | 2.515625 | 3 | [] | no_license | /**
*
* @authors Ou Yuan (ouyuan@gosuncn.com)
* @date 2017-10-30 12:22:36
* @version $1.0$
*/
define([
"dojo/_base/declare",
"dojo/_base/array",
"esri/Color",
"dojo/_base/connect",
"esri/SpatialReference",
"esri/geometry/Point",
"esri/graphic",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbol... | true |
4c625a0bb1d9f3ce4dd7abaf1035f345cd99b5cc | JavaScript | fflorent/firebug | /tests/FBTest/content/api/core.js | UTF-8 | 12,127 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | /* See license.txt for terms of usage */
/**
* This file defines Core APIs for test drivers. The FBTest object is injected
* into this scope by the Firebug test harness.
*/
(function() {
// ********************************************************************************************* //
// Constants
// XPCOM
var ... | true |
ebf875faa537d62a1a4a9d0080fe5280f1dfd225 | JavaScript | qlstico/QL | /src/server/util.js | UTF-8 | 782 | 2.8125 | 3 | [
"MIT"
] | permissive | // Util function for manually killing server
function closeServer(server, message) {
if (server) {
server.close(function() {
console.log(message);
});
server.destroy();
}
}
// Encrypting and decrypting functionality for password storage
const SimpleCrypto = require('simple-crypto-js').default;
v... | true |
b3a8c22d20ec757574b117bbd627ea51891b5b08 | JavaScript | ThanDB/js-jumpstart | /tdd-js/lib/coco.js | UTF-8 | 8,677 | 2.640625 | 3 | [] | no_license | /*jslint indent: 2, onevar: false, plusplus: false, eqeqeq: false, nomen: false*/
/*globals document, window*/
var coco = (function () {
function namespace(string) {
var object = this;
var levels = string.split(".");
for (var i = 0, l = levels.length; i < l; i++) {
if (typeof object[levels[i]] == "... | true |
b9c9172295aaa74108f0c400c63559b9e803d3ed | JavaScript | juliandrj/prematriculajs | /www/app/scripts/generics.js | UTF-8 | 2,266 | 2.53125 | 3 | [] | no_license | var codigo = '40171002';
//UTILITARIOS
var alerta = function (texto, tipo) {
var tipotxt = undefined;
switch(tipo) {
case 1:
tipotxt = 'info';
break;
case 2:
tipotxt = 'success';
break;
case 3:
tipotxt = 'warning';
break;
case 4:
tipotxt = 'danger';
break;
default:
tipotxt = 'info';
}
$.notif... | true |
157c86b297caf375959b3cd533fb9b46091e7529 | JavaScript | nojacko/game-off-2012 | /public_html/data/source/Utilities.js | UTF-8 | 3,770 | 3.265625 | 3 | [] | no_license | Math.toDegrees = function (x) {
return x * 180 / Math.PI;
}
Math.toRadian = function (x) {
return x * Math.PI / 180;
}
/**
* Calculates the distance between two points.
* Uses a^2 + b^2 = c^2
*/
Math.distanceBetweenObjs = function (obj1, obj2) {
if (typeof obj1 === 'undefined' || typeof obj2 === '... | true |
4dfcb7b3decd25201e7590d25bdf9739d71b9bfd | JavaScript | thill2/TriviaGame2 | /assets/javascript/app.js | UTF-8 | 1,519 | 3.328125 | 3 | [] | no_license | // upon loading, only show start screen
$(document).ready(function(){
$("#quiz").hide();
$("#finish").hide();
// when you click start, hide the start screen, show the quiz
$(".start").click(function(){
$(".start").hide();
$("#quiz").show();
$("#finish").hide();
});
// when you click submit, hide the ... | true |
494cb77e5bd77cab0efe1f69c4dbe429e86bd59a | JavaScript | BenDehlin/wlr1-hook-dependency-mini-lecture | /src/components/Pokemon.js | UTF-8 | 1,298 | 2.84375 | 3 | [] | no_license | import {useState, useEffect} from 'react'
import axios from 'axios'
const Pokemon = () => {
const [pokemon, setPokemon] = useState([])
const [url, setUrl] = useState('https://pokeapi.co/api/v2/pokemon/')
const [nextUrl, setNextUrl] = useState('')
const [prevUrl, setPrevUrl] = useState('')
const [offset, setO... | true |
3def9d850a5e59fc641fb5e0d01a1757d207d31c | JavaScript | jd891110/fantasy | /src/main/resources/boot/react-turorial/start/src/components/LifeCycleRoot.js | UTF-8 | 1,257 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
import LifeCycle from './LifeCycle';
class LifeCycleRoot extends Component {
constructor(props) {
super(props);
this.state = {
flag: true,
num: 0
};
}
toggleChildCmp = () => {
let { flag, num } = this.state;
... | true |
ccded7b0800acc6c37cbd94360bf0ff68aa9e7bb | JavaScript | thanh01pmt/origami-box | /src/Baggi/dimensions.js | UTF-8 | 883 | 2.71875 | 3 | [
"MIT"
] | permissive | const pageWidth = 210;
const pageHeight = 297;
export function getPageDimensions(baggi) {
if (!baggi) {
return null;
}
const w = parseFloat(baggi.width);
const l = parseFloat(baggi.length);
if (isNaN(l + w) || l <= 0 || w <= 0) {
return null;
}
const width = 2.0 * w + l;
const height = 4.0 *... | true |
921a62e930814dc198b58633b34dd9ee8c59fa53 | JavaScript | tessi/webdev-spm | /js/controls.js | UTF-8 | 1,134 | 2.84375 | 3 | [] | no_license | function Controls(logic, graphics) {
this.logic = logic;
this.graphics = graphics;
var self = this;
this.actions = {
setDown: {
codes: [32], // space
apply: function() { self.logic.setDown(); }
},
moveLeft: {
codes: [37, 97], // left arrow, A
apply: function() { self.logic.... | true |
439e7be00edcb15c1d14ad3cdf4eaef1badf6aa2 | JavaScript | spawner999/Js-2day-project | /js/api-helpers.js | UTF-8 | 4,275 | 2.640625 | 3 | [] | no_license |
var clientId = '44ZBUPBKJLBXBM0IJRZPSM34YPUKNSE2VQCNL041GNFIWRSO';
var clientKey = 'RPHMMDSE0DQIAY4XZ34WN1ZRTUV250NCNIX05N1WMSRODPJ2';
var template = 'https://api.foursquare.com/v2/venues/explore?client_id=%CLIENT_ID%&client_secret=%CLIENT_SECRET%&v=20130815&near=%CITY%&venuePhotos=1&query=%query%';
var venueTemplate ... | true |
a28639c8fb13aff42cb37c58d5ec4b1b59aeaaeb | JavaScript | armandopartida0/etch-a-sketch | /js/index.js | UTF-8 | 2,128 | 3.984375 | 4 | [] | no_license | // Grab grid container node
let gridContainer = document.querySelector('.grid');
// Create Document Fragment for fast dynamic grid size
let fragment = document.createDocumentFragment();
// Create our grid layout on page load. 16x16 intial size
generateGrid(16);
// Add event listener to button and check for user inpu... | true |
c8a136335c442516c8cafcdf550862a362a7eeb5 | JavaScript | SoftDevAndy/discord-coinbot | /bot.js | UTF-8 | 3,498 | 3.21875 | 3 | [] | no_license | const discord = require('discord.js');
const request = require('request');
const config = require('./config.json');
// Initializing the bot
const bot = new discord.Client();
bot.on("ready", () => {
console.log('\n' + config.botname + ' is running!');
});
bot.on("message", async message => {
// Making sure... | true |
1042107f734409bba9c9741c01edf6c0b8e22807 | JavaScript | heikkipesonen/kyyla | /kyylademo/main.js | UTF-8 | 8,573 | 2.65625 | 3 | [] | no_license | function get(data,callback){
$.ajax({
type:'GET',
url:'../kyyla.php',
data:data,
dataType:'json',
success:callback,
error:function(e){
console.log(e.responseText);
callback(false);
}
});
}
function scale(arr){
var total = 0,
result = [];
each(arr,function(){
total += this;
});
each (ar... | true |
dd4036c1be1152087592279b3dea3c13912853e5 | JavaScript | zubairsamo/Expertizo_task | /quizapp/src/components/Answers.js | UTF-8 | 1,688 | 2.828125 | 3 | [] | no_license | import React from "react";
class Answers extends React.Component {
constructor(props) {
super(props);
this.state = {
isAnswered: false,
classNames: ["", "", "", ""],
};
this.handleCheckAnswer = this.handleCheckAnswer.bind(this);
}
componentWillReceiveProps(nextProps) {
this.setS... | true |
efc731148a515cf2247307d2f148133c60aa516a | JavaScript | SeannaBirchwood/week1day4 | /makeOwnMap.js | UTF-8 | 754 | 3.25 | 3 | [] | no_license | var trees = [{logs: 5, type: 'hardwood', name:'elm'},
{logs: 8, type: 'hardwood', name: 'birch'},
{logs: 3, type: 'hardwood', name:'maple'},
{logs: 8, type: 'softwood', name: 'pine'},
{logs: 2, type: 'softwood', name: 'spruce'}];
var invenTrees = trees.map(function(logging) {
var typeKey =... | true |
521f6ae991db4e6b1968d3eeac2133a083438128 | JavaScript | ThiagoOliveira001/company-crud | /src/app/services/Zipcode.js | UTF-8 | 493 | 2.625 | 3 | [] | no_license | import axios from 'axios';
class ZipcodeService {
async find(zipcode) {
try {
const url = `${process.env.CEP_API}/${zipcode}/json`;
const response = await axios.get(url);
const location = {
address: response.data.logradouro,
neighborhood: response.data.bairro,
city: resp... | true |
fda6857519b8c990ae868edf88746b26f83b8c3d | JavaScript | alexvins/dwscript_old | /Libraries/JSCodeGen/rtl/stringRepeat.js | UTF-8 | 175 | 3.015625 | 3 | [] | no_license | function stringRepeat(s, n) {
if (n<1) return '';
var r = '';
while (n > 0) {
if (n & 1) r += s;
n >>= 1, s += s;
};
return r;
};
| true |
3ace26f0a43e3075ee0967711516ed5cdbb0bf87 | JavaScript | Kyle-Chambers/recursion-review | /src/getElementsByClassName.js | UTF-8 | 738 | 3.640625 | 4 | [] | no_license | // If life was easy, we could just do things the easy way:
// var getElementsByClassName = function (className) {
// return document.getElementsByClassName(className);
// };
// But instead we're going to implement it from scratch:
var getElementsByClassName = function(className) /*targetClassName */{
var result =... | true |
cb5f506a1a3c5abdda5edd85394110cd09ca2539 | JavaScript | FlorenciaVillaverde/PracticasDH | /practicas-js/clase3-simpsons/js/index.js | UTF-8 | 1,665 | 3.421875 | 3 | [] | no_license | window.addEventListener("load", function() {
document.querySelector("#titulo").addEventListener("mouseover", function() {
//EJ 1
let nombre = prompt("Como te llamas?")
//EJ 2
if (nombre == "") {
document.querySelector("#saludo").innerHTML += "BIENVENID@"
... | true |
36ab525443ed868443800cc87d2b301e66dd836b | JavaScript | aozora0000/pixiv-app-api | /index.test.js | UTF-8 | 3,821 | 2.53125 | 3 | [
"MIT"
] | permissive | const isEqual = require('lodash.isequal')
const isPlainObj = require('is-plain-obj')
const PixivAppApi = require('.')
const userId = 471355
const illustId = 57907953
jest.setTimeout(10000)
function setup() {
const { NAME, PASSWORD } = process.env
return new PixivAppApi(NAME, PASSWORD)
}
const pixiv = setup()
le... | true |
7427f743c4ec22bb948ab497fbf02cc262fef835 | JavaScript | sb-dev/hot-pot | /assets/app/common/resources/paymentMethod.model.js | UTF-8 | 1,363 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | (function() {
'use strict';
angular
.module('angular')
.factory('PaymentMethod', PaymentMethodModel);
/** @ngInject */
function PaymentMethodModel() {
/**
* Constructor, with class name
*/
function PaymentMethod() {}
/**
* Static method, assigned to class
* Instance (... | true |
5f8c225f9457f7a13714a1b2d549c938a62db91b | JavaScript | Joannayu/homework_2 | /rules.js | UTF-8 | 1,342 | 2.9375 | 3 | [] | no_license | let Price = require('./price.js');
class Rules {
constructor() {
this.price = new Price();
}
applyRules(merchandiseList){
this.appleTVRules(merchandiseList);
this.ipadRules(merchandiseList);
this.macbookRules(merchandiseList);
}
appleTVRules(merchandiseList) {
let countOfAppleTV = this.countOf('atv', ... | true |
bb881d9c8d66795c1c43c83bc908f1197ef0abb0 | JavaScript | muadh226/Valkai | /Chrome Extension/frontend/chrome_extension/js/video-netflix.js | UTF-8 | 7,273 | 2.8125 | 3 | [] | no_license | (function (){
console.log(new Date().toISOString());
window.addEventListener ("load", myMain, false);
function myMain (evt) {
var jsInitChecktimer = setInterval (checkForJS_Finish, 111);
function checkForJS_Finish () {
if (typeof document.getElementsByClassName("time-remaining__time")[0].inner... | true |
f232e896d5052706bcd59c474280eca75948a913 | JavaScript | michelneeser/trackr-spring | /src/main/resources/static/app.js | UTF-8 | 5,703 | 2.625 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", function() {
let token = document.querySelector("#token").value;
let addStatValue = function() {
let valueToAdd = document.querySelector("#valueToAdd").value;
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
... | true |
69f5e0dc50f13ea22b49696c533de1e3aaf29fc0 | JavaScript | bsharp807/react_npc_gen | /front_end/src/allCharacterDisplay/AllCharacterDisplay.js | UTF-8 | 564 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import CharacterCard from './components/CharacterCard';
class AllCharacterDisplay extends Component{
constructor(props){
super(props)
this.state = {
}
this.renderCharacters = this.renderCharacters.bind(this)
}
renderCharacters(){
return this.props.... | true |
0592720c1b76e8226890e9c851594d94302e8a8e | JavaScript | KondratskiVD/beetroot_js | /students/anna_glovyak/lesson-5/task1.js | UTF-8 | 790 | 3.515625 | 4 | [] | no_license | const car = {
brand: 'BMW',
model: 'e525',
year: 2002,
speed: 110,
getTimeDestansce: function(length) {
let totalTime = length / this.speed;
let hoursToRest = 0;
function restTime (time) {
if (Math.trunc(time / 4) >= 1) {
hoursToRest += 1;
... | true |
74d389174b4f57cbcadf420a9e42759cf566e2d9 | JavaScript | lijuanzhang/VersionManagement2016 | /common/stringTrans.js | UTF-8 | 11,521 | 2.640625 | 3 | [] | no_license | /**
* Created by lijuanZhang on 2015/9/2.
*/
var fs = require("fs");
var sqlReg = /((\S*.sql)$|(\S*(配置变更单|模型变更单|数据变更单)([\u4e00-\u9fa5]|[\x00-\xff])+(.txt)$|(.sql)$))/g;
/**
* 获取path目录下的配置变更单
* @param path
* @returns {{files: Array, folders: Array}}
*/
function getSqlAttachment(path) {
var fileList = [],
... | true |
cbc19c68a98bef46ebf79422fddc200166c157f5 | JavaScript | kayartaya-vinod/2017_08_UNISYS_NODEJS | /day3/ex14.js | UTF-8 | 457 | 2.53125 | 3 | [] | no_license | // ex14.js
var express = require("express");
var server = express();
var port = 3000;
var path = require("path");
var webroot = path.join(__dirname, "www");
server.use(express.static(webroot));
server.get("/about", (req, resp)=>{
resp.send("<h1>About page under construction</h1>");
});
server.get("/contact-us", (re... | true |
bfd39a9b5b1c74e939dbb976609eba54fa29de4d | JavaScript | felpscg/Delivery | /js/valcpf.js | UTF-8 | 1,785 | 2.921875 | 3 | [] | no_license | var idCPF = document.getElementById("cpf");
function TestaCPF() {
var CPF = idCPF.value;
CPF = CPF.replace(/[^\d]+/g, '');
var Soma;
var Resto;
Soma = 0;
if (CPF == "00000000000" ||
CPF == "11111111111" ||
CPF == "22222222222" ||
CPF == "33333333333" ||
... | true |
df17599eb359ccf096813936ca818b94d5ee42c0 | JavaScript | MarlonSterling/Belajar-React-1 | /src/index.js | UTF-8 | 1,102 | 2.640625 | 3 | [] | no_license | import React from 'react';
import reactDom from 'react-dom';
import './index.css';
import {books} from './books';
import Book from './Book';
// const title ='Rich Dad Poor Dad';
// const author ='Robert T. Kiyosaki';
// const img = 'https://images-na.ssl-images-amazon.com/images/I/81bsw6fnUiL._AC_UL200_SR200,200_.jp... | true |
d37fce1e8d98314a19cff50e17ad3298db8b56a2 | JavaScript | kodluyoruz-react-bootcamp/odev-4-realtime-colors-app-gokberkdeprem | /client/src/components/ColorPicker.js | UTF-8 | 1,487 | 2.5625 | 3 | [] | no_license | import { useEffect, useState } from "react";
import { SketchPicker } from "react-color";
import {
disconnectSocket,
initSocket,
subscribeToColors,
sendColor,
} from "../socketService";
function ColorPicker() {
const [pageColor, setPageColor] = useState({});
const [displayColorPicker, setDisplayColorPicker]... | true |
88be0ccc594ab33004bd006c4cad497fe7fb8f90 | JavaScript | VbeeTeam/webtrain | /day12/bookadmin/db.js | UTF-8 | 794 | 2.515625 | 3 | [] | no_license | /**
* 封装操作数据库api
*/
const mysql = require('mysql');
exports.base = (sql, data, callback) => {
//创建数据库连接
const connection = mysql.createConnection({
host: 'localhost', //数据库所在的服务器或IP
user: 'root', //登录数据库账号
password: '123456', //登录数据库密码
database: 'book' //数据库... | true |
17282e1368c71e9b3dff1139ecbd662b307da237 | JavaScript | jcarlos0305/react-maps | /src/features/autocomplete/index.js | UTF-8 | 1,543 | 2.640625 | 3 | [
"MIT"
] | permissive | import React, { useState, useRef } from "react";
import { Autocomplete } from "@react-google-maps/api";
import { addMarker } from "../marker/markerSlice";
import { useDispatch } from "react-redux";
export default function AutocompleteSearchBox() {
const [autoComplete, setAutoComplete] = useState(null);
const dispa... | true |
998b91c524b4fac6514ad23242f34709c7ebf1bc | JavaScript | emurguia/basic-web-builder | /script.js | UTF-8 | 12,135 | 3.046875 | 3 | [] | no_license | /*
* CREATING USER PAGE
*/
//function to get user selected font
function getFont(){
var fontForm = document.getElementById("fonts");
if(fontForm.selectedIndex == 0){
return "Ubuntu";
}
var fontSelection = fontForm.options[fontForm.selectedIndex].value;
return fontSelection;
}
//function to get user sele... | true |
c0b40e916ad32ca60f4ea7d46f88b914a568baa8 | JavaScript | McDibou/projet_checkers | /app.js | UTF-8 | 25,629 | 2.96875 | 3 | [] | no_license | let formatTab = 10;
let endFormatTab = formatTab - 1;
let playersTurn = 1;
let history = [];
let player = {
startX: 0,
startY: 0,
endX: 0,
endY: 0,
typeStart: '',
colorStart: '',
typeEnd: '',
colorEnd: '',
selected: false,
}
/**
* Construit le plateau de jeu dans le navigateur
* @... | true |
8bef0f508798e7c6128d0cc0f48ca8a2894995c0 | JavaScript | iceycc/daydayup | /react/react-demo/src/hooks/11.middleware.js | UTF-8 | 2,614 | 3.03125 | 3 | [] | no_license | import React, { useEffect, useReducer } from 'react';
import ReactDOM from 'react-dom';
let initialState = { number: 0 };
const INCREMENT = 'INCREMENT';
const DECREMENT = 'DECREMENT';
function reducer(state, action) {
switch (action.type) {
case INCREMENT:
return { number: state.number + 1 };
... | true |
cf566e65992033bb8ee9070fb0a0b5ed12b07cd1 | JavaScript | sbalev/bestiaire-processing | /sketches/sketch020.js | UTF-8 | 1,677 | 2.671875 | 3 | [] | no_license | function setup() {
// Fenêtre
parent.tweakCanvas(createCanvas(1000, 800));
parent.document.getElementById('author').innerHTML = 'Léo Gosse';
}
function draw() {
background(240);
// Corps
fill(200);
quad(mouseX - 100, mouseY, mouseX + 100, mouseY, mouseX + 120, mouseY + 60, mouseX - 120, mouseY + 60);
... | true |
df8dca0df9dc60ed902e7d6691835ee16da89c3a | JavaScript | chromium/chromium | /third_party/blink/web_tests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-color.js | UTF-8 | 2,291 | 3.171875 | 3 | [
"LGPL-2.0-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-only",
"GPL-1.0-or-later",
"GPL-2.0-only",
"LGPL-2.0-only",
"BSD-2-Clause",
"LicenseRef-scancode-other-copyleft",
"BSD-3-Clause",
"MIT",
"Apache-2.0"
] | permissive | function test(value, inlineValue, computedValue)
{
if (value !== null)
e.style.textDecorationColor = value;
shouldBeEqualToString("e.style.textDecorationColor", inlineValue);
computedStyle = window.getComputedStyle(e, null);
shouldBeEqualToString("computedStyle.textDecorationColor", computedValu... | true |
c87cc937027882a78d2d68255c52416943a60203 | JavaScript | AlexandraM23/FreeCodeCamp | /Pomodoro/test/test.js | UTF-8 | 155 | 3.265625 | 3 | [] | no_license | var currVal = "23 + 23 + 34";
var str = "23";
currVal = currVal.split(" ");
// currVal
// .pop()
// .push("45")
// .join(" ");
console.log(currVal); | true |
d882a8e8c10d50571dc909c2a9662a0a86e0eb19 | JavaScript | GregoXYZ/portal | /portal/WebContent/common/js/common.js | UTF-8 | 3,028 | 3.078125 | 3 | [] | no_license | // Top 10 javascrips
function addEvent(elm, evType, fn, useCapture) {
if (elm.addEventListener) {
elm.addEventListener(evType, fn, useCapture);
return true;
}
else if (elm.attachEvent) {
var r = elm.attachEvent('on' + evType, fn);
return r;
}
else {
elm['on' + evType] = fn;
return true;
... | true |
9ef7d60d844ea9c34b4a67b398c34f502369c471 | JavaScript | d-smith/ce | /json-schema/person-ce.js | UTF-8 | 1,284 | 2.796875 | 3 | [] | no_license | let cloudEvent = `
{
"specversion" : "1.0",
"type" : "person.added",
"source" : "/mycontext",
"id" : "A234-1234-1234",
"time" : "2018-04-05T17:31:00Z",
"comexampleextension1" : "value",
"comexampleothervalue" : 5,
"unsetextension": null,
"datacontenttype" : "application/json",
"d... | true |
d72d8ea7d30776be2e22b07c53ee162ad61bbf6d | JavaScript | HaykMan95/homeworks | /hwk-01-HaykMan95/solutions/createGUID.js | UTF-8 | 317 | 2.71875 | 3 | [] | no_license | (function() {
'use strict';
window.createGUID = function() {
return getHexNumber(8) + '-' + getHexNumber(4) + '-' + getHexNumber(4) + '-' + getHexNumber(4) + '-' + getHexNumber(12);
};
function getHexNumber(count) {
return Math.random().toString(16).slice(2, count + 2);
}
}());
| true |
568c171065d83b4703c4779f208bca135b63f7b2 | JavaScript | lmitiche/n220fall2020 | /labs/lab3/js/app.js | UTF-8 | 272 | 3.546875 | 4 | [] | no_license | function setup() {
createCanvas(400,300);
}
function draw() {
background(100);
noFill();
//For loop syntax
for( var i =0; i < 15; i++) {
stroke(255 - (i * 15));
circle(200,150, i * 5);
}
console.log("Afterwards: " + i);
} | true |
7552f7f046c65633013e749376a1d35e023d7fcc | JavaScript | NguyenDuong21/ToDoList | /index.js | UTF-8 | 1,920 | 3.109375 | 3 | [] | no_license | const data_text = document.getElementById('data');
const add = document.getElementById('add');
const item = document.querySelector('.item');
// add.addEventListener('click', () => {
// alert(data_text.value);
// })
function add_item(){
if(data_text.value){
let contener = document.createElement('div');
... | true |
a67e2b73c1286ad19be2c93f57736d21737da0c4 | JavaScript | quanshengjie/watson-api | /WatsonPlatformSDK-20140321-1046/com.ibm.watson.sdk.wea.toolkit/WebContent/app/com/ibm/watson/ui/ProgressBar.js | UTF-8 | 6,361 | 2.578125 | 3 | [] | no_license | /* ***************************************************************** */
/* */
/* Licensed Materials - Property of IBM */
/* */
/* (C) Copyright IBM Corp. 2001,... | true |
e314d1262f330427d9ea94b0f136db9f5dd0b0ad | JavaScript | Dloft1991/Game-Point-React | /src/pages/CreateChallenge.js | UTF-8 | 1,165 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import '../../src/App.css';
class createChallenge extends Component {
state = {
userName: " ",
park: " ",
time: " "
}
handleChange = (e) => {
this.setState({
[e.target.id]: e.target.value
})
}
handleSubmit = (e) => {
e.preventDefault();
console.log(... | true |
bc29c326a2aef8b0fc2807989bb3ff03f6c115ae | JavaScript | googamanga/2013-04-data-structures | /src/functional-shared/queue.js | UTF-8 | 817 | 3.484375 | 3 | [] | no_license | var extend = function(obj, extention) {
var keys = Object.keys(extention);
for(var i =0; i < keys.length; i++){
var key = keys[i];
obj[key] = extention[key];
}
return obj;
};
var makeQueue = function(){
// Use an object with numeric keys to store values
//var storage = {};
var queue = {};
que... | true |
6d0a5d0865892fdefc4878d9a65d553d07a82dff | JavaScript | bzs-academy/React_002_Props | /src/components/Welcome.js | UTF-8 | 493 | 2.734375 | 3 | [] | no_license | import React, { Component } from 'react'
class Welcome extends Component {
render() {
// Destructuring
const {isim, yas, sehir} = this.props;
console.log(this.props);
return (
<div>
<h3>{isim}</h3>
<h5>{yas}</h5>
... | true |
126230bcddc36ed1c364d2d6698b643c4523a0db | JavaScript | ArnoldoCortez/TriviaReact | /src/shared/services/triviaService.js | UTF-8 | 408 | 2.71875 | 3 | [] | no_license | const REQUEST_URL =
"https://opentdb.com/api.php?amount=10&category=15&difficulty=medium&type=multiple";
export const fetchQuestions = async () => {
return fetch(REQUEST_URL)
.then((response) => response.json())
.then((data) => data['results'].map(el => {
return {
...el,
answered... | true |
7c46daa984899f73fa48df0a5ff56a4e72602a7f | JavaScript | mcverticchio/6.4-Backbone-Exercises | /e/app/scripts/views/post.js | UTF-8 | 1,887 | 2.515625 | 3 | [] | no_license | var Backbone = require('backbone');
var $ = require('jquery');
//templates
var postAddTemplate = require('../../templates/postAddForm.hbs');
var postListTemplate = require('../../templates/postListing.hbs');
var displayBlogTemplate = require('../../templates/blogDisplay.hbs');
var PostAddForm = Backbone.View.extend({... | true |
2bafb062589c3c988e79f0782e5192c55c00032c | JavaScript | alanmacleod/chip8 | /util/romencode.js | UTF-8 | 299 | 2.6875 | 3 | [
"MIT"
] | permissive |
// for offline processing of ROMs into json with nodejs
var fs = require('fs');
var rom_data = fs.readFileSync('../rom/PONG',{encoding:'base64'});
var json = {
title: 'PONG',
binary: rom_data
};
fs.writeFileSync("../rom/json/pong.json", JSON.stringify(json));
console.log("wrote file");
| true |
2d6bed0452b8b57030261960715b8e8f1f677f08 | JavaScript | Tivcrmn/uci-cs230 | /HW1/src/std.js | UTF-8 | 1,994 | 2.796875 | 3 | [] | no_license | uniform = JSON.parse(uniform);
_1gaussian = JSON.parse(_1gaussian);
_10gaussian = JSON.parse(_10gaussian);
_100gaussian = JSON.parse(_100gaussian);
_200gaussian = JSON.parse(_200gaussian);
_500gaussian = JSON.parse(_500gaussian);
Chart.defaults.global.elements.point.radius = 1;
allInfo = {0: uniform, 1: _1gaussian, 10:... | true |
243f8f255b1383ad5869a8e9917b132d54cc34bf | JavaScript | yo1dog/yo1ddns | /src/functions/updateFunction/parseKeyValuePairs.js | UTF-8 | 706 | 3.015625 | 3 | [] | no_license | /**
* @param {string} keyValuePairsStr
*/
module.exports = function parseKeyValuePairs(keyValuePairsStr) {
/** @type {[string, string][]} */
const pairs = [];
const regexp = /\s*([^:,\s]+)\s*:\s*([^:,\s]+)\s*(,|$)|\s*,|\s+/g;
/** @type {RegExpExecArray | null} */
let match;
let curIndex = 0;
while... | true |
0047a5839232c468650e7522581eb6a9ed66d652 | JavaScript | Stessie-Rb/js_school_projects | /conditions+ poo/shop.js | UTF-8 | 746 | 3.515625 | 4 | [] | no_license | "use strict"
class Panier{
constructor (clientName){
this.clientName = clientName;
this.contenu = [];
this.somme = 0;
}
add(produit){
this.contenu.push(produit);
this.somme += Produit.prix;
}
remove(produit){
this.contenu.pop(produit);
this.som... | true |
f582b60d8d748a3590af082552f8d1c212b01a7c | JavaScript | VatslavDS/philmunt.com-tutorials | /nhsg/part6/Input.js | UTF-8 | 585 | 2.765625 | 3 | [] | no_license | var Input = Class.extend({
init: function () {
var input = this;
this._pressed = {};
window.addEventListener('keyup', function (event) {
delete input._pressed[event.keyCode];
}, false);
window.addEventListener('keydown', function (event) {
if (input._pressed[event.keyCode] === undefined)
input._p... | true |
7f801757a4ae93612e67526b2742681278e9b898 | JavaScript | ArtemShapiro/React-redux-Todo | /src/reducers/users.js | UTF-8 | 410 | 2.515625 | 3 | [] | no_license | const initialState = {
user: undefined,
loading: false
}
const users = (state=initialState, action) => {
switch (action.type) {
case 'SET_USER':
return {
user: action.user, loading: false
}
case 'USER_LOAD_REQUEST':
return { ...state, loading: true }
case 'USER_LOAD_REQUEST_CLOSE':
re... | true |
6e2d184903c960324f9acfe34a3fcb13d192d694 | JavaScript | chihempat/javascript-projects | /Calculator/calculator.js | UTF-8 | 492 | 2.59375 | 3 | [] | no_license | var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: true }));
app.get("/", function(req, res) {
res.sendFile(__dirname + "/bmicalculator.html");
})
app.post("/", function(req, res) {
var num1 = Number(req.body.height) / 1... | true |
75575d36aac07e319cf90ebf820ed0db72ba286c | JavaScript | hope-scotch/Task-Manager-API | /src/middleware/auth.js | UTF-8 | 1,266 | 2.921875 | 3 | [] | no_license | // Single file for each piece of middleware
const jwt = require('jsonwebtoken')
const { User } = require('../models/user.js')
// Authentication Middleware
const auth = async (req, res, next) => {
//console.log('auth middleware')
try {
const token = req.header('Authorization').replace('Bearer ', '')
... | true |
5215984a65c41374f8852ce7fa486f5c6030a37a | JavaScript | iheb-mns/VST-Angular | /backend/controllers/hotel.controller.js | UTF-8 | 3,976 | 2.890625 | 3 | [] | no_license | const db = require("../models");
const Hotel = db.hotels;
// Create and Save a new Hotel
exports.create = (req, res) => {
// Validate request
if (!req.body.name) {
res.status(400).send({ message: "Content can not be empty!" });
return;
}
// Create a Hotel
const hotel = new Hotel({
name: req.body... | true |
1346be92cf5aa050fdac33e57f84f7f5cac691b3 | JavaScript | heitorcordioli/Tiacademy | /Ciclo 2/Aula Extra Pietro/Aula reforço_19_08/teste.js | UTF-8 | 124 | 3.78125 | 4 | [] | no_license | //Iteração é a mesma coisa que repetição
let x = 0;
while (x < 3){
console.log(x);
x = x + 1; // ou x++ ou x += 1
} | true |
cbb7424c5ff64e5ce895456cb85fe9b0a948dd91 | JavaScript | dmunozo/dart450 | /Assigment_02/js/script.js | UTF-8 | 1,461 | 2.9375 | 3 | [] | no_license |
/*
Daniel Munoz Ortiz
Description:
Slow web, magic realism, illustration.
*/
//-------------------------------> Variables containing voice
$(document).ready(function() {
//-------------------------------> Controls the volume of music
document.getElementById("music").volume = 0.4;
scroll_color() //controls the... | true |
98b4cfddf9bb681e3916d36952eb7eff3e7766f9 | JavaScript | riicaampos/curso-javascript | /fundamentos/conceitosFuncao.js | UTF-8 | 2,168 | 4.65625 | 5 | [] | no_license | /**
* Função em JavaScrip é First Class Object (Citizen) (é quando a linguagem trata a função como dado)
* tambem chamado de Higher Order Function
* uma função em JS é um dado também, pode ser amrmazeado em uma variavel, pode ser passado
* como parametro, pode ser retornada, pode ter uma função com outra função den... | true |
55d35fd7b74f0e24f3cd99894ed18af9f94ca910 | JavaScript | brunolm/codewars | /8 kyu/grasshopper-summation.js | UTF-8 | 158 | 3.234375 | 3 | [] | no_license | // http://www.codewars.com/kata/grasshopper-summation
const summation = (n) => Array.apply(null, { length: n }).map((x, i) => i + 1).reduce((a, b) => a + b); | true |
a914b0b0a4a281336349def2651f349aa7e1c61a | JavaScript | DaniAguilarGarcia/Group1 | /src/models/address.js | UTF-8 | 768 | 2.640625 | 3 | [] | no_license | const mongoose = require('mongoose');
/**
* @typedef {Object} Address
* @property {string} street
* @property {string} city
* @property {string} state
* @property {string} postal
* @property {string} country
*/
const schema = new mongoose.Schema({
street: {
type: String,
required: [true, 'You m... | true |
efabf4e9cda0c23380e73224f995fbf9ef98a860 | JavaScript | Jooh34/everydent-admin | /src/redux/modules/auth.js | UTF-8 | 425 | 2.71875 | 3 | [] | no_license | // Actions
const ADD_POST = 'post/ADD_POST';
// Action Creators
export const addPost = post => ({ type: ADD_POST, post });
const initialState = {
user_id: '',
token: '',
posts: []
};
export default function post(state = initialState, action) {
switch (action.type) {
case ADD_POST:
return {
... | true |
6cc34a42fc2b7caa6c91b1a9f26ebd49a92d4161 | JavaScript | LIMU2/JS-Object-2019-5-27-1-24-42-150 | /main.js | UTF-8 | 760 | 4.40625 | 4 | [] | no_license | // 1. 编程程序,完成下列需求:
// 创建一个空对象,变量名为user;
// 添加一个name属性,并设置值为John;
// 添加一个surname属性,并设置其值为Mike;
// 将name属性的值改为Peter;
// 删除user的name属性
var user = {
};
user.name = "John";
user.surname = "Mike";
user.name = "Peter";
console.log(user);
delete user['name'];
console.log(user);
// 2. 编写程序,实现下列需求:计算下面fruit对象共有多少个水果,应该输出50。
v... | true |
d5f19e110fa8e3c0808591791544883f9f4a1b1c | JavaScript | cry3small/fcc-taipei-X | /public/js/components/LandingPart/UploadAvatar.js | UTF-8 | 1,151 | 2.546875 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react'
class UploadAvatar extends Component {
constructor(props) {
super(props)
this.state ={
src : './images/default-upload-avatar.svg'
}
this.upload = this.upload.bind(this)
}
upload(e) {
const bHaveFileAPI = (window.File && window.FileReader)
c... | true |
92274c101ae1c6e118734ab35c2ce0d5685dc2f7 | JavaScript | FatConan/podswamp | /podswamp/resources/javascript/main.js | UTF-8 | 3,136 | 3.015625 | 3 | [
"MIT"
] | permissive | /* A little javascript to enhance the abilities of the playback pages a little */
class PlaybackControl{
constructor(playbackElementId, playbackModalId){
this.playbackElement = document.getElementById(playbackElementId);
this.playbackModal = $(`#${playbackModalId}`);
this.dialog = this.play... | true |
02a4831047354974cc59fb865feb6d74a8aee5fe | JavaScript | ahmadwaluyo/HACKTIV8-fase0 | /WEEK_1/DAY4/ANCHOR/Anchor-Graduates.js | UTF-8 | 751 | 3.375 | 3 | [] | no_license | var nama = 'Ahmad';
var nilai = 90;
var absen = 5;
if (nilai >= 70 && nilai <= 100 && absen >= 5) {
console.log(nama+' '+'Dinyatakan LULUS!');
} else if (nilai < 0 || nilai > 100) {
console.log('Nilai invalid!');
}else {
console.log(nama+' '+'MOHON MAAF ANDA BELUM LULUS');
}
/*
SET VAR name as Ahmad in string
... | true |
115a4af28edc0a1985ad638c60b38f466021b5d6 | JavaScript | KevinEverywhere/psykick2d | /examples/pong/js/score.js | UTF-8 | 1,556 | 2.875 | 3 | [
"MIT"
] | permissive | 'use strict';
var Helper = require('psykick2d').Helper,
BehaviorSystem = require('psykick2d').BehaviorSystem,
CONSTANTS = require('./constants.js');
/**
* Updates the score and resets the game
* @param {Entity} ball
* @param {Entity} player
* @param {Entity} enemy
* @constructor
*/
var Score = function... | true |
a7e1394041d874ff4e3a612b075f9d6818ce2678 | JavaScript | tmf-map/redux-mini | /draft/reduce.js | UTF-8 | 379 | 3.65625 | 4 | [
"MIT"
] | permissive | // reduce :: (a -> b -> a) -> a -> [b] -> a
function reduce(reducer, initialData, allData) {
let accumulator = initialData;
for(let i = 0; i < allData.length; i++) {
accumulator = reducer(accumulator, allData[i])
}
return accumulator;
}
console.log(reduce((a, b) => a + b, 0, [1, 2, 3, 4, 5]) === 15)
consol... | true |
9b62c1dbda0abb832aa0f631c712891e3f021910 | JavaScript | jraulcr/curso-javascript | /hola-mundo/js/11-ejercicio1.js | UTF-8 | 722 | 4.0625 | 4 | [] | no_license | 'use strict'
var numero1 = parseInt(prompt('¿Dime el primer numero?', 0));
var numero2 = parseInt(prompt('¿Dime el segundo numero?', 0));
//console.log(numero1, numero2);
while(numero1 <= 0 || numero2 <= 0 || isNaN(numero1) || isNaN(numero2) ){
var numero1 = parseInt(prompt('¿Dime el primer numero?', 0));
var nu... | true |
e17de3e68ebf404b35974140e3ea7714e3d7110c | JavaScript | keenjaan/sentry-tool | /webpack-build-release.js | UTF-8 | 1,099 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | const path = require('path')
const fs = require('fs')
function writeFile (release) {
let filename = 'sentry.json'
if (process.env.BUILD_ENV === 'prod') {
filename = 'sentry.prod.json'
}
const dist = path.join(process.cwd(), `./${filename}`)
let config
try {
const jsonStr = fs.readFileSync(dist, 'u... | true |
8cf214d91c670df36ee542a46c1b57c84e10aa59 | JavaScript | devcheolheon/algoPractice | /kakao/2019_blind/2/2.js | UTF-8 | 720 | 3.03125 | 3 | [] | no_license | function solution(N, stages) {
var answer = [];
var counter = new Array(N + 2).fill(0);
var accCounter = [];
stages.forEach((v) => {
counter[v]++;
});
accCounter = counter.slice();
var i = 0;
for (var i = accCounter.length - 1; i > 0; i--) {
accCounter[i - 1] += accCounter[i];
}
answer ... | true |
6697bac44d2e5ab7b05f9c962cc9f8134063bf3c | JavaScript | Tomraydev-WFiIS/rubik | /js/app.js | UTF-8 | 10,047 | 2.75 | 3 | [] | no_license | "use strict";
import * as THREE from "https://threejs.org/build/three.module.js";
import { OrbitControls } from "https://threejs.org/examples/jsm/controls/OrbitControls.js";
// import { Stats } from "https://mrdoob.github.io/stats.js/build/stats.module.js";
let camera;
let scene;
let renderer;
let controls;
let axesHe... | true |
2ece8cd456156eeae925ee3c66e62aa7f415ea4a | JavaScript | WSU-SPRING-2019/cs4280-inclass-webgl | /src/javascripts/week09/three-cubegrid.js | UTF-8 | 1,778 | 2.953125 | 3 | [] | no_license | import * as THREE from 'three'
import * as dat from 'dat.gui'
export function displayScene(){
let canvas = document.querySelector("#webgl-scene")
let scene = new THREE.Scene()
let renderer = new THREE.WebGLRenderer()
let camera = new THREE.PerspectiveCamera(45, canvas.clientWidth / canvas.clientHeight... | true |
9e8a63d718b59ae70aee9092918f3b5461fb2b57 | JavaScript | aeroxy/JavaScript-Solutions | /House Robber/cases.js | UTF-8 | 538 | 2.515625 | 3 | [] | no_license | const expect = require("../test/expect");
const method = require("./solution1");
const assert = require("assert");
function testMethod(input, output) {
return assert.equal(method(...input), output);
}
module.exports = {
testCases: [
() => expect(
[[1, 2, 3, 1]],
4,
testMethod,
),
() ... | true |
8e31279a06fcf57ce7c5fa9ed6e6aba700a2135f | JavaScript | RihaGupta/dockermanager | /DockerManager/js/docker_manager.js | UTF-8 | 861 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | //This JS files contains the code to manage the Docker
$(document).ready(function(){
// alert("Hello in");
//Call the getDockerInfo()
getDockerInfo();
});
function getDockerInfo(){
/**/
//Ajax request to Docker API, we are using REST End point /info
$.ajax({
url :rest_info ,
dataType : "json",... | true |
1b31531fff64b68c0679c4782604d8625ce6e69f | JavaScript | future4code/Danilo-Mourelle | /semana7/integracao-api/src/App.js | UTF-8 | 1,155 | 2.59375 | 3 | [] | no_license | import React from 'react';
import Inputs from './Components/Inputs';
import Lista from './Components/Lista';
import Detalhes from './Components/Detalhes';
class App extends React.Component {
constructor(props) {
super(props)
this.state = {
idBuscado:'',
paginaAtual: 'cadastro',
}
}
onP... | true |
392f0e2ca1b0c5206555e2d79856151424fcd5da | JavaScript | hitode909/sketch20190802vj | /7.js | UTF-8 | 1,280 | 2.875 | 3 | [] | no_license | var map;
function initMap() {
var initialCenter = { lat: 35.0036138, lng: 135.7705486 };
var center = JSON.parse(JSON.stringify(initialCenter));
var map = new google.maps.Map(document.getElementById('map'), {
center: center,
zoom: 14,
// disableDefaultUI: true,
});
var panora... | true |
95918f90be004a500b704ae1444e6e4b20d4e069 | JavaScript | MtRoman19/Examen4J | /main.js | UTF-8 | 555 | 3.1875 | 3 | [] | no_license | var puntoo=new punto()
function agregarPuntos() {
var x=parseInt(document.getElementById('x').value);
var y=parseInt(document.getElementById('y').value);
puntoo.agregarPunto(x,y)
var calculaar=calcular()
var distTotal=puntoo.mostrar(calculaar)
console.log(distTotal);
document.get... | true |
3b81a115a971a8106ded43b07c29973ca6a15d94 | JavaScript | jung4891/NodeJs | /1. Syntax/1. Type/Number.js | UTF-8 | 173 | 3.25 | 3 | [] | no_license |
console.log(1+1);
console.log('4-1 =', 4-1);
console.log("2*2 =", 2*2);
console.log(10/2); // 5
console.log(9/2); // 4.5
console.log(10/3); // 3.3333333333333335
| true |
d2f18db80546ea57fa82242d48b406b00d2d2f2c | JavaScript | b-heilman/pickaxe | /src/expression/sequence.js | UTF-8 | 492 | 2.734375 | 3 | [
"MIT"
] | permissive |
class Sequence {
constructor(){
this.expressables = [];
}
addExpressable(expressable){
this.expressables.push(expressable);
}
async express(ctx){
return (
await Promise.all(this.expressables.map(
expressable => expressable.express(ctx)
))
).reduce(
(agg, value) => agg + value,
0
);
}
... | true |