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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
536319ca75987f3451fefe76996e6865e1716053 | JavaScript | Adam262/NodeSchool | /nodeschool/sync.js | UTF-8 | 478 | 3.640625 | 4 | [] | no_license |
//leanryounode 3/13. Write a program that uses a single synchronous filesystem operation to read a file and print the number of newlines it contains to the console (stdout), similar to running cat file | wc -l.
var fs = require("fs");
var buf = fs.readFileSync(process.argv[2]);//returns native Node buffer data object... | true |
01088ace88a47bb37075f91e319fc9c09c6ce444 | JavaScript | achrams/livecode-1 | /server/helpers/bcrypt.js | UTF-8 | 340 | 2.640625 | 3 | [] | no_license | const bcrypt = require('bcryptjs')
function generatePassword(password) {
let salt = bcrypt.genSaltSync(10)
let hash = bcrypt.hashSync(password, salt)
return hash
}
function decryptPassword(password, hashPassword) {
return bcrypt.compareSync(password, hashPassword)
}
module.exports = { generatePasswor... | true |
ee5fdaaa83e460c5bb6ca6ddbc001739b099e59c | JavaScript | minciu/Form | /FormDetails.js | UTF-8 | 2,849 | 2.515625 | 3 | [] | no_license | import React, { Component } from "react";
//import { useState } from "react";
import Col from "react-bootstrap/Col";
import Button from "react-bootstrap/Button";
import Form from "react-bootstrap/Form";
class FormDetails extends Component {
constructor(props) {
super(props);
this.state = {
validated:... | true |
c3a4255a50da2e03dbe0c4b7dac3b08a2442febf | JavaScript | jigioarias/practicaCur | /practica/src/main/webapp/js/cur.js | UTF-8 | 238 | 2.53125 | 3 | [] | no_license | /**
* Empresa :Remington
*
*/
function validar(){
formulario = document.forms[0];
casilla = formulario.casilla.value;
if(casilla!=''){
formulario.submit();
}else{
alert('La casilla esta vacia')
}
} | true |
b78d6a5c57f495d9b01bece6598431ffee544345 | JavaScript | generatorinchief/generatorinchief.github.io | /test/find_by_innertext.js | UTF-8 | 215 | 3.09375 | 3 | [] | no_license | function contains(selector, text) {
var elements = document.querySelectorAll(selector);
return Array.prototype.filter.call(elements, function(element){
return RegExp(text).test(element.textContent);
});
}
| true |
caf67b31b67b3354a00cfa7bd7cefb19cc2faf87 | JavaScript | vovachebr/external-courses | /src/ex4_js-objects-part2/task-12.js | UTF-8 | 135 | 2.796875 | 3 | [
"MIT"
] | permissive | function summ(left,right){
return Number((left+right).toFixed(3));
}
console.log(summ(3.455, 4.55));//8.005
module.exports = summ; | true |
85d4d7e46ecdab94b16db9e74d4005dd8ecb99a6 | JavaScript | Maju1612/nodeJS-REST-API | /controllers/user.js | UTF-8 | 1,526 | 2.625 | 3 | [] | no_license | const userService = require('../services/user')
const { createToken } = require('../services/jwt')
const { validationResult } = require('express-validator');
exports.loginUser = async (req, res) => {
const email = req.body.email
const password = req.body.password
const result = await createToken(email, pa... | true |
c3475c192c7d029efd26323c4c03f3d459098d10 | JavaScript | Wladimir88Shevchenko/React_projects | /todolist/src/components/list-item/list-item.js | UTF-8 | 1,445 | 2.71875 | 3 | [] | no_license | import React, {Component} from 'react';
import './list-item.css';
export default class ListItem extends Component {
/*
state = {
done: false,
important: false,
} */
/* onLabelClick = () => {
this.setState(({done}) => {
return{
done: !done
} ... | true |
f420939653b395054264d0469124184777a46224 | JavaScript | tomdora/codewars-solutions | /Maximum subarray sum.js | UTF-8 | 483 | 3.34375 | 3 | [] | no_license | const maxSequence = arr => {
if (!Array.isArray(arr) || !arr.length) return 0;
if (arr.every(x => x >= 1)) return arr.reduce((x, y) => x + y);
let max = 0;
for (let i = 0; i < arr.length; i++) {
let tempSum = arr[i];
let tempMax = arr[i];
for (let j = i + 1; j < arr.length; j++)... | true |
b5d489dcffa7b70229f95cca048c88b52981caaa | JavaScript | maguangxiao/maguangxiao.github.io | /JS/jumpThroughPost.js | UTF-8 | 2,396 | 2.65625 | 3 | [] | no_license |
// var request;
// if (window.XMLHttpRequest) { // Mozilla, Safari, ...
// request = new XMLHttpRequest();
// } else if (window.ActiveXObject) { // IE
// try {
// request = new ActiveXObject('Msxml2.XMLHTTP');
// } catch (e) {
// try {
// request = new ActiveXObject('Microsoft.X... | true |
e1504117a25dba68898c5b4fe773e4534a6b7ea4 | JavaScript | UnosquareBelfast/AdminCore | /web-app/src/utilities/mandatoryEvents.js | UTF-8 | 1,255 | 2.671875 | 3 | [
"MIT"
] | permissive | import moment from 'moment';
import holidayStatus from './holidayStatus';
const currYear = new Date().getFullYear();
// Add mandatory events here. The only fields that need change are title and the dates.
const mandatoryEvents = [
{
title: 'Christmas Day',
mandatoryDate: `${currYear}-12-25`,
},
{
ti... | true |
b10fa72b2170e193cc382ad76dac388b748a8adb | JavaScript | amalharb123/prac1 | /clock.js | UTF-8 | 76 | 2.515625 | 3 | [] | no_license | let time=0
setInterval(function(){
time++;
console.log(time)
},1000) | true |
853f5d53a25779679fc95cfe13be1cc964dd9d26 | JavaScript | jiedong9/web_dev | /bibao/demo2.js | UTF-8 | 305 | 3.015625 | 3 | [] | no_license | let a = new Promise((resolve, reject) => {
setTimeout(() => {
resolve('a成功')
},1000)
})
let b = new Promise((resolve, reject) => {
setTimeout(() => {
reject('失败')
},2000)
})
Promise.race([a, b]).then(res => {
console.log(res)
},err => {
console.log(err)
}) | true |
14556cf06b2449d0b533cd9f4d527a5b9c63d546 | JavaScript | klaytnsori-2019/klaytnsori_server_api | /v1/app/klaytnsori/translateTime.js | UTF-8 | 497 | 2.78125 | 3 | [] | no_license | var translateTime = {};
translateTime.translateDate = function(unixTimeStamp){
var date = new Date(unixTimeStamp*1000);
var year = date.getFullYear();
var month = "0" + (date.getMonth()+1);
var day = "0" + date.getDate();
var hour = "0" + date.getHours();
var minute = "0" + date.getMinutes();
var second ... | true |
59ed76ff762256d1b0256bbd5a967c02cd6c9333 | JavaScript | DorotaRan/Weather-App | /.vscode/app.js | UTF-8 | 2,893 | 3.359375 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | const apiKey = 'ab06cf297e8f65ab0d86ffab4a9e88b4'
const url = `https://api.openweathermap.org/data/2.5/`
const locationSearchBox = document.querySelector('.location-search-box');
locationSearchBox.addEventListener('keypress' , sendRequest);
let current = new Date();
const date = document.querySelector('.date-contain... | true |
81a54d2fa589badd3d1b1354116de46ab76a280f | JavaScript | 6170-fa20/student-examples | /a3/routes/users.js | UTF-8 | 9,872 | 2.71875 | 3 | [] | no_license | const express = require('express');
const Users = require('../models/Users');
const Freets = require('../models/Freets');
const Refreets = require('../models/Refreets');
const session = require('express-session');
const router = express.Router();
/**
* Create a new user (account)
* @name POST/api/users/signup
*/
r... | true |
978c63520830b2652b8eee3780970877f2af608a | JavaScript | theojulienne/BooJS | /libjs/booJS.js | UTF-8 | 10,642 | 2.53125 | 3 | [] | no_license | // booJS.js
// David Collien and Dougall Johnson, 2011
// The Boo namespace and runtime tools.
Enumerator = function( array ) {
this.index = -1;
this.array = array;
this.length = array.length;
};
Enumerator.prototype = {
index: -1,
length: 0,
array: null,
MoveNext: function( ) {
this.index++;
return this... | true |
8ad6cda1a616a87349c9b30e508b509b3a9f7d97 | JavaScript | wisawut/frontweb-react | /script_js/main.js | UTF-8 | 3,479 | 2.84375 | 3 | [] | no_license | class Clock extends React.Component {
constructor(props){
super(props);
this.state = {
date: new Date() ,
user: props.profiles.profile,
description : props.profiles.detail,
feeddata:props.profiles.feed,
news:null
};
}
componentDidMount(){... | true |
7c0b43374859eb3d7b63b913853821ba97f59c3f | JavaScript | MaxSamokhin/simple-logger | /src/modules/util.js | UTF-8 | 955 | 2.734375 | 3 | [] | no_license | ;(function () {
class Http {
constructor() {
}
static FetchGet(address) {
return fetch(address, {
method: 'GET',
headers: {
'Content-Type': 'application/json; charset=utf-8',
'Accept': 'application/json'
... | true |
2df46c7cfed175756dfbbd1380ff0461983ca0e5 | JavaScript | forrestblade/react-seed | /src/tests/puppeteer/puppeteer.js | UTF-8 | 845 | 2.53125 | 3 | [
"MIT"
] | permissive | const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto('http://localhost:8080')
await page.screenshot({ path: 'initialState.png' })
const title = await page.$eval('p', e => e.innerHTML)
title === 'React Seed' && ... | true |
943d6385a9f4faa01cd8d8adb59865177f9555fe | JavaScript | joelnederveen/J1B1W2 | /pizza calculater 1.0/b1w2l1.js | UTF-8 | 1,151 | 3.625 | 4 | [] | no_license | //Joel Nederveen
//pizza calculator 1.0
var small = prompt("Hoeveel small pizza's wilt u?",); //vraag hoeveel small pizza's de klant wilt
var medium = prompt("Hoeveel medium pizza's wilt u?",); //vraag hoeveel medium pizza's de klant wilt
var large = prompt("Hoeveel large pizza's wilt u?",); //vraag hoeveel large pizza... | true |
09ad87da6ccbd189cceec3d91a5f3db802d4b004 | JavaScript | CGriffoin/clement-angular-application | /routes/fwk.js | UTF-8 | 2,915 | 2.703125 | 3 | [] | no_license | "use strict";
var FWK = [
{
"id":'1',
"name":'AngularJS',
"comment":'Des applications Web Monopage',
"url":'http://angularjs.org/',
"type":'Client'
},
{
"id":'2',
"name":'NodeJS',
"comment":'Des appl... | true |
faf4ae0363a76d99b0f62f797b955efe55584591 | JavaScript | ntieman/react-madlibs | /src/MadLib.js | UTF-8 | 9,838 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react';
import { Redirect } from 'react-router-dom';
import { Query } from 'react-apollo';
import gql from 'graphql-tag';
import './Home.css';
import './MadLib.css';
const query = gql`
query MadLib($id: ID!) {
madLib(id: $id) {
id
title
... | true |
ff19acbc6ffca5dd8264bb7a00f430a19540e3ab | JavaScript | z605069038/study | /project/common/js/base/util.js | UTF-8 | 754 | 3.078125 | 3 | [] | no_license | /**
* @description setInterval 修正版,每隔一个 interval 运行一次
* @author 许传宝
* @date "2017-01-10"
*
* @example
* var timeId = acInterval(function() {
* ...
* }, 1000);
*
* clearAcInterval(timeId);
*/
function acInterval(callback, interval) {
var now = +new Date(),
timeIds = [];
t... | true |
ed27ed2ad8a92f6195a3075aae7e26f46787503c | JavaScript | OldJen/CodeWars | /8kyu/Sum_Arrays.js | UTF-8 | 222 | 4.09375 | 4 | [] | no_license | // Sum Numbers
//
//Add each item in array to total and return the total at the end.
//
function sum (numbers) {
"use strict";
let total=0;
numbers.forEach(element => total += element);
return total;
};
| true |
97907b746117dd2bd0673e5c1b61daa9a13c8267 | JavaScript | processpluserp/Process_ESTACION | /js/reportes.js | UTF-8 | 33,087 | 2.5625 | 3 | [] | no_license | var formatNumber = {
separador: ",", // separador para los miles
sepDecimal: '.', // separador para los decimales
formatear:function (num){
num +='';
var splitStr = num.split(',');
var splitLeft = splitStr[0];
var splitRight = splitStr.length > 1 ? this.sepDecimal + splitStr[1] : '';
var regx = /(\d+)(\d{3})/;
... | true |
a151f4cf48d5353948c1d6f25a7008c7a4183c8c | JavaScript | ndao335/WU-Bootcamp | /Module 3/wk2-day1-Homework/app.js | UTF-8 | 3,045 | 2.59375 | 3 | [] | no_license | var MongoClient = require('mongodb').MongoClient;
//statsdb is the database name
var url = "mongodb://localhost:27017/statsdb"
// Connect to the db
MongoClient.connect(url, {
useNewUrlParser: true, useUnifiedTopology: true
}, function (err, db){
// if(err) throw err;
// console.log("Database created!");
... | true |
02cb13c20bb4092875db01a63841018f2447e85f | JavaScript | naseelemak/jithub | /src/views/home/home.component.jsx | UTF-8 | 2,727 | 2.53125 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import styles from "./home.styles";
import { View, Text, TextInput } from "react-native";
import Icon from "@expo/vector-icons/FontAwesome";
// redux imports
import { useDispatch, useSelector } from "react-redux";
import { setGitUser } from "../../redux/gitUser/gitus... | true |
7e29bb93a0d3b77a2e260660e4e50c35bad2bb56 | JavaScript | NERVEUML/Test-runner-webapp | /ARCHIVE/www/js/main.js | UTF-8 | 21,587 | 2.6875 | 3 | [] | no_license | // NOTE: is there a better way to handle the consitent Keys of ( 'runs','configs', 'evals', 'location')
// BRAIN BLAST: if i can export shouldn't I be allowed to import, like configs each day ?
// TODO: EXPORT file for GPS, Evals.
// TODO: Import file for Configs
// TODO: create a Trash bin for chance of recovery in th... | true |
1dcefe484872be44acfb6480d9978254d148dd29 | JavaScript | lemuelcr03/lemuelcr03.github.io | /js/Viajes.js | UTF-8 | 5,087 | 2.53125 | 3 | [] | no_license | $(document).on('click', '#btn_save', function (event) {
event.preventDefault();
//Validar
Swal.fire({
title: '¿Desea Guardar?',
text: "Se Agregará este Viaje a la Solicitud",
type: 'question',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
cancelButto... | true |
f0842d74c36f2feab018101f995991580a37c126 | JavaScript | squarewave21/squarewave-nuxt-portfolio | /dist/common.js | UTF-8 | 896 | 3.140625 | 3 | [
"MIT"
] | permissive | // // ページ表示時にはレイヤーを非表示にするため、bodyから.fadeoutセレクタを取り除く
// $(window).on('load', function () {
// $('body').removeClass('fadeout');
// });
// $('.focus-start').on('inview', function (event, isInView) {
// if (isInView) {
// $(this).addClass('focus-in-expand');
// }
// });
// $('.fade-start').on('inview', function ... | true |
f98254bd23940aa761764b1580213a5aa0a6efb8 | JavaScript | marto4kata/JavascriptFundamentals | /Arrays Advanced - Lab/02-negative-or-positive-numbers.js | UTF-8 | 126 | 2.921875 | 3 | [] | no_license | function solve(arrOfNums) {
return arrOfNums.reduce((arr, num) => num < 0 ? [num, ...arr] : [...arr, num], []).join('\n')
}
| true |
c5960452f81ff400f4c72305e2ee8147a8509cd0 | JavaScript | pantojao/Protected-Notes-Mobile-App | /components/Authentication/Register.js | UTF-8 | 1,950 | 2.578125 | 3 | [] | no_license | import React, { useState} from "react";
import { View } from "react-native";
import { Button, TextInput } from "react-native-paper";
import firebase from "firebase";
import 'firebase/auth'
import styles from "./AuthenticationStyles";
export default function Register({ navigation }) {
const [email, setEmail] = useState... | true |
d77b57a0c565ee874fa5a87ed7cdb5ba3e97261e | JavaScript | jojotmz/JSQuest | /server/src/controllers/user.js | UTF-8 | 2,303 | 2.984375 | 3 | [] | no_license | // Keep index of our players for easy and quicker access
// This index keeps just the info that we need to send to other
// users. We don't want to send the whole sprite to our users.
var ScenePlayers = {
'level1':{},
'level2':{},
'level3':{}
};
function SwitchScene({scene, x, y, user}){
user.scene.removePlaye... | true |
fb65f345029ce744209b9d0e9d7104fa5974ec57 | JavaScript | kervinck/gigatron-rom | /Contrib/PhilThomas/src/audio.js | UTF-8 | 3,687 | 2.765625 | 3 | [
"BSD-2-Clause"
] | permissive | const SAMPLES_PER_SECOND = 44100;
var AudioContext = window.AudioContext || window.webkitAudioContext;
/** Audio output */
export class Audio {
/**
* Create an Audio.
* @param {Gigatron} cpu - The CPU
*/
constructor(cpu) {
this.cpu = cpu;
let context = this.context = new AudioCo... | true |
26fc0abe958683c06e568a00dbb1d23d4c783208 | JavaScript | willrp/willbuyer | /frontend/js/components/util/loadable-error.js | UTF-8 | 1,562 | 2.578125 | 3 | [
"MIT"
] | permissive | //IMPORT EXTERNAL COMPONENTS================================================
import React, { Component } from "react";
import { Message, Icon } from "semantic-ui-react";
//IMPORT INTERNAL FUNCTIONS=================================================
import toastMessage from "lib/toast-message";
//COMPONENT==============... | true |
c36eded8c275e1eb6a8c834692adbad5305dcbd2 | JavaScript | Kevin0920/LC-Repo | /findDuplicate287.js | UTF-8 | 1,007 | 4.03125 | 4 | [] | no_license | var findDuplicate = function(nums) {
if (nums === null || nums.length === 0) return 0;
nums = nums.sort((a, b) => a - b);
let result = []
for (let i = 1; i < nums.length; i++) {
if (nums[i] === nums[i - 1]) {
// return nums[i];
result.push(nums[i])
} else {
... | true |
ceb334f8d6fcfb0a2251db10a9f43081a9c70a0e | JavaScript | akky25/comp-pg | /src/ABS/PracticeA.js | UTF-8 | 298 | 2.859375 | 3 | [] | no_license | function main(i) {
const input = i.trim().split("\n");
const line2 = input[1].split(" ");
const a = parseInt(input[0], 10);
const b = parseInt(line2[0], 10);
const c = parseInt(line2[1], 10);
console.log(a + b + c, input[2]);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
| true |
6f0182736db166fd41a39524279afb6c8de7afce | JavaScript | zhoukekestar/vscode-commands | /src/replace/index.js | UTF-8 | 1,220 | 2.65625 | 3 | [
"MIT"
] | permissive | const vscode = require('vscode');
const OPTIONS = {
EMPTY: ' --- 请选择 --- ',
DAVINCI: '达芬奇代码 2 Cox',
DAVINCI_CSS: '分离达芬奇 Styles 到 Css',
}
exports.execute = function(args) {
// Get current text & fliename
let text = vscode.window.activeTextEditor.document.getText();
const fileName = vscode.window.activeText... | true |
7b33d526bc6e63041a45a6a7719cc70d21342870 | JavaScript | hatchways/team-corn-pops | /server/util.js | UTF-8 | 4,210 | 2.765625 | 3 | [] | no_license | const jwt = require("jsonwebtoken");
const userController = require("./controllers/usersController");
const chefController = require("./controllers/chefsController");
const isArrayOfStrings = (arr) => Array.isArray(arr) && arr.every((ele) => typeof ele === "string");
// function that takes in a request handeler and r... | true |
1d9d7e59fd5d22f9fb3d5d4d91dddc2fcefaba8e | JavaScript | guoyanming150382/company | /模板/js/index.js | UTF-8 | 3,200 | 2.5625 | 3 | [] | no_license | window.onload=function(){
// 导航栏目
// 下拉
var oMenu1=document.getElementById("one-menu");
var oMenu2=document.getElementById("two-menu");
var oMenu3=document.getElementById("three-menu");
var oQiye1=document.getElementById("qiye1");
var oQiye2=document.getElementById("qiye2");
var oQiye3=document.getElement... | true |
4ed06e985b603a725f3f3f860568328625465d6f | JavaScript | chevalvert/tooooools-love-is-hall | /src/components/Wall.js | UTF-8 | 5,736 | 2.90625 | 3 | [
"MIT"
] | permissive | import Store from 'store'
import { Component } from 'utils/jsx'
import Prng from 'utils/prng'
import dedup from 'utils/array-uniq'
import VirtualCell from 'abstractions/VirtualCell'
import Cell from 'components/Cell'
import HallNumber from 'components/HallNumber'
import SYMBOLS from 'controllers/symbols'
export defa... | true |
bb15ff255e66c097951ee35d94ca33bfa4b650ea | JavaScript | Rafail1/garf | /public/javascripts/clock.js | UTF-8 | 1,197 | 3.28125 | 3 | [] | no_license | (function() {
var timeNode = document.querySelector('.clock__time'),
dateNode = document.querySelector('.clock__date');
var month = [
'января',
'февраля',
'марта',
'апреля',
'мая',
'июня',
'июля',
'августа',
'сентября',
'октября',
'ноября',
'декабря'
];
var day = [
... | true |
b3c424b4c1db42b3db0d11804fdc9946f39e4b29 | JavaScript | meryemfelhi/Java | /main.js | UTF-8 | 1,158 | 2.65625 | 3 | [] | no_license | function italic(){ document.getElementById ("para").style.fontStyle="italic"}
function bold(){ document.getElementById ("para").style.fontWeight="bold"}
function sb(){ document.getElementById ("para").style.fontSize="100px"}
function ss(){ document.getElementById ("para").style.fontSize="5px"}
function f(){ documen... | true |
ff4d1445260e4f87d94a244cd3ddeb141cf496de | JavaScript | MichaelAbe/typescript-nn-practice | /public/sandbox.js | UTF-8 | 565 | 3.40625 | 3 | [] | no_license | "use strict";
var char = "Peeley";
var other = "Jonsey";
var names = [char, other, "Midas", "Sloan", "Brutus"];
var mixedArray = [];
var best = {
name: 'Sky',
mythic: 'AR',
glider: 'Ollie'
};
var age = 5;
var killer = false;
console.log(char, other);
var inputs = document.querySelectorAll('input');
console.... | true |
7174e10c5577d223bada1bfe2419a8635747e107 | JavaScript | fruit13ok/trysms | /src/App.js | UTF-8 | 2,629 | 3.265625 | 3 | [] | no_license | import React, { Component } from 'react';
class App extends Component {
// use state to store web form's input phone number and message,
// also keep an array of messaging objects contain two way phone number and message.
state = {
text: {
recipient: '',
textmessage: ''
},
texts: []
}
... | true |
d8dd90fc8a5a68213f8ecbeaf607a7a8194d7ec4 | JavaScript | akhil451/jscalc | /myscripts.js | UTF-8 | 1,370 | 3.265625 | 3 | [] | no_license | windowHeight = $(window).innerHeight();
$("#outside").css("height",windowHeight);
$(document).ready(function(){
var inputs=[];
var totalString;// this string is finally evaluated ;
var operators =["+","*","/","-"];
var num=[0,1,2,3,4,5,6,,7,8,9];
function update(){
totalString=inputs.join("");
$("#print"... | true |
8ec588aa2fef1e40b7f9531933025653eddf7e59 | JavaScript | xixuebin/CorsApi | /snippets/static/js/project/jsPlumb/container.js | UTF-8 | 5,047 | 2.703125 | 3 | [] | no_license | /**
*
* jsPlumb适配器 二次封装jsPlumb的常用方法
* 使用前提:
* 导入jsPlumb插件 导入baseTpe文件
*/
var allBaseType = Object.create(baseType);
/**
* nodeContainer 基于Map保存节点信息 key为node id,value为节点信息
* 提供基本的节点存取方法和一些节点细节信息的读写方法
*
*/
function nodeContainer() {
this.nodes = new Map(); //用于保存流程中的每一个节点信息 暂时放置于此 后期可能还需要考虑放到别的位置维护
... | true |
f1ee43d84f0ac74230efdc1e7b11c0cfba625806 | JavaScript | MatthiasGass/WebGIS | /uebung_01_pc/script.js | UTF-8 | 186 | 2.6875 | 3 | [] | no_license | // test
function myFunction() {
document.getElementById("test").innerHTML = "123";
}
function neu() {
let gj_alt = document.getElementById("Ausgabe2").value;
alert(gj_alt);
}
| true |
3880a9cf0d4832870b7fb723a022f953c00b96b1 | JavaScript | Ianara-cs/-ifpi-ads-algoritmos2021-Ianara-Costa-da-Silva | /Lista05/q08_menor_maior.js | UTF-8 | 717 | 3.671875 | 4 | [] | no_license | const input = require('prompt-sync')()
function main(){
const n = Number(input('Quantidade de elementos: '))
const vetor_a = Array(n)
for(let i = 0; i < n; i++){
vetor_a[i] = Number(input(`Elemento ${i}: `))
}
let posicao_maior = 0
let posicao_menor = 0
fo... | true |
1b546db9d68f0964425e8c260df86eb696062ee5 | JavaScript | nchhaj189/Node-Vue-Express-Assessment | /assessment_backend/helpers/time-parse.js | UTF-8 | 2,322 | 3.015625 | 3 | [] | no_license | function minToMilli(duration) {
duration = parseInt(duration);
return duration * 60000;
}
module.exports = function (calendarEvent, eventList, action) {
if(action === 'update') {
for(var i = 0; i < eventList.length; i++) {
if(eventList[i].id === calendarEvent.id) {
... | true |
b03b11526c38b57d8d7f238caa61cc2ab22a0b1b | JavaScript | kencormican/gitHubAPI-Lessons | /2. Initial Data Retrieval Lesson/assets/js/github-information.js | UTF-8 | 1,398 | 3.21875 | 3 | [] | no_license | function fetchGitHubInformation(event) {
// create username variable to store the typed username in the gh-username <div> element
var username = $("#gh-username").val();
// if username text box is empty push <h2> text into gh-user-data <div>
if (!username) {
$("#gh-user-data").html(`<h2>Please enter a GitH... | true |
e78c3ef1162230ca7869df89045b01f0cd074c30 | JavaScript | Nemzis02/TaskForDen | /pages/index.js | UTF-8 | 2,895 | 2.578125 | 3 | [] | no_license | import { useState } from "react";
import generator from "generate-password";
import Head from "next/head";
import Selector from "../components/Selector/Selector";
import Checkbox from "../components/Checkbox/Checkbox";
import TextInput from "../components/TextInput/TextInput";
import Clipboard from "../components/Clip... | true |
4676327ece4adb50e049b9871d04e25bc0ccd8dc | JavaScript | rishikajain419/assessment | /routes/api/blogs.js | UTF-8 | 3,497 | 2.859375 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
// connecting to service
const blogService = require("../../services/blogService");
/* POST blogs */
/**
* @swagger
* /api/blogs:
* post:
* tags:
* - Posts
* description: Create a new blog
* responses:
* '201':
*... | true |
84e36873261ed1dc22daa613f06a9717f66d52cb | JavaScript | Zharakai/daf_p6 | /game.js | UTF-8 | 5,482 | 2.734375 | 3 | [] | no_license | class Game {
constructor() {
this.boot();
}
boot() {
window.Game = this;
this.players = [
new Player("Iop", corbalame, "./sprites/iop.png", 100, 0, ""),
new Player("Steamer", corbalame, "./sprites/steamer.png", 100, 0, "")
];
this.playerTur... | true |
dc0e0f77baae9b9efede79cf06111085385da8a0 | JavaScript | ehrudxo/javascript | /04.javascript/modules/01_02_start_native.js | UTF-8 | 548 | 3.5625 | 4 | [] | no_license | var message = "Biff: McFLy!!!!";
var back_to_the_future = function(message){
console.log("[In the past]");
console.log("Martin : Mom, Is that you?");
console.log("Mom: Calvin Klein? I Love you!");
console.log("~Father hit the biff~");
console.log("Dr.Brown : Back to the Future!");
return message;
}
console.... | true |
33fe679fca29c293f2c4fbc5e5454da0af8ea6a2 | JavaScript | mohlemeyer/vertxWinston | /jslibs/winston/lib/winston/transports/eb-mail.js | UTF-8 | 4,980 | 2.578125 | 3 | [
"MIT"
] | permissive | /*
* eb-mail.js: Transport sending logging emails via the Vert.x event bus
*
* (C) 2014 Matthias Ohlemeyer
*
* MIT LICENCE
*/
var util = require('jslibs/winston/thirdPartyDeps/nodejs/util/util'),
_ = require('jslibs/winston/thirdPartyDeps/underscore/underscore'),
Transport = require('./transport').Transport,
ve... | true |
4cf2f2ad0d1496c6e66c1b68ea8a5d0a22700860 | JavaScript | Kdeg0040/notes_app | /src/note-list.js | UTF-8 | 265 | 2.703125 | 3 | [] | no_license | (function(exports) {
function NoteList() {
this.all = [];
};
NoteList.prototype.add = function(noteText) {
var newNote = new Note(noteText);
newNote.setId(this.all.length);
this.all.push(newNote)
}
exports.NoteList = NoteList;
})(this);
| true |
b968c24217b4535fa67411e586c8ffa449b98cff | JavaScript | Team-Developers-totti/ShoppingDosBichos | /routes/user.js | UTF-8 | 4,177 | 2.609375 | 3 | [] | no_license | const express = require("express")
const router = express.Router()
const User = require("../models/user")
const jwt = require("../auth/jwt")
const middle = require("../auth/authMiddleware") //middleware
const validator =require('validator');
router.post("/signup",async(req,res)=>{
try {
const verifyUser = ... | true |
b7dccb80ce22f9756553823306e4cb918a0978c7 | JavaScript | martincsy/Mipu | /helpers/utils.js | UTF-8 | 3,195 | 3.296875 | 3 | [] | no_license | /**
* Miscellaneous utility functions. Module export statement at the bottom.
*/
function formatNumber(number) {
var result = "";
if (number < 10) result += "0";
return result + number;
}
// Converts a date/time passed as UTC into yyyy-mm-dd hh:mm:ss format
function formatDate(utc_time, use_seconds) {
... | true |
57a00f07cb46191bf084dc94d7fabeb837408c26 | JavaScript | OlgaMozejko/webdoc | /Loop/JSloop.js | UTF-8 | 704 | 3.359375 | 3 | [] | no_license |
function myFunction() {
let Many = function (howMany) {
let h = document.body.clientHeight;
let w = document.body.clientWidth;
for (let i = 0; i < howMany; i++) {
// create elements on the fly
let newDiv = document.createElement("div");
newDiv.classList.add("flower");
n... | true |
c4146faf35442a2af0880cc0e1789f4d7a508355 | JavaScript | diogoss120/musics-control-with-django | /musics/static/javascript/musics.js | UTF-8 | 1,514 | 3.203125 | 3 | [] | no_license | class Music {
constructor() {
this.events();
}
events() {
let musicas = document.querySelectorAll('.musics');
console.log(musicas.length);
if (musicas.length > 0) {
musicas.forEach(el => {
el.addEventListener('click', () => {
... | true |
533758175c6e392890c1959306e0bef9e152a551 | JavaScript | EunJaePark/React | /누구든지 하는 리액트/실습/contact-app/src/components/PhoneInfo.js | UTF-8 | 4,056 | 3.40625 | 3 | [] | no_license | // 각 전화번호 정보를 보여주는 컴포넌트
import React, { Component, Fragment } from 'react'; // editing 스테이트를 위해 Fragment를 불러옴.
class PhoneInfo extends Component {
state = {
editing: false,
name: '',
phone: '',
}
shouldComponentUpdate(nextProps, nextState) {
// return true; // shouldCompo... | true |
cb3356cc2f5f8b4db088f59ce03b2e42cfa0b42e | JavaScript | DavitHunanyan/Small-Todo-App-Node-JS | /controllers/todoController.js | UTF-8 | 1,472 | 2.59375 | 3 | [] | no_license | var mongoose = require('mongoose');
var bodyParser = require('body-parser');
mongoose.connect('mongodb://test:test@ds135916.mlab.com:35916/todolist');//conect to the DataBase
var todoSchema = new mongoose.Schema({
item:String
});//create a data type
var Todo = mongoose.model('Todo',todoSchema);//craete a model to... | true |
96f6e50d2865119187e3bd468179f9050a05bb0f | JavaScript | jim-conner/ASSIGNMENT-Bear-Watcher | /src/javascripts/river.js | UTF-8 | 1,239 | 2.8125 | 3 | [] | no_license | import printToDom from './printToDom';
const bears = [];
const removedBears = [];
const addBear = (taco) => {
let domString = '';
taco.forEach((card, i) => {
domString += `
<div class="card" style="width: 18rem;">
<div class="card-body">
<img class="card-img-top... | true |
5f887075a6c77bb5f9820d1347b77363d1286b45 | JavaScript | dustinpfister/test_natural | /dist.js | UTF-8 | 316 | 2.5625 | 3 | [] | no_license |
var natural = require('natural'),
term = 'javaScript',
dist = function (b, a) {
a = a || term;
return natural.JaroWinklerDistance(a, b);
};
console.log( dist('javaScript') ); // 1
console.log( dist('java') ); // 0.88
console.log( dist('lightScript') ); // 0.715...
console.log( dist('python') ); // 0
| true |
0779d3aa01cf4aff2157cdd6422c108a7185a73a | JavaScript | hieuhvh1994/my-new-project | /UngDungGood-Cheap-Fast/UngDungGood-Cheap-Fast.js | UTF-8 | 778 | 2.84375 | 3 | [] | no_license | function check(att) {
switch (att) {
case ("good"):
if (document.getElementById("cheap").checked === true && document.getElementById("fast").checked === true) {
document.getElementById("cheap").checked = false
}
break;
case ("cheap"):
... | true |
76c3aa903af5bf414d416263b116c4d21e1ad256 | JavaScript | supriyada/RBootcamp | /cw/01-Lesson-Plans/14-Intro-To-JavaScript/2/Activities/04-Stu_Word_Counter_Objects/Unsolved/index.js | UTF-8 | 574 | 4.0625 | 4 | [] | no_license | function wordCount(myString) {
// Convert string to an array of words
var stringArray = myString.split(" ");
// An object to hold word frequency
freq_words = {}
// Iterate through the array
for (var i = 0; i < stringArray.length; i++) {
var currWord = stringArray[i]
if (currW... | true |
1630036e3fcebaf6bbce6c60a9bd287780c05cd3 | JavaScript | ronghe-peng/blog-template | /src/data/dataHelper.js | UTF-8 | 2,259 | 2.71875 | 3 | [] | no_license | import Data from './blogs.json'
// get all blogs data from database
function fetchBlogs () {
const LS_KEY = 'blogs'
let fromLs = localStorage.getItem(LS_KEY)
if (!fromLs) {
localStorage.setItem(LS_KEY, JSON.stringify(Data.data.blogs))
fromLs = localStorage.getItem(LS_KEY)
}
return JSON.parse(fromLs)
... | true |
699954fb8ebc5ccfc7a7c3347317cd79f3ec39d6 | JavaScript | icerahi1/programming-hero | /milestone_6/module_34_jsTrickyConcepts/true_false.js | UTF-8 | 441 | 4.09375 | 4 | [] | no_license | /*
Falsy:
false
0
empty string
undefined
null
NaN
----------------------------------------
Truthy:
true
any number(positive or negative)
any string including single whitespace,'0','false'
array []
object {}
anything else that is not falsy will be truthy
*/
let x= {}
... | true |
4983559c6cf9e91a6ba5c6b489d9079453eb266d | JavaScript | ULL-ESIT-PL-1617/analizador-usando-peg-erik-jorge-ruben | /main.js | UTF-8 | 472 | 2.65625 | 3 | [] | no_license | var PEG = require("./arithmetics.js");
var util = require('util')
var input = process.argv[2] || "var x, squ; function foo (a, b, c) {var a,b,c; a := 2}; begin x := 1; while x <= 10 do begin call square; ! squ; x := (x + 1) * 2 end ; if x <= 10 then begin call square; ! squ; x := - x + 1 end else begin x := a (b, 2+2... | true |
5f567ab5ac3098f72a1b4130a54c5da436e70fd6 | JavaScript | dzstef/IT255-DZ04 | /slajdovi.js | UTF-8 | 1,354 | 3.046875 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Metoda koja uzima unos korisnika, trazi tu rec u odredjenom tekstu i boji je u crveno
* Metoda takodje menja izgled teksta
*... | true |
9c25e30a6d348f6d21f2f3e35bec1f05b65e4ea1 | JavaScript | Romanope/farma-online-rest-layer | /api-rest-contato/controllers/controllerUsuario.js | UTF-8 | 1,268 | 2.515625 | 3 | [] | no_license | var pool = require('.././db-connect/connect-mysql');
var controllerUsuario = {
inserir: function (usuario, callback) {
if (!usuario) return;
console.log(usuario);
var insert = "insert into `usuario` (`USU_LOGIN`, `USU_SENHA`, `USU_EMAIL`, `USU_DH_CADASTRO`) values (?)";
var params = [usuario.login, usuario.... | true |
4b82b5e9efaf3bd203ed7bc85f92f1c518e54912 | JavaScript | jamesarmenta/sixfold-symmetry | /get-files.js | UTF-8 | 729 | 2.84375 | 3 | [] | no_license | var fs = require('fs');
function getFilesByTypeAsync(path,extension){
return new Promise(
(resolve,reject)=>{
var validFiles = [];
fs.readdir(path, (err, files) => {
if(err) reject(err);
files.forEach(file => {
if(file.indexOf(extension)>0){
validFiles.push(pat... | true |
aeea5aedba67c9541cb286ee1d2c0674f65d090c | JavaScript | dyladan/alexa_drinkmaster | /src/util.js | UTF-8 | 2,151 | 3.125 | 3 | [
"Apache-2.0"
] | permissive | /*
* @Author: Matthew Zygowicz
* @Date: 2016-03-28 13:12:07
* @Last Modified by: Matthew Zygowicz
* @Last Modified time: 2016-03-30 06:17:02
*/
/* jshint node: true */
'use strict';
//*****************************************************************
// Begin utlity function section
//****************************... | true |
db1b43b39b8e623ddaf16f5d8e236f464bae84f3 | JavaScript | Code-Institute-Submissions/LucyJones-BRITbrAIN | /assets/js/sendemail.js | UTF-8 | 721 | 2.734375 | 3 | [] | no_license | // Code taken from EmailJS.com with small amendments
// Template parameters linked to name attributes in index.html
function sendMail(contactForm) {
emailjs
.send("lucyjpjones@gmail.com", "lucy", {
from_name: contactForm.name.value,
from_email: contactForm.email.value,
project_subject: contactF... | true |
e1e72228e5b29a4f9dde3781177babc630b31c72 | JavaScript | vubao2303/ucb-consolelogger | /course-content/10-OOP/activities/22-Ins-Multiple-Classes/order.js | UTF-8 | 278 | 2.75 | 3 | [] | no_license | class Order {
constructor(item) {
this.item = item;
//Order.lastId to define what's known as a static value on a class.
//This also works with constructor functions.
Order.lastId++;
this.id = Order.lastId;
}
}
Order.lastId = 0;
module.exports = Order;
| true |
a1577dfeb2d1a4e82974978278f90e11a51b3e51 | JavaScript | trungdong/ProvToolbox | /modules-js/prov-js-core/bak/target.bak2/js/org/openprovenance/apache/commons/lang/ObjectUtils.js | UTF-8 | 27,346 | 2.890625 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | /* Generated from Java with JSweet 3.0.0 - http://www.jsweet.org */
var org;
(function (org) {
var openprovenance;
(function (openprovenance) {
var apache;
(function (apache) {
var commons;
(function (commons) {
var lang;
(function (lang) {... | true |
1a6b1bd7c4fc3c9fa8a2e2dbcee8649073a35ad9 | JavaScript | AryaneValentim/Exerc-cio-Juro-composto | /_js/javascript.js | UTF-8 | 1,151 | 3.1875 | 3 | [] | no_license | function calcular() {
$(".form-dados").addClass("d-none");
$(".simu").addClass("d-none");
$(".resultado").removeClass("d-none");
var vf, pmt, i, n, nom;
/*
pmt = Number($("#mensalidade").val()); //mensalidade
i = Number($("#taxa").val()); //taxa
n = Number($("#tempo").val()); //t... | true |
41579aa7919a0f70e0a446cc2ce8fc821c9031a4 | JavaScript | llafuente/language | /lib/parser.fn.statement.js | UTF-8 | 4,524 | 2.671875 | 3 | [] | no_license | module.exports = {
read_function_declaration: read_function_declaration,
read_parameters: read_parameters,
read_function_body: read_function_body,
read_return: read_return,
function_options: ["inline"],
parameter_operators: ["clone", "const"],
parameter_default_operators: ["="],
parameter_assertion_ope... | true |
f683437bdb32b01af534f910fee86ca10d313a3f | JavaScript | fernandogutierrez/SoftwareTesting-MochaJs | /tests/qadev06-todoly/test/hooks.js | UTF-8 | 1,031 | 2.609375 | 3 | [] | no_license | //hooks
describe('suite 1.0',function() {
before(function(){
console.log('Before All 1.0');
});
after(function(){
console.log('After All 1.0');
});
beforeEach(function(){
console.log('Before Each 1.0');
});
afterEach(function(){
console.log('After Each 1.0');
... | true |
b40d1f1649b9cba260a8ddf26686f7632b905a7b | JavaScript | SysLegBG/JS_Fundamentals | /Exercise - Arrays/commonEl.js | UTF-8 | 231 | 2.90625 | 3 | [] | no_license | function commonEl(fArr,sArr){
for (const el of fArr) {
if(sArr.includes(el)){
console.log(el);
}
}
}
commonEl(['Hey', 'hello', 2, 4, 'Peter', 'e'],
['Petar', 10, 'hey', 4, 'hello', '2']) | true |
2d5ec1e54fe5cedc275a77fb939b53aadf07fdbe | JavaScript | mkdoc/mkpi | /lib/include.js | UTF-8 | 2,531 | 2.671875 | 3 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | var fs = require('fs')
, path = require('path')
, Node = require('mkast').Node
, Walk = require('mkast/lib/walk')
, INDEX = 'index.md';
/**
* Include one or more markdown files into the AST, processing instructions
* in included files are executed.
*
* ```html
* <? @include intro.md install.md ?>
* ... | true |
bb5965e7a58d61c7f416d61f08b54ac32b45c43b | JavaScript | saichand007/Profile | /src/component/action.js | UTF-8 | 586 | 2.78125 | 3 | [] | no_license | var result=require("./lang.json");
var langs=result.map((data)=>data.name);
console.log("langs=",langs);
export const getLang=function()
{
return {type:"GET_LANG",langs};
}
export const addLang=function(lang)
{
return {type:"ADD_LANG",lang};
}
var rslt=require("./currency.json");
var currencies=rslt.... | true |
220161f4eecd2c02737bfcbe92b8d2cb890579ee | JavaScript | MarcoF1/grassroots | /db/db_config.js | UTF-8 | 4,345 | 2.59375 | 3 | [
"MIT"
] | permissive | const { Pool } = require("pg");
// const sqlite3 = require('sqlite3');
production = true;
// let sqlDb;
// Connect to the db using a pool
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
ssl: production ? { rejectUnauthorized: false } : false,
database: "grassroots",
});
const columnNames = ... | true |
45ffd475654cc2611b4a97f6e57d645de1effd75 | JavaScript | futuresocks/react_leaflet_example | /src/components/MapBox.js | UTF-8 | 987 | 2.53125 | 3 | [] | no_license | import React from 'react'
import { Map, TileLayer } from 'react-leaflet'
import './MapBox.css'
import MarkerView from './MarkerView'
class MapBox extends React.Component{
constructor(props){
super(props);
this.state = {
markers: []
}
this.addMarker = this.addMarker.bind(this)
this.removeMar... | true |
1afb83b38e3a2409aaa25641e18add1a6030a43f | JavaScript | fgsilva93/Edabit_Challenges | /Easy Level/Power Calculator/app.js | UTF-8 | 197 | 2.765625 | 3 | [] | no_license | function circuitPower(voltage, current) {
return voltage * current
}
// testing variables:
console.log(circuitPower(110, 3))
console.log(circuitPower(230, 10))
console.log(circuitPower(480, 20)) | true |
4fff97890c38a6d46f06f2882ce6325f24f18214 | JavaScript | krychaxp/nextjs-google-fonts | /index.js | UTF-8 | 3,272 | 2.625 | 3 | [
"MIT"
] | permissive | const fs = require("fs");
const path = require("path");
const axios = require("axios");
const log = (a) => console.log("> [nextjs-google-fonts] " + a);
const replaceValue =
/(https?:\/\/fonts\.gstatic\.com|https?:\/\/storage\.googleapis\.com)/g;
const fetcher = async (url, prev) => {
const { data } = await axios({... | true |
a676f0140a92f2b4ba324c6aec4e4f013d2d0ac5 | JavaScript | farhad0085/django-money-management | /frontend/src/store/reducers/transactionReducer.js | UTF-8 | 992 | 2.5625 | 3 | [
"MIT"
] | permissive | import * as Types from '../actions/actionTypes'
const initialState = {
loading: false,
transactionCreatedData: {},
transactionCreateErrors: {},
transactions: []
}
function transactionReducer(state = initialState, action) {
switch (action.type) {
case Types.TRANSACTION_CREATED: {
... | true |
8e29976d0f03216e9ce2c8b85bf0542e4f6df436 | JavaScript | nelsonjunior/qfood | /qfood-delivery-react/src/MessageList.jsx | UTF-8 | 373 | 2.609375 | 3 | [] | no_license | import React from 'react'
class MessageList extends React.Component {
render() {
let elements = this.props.messages.map((element, index) => {
let {latitude, longitude} = element;
return (<li key={index}>Latitude: {latitude} - Longitude: {longitude}</li>)
})
return <u... | true |
af72cedbf3271742468d3f6e9e8507df0c54f398 | JavaScript | Jack-Mutsers/battleship_view | /battleship_view/wwwroot/js/CreateField.js | UTF-8 | 10,993 | 2.890625 | 3 | [] | no_license | var id;
var boatsPixel = new Array(5);
var boatCoordinates;
var boats;
function boatPositions() {
for (var i = 1; i < 6; i++) {
var boatId = i;
var horizontalBegin = document.getElementById("boat" + i).offsetLeft;
var horizontalEnd = horizontalBegin + document.getElementById("boat" + i).of... | true |
9e862439db0f10d36fd882085a724f74deb7b23c | JavaScript | BelalHaiss/Evaluate-a-news-article-with-Natural-Language-Processing | /src/client/js/checkURL.js | UTF-8 | 282 | 2.828125 | 3 | [] | no_license | // function is copied from an stackoverflow post
function validateUrl(url) {
const expression =
/[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi;
const regexp = new RegExp(expression);
return regexp.test(url);
}
export { validateUrl };
| true |
55366fda24fa2367ccc2687e45804d182ed89a56 | JavaScript | pushkar0108/datastructures | /graphs/union_find.js | UTF-8 | 1,362 | 4 | 4 | [] | no_license | /*
Disjoint sets -
detect cycle in a graph
*/
"use strict";
class Graph {
constructor(numberOfVertices) {
this.V = numberOfVertices;
this.edges = [];
this.parentArr = [];
for (let i = 0; i < this.V; i++) {
this.parentArr.push(-1);
}
}
addEdge(a, b) {
this.edges.push([a, b]);
}... | true |
80b39d178f393acb6efa0499ff516cadb4d26df3 | JavaScript | bohdanbrn/complete-nodejs-course | /weather-app/app.js | UTF-8 | 1,215 | 2.765625 | 3 | [] | no_license | const yargs = require('yargs');
const mapquest = require('./mapquest/mapquest');
const weather = require('./weather/weather');
const argv = yargs
.options({
a: {
demand: true,
alias: 'address',
describe: 'Address to fetch weather for',
string: true
}
... | true |
d38f8bc00ffa170a8b825bad0bda68c9dcbf32b6 | JavaScript | BryceEvans/db-zoos | /routers/zoo_router.js | UTF-8 | 2,278 | 2.546875 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const knex = require('knex');
const dbConfig = require('../knexfile');
const db = knex(dbConfig.development);
router.use((req, res, next) => {
next();
});
// INSERT INTO zoos (name) VALUES ('Hoogle Zoo');
router.post('/', (req, res) => {
const z... | true |
0406c638ae35761e5556880737eae61ba62b315a | JavaScript | Bringerrr/Vue-Socket-io-Messanger | /helpers/date.js | UTF-8 | 239 | 2.671875 | 3 | [] | no_license | options = {
hour: "numeric",
minute: "numeric",
year: "numeric",
month: "long"
};
exports.dateToString = date => {
if (!date instanceof Date) throw "That's was not a date";
return date.toLocaleDateString("en-US", options);
};
| true |
e57eba150eb40d1728ed4e16691eed012276e096 | JavaScript | oimoralest/AirBnB_clone_v4 | /web_dynamic/static/scripts/1-hbnb.js | UTF-8 | 1,055 | 3.09375 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | $(document).ready(function () {
const amenitiesIds = {};
const amenities = [];
function updateList () {
let text = '';
for (const string of amenities) {
if (text === '') {
text = string;
} else {
text = text + ', ' + string;
}
}
return text;
}
$('.popover inpu... | true |
c5adaeb14d730d33c750a8c34d36406bba5f518a | JavaScript | JonyBu/ong | /Client/src/components/ModalAlert/Modal/example.js | UTF-8 | 1,597 | 2.9375 | 3 | [] | no_license | import ModalAlert from '../../components/ModalAlert'; //Ejemplos de importación
import Modal from '../../components/ModalAlert/Modal';
//Se importa el ModalAlert, para usarlo con botón.
// Recibe todos los props que Modal más textButton que está en default asignado a "alert"
/*
Hay dos botones, el de confirmar y el... | true |
da3010ea15448e3850f2d610054909c4bbfc3729 | JavaScript | aksahu87/node-todo | /playground/hash.js | UTF-8 | 671 | 2.796875 | 3 | [] | no_license | const {SHA256} = require('crypto-js');
const jwt = require('jsonwebtoken');
// var msg = "My name is Alok";
// var hash = SHA256(msg);
// console.log(`Msg: ${msg}`);
// console.log(`Hash: ${hash}`);
// var data = {
// id: 4
// };
// var token = {
// data,
// hash: SHA256(JSON.stringify(data) + 'somesecr... | true |
ed26d86bdaffc0729e1f0c82a859999c031048e7 | JavaScript | bhaskarbs/signaling | /app/scripts/providers/cookie.provider.js | UTF-8 | 1,629 | 2.515625 | 3 | [] | no_license | 'use strict';
angular.module('common.providers',[]);
angular.module('common.providers').provider('CookieService',[ function () {
var _options = {
'Environment':null
};
return {
'setOptions': function (options) {
if (options) {
if (options.hasOwnProperty('Environment')) {
_options.E... | true |