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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6143741124bf8628014c90ca341b500f0325e6be | JavaScript | phamcongsonit/auto-twitter | /pcs.js | UTF-8 | 2,233 | 2.515625 | 3 | [] | no_license | // Author: Pham Cong Son - Email: phamcongsonit@gmail.com
$(function() {
console.log("Tác giả: Phạm Công Sơn - phamcongsonit@gmail.com");
setTimeout(function() {
var pcs = 0;
var time = ((Math.random()) + 1) * 500;
var button = '<button type="button" class="btn small pcs-button pcs-follow-active">Auto Follow</b... | true |
e0a62969575bab158ab2dde4fdbc5ece08993c27 | JavaScript | TsOleh/js-homework | /home-2/TaskColor/color.js | UTF-8 | 611 | 2.90625 | 3 | [] | no_license | //var task1 = document.getElementsByTagName('span');
//task1[0].className = 'orange';
//var task2 = document.body.children[0].children[0].children[1];
//task2.className = 'blue';
//var task3 = document.body.firstChild.firstChild;
//var task3_1 = document.body.children[0].children[5];
//task3.style.color = 'red';
//t... | true |
4b6c0e12409112ab95282ee727fde5a23279346c | JavaScript | Poligera/1st-portfolio-project-journalling-app | /__tests__/helpers.spec.js | UTF-8 | 1,027 | 2.59375 | 3 | [] | no_license | const helpers = require("../client/assets/helpers")
const data = [{
"id": 1,
"message": "I want to be famous",
"reactions": {"smile": 4, "celebrate": 1, "love": 3},
"comments": ["this is my post", "I liked it"]
},]
const dataTwo = [{
"id": 1,
"message": "I want to be famous",
"reactions": {... | true |
1eba38a72aa33e464d3707fe99f8c8bc9c823f54 | JavaScript | cxnld/bdo-tracker | /api/app.js | UTF-8 | 9,590 | 2.515625 | 3 | [] | no_license | const express = require('express');
const app = express();
//const mongoose = require('./db/mongoose');
const mongoose = require('mongoose');
mongoose.Promise = global.Promise;
mongoose.connect('mongodb://localhost:27017/GatheringTracker', { useNewUrlParser: true, useUnifiedTopology: true }).then(() => {
consol... | true |
4757b6c16a290e04d321dacb90196a27308c23d0 | JavaScript | maromo71/react-biblio | /src/pages/Livros/create.js | UTF-8 | 3,410 | 2.59375 | 3 | [] | no_license | import React, { Component } from 'react';
import firebase from '../../firebaseConn';
import Swal from 'sweetalert2';
import { Button } from 'react-bootstrap';
class CreateBook extends Component {
constructor(props) {
super();
this.state = {
tituloInput: '',
autorInput: '',
... | true |
9fa6b12c5a8f71e0ff3ee063a556c1f244488e14 | JavaScript | jedsada-gh/React-Three.js | /src/component/Showroomlogo.js | UTF-8 | 1,248 | 2.5625 | 3 | [] | no_license | import * as THREE from "three";
import { LinearFilter, NearestFilter } from "three";
const renderer = new THREE.WebGLRenderer({ antialias: true });
const circle = new THREE.BoxGeometry(1, 1, 1);
circle.scale(0.192, 0.192, 0);
const image = new THREE.TextureLoader().load(
"https://i.imgur.com/gIjX5R4.png",
image =... | true |
72d88d545dc650d5081ef59189be80a16d62a4c5 | JavaScript | jaikumarkaushil/React-Restaurant-Application---Prarukh | /src/components/ContactComponent.js | UTF-8 | 8,747 | 2.59375 | 3 | [] | no_license | import React, { Component } from 'react';
import { Row, Label, Col} from 'reactstrap'; // form feedbackback will validate our form.
import { Control, Form, Errors } from 'react-redux-form';
const required = (val) => val && val.length;
const maxLength = (len) => (val) => !(val) || (val.length <= len);
const minLength =... | true |
4e9e87366d14717591a8154201d0840d2044770f | JavaScript | green-fox-academy/sepgab | /Week-08/day-04/mapapi.js | UTF-8 | 936 | 3.03125 | 3 | [] | no_license | 'use strict';
let button = document.querySelector('button');
let city = document.querySelector('input');
let answer = document.querySelector('div');
let map = document.querySelector('iframe')
let resp = {};
let getLocation = function() {
let xhr = new XMLHttpRequest();
let url = 'https://devru-latitude-longitude... | true |
ff27d07638862ebcf9d5c390cb968a1d7de08f6f | JavaScript | htjahyon/m3-0321-code-solutions | /react-validated-input-component/src/validated-input.jsx | UTF-8 | 1,457 | 2.890625 | 3 | [] | no_license | import React from 'react';
class ValidatedInput extends React.Component {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
this.state = {
password: '',
filled: false,
longEnough: false
};
}
handleChange(event) {
const length = event.targe... | true |
7ae18f5cc7970f93ef56170e50c28de211058915 | JavaScript | om-mani-padme-hum/ezhtml | /ezelement.js | UTF-8 | 1,289 | 2.6875 | 3 | [
"MIT"
] | permissive | /** Require external modules */
const ezobjects = require('ezobjects');
/**
* @signature ezhtml.createClass
* @added v1.0.0
* @description Helper method for implementing new HTML elements in EZ HTML using a shorthand
* configuration object.
*/
module.exports.createClass = function (config) {
/** Create the cl... | true |
32bd7fcfe1decb8a9dd96036466208de15acd62f | JavaScript | rahul4times/ejspractice | /server.js | UTF-8 | 1,335 | 2.703125 | 3 | [] | no_license | var express = require('express');
var fs = require('fs');
var bodyParser = require('body-parser');
var app = express();
var port = process.env.PORT || 8000;
app.use(bodyParser.urlencoded({ extended: true }));
app.set('view engine', 'ejs');
app.get('/', function(req, res){
let obj = {
name: "Rahul",
email: "... | true |
6cd7046bc2f81ae684719bcb90ac43dd7a8b7156 | JavaScript | collabo-br/camunda-modeler | /client/lib/util/browser.js | UTF-8 | 1,147 | 2.6875 | 3 | [
"MIT",
"LicenseRef-scancode-bpmn-io"
] | permissive | 'use strict';
var Ids = require('ids');
var ipcRenderer = window.require('electron').ipcRenderer;
var ids = new Ids();
/**
* Communicate with the Browser process.
* Make sure that the callback is always called, even when there's an error.
*
* @param {Event} event
* @param {Object|Array<Object>} args
* @param ... | true |
5e9de247607d9c4684ce1defb891838303c976a8 | JavaScript | hikuley/nodejs-react-docker-compose | /ui/src/redux/home/Reducer.js | UTF-8 | 1,095 | 2.6875 | 3 | [] | no_license | import {GET_LIST_REQUEST, GET_LIST_SUCCESS, GET_LIST_FAILURE} from "./Actions";
const initialState = {
movieList: null,
fetchDataCompleted: false,
hasError: false,
loadingShow: false,
message: null
};
export default function (state = initialState, action) {
let {payload} = action;
if (ac... | true |
0b64a3ace4d5930136211cfc39b562d9bb0e7bf3 | JavaScript | mrlvsb/kelvin | /frontend/src/utils.js | UTF-8 | 1,102 | 2.515625 | 3 | [
"MIT"
] | permissive | import {writable} from 'svelte/store'
export function clickOutside(node) {
const handleClick = event => {
if (node && !node.contains(event.target) && !event.defaultPrevented) {
node.dispatchEvent(
new CustomEvent('click_outside', node)
)
}
}
document.addEventListener('click', handleC... | true |
05619e593d9f00e5fc1e4bbd87dd5ad9aa24742c | JavaScript | exacs/liqen-client-js | /examples/collectionExample.js | UTF-8 | 1,271 | 3.34375 | 3 | [
"MIT"
] | permissive | /**
* Collection Example
*
* In this example we are going to perform several requests to the server.
* 1. We will retrieve a list of articles (a summary of them)
* 2. We will retrieve the information of each Article (the full article object)
*/
import core, { APIError } from '../src/index'
const client = core()
... | true |
3ef7e8acbdbfb0b49d9905513a87d742fec58e38 | JavaScript | irawinder/InfoDes | /C2_Clock_p5/sketch.js | UTF-8 | 2,668 | 3.046875 | 3 | [] | no_license |
function setup() {
createCanvas(800, 800);
}
var col = "#999999";
var hLength = 0.7;
var mLength = 0.9;
var sLength = 0.95;
function draw() {
var h = hour();
var m = minute();
var s = second();
var handScaler = 250;
var thetaH = map(h%12 + m/60.0, 0, 12, 0, TAU);
var thetaM = map(m + s/60.0, 0, 6... | true |
aa237f1b2716f107940c84c2a3b6fa088767d502 | JavaScript | mel1015/mobile-web | /models/User.js | UTF-8 | 3,578 | 2.515625 | 3 | [] | no_license | var mongoose = require("mongoose");
var bcrypt = require("bcrypt-nodejs");
// schema
var userSchema = mongoose.Schema({
userid: {
type: String,
required: [true, "아이디는 필수사항입니다!"],
match: [/^.{4,12}$/, "4~12자 이내여야 합니다."],
trim: true,
unique: true
},
password: {
... | true |
9a9b0bc4d2c9df5b9f4e134d9c34c800951716b2 | JavaScript | yannick9letallec/encombrants | /node/legal.js | UTF-8 | 3,118 | 2.546875 | 3 | [] | no_license | const fs = require( "fs" )
const exec = require('child_process').exec;
const util = require( "util" )
const { URL } = require( "url" )
const cheerio = require('cheerio');
/*
* ALGO SUMMARY
* 1 - prepare wget command
* 2 - execute it
* 3 - extract link from google results | TO IMPROVE !
* 4 - execute wget to get ... | true |
b8a35635971410248c76c838c0665e6a7a5d273d | JavaScript | DMcCulloch-Coder/cypher-text | /bin/www | UTF-8 | 3,590 | 2.578125 | 3 | [] | permissive | #!/usr/bin/env node
/**
* Module dependencies.
*/
const app = require("../app");
const debug = require("debug")("cypher-text:server");
const http = require("http");
const db = require("../models");
const server = http.createServer(app);
const io = require("socket.io")(server);
/**
* Create HTTP server.
*/
funct... | true |
2d296f129c25366300da9d51b81cb86e7dd926ae | JavaScript | sa-met/revoltbot | /util/commands.js | UTF-8 | 290 | 2.578125 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
const commands = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
this.commands = []
for (const file of commands) {
console.log(`commands load ${file}`);
const command = require(`../commands/${file}`);
this.commands.push(command)
};
| true |
6b15e2a2c1c969d07c55ff2cf48ef546e340f29b | JavaScript | moonsung-ho/entryinfo | /js.js | UTF-8 | 250 | 2.703125 | 3 | [] | no_license | const name = prompt("사용자이름을 입력하세요")
fetch(`https://playentry.org/api/getUserByUsername/${name}`)
.then(res => res.json())
.then(o => {
message = o.description.split(/[-:T]/)
alert(`상태메시지는 "${message}" 입니다.`)
}) | true |
9c043695a2e4ce7337dcc610c7713b7e7c142fa9 | JavaScript | moisessbr/frontend-juni | /script.js | UTF-8 | 5,039 | 2.953125 | 3 | [] | no_license | // Função para o click do botão
function handleButton() {
function setBack() {
footerButton.setAttribute('style', 'width: 100%; margin-top: 15px; font-size: 12px; padding: 10px; color: #fff; background: #000; border: 1px solid #000; cursor: pointer; text-transform: uppercase; font-weight: bold; transition: al... | true |
bffb20bf08bd0b9657224e588a258b5f2f4e5a7f | JavaScript | nss-day-cohort-43/automated-world-don-t-break-the-code | /scripts/russia/leaderDataProvider.js | UTF-8 | 892 | 3.171875 | 3 | [] | no_license | const leaderCollection = [
{
name: "Vladimir Putin",
image: "vladimirPutin.jpg",
},
]
export const leaderCityData = () => {
return leaderCollection.slice();
}
export const leaderList = () => {
const contentElement = document.querySelector(".leaderList")
const leaders = leaderCity... | true |
8f50d3bf45723244c6c343ac857eaab530bb0b1c | JavaScript | vidishakudalkar/NodeJS-CRUD | /db_ops_lib.js | UTF-8 | 2,458 | 3.09375 | 3 | [] | no_license | 'use strict';
const assert = require('assert');
const mongo = require('mongodb').MongoClient;
//used to build a mapper function for the update op. Returns a
//function F = arg => body. Subsequently, the invocation,
//F.call(null, value) can be used to map value to its updated value.
function newMapper(arg, body) {... | true |
24e4b99445fb885403819dce69fc49774412ced5 | JavaScript | Bombik007/front-end-lab-8 | /homework_04/scripts/script.js | UTF-8 | 3,580 | 2.84375 | 3 | [] | no_license | function assign(res) {
let result = res;
function addProps(obj) {
for (let i in obj) {
if (obj.hasOwnProperty(i) && (typeof obj === 'object')) {
result[i] = obj[i];
}
}
return result;
}
[].forEach.call(arguments, function (item) {
... | true |
cb140ea48fba6f6f0993fe9334cb9ebb8c54b30b | JavaScript | joshsmith27/code-wars | /Javascript/reverse words in a string.js | UTF-8 | 489 | 4.5 | 4 | [] | no_license | // Write a reverseWords function that accepts a string a parameter, and reverses each word in the string. Every space should stay, so you cannot use words from Prelude.
//
// Example:
//
// reverseWords("This is an example!"); // returns "sihT si na !elpmaxe"
// reverseWords "An example!" -- "nA !elpmaxe"
// revers... | true |
b25f24ed612629c361051d0c7effefb37b4a9d5b | JavaScript | felipemarinho97/react-studies | /mestre-da-musica/src/App.jsx | UTF-8 | 2,726 | 2.515625 | 3 | [] | no_license | import React from 'react';
import ArtistProfile from './ArtistProfile'
import Album from './Album'
import Loading from './Loading'
import { FormGroup, FormControl, InputGroup, Button } from 'react-bootstrap';
class App extends React.Component {
constructor(props) {
super(props)
this.state = {
artistNa... | true |
16bef398fc716f3490c01068edd42d4f9491ac27 | JavaScript | mahercoder/bot-maker | /engine/utils.js | UTF-8 | 7,523 | 2.609375 | 3 | [] | no_license | const fs = require('fs')
const path = require('path')
const beautify = require('js-beautify').js
function copyFileSync( source, target ) {
let targetFile = target;
// If target is a directory, a new file with the same name will be created
if ( fs.existsSync( target ) ) {
if ( fs.lstatSync( target... | true |
911b8fc3d500334cbce2ba49af994f996767cca0 | JavaScript | niranjan699/Junk | /index.js | UTF-8 | 859 | 2.921875 | 3 | [] | no_license | const http =require('http');
const url=require('url');
const stringDcoder=require('string_decoder').StringDecoder;
// start http server and start listening
var server=http.createServer((req,res)=>{
//get url and parse
let parsedurl=url.parse(req.url,true);
//get the path
let path=parsedurl.pathname;
let trim... | true |
5856a2c2f5cc188a06b87d889114725848599015 | JavaScript | QuinnKennedy9/72-Summit-Series | /js/home.js | UTF-8 | 2,572 | 2.71875 | 3 | [] | no_license | (function(){
var vid = document.querySelector('#splashVideo');
var screenWidth = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
var toggleSound = document.querySelector('#toggleSound');
var fade = document.querySelector('#fade');
function toggleVideo(){
if(screenWidth>=(16*40)){... | true |
8f360b2404ea89d0c56ca9dc86bbab764948f74c | JavaScript | mohammedsbm/August | /Javascript/Functions and Program Flow/functionsProgramFlow5.js | UTF-8 | 1,418 | 4.46875 | 4 | [] | no_license | //Functions and Program Flow - ex5 - Create a switch statement that displays the current day and time of the week on the webpage
var event1 = document.getElementById("button1");
event1.addEventListener('click', myFunction, false);
function myFunction()
{
var day ="";
//create a new date object
var ... | true |
b6a6ca5463f7debefa3135885187a4a2acf851a0 | JavaScript | Allekksa/Coffee-machine | /script.js | UTF-8 | 7,081 | 3.21875 | 3 | [] | no_license | "use strict"
// window.document.documentElement.body - если не нужен досуп в head window и documentElement опускают часто ? пишут просто document.body
//поиск элементов
// --------Устаревшие методы-----------
/*let coffeeMachine = document.getElementById("coffee"); //поиск по id
console.log(coffeeMachine);
let images =... | true |
367e04b8a1bbdfa2e7cc0231cc5c764331b9ffdc | JavaScript | IgorChiriac/mvc-js-app | /tests/spec/controller.specs.js | UTF-8 | 1,219 | 2.625 | 3 | [
"MIT"
] | permissive | define(['Models/Blog', 'Controllers/ListController'], function (Blog, ListController) {
describe("render a view for each model", function () {
var blogs = [new Blog('data.json')];
beforeEach(function (done) {
ListController.loadData(blogs[0]).then(function (data) {
List... | true |
5f4ce8cbec0fdd56a1fae654fe9f67aa136a87b8 | JavaScript | ChrisLinOvO/wow-gym-client | /src/component/Faq_list/FaqList.jsx | UTF-8 | 3,884 | 2.65625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import FaqListItem from './FaqListItem'
import './FaqList.scss'
// import FaqImg from '../Faq_list/img/faqimg.jpg'
import FaqImg from './img/faqimg3.jpg';
const FaqList = (props) => {
const [faqData, setFaqData] = useState([])
const [searchValue, setSearchVa... | true |
43d848844e2efce062fa766cdf13d02572c50b2b | JavaScript | wolfgangcodes/nvd3 | /src/models/stackedArea.js | UTF-8 | 12,765 | 2.5625 | 3 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive |
nv.models.stackedArea = function() {
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------
var margin = {top: 0, right: 0, bottom: 0, left: 0}
, width = 960
, height = 500
, color = n... | true |
1f7db57822700e9d5b2ab431a3c7a82b76d136b7 | JavaScript | mkdoh3/mocp_me | /client/src/pages/submit/submit.js | UTF-8 | 1,192 | 2.546875 | 3 | [
"MIT"
] | permissive | import React, { Component } from "react";
import axios from "axios";
class Submit extends Component {
componentWillMount() {
const check = !sessionStorage.getItem("prevState");
if (!check.uploadedImg) {
this.props.history.push("/");
}
}
handleOnClick = () => {
const { uploadedImg, returned... | true |
901c64151dc0b03cbb7e094bcb8140a22ccc8cfc | JavaScript | jenilChristo/javascript | /functionComposition.js | UTF-8 | 1,653 | 4.625 | 5 | [] | no_license | // //given function compose(a, b, c), return the result of
// a(b(c(d(e()))));
// function sum(a){
// return function(b){
// return function(c) {
// return a + b + c;
// }
// }
// }
// var res = sum(a)(b)(c)
// //compose([a, b, c])(1)
const func1 = function(a){
return a+1;... | true |
86a3dd4a8840eccf3362f4c3c03d72ef84c82b65 | JavaScript | handv/freecodecamp | /网页设计/build-a-pomodoro-clock/src/App.js | UTF-8 | 4,402 | 3.078125 | 3 | [] | no_license | import React, {Component} from 'react'
import './App.css'
class App extends Component {
constructor(props) {
super(props)
this.state = {
breakLength: 5,
sessionLength: 25,
timeRemain: 1500, //seconds
timeStart: false
}
this.timer = null
}
leftPad = string => {
if (Str... | true |
df17a5ad8ad881656d52ad8ad22a53356c6f45bd | JavaScript | bklcross/Freedom-Forever-Test-Loan-App | /client/src/components/LoanApps/index.js | UTF-8 | 7,862 | 2.546875 | 3 | [] | no_license | import React, { Component } from "react";
import axios from "axios";
import "./style.css";
export default class LoanApps extends Component {
constructor(props) {
super(props);
this.state = {
searchValue: "first_name",
searchType: "First Name",
submissionData: [],
userInput: "",
}... | true |
4e8676a24d2a938ef12242c685c7a45951f893f3 | JavaScript | Taddist/Tennis-Game | /myscript.js | UTF-8 | 3,827 | 3.203125 | 3 | [] | no_license | var canvas;
var canvasContext;
var ballX=50;
var ballY=50;
var ballSpeedX=10;
var ballSpeedY=4;
var palayer1Score=0;
var palayer2Score=0;
var paddle1Y=250;
var paddle2Y=250;
var showingWinScreen=false;
const PADDLE_HEIGHT=100;
const PADDLE_THICKNESS=10;
const WINNING_SCORE=3;
function calculateMousePos(evt) {
... | true |
1176b94ecaf3fa5f40ed6bd0f10323b36afa8f56 | JavaScript | frybitsinc/blusher | /lib/blusher/js/path.js | UTF-8 | 798 | 3.046875 | 3 | [
"MIT"
] | permissive | function join(path1, path2) {
let result = path1;
result += '/' + path2;
return normalize(result);
}
function normalize(path) {
let result = '';
while (path.indexOf('//') !== -1) {
path = path.replace('//', '/');
}
let splitted = path.split('/');
// Debug!
if (false) {
console.log(JSON.... | true |
4ec63a4185aeb12cd7ea792d1bc5b97d602a297a | JavaScript | NouraKaddoura/dmein | /core/entities/Node.js | UTF-8 | 2,814 | 2.90625 | 3 | [] | no_license | class Node {
constructor (props) {
const validatePropsResponse = this._validateConstructionProps(props)
if (validatePropsResponse.status === 'ERR') {
this.isValid = false
throw validatePropsResponse
}
else {
this._assignProps(props)
}
}
getProperties = () => {
let tables... | true |
0d4375bd60916c68c9ac09a06e60c6cae6bc1586 | JavaScript | aprilkrg/mongoose-flights | /controllers/destinations.js | UTF-8 | 862 | 2.59375 | 3 | [] | no_license | const Flight = require('../models/flight');
module.exports = {
create
};
function create(req, res) {
console.log(req.body, 'info on creating the review'); //output [object: null prototype] {destination: ATX}
Flight.findById(req.params.id, function(err, flight) {
console.log(flight, ' this is the flight... | true |
9b20e7143c1bdc9ea5bb873e99445a545bd42e07 | JavaScript | jong-ah/Algorithm_Study | /이지연/210701_정렬_공통.js | UTF-8 | 1,325 | 3.59375 | 4 | [] | no_license | //? 프로그래머스 레벨2 H-index
//= Test Case [1, 3, 5, 7, 9, 11], 4
//! H-index를 구하는 방법
// 자신이 저널에 등재한 전체 논문중 많이 인용된 순으로 정렬한 후, 피인용수가 논문수와 같아지거나 피인용수가 논문수보다 작아지기 시작하는 숫자가 바로 나의 H-index
// 인자로 주어진 citations를 내림차순으로 정렬하고 배열을 순회해서 인덱스의 값(=논문의 수 - 1)과 요소의 값(=피인용수)를 비교해서
// 1. 피인용수가 크거나 같다면 결과값이 1증가
// 2... | true |
ee2ecd2ee3a0ba5be3f7b8a623df05f9c8904d46 | JavaScript | gustavojordao/cefet-web-geiser | /server/app.js | UTF-8 | 3,097 | 2.875 | 3 | [] | no_license | var fs = require('fs');
var _ = require('underscore');
var express = require('express'),
app = express();
var server = app.listen(3000,
function(){
var host = server.address().address;
var port = server.address().port;
console.log('Server started: http://%s:%s', host, port);
}
);
app.use(express.static(... | true |
9cf6f128197bda868bef6c84195e102af65e8c5f | JavaScript | saranyavivekanandan/MernStack | /nodeapi/server.js | UTF-8 | 287 | 2.796875 | 3 | [] | no_license | const express=require('express')
const app=express();
const port =9090
app.get('/', function (req, res) {
res.send('Hello World')
})
app.get('/Hi', function (req, res) {
res.send('I am new to nodemon World')
})
console.log(`we are listening on port ${port}`)
app.listen(9090) | true |
a3ea347f38878878a9b83d8a8332f06612ade7c0 | JavaScript | bhagwantheer/YoutubeAPI_Pokemon | /js/script.js | UTF-8 | 1,788 | 3.03125 | 3 | [] | no_license | let moves =[];
$(function(){
$('#pokemonForm').submit(function(e){
//userInput-items
e.preventDefault();
//Take the input from the user
let pokemonName = $('.inputBox').val().toLowerCase();
$('.inputBox').val("");
$.ajax({
url:"https://pokeapi.co/api/v2/pokemon/"+pokemonName,
dat... | true |
28ba661ffac6114cb272ae42a8598ad00f7ed4e9 | JavaScript | tritue1398/testMindX | /tong.js | UTF-8 | 233 | 2.96875 | 3 | [] | no_license | const readline= require("readline-sync");
function tong(a,b){
return a+b;
}
function run(){
let a=readline.question("Nhap a:");
let b=readline.question("Nhap b:");
console.log(tong(a,b));
}
run (); | true |
f5d8dde8825c74613b5d6f0e006ebecce8083593 | JavaScript | RichMatthews/javascript | /map.js | UTF-8 | 1,161 | 3.875 | 4 | [] | no_license | function map(array, transform){
let namesArray = [];
for (var i=0; i < array.length; i++){
namesArray.push(transform(array[i]));
}
return namesArray;
}
var people = [
{name: 'Rich', born: 1992, city: 'London'},
{name: 'Pete', born: 1962, city: 'Leeds'},
{name: 'Rob', born: 1914, city: 'New York'},
... | true |
7ac6931ed8c935b34b55c369c6a76ae9ec563ee4 | JavaScript | ferreiro/Learning-node | /Cap5/finalExercises.js | UTF-8 | 1,220 | 3.015625 | 3 | [] | no_license | /****
* 1
* Crear una cabecera que le pase el código 501
var http = require('http');
http.createServer(function(req, res) {
res.writeHead(501);
res.end("Yoooooo biach!");
}).listen(2000, "127.0.0.1");
console.log("Server run on server. 127.0.0.1:2000");
*****/
// Second Activity
/*
var http = require('http'),
... | true |
d5c44ec49c96293cd3c2ec76f5f3807cce869697 | JavaScript | nixon7777/Pokemon-Showdown | /chat-plugins/money-system.js | UTF-8 | 9,464 | 2.578125 | 3 | [
"MIT"
] | permissive | /*--
Sistema monetario
Este plugin sostiene todo el sistema
monetario del servidor, es el encargado
de efectuar las compras, dar los articulos,
etc.
© panpawn
--*/
'use strict';
const fs = require('fs');
const moneyName = Utils.Money.moneyName;
let prices;
// Precios med... | true |
92f8537c105267181b88dd5e07cdaba9e078cac7 | JavaScript | skillitzimberg/swell | /src/main.js | UTF-8 | 2,044 | 2.734375 | 3 | [
"MIT"
] | permissive | import { WaveScore } from './waveScore';
import { BouyData } from './bouyData';
import $ from 'jquery';
import 'bootstrap';
import 'bootstrap/dist/css/bootstrap.min.css';
import './styles.css';
$(document).ready(function() {
const url = 'https://www.ndbc.noaa.gov/data/realtime2/46029.spec';
const newBouyData = new... | true |
da0556d6bf65694fc941018ddb3f638389bfbcd5 | JavaScript | mattgawron/codewars-kata | /kyu-7/wheres-wally/solution-test.js | UTF-8 | 1,745 | 3.21875 | 3 | [] | no_license | const solution = require('./solution');
describe('wheresWally', () => {
it('should return -1 for empty string', () => {
expect(solution.wheresWally('')).toBe(-1);
});
it('should return -1 when Wally was not found', () => {
expect(solution.wheresWally('No expected string here')).toBe(-1);
});
it('shou... | true |
0149bc0cbc91347d6870bd9c76c8696cf5fbf75c | JavaScript | dwharve/hub | /app.base.js | UTF-8 | 807 | 3.1875 | 3 | [] | no_license | function base(){
var that = this;
var events = [];
var addValid = [];
var setValid = [];
this.description = '';
this.on = (event, cb)=>{
that.events.push({event: event, cb:cb});
};
var fireEvent = (event,data)=>{
var cbs = events.filter( d => { return d.event == event; });
if(cbs.length >... | true |
558a4421bc8d455e73576dd70a14f6a4f6a6b283 | JavaScript | leocaliban/b7web-FrontEnd | /07 - JQUERY/16_propriedades_padrao_do_evento/assets/javascript/script.js | UTF-8 | 277 | 2.578125 | 3 | [] | no_license | $(function () {
$('#botao').click(function (e) {
// cancela o evento padrao de envio de formulario
e.preventDefault();
// saber o tipo de evento realizado
console.log(e.type);
$('h2').toggleClass('enviado');
});
}); | true |
503bc7fb0c98f146f78bc9832a82681380adafb5 | JavaScript | Mechwarrior21/wdi-fundamentals-memorygame | /starter-code/main.js | UTF-8 | 593 | 3.21875 | 3 | [] | no_license | console.log("JS file is connected to HTML! Woo!")
var cardOne = "queen";
var cardTwo = "queen";
var cardThree = "king";
var cardFour = "king";
if ("king" = "king") {
window.alert("You found a match!")
};
else if ("queen"= "queen") {
window.alert("You found a match!")
};
else {
window.alert("Sorry, try again.")
}... | true |
84943a11a98730be92655f71c22a128b81a16719 | JavaScript | mig82/viskit | /src/core/operations/get-quantum-version.js | UTF-8 | 1,782 | 2.734375 | 3 | [
"MIT"
] | permissive | "use strict";
const fs = require('fs-extra');
const colors = require('colors');
const path = require('path');
/**
* getQuantumVersion - Returns the current Visualizer Quantum GA version of a project
* according to the projectProperties.json file in its root folder.
*
* @param String projectPath The absolute pat... | true |
ca28bb2561eb9564a22aab3e67f715c61d020fea | JavaScript | Rrobertson014/Rrobertson014.github.io | /Adv Projects/newSnake/index.js | UTF-8 | 7,058 | 3.28125 | 3 | [] | no_license | /* global $, sessionStorage */
$(document).ready(runProgram); // wait for the HTML / CSS elements of the page to fully load, then execute runProgram()
function runProgram(){
////////////////////////////////////////////////////////////////////////////////
//////////////////////////// SETUP //////////////////////... | true |
24866027c9d32b2d87d309b299d85b1d17accbd6 | JavaScript | hantomato/learnyounode | /testjs/6.operator.js | UTF-8 | 1,494 | 3.953125 | 4 | [] | no_license | // 비교 연산자
// 일반적으로 비교시에 두개의 타입이 틀리면 자동 형변환을 수행 후에 비교를 한다. ===, !== 만 예외.
// 자바스크립트에서는 아래 6가지 타입을 제외하고는 모두 true 임.
// ”” (빈 문자열)
// NaN (Not a Number)
// undefined (정의되지 않은 값)
// null (Null값)
// false (기본 boolean false)
// 0 (숫자 0)
// === 비교는 타입도 일치해야함.
... | true |
031ed76751e8a1ed53242c22d00510ab96aa9529 | JavaScript | CDidier80/Code-Challenges-Algos-Interviews-Cool-Solutions | /SORTS/insertion-sort/insertion-sort.js | UTF-8 | 1,195 | 4.03125 | 4 | [] | no_license | // insertion sort. Iterate through each array index moving left to right
// move the value found at each index from right to left until it's sorted
// [1, 2, 6, 7, 4] on the final pass ==> [1, 2, 4, 6, 7]
// 4 moves to spaces to the left
for (let i = 1; i < length; i++) {... | true |
cda718cea4c5820419d30624702ed6b9c847f86b | JavaScript | bgutman97/wdfw | /bot.js | UTF-8 | 4,529 | 2.53125 | 3 | [] | no_license | var request = require('request');
var https = require('https');
var botIdProd= process.env.botIdProd;
var groupIdProd = process.env.groupIdProd;
var groupEnvProd = '27242090';
var botIdTest = process.env.botIdTest;
var groupIdTest = process.env.groupIdTest;
var groupEnvTest = 'TEST';
var botName = process.env.botName;... | true |
26861c9c0199036784a1d4049e0561f14d2c6249 | JavaScript | AbdulqadirQ/react_redux | /07_blog/src/actions/index.js | UTF-8 | 1,989 | 3.0625 | 3 | [] | no_license | import _ from "lodash";
import jsonPlaceholder from "../apis/jsonPlaceholder";
export const fetchPostsAndUsers = () => async (dispatch, getState) => {
// await ensures fetchPosts is called, sends api request, gets response, and the dispatches action before moving on to next line of code
// So await IS ONLY use... | true |
e8a0b849451fa03ad996f1b30dd945648b14d45d | JavaScript | homutovan/AJS_1_4_1_unit-test_clear_functions | /src/js/app.js | UTF-8 | 325 | 2.734375 | 3 | [] | no_license | export default function healthHandler(character) {
if (!character) throw new Error('character not found');
else if (!('health' in character)) throw new Error('character is bad');
const { name, health } = character;
return (health > 50 && 'healthy')
|| (health <= 50 && health >= 15 && 'wounded')
|| 'critical... | true |
3341a4335dc8a64f4a6208e58947985203f0080d | JavaScript | Juliolikescoding/WEB1100-MIDTERM | /.history/Q13_20180524195739.js | UTF-8 | 165 | 4.1875 | 4 | [] | no_license | // Write a for loop that prints to the console all the numbers from 1 to 10 in
// ascending order.
for (i = 0; i < 10; i++) {
console.log(i);
}
// console.log(i) | true |
226b6141a31ec80c1481ec4781d507a8e59b8de6 | JavaScript | arammkr/codility-js-solutions | /Stacks and Queues/Nesting/index.test.js | UTF-8 | 276 | 2.546875 | 3 | [] | no_license | const solution = require('./index.js');
describe('Nesting', () => {
test(`codility test`, () => {
expect(solution('(()(())())')).toBe(1);
expect(solution('())')).toBe(0);
});
test(`simple test`, () => {
expect(solution('(((()()()())))')).toBe(1);
});
}); | true |
05f8e4caf75fa844e1aee9f1f4983ab51ddea107 | JavaScript | MateuszJrk/PanelApp | /src/components/Main/Pagination/Pagination.js | UTF-8 | 5,118 | 2.609375 | 3 | [] | no_license | import React from "react";
import { connect } from "react-redux";
import styled from "styled-components";
import { PaginationItem, PaginationLink } from "reactstrap";
import PropTypes from "prop-types";
const propTypes = {
onChangePage: PropTypes.func.isRequired,
initialPage: PropTypes.number
};
const defaultPro... | true |
100c04e215849f0848cd59a76f20da818bdc2f7a | JavaScript | sansanshow/fe-notes | /examples/html/13-Cross-domain.js | UTF-8 | 445 | 2.8125 | 3 | [] | no_license | /**
* Cross domain
* 跨域的实现
*/
//1. 图片ping或script标签跨域
function imgPing(url) {
var img = new Image();
img.src = url;
img.onload = function () {
console.log(`img-url:${url}...success`)
}
img.onerror = function () {
console.error(`img-url:${url}...faild`)
}
}
function addScript... | true |
ba8196ef3b3038249caa323d14bcaec6e48ee29d | JavaScript | nigelhardy/CST426 | /Battle4/Project/service_locator.js | UTF-8 | 1,001 | 2.984375 | 3 | [] | no_license | class AudioService {
// should be abstract class
// would be virtual
playSound(soundID) { return null; };
};
// HD implementation of Audio
// plays more HD sound
class AudioHD {
constructor() {
this.sounds = ['../Project/game_sound.wav'];
}
playSound(soundID)
{
var audio = new Audio(this.sou... | true |
532132ec42a76c69fb683b0ec3e22361c4f20a2b | JavaScript | kajetansw/kajetansw.github.io | /js/progressbars.js | UTF-8 | 4,558 | 3.140625 | 3 | [] | no_license | // progressbar.js@1.0.0 version is used
// Docs: http://progressbarjs.readthedocs.org/en/1.0.0/
/*
##########################################
SETTINGS
##########################################
*/
const fontFamily = '"Quicksand", sans-serif';
const fontSize = '1.8rem';
const stepHandler = (state, circle) => {
c... | true |
32bc01bd1baceb6d14c3b674f59637d346c289e3 | JavaScript | amartya97/todo-manager-lwc | /force-app/main/default/lwc/toDoManager/toDoManager.js | UTF-8 | 3,393 | 3.125 | 3 | [] | no_license | import { LightningElement, track} from 'lwc';
import addTodo from '@salesforce/apex/ToDoController.addTodo';
import getCurrentTodos from '@salesforce/apex/ToDoController.getCurrentTodos';
import updateTodo from '@salesforce/apex/ToDoController.updateTodo';
import deleteTodo from '@salesforce/apex/ToDoController.deleteT... | true |
2a10660517152281c0007505bacbf2a6a0da7ec4 | JavaScript | utilmind/video-switcher | /video-switcher.js | UTF-8 | 5,758 | 2.546875 | 3 | [] | no_license | var videoSwitcher = {
// config (filled with defaults)
config: {
id: "myvideo",
rotate: false,
vids: [],
},
// go
init: function(options) {
var me = this;
// setup options (copy to config)
if (options) {
if (typeof options.id != "undefined")
me.config.id = ... | true |
cdd7a3392d6fdb37221aba5a063252590506ed14 | JavaScript | robert-brandt-fi/day3web | /scripts/javascript.js | UTF-8 | 231 | 2.984375 | 3 | [] | no_license |
function loginClicked() {
let firstName, surName;
firstName = document.getElementById("firstName").value;
surName = document.getElementById("surName").value;
alert(`Töttöröö, olet ${firstName} ${surName}`);
} | true |
a80c225b007caa67cc6da7ec302c180d41b8b2dc | JavaScript | Kmilo9433/MercadoLibreApp | /FrontEnd/src/components/views/details/index.js | UTF-8 | 1,864 | 2.53125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import { useLocation } from "react-router-dom";
import { get } from "../../../services";
import styles from "./details.module.scss";
import CurrencyFormat from "react-currency-format";
const Details = () => {
const [productDetail, setProductDetail] = useState();
... | true |
8beed44082ecc2c32b179a2d7ee846b8233bccc1 | JavaScript | Mkhzoumi/amman-301d23 | /class-13/demo/backend/server.js | UTF-8 | 1,699 | 2.890625 | 3 | [
"MIT"
] | permissive |
// frameworks are code that executes or runs your own code
// libraries are code that gets executed by your own code
const express = require('express') // require the express package
const app = express() // initialize your express app instance
const mongoose = require('mongoose');
const {
getCats,
createCat,... | true |
cad782f7b27031f3a6ce8cd71e675854e8082d3e | JavaScript | wpantoja/programacao_imperativa-1 | /Arrays.js | UTF-8 | 868 | 3.5625 | 4 | [] | no_license |
let produtos = ['amaciante', 'sabao', 'detergente', 'shampoo', 'sabonete'];
console.log(produtos)
console.log(produtos.pop(), "O método 'pop' remove e retorna o último item de uma matriz.")
console.log(produtos)
console.log(produtos.join(" — "), "O método 'join' converte uma matriz em uma string, unindo todos... | true |
7615399cd49f1232eb20066f80e1ef6319a129a2 | JavaScript | PhoenixContactUSA/sdk-dslink-javascript | /lib/value.js | UTF-8 | 1,363 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | var _ = require('./internal');
var ValueType = {
DYNAMIC: 'dynamic',
STRING: 'string',
NUMBER: 'number',
BOOLEAN: 'bool',
LIST: 'list',
MAP: 'map',
ENUM: function() {
return 'enum[' + _.args(arguments).join(',') + ']';
}
};
function determineType(value) {
var types = {
'string': ValueType.ST... | true |
269a66c70e06c76f7f7f08bdb8c034f9fa0fa598 | JavaScript | geozhur/project-lvl1-s340 | /src/games/prime.js | UTF-8 | 665 | 3.15625 | 3 | [] | no_license | import { game, makeQuestionAndCorrectAnswer, rand } from '..';
const isPrime = (num) => {
const iterPrime = (index) => {
if (num % index === 0 || num < 2) {
return (num === 2);
}
if (index < num / 2) {
return iterPrime(index + 1);
}
return true;
};
return iterPrime(2);
};
const l... | true |
4d3925d81332b44a998e2d78ed3a007aeee38052 | JavaScript | b-ellis/hot-or-cold-starter | /objects.js | UTF-8 | 373 | 4.03125 | 4 | [] | no_license | var student = {
name: "Bradley",
age: 24,
birthday: function() {
this.age++;
}
};
var student2 = Object.create(student);
student2.name = "Mostafa";
student2.age = 24;
//console.log(student.name);
//console.log(student.age);
console.log(student2.name);
console.log(student2.age);
student2.birthday();
co... | true |
2aad139dfb527161c378638d5c5339f0de297ec7 | JavaScript | iMediaLibrary/LibraryHZNU | /assets/script/AlertBookSearch.js | UTF-8 | 4,327 | 2.546875 | 3 | [] | no_license | var BookAlert = {
_alert: null, // prefab
_book1:null,
_book2:null,
_book3:null,
_enterCallBack:null, // 回调事件
_animSpeed:0.3, // 动画速度
};
/**
* detailString : 内容 string 类型.
* enterCallBack: 确定点击事件回调 function 类型.
* neeCancel: 是否展示取消按钮 bool 类型 default YES.
* duration:... | true |
8d01894f278e50349836634f8d4df0d2f7a350b5 | JavaScript | josiah14/lubuntu_home_dir | /.config/google-chrome/Default/Extensions/pnjaodmkngahhkoihejjehlcdlnohgmp/5.2.2_0/popup/js/pui/events.js | UTF-8 | 2,201 | 2.6875 | 3 | [] | no_license | PUI.Events = Class.extend({
initialize: function(baseElement, callbackObject) {
this.element = baseElement;
this.callbackObject = callbackObject;
},
add: function(key, method) {
var events = {};
if ( typeof key === "object" )
events = key;
else
events[key] = method;
for ( var key in events ) if ... | true |
5ffca75895a0b7ce154bbea253be3c218fc48c0d | JavaScript | ITA-Dnipro/Dp-197-Kony-Team-Hannibal | /modules/require/httpNewsService.js | UTF-8 | 1,234 | 2.8125 | 3 | [] | no_license | define(['utils'], function (utils) {
function getFeedData(url, successCb, errorCb, logo) {
function retrieveFeedData(data) {
var feedData = data.rss.channel.item.map(function(item) {
var date = new Date(item.pubDate);
var month = (date.getMonth() + 1) + "";
if (month.length < ... | true |
e746ad83f7a04d41e042cb2b8710320d3447f072 | JavaScript | scip4/DRCTS | /DRCTS/Scripts/session.warning.js | UTF-8 | 8,214 | 2.5625 | 3 | [
"MIT"
] | permissive | $(document).ready(function () {
//delete loggedout session cookie
delete_cookie('loggedout', window.location.hostname);
initSessionMonitor();
awakeServerSession();
getLastActivityTime = true;
});
//Load jQuery First
//How frequently to check for session expiration in milliseconds
//10000 - every... | true |
7be2304544ff0370df12d5c21eec0388e9a19c17 | JavaScript | alisaspl/1556343-keksobooking-21 | /js/card.js | UTF-8 | 3,114 | 2.890625 | 3 | [] | no_license | 'use strict';
(function () {
const config = window.config;
const container = document.querySelector(`.map`);
const template = document.querySelector(`#card`).content.firstElementChild;
let closeCardHandler;
function render({offer, author}) {
closeMainPinCard();
const card = template.cloneNode(true... | true |
93f3eff929d929b8417e4f6401400dbf3834c6f1 | JavaScript | sljudge/chess_openings | /src/config/sagas.js | UTF-8 | 3,113 | 2.65625 | 3 | [] | no_license | import { takeEvery, select, call, put } from 'redux-saga/effects'
import { MOVE_PIECE, movePiece, castleKingSide, castleQueenSide } from '../actions/movePiece'
import { UPDATE_DATA, TOGGLE_PLAYER, RESET, SET_ALERT, TOGGLE_AUTO, CLEAR_GAMES } from '../actions/updateData'
import createMatrix from '../helpers/createMatrix... | true |
a1c4cc35d56f6c454ebab29abf372a4358c8757e | JavaScript | martahj/vjeverica | /server/models/token.js | UTF-8 | 1,513 | 2.828125 | 3 | [] | no_license | const Promise = require('bluebird');
const jwt = require('jsonwebtoken');
const jwtPromised = Promise.promisifyAll(jwt);
const db = require('../db.js');
const ModelHelper = require('./modelHelper');
let tokenAttributes = [
ModelHelper.makeAttr('token', true)
];
const code = "jafoi2j89jj";
const expiration = {
dev... | true |
04fa32bbdfc8e20d023e476d55a7b05c928c4319 | JavaScript | conois/clima_Udemy | /app.js | UTF-8 | 785 | 3.21875 | 3 | [] | no_license | const lugar = require("./lugar/lugar");
const clima = require("./clima/clima");
const argv = require("yargs").options({
direccion: {
alias: "d",
description: "Direccion de la ciudad para obtener el clima",
demand: true,
}
})
.help()
.argv
let getInfo = ... | true |
3901ee82e1b5e8cc7dd8b7a9c468ff959124ba65 | JavaScript | rtef23/es6 | /public/src/js/test.js | UTF-8 | 595 | 2.703125 | 3 | [] | no_license | "use strict";
const jsonValidator = require("json-validator");
let jsonSchema = {
name: {
required: true,
trim: true,
validate: function (name, path) {
console.log(`name : ${name}\npath : ${path}`);
return {
isValid: (!name && typeof name === "string"),
message: "check your ... | true |
862a2015794b74260af95c5837af45769b54c18e | JavaScript | shokhnazarovs/basic-js | /src/carbon-dating.js | UTF-8 | 538 | 3.234375 | 3 | [
"MIT"
] | permissive | const MODERN_ACTIVITY= 15;
const HALF_LIFE_PERIOD= 5730;
module.exports = function dateSample(sampleActivity = -1) {
if(typeof(sampleActivity) != 'string')
return false;
sampleActivity = parseFloat(sampleActivity);
if(isNaN(sampleActivity) || sampleActivity === -1){
return false;
}
... | true |
7ae11fe9d97ae2a92e8046ad1df5e9ea0d2e45fa | JavaScript | EvgenyKalnichenko/three_js | /src/js/modules/split-letters.js | UTF-8 | 1,365 | 3.265625 | 3 | [] | no_license | export const splitLetters = (selector, wrapper = "$", delimeter = " ", joiner = " ") => {
//let nodeList = document.querySelectorAll(selector);
let nodeList = selector;
let ind = 0;
function parseLetters(node) {
let htmlNode = node.cloneNode();
htmlNode.innerHTML = "";
for (let... | true |
813ed27456e08ac2f653b6f618182d84fd3c7833 | JavaScript | celrenheit/grex | /src/arguments/object.js | UTF-8 | 511 | 2.640625 | 3 | [
"MIT"
] | permissive | var inherits = require('inherits');
var Argument = require('./argument');
module.exports = (function() {
function ObjectArgument() {
Argument.apply(this, arguments);
}
inherits(ObjectArgument, Argument);
ObjectArgument.prototype.toString = function() {
return JSON.stringify(this.raw).replace('{', '['... | true |
b9f61e6333e476a076ac857ca811e70d6aca1ee4 | JavaScript | JacksonWuxs/Traditional-Archery-Event-Management-System | /Code/client_pro/Source/Background/lunbo.js | UTF-8 | 4,178 | 2.78125 | 3 | [
"Unlicense"
] | permissive | // js导入语句:(在head里,且js与html文件在同一文件夹里)
// <script src="lunbo.js"></script>
window.onload = function() {
document.getElementsByTagName("body")[0].style.height = "535px";
document.getElementsByTagName("body")[0].style.width = "753px";
var width = 600;
var imgs = document.getElementsByTagName("img");
var box = ... | true |
ab1128ad0b73f134e70edd2208098f573a13742a | JavaScript | LuoRiWuSheng/ES6-practice | /类class/4-类的实例属性.js | UTF-8 | 103 | 3.21875 | 3 | [] | no_license | class Foo {
a = 12
say() {
console.log(this.a)
}
}
let f = new Foo()
f.say() | true |
fcf6f9034a343f22bdd3696b07e3052365205733 | JavaScript | tolaked/AnyWhereFitness-Backend | /auth/auth.js | UTF-8 | 1,995 | 2.53125 | 3 | [] | no_license | const bcrypt = require("bcryptjs");
const Users = require("../models/dbModel");
const auth = require("../middleware/auth");
class Auth {
async createUser(req, res) {
req.body.password = bcrypt.hashSync(req.body.password, 11);
const newUser = { ...req.body };
return Users.add(newUser, "users")
.th... | true |
a89e3036dd06012d55b104928dbf937ef452a7d1 | JavaScript | jecs580/Practica-Three.js | /main.js | UTF-8 | 4,067 | 2.875 | 3 | [] | no_license |
// Render
var Render = new THREE.WebGLRenderer();
var Escenario=new THREE.Scene();
var Figura;
var controls;
var ancho=window.innerWidth -50;
var alto=window.innerHeight -50;
var angulo=45;
var Aspecto=ancho/alto; // Aspecto del radio
var cerca=0.1;
var lejos=10000;
var Camara=new THREE.PerspectiveCamera(angulo,Aspec... | true |
4933276dd943dc78e7b03f6ca28ab57d21a97c5a | JavaScript | kretikaarora/ComputationProgramming-JavaScripts | /ForLoop/ForLoop1.js | UTF-8 | 669 | 4.125 | 4 | [] | no_license | ///console read write module is requires for taking input from the user
io= require('console-read-write');
///we are declaring the function as async
///if func is not async then we will have to give all the inputs at the begining together
///the function wont take the input when it is called
///Async makes the func wa... | true |
9bef7a370c01e847ee6c1719a3bda62e10f7fdf4 | JavaScript | icedjello/ag_server_example_sequelize | /server.js | UTF-8 | 1,649 | 2.515625 | 3 | [] | no_license | const express = require('express');
const Sequelize = require('sequelize');
const app = express();
const environment = require('./config.json').test;
app.use(express.json());
const cors = require("cors");
app.use(cors({}));
const port = 3000;
const sequelize = new Sequelize(environment.database, environment.username,... | true |
4f6e2f3c4135e4e0b50ac59fb2da20aac555de73 | JavaScript | aschambers/react_fullstack_auth | /server/services/passport.js | UTF-8 | 1,163 | 2.515625 | 3 | [] | no_license | // required to use login with passport
const passport = require('passport');
// uses regular custom built login to sign-in
const LocalStrategy = require('passport-local').Strategy;
const mongoose = require('mongoose');
const keys = require('../config/keys');
// required to execute some passport functionality
const User... | true |
a9fdb10b4022f9334a892554934f44f271aea4f3 | JavaScript | ukutaht/artisan | /app/src/js/stories/pert.js | UTF-8 | 586 | 3.09375 | 3 | [] | no_license | function hasEstimate(estimates) {
return estimates.optimistic || estimates.realistic || estimates.pessimistic
}
function weightedMean(estimates) {
return ((estimates.optimistic + (4 * estimates.realistic) + estimates.pessimistic) / 6);
}
function standardDeviation(estimates) {
return ((estimates.pessimistic - e... | true |
4eb91b26a4d15d75d414d4b799cc01eaf9aa0306 | JavaScript | izaakschroeder/vinyl-request | /lib/src.js | UTF-8 | 3,643 | 2.78125 | 3 | [] | no_license |
'use strict';
var _ = require('lodash'),
File = require('vinyl'),
Stream = require('stream'),
path = require('path'),
url = require('url'),
util = require('util');
// So would love to use the `request` module but it doesn't support
// streams2+ soooo... ¯\_(ツ)_/¯
var handlers = {
'http:': require('http'),
'... | true |
7444ab5078d6d6c096525b1ad19b8af2a3449c85 | JavaScript | nemanjaZivkovic/react-hooks | /src/Matrix.js | UTF-8 | 878 | 2.8125 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import MATRIX from './data/matrix';
const MIN_FPS = 5;
const MAX_FPS = 90;
function Matrix() {
const [ index, setIndex ] = useState(0);
const [ fps, setFps ] = useState(30);
useEffect(
() => {
const interval = setInterval(() => {
setIndex((curIndex) =>... | true |