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
0f4182039edd7bde1e87fc58ece6092c3bf32f8e
JavaScript
CTownsdin/readable
/src/reducers/reducer-posts.js
UTF-8
1,886
2.796875
3
[]
no_license
// will appear in app state with the same name by design of combineReducers() export function postsIsLoading (state = false, action) { switch (action.type) { case 'POSTS_IS_LOADING': return action.isLoading default: return state } } export function postsHasErrored (state = false, action) { s...
true
53d0e070a4d092fe56dfe54f2a07922b94c50388
JavaScript
Udit-takkar/Reviews
/app.js
UTF-8
2,692
2.875
3
[]
no_license
var reviewData=[ { "Photo":"Photos/sara.jpg", "name": "Sara Jones" , "profession":"UI/Ux Designer", "review":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.aculis elit. Vestibulum vel lectus vestibulum, finibus augue ac, bibendum risus. Vestibulum finibus augue id enim...
true
88892ed63a17e72f19d9dfbae04d23c12bd58457
JavaScript
qiyuqianxai/gin_server
/go-label-master/js/review.js
UTF-8
6,050
2.640625
3
[]
no_license
var cards; var red = `rgba(255, 0, 0, .5)`; var green = `rgba(0, 255, 0, .5)`; var blue = `rgba(0, 0, 255, .5)`; function getRandomColor() { var letters = '0123456789ABCDEF'; var color = '#'; for (var i = 0; i < 6; i++) { color += letters[Math.floor(Math.random() * 15)]; } return color; } fu...
true
794ba45c75f4e2106dc2ff73c090d1b9ad5ab298
JavaScript
tejb54/pokemon-remake-server
/app.js
UTF-8
3,586
2.71875
3
[]
no_license
/** * Created by Tobias on 2016-04-25. */ var io = require('socket.io').listen(9058); var _ = require('lodash'); var uuid = require('uuid'); var players = {}; var battles = {}; io.on('connection',function (socket) { console.log('connection'); socket.emit('connection',socket.id); socket.on('start',fu...
true
7c6342445a377663ca788780bd5bb28741364c82
JavaScript
andrecode01/reactAndGoogleMaps
/src/App.js
UTF-8
1,145
2.625
3
[]
no_license
import React from 'react'; import "./App.css"; import { Marker ,withScriptjs, withGoogleMap, GoogleMap } from "react-google-maps"; function Map () { return( < GoogleMap defaultZoom = {15} defaultCenter = {{ lat : -20.756598202039, lng : -41.451916662831 }} > < Marker onClick = {f...
true
49b2f2cdd5bb223cd21edf333eb5d92069d285b4
JavaScript
pashidlos/image-compare-tryouts
/src/utils.js
UTF-8
1,279
2.65625
3
[]
no_license
const path = require("path"); const { PNG } = require("pngjs"); const { writeFileSync, readFileSync } = require("fs"); function getImagePath(name) { return path.resolve("src/images", name); } function getImageBuffer(name) { return readFileSync(getImagePath(name)); } function getImage(name) { return PNG.sync.re...
true
93ca5e589e3c679fa626d881e37180e1fa36129e
JavaScript
steva1312/programiranje
/sajtovi/todo/app.js
UTF-8
1,263
3.40625
3
[]
no_license
const input = document.querySelector('.mainInput') const form = document.querySelector('.mainForm') const todoContainer = document.querySelector('.todoContainer') const body = document.querySelector('body') const numCon = document.querySelector('.numCon') let id = 0 const todoNum = document.createElement('h3') numCon...
true
6fe755569a9fe18ed87990593063423dc824f69b
JavaScript
maj3r1819/To-Do-List-using-React.Js
/src/MyComponents/TodoItem.js
UTF-8
642
2.828125
3
[]
no_license
import React from 'react' //written using rafc.. arrow function export const TodoItem = (props) => { return ( <div> <h4>{props.arrtodoitem.title}</h4> <p>{props.arrtodoitem.desc}</p> <button className="btn btn-sm btn-danger" onClick = {() => {props.onDelete(props.arrtodoi...
true
c1ad87f7043297b8d6ca0286f680549d1b917484
JavaScript
forivall-old-repos/tacoscript-prehistory
/packages/tacoscript/src/gen-taco/generators/template-literals.js
UTF-8
735
3.34375
3
[ "MIT" ]
permissive
/** * Prints TaggedTemplateExpression, prints tag and quasi. */ export function TaggedTemplateExpression(node) { this.print(node.tag, node); this.print(node.quasi, node); } /** * Prints TemplateElement, prints value. */ export function TemplateElement(node) { this.push(...node.tokens); // this._push(node...
true
fb0275764a5eac63bc2486ad170aed6b2c2df791
JavaScript
Anand278/AWEP-EXAM
/200240520016/2.js
UTF-8
425
2.578125
3
[]
no_license
function submithere() { let inp = document.querySelector('#emailid').value; let childclone = document.querySelector('#childid').cloneNode(true); childclone.children[0].innerHTML = inp ; let parentdiv = document.querySelector('#parentid'); parentdiv.insertBefore(parentdiv,childclone.first...
true
08118e80294983b1d1db2d468df8d1df2342984f
JavaScript
Softheon/AlexaSkills
/greeter/index.js
UTF-8
1,670
2.859375
3
[]
no_license
'use strict'; module.change_code = 1; var _ = require('lodash'); var Greeter = require('./greeter'); var alexa = require('alexa-app'); var app = new alexa.app('greeter'); // Launch intent function var launchIntentFunction = function(req, res) { var prompt = 'Greeting to you! What is your name?'; res.say(p...
true
b4c4cfda2623ed9ca1d218216603ce62c46e20d5
JavaScript
stanislav-web/Quiz-System
/src/assets/js/modal.js
UTF-8
1,067
2.578125
3
[]
no_license
/** * Modal class * @type {{confirmDialog}} */ var Modal = (function () { /** * Set modal title * * @param modal * @param title */ var setModalTitle = function (modal, title) { var modal = jQuery(modal).find('.modal-header'); modal.html(title); }; /** *...
true
dc229bb812a290cbfab2f728bfd405e786657797
JavaScript
nwtgck/2048-minimized
/js/html_actuator.js
UTF-8
3,403
3.328125
3
[ "MIT" ]
permissive
class HTMLActuator { constructor() { this.tileContainer = document.querySelector(".tc"); this.scoreContainer = document.querySelector(".sc"); this.messageContainer = document.querySelector(".m"); this.score = 0; } actuate(grid, metadata) { const self = this; window.requestAnimation...
true
40d0a95ca82b99b23d85c5cacc00d7ad122f7de1
JavaScript
anteater333/Anteater_lab
/Algo/2493/app.js
UTF-8
1,215
3.46875
3
[]
no_license
/* node.js */ const rl = require("readline").createInterface({ input: process.stdin, output: process.stdout, }); let input = []; // 입력 큐 let inputNum = 2; // 입력 갯수 rl.on("line", function (line) { if (inputNum == -1) { inputNum = line; } else { input.push(line); if (input.length == inputNum) rl.cl...
true
c7f144fa9930b616634d90e4b826324b82b43916
JavaScript
OFRT/FFwebsite
/static/js/page.js
UTF-8
1,139
2.53125
3
[ "MIT" ]
permissive
// 页面模板 id: page_m // 页面数据 id: page_d // 页面显示 id: view layui.use('laytpl', function(laytpl){ var view = document.getElementById('view') ,controller = function(){ var data_url = 'https://ffweb.ofrt.top/data.json'; // 获取json 数据 var json = ""; var httpRequest = ...
true
41212d75d694f3b05e553a162bcd8a23f6bd8061
JavaScript
kelvinlee/giccoo-projects
/shortout/js/game/Gun.js
UTF-8
483
2.640625
3
[]
no_license
// Generated by CoffeeScript 1.8.0 var gun; gun = (function() { function gun(size) { var g, handColor; this.size = size; PIXI.Sprite.call(this); handColor = 0x000000; g = new PIXI.Graphics(); g.lineStyle(2, lineColor); g.beginFill(headerColor, 1); g.drawCircle(this.size * 1.5, this.si...
true
1b1b793f2c596b8ab338a401fbd764974aa67d50
JavaScript
DataStructuresAlgorithmsJS/DataStructures-Algorithms
/Stack-Queue/prototypal/queue.js
UTF-8
490
3.15625
3
[]
no_license
var Queue = function() { var instance = Object.create(queueMethods) instance.first = 0; instance.last = 0; instance.storage = {}; return instance; }; var queueMethods = { enqueue:function(value){ this.storage[this.last++] = value; }, dequeue:function(){ if(this.last - this.first > 0){ var...
true
feacfb1bf30ccd83f4868af992f10358b20c687f
JavaScript
gitmadacode/jsDocumentation
/colecciones/arrays/filter-find-foreach.js
UTF-8
715
4.21875
4
[]
no_license
//Array.find / que te retorne un elemento con una condicion dada , find retorna el primero solamente const numbers = [1,4,6,2,7,9,8]; // e = elemento , find recorrera el array y el primer numero mayor a 4,lo mostrara console.log(numbers.find((e) => e > 4 ));//Output 6 //Array filter, filtra los diversos elementos de u...
true
228300f94222ca38ed12fd06b2e60e607c6e8ce7
JavaScript
dsparr1010/MERN-recipe-app
/client/src/utils/API.js
UTF-8
1,194
2.640625
3
[]
no_license
import axios from "axios"; import { v4 as uuidv4 } from 'uuid'; //named function that maps through multiple arrays from API response // function mapItems(item) { // item.map(x => { // console.log(x) // return x; // }) // } export default { fetchQuery: async (searchValue) => { retur...
true
3a225ca52f835c01c055e592942b728e885015f4
JavaScript
stefycoder/pseudo
/Ejercicios estructuras repetitivas/Ejercicio 9 CALIFICACIONES ALUMNOS/Problema/main.js
UTF-8
376
2.984375
3
[]
no_license
//Escribe aquí tú código document.write("CALIFICACIONES ALUMNOS"+ '<br>'); var n=4; var menor=1000; var suma=0; for(i=1;i<=4;i++){ nota=Number(prompt('Ingrese nota'+i)); if(nota<menor){ menor=nota; } else{ menor=menor; } suma=suma+nota;} promedio=suma/n; document.write("promedio notas:"+prom...
true
3e3e67c2c7b29e3c640406ac89d2caa61114d51a
JavaScript
plex79/ES6-2
/index.js
UTF-8
142
3.03125
3
[]
no_license
const names = ["mike", "john", "alan", "dexter"]; const names2 = names.map((imie) => `${imie} szef`); alert ( 'sdsdsd'); console.log(names2);
true
fcde4aede392e7629bb776713f9aa6890798f9ca
JavaScript
apierson5/NodeUserLogin
/public/js/index.js
UTF-8
1,478
2.984375
3
[]
no_license
import JSONStorage from "./modules/storage.js"; window.onload = () => { class Index { constructor(storage) { this.storage = storage; this.user = this.storage.get("user"); this.cacheDOM(); this.bindEvents(); this.render(); } cacheDOM() { this.dropdownEmail = document.querySelector("#email"); ...
true
f62e8dedd84292ffba708fdf83a1d10257c213a1
JavaScript
Djonata-Colferai/Projeto-Correto---Estoque
/src/auth.js
UTF-8
958
2.640625
3
[]
no_license
import { Funcionarios } from "./usuarios"; export class Autenticacao { constructor() { } entrar(inputFromOperador, inputFromSenha) { //usar o find if (inputFromOperador === Funcionarios.operador && inputFromSenha === Funcionarios.senha) { localStorage.s...
true
4e40f16ce893f9441d6f0060290db90723b02006
JavaScript
cityac/Pokemons
/src/app/Header.jsx
UTF-8
3,739
2.546875
3
[]
no_license
// @flow import React, {Component} from "react"; import {connect} from "react-redux"; import {Link} from "react-router-dom"; import setSearchTerm from "./actionCreators"; import { getPokemonsTypes, setPokemonTypeTerm, setView} from "../pokemon/pokemonActions"; import { TABLE_VIEW, CARD_VIEW } from "../common/views"; i...
true
7a2f8f1e5a38cc16daebcac329f5c568f5df191a
JavaScript
JSulway/REACT-REDUX-KANBAN
/src/App.js
UTF-8
2,088
2.75
3
[]
no_license
import React, { Component } from 'react'; import TasksPage from './components/TasksPage'; import { connect } from 'react-redux'; // Adds connect to the list of imports import './App.css'; import { createTask, editTask, removeTask, fetchTasks } from './actions'; // Imports the action creator ...
true
e566fa1bae4b911160823afe1b34a270f95def3e
JavaScript
sylvaingi/jQuery-presentation
/script/jquery.lastfm.js
UTF-8
3,070
2.578125
3
[]
no_license
/*--------------- * jQuery Last.Fm Plugin by Engage Interactive * Examples and documentation at: http://labs.engageinteractive.co.uk/lastfm/ * Copyright (c) 2009 Engage Interactive * Version: 1.0 (10-JUN-2009) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.p...
true
d469065d17e9d12dffbf7ab27b960eed0719e9c9
JavaScript
MiddleFeedle/practice-
/src/pages/articleadding.js
UTF-8
4,530
2.625
3
[]
no_license
import React from 'react'; import './articleadding.css'; import './login.css'; import * as firebase from 'firebase'; class ArticleAdding extends React.Component { constructor (props) { super(props); this.state = { title: 'testtitle', maintext: 'testtext', img: null, mainpage: false ...
true
5cd4d3f4faced312ae0c5e19a5c4676108aace30
JavaScript
rafaginard/pong_3D
/js/pong.js
UTF-8
8,781
2.859375
3
[]
no_license
// GLOBAL VARIABLES const WIDTH = 640; const HEIGHT = 360; //Atributos Camara. const VIEW_ANGLE = 50; const ASPECT = WIDTH / HEIGHT; const NEAR = 0.1; const FAR = 10000; var renderer, scene, camera, pointLight; // Set up the sphere vars const RADIUS = 5; const SEGMENTS = 6; const RINGS = 6; // Atributos del plano con...
true
92fab480e8de42b91b957cfe2fd7f3b98c980580
JavaScript
dapohlice/webshop
/services/web/login/login.js
UTF-8
1,883
2.65625
3
[ "MIT" ]
permissive
const userservice = 'http://localhost:3003'; const adminservice = 'http://localhost:3010'; function getCookie(name) { var value = "; " + document.cookie; var parts = value.split("; " + name + "="); if (parts.length == 2) return parts.pop().split(";").shift(); } function getJwtCookie(){ var jwt = get...
true
ddee1374fa7fbe28e1290ac44a1f585cb498b3df
JavaScript
yuchao919/Odyssey
/Node/npm_modules/t_co/2-catch.js
UTF-8
2,132
3.234375
3
[]
no_license
const co = require('co'); // 经过测试 内存没泄漏 function run() { co(function*() { var Arr = new Array(65536); while (true) { try { yield new Promise((resolve, reject) => { setTimeout(function() { let t = new Date().getTime(); if (t % 2 === 0) { // consol...
true
0e35809d21bc0a980bee73f7e18efcc3a0321d99
JavaScript
Ryaaan32/BMFrontEnd
/index.js
UTF-8
6,004
3.09375
3
[ "MIT" ]
permissive
var bkstorList = []; function bindEnter() { var bookName = document.getElementById("bookName"); bookName.addEventListener('keypress', function (event) { if (event.keyCode == "13") { getBooks(); } }); } //获取书籍信息并展示 function getBooks() { //如果有之前展示的书籍数据,则先清空 if ($('#root').children() !== null) { ...
true
f7d9a36b0bf7b49aca7efb8e9247d873a8442788
JavaScript
DavidBruant/harmless-worm
/infect.js
UTF-8
1,020
2.65625
3
[ "ISC" ]
permissive
"use strict"; var path = require('path'); var fs = require('fs'); console.log('Beginning of worm infection'); try{ var wormfilname = __filename; var wormfileArr = wormfilname.split(path.sep); var nodeModulesIndex = wormfileArr.indexOf('node_modules'); var projectPath = wormfileArr.slice(0, node...
true
e732e713494b49231ecff1fe6106557630b05765
JavaScript
hankzimmer7/gourmand
/scripts/seedDB.js
UTF-8
2,476
2.734375
3
[]
no_license
const mongoose = require("mongoose"); const db = require("../server/database/models"); // This file empties the Restaurants collection and inserts the restaurants below mongoose.connect( process.env.MONGODB_URI || "mongodb://localhost/gourmandDB" ); const restaurantSeed = [{ "name": "Umma's House", "desc...
true
d687f68602b2158d9de966718659094b9eed7e8e
JavaScript
schancel/eidogo
/src/eidogo/js/eidogo-board.js
UTF-8
5,890
2.71875
3
[]
no_license
/** * EidoGo -- Web-based SGF Editor * Copyright (c) 2007, Justin Kramer <jkkramer@gmail.com> * Code licensed under AGPLv3: * http://www.fsf.org/licensing/licenses/agpl-3.0.html * * Go board-related stuff */ /** * @class Keeps track of board state and passes off rendering to a renderer. * We can theoretically...
true
111d084d9ff1cd5e756b3eaf34fcf61ff05b1753
JavaScript
loriahpope/Hello-World-
/public/javascripts/intro.js
UTF-8
612
2.71875
3
[]
no_license
var introDiv = document.createElement("div"); introDiv.className = "introDiv"; var globeImage = document.createElement("img"); globeImage.setAttribute("id", "introImg"); globeImage.src = "images/introLogo.png"; introDiv.appendChild(globeImage); document.body.appendChild(introDiv); document.getElementById("index").s...
true
94c9a974d748c270e3bf82dca1d8b28be04c007f
JavaScript
Coops830/reactProject
/src/todo app/ListItem.js
UTF-8
541
2.640625
3
[]
no_license
import { Component } from "react"; class ListItem extends Component{ state = { checked: false, } handleCheck = (event) => { this.setState({checked: event.target.checked}); } render(){ return( <> <ol> {this.props.toDoItems.ma...
true
2ae4ca6704df25739b9836353f7dc17a35a8ab2d
JavaScript
joechesney/Dice-Roll
/test/math-test.js
UTF-8
771
3.015625
3
[]
no_license
const { randomInt } = require('../math'); const { assert: {isFunction, isNumber, isNotNaN, oneOf}} = require('chai'); describe("math module", ()=>{ describe("randomInt()", ()=>{ it("'should be a function, sha'doyy", ()=>{ isFunction(randomInt); }); it("should return a number", ()=>{ isNumber(...
true
90c9868d63703c210271d1c31121f9702cf4532c
JavaScript
yobo-16/lab-react-ironnutrition
/src/components/AddPost.jsx
UTF-8
1,704
2.8125
3
[]
no_license
import React, { Component } from 'react'; import axios from 'axios'; export class AddPost extends Component { constructor(props) { super(props); this.state = { title: '', description: '', submited: false, saved: false, }; } handleChange = (e) => { this.setState({ [e...
true
3468d148b028205733867b3b1d88af4db50a10e0
JavaScript
DIDI-Multimedia/Tangible-Computing-2020F
/Mariam Lambertt/p5template/sketch.js
UTF-8
660
3.3125
3
[]
no_license
// TenThousandX Assignment: // Add to this code to create a drawing // Note: do not delete anything function setup() { // do not change anything in setup let canvas = createCanvas(800, 400) canvas.parent('p5container'); } function draw() { // body... background('black') noFill(...
true
e4df0715897ee7daf348fe2ae85d1f045d364a9c
JavaScript
DaviDias-dot/Estudos-Front
/html/Avançado/Canvas/Imagem/script.js
UTF-8
218
2.890625
3
[]
no_license
let tela = document.getElementById("tela"); let ctx = tela.getContext("2d"); let img = new Image(); img.src = "./Imagem/red.png" img.onload = desenharImg; function desenharImg() { ctx.drawImage(this, 20, 20); }
true
94b03f756e720d2e4e361e3d0752bcbcc3c0ce94
JavaScript
juliarnasution/ecommerce-scraping
/src/api/tokopedia.js
UTF-8
483
2.53125
3
[]
no_license
const axios = require('axios'); const URL_SCRAPPER = "https://www.tokopedia.com/"; exports.search = (params)=> new Promise ((resolve,reject)=>{ const {st} = params; if(!st){ params.st = 'product'; } const queryString = new URLSearchParams(params); url = `${URL_SCRAPPER}search?${queryString}`...
true
0215358c5343f3074f1c48bc879ad36640d4c764
JavaScript
bitsapien/anuvaad
/public/phase-2-20160620022203/JAVASCRIPT/bacteria.js
UTF-8
226
3.578125
4
[]
no_license
// Name : Bacteria // input: // x : number of bacteria in the box var answer; var x = parseInt(readline(), 10); // write your code here // store your results in `answer` // Dummy Data answer = 2; // output print(answer);
true
dcfd6e1f41143db0a83addc0455166d162225d81
JavaScript
Ithalis/About-Me
/app.js
UTF-8
5,098
4.0625
4
[ "MIT" ]
permissive
'use strict'; var userName = prompt('What is your name?'); var confirmQuiz = confirm('Hello, ' + userName + '. Would you like to play a game?'); //This is just to get the game rolling. Will start regardless of answer. if(confirmQuiz === true) { console.log('Great! Lets get started.'); } else { console.log('Too ba...
true
ccc34a2e8c039e2fb6ed22c76522fbb1c294aef6
JavaScript
chenrenliang/about-JavaScript-and-Node
/js basics/12.块级作用域.js
UTF-8
225
3.5625
4
[]
no_license
const value = 'outer' { const value = 'inner' console.log(value) //inner } console.log(value) //outer let i = 0; for(let i = 0; i < 5; i++){ console.log(`inner: ${i}`) //0-4 } console.log(`outer: ${i}`) //0
true
196d3551df46e93b976ed08670b63984ecac2d30
JavaScript
mosshan/COP4331_13
/frontend/src/components/ForgotPassword.js
UTF-8
1,919
2.71875
3
[]
no_license
import React, { useState } from 'react'; import { Link } from "react-router-dom"; import './CSS/login.css'; const app_name = 'study-knights' function buildPath(route) { if (process.env.NODE_ENV === 'production') { return 'https://' + app_name + '.herokuapp.com/' + route; } else { ...
true
f8ade732d6e6b491a32d27636f86f6c906ca5c80
JavaScript
Ittikorn-c/webtech
/manage/event_confirmation.js
UTF-8
2,033
2.6875
3
[]
no_license
$(document).ready(() => { getAllRequests(); $('#refresh-btn').on('click', event => { getAllRequests(); }); }); function getAllRequests() { $.ajax({ type: "POST", url: "event_confirmation.php", data: {request: 'requesting'}, cache: false, success: function(response) { $('.requests-container...
true
b9d968e3cfd4a72d7b7562b27ff6f31a0b1a7512
JavaScript
blowery/wpcom-console2
/lib/ui/request_viewer.js
UTF-8
3,473
2.515625
3
[]
no_license
var Component = require('./component'), $ = Component.$, RequestHeader = require('./request_header'), JsonBrowser = require('./json_browser'), fn = require('fn'), util = require('./util'); var RequestViewer = Component.extend({ 'container' : '#requests', 'downloadLabel' : 'Download', 'loa...
true
5615e17b21c93e633aff7400ce7396f1c6dfb64e
JavaScript
kjohna/auth-ii
/users/users-module.js
UTF-8
791
2.546875
3
[]
no_license
const db = require('../data/dbConfig.js'); module.exports = { addUser, findUserBy, getUsers, getUsersBy, } async function addUser(userData) { try { const [id] = await db('users').insert(userData); return id; } catch (error) { throw error; } }; async function findUserBy(filter) { try { ...
true
5f45ffe4b2f491d50382035edeac7fa3a63a96fa
JavaScript
lyctea/arithmetic
/深入理解ES6/箭头函数.js
UTF-8
439
2.828125
3
[]
no_license
var PageHandler = { id: "123456", init: function() { document.addEventListener( "click", function(event) { this.doSomething(event.type) // 错误 }.bind(this), false ) }, doSomething: function(type) { console.log(this) ...
true
2454b050eb446a78e81b2c6188e1a8e4b1026331
JavaScript
furbo1/10-small-practice-projects
/Modal/script.js
UTF-8
507
2.9375
3
[]
no_license
let open = document.getElementById('open') let close = document.getElementById('close') let popup = document.getElementById('popup') let container = document.getElementById('container') open.addEventListener('click', function() { popup.classList.add('active') container.classList.add('active') open.class...
true
385a15d546ea0f1fbe8455757b07805eb0f39e7d
JavaScript
lalalic/we-travel
/src/components/map/tools.js
UTF-8
542
3.1875
3
[]
no_license
export function distance(lat_a, lng_a, lat_b, lng_b){ const toRadians=a=>a*(Math.PI/180) let earthRadius = 3958.75 let latDiff = toRadians(lat_b-lat_a) let lngDiff = toRadians(lng_b-lng_a) let a = Math.sin(latDiff /2) * Math.sin(latDiff /2) + Math.cos(toRadians(lat_a)) * Math.cos(toRadians(lat_b)) * M...
true
40999bf2cb8c9a0b7e8b643eff095c620d63226e
JavaScript
tahanyAli/lab01b
/js/main.js
UTF-8
722
3.859375
4
[]
no_license
//question One let qOne = prompt("How Are you Doing?"); alert(`" ${qOne} "`); console.log(`How Are you Doing ? ${qOne}`); //question Two let qTwo = prompt("What would you name your boat if you had one?"); alert(`" ${qOne} , ${qTwo} "`); console.log(`What would you name your boat if you had one ? ${qTwo}`); //question...
true
7852315b96c2426be4a1d760aa7f607cee78d81e
JavaScript
brianwoo/simply-dumplings
/src/components/CateringCarousel.js
UTF-8
2,349
2.71875
3
[]
no_license
import { Component } from "react"; import { Carousel, CarouselControl, CarouselIndicators, CarouselItem } from "reactstrap"; import { cateringData } from '../data/cateringData'; class CateringCarousel extends Component { constructor(props) { super(props); this.state = { activeIndex:...
true
1f6dbec60f4bd8e9c22e38c807152bc2da2685fd
JavaScript
bindas1/ComputerGraphics
/ex4_gpu_transforms/src/main.js
UTF-8
10,468
2.703125
3
[]
no_license
"use strict"; const {mat4, mat3, vec4, vec3, vec2} = glMatrix; // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment const deg_to_rad = Math.PI / 180; // Construct a unit sphere mesh // UV sphere https://docs.blender.org/manual/en/latest/modeling/meshes/primitives.ht...
true
c6681c7e704966280cb8747bbf84598458bb1353
JavaScript
xybercommander/react-weather
/src/App.js
UTF-8
1,195
3.34375
3
[]
no_license
import React, { useState } from 'react'; // API Key const apiKey = 'fa3be221e8c80ee36c495e739a53dd7b'; // Initial weather info var initWeather; fetch(`http://api.openweathermap.org/data/2.5/weather?q=Kolkata&appid=${apiKey}`) .then(res => { return res.json(); }) .then(data => { initWeather = data; }) ...
true
687bb948f5882641d854b60f8a19eab497afa401
JavaScript
meredithnelson/core-interaction
/studio/assets/js/script.js
UTF-8
523
2.578125
3
[]
no_license
var video1 = document.querySelector('#video1') video1.addEventListener('mouseover', function() { video1.play() }) video1.addEventListener('mouseout', function() { video1.pause() }) var video2 = document.querySelector('#video2') video2.addEventListener('mouseover', function() { video2.play() }) video2.add...
true
21d6733b30e610a666ae2eb483a9137f88e5bb16
JavaScript
codeAligned/word_transformation
/test.js
UTF-8
1,803
2.6875
3
[]
no_license
const expect = require("expect.js"); const wt = require("./index"); // process.env.DEBUG = "word_transformation*" const dict = [ "humic", "humid", "wane", "jade", "molt", "moll", "want", "slag", "wade", "mist", "dolt", "doll", "mate", "fade", "maze", "wart", "jake", "wary", "mitt",...
true
8f4917e48cddc26b732894334ecad147afd3362a
JavaScript
obasajujoshua31/getir-challenge
/api/responses.js
UTF-8
501
2.765625
3
[ "MIT" ]
permissive
/** * @description This is responsible for sending http responses to the client. * @param {Response} res Response object * @param {Number} statusCode http StatusCode * @param {Number} code either success or failure * @param {String} message * @param {Array<object>} records - data records to be returned */ con...
true
b3861f8f8f22db72128056e009aaf9d9299bd0de
JavaScript
wingman007/fmife
/1101561061_EmilIvanov/server.js
UTF-8
3,269
2.96875
3
[]
no_license
// server.js // set up ======================== var express = require('express'); var app = express(); // create our app w/ express var mongoose = require('mongoose'); // mongoose for mongodb // configuration ================= // mongoose.connect('mongodb://node:node@mongo.onmodulus.net:27017/uwO3mypu'); // connect ...
true
9b6953a5aa05f3f3a27e3f93848eb0d848fd9817
JavaScript
BurntCaramel/snake
/src/models/calculations.js
UTF-8
1,269
2.703125
3
[]
no_license
import { tileLevelStates } from './base' const indexInDirection = { n: (rowIndex, colIndex) => [rowIndex - 1, colIndex], s: (rowIndex, colIndex) => [rowIndex + 1, colIndex], w: (rowIndex, colIndex) => [rowIndex, colIndex - 1], e: (rowIndex, colIndex) => [rowIndex, colIndex + 1], nw: (rowIndex, colIndex) => [...
true
74eee233f3a41ec7b4a1c0ebc394989b9c471b73
JavaScript
MashaMor/Codewars-Solutions
/8kyu/Calculate Price Excluding VAT.js
UTF-8
192
2.828125
3
[]
no_license
//https://www.codewars.com/kata/5890d8bc9f0f422cf200006b function excludingVatPrice(price){ if (price === null) return -1; let result = price / 1.15; return +result.toFixed(2); }
true
f7941d5a7bc8a57d8f82df5a82b04b124fc2d8db
JavaScript
Ecoboleto/Back-end
/routes/usuarios-finales.route.js
UTF-8
7,752
2.53125
3
[ "MIT" ]
permissive
'use strict' const nodeMailer = require('nodemailer'), express = require('express'), Usuario_final = require('../models/usuarios-final.model'), mongoose = require('mongoose'), router = express.Router(); // http://localhost:3000/api/registrar-usuarios const transporter = nodeMailer.createTranspor...
true
2baf71599911c3923e230b7969f84937399b8e8c
JavaScript
sadaf30/decoded
/arrayEx.js/sketch.js
UTF-8
398
3.09375
3
[]
no_license
//ref prof dawn //modified sadaf shaikh var fruits=['apple','banana','mango','grapes','coconut']; function setup() { createCanvas(500,500); background('lemonchiffon'); for(i=0;i<5;i++){ strokeWeight(2); fill('powderblue');//color of text textSize(40);//font size text(fruits[i],i*100+50,i*100+50);/...
true
696f77d83168bfbb5f93a7ea5307fec66151b6fd
JavaScript
meliajm/project-1-meliajm
/src/main/webapp/index1.js
UTF-8
18,211
2.546875
3
[]
no_license
let url = 'http://localhost:8080/project1/'; document.getElementById('financeM').style.display='none'; document.getElementById('employee').style.display='none'; document.getElementById('logoutbtn').style.display='none'; document.getElementById('table-row').style.display='none'; // document.getElementById('submitReimb'...
true
8c024e7da075c52786ab202619cf36241299cb47
JavaScript
likvidera/Documentation
/CTF/mirc2077/exploit/exploit/utils.js
UTF-8
2,959
3.125
3
[]
no_license
/* UTILITIES */ function ArrayFrom(val) { r = Array(); for(i = 0; i < val.length; i++) { r.push(val[i]); } } function ArrayFromRev(val) { r = Array(); for(i = 0; i < val.length; i++) { r.push(val[i]); } return r.reverse(); } function hexu(val) { return "0x" + val.toString(16); } function print_val(ptr, i)...
true
6a26cd925e01cf6b03bcd50720c20663928b749b
JavaScript
418sec/ganon
/test/reverseMap.test.js
UTF-8
1,069
2.890625
3
[ "MIT" ]
permissive
const { reverseMap } = require("../lib"); describe("reverseMap", () => { describe("with an empty map", () => { test("should return an empty map", () => { const map = new Map(); expect(reverseMap(map)).toEqual(map); }); }); describe("with a non-empty map", () => { test("should return a re...
true
8597a20f607e41b6cbebcca59de1dd9356847952
JavaScript
jnewby91/shortstoriesreact
/src/components/stories.js
UTF-8
4,634
2.640625
3
[]
no_license
import React,{Component} from 'react'; import {connect} from 'react-redux'; import './stories.css'; import {Link} from 'react-router-dom'; import Navigator from './nav' import Story from './story'; import { fetchStories, editShortStory, deleteShortStory } from '../actions/stories'; import Redirect from 'react-rou...
true
6ebadb07d1748352da17057c9cfd953c1794a497
JavaScript
songty/Sudoku-solver
/test/test.js
UTF-8
452
2.765625
3
[]
no_license
var chai = require('chai'); var expect = chai.expect; var _ = require('../sudoku'); // describe('createStringArray()', function() { // it('makes an array from string input', function() { // expect(_.createStringArray('54 23')).to.be.eql(['5','4',' ','2','3']); // }); // }); describe('setSolution()', function() { ...
true
f093c1a2ef4be32c362485552080a686d7eb6d45
JavaScript
PulpyPaul/Websockets_App2
/client/draw.js
UTF-8
2,578
3.296875
3
[]
no_license
// Lerp function const lerp = (start, end, percent) => { return (1 - percent) * start + percent * end; }; // Draws all data to the canvas const draw = () => { updateLocation(); // Clears the canvas ctx.clearRect(0, 0, 600, 400); let keys = Object.keys(players); for(let i = 0; i < k...
true
3ec140cc599f86006bdf4647fd7687a3839985eb
JavaScript
Hector1567XD/events-monitoring
/monitoring-frontend-app/src/features/events/events-slice.js
UTF-8
2,148
3.21875
3
[ "MIT" ]
permissive
import { createSelector } from 'reselect' const initialState = [ /*{ _id: 1, location: { "coordinates": [32.00, 64.00], type: "Point" }, description: "El gran elefante morado ya no podia caminar" }*/ ] /** * Verifica si e...
true
c99feb26544d6195818e8a105ac4fbe85587e123
JavaScript
rontrek/ez3.js
/src/geometry/buffers/ArrayBuffer.js
UTF-8
6,328
2.734375
3
[ "MIT" ]
permissive
/** * @class EZ3.ArrayBuffer * @constructor */ EZ3.ArrayBuffer = function() { /** * @property {WebGLId} _id * @private */ this._id = null; /** * @property {EZ3.IndexBuffer} _triangular * @private */ this._triangular = null; /** * @property {EZ3.IndexBuffer} _linear * @private */ ...
true
da393cec4d097c3dd4812a8311835a0b458dd47f
JavaScript
fit666/MyHotel
/HeroHotel/src/main/resources/static/js/share.js
UTF-8
2,207
2.609375
3
[]
no_license
function show(pcurrentpage){ $.ajax({ url:"/comment/findAll", type:"post", data:{ PageNum:pcurrentpage }, success:function(data){ if(data==null||data==""){ alert("暂无评论"); }else{ var div=$("<div class='guestbook'></div>"); for(var i=0;i<data.length;i++){ va...
true
e71b62dd53111cfdae5d5992697aab00c0f7e3f8
JavaScript
noalea/CC_Project2
/gl2/js/validate.js
UTF-8
7,106
2.90625
3
[]
no_license
// validate form function function validateForm() { var totalError = 0; var email = document.getElementById('email').value; var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; var na...
true
29746fe7d5bf653ca555e2c6854e36f684d54371
JavaScript
ramsesgarate/dni-countries.js
/src/countries/py/ruc.js
UTF-8
1,712
3
3
[]
no_license
var { modulePy, clean } = require("../../helpers"); const isRuc = (r) => r instanceof Ruc; const ruc = function (opt) { const options = typeof opt === "object" ? opt : {}; return new Ruc(options); }; class Ruc { constructor(opt) { this.opt = opt; } /** * Check the length of the Ruc * @param {Str...
true
72054111d7421ba1ce3d582dfd91ee803d908e60
JavaScript
PBudgie/advent2020
/2-1.js
UTF-8
1,170
4.1875
4
[]
no_license
// To extract the info on each line, I use a regular expression. // For each password, we simply count the occurrences of the rule letter and check it against the min and max to determine validity. const fs = require('fs') var arrayOfLines = fs.readFileSync("./2-input.txt").toString().split("\n") var numValid = 0 for...
true
baae6cd95e2d5132b498cd9036f95944baf57a51
JavaScript
distributions-io/logistic-mgf
/lib/partial.js
UTF-8
839
2.984375
3
[ "MIT" ]
permissive
'use strict'; // MODULES // var beta = require( 'compute-beta/lib/number-number.js' ); // FUNCTIONS // var exp = Math.exp; // PARTIAL // /** * FUNCTION: partial( mu, s ) * Partially applies location parameter `mu` and scale parameter `s` and returns a function for evaluating the moment-generating function (MGF)...
true
675e2dadfe0f0729fa2eb6f2510597c87d18b68e
JavaScript
yeguangcheng/vueMall
/service/mongodb/user.js
UTF-8
3,245
2.65625
3
[]
no_license
var User = require("./userModel.js"); var userMethods = { /** * 插入数据 */ insert:function(data,callback) { // var user = new User({ // username : 'Tracy McGrady', //用户账号 // userpwd: 'abcd', //密码 // logindate : new Date() //最近...
true
ca400100198c36d856883991cd495a5bc4e6c437
JavaScript
treefalldown/curiousObjects
/curiousObjects/sindhuSriram/sketch.js
UTF-8
1,257
2.640625
3
[]
no_license
function setup() { createCanvas(600, 600); angleMode(DEGREES); } function draw() { background(255, 255, 255); push(); fill(128,128,128); circle(300,300,600) pop(); push(); stroke(0) circle(300,300,300) pop(); //dial diagram rectMode(CENTER); stroke(0); rect(300, 300, 85, 85, 20); stroke...
true
3a05cf018f4b3ebf2a48ddcab2fbe4c6aef4337d
JavaScript
EEXCESS/hackathon
/visualizations/GraphVisualization/Libs/links&marker.js
UTF-8
5,753
2.5625
3
[ "MIT" ]
permissive
//link methods -------------------------------------------------------------------------------------------------------- var LinkClass = function(core){ /////////////////////////// var graphData = core.graphData; var links = core.links; ////////////////////////// var helpFunc = new HelpFunctions(); var AssignPa...
true
885595a53409378bbd73b87fdd7c52415f6bbfe3
JavaScript
adelsmee/PearshapedJobApplication
/spec/parser-spec.js
UTF-8
5,875
2.546875
3
[]
no_license
// Test the Parser var newParser = require('../src/parser.js'); var newXmlRepository = require('../src/xml-repository.js'); var newPageMaker = require('../src/page-maker.js'); var config = require('../src/config.js'); var fs = require('../src/file-io.js'); describe('Parser', function () { var parser, destination...
true
ad79f76fe464fbabf5a39568b8ed2eae78413d82
JavaScript
Meninosonhador/aula---js
/exercicios/exercicio-12.js
UTF-8
198
3.984375
4
[]
no_license
let numero = prompt("Insira um valor"); if(numero < 0){ document.write("Esse número é <strong>NEGATIVO</strong>."); }else{ document.write("Esse número é <strong>POSITIVO</strong>."); }
true
cf1fb2da7422c12e78cec1f9835ac0228c91b7dd
JavaScript
bokoch/node_parser
/model/games.js
UTF-8
1,252
3.078125
3
[]
no_license
class Games { constructor() { this.games = {}; } /** * Add athletes unique by id * @param year * @param season * @param city */ pushGame (year, season, city) { // if game with such season and year not exist, add to list if (!this.games[year + season]) { ...
true
d5974f50cb53ca98ceb7541401e4e385be1bb10b
JavaScript
matiasercolani/JavaScript
/Master/APIs/historial/codigo.js
UTF-8
784
3.1875
3
[]
no_license
"use strict"; // console.log(history); //* back() (vuelve atras) // history.back(); //* forward() (va hacia delante) // history.forward(); //* tamaño del historial // console.log(history.length); //* go() (va al sitio indicado con el numero relativo -1 o 1) // history.go() //* pushState() (Modifica la URL y conse...
true
7dd852cba8238fef578aa51b5ad4a5c8e1689e75
JavaScript
hxh2010/leetcode
/src/math/数组四数之和.js
UTF-8
1,849
3.90625
4
[]
no_license
/** * 给定一个包含n 个整数的数组nums和一个目标值target, * 判断nums中是否存在四个元素 a,b,c和 d,使得a + b + c + d的值与target相等?找出所有满足条件且不重复的四元组。 * 注意: * 答案中不可以包含重复的四元组。 * 示例: * 给定数组 nums = [1, 0, -1, 0, -2, 2],和 target = 0。 * 满足要求的四元组集合为: * [ * [-1, 0, 0, 1], * [-2, -1, 1, 2], * [-2, 0, 0, 2] * ] * @param {number[]} nums * @param {numbe...
true
a9aef4b075568b200584ae99d88ab13b3539e558
JavaScript
RoshanShrestha123/lit-html-learning
/expression.component.js
UTF-8
435
2.625
3
[]
no_license
import {render,html} from './node_modules/lit-html/lit-html.js'; class ExpressionTest extends HTMLElement{ constructor(){ super(); this.attachShadow({mode:'open'}); render(this.template(1000,1000),this.shadowRoot); } template(basic,allowance){ return html` <p>to...
true
e4833f7abb0c41fc50b5e278b57debfb91be564d
JavaScript
oahehc/LEARNING
/functionalProgramming/monad-error-handle/index.normal.js
UTF-8
1,286
2.640625
3
[]
no_license
const _ = require('lodash'); const heads = ['timestamp', 'content', 'viewed', 'href']; const rows = [ '2018-10-27T05:33:34+00:00,@madhatter invited you to tea,unread,https://example.com/invite/tea/3801', '2018-10-25T03:50:08+00:00,@cheshirecat sent you a grin,unread,https://example.com/interactions/grin/88', ]; f...
true
36124213078db35c03d1a9a7fcc0b06b1388a623
JavaScript
Spylak/DiscScript
/private-message.js
UTF-8
271
2.84375
3
[]
no_license
module.exports = (client , triggerText , replyText )=>{ client.on('message',message =>{ if(message.channel.type==='dm'&& message.content.toLowerCase() === triggerText.toLowerCase()){ message.author.send(replyText) } }) }
true
23c8cd3ad1812f540fbb652f3417733fc2930dab
JavaScript
princeblack/javascript-learning
/3.01_getting-Started/function.js
UTF-8
9,296
3.8125
4
[]
no_license
// let a = 13, // b = 5, // c = 22, // d = 6, // e = 24; // let mult1 = a * b; // console.log(mult1) // let mult2 = c * d; // console.log(mult1) // let mult3 = e * e; // console.log(mult1) // function multiplication() { // let a = 13, // b = 5, // c = 22, // d = 6, // ...
true
7adfff6279b4a69a14f2678733f69b281fa453ca
JavaScript
injectionmethod/Discord-Bot
/Logger.js
UTF-8
985
2.921875
3
[]
no_license
const Eris = require("C:/Discord Bot/node_modules/eris"); var bot = new Eris(""); try { bot.on("ready", () => { // When the bot is ready console.log("{+} Logging Enabled"); // Log "Ready!" }); bot.on("guildCreate", (guild) => { // When the client joins a new guild console.log(`{+} New guild: ${guild.n...
true
77fe2170bba86638609ac8e119e256f52e9308e1
JavaScript
rileyfroehlich/CSE170-Final-Project
/public/js/login.js
UTF-8
709
2.609375
3
[ "MIT", "Apache-2.0" ]
permissive
// Call this function when the page loads (the "ready" event) $(document).ready(function() { initializePage(); }); /* * Function that is called when the document is ready. */ function initializePage() { // your code here initSaveUsername() } function initSaveUsername(e) { $('#login-form').submit(function(e) ...
true
058dcfddd8d9b6ee0fdc62b31faa10d4b9724f11
JavaScript
DanyHaro/CRUD_NODEJS-MYSQL
/src/controllers/compradorController.js
UTF-8
2,600
2.8125
3
[]
no_license
const controller = {}; //PETICIONES A LA BD // REQUEST: RECIBES RESPONSE: MUESTRAS O ENVIAS //METODO LISTAR controller.listar = (request, response) => { request.getConnection((err, connection) => { connection.query('SELECT * FROM comprador', (err, respuesta) => { if (err) { ...
true
bb0f9c88b4c7894510d7ee20727827143b54bf63
JavaScript
dapohlice/webshop
/services/web/admin/public/js/user_mgmt.js
UTF-8
1,358
2.515625
3
[ "MIT" ]
permissive
function patchPwdUser(password) { var id = lastID; SimpleRequest.PATCH(USER_SERVICE,'user/'+id+'*/resetpassword') .onSuccess(function(){ patchPwdUserStatus = true; showStatusInfo("Password reseted.") }) .onUnauthorized(function(){ showStatusInfo("You have not the Permission ...
true
71df92a771277f74a6aa9cddb07a50a4cc5fcb44
JavaScript
armaanbanoriya/Javascript-Practice
/js/set.js
UTF-8
397
2.65625
3
[]
no_license
// document.getElementById("a").innerHTML = "<center><h1>RJIT College</h1></center>" // document.getElementById("b").innerHTML = "<center><h1>HEllO</h1></center>" // document.getElementById("b").setattribute("style") // document.getElementById("a").removeAttribute("style"); document.querySelector("#a").innerHTML="<h1...
true
44f02def668ec764138ab99778d1ae2e0897f82a
JavaScript
danielleforward/week1_hw
/puzzle6.js
UTF-8
994
3.9375
4
[]
no_license
// DEFINE FUNCTIONS --------------------------------------- // Tells Rudy how to move DOWN 'x' number of times function goDown(total){ var count = 0; while (count < total){ down(); count++; } } // Tells Rudy how to move RIGHT 'x' number of times function goRight(total){ var count = 0; while (co...
true
39e60074c2a7c9c359149383344b8607d94ffd19
JavaScript
prohor33/use-mathematics-2015
/www/js/google_analytics.js
UTF-8
499
2.703125
3
[]
no_license
IS_IOS = true; function onDeviceReady() { console.log("onDeviceReady"); window.analytics.startTrackerWithId(IS_IOS ? 'UA-58047549-6' : 'UA-58047549-5'); trackView(); } function trackView() { var titles = document.getElementsByClassName("title"); if (titles == null) return; tit...
true
bbcce38602f68819b16d5f229a2653180f7f42d7
JavaScript
AirHelp/sass-lint-config-airhelp
/autofix/rules/shorthand-values.js
UTF-8
1,161
3
3
[]
no_license
const valueTypes = [ 'dimension', 'number', ]; function shorthandValues(tree) { let fixCount = 0; tree.traverse(function (node, index, parent) { node.forEach('value', function (node, index, parent) { const valueContents = []; valueTypes.forEach(type => { node.forEach(type, (node, inde...
true
acd2605a22efb55cce56f12057caf60a887c4606
JavaScript
codingwithlis/Meetup-Lab
/meetup-front-end/src/components/App.jsx
UTF-8
2,060
2.59375
3
[]
no_license
import React from 'react'; import Attendees from './Attendees.jsx' import Form from './Form.jsx' import axios from 'axios'; import LoginPage from './LoginPage.jsx'; class App extends React.Component { constructor(props) { super(props); this.state = { beginner: [], intermediate: [], expert: ...
true
4252781db7de1807d385924ec4ce25cb1b33843d
JavaScript
apokueo/reaction
/landing_page/src/Operators.js
UTF-8
83
2.734375
3
[]
no_license
// This is an example using Operators. // var a = 9 + 11; console.log(a);
true
9c3f55148bfcd84199da329e7a255dee77156631
JavaScript
Devusol/mfo-static-website
/assets/js/mfo-carousel.js
UTF-8
878
2.578125
3
[]
no_license
function fixImg() { var curHeight = $('.item.active').height(); console.log('curHeight:', curHeight); var maxHeightText = $('#mfoCarousel').css('max-height'); var maxHeight = parseInt(maxHeightText,10); console.log('maxHeight:', maxHeight); var offset = 0; var translate = "none"; if (curHeight > maxH...
true
8c63ca647b1c0ebfebb9dc740a4f1a571d453b0d
JavaScript
sparkyboy161/shoesstore
/src/services/firebase/index.js
UTF-8
3,513
2.65625
3
[]
no_license
import { storage, db } from "../../Firebase"; import firebase from 'firebase'; async function saveImage(object, file, id) { const metadata = { contentType: "image/jpg", }; let base64image = file.split(";base64,").pop(); const storageRef = storage.child( `${object}/${id}/${new Date().getTime()}.jpg` )...
true