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
33c1a7ea6bf52a378bb77a4900aa192def16b945
JavaScript
Ericaemiliana/Express-Routing
/calculator.js
UTF-8
2,376
2.859375
3
[]
no_license
const express = require("express"); const app = express(); const ExpressError = require("./expressError"); app.use(express.json()); const { converter, findMode, findMean, findMedian } = require("./helpers"); // router handler to calculate the mean app.get("/mean", function (req, res, next) { // if no values are ent...
true
c29d05db1f75bf005ee0e1ce4f81f1ef8f596af0
JavaScript
HelveticaScenario/TUNESQUAD-REACT
/src/scripts/views/stars.js
UTF-8
616
2.578125
3
[]
no_license
/** * @jsx React.DOM */ var React = require('react'); var _ = require('lodash'); var Stars = React.createClass({ handleTap: function(star) { this.props.onTouchTap(star); }, render: function() { var starsArr = []; for (var i = 0; i < (this.props.count || 0); i++) { starsArr.push((<span onTouchTap={_.par...
true
4b4c8edd8e70d642a917bc5e99129175813dd6bc
JavaScript
weeklynote/react_learning
/src/hello_world.js
UTF-8
1,125
2.96875
3
[]
no_license
import React, { Component } from 'react'; import { AppRegistry, Text } from 'react-native'; class AwesomeProject extends Component { render() { return ( <Text>Hello world!</Text> ); } } // 注意,这里用引号括起来的'AwesomeProject'必须和你init创建的项目名一致 AppRegistry.registerComponent('AwesomeProject', () => AwesomeProje...
true
5cb026abc9a3b30922cef2c0f297d7e1ddb50a9c
JavaScript
shevdi/GameOfLife
/src/js/view.js
UTF-8
1,330
2.65625
3
[]
no_license
export default function () { const _updateView = function (field) { $('#field tr').remove(); const fragment = document.createDocumentFragment(); // In table create rows and then columns. In id write number of column and row. for (let i = 0; i < field.length; i++) { const ...
true
cd51fbd41eb0c787501895935cbf4cd63c69ddc1
JavaScript
Nolanrulesroblox/Pacman-App
/source/demo/DemoGhost.js
UTF-8
1,781
3.234375
3
[]
no_license
/** * @extends {Ghost} * The Demo Ghost Class */ class DemoGhost extends Ghost { /** * The Demo Ghost constructor * @param {string} name * @param {string} color */ constructor(name, color) { super(); this.canvas = Board.screenCanvas; this.ctx = this.ca...
true
656300fe45a4a092d01f43b68c1143828dcf6b7b
JavaScript
quirico/learnyounode
/baby-steps.js
UTF-8
91
2.546875
3
[]
no_license
const [a, b, ...rest] = process.argv; console.log(rest.reduce((a, v) => a + Number(v), 0));
true
2caf25737017bb873075c7cc66cce23618952ca3
JavaScript
Maravilla-Visual/blog-computacion-visual
/components/sketches/ilusiones/Blivet.js
UTF-8
1,430
2.75
3
[]
no_license
export default function RedBall(p5) { let constx = -4; let consty = -0.4; let movx = 0; let movy = 0; let a = false; p5.setup = function () { p5.createCanvas(900, 400); }; p5.draw = function () { p5.background(255); p5.translate(0, 500); p5.stroke(204, 102, 0); // X1 Y1 X...
true
06c778dae6fc1431482a02344450f123faa8e867
JavaScript
jbouzekri/hotline-js
/public/javascripts/chat.js
UTF-8
2,877
2.734375
3
[ "MIT" ]
permissive
(function(window, document, $){ var chatManager = { socket: null, pseudo: "undefined", cookieName: "hotlinejs", send: function(msg) { var message = this.buildMessage(msg); this.getSocket().emit('user-message', message); this.addMessage(message); ...
true
fc300aac61458c3388c2318745ba5c9fd37de615
JavaScript
likelion-khw/WhameProject
/Project/src/main/webapp/resources/js/enrollform_js.js
UTF-8
1,149
2.734375
3
[]
no_license
function changeCategory() { var category = $("#categorySelect").val(); var store_category; if(category == "한식"){ store_category = 100; } else if(category == "중식"){ store_category = 200; } else if(category == "일식"){ store_category = 300; } else if(category == "양식"){ store_ca...
true
b51fc3f313405ef586ed3a3acfad45c5625982d7
JavaScript
sushmitasah/chatbot-project
/datasend_db4.js
UTF-8
1,426
2.859375
3
[]
no_license
// Initialize Firebase var config = { apiKey: "AIzaSyAJ-kHys7rIXfoLH1AmmnTIS41k0v9hYcM", authDomain: "fir-training-38447.firebaseapp.com", databaseURL: "https://fir-training-38447.firebaseio.com", projectId: "fir-training-38447", storageBucket: "fir-training-38447.appspot.com", messagingSender...
true
c1bfff7d218c189151a3392d6fcd9d8601dd4247
JavaScript
urre/greycolors
/src/App.js
UTF-8
1,831
2.703125
3
[]
no_license
import React, { Component } from "react"; import tinycolor from "tinycolor2"; import "./appy.css"; import Footer from "./components/Footer"; class App extends Component { constructor(props) { super(props); this.state = { value: 3, colors: [...Array(48).keys()], hexes: [], copied: fal...
true
5e03c58eea78409ca0367cb14ce77a88174fbe45
JavaScript
freeSFish/x-spreadsheet
/src/component/filtermenu.js
UTF-8
2,691
2.5625
3
[ "MIT" ]
permissive
/* global window */ import { h } from './element'; import { bind } from '../event'; import { cssPrefix } from '../config'; import { tf } from '../locale/locale'; import Icon from './icon'; const menuItems = [ { key: 'asc', title: tf('filtermenu.asc'), label: '' }, { key: 'desc', title: tf('filtermenu.desc'), label...
true
77ca74be56abfb3ecae6684853a2956fb8a160bd
JavaScript
1906jun10java/dylan-waser
/ServletDemp/src/main/webapp/scripts/check.js
UTF-8
948
3.328125
3
[]
no_license
/** * */ let user = {}; window.onload = function() { populateUser(); } function populateUser() { //send a GET request to SessionServlet to obtain session information fetch("http://localhost:8081/ServletDemp/session").then(function(response) { return response.json() //parse the response in json format to javas...
true
897e8e962fb60f229365e9c604e759e6b20c391f
JavaScript
deadratfink/pkg2md
/lib/md-writer.js
UTF-8
4,912
2.90625
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
'use strict'; var constants = require('./constants'); var Promise = require('bluebird'); var mkdirp = require('mkdirp-then'); var path = require('path'); var fs = Promise.promisifyAll(require('fs')); var os = require('os'); var stringify = require('json-stringify-safe'); //////////////////////////////////////////////...
true
cd25bf64a7a72620daf05f25d758acfc11d85922
JavaScript
pawanray/reactCricketWebiste
/src/store/reducers/matchesReducer.js
UTF-8
1,344
2.625
3
[]
no_license
import {UPCOMMING_MATCHES, LIVE_MATCHES, RECENT_MATCHES, ALL_MATCHES} from '../actionTypes'; const intialState = { upcomingMatch:[], liveMatch:[], recentMatch:[], testMatch:[], twentyMatch:[] } const matchesReducer = (state=intialState,{type,payload})=>{ switch(type){ case ALL_MATCHES: ...
true
a3656208ed7100640d54e1509545870ac1d8252c
JavaScript
Schmitty89/BigBuys-api
/routes/users.js
UTF-8
971
2.59375
3
[]
no_license
const express = require('express'), User = require('../models/user'); const router = express.Router(); router.post('/', function(req, res){ var user = new User(req.body); user.save(function(err){ if (err){ res.json(err); return } res.json(user); }); }); router.get('/...
true
ed1724932f41fed11e254056978b3b1240bcf8d9
JavaScript
AdventistasSP/sabbath-school-lessons
/compile.js
UTF-8
2,453
2.53125
3
[ "MIT" ]
permissive
var metaMarked = require("meta-marked"), fs = require("fs-extra"), yamljs = require("yamljs"), fswf = require("safe-write-file"); var SOURCE_PATH = "src/", SOURCE_INFO_FILE = "info.yml", SOURCE_EXTENSION = "md", SOURCE_COVER_FILE = "cover.png", DIST_PATH = "dis...
true
d9b63ce86956ee04ec9d9cfcc7a6181248fa0a85
JavaScript
isford/auth-shelf
/src/redux/sagas/item.saga.js
UTF-8
1,496
2.765625
3
[]
no_license
import { put, takeLatest, takeEvery } from 'redux-saga/effects'; import axios from 'axios'; // saga generator to handle axios GET all items function* fetchItems() { try { const response = yield axios.get(`/api/shelf`) console.log(`Server says... ${response}`) yield put({ type: "SET_ITEMS", payload: respo...
true
9b232bd8fbb333a5864cf31780793574bb5d03d0
JavaScript
criesbeck/thinking-with-hooks
/src/App.js
UTF-8
3,437
2.59375
3
[]
no_license
import React, {Suspense, useEffect, useState} from 'react'; import { Container, Form, Grid, List, Segment } from 'semantic-ui-react'; import './App.css'; function ProductList(props) { const {products} = props; const items = products.map(product => <List.Item key={product.name}> <Grid columns={3}> ...
true
4595908b4f697656d67db46a5bd22375ac3096ad
JavaScript
FGuerreir0/Covid19Tracker
/src/Components/LineChart/index.jsx
UTF-8
3,038
2.625
3
[ "MIT" ]
permissive
import React, { useState, useEffect } from 'react'; import { Line } from 'react-chartjs-2'; import numeral from 'numeral'; //IMPORT SERVICE import { history } from '../../services/diseaseApi'; const options = { legend: { position: 'top', labels: { fontColor: 'black', fontSize: 10, }, }, e...
true
ee279ec67bda2eda8f94248cbd356e9bc8a65b61
JavaScript
mamacas/DataStructures
/__test__/__dailyChallenge__/diagonalSum.test.js
UTF-8
451
2.859375
3
[ "MIT" ]
permissive
'use strict'; const diagonalSum = require('../../dailyChallenge/diagonalSum-arr.js'); describe('Matrix Diagonal Sum', () => { it('should accurately sum diagonal values in a square matrix, counting the middle element only once', () => { let input1 = [[1,2,3], [4,5,6], [7,8,9]]; expect(diagonalSum(input1)).t...
true
17d94f5b64e4263c44bef5fdc5a0ef480deea5ae
JavaScript
youngscientists/article-management-web-ui
/src/proxies/APIProxy.js
UTF-8
2,724
2.640625
3
[]
no_license
import BaseProxy from "./Proxy" export default class APIProxy extends BaseProxy { /** * The constructor for the ArtistProxy. * * @param {Object} parameters The query parameters. */ constructor( parameters = { callback: "" } ) { const API_PRODUCTION = "https://ysj-article-management....
true
05eb1c501bbc9408b145e930142155c96c18dd80
JavaScript
KONGLEON/arozos
/src/web/Music/functions/listSong.js
UTF-8
9,637
2.890625
3
[]
no_license
/* List Song This function will list all song with the given directories. Type of operations listSong=(type) listSong=search:(keyword) listdir=root listdir= (Target path) listfolder=(target folder) This module is a direct lanuage translation from the original module.Musi.go */ /...
true
b480e8b963821aaf5bd8780152195f9ea3be7f81
JavaScript
AmenyaZ/Gatepass
/js/signup.js
WINDOWS-1250
4,745
2.953125
3
[]
no_license
function checkform(){ if(document.frm.namee.value=='') { alert("Please enter your name!"); document.frm.namee.focus(); return false; } if(document.frm.email.value=='') { alert("Please write your email address!"); document.frm.email.focus(); return false; } if(document.frm.password.v...
true
0e2fd0b19084d2cd085523b5807b64d4a985cd52
JavaScript
bcataldo/cnit133
/js/assign4-pt4.js
UTF-8
1,847
3.515625
4
[]
no_license
function calculateAmount() { //declare variables var pNum, qProd, totalNum, totalSold = 0, cost, i; //cycle through for all 5 products with for statement for (i = 1; i <= 5; i++) { pNum = parseInt(document.getElementById("prod" + i).value); // Get values as it cycles through the product # qProd = docu...
true
a30607e16422a3fab64087b97656579971001666
JavaScript
BoringTorvalds/mirror-frontend
/app/reducers/stock.js
UTF-8
582
2.625
3
[ "MIT" ]
permissive
import { FETCH_STOCK_SUCCESS, FETCH_STOCK_REQUEST, FETCH_STOCK_SYMBOL } from './../constants/ActionTypes'; const initialState = { title: 'APPLE', symbol: 'AAPL', exchange: 'NASDAQ', data: null }; export function stock(state= initialState, action) { switch (action.type) { case FETCH_STOCK_SYMBOL: return {...
true
229086247f1923462c4399a16bf05599690f4c5e
JavaScript
mauriciomonla/cursos
/ComIT/NodeJS/Practicas/Proyecto/MauricioLunaReservaLaCancha/js/aplicacionCanchas.js
UTF-8
9,924
3.46875
3
[]
no_license
var AplicacionCanchas = function (listadoCanchas) { console.log("AplicacionCanchas"); console.log(listadoCanchas); this.listado = listadoCanchas; this.dibujarListado(listadoCanchas.canchas); this.dibujarFiltros(); this.registrarEventos(); }; //Esta función le asigna al botón "Buscar" la función filtrarcanc...
true
c872ec2450a9f206757ed544083ead6d9346bd74
JavaScript
MarielJHoepelman/jsdom-fetch-dog-ceo-challenge-v-000
/src/index.js
UTF-8
1,494
3.265625
3
[]
no_license
document.addEventListener('DOMContentLoaded', function() { console.log('%c HI', 'color: firebrick') function fetchUrl(url) { return fetch(url) .then(function(response) { return response.json(); }) .then(function(json){ return json }) } fetchUrl("https://dog.ceo/ap...
true
13c8c047adfa851785ca03506c67a8473d0ec36b
JavaScript
gentlepudding/javascript-task-3
/robbery.js
UTF-8
5,008
3.34375
3
[]
no_license
'use strict'; /** * Сделано задание на звездочку * Реализовано оба метода и tryLater */ exports.isStar = false; var days = 'ПН ВТ СР'.split(' '); function toMinutesUTC(time) { var hours = Number(time.slice(3, 5)); var minutes = Number(time.slice(6, 8)); var offset = getOffset(time); return hours ...
true
4ef5b87cc5de69bffdb1e2ae0d37a8c47f898758
JavaScript
gbozsik/phone-service_fontend
/src/lib/validationRules.js
UTF-8
1,586
2.984375
3
[]
no_license
import moment from 'moment' export const required = v => !!v || 'Szükséges mező.' export const min10char = v => { if (v === undefined) return !!v return v.length >= 10 || 'Legalább 10 karaktert kell tartalmazzon.' } export const isNumber = v => !isNaN(v) || 'Csak számokat tartalmazhat.' export const dateNotInF...
true
c8444273c0cbebca29d9912d99953f53f1cb2e01
JavaScript
knightjdr/gene-info
/extension/src/popup/settings/toggles.js
UTF-8
1,070
2.6875
3
[ "MIT" ]
permissive
import config from '../../config'; import storageGet from '../helpers/storage'; /* setTransitionDuration gets the parent node for a toggle and then ** changes the transition duration on the adjacent label so that ** it will only transition after loading */ export const setTransitionDuration = (el) => { const label =...
true
f32fb26a664329497509f6d298c7c9951a24adc1
JavaScript
nfoster1219/Functions_2
/JS_Katas/main.js
UTF-8
5,041
3.640625
4
[]
no_license
const mainElement = document.querySelector('main') const kata1 = document.createElement('h1') mainElement.append(kata1) kata1.append('Kata 1') let counter1 = 0 while (counter1 < 20) { counter1 += 1 mainElement.append(counter1 + ", ") } const kata2 = document.createElement('h1') mainElement.append(ka...
true
f69c965b99c1d818244854d150dd2edd77086b4d
JavaScript
malenavero/apiMovies
/controllers/userController.js
UTF-8
3,151
2.984375
3
[]
no_license
class userController { constructor(userService){ this.userService = userService }; //funcion para chequear si existe el di en la db async checkId(id) { try { await this.userService.checkUser(id); return true }catch(err){ return false ...
true
d7fd0afcfb33a6787a18e38cea19658ef2a7cb5b
JavaScript
jtong99/VSTAY-backend
/src/api/helpers/date.js
UTF-8
579
2.859375
3
[]
no_license
const { format, differenceInHours } = require("date-fns"); const ensureUnixTimestampInSeconds = (time) => { const formattedTime = time.toString().length !== 14 ? time * 1000 : time; return formattedTime; }; const formatTimeIn8601 = (time) => { // transform UNIX timestamp in seconds to milliseconds if (typeof...
true
4720a3270106dff85efa76f0e34f35acb72e365e
JavaScript
antoniopaolillo/antoniopaolillo.github.io
/trybe-exercises/9.1/data.js
UTF-8
295
3.53125
4
[]
no_license
const books = {name:'ok', name3: 'ok2', 3:'ok3'} function averageAge() { const numbersOfBooks = books.length; const averageAgeAuthors = books.reduce(( book) =>book.name - book.name3, 0) // return averageAgeAuthors / numbersOfBooks; console.log(averageAgeAuthors) } averageAge()
true
10aa4a8f646a67dc72c1de8999c6a694d9ae1328
JavaScript
kaizhou-College/apri-homework
/kz103-chuhuandong/jquery/jquery01/第2次课/kz9jquery01/WebRoot/prototype/prototype.js
GB18030
2,243
4.625
5
[]
no_license
/* *prototype:ԭ *1javaScriptjsû{} ֻк * ܽ᣺ںڲıߺ˽еֻںڲʹã *2jsľ̬Ժͷ * 1functionһһͬʱһ췽 * 2ֻ̬ͨзʣͨnewĶDzܷʵģ */ //1js //if(1<2){ // //ȫ // var a = 34;// //} //alert(a); //function student(){ // //˽ // var b = 56; // var getName= function(){ // alert("def"); // } //} //alert(this.b); //2,jsľ̬Ժͷ : //function Student(){/...
true
76ce21646f328437e2f003620681548d1ae06ef8
JavaScript
siwarmansouri/slackbot
/index.js
UTF-8
1,371
2.6875
3
[]
no_license
const SlackBot = require('slackbots'); const dotenv = require("dotenv"); dotenv.config(); const Slack_Bot_TOKEN = process.env.TOKEN; const Slack_Bot_NAME = process.env.NAME; const Slack_Bot_CHANNEL = process.env.CHANNEL; const bot = new SlackBot({ token: Slack_Bot_TOKEN, name: Slack_Bot_NAME, channel: Slack_Bot_...
true
4e4eaf909841e0514ac3bb089c655897264fab0e
JavaScript
Kadantte/PenguBot
/src/commands/Utilities/twstats.js
UTF-8
1,403
2.6875
3
[ "MIT" ]
permissive
const { Command, MessageEmbed, Timestamp, config: { apis } } = require("../../index"); const timestamp = new Timestamp("d MMMM YYYY"); module.exports = class extends Command { constructor(...args) { super(...args, { cooldown: 15, aliases: ["twitchstats", "twitchstatistics"], ...
true
0079aeb670a337981888f6be816b0a0cbc0f0b0a
JavaScript
longfei347/lf-test
/js/demo.js
UTF-8
18,024
2.953125
3
[]
no_license
//# sourceURL=ttt.js //# sourceURL=ttt.js // export var long ="long"; // export var fei = "fei"; /*var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }, { 'user': 'pebbles', 'age': 18 } ]; // 1. 获取所有用户名字,并以”,“分割 var names = _.chain(users) .map(function(user) { return user.user; }) .join(...
true
59b55fdb69d55d22ac6d57b3eab5ae433ddafdab
JavaScript
alexrpedersen/busmall
/app.js
UTF-8
6,633
3.140625
3
[]
no_license
'use strict'; var ctx = document.getElementById('voteChart').getContext('2d'); var totalVotes = 0; var listOfProducts = ['bag', 'banana', 'bathroom', 'boots', 'breakfast', 'bubblegum', 'chair', 'cthulhu', 'dog-duck', 'dragon', 'pen', 'pet-sweep', 'scissors', 'shark', 'sweep', 'tauntaun', 'unicorn', 'usb', 'water-can',...
true
e187a015165a6b4b891d9f5cab124b9a8c74f691
JavaScript
Cameriusm/guess-the-number
/app.js
UTF-8
2,860
3.296875
3
[]
no_license
let randomNumber = parseInt(Math.random() * 100 + 1); const submit = document.querySelector('#subt'); const userInput = document.querySelector('#guessField'); const guessSlot = document.querySelector('.guesses'); const remaining = document.querySelector('.lastResult'); const startOver = document.querySelector('.resultP...
true
616c325607026c5558b95cd0629e8a53dd5dcb54
JavaScript
vibertthio/vt-board
/routes/api.js
UTF-8
2,086
2.578125
3
[ "MIT" ]
permissive
const express = require('express'); const router = express.Router(); const lo = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis ...
true
36e9907aaef1943dd445a87f3f19e5d18d55bf7f
JavaScript
ZanoniCintia/CursoIngresoJS
/9-Parciales/2018_1Cuatri_Parcial_fuentes/nueve.js
UTF-8
1,474
3.46875
3
[]
no_license
function mostrar() { var marca; var peso; var temperatura; var contadorTempPar=0; var MarcaMaximo=0; var PesoMaximo=0; var PesoMinimo=0; var flag=false; var contadorTempBajoCero=0; var contador=0; var acumulador=0; var promedio; var respuesta="si"; while(respuesta=="si") { marca=prompt("ingrese un mar...
true
5994cc9089175cde295b5b08307d905e8121a4a9
JavaScript
kirschnerp/timedquiz
/questions.js
UTF-8
1,294
2.734375
3
[]
no_license
const questions = [ { question: "Commonly used data types DO NOT include:", choices: ["strings", "booleans", "alerts"], correct: "C" }, { question: "The condition in an if / else statement is enclosed within ____.", choices: ["quotes", "curly brackets", "parentheses"], c...
true
04fbbc1c43f2441c93b6bc59d06efafc597d1861
JavaScript
klerikdust/frankdiscord
/src/FranxKits/index.js
UTF-8
4,325
2.8125
3
[]
no_license
const { RichEmbed, Attachment } = require(`discord.js`) /** * Micro framework to support Frank's structure * Lightweight, portable and opinionated * @Pistachio */ module.exports = (Components) => { // Get main components to make the tool works let { bot, message } = Components // Initialize default con...
true
d3738399d18f1b139474423095b46d521054924f
JavaScript
zeekzeek/p5-projekts
/begin again/changeBackground/sketch_a.js
UTF-8
376
3.21875
3
[]
no_license
let button; function setup() { createCanvas(windowWidth, windowHeight); background(255,12); button = createButton('click me'); button.position (windowWidth/2,windowHeight/2); button.mousePressed(changeBG); } function draw() { } function changeBG() { let valR = random(255); let valG = random(255); le...
true
cc4aa1ea9dc183501afff1947f800ba250673b77
JavaScript
drewwmercer/Flashcard-Generator
/js/BasicCard.js
UTF-8
1,073
3
3
[]
no_license
var frontArray = []; var backArray = []; var fullBasicArray = []; function BasicCard(front, back) { if (this instanceof BasicCard) { this.front = front; this.back = back; this.push = () => { frontArray.push(this.front); backArray.push(this.back); } } els...
true
c905fe7e73200b20ba597c5f1cab9a40e55fce23
JavaScript
omoviso/wheel-of-fortune
/src/show-content.js
UTF-8
637
3.015625
3
[]
no_license
function showContent(index) { //Show contents of section pointed to on the wheel let contents = document.querySelector(".contents"); let title = document.querySelector(".title"); let images = document.querySelector(".images"); let back = document.querySelector(".back"); contents.classList.add("active"); t...
true
52dea545f3972a43f75eb7996294c0cfef28d28b
JavaScript
neilpat1995/Daily-Journal
/src/JournalEntry.js
UTF-8
4,068
2.6875
3
[]
no_license
import React, { useState, useEffect } from "react"; import { useParams } from "react-router-dom"; import { API } from "aws-amplify"; import { useHistory } from "react-router-dom"; import { useAppContext } from "./libs/contextLib"; import Form from "react-bootstrap/Form"; import Button from "react-bootstrap/Button"; imp...
true
d5a7b00dcbde5f0d86b53d15bb1d33321631e22f
JavaScript
moara-ops/crypto-city
/client/src/API/index.js
UTF-8
5,433
2.671875
3
[ "MIT" ]
permissive
import { formatUnits, parseEther, parseUnits } from "@ethersproject/units" import { pause } from "./../Utils/misc" import constants from "./../Utils/constants" let library, account, tokenContract, mainContract const POLLING_DELAY = 2000 const throwBlockChainError = (error) => { console.log("Transaction error:", er...
true
fc42511b9869c6c9351054d8f803bafe048b0d0e
JavaScript
yangxin1994/farvekonfigurator
/color-modular/color159.js
UTF-8
119
2.515625
3
[]
no_license
(function() { // Make the color #159 HTMLElement.prototype.color159 = function() { this.style.color = '#159' } })()
true
17570389b1904d9fa3f6ea8c63dfa1d635b4b78e
JavaScript
jtuppy/react-lifecycle-methods
/src/components-hooks/TimerView.js
UTF-8
1,135
2.890625
3
[]
no_license
import React, { useState, useEffect } from 'react'; function formatTime(seconds) { let mins = Math.floor(seconds / 60) .toString() .padStart(2, '0'); let secs = (seconds % 60).toString().padStart(2, '0'); return `${mins}:${secs}`; } function TimerView(props) { const [seconds, setSeconds] = useState(0)...
true
e7c83b2748d3584c96721c78449276a79c68190c
JavaScript
baoziwei/ts-note
/src/4_装饰器.js
UTF-8
7,752
3.015625
3
[]
no_license
"use strict"; // ### 装饰器(东西挺多) var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b)...
true
90bbb4102ab8396078cacfd46b3e233762fc1868
JavaScript
Obelixx/TelerikAcademy
/JavaScript/JavaScript-Fundamentals/8.Array_Methods/Array_Methods/5.Youngest_person.js
UTF-8
2,270
3.46875
3
[]
no_license
var output = '', pplArr = []; //polyfill array.find if (!Array.prototype.find) { Array.prototype.find = function (callback, thisArg) { "use strict"; var arr = this, arrLen = arr.length, i; for (i = 0; i < arrLen; i += 1) { if (callback.call(thisArg, arr[...
true
19327570cb9bcb4cfe2b5f2bd9483c268566fa93
JavaScript
waleedo91/weatherapp
/src/app.js
UTF-8
3,100
2.734375
3
[]
no_license
const path = require('path'); const express = require('express'); const hbs = require('hbs'); const geocode = require('./utils/geocode'); const forecast = require('./utils/forecast'); // initilizes the application // const app = express(); const port = process.env.PORT || 3000; // Define paths for Express config cons...
true
4ab6850171cd2b684557e468c06a162ce6c9bfb7
JavaScript
kamikamiman/auto_switch_all
/lunchSendMail.gs
UTF-8
2,947
2.796875
3
[]
no_license
/* ========================================================================= / / === 昼当番の担当者に通知メールを送信 [ 関数 ] === / / ======================================================================== */ function LunchSendMail() { // スプレットシートの情報を取得 const ssSheetAdress = SpreadsheetApp.op...
true
036b4f750707435fc4dbcbcc124c8ef05c37ceda
JavaScript
XyParaCrim/toy-widget
/src/global-features/commander/index.js
UTF-8
1,695
2.640625
3
[ "MIT" ]
permissive
import {$fn} from "../../util"; import CommandStack from "./command-stack"; export default function commanderFeature(size) { const mixin = {} mixin.executed = $fn.optionalHook mixin.undone = $fn.optionalHook mixin.redone = $fn.optionalHook mixin.onDirty = $fn.optionalHook mixin.errorCapturedOfCommand ...
true
87707c38543444383a5b59397a82f348b3cec08b
JavaScript
darrownet/react-redux-boilerplate
/src/core/reducers/reducer.js
UTF-8
819
2.78125
3
[ "MIT" ]
permissive
import * as types from '../actions/action-types'; import { generateUniqueId } from '../services/generate-unique-id'; let initialState = { todos: [] }; const itemAdded = (todos, item) => { let newTodos = [...todos]; item.id = generateUniqueId.generate(todos.length); newTodos.push(item); return newTodos; }; ...
true
e7cf90b6a3988c031613d315befa81622d2d0d3c
JavaScript
mateusdeve/TrainingCursos
/assets/js/script.js
UTF-8
6,135
2.515625
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
$(function(){ paginar( 0, true ); }); function goToPage( element ) { paginar( element.innerHTML - 1 ); } function paginar( pagina, onload = false ) { const path = window.location.href; // var array_path = path.split( '/' ); array_path.pop(); var array_base_path = Object.assign( [],...
true
04c92a9ec2467acbd3dba0e32061ae04df39c5dd
JavaScript
devonChurch/corn-chips
/__tests__/enrich-test.js
UTF-8
1,418
3.046875
3
[ "MIT" ]
permissive
'use strict'; // babel-jest const { enrichWords } = require('../src/'); describe('random enrich', () => { const text = 'This is some dummy text to enrich'; const keyWords = ['apple', 'banana', 'orange', 'potato']; it('enrich a string of words with a random set of supplied key words from an array', () => { co...
true
021e621afb8cd9e376a23b740f5c4d1595befc0d
JavaScript
MMcClure11/fewpjs-oo-static-methods-lab-onl01-seng-pt-030220
/index.js
UTF-8
797
3.609375
4
[ "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference" ]
permissive
class Formatter { //add static methods here static capitalize(string) { return string.charAt(0).toUpperCase() + string.slice(1); } static sanitize(string){ return string.replace(/[^A-Za-z0-9- ']+/g, ''); } static titleize(string){ let lowerCasedWords = ['the', 'a', 'an', 'but', 'of', 'and', 'f...
true
8ba4eda9747e8d43228a5f49aab9538075e55141
JavaScript
floticerus/uns
/src/fn.js
UTF-8
961
2.828125
3
[ "MIT" ]
permissive
exports.isObject = item => { return (item && typeof item === 'object' && !Array.isArray(item)); } // originally from this stackoverflow link, and modified: // https://stackoverflow.com/questions/27936772/how-to-deep-merge-instead-of-shallow-merge?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_...
true
32c9ac255b4fbb4507b9a05f1874f1a629aada8e
JavaScript
Dufuna-CodeCamp/Dufuna-Fem
/submissions/saidatAtanda/javaScript/productList.js
UTF-8
592
2.90625
3
[]
no_license
let productList = [ { productName: "The Summer I Turned Pretty", imageUrl: "../html/images/book-3.JPG", productPrice: "$40" }, { productName: "To All The Boys I've Loved Before", imageUrl: "../html/images/book-4.JPG", productPrice: "$35" }, { p...
true
3751865cfb049f18dc530b4480c5e4942fac0195
JavaScript
juan2ramos/mi-martinez
/js/script.js
UTF-8
1,005
2.5625
3
[]
no_license
var i = 0; $(function () { $('nav li').on('click',function(){ var id = $(this).data('id'); if($('#'+id).hasClass('show-section')){ $('section').removeClass('show-section'); }else{ $('section').removeClass('show-section'); $('#'+id).addClass('show-section'...
true
4f3601600a3d4453175f39257f7f3315b84a40a1
JavaScript
UncleBenjen/TOTrends
/src/utils.js
UTF-8
975
3.03125
3
[ "MIT" ]
permissive
function isEmpty (data) { if(data === undefined || !Object.keys(data).length ){ return true } return false } function timeSincePosted(originalTimeStamp){ var d = new Date(originalTimeStamp*1000); return timeSince(d) + ' ago' } function timeSince(date) { var seconds = Math.floor((new Date() - date) / 1000...
true
8edf84bd60f899ea5b8baec6ea5445b6d6594677
JavaScript
Tera99/Issues-Tracking-Database
/solarApp.js
UTF-8
11,232
2.515625
3
[]
no_license
//~~~~~~~~~~~~~~~ //Terezie Schaller //CS340 - Intro to databases //Spring 2017 //Node application for final project //~~~~~~~~~~~~~~~~~ //express and mysql var express = require('express'); var mysql = require('./tschal.js'); //set up app and handlebars var app = express(); var handlebars = require('express-handlebar...
true
ebca610d852382256c8818b0f16d9ed47fc4ae8c
JavaScript
pyhurst/digiClock
/sandbox.js
UTF-8
2,170
3.609375
4
[]
no_license
const milClock = document.querySelector('.milClock'); const clock = document.querySelector('.clock'); const greeting = document.querySelector('.greeting'); const start = new Date('Janurary 15 2020 7:30:59'); const today = new Date(); const diff = today.getTime() - start.getTime(); const daysJS = Math.round(diff /...
true
d17e8cd9683311df32f69d9cd2b238e7975c330b
JavaScript
melissaportfolio/melissaportfolio.github.io
/HuckleberryWeather/js/fishhavenforecastapi.js
UTF-8
1,222
3.3125
3
[]
no_license
const apiURL2 = "https://api.openweathermap.org/data/2.5/forecast?lat=42.0372&lon=111.3960&units=imperial&APPID=8edd374362f96360d97da10d2909e8b7"; var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; fetch(apiURL2) .then((response) => response.json()) .then((jsObject) => { ...
true
ceb0580ade3da84cfc5223819ce6c8c2e95e320d
JavaScript
VSAlmeida/ibmcloud-users-permissions
/src/helpers/wsHeader.js
UTF-8
672
2.921875
3
[ "MIT" ]
permissive
// Funcao responsavel por criar o header nos Worksheets const wsHeader = (wb, ws) => { // Cria os estios do header const style = wb.createStyle({ fill: { type: "pattern", patternType: "solid", bgColor: "#222B35", fgColor: "#222B35", }, alignment: { vertical: "center", }...
true
9dddd853606d9b4141975ac48851062bfdc0a2e0
JavaScript
ivan4otopa/SoftUni
/JavaScriptBasics/exams/13May2015/kitodarTheMiner.js
UTF-8
507
3.140625
3
[]
no_license
function kitodarTheMiner(input) { var regex = /mine\s+.*\s*-\s+(gold|silver|diamonds):\s+(\d+)/; var oresQuantities = { 'silver': 0, 'gold': 0, 'diamonds': 0 }; for(var line in input) { var match = input[line].match(regex); if (match != null) { var ore = match[1].trim(); var quantity = parseInt(match[2]...
true
e8dde2fec981f67927408f19a24a58750a104c02
JavaScript
choiwa/algorithms
/endStringSame.js
UTF-8
290
3.078125
3
[]
no_license
function confirmEnding(str, target) { // "Never give up and good luck will find you." // -- Falcor const startIndex = str.length - target.length; const endIndex = startIndex + target.length; return str.substring(startIndex, endIndex) === target; } confirmEnding('Bastian', 'n');
true
16f3a3c67580326d37071fd5e79b96d9acd63ba7
JavaScript
igualadins/musicalitza
/js/friends.js
WINDOWS-1250
13,197
2.765625
3
[]
no_license
/* * Funcio on bloquejem els amics que tenim acceptats * OK */ function bloquejarAcceptat(userId,friendId,imatge,nom){ var formData = new FormData(); formData.append('userId', userId); formData.append('friendId', friendId); formData.append('blocked', 1); formData.append('action', '...
true
488e3f0c81efec8fecad8b966ebc88bc03a1fd57
JavaScript
ivanoung/icq98
/public/script/script.js
UTF-8
1,074
2.546875
3
[ "MIT" ]
permissive
function Sound(src) { this.sound = document.createElement("audio"); this.sound.src = src; this.sound.setAttribute("preload", "auto"); this.sound.setAttribute("controls", "none"); this.sound.style.display = "none"; document.body.appendChild(this.sound); this.play = function () { this.sound.play...
true
aca24691da04bab6eb2080673fcccef3a4cb11b9
JavaScript
luisgoyburo/advance_react_techniques
/src/FacebookColorThief.js
UTF-8
556
2.59375
3
[]
no_license
import React from "react"; const blue = "rgb(139, 157, 195)"; const darkBlue = "rgb(059, 089, 152)"; const lightBlue = "rgb(223, 227, 238)"; const grey = "rgb(247, 247, 247)"; const white = "rgb(255, 255, 255)"; const styles = { blue: blue, darkBlue: darkBlue, lightBlue: lightBlue, grey: grey, white: white,...
true
e33f645d6c525023cca089470171360637694c6d
JavaScript
Mikheltodd/credit-card-checker
/main.js
UTF-8
6,894
3.53125
4
[]
no_license
/** * Credit Card Checker * 15th of may, 2021 * by Mikheltodd * * This is a project proposed by Codecademy for JavaScript practice. * It requires to create some functions for evaluating credit cards numbers using the Luhn's Algorithm. * Some data are given to test the functions. * Testing of functions appear as...
true
71d300ee7ce6919145bc88509d9df3c81cef18fc
JavaScript
tutkuince/ModernJavascriptTutorial
/WebContent/js/app040.js
UTF-8
1,446
4.15625
4
[]
no_license
// function Person(name, age){ // this.name = name; // this.age = age; // } // Person.prototype.showInfos = function () { // console.log(`Name: ${this.name}, Age: ${this.age}`); // } // // // const person = new Person("Tutku", 30); // // console.log(person); // // function Employee(name, age, salary) { // ...
true
5e510973fb23c65371779ec0a8f09eba3924ceee
JavaScript
zkhomer/JS_Homework_1-Bespaly-A.A.
/05/main.js
UTF-8
175
2.578125
3
[]
no_license
var age = 24 if((age>=20) && (age<=27)) { console.warn("Выслать повестку")} else{ console.warn("не высылать повестку") } /* asd*/
true
8100602285e37ac4ab4424e22063fbf2b8ae67f9
JavaScript
fengmingke/PWATest
/demo/Notification.js
UTF-8
14,786
3.40625
3
[ "MIT" ]
permissive
//通常你应在你的应用首次初始化的时候请求显示通知的权限: //注:Chrome 不允许你在 load 事件处理中调用 window.addEventListener('load', function () { Notification.requestPermission(function (status) { // 这将使我们能在 Chrome/Safari 中使用 Notification.permission if (Notification.permission !== status) { Notification.permission = status; } }); }); ...
true
2fc82220b7bc1c9b6f2f4a6b29d0a1c83fcdcaa3
JavaScript
zespoloweprogramowanie/co-zjesc-frontend
/src/pages/MyFavoritesPage/MyFavoritesPage.jsx
UTF-8
1,335
2.734375
3
[]
no_license
/** * @module pages/MyFavoritesPage */ import React, { Component } from 'react'; import RecipeListing from '../../components/RecipeListing/RecipeListing'; import Spinner from '../../components/Spinner/Spinner'; import CoZjescService from '../../services/co-zjesc-service'; import SuggesterSection from '../../componen...
true
4d370a8cac0cbc5449d21de4327b835fac09e361
JavaScript
CharlyMannion/be-nc-news-tutor
/errors.js
UTF-8
898
2.625
3
[]
no_license
// error handling middleware functions (EHMF): exports.handleCustomErrors = (err, req, res, next) => { if (err.status) res.status(err.status).send({ msg: err.msg }); else next(err); }; exports.handle400s = (err, req, res, next) => { const codes = ["23502", "23505", "22P02", "42703"]; if (codes.includes(err.co...
true
ed071da6f0b64076f751ddbb715fab94746526f8
JavaScript
afiatamanna06/LoginSignup-Javascript
/index.js
UTF-8
1,269
2.546875
3
[]
no_license
// Your web app's Firebase configuration var firebaseConfig = { apiKey: "AIzaSyC2ec7KFkjgMQSlMp467GxS7VfAr3vbSNA", authDomain: "form-d47d9.firebaseapp.com", databaseURL: "https://form-d47d9.firebaseio.com", projectId: "form-d47d9", storageBucket: "form-d47d9.appspot.com", messagingSenderId: "123...
true
a2418d598bd67c148d4566fe3656f63caae0330b
JavaScript
Sankin1995/yuewang
/Public/Home/js/internetBarIntroduction.js
UTF-8
1,443
2.75
3
[]
no_license
/*获取节点变量*/ $carousel = $('.carousel'); /*动态设置main 中间内容的定位top的值*/ setTimeout(function () { $("main").css("top", $("header").height() + "px"); },200); /*carousel 旋转木马 轮播图动画效果*/ var startX, startY, moveEndX, moveEndY, X, Y; $carousel.on("touchstart", function (e) { e.preventDefault(); startX = event.touche...
true
865b10b41d6892e1477a5443d43ad8ea3ffcbd73
JavaScript
PrincipleZ/Photo_album
/js/fixIframe.js
UTF-8
797
2.546875
3
[]
no_license
$(document).getElementById("content-frame").onload = function(){ var temp = document.getElementById("content-frame").contentWindow.location.href; var httpIndex = temp.indexOf(".com") if (temp.includes("?redirected=True")){ console.log("here"); temp = temp.slice(0, temp....
true
7f74ac956106035994400ff59ccb307bf2cb1d7d
JavaScript
SergeyKirintsev/JavaScript-Total
/assets/patterns/js/creational/factory/script.js
UTF-8
2,975
3.859375
4
[ "MIT" ]
permissive
// фабрика function Car({ doors, state, color }) { this.doors = doors || 4 this.state = state || 'новый' this.color = color || 'серебряный' } function Truck({ state, wheelSize, color }) { this.state = state || 'подержанный' this.wheelSize = wheelSize || 'большой' this.color = color || 'синий' } function V...
true
198e01cad26ad6cbd806e14761efd3128102238d
JavaScript
mrombout/BattleShips
/assets/js/game/util/sprintf.js
UTF-8
461
3.203125
3
[]
no_license
"use strict"; define(function() { /** * Formats a string with the given data by replacing any {keywords} with * the corresponding value in the given data. * * NOTE: A {keyword} will only be replaced once */ return function(str, data) { for(var key in data) { if(data...
true
fa1b0c00dea92692df8b85eac26417156eb5f669
JavaScript
cjroebuck/spreedly-node
/lib/spreedly/spreedly-response.js
UTF-8
3,477
2.53125
3
[ "Apache-2.0" ]
permissive
var util = require("util"); function SpreedlyResponse() { } SpreedlyResponse.prototype.$unpad = function( value ) { if ( (value+"").indexOf("0") == 0 ) { return parseInt( (value+"").substr(1,1) ); } return parseInt(value+""); }; SpreedlyResponse.prototype.$get_datetime_value = function( value ) { value = value...
true
6bb99a0ba0b1c73b745f10a2bb2d5f3ad489495b
JavaScript
Zaytt/freecodecamp-projects
/ResponsiveWebDesign/portfolio-page/js/index.js
UTF-8
373
2.625
3
[ "MIT" ]
permissive
$("#welcome-link").click(function() { var offset = -100; //Offset of 20px $('html, body').animate({ scrollTop: $("#welcome-section").offset().top + offset }, 1500); }); $("#projects-link").click(function() { var offset = 100; //Offset of 20px $('html, body').animate({ scrollTop: $...
true
9a28d9833ffd991898e7cddc6a3f4a11407cac79
JavaScript
Drumzey/ArcadeSidekick_Temp
/Sidekick - VS - TEST/Sidekick - VS - TEST/www/js/ui/games/top50/top50.js
UTF-8
708
2.765625
3
[ "MIT" ]
permissive
var top50ArcadeRatings = []; var top50PinballRatings = []; var bottom50ArcadeRatings = []; var bottom50PinballRatings = []; // Function that is called from the main menu to access the Top 50 function ArcadeTop50() { SideKickOnline_GetTopFifty(); } function ArcadeBottom50() { SideKickOnline_GetBottomFifty(); }...
true
6433099ce984f10646b9907206a7f14265e7ec53
JavaScript
ChrisChenSZ/chris-koa
/koa10_原生router.js
UTF-8
1,927
2.90625
3
[]
no_license
// const Koa = require('koa'); // const fs = require('fs'); // const app = new Koa(); // // function render(page){ // return new Promise((resolve,reject)=>{ // let pageUrl = `./page/${page}`; // fs.readFile(pageUrl,"binary",(err,data)=>{ // console.log(444); // if(err){ // ...
true
b8633a766784d6356f51bd4ff671166daa2a8505
JavaScript
gonzavz/restful-api-mongo
/test/users.js
UTF-8
1,823
2.609375
3
[]
no_license
const request = require('supertest'); const server = require('../server'); const User = require('../src/models/User'); const logger = require('../src/utils/logger'); const validUser = { name: 'Valid User', avatar: 'http://someurl.com/image.png', }; const invalidAvatar = { name: 'pepe', avatar: 'httpp://not_an...
true
4457b0d9adef1d1d6865e70272c97a8e37f4fbc1
JavaScript
sumasubbu/react-tutorial
/src/App.js
UTF-8
708
2.640625
3
[]
no_license
import React , { Component } from 'react' import Table from './table' class App extends Component { state = { characters: [ { Book: 'India Unbound', Author: 'Gurcharan Das', }, { Book: 'Art of War', Author: 'Sun Tzu', }, ], } render() { const { ch...
true
98e9b1c6b3b51e267523adf1d872c2c3344c4446
JavaScript
seoushi/HTML-5-Canvas-Pong
/introState.js
UTF-8
1,851
3.28125
3
[]
no_license
// Author: Sean Chapel // Date: 10/10/10 // Description: The paddle object function IntroState() { this.time = new Date().getTime(); this.states = { DrawNormal: 0, FadeOut: 1, DrawNothing: 2, FadeIn: 3, Done: 4}; this.stateLengths = [500, 1500, 750, 1500]; // in mi...
true
f881b3223eb0d0606cbd99a83176123bf825b8b3
JavaScript
Paaske7/57ChallengesForBeginnersTypeScript
/Opgave 1/Index.js
UTF-8
204
3.359375
3
[]
no_license
"use strict"; function sayingHello() { var inputNameElem = document.getElementById("inputName"); var name = inputNameElem.value; document.getElementById("outputName").innerText = "" + name; }
true
6d7dad8bf190ca5e456e0e93da03495f9276c4fb
JavaScript
horacn/test_es6
/lodash/string.js
UTF-8
6,414
3.484375
3
[ "MIT" ]
permissive
var _ = require('lodash'); // ------> camelCase // 转换字符串为 驼峰写法。 console.log('---------------------------camelCase------------------------------'); var r = _.camelCase('Foo Bar'); // => 'fooBar' console.log(r); r = _.camelCase('--foo-bar--'); // => 'fooBar' console.log(r); r = _.camelCase('__FOO_BAR__'); // => 'fooB...
true
32f735b8795d2bf72df3cb2b7769227db5e08180
JavaScript
ArtistDiagrams/AnimatedDiagrams
/Michelle/MiddleCircle.js
UTF-8
10,472
2.59375
3
[]
no_license
function drawMiddleCircle(ctx) { // outerRing/Group ctx.save(); // outerRing/Group/Compound Shape ctx.save(); // outerRing/Group/Compound Shape/Compound Path ctx.beginPath(); // outerRing/Group/Compound Shape/Compound Path/Path ctx.moveTo(1293.5, 520.1); ctx.bezierCurveTo(1259.6...
true
e8f772d8c024d5a3dbec2e65b43614f48a1e52c4
JavaScript
SHISME/LeetCode
/src/45/index.js
UTF-8
1,879
3.640625
4
[]
no_license
/* * @lc app=leetcode id=45 lang=javascript * * [45] Jump Game II * * https://leetcode.com/problems/jump-game-ii/description/ * * algorithms * Hard (27.21%) * Total Accepted: 152.2K * Total Submissions: 557.5K * Testcase Example: '[2,3,1,1,4]' * * Given an array of non-negative integers, you are initia...
true
35215611767da76713bbc3b4a3aa26e7349875be
JavaScript
dimz13/bamazon
/bamazonCustomer.js
UTF-8
3,100
2.9375
3
[]
no_license
var mysql = require("mysql"); var Table = require('cli-table'); var inquirer = require("inquirer"); var connection = mysql.createConnection({ host: "localhost", // Your port; if not 3306 port: 3306, // Your username user: "root", // Your password password: "password", database: "bamazonDB" }); conn...
true
421a0ff9d28ad2249054b08d0faf8aa053fc3c75
JavaScript
slavasemeniuk/lectorium_hw_3
/controllers/itemsController.js
UTF-8
1,006
2.65625
3
[]
no_license
const fs = require('fs').promises const uuidv1 = require('uuid/v1'); module.exports.create = (req, res, next) => { let item = req.body item.identifier = uuidv1().toString() fs.writeFile(`./storage/${item.identifier}`, JSON.stringify(item)) .then((data) => { res.status(200).send(item) }).catch(next)...
true
d84fcd04c7e1a2eb892b6fa15cbb5df87c73e3d1
JavaScript
VitaliiRadaiev/LuriiDynys
/#src/js/#card-blog.js
UTF-8
501
3.078125
3
[]
no_license
{ let card = document.querySelectorAll('.card-blog'); if(card.length>0) { card.forEach( function(elem, index) { let textBlock = elem.querySelector('.card-blog__text'); let span = textBlock.querySelector('span') if(span) { span.remove(); } let text = textBlock.innerText; if(text.length > 4...
true
e2808790d6148d6a317c9aef0d5b93cb714fd71d
JavaScript
Samwakelam/GYM-SHARK-SLW
/src/context/GenderContext.js
UTF-8
588
2.734375
3
[ "MIT" ]
permissive
// packages import React, { useState, createContext } from 'react'; // Create Context const GenderContext = createContext(); const GenderContextProvider = ({children}) => { const [ gender, setGender ] = useState('male'); const genderMale = () => { setGender('male'); } const genderFemale = () => { ...
true