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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
da92ad833afa6d2060057152caa04cdaa0076d90 | JavaScript | john-yuan/jpass | /test/cmd.test.js | UTF-8 | 6,375 | 2.578125 | 3 | [
"MIT"
] | permissive | var jpass = require('../dist/jpass.cmd');
var JPass = jpass.JPass;
var assert = require('assert');
function test(mode, text) {
var j = new JPass();
j.generate(512);
var object = j.serialize();
var details = j.getPublic();
j = null;
var j1 = new JPass();
var j2 = new JPass();
j1.set... | true |
b1e72d9b60461f4b38e180385d06b38df003dc05 | JavaScript | jrloom/react-bubbles | /client/src/components/Login.js | UTF-8 | 1,072 | 2.546875 | 3 | [] | no_license | import React, { useState } from "react";
import axios from "axios";
const Login = props => {
const [user, setUser] = useState({
username: "",
password: ""
});
const handleChange = e => {
setUser({
...user,
[e.target.name]: e.target.value
});
};
const handleSubmit = e => {
e.... | true |
e16550b170811085b720fe66d6b9a5b132bae435 | JavaScript | stipic1/The-Tech-Academy-Basic-JavaScript-Projects | /Basic_JS_8.js | UTF-8 | 1,468 | 3.5625 | 4 | [] | no_license | function fullSentence() {
var part1 = "Hello there, ";
var part2 = "I am four ";
var part3 = "seperate strings ";
var part4 = "concatenated together!";
var wholeSentence = part1.concat(part2, part3, part4);
document.getElementById("concatenate").innerHTML = wholeSentence;
}
function sliceMetho... | true |
bacacf8911d7727c1194b683ea18145a498beae2 | JavaScript | wer-com/redux-todo | /src/components/todoView.js | UTF-8 | 1,108 | 2.671875 | 3 | [] | no_license | import React,{useEffect} from 'react';
import {useSelector} from "react-redux";
import {deleteTodo,getData,completedTodo} from "../actions";
import {useDispatch} from "react-redux";
const TodoView = () =>{
const dispatch = useDispatch();
const todoList = useSelector(state=>state)
.map(({title,descript... | true |
92fdd4bcaf6b90ac862b7137f956811407bad853 | JavaScript | zz632893783/canvasShape | /src/lib/dolphin.js | UTF-8 | 18,506 | 2.78125 | 3 | [] | no_license | class Dolphin {
constructor (x, y, size, zIndex) {
this.type = 'dolphin'
this.x = x
this.y = y
this.size = size
this.zIndex = zIndex
this.offsetX = this.offsetY = 0
this.scale = this.size / 2000
this.pointMap = {
A: 0,
B: 1,
... | true |
ddaed24ae8359c64dc05cb7a705be8c7b1c8011e | JavaScript | ShirlyNiego/IsraRate-ML-Service | /ml-server/ml-server.js | UTF-8 | 3,327 | 3.359375 | 3 | [] | no_license | // Input data should look like:
// {
// tweets: [
// {
// id: "asdasd",
// text: "i love israel"
// },
// {
// id: "asdcascasv",
// text: "bomb israel"
// }
// ]
// }
// Output data should look like:
// {
// tweets: [
// {
// id: "asdasd",
// tag: "1.0"
// ... | true |
8c1d3ae5596e2da76e77305fd0729b5a622d9162 | JavaScript | henrikeze/avanade-YourBank | /back-end/app.js | UTF-8 | 1,743 | 2.734375 | 3 | [] | no_license | const express = require('express');
const app = express();
const Cliente = require('./cliente/cliente')
const ClienteController = require('./cliente/clienteController');
const Mongoose = require('mongoose');
Mongoose.connect('mongodb://localhost:27017/yourbank', { useNewUrlParser: true });
const db = Mongoose.connectio... | true |
0bcf492ae98ef3d4a7b4d5565e9789f14edf1dd5 | JavaScript | minghao912/Octopus | /scripts/idProcess.js | UTF-8 | 1,005 | 3.046875 | 3 | [] | no_license | const form = document.querySelector('form');
//Listen for form submission
form.addEventListener('submit', e => {
e.preventDefault();
//Gather files and begin FormData
const studentID = document.getElementById("studentIDForm").studentID.value;
loadJSON("data/id.json", e => {
const ids = JSON.p... | true |
b04ea8750d76a35d629bd29bf3a09896abb35ad5 | JavaScript | Marshysaurus/ldaw-todo-react | /ldaw-react-todo/src/components/todo-list-component/TodoList.js | UTF-8 | 1,178 | 2.625 | 3 | [] | no_license | import React from "react";
import Todo from "../todo-component/Todo";
class TodoList extends React.Component {
constructor(props) {
super(props);
this.state = {
isLoaded: false,
todos: [],
};
}
componentDidMount() {
fetch("http://localhost:4000/tasks", {
method: "GET",
})
... | true |
56d17f104586659883c006462eb10718ff1d6929 | JavaScript | ShahanaPB/Story-Strap | /src/routes/addbookRoutes.js | UTF-8 | 1,640 | 2.53125 | 3 | [] | no_license | // const express=require('express');
// const addbookRouter=express.Router();
// function router5(nav){
// addbookRouter.get('/',function(req,res){
// res.render("addbook",
// {
// nav,title:'Library'
// });
// });
// return addbookRouter;
// }
// module.exports=router5;
const express=re... | true |
ca5f5a6bc100a04df74c7513f70b0c8404b142d5 | JavaScript | tbreuss/html-boilerplate | /static/js/main.js | UTF-8 | 1,455 | 2.5625 | 3 | [
"MIT"
] | permissive | (function (window, document) {
var menu = document.getElementById('menu'),
rollback,
WINDOW_CHANGE_EVENT = ('onorientationchange' in window) ? 'orientationchange' : 'resize';
function toggleHorizontal() {
menu.classList.remove('closing');
[].forEach.call(
document.ge... | true |
dbb337b9462b8c4ea5be8d716768478c0a8aa67d | JavaScript | pktherock/Javasctipt-Basic-Functions | /calculateWeight/app.js | UTF-8 | 1,975 | 4.375 | 4 | [] | no_license | // Write your function here:
// const weightOnMercury = earthWeight * 0.378;
// const weightOnVenus = earthWeight * 0.907;
// const weightOnMars = earthWeight * 0.377;
// const weightOnJupiter = earthWeight * 2.36;
// const weightOnSaturn = earthWeight * 0.916;
const calculateWeight = (earthWeight, planet) => {
if... | true |
2e9e2fee86063b16a603efd92f426e5297820be4 | JavaScript | TabLand/dine_me | /dine.js | UTF-8 | 640 | 2.8125 | 3 | [] | no_license | enable_animation = true;
function proceed_with_sound(){
document.getElementById("audio").play();
}
function proceed_without_sound(){
document.getElementById("audio").pause();
}
function setup(){
text_div = document.getElementById("text");
animate_mask(text_div);
}
function animate_mask(text_div){
setInt... | true |
4a0b8f27544d1eff3c6bb0905c380de249ffa118 | JavaScript | zickmho/gomycut | /resources/assets/js/booking.js | UTF-8 | 3,064 | 3 | 3 | [
"MIT"
] | permissive | /**
* Created by RJG on 2018-01-24.
*/
function ServiceSelect(elem) {
var service_type = elem.getAttribute('service');
var value = elem.checked;
if (value == true) {
addBooking(service_type);
} else {
removeBooking(service_type);
}
$('.checkbox')[service_type - 1].setAttribute... | true |
f4daadf744d17ac6cde71a555445c830a1955b47 | JavaScript | mujtaba-basheer/strives-server | /controller/user.js | UTF-8 | 4,949 | 2.5625 | 3 | [] | no_license | const { ObjectID } = require("mongodb");
const asyncHandler = require("express-async-handler");
const AppError = require("../utils/appError");
/* ----------- Details ----------- */
// get user details
exports.get = asyncHandler(async (req, res, next, db) => {
try {
// fetching user details
const [user] = aw... | true |
02abff3c08eb3c0eb4e62edd0a9f846d3a8537be | JavaScript | deepexi/egg-authorization | /lib/utils.js | UTF-8 | 688 | 2.515625 | 3 | [
"MIT"
] | permissive | /**
* Created by Jakcy On 2019-08-21
*/
'use strict';
exports.acceptsResult = function(ctx, options) {
if (options.returnType) {
switch (options.returnType) {
case 'json': {
options.json(ctx);
break;
}
case 'html': {
options.html(ctx);
break;
}
de... | true |
408e6f031a1ef180c42ea2cc9c2781bd59f09a18 | JavaScript | smmurdock/am-javascript-bootcamp | /3_objects/7_const.js | UTF-8 | 353 | 3.953125 | 4 | [] | no_license | const isRaining = true; // can't reassign const variable values
// let isRaining = true;
// isRaining = false;
const person = {
age: 30
};
// person = {}; // will fail because the object itself can't be reassigned
person.age = 31; // is valid because we're just altering a property inside of the object
console.log(... | true |
6ebfc7ee1b89668169e6bb4bcf34a0970fe5c9bd | JavaScript | Adalab/modulo-2-evaluacion-intermedia-CrisBIB- | /js/main.js | UTF-8 | 2,180 | 3.8125 | 4 | [] | no_license | 'use strict';
//Bring HTML elements
const inputElement = document.querySelector('.js-input');
const buttonElement = document.querySelector('.js-button');
const cluesElement = document.querySelector('.js-clues');
const messageElement = document.querySelector('.js-message');
const counterElement = document.queryS... | true |
6c7fec4e73c87ace021a015686dd34d81d872440 | JavaScript | Marcandy/toy-problems | /leetcode-js/leetMarch21.js | UTF-8 | 2,884 | 3.71875 | 4 | [] | no_license | /* Review
#print("Hello")
# Given two integers representing the numerator and denominator of a fraction, return the fraction
#in string format.
# If the fractional part is repeating, enclose the repeating part in parentheses.
# Example 1:
# Input: numerator = 1, denominator = 2
# Output: "0.5"
# Exampl... | true |
d6ffb7eed14e7dff1b1b07cf39a3507bf1b468b0 | JavaScript | emran899dev/problem-solving-assignment-programming-hero | /tinyFriend.js | UTF-8 | 506 | 3.671875 | 4 | [] | no_license |
const friends = ['emran khan','emon','naser','shek']
let min = friends[0]
for (let i = 0; i < friends.length; i++){
let element = friends[i];
if (element.length < min.length) {
min = element
}
}
console.log(' Lower value ', min);
// console.log(
// arr.reduce(function(a, b) {
// r... | true |
72409930b532ebf85ce065e6bad89123ab96a078 | JavaScript | obengwilliam/exp-joi-validator | /get-object-to-validate.test.js | UTF-8 | 1,871 | 2.59375 | 3 | [] | no_license | 'use strict'
const { expect } = require('chai')
const getDetailsToValidate = require('./get-object-to-validate')
describe('getDetailsToValidate()', () => {
let req
before(() => {
req = {
query: { id: 243, email: 'obeng@gmail.com' },
params: { id: 456 },
headers: { 'X-RequestId': 23 },
... | true |
897411a818c92730d59cbd49ae66004a74bbde36 | JavaScript | chenyong88/SpringBootTest | /ranzhi/app/cash/trade/ext/js/browse/ameba.js | UTF-8 | 1,675 | 2.703125 | 3 | [] | no_license | $(function()
{
$(document).on('change', '[name*=money]', function()
{
$(this).parents('tr').find('[name*=rate]').val(Math.round($(this).val() / v.money * 10000) / 100);
computeTotal();
});
$(document).on('change', '[name*=rate]', function()
{
$(this).parents('tr').find('[nam... | true |
cfad0c5e460a8c8e2141488ce275e9f79db2b6b6 | JavaScript | langens-jonathan/rdfa-link-scraper | /scraper/marawa/node-walker.js | UTF-8 | 4,501 | 2.65625 | 3 | [
"MIT"
] | permissive | // import RichNode from './rich-node';
const RichNode = require('./rich-node');
// import {get, set} from './ember-object-mock';
function get( object, key ){
return object[key];
}
function set( object, key, value ){
object[key] = value;
}
function warn( string ) {
console.log( string );
};
if( ! Node ) {... | true |
1c496143c6b1c17da2b5894d03d797273f1c67e5 | JavaScript | DVOBS/my-workspace | /public/works/QCharts/src/index.js | UTF-8 | 1,973 | 2.515625 | 3 | [] | no_license | define(
['./engine/get3DEngine', './sketch/sketchFactory', './tool/util'],
function(get3DEngine, sketchFactory, util) {
var defaultOption = {};
function QCharts(element, option) {
var self = this;
this.element = element;
this.option = util.clone(defaultOption);
util.merge(this.option, option, true);
... | true |
01486be8674aeea765a716e438348d3022bb5865 | JavaScript | yoonhee-cho/MEAL-P | /client/components/AddMenuForm.js | UTF-8 | 1,662 | 2.640625 | 3 | [
"MIT"
] | permissive | import React from 'react'
class AddMenuForm extends React.Component {
constructor(props) {
super(props)
this.state = {
name: '',
category: ''
}
this.handleChange = this.handleChange.bind(this)
this.handleSubmit = this.handleSubmit.bind(this)
}
handleChange = event => {
this.s... | true |
2f7713850eebaf1dfeb9ef39552fdad903a11d33 | JavaScript | chelflan/midi-javascript | /midi.js | UTF-8 | 3,548 | 2.609375 | 3 | [] | no_license | MIDI.init = function() {
var context = null;
var instrument = null;
var noteList = [];
if (typeof(MIDI) === "undefined") window.MIDI = {};
MIDI.pianoKeyOffset = 21;
MIDI.soundBuffer = {};
MIDI.instruments = [];
// note conversions
MIDI.keyToNote = {}; // C8 == 108
MIDI.noteToKey = {}; // 108 == C8... | true |
ed352fca00472dea04406f66a95de78707ef5e2d | JavaScript | Pleurosigma/MegaDrop | /brush/Baddie.js | UTF-8 | 368 | 2.609375 | 3 | [] | no_license | /*
Baddie by Logan Wilkerson
*/
(function(window){
/**
Used for bad guys
*/
var Baddie = function(){
this.initialize();
}
Baddie.prototype = new Actor();
// Public Properties:
Baddie.prototype.type = 'baddie';
Baddie.prototype.Actor_initialize = Baddie.prototype.initialize;
Baddie.prototype.initiali... | true |
425b7df99395a50e21f0e0cb075bf0cd45d36107 | JavaScript | Clement-L44/AjeunProjectWeb- | /src/components/Admin/DashBoard/AdminAccueil.js | UTF-8 | 2,425 | 2.5625 | 3 | [] | no_license | import React from 'react'
import Card from "@material-ui/core/Card";
import CardContent from "@material-ui/core/CardContent";
class AdminAccueil extends React.Component {
constructor(props){
super(props);
this.state = {
articles: null,
LastArticles: null,
load... | true |
9165dad80aaa6fa59716dff4a8ac6b6f35ad3c36 | JavaScript | patrickrgrady81/Codesignal | /1. firstDuplicate.js | UTF-8 | 176 | 3.0625 | 3 | [] | no_license | function firstDuplicate(a) {
let st = new Set();
for (let i = 0; i < a.length; i++){
if (st.has(a[i])) return a[i];
st.add(a[i]);
}
return -1;
} | true |
59cee9e930bcdc0703f3a69ea2d757674a456a75 | JavaScript | Moomyd/js-exercise | /ballon.js | UTF-8 | 665 | 3.15625 | 3 | [] | no_license | <!doctype html>
<p>🎈</p>
<script>
let p=document.querySelector("p");
let size=30;
function setSize(newSize) {
size = newSize;
p.style.fontSize = size + "px";
}
function handle(event) {
if(event.key=="ArrowUp"){
if(size>50){
p.textContent="💥";
document.bo... | true |
12eb804987598f0f485745d9385d2e1fb44295d2 | JavaScript | amy-r/simon | /src/Colors.js | UTF-8 | 1,594 | 2.65625 | 3 | [] | no_license | import React, { Component } from "react";
import "./Colors.css"
export default class Colors extends Component {
constructor() {
super();
this.state = {
clicked: []
}
}
renderColorPattern = () => {
return (
<div>
<h1> Watch and Learn </h1>
<div className={`block blue ${this.isActive("blue")}`}... | true |
619698c0223a001d484eb7fb72e04461d21f619d | JavaScript | kazu634/newspaper | /kahoku.js | UTF-8 | 1,844 | 2.984375 | 3 | [] | no_license | const puppeteer = require('puppeteer');
const fs = require('fs');
// コマンドライン引数から対象URLを取得する
if (process.argv.length != 3) {
console.log("対象URLをコマンドライン引数に指定してください");
process.exit(1);
}
const URL = process.argv[2];
// ファイル名の生成
const regexp = /([0-9_]+)\./g;
let match;
match = regexp.exec(URL);
const ARTICLEID = mat... | true |
74f7cab8072809f96e6af4e46862d9eb33e9dac4 | JavaScript | pvselvan/498p1 | /imports/ui/word.js | UTF-8 | 746 | 2.59375 | 3 | [] | no_license | import { Template } from 'meteor/templating';
import { Words } from '../api/words.js';
import './word.html';
//manipulate word elements after it is rendered
Template.word.rendered = function(){
var element = $(".text");
if(this.data.isBold) {
element.addClass("bold");
}
if(this.data.isItalic) {
element.a... | true |
f8602d2c41a055fecc8b6b0416db4b5d0e9774e9 | JavaScript | lucasbalbino/indicadores | /app/views/suporte/evolucao/suporte-evolucao-numeros.js | UTF-8 | 1,770 | 2.515625 | 3 | [
"MIT"
] | permissive | (function () {
'use strict';
app.controller('SupEvolucaoNumerosCtrl', SupEvolucaoNumerosCtrl);
/** @ngInject */
function SupEvolucaoNumerosCtrl($scope, SuporteEvolucaoService) {
$scope.qtdAguardandoAtendimento = 0;
$scope.qtdAtrasados = 0;
$scope.qtdEmAtendimento = 0;
$... | true |
8f5eb5183754928bc7a107e22bcdf92298b81658 | JavaScript | vibhorsxn/unlu-project | /src/App.js | UTF-8 | 2,943 | 3 | 3 | [] | no_license | import React,{ useState,useEffect }from 'react';
import './post.css';
import Posts from "./components/Posts";
import Pagination from "./components/Pagination";
import Search from "./components/Search";
function App(){
const [data,setData]= useState([]);
const [error,setError]=useState(null);
const [loading,setLoadi... | true |
e2038d70986514f5fa8f426f9b07548b6881e113 | JavaScript | rummsi/ministra | /portal/tools/stb-proxy/wspool.js | UTF-8 | 2,649 | 3.109375 | 3 | [] | no_license | /**
* WebSocket pool
* wraps all the work with ws instances
* @author Stanislav Kalashnik <sk@infomir.eu>
*/
// named WebSocket list
var pool = {};
// exports the wrapper object
module.exports = {
/**
* New WebSocket creation
* @param {string} name unique identifier for session
* @param {Object} socket we... | true |
3c81ea23856cd79ae535ae872b978ccd0cb6e42a | JavaScript | adrianowarmling/Games | /public/js/ajax.js | UTF-8 | 16,484 | 2.859375 | 3 | [
"MIT"
] | permissive | window.addEventListener("load", atualizarTabelaGames);
window.addEventListener("load", atualizarTabelaPlataforma);
window.addEventListener("load", atualizarTabelaGeneros);
window.addEventListener("load", atualizarTabelaDesenvolvedora);
// ------------------------------------------ Games ------------------------------... | true |
f428c921fb11a8781b02b2e443e48f990033dca3 | JavaScript | ABoutCoDing/Learning-Javascript_ABCD | /CH6.함수/6.5this키워드.js | UTF-8 | 1,407 | 4.59375 | 5 | [] | no_license | // // 함수 바디 안에는 특별한 읽기 전용 값인 this가 있다.
// const o = {
// name: 'Wallace',
// speak() {return `My name is ${this.name}`},
// }
// o.speak();
// const speak = o.speak;
// speak === o.speak; // true
// speak(); // "My name is undefined!"
// // 함수가 어디에 속하는지 알 수 없으므로 this는 undefined에 묶인다.
... | true |
5d172159fe60cb73cfcd47ec927dd96726a06919 | JavaScript | TheChanRProject/SannaAnnaTutoring | /mathematics/sanna/algebra/js/fifteen.js | UTF-8 | 494 | 4.125 | 4 | [] | no_license | function func1(x) {
theFunc = 1 - Math.pow(x,2)
console.log(theFunc);
}
function func2(x) {
theFunc = Math.pow(Math.E, -x)
console.log(theFunc);
}
answerArray1 = [func1(0.2), func1(0.4), func1(0.5), func1(0.8), func1(1), func1(1.2), func1(1.4), func1(1.5), func1(1.8), func1(2), func1(2.2), func1(2.4), func1(... | true |
31b6e2e03fd384b18225036261e2cbe48b74f0b4 | JavaScript | tmpsame/bot-express | /typedef/global.js | UTF-8 | 609 | 2.59375 | 3 | [
"MIT"
] | permissive | /**
Object which contains context information.
@typedef {Object} context
@prop {Array.<Object>} to_confirm - Array of parameters to confirm.
@prop {Sting} confirming - Parameter name which Bot is now confirming.
@prop {Object} confirmed - Object which contains confirmed value of the parameters as properties. If you wan... | true |
df46084349c4676be2b683cccd9a40db5a11c1e9 | JavaScript | trmbeck/FIU-N-20-4-21-1 | /expresswebserver/app.js | UTF-8 | 1,191 | 2.609375 | 3 | [] | no_license | const { response } = require('express');
let express = require('express');
let app = express();
let formidable = require('formidable');
app.use(express.static(__dirname + "/public"));
app.post('/PostHello',function(request,response){
let form = new formidable.IncomingForm();
form.parse(request, function (err,... | true |
d5772fd89e1f3df59c352cd04ec83d3454ae50f6 | JavaScript | wubaibai/chrome-extension-beibeijapan | /js/plugin.js | UTF-8 | 524 | 2.671875 | 3 | [
"MIT"
] | permissive | getCurrentTabUrl(function(url) {
console.log(url);
var yid = youtubeParser(url);
console.log(yid);
$('[name="vid"]').val(yid);
});
function getCurrentTabUrl(callback) {
console.log('getCurrentTabUrl');
chrome.tabs.getSelected(null, function(tab){
callback(tab.url);
});
}
function youtubeParser(urlStr) {
c... | true |
26147c3478fb0e0e7d820402e7b85a48e26d11dd | JavaScript | msstry/case | /hq/js/allTools.js | UTF-8 | 18,164 | 3.25 | 3 | [] | no_license | // 1 功能:冒泡排序(从小到大排序),
// 参数:数组,
// 返回值:数组
function maoPao() {
for (var i = 0; i < arr.length - 1; i++) {
for (var j = 0; j < arr.length - 1 - i; j++) {
if (arr[j] > arr[j + 1]) {
var temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = arr[j];
}
}
}
return arr;
}
// 2 功能:数组去重,
// 参数:数组,
// 返回值:无重... | true |
656ca96b304c99405053f301559a2b7028980da5 | JavaScript | dploc96/product-page.github.io | /main.js | UTF-8 | 749 | 3.234375 | 3 | [] | no_license | var slideIndex = 1;
const showSlider = (n) => {
let i;
const slider = document.getElementsByClassName('slider__item');
const dots = document.getElementsByClassName('slider__dot');
if (n > slider.length) {
slideIndex = 1;
}
if (n < 1) {
slideIndex = slider.length;
}
for (i = 0; i < s... | true |
360887796976b250eb2f33cb8566148d88c4b9d7 | JavaScript | rrichardsonv/cosmic-shapes | /src/lib/Animation.js | UTF-8 | 1,343 | 2.640625 | 3 | [] | no_license | import Goo from './components/Goo';
import { prepareEcosystem } from './utilities/geometryHelpers';
const getDefaultGooProps = fillColor => ({
qty: 25,
maxW: 25,
minW: 10,
maxL: 30,
minL: 18,
maxSpeed: 0,
minSpeed: 0.5,
sample: [{ x: 20, y: 10 }],
fillColor,
});
const DEFAULT_CENTER_COORDS = { x: 24... | true |
c54ca72bc023a0bff329e4c3f985c77d1dad87cd | JavaScript | JoeGurria/CsvToJsonJoeGurriaCelimendiz | /csvToJson.js | UTF-8 | 1,260 | 3.296875 | 3 | [] | no_license | /** csv file
a,b,c
1,2,3
4,5,6
*/
const csvFilePath='customer-data.xls'
const csv=require('csvtojson')
var os = require("os");
var obj = [];
var i=0;
var fs = require('fs');
csv()
.fromFile(csvFilePath)
.on('json',(jsonObj)=>{
obj.push( jsonObj );
//console.log("obj.length= " + obj.length)
})
.on('done',(err... | true |
a7e9ee87f9d24bb9e3a3bfbb4d79b871eb781312 | JavaScript | alexpriceprogram/login | /src/operations/index.js | UTF-8 | 1,248 | 2.59375 | 3 | [] | no_license | import {updateUserName, updatePasswordConfirmation, updateUserPassword, updateUserEmail, loginUser} from '../actions/index';
import axiosClient from '../axiosClient'
export function updateUsername(event) {
return function(dispatch) {
dispatch(updateUserName(event.target.value))
}
}
export function updateUserpasswo... | true |
5d84e5186b2567fadd43d1d0a34cf24fe04cc150 | JavaScript | fenixfer/Vuejs | /main.js | UTF-8 | 1,803 | 3.125 | 3 | [] | no_license | // EL Vue que se ve en la siguiente linea viene del CDN declarado en index.html en el script
const app = Vue.createApp({
data(){
return {
titulo: 'El Banco de Fer con Vue.js',
cantidad: 1000,
enlace: 'https://youtube.com/blueeweb',
estado: true,
se... | true |
fdb5813e3a94dc09058da3a14e90b0b950c6bb21 | JavaScript | michelrsouza/Estudoswev | /ARRAY/filter1.js | UTF-8 | 620 | 3.578125 | 4 | [] | no_license | const produtos=[ {nome:"notebook",preco:2500, fragil:true },
{nome:"pad pro", preco : 1500,fragil:true},
{ nome:"copo de vidro", preco:15.60, fragil: true},
{nome:"copo de plastico", preco:18.90, fragil:false}
]
console.log(produtos.filter(function(p){
return p.preco> 1000// false não tem nada, true return todo ar... | true |
76dedd603478be14c27a2e32e177be8630e611fe | JavaScript | lsrfocus/website | /src/utils/object-utils.js | UTF-8 | 383 | 2.71875 | 3 | [
"MIT"
] | permissive | // @flow
import * as _ from 'lodash';
/**
* Deeply map the keys of an object by applying `fn` (depth-first iteration).
* @see https://github.com/lodash/lodash/issues/1244#issuecomment-271850316
*/
export const mapKeysDeep = (object: {}, fn: Function): {} => (
_.mapValues(
_.mapKeys(object, fn),
(value) =... | true |
c599d4de0511fc990cd0491b3cc871058fd9f771 | JavaScript | eazy-g/DataFizz | /AllMyBooksArePacked/server/BookScraper.js | UTF-8 | 3,214 | 3.265625 | 3 | [] | no_license | /**
* I made a module containing the scraping methods with a public API, in case we
* had sensitive information we wanted to hide inside of this function. It
* abstracts away the implementation details.
* It is an immediately invoked function so that we can have the api
* BookScraper is like a class, in that it gives ... | true |
22b010f4d03122ac6a9b39360144b3f337920313 | JavaScript | giovanaragozzino/atividade-microssericos | /lojas/scr/index.js | UTF-8 | 641 | 2.625 | 3 | [
"MIT"
] | permissive | const express = require('express');
const app = express();
app.use(express.json());
const axios = require("axios");
const lojas = {};
contador = 0;
app.get('/lojas', (req, res) => {
res.send(lembretes);
});
app.put('/lojas', async(req, res) => {
contador++;
const {
texto
} = req.body;
lojas... | true |
e2f3671d424a0864a84321eceea9d5d87f428dee | JavaScript | Rasim-Deniz/hyf-homework | /javascript/javascript1/week1/goodboy-oldboy.js | UTF-8 | 690 | 4.21875 | 4 | [] | no_license | // Goodboy-Oldboy (A dog age calculator)
/* The same friend (who by the way loves dogs) asks how old his dog will be in 2045.
Hmm you think, lets make this into a product as well!
Dogs age can either be measured in dog years or in human years, this we want to take into consideration! */
const dogYearOfBirth = 2021;... | true |
a332adcd9f0957dc3be31502e6eb96014914f320 | JavaScript | wmyers/react-router | /modules/__tests__/MemoryHistory-test.js | UTF-8 | 2,247 | 2.671875 | 3 | [
"MIT"
] | permissive | import expect from 'expect';
import describeHistory from './describeHistory';
import MemoryHistory from '../MemoryHistory';
describe('MemoryHistory', function () {
describeHistory(new MemoryHistory('/'));
var history;
beforeEach(function () {
history = new MemoryHistory('/');
});
describe('when first c... | true |
7504445c0de27e83822cebc814bfacb5a8aceb1e | JavaScript | Keehada/twitch_leaderboard | /src/components/Streams.js | UTF-8 | 1,669 | 2.703125 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
import api from '../api.js';
/* This component shows the top 20 streams on Twitch */
function Streams() {
const [ streams, setStreams ] = useState([]);
let counter = 1;
useEffect(() => {
const fetchData = async () => {... | true |
19bdb71c5a26b9c445dc4125887b8037ae135ac8 | JavaScript | WangZhekun/JSTheDefinitiveGuideDemo | /chapter6/6.1 inherit.js | UTF-8 | 375 | 2.984375 | 3 | [] | no_license | /**
* Created by Administrator on 2016/3/31.
* 返回一个继承自原型对象p的属性的对象
*/
function inherit(p) {
if(p == null) throw TypeError();
if(Object.create) return Object.create(p);
var ptype = typeof p;
if(ptype !== "object" || ptype !== "function") throw TypeError();
function f() {};
f.prototype = p;
... | true |
e6ec313cd52363021d8f07469239fd0dd7e1aad3 | JavaScript | matthope1/gifsync | /gifsync/static/js/updateFileChooser.js | UTF-8 | 344 | 2.71875 | 3 | [
"MIT"
] | permissive | $(document).on('change', 'input[type="file"]', function (event) {
var filename = $(this).val();
if (filename == undefined || filename == "") {
$(this).next('.custom-file-label').html('Choose File');
} else {
$(this).next('.custom-file-label').html(event.target.files[0].n... | true |
959d2e5dee3fdbdf7f5001efd99229850d8b18fc | JavaScript | arundasps3/dev1001 | /index.js | UTF-8 | 2,493 | 2.9375 | 3 | [] | no_license | const sqlite3 = require("sqlite3").verbose();
const db = new sqlite3.Database(":memory:");
db.serialize(function(){
db.run("CREATE TABLE Classroom (Room_number NUMBER, Building TEXT, Capacity NUMBER)");
db.run("INSERT INTO Classroom VALUES(101, 'Packard', 500)");
db.run("INSERT INTO Classroom VALUES(514,... | true |
6e807b8d0bc9ae9795a6ca6293adad68ad043b04 | JavaScript | robertbolstad/JavaScript_2_Resit | /js/components/cart.js | UTF-8 | 1,821 | 3.234375 | 3 | [] | no_license | import { retrieveFromStorage} from "../utils/localStorage.js";
// This function takes each product saved to local storage and creates a list of products in the cart section.
export function createList(element) {
const products = retrieveFromStorage("products");
element.innerHTML = "";
products.forEach(p... | true |
b55282f35559083f5ba6ed403ba28dfba36d1f06 | JavaScript | ryankelso/minesweeper | /src/board.js | UTF-8 | 3,758 | 3.765625 | 4 | [] | no_license | export class Board {
constructor(numberOfRows, numberOfColumns, numberOfBombs) {
this._numberOfBombs = numberOfBombs;
this._numberOfTiles = numberOfRows * numberOfColumns;
this._playerBoard = Board.generatePlayerBoard(numberOfRows, numberOfColumns);
this._bombBoard = Board.generateBombBoard(numberOfRo... | true |
f68a9502e51c13c72b15f6c4d7bbcbe8ac7f21f3 | JavaScript | silipi/newsletter-serverless | /pages/index.js | UTF-8 | 1,241 | 2.78125 | 3 | [] | no_license | import { useState } from "react";
import axios from "axios";
import s from "../styles/index.module.css";
export default function Home() {
const [email, setEmail] = useState("");
const [apiResponse, setApiResponse] = useState("");
function handleSubmitEmail() {
axios.post("/api/register-email", { email }).t... | true |
323bfdaed79a8433c7aeeed5faf1f33eae6a4b3d | JavaScript | SilvesterLipjanec/LAMAD-race-tracker | /js/competitorsHandler.js | UTF-8 | 3,158 | 2.8125 | 3 | [] | no_license |
const TRAJECTORIES_DIR = './trajectories/';
const COMP_ICON_DIR = './images/competitors/';
const NUM_COMPETITORS = 2;
var competitorsRoutes = [];
var time = 0;
var simulationPaused = false;
function initMarker(compNumber){
var iconUrl = COMP_ICON_DIR+'c'+compNumber+'.png';
var icon={
url: iconUrl,
... | true |
e0b8d8bfc8df7f5acb67d0adfad78ab1d88d0624 | JavaScript | cacheflowe/haxademic.js | /src/json-poller.es6.js | UTF-8 | 969 | 2.84375 | 3 | [
"MIT"
] | permissive | class JsonPoller {
constructor(url, callback, errorCallback, interval=0, requestData={}) {
this.url = url;
this.callback = callback;
this.errorCallback = errorCallback;
this.interval = interval;
this.requestData = requestData;
this.requestCount = 0;
this.fetchData();
}
setRequestData... | true |
0191758efbe403397fc3e0f474004714e674d145 | JavaScript | KnowYouGroup/KnowYou | /src/config/filter.js | UTF-8 | 4,500 | 3.21875 | 3 | [] | no_license | /**
* 格式化时间
* @name formatDate
* @param {String} 13位unix时间戳
* @return {String} 格式化后的时间
*/
export const formatDate = (str) => {
if (!str) return ''
var date = new Date(str)
var time = new Date().getTime() - date.getTime() // 现在的时间-传入的时间 = 相差的时间(单位 = 毫秒)
if (time < 0) {
return ''
} else if ((ti... | true |
42a425f094410dbfa0d1b5354c9be3c67d2ade79 | JavaScript | melinda-schmitz/CodeSwitch2018 | /client/src/App.js | UTF-8 | 4,446 | 2.6875 | 3 | [] | no_license | // Import React
import React, { Component } from 'react';
// Importing React Router to add page routes.
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
// Import Events page
import Events from './containers/Events';
// Import Profile page
import Profile from './containers/Profile';
// Import ... | true |
c2b481182e07aa20ee5f5391616c057acb6d5a67 | JavaScript | canvasplay/SMX | /src/document/Node.js | UTF-8 | 5,265 | 2.828125 | 3 | [
"MIT"
] | permissive | /**
* @memberof smx
* @mixes Node-Core
* @mixes Node-Attributes
* @mixes Node-Traversal
*
* @description
* The Node class wraps an XMLNode and provides an easy to use api
* to interact with it.
*
* This class can be further extended by mixins from custom modules.
*/
class Node {
/**
* @c... | true |
fc53aa86de6b964cffda5036d172e589ab5593bc | JavaScript | yurimann/point-of-sale | /src/logic/Evaluate.js | UTF-8 | 402 | 2.640625 | 3 | [] | no_license | // import keypad from '../Keypad.js';
var ticket = [];
export default function evaluate(value) {
let hashKeys = Object.keys(value);
// console.log(Object.keys(value));
for (var i = 0; i < hashKeys.length; i++ ){
console.log(hashKeys[i]);
if (typeof value !== 'undefined' && value[hashKeys[i]] !== "") {
... | true |
78fece5b4eabc60fc053ee9417478e4961275b02 | JavaScript | dinaaziz/jquery-selectors-readme-re-coded-000 | /spec/selectors-spec.js | UTF-8 | 1,954 | 2.78125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | 'use-strict';
describe('Selectors', function() {
beforeEach(function() {
var fixture = setFixtures('<body><div class="pics"><img id="baby-ninja" src="https://s3.amazonaws.com/after-school-assets/baby-ninja.gif" width="300px"><img alt="the beatles making faces" src="https://s3.amazonaws.com/after-school-assets/b... | true |
65dbd6ea2611ce287d63dfec072f2c15b0c21571 | JavaScript | kush789/2048 | /js/artificialIntelligence.js | UTF-8 | 1,757 | 3.5 | 4 | [
"MIT"
] | permissive | var BOARD = 1;
var PLAYER = 0;
GameManager.prototype.getBestMove = function(grid, depth)
{
var score = Number.MIN_VALUE;
var bestMove = 0;
for (var i = 0; i < 4; i ++)
{
var newGrid = grid.clone();
if(newGrid.move(i) === false)
continue;
var newScore = thi... | true |
af91eb27cac30b4a7550993974e18351d7abb60d | JavaScript | LocalGood/WordPress | /themes/localgood/js/common.js | UTF-8 | 293 | 2.640625 | 3 | [] | no_license | //閲覧端末判定
//iPadもAndroidタブレットもPC扱い。
function getDeviceType() {
var ua = window.navigator.userAgent;
if (ua.match(/iPod|iPhone/i)) {
return 'sp';
} else if (ua.match(/Android.+Mobile/i)) {
return 'sp';
} else {
return 'pc'
}
}
| true |
b57e5999e8854a8fbdc63acadc86193074b3556d | JavaScript | dannehess/Javascript-1 | /Lektioner/Lektion 11/Exempel1.js | UTF-8 | 2,657 | 4.09375 | 4 | [] | no_license | //ITERATION
for (let i = 1 ; i <= 10 ; i++) {
if(i%3 === 0)
console.log(i + ' är delbart med 3');
}
// Skriv ut alla jämna tal mellan 1 och 20
for(let i = 1; i<=20; i++)
{
if(i%2 === 0)
{
console.log(i);
}
}
// Skriv ut alla tal mellan 1 och 100, men enbart tal som är jämnt delbart... | true |
80162e06e6dea0bd71df55efb04d54dd28ef8b64 | JavaScript | AnayaRepo/My-Own-Game-Part1 | /js/Game.js | UTF-8 | 711 | 2.65625 | 3 | [] | no_license | class Game{
constructor(){
this.level1Bg = loadImage("images/bg/bg.png");
this.level2Bg = loadImage("images/bg/bg4.jpg");
this.level3Bg = loadImage("images/bg/bg6.jpeg");
this.gameLevel = "level1";
this.gameOver = loadImage("images/gameover.jpg");
this.loseSoun... | true |
6fb0f497775704880c4665c609acc79a819aebf3 | JavaScript | nxmai/Web-Final-Project-HCMUS | /models/userModel.js | UTF-8 | 2,592 | 2.75 | 3 | [] | no_license | const db = require('../dal/mysql');
const bcrypt = require('bcrypt');
exports.addUser = async (newUser) => {
const saltRounds = 10;
await bcrypt.genSalt(saltRounds, function(err, salt) {
bcrypt.hash(newUser.password, salt, function(err, hash) {
const user = {
name: newU... | true |
f1938b46286ebdb05118726428956c4ef3b4ac6c | JavaScript | Oskar-V/smart_table | /app_handler/app_handler.js | UTF-8 | 1,196 | 2.75 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const fs = require('fs');
const app = express();
const port = 80;
const outputFilePath = "/home/pi/widgets/json.json";
app.use(bodyParser.json());
let cache = {};
let cacheIndex = 1;
app.get('/', (req, res) => res.send('Only post request ... | true |
840ee665050805ae3ba1b35d4e7e50fb58229199 | JavaScript | rob-blackbourn/scratch-js | /react-converter/src/converters/definitions/Quantity.js | UTF-8 | 403 | 2.578125 | 3 | [
"MIT"
] | permissive | export default class Quantity {
constructor(amount, originalUnitConverter, targetUnitConverter) {
this.amount = amount
this.originalUnitConverter = originalUnitConverter
this.targetUnitConverter = targetUnitConverter
}
toString() {
return `amount=${amount}, originalUnitConv... | true |
92081f741cca68be10fffe09362cd08f6d2194a6 | JavaScript | KristofferHebert/thinkful | /nodejs/io-callback/index.js | UTF-8 | 1,159 | 3.484375 | 3 | [] | no_license | function wait(seconds, callback) {
setTimeout(function(){
callback(new Date())
}, seconds * 1000)
}
console.log('Console log before calling wait:', new Date())
wait(3, function(date) {
console.log('Console log inside anonymous callback:', date)
})
console.log('Console log after calling wait:', new Date())
... | true |
94402b1deb80cb7b68ae6acdd0b5d29eb88eb077 | JavaScript | PhilWaldmann/node-red-contrib-hubo | /hubo-input.js | UTF-8 | 736 | 2.515625 | 3 | [] | no_license |
module.exports = function(RED) {
function HuboInputNode(config) {
RED.nodes.createNode(this, config)
const node = this
const hubo = RED.nodes.getNode(config.hubo)
const channel = config.channel.toString()
if(!hubo) return
const listener = function(state){
if(state) node.status({fill:'... | true |
2241b0f095b95d61fea26467d3845fbe0d6ca271 | JavaScript | omgdork/tweet-splitter | /src/app/modules/home/components/tweet.js | UTF-8 | 1,085 | 2.515625 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
const formatTimestamp = (timestamp) => {
const now = moment(new Date());
const tweetTimestamp = moment(timestamp);
return now.diff(tweetTimestamp, 'hours') < 24
? tweetTimestamp.fromNow()
: now.diff(tweetTimestam... | true |
cee12fcf46ceafeb9e1e9cba6a08bb5f58b5fc43 | JavaScript | doctorstal/Formaggiore | /proto/generator-bin/protoc-get-light.js | UTF-8 | 2,104 | 2.90625 | 3 | [
"Zlib"
] | permissive | const protocPlugin = require('protoc-plugin');
// Only basic markup supported
// Types: bool, int32 and string
// No nested messages supported
// No error checking
// Produces ts and
protocPlugin(protos =>
protos.map(proto => {
return [
{
name: proto.name.replace(/\.proto$/, '.... | true |
b3eeda1a6d824a25ac0c06cea828ecf77f0f1ece | JavaScript | jane88nausicaa/Emaily-Survey-Application | /client/src/index.js | UTF-8 | 1,547 | 2.6875 | 3 | [] | no_license | /* This top level index.js
responsible for all of our redux setup, where all kind of data setup
*/
import "materialize-css/dist/css/materialize.min.css";
import React from "react";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { createStore, applyMiddleware } from "redux";
import redu... | true |
608193a0a535d3f131f5a47ad4fcd8ae30385d16 | JavaScript | ProgrammerShahJalal/basic-js-bonus | /breck-continue.js | UTF-8 | 532 | 2.578125 | 3 | [] | no_license | const products = [
{ name: 'samsung s7', price: 12000 },
{ name: 'hp laptop', price: 42000 },
{ name: 'apple smart watch', price: 1900 },
{ name: 'bosundara paper', price: 80 },
{ name: 'lg smart phone', price: 10000 },
{ name: 'analog phone', price: 120 }
]
// for (const product of products) {
... | true |
43caa02c2379d4b13f13d831e58d95f60115a2c5 | JavaScript | SofDevAko/CoDoAssignments | /WebFundementals/APIandAJAX/gameOfThrones/script.js | UTF-8 | 987 | 2.9375 | 3 | [] | no_license | $(document).ready(function(){
$(document.body).on("click","img", function(){
var name = $(this).attr("id");
if (name == "stark"){
var url = 362;
}
else if(name == "targaryen"){
var url = 378;
}
else if(name == "lannister"){
var url ... | true |
4f74fa57b17d36ce4d215d37207b733a94516f67 | JavaScript | mrkev/CodeThingy | /CodeThingy/lib/public/js/code_thingy.editor.js | UTF-8 | 4,118 | 2.640625 | 3 | [] | no_license | var HUDOverlay = function () {
var _hud;
HUDOverlay.prototype.show = function () {
_hud = document.createElement('div');
_hud.className = 'progress_hud';
var progress = document.createElement('img');
progress.setAttribute('src', './img/fancybox_loading@2x.gif')
_hud.appendChild(progress);
... | true |
c9e9ae187e44118085e0354984176be700e1310a | JavaScript | zh3305/MapleStory_Script | /回忆冒险岛全套脚本/npc/9310143_42.js | GB18030 | 3,307 | 2.515625 | 3 | [] | no_license | /* ȫְҵ̵ */
var status = -1;
var itemList = Array(
Array(1353105, 50000),
Array(1342095, 50000),
Array(1352009, 50000),
Array(1352109, 50000),
Array(1352206, 50000),
Array(1352216, 50000),
Array(1352226, 50000),
Array(1352276, 50000),
Array(1352286, 50000),
Array(1352296, 50000),
Array(1352406, 50000),
Array(1352506, 5... | true |
27f481e9c8bacdfbd093e1a7219d60c51ebd49cb | JavaScript | Vladekk/izvne.com | /files/lj/602320_files/common.js | UTF-8 | 9,134 | 2.890625 | 3 | [] | no_license | /*****************************
** Misc functions
******************************/
function $(id){
return document.getElementById(id);
}
function addStyleProperties(cssStr){
var head = document.getElementsByTagName('head')[0];
var styleSheets = head.getElementsByTagName('style');
var styleSheet = null;
if (styleS... | true |
ee539d82a945faf29c27e1dad5ae736c2c98a6dd | JavaScript | saikrishnadm/java_script | /file_operations.js | UTF-8 | 399 | 2.734375 | 3 | [] | no_license | var fs =require('fs')
fs.readFile('app.js', function(err, data) {
// console.log(data.toString())
});
// try catch for handling the
try
{
var a= fs.readFileSync('app.js');
}
catch(err)
{
console.log(err)
}
//console.log(a.toString())
console.log("after err")
fs.writeFile('sai.txt',"bbbbbbbbbb",(err)=>... | true |
1a5a5805dfae620d499f1aef690f1cb17b4e4363 | JavaScript | 0529bill/people-generator | /src/App.js | UTF-8 | 2,034 | 2.5625 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import Layout from './Layout';
import axios from 'axios';
import Spinner from './Spinner';
import { Container, Button } from 'react-bootstrap';
function App() {
let [datas, setdatas] = useState('');
let [loading, setLoading] = useState(false);
let [darkmode, se... | true |
f8be843a33897c9e4a1dc19dc96559b3146eae93 | JavaScript | benjambo13/sudoku-solver | /api/solving/crossover.js | UTF-8 | 1,101 | 3.15625 | 3 | [] | no_license | var getSolutions = require('./getSolutions');
function crossover(solutions, popSize)
{
var newSolutions = [];
solutions = shuffle(solutions);
solutions = getSolutions(solutions);
while (newSolutions.length !== popSize)
{
var newCurrentSolution = [];
var parent1 = solutions[Math.floo... | true |
b55a26d4158e90b5d025fc993ff67d4e47abb689 | JavaScript | lindellcarternyc/opera-collective-space | /data/admin.js | UTF-8 | 621 | 2.984375 | 3 | [] | no_license | let admins = [
{firstName: 'Lindell'},
{firstName: 'Jose'}
]
export const getAdmins = () => {
return new Promise((resolve, reject) => {
if (admins.length > 0) {
resolve(admins)
} else {
reject('NO ADMINS')
}
})
}
export const getAdminById = id => {
return new Promise((resolve, reject... | true |
13dd8a05ce5e77c31221a8a1e6581ccaa67130e8 | JavaScript | muratkeremozcan/books | /Kyle-Simpson_Luis-Antecio/FP-in-JS/model/Tree.js | UTF-8 | 819 | 2.96875 | 3 | [] | no_license | /**
* Simple tree class
* Author: Luis Atencio
*/
const _ = require('lodash');
class Tree {
constructor(root) {
this._root = root;
}
static map(node, fn, tree = null) {
node.value = fn(node.value);
if(tree === null) {
tree = new Tree(node);
}
if(node.hasChildren()) {
_.map(no... | true |
cda7cba59b4d856ee75e33967de13a5936df3b48 | JavaScript | lffernandez2018/WEB222 | /assignment3/js/list.js | UTF-8 | 1,685 | 3.359375 | 3 | [] | no_license | //Student Name: Leny Fe Fernandez
//Date: 2018-03-08
//email: lffernandez@myseneca.ca
//list.js
// Data for the "HTML Lists" Page
var fruits = [ "Apples","Oranges","Pears","Grapes","Pineapples","Mangos" ];
var directory = [
{type: "file", name: "file1.txt"},
{type: "file", name: "file2.txt"},
{type: "dir... | true |
c1eab3d9c3b99ebdfa5ff31d091a422ff8a4a64c | JavaScript | phamadam/Daily-Cooking | /script.js | UTF-8 | 4,122 | 3.15625 | 3 | [] | no_license | 'use strict';
const apiKey = 'f38898caa70c4d1a9a9b14589fd8e362';
const searchURL = 'https://api.spoonacular.com/recipes/complexSearch';
//translates user search into url
function formatQueryParams(params) {
const queryItems = Object.keys(params)
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent... | true |
b54c8d1d0ea209bb7486fb79fe417222cf6f64a0 | JavaScript | AndrewEvansDev/herokuclone | /js/about.js | UTF-8 | 912 | 2.703125 | 3 | [] | no_license |
// $(".pegBar img").mouseup(function(){
// $(this).removeClass("btnDown")
// })
const questionArray = [];
const $sName = $('#sName');
const $sEmail = $('#sEmail');
const $sTextarea = $('#sTextarea');
const $submitBtn = $('#reqInfo');
class InfoRequest{
constructor(name,email,msg){
this.name = name;
... | true |
83b86a3b2764f3c368171887cc43e2e629ff0bb4 | JavaScript | Ferchop89/e_Titulos_d | /public/js/datepickerBlock.js | UTF-8 | 7,965 | 2.828125 | 3 | [] | no_license | $(document).ready(function(){
var date = new Date();
var today = new Date(date.getFullYear(), date.getMonth(), date.getDate());
$.datepicker.regional['es'] =
{
closeText: 'Cerrar',
prevText: '< Ant',
nextText: 'Sig >',
currentText: 'Hoy',
monthNames: ['Enero', 'Febrero', 'Marzo',... | true |
9abfe3fd78a8f828e9ad1a6d396afd784fdc0e14 | JavaScript | hi-noikiy/zty_nest | /src/qichacha/chaJsonProc.js | UTF-8 | 4,992 | 2.96875 | 3 | [
"MIT"
] | permissive | var fs = require('fs');
// var CompanyInfo = require('./database.js');
// var person= JSON.parse(fs.readFileSync('./工商-人员返回值.json'));
// var project = JSON.parse(fs.readFileSync('./建筑企业-工程项目返回值.json'));
// var stock = JSON.parse(fs.readFileSync('./信息核验-股权穿透返回值.json'));//读取三个json用于调试,实际为传入的三个查询返回值
var JsonProcessing... | true |
4955b1a7cece3a44219e997c898f81ecae9f1aec | JavaScript | MaggyChristina/astro-javascript | /js-apps/src/index-scope-hoistingglobal.js | UTF-8 | 403 | 3.71875 | 4 | [] | no_license |
/**
*
*
* variable declaration is moved up:Hoisting
var i;
var j;
console.log(i, j)
i = 10;
j = 30;
*/
//can we access the i and j before declaration.
console.log(i, j)
var i = 10;
var j = 30;
console.log(i, j)
sayHello();
//function declaration
function sayHello() {
console.log('Hello')
}
sayHello()
//... | true |
5d646c9b866dbd35f6f1515193e372f2e5f02aa8 | JavaScript | dazaevvc/leftovers-webapp | /routes/restaurants.js | UTF-8 | 2,142 | 2.671875 | 3 | [] | no_license | const db = require("../models/restaurant");
function getRestaurantList (req, res){
db.Restaurant.find({}).
populate('foodLeft').
exec(function (err, restData){
if (err) {
console.log('Error retrieving restaurants from DB.', err);
res.status(500).send('Internal server error');
} else {
c... | true |
41fc26b644263d5b46f8e66d72cbb97fc170de35 | JavaScript | Nur-A-Alam1997/bear-sports | /server/middleware/formidable.js | UTF-8 | 927 | 2.671875 | 3 | [] | no_license | const route = require("express").Router();
const fs = require("fs");
route.post("/uploadfile", (req, res, next) => {
// console.log((req.body))
var array1= req.body.City
var array2= ["stockholm", "moscow", null, null, "helsinki", "london"];
const intersection = array1.filter(element => array2.includes(elem... | true |
a259795cde23207a5db7096289ef26d36d336772 | JavaScript | yeomhyelim/before_project | /160129_넷마블/그린카서버소스인듯/public_html/www/web/shopAdmin/common/js/common.js | UTF-8 | 11,520 | 2.59375 | 3 | [] | no_license | function C_getCheckAll(val,target){
var doc = document.form;
if (C_isNull(target))
{
target = "chkNo[]";
}
var obj = doc[target];
if(!C_isNull(obj) && !C_isNull(obj.length)){
if (obj.length>0){
for (i=0; i<=obj.length-1; i++){
obj[i].checked=val;
}
}else{
obj.checked=val;
}
} else {
ob... | true |
9feaecaef8ec6e1a73112236dce2d4285b9e177e | JavaScript | Iceberg-rookie/JS__fullstack | /js_base/手写系列/数组去重/unique.js | UTF-8 | 1,271 | 3.8125 | 4 | [] | no_license | // _.uniq(array, [isSorted], [iteratee])去重
let array1 = [1, 2, '1', 2, 1]
let array2 = [1, 1, '1', 2, 2, 'a', 'b', 'A']
// function unique(array, isSorted) {
// let res = []
// let seen
// for (let i = 0, len = array.length; i < len; i++) {
// let value = array[i]
// if (isSorted) {
// ... | true |