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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
89abfe163b3f63291d841b9256f6360277414af3 | JavaScript | philrabin/ubertest | /static/scripts/app/views/App.js | UTF-8 | 2,174 | 2.6875 | 3 | [] | no_license | define([
'backbone',
'underscore',
'app/views/MapView',
'app/views/ListView',
'app/collections/TruckLocationCollection',
'hbs!templates/app'
], function(Backbone, _, MapView, ListView, TruckLocationCollection, html) {
/**
* Main app view
* @class
*/
return Backbone.View.ex... | true |
b9d48d1cb58e50b1e79eb72f3644975c1fcae401 | JavaScript | ErikHaSu/estanciasAct | /graficas/scripts/edad_script.js | UTF-8 | 1,220 | 2.828125 | 3 | [] | no_license | /*var xhr = new XMLHttpRequest();
xhr.open('GET','edad.php');
xhr.onload = function(){
if(xhr.status === 200){
var json = JSON.parse(xhr.responseText);
var data = [
{
x: ['7 años', '8 años', '9 años','10 años','11 años','12 años'],
y: [json.siete, json.och... | true |
39f4f75b2e62b973f616cfeff7a405603358927b | JavaScript | DJGARG7/virtualtokens | /Node_backEnd/server.js | UTF-8 | 4,357 | 2.578125 | 3 | [] | no_license | const { instrument } = require("@socket.io/admin-ui");
const generateUniqueId = require("generate-unique-id");
const express = require("express");
const socketIO = require("socket.io");
const PORT = process.env.PORT || 5000;
const INDEX = "/index.html";
const server = express()
.use((req, res) => res.sendFile(INDEX... | true |
69c3bb6b57d88dd13109ba1cffde62ec6cf58a82 | JavaScript | dexteerz/CARCOMPRASWEB | /public/app.js | UTF-8 | 5,131 | 3.109375 | 3 | [
"MIT"
] | permissive | // CONFIGURAÇÕES DE CONEXÃO FIREBASE
const config = {
apiKey: "AIzaSyBoTRlfosL2xrcFlkDTy8sU0WJIfxqUOX4",
authDomain: "projeto-2-8a6b3.firebaseapp.com",
databaseURL: "https://projeto-2-8a6b3.firebaseio.com",
projectId: "projeto-2-8a6b3",
storageBucket: "projeto-2-8a6b3.appspot.com",
messagingSenderId: "50378315774... | true |
10f7c5b4dd3976234d9ebb916ab159e1e43a1223 | JavaScript | chongqiangchen/Frontend-04-Template | /Week_02/寻路/data.js | UTF-8 | 228 | 3.328125 | 3 | [] | no_license | /**
* Data
* 公式: F(M) = G(M) + H(M);
*/
class Data {
constructor(point, g, h, parent) {
this.point = point;
this.g = g;
this.h = h;
this.parent = parent;
}
f() {
return this.g + this.h;
}
}
| true |
c8fe49a493999f56efbd13cdfc116095b449a320 | JavaScript | Yannickvanoekelen/ex-9-Yannick-Van-Oekelen | /Distribution.js | UTF-8 | 10,418 | 2.84375 | 3 | [] | no_license | /**
* Created by yannickvanoekelen on 3/01/17.
*/
//hulp gekregen van kristof en axel en daar ben ik enorm dankbaar voor//
//we gaan hier onze afhankelijkheden gaan inladen
var express = require('express');
var parser = require('body-parser');
var shortid = require('shortid');
//we gaan hier onze exterene bronnen... | true |
8d0e7d3716ee62788b587837945db79ca8fd344a | JavaScript | TobiasPro/Game | /Youtube-Spil/laser.js | UTF-8 | 1,641 | 3.359375 | 3 | [] | no_license | // Så jeg kopier ved at bruge spos. så den laver en ny vector med smame x og y. Jeg tilføjer angle for styre den vinkel mine skud skal skydes
function Laser(spos, angle) {
this.pos = createVector(spos.x, spos.y);
// Her får jeg mine skud til skyde i samme vinkel som mit skib peger
this.vel = p5.Vector.fromA... | true |
2ee66f12a91b955cbc6f8d6e7e2483b524871549 | JavaScript | hervegbedji/blitzyChat | /src/utils/users.js | UTF-8 | 3,812 | 3.03125 | 3 | [] | no_license | const users = [];
const rooms = [];
const checkUserNameFormat = (a) => {
return true
}
const checkUserInfo = (username, roompin) => {
if((typeof username !== 'undefined')){
username = username.trim().toLowerCase();
if(username === ''){
return {
error: 'Some needed ... | true |
5bc4a90366b6d9e5b4557732464308b5da0aef37 | JavaScript | bsteinig/personal-dashboard | /src/content/hourCard.js | UTF-8 | 1,180 | 2.84375 | 3 | [] | no_license | import React from 'react'
import weather_imgs from '../assets/weather_imgs'
function HourCard({index, data}) {
function time(){
var dt = new Date();
let add = parseInt(index) + 1;
dt.setHours( dt.getHours() + add);
return (
<h3 className="time-text">{dt.toLocaleString('... | true |
62992dbb98d4b856981ef0d403ee9eecb4c3322c | JavaScript | arnihermann/react-browserify-experiment | /browser/main.js | UTF-8 | 286 | 2.5625 | 3 | [] | no_license | /** @jsx React.DOM */
var React = require('react-tools').React;
var HelloMessage = React.createClass({
render: function() {
return <div>{'Hello ' + this.props.name}</div>;
}
});
React.renderComponent(
<HelloMessage name="John Smith" />,
document.getElementById('example')
);
| true |
cce4b8a9ab477c7b654f8791f063a10b5e1ab831 | JavaScript | mtjhartley/front-end-hartpr-react | /src/components/Head2Head/Head2Head.js | UTF-8 | 5,801 | 2.75 | 3 | [] | no_license | import React, { Component } from "react";
import '../../../node_modules/bootstrap/dist/css/bootstrap.min.css';
import Head2HeadSetsTable from './Head2HeadSetsTable';
import {makeApiRequest} from "../utils/api";
import Head2HeadStats from './Head2HeadStats';
class Head2Head extends Component {
constructor(props) {
... | true |
507ca65945a06a9b0c1674610894223782f5ebd8 | JavaScript | PsyAuto/Vanilla-JS-Audio-Player | /playlist.js | UTF-8 | 5,723 | 2.921875 | 3 | [] | no_license | /**
* Vanilla JS Audio Player with ACF
* Copyright © 2021
* Monoscopic Studio | https://monoscopic.net
* Version 1.0.0
**/
class AudioTrack {
constructor(track_element) {
this.el = track_element;
this.src = track_element.getAttribute('data-audio');
}
}
class AudioPlayer {
constructor(player_... | true |
b51de8a10339f9c6f3d887655241990475062b32 | JavaScript | allen286/programming-quiz | /algorithm/findPath.js | UTF-8 | 890 | 3.40625 | 3 | [] | no_license |
function findPath(obj = {}, targetValue) {
const dfs = (obj = {}, targetValue) => {
let res = [];
Object.keys(obj).forEach((key) => {
res.push(key);
if (obj[key] && typeof obj[key] === 'object') {
let temp = dfs(obj[key], targetValue);
if (temp.length) {
// 说明在子层中找到目标值,拼... | true |
c3d8c67f68895f6313b25b25a17c1a7b2344fa38 | JavaScript | puftu/Brasov-guide | /gallery/gallery.js | UTF-8 | 2,335 | 2.625 | 3 | [] | no_license | $(function() {
$("#listingTable").on("click", "span", paginationClickHandler);
loadGallery(1);
function paginationClickHandler(e) {
var pageNumber = e.currentTarget.innerHTML;
loadGallery(pageNumber);
var header = document.getElementById("listingTable");
var btns = header.getElementsByClassName(... | true |
c1a518563884e5cd7003545cf06cd9b389b02bc1 | JavaScript | tcotav/blackboard_impactjs | /entities/billboard.js | UTF-8 | 4,468 | 2.78125 | 3 | [
"MIT"
] | permissive | /*
Entity in center of screen
Keys for Weltmeister:
name -- used by trigger to invoke
text -- written to billboard
*/
ig.module(
'game.entities.billboard'
)
.requires(
'impact.entity'
)
.defines(function(){
EntityBillboard = ig.Entity.extend({
size: {x: 32, y: 32},
name: "billboard",
... | true |
f62b631ef3c1189ddd00b2f9f57d5133833e5399 | JavaScript | MichaelLi-96/Beam-Dental-Boxing-Kata | /src/tests/getSummaryData/getSummaryData.test.js | UTF-8 | 3,156 | 2.515625 | 3 | [] | no_license | const getSummaryData = require('./getSummaryData');
let test1 = [
{
"id": 2,
"name": "Anakin",
"brush_color": "blue",
"primary_insured_id": null,
"contract_effective_date": "2018-01-01"
},
{
"id": 3,
"name": "Padme",
"brush_color": "pink",
"primary_insured_id": 2,
"contract_effective_date": ""
... | true |
f8f2756cfa90247bc8b67d67901cf3327c6e1c21 | JavaScript | yervand-stepanyan/to-do-list | /main.js | UTF-8 | 19,345 | 2.796875 | 3 | [] | no_license | const input = document.querySelector('input');
const btnAdd = document.querySelector('#btnAdd');
const list = document.querySelector('#list');
const ul = document.querySelector('ul');
const itemLeftDiv = document.querySelector('#itemLeft');
const clearCompleted = document.querySelector('#clearSpan');
const btnAll = doc... | true |
71d0420b9a097049bf4d9356b4d04a27d33b4394 | JavaScript | wilsonmb89/udemy-pwa-01-fundamentos | /fetch/fetch-1.js | UTF-8 | 273 | 2.75 | 3 | [] | no_license | var req = new XMLHttpRequest();
req.open('GET', 'https://reqres.in/api/users', true);
req.send(null);
req.onreadystatechange = function(state) {
if (req.readyState === 4) {
var res = req.response;
var resJson = JSON.parse(res);
console.log(resJson);
}
};
| true |
05b233b694c40f72e2974a42eb500a729333e8ae | JavaScript | beaniegel/jelenaio | /public/js/nav.js | UTF-8 | 1,374 | 2.546875 | 3 | [
"MIT"
] | permissive | "use strict"
function startSite() {
var hash = window.location.hash;
var home = "about";
if (hash) {
home = hash.replace("#", "");
}
enableMenu();
loadPage(home);
}
function enableMenu() {
enableBtn("about-nav");
enableBtn("projects-nav");
enableBtn("work-nav");
enableBtn("contact-nav");
}
... | true |
1961be6da3901c981ea71364cfed6b0d3ccb64a6 | JavaScript | Ajarnshilin/school-api-622110339 | /app/Controllers/Http/StudentController.js | UTF-8 | 2,835 | 2.53125 | 3 | [] | no_license | 'use strict'
const Database = use('Database')
const Hash = use('Hash')
const Validator = use('Validator')
const Student = use('App/Models/Student')
function numberTypeParamValidator(number) {
if(Number.isNaN(parseInt(number))) {
return { error: `param: ${number}`}
}
return{}
}
class StudentContro... | true |
bd7c42d0202abb6f85bc366e4f165434ce42b53c | JavaScript | rskidmore1/code-journal | /js/main.js | UTF-8 | 7,832 | 2.84375 | 3 | [] | no_license | /* global data */
/* exported data */
var urlInput = document.querySelector('.photoUrl');
var imgSrc = document.querySelector('.placeholder-img');
urlInput.addEventListener('input', function (event) {
var imgUrl = event.target.value;
imgSrc.setAttribute('src', imgUrl);
});
var submitForm = document.getElementBy... | true |
7547d5ced2bef0fbe5e4022afc9b5bae33db37ac | JavaScript | taurgis/salesforce-commerce-cloud-libraries | /test/unit/lodash/rest.test.js | UTF-8 | 1,051 | 2.859375 | 3 | [
"MIT"
] | permissive | var assert = require('assert');
var rest = require('../../../cartridges/lodash/rest');
var map = require('../../../cartridges/lodash/map');
var constant = require('../../../cartridges/lodash/constant');
var slice = Array.prototype.slice;
describe('rest', function () {
function fn() {
return slice.call(argu... | true |
7e994ed31ce8a4609a3e590b5c2629d94deabdb2 | JavaScript | mimikim/See-You-Space-Cow-2018 | /assets/js/src/portfolio.js | UTF-8 | 2,531 | 2.8125 | 3 | [] | no_license | // filter portfolio
( () => {
"use strict";
class Portfolio {
constructor() {
// set variables
this.route = `${wp_portfolio.url}/wp-json/spacecow/v1/portfolio/`;
this.active_buttons = [];
this.container_div = document.getElementById( 'js-portfolio-results' );
// add filter funct... | true |
b8437af79eb26687dc656af79889fdda4dd426d9 | JavaScript | reaktivate/venuex | /packages/library/ddd/src/ModelRegistry.js | UTF-8 | 992 | 2.53125 | 3 | [] | no_license | import { getModelName as getClassModelName, isModel } from './Metadata';
import isString from 'lodash/isString';
import invariant from 'tiny-invariant';
function getModelName(arg) {
if (!isString(arg)) {
arg = getClassModelName(arg);
}
return arg;
}
class ModelRegistry {
map = new Map();
register(Clas... | true |
a693bb707b23dbe27ad2899ba968020b710bbb76 | JavaScript | ottoinfo/otto-dock | /apps/simple_express/middleware/logger.js | UTF-8 | 4,448 | 2.90625 | 3 | [] | no_license | const { createLogger, format, transports } = require('winston')
const { combine, prettyPrint } = format
const { NODE_ENV } = process.env
const dev = NODE_ENV !== 'production'
// WINSTON Configurations
// level - Level of messages to log.
// filename - The file to be used to write log data to.
// handleExceptions - C... | true |
a37699bedae27f3cdedbe87c2c1ef44c9f694d60 | JavaScript | Voxer/franz-kafka | /client/receiver.js | UTF-8 | 1,287 | 3.078125 | 3 | [
"BSD-3-Clause"
] | permissive | module.exports = function (
inherits,
EventEmitter,
State) {
function Receiver(stream) {
var self = this
this.stream = stream
this.stream.on(
'readable',
function () {
self.read()
}
)
this.stream.on(
'end',
function () {
self.closed = true
}
)
this.queue = []
this.current ... | true |
5c36fae801a679a05a8a2659660e60d1718d9c31 | JavaScript | ParichitR/p27 | /sketch.js | UTF-8 | 1,113 | 2.796875 | 3 | [] | no_license |
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
const Constraint=Matter.Constraint
function preload()
{
}
function setup() {
createCanvas(1000, 600);
engine = Engine.create();
world = engine.world;
//Create the Bodies Here.
roof= new Roof(500... | true |
243493a340773671d52cd171f4ffa39e16f7e9a7 | JavaScript | mifkata/terrapress | /scripts/helpers/terminal.js | UTF-8 | 1,064 | 2.8125 | 3 | [] | no_license | 'use strict';
const { terminal } = require('terminal-kit');
const trimMultiline = str => str.split('\n')
.map(line => line.trim())
.join('\n');
const terminate = () => {
terminal.grabInput(false) ;
terminal('\n');
process.exit();
}
terminal.on('key', name => name === 'CTRL_C' ? terminate() : {});
terminal... | true |
fb02ab118c1387d5bde1db1c80ce13e6b3c4b4c6 | JavaScript | sithu/pebble-timeline | /src/app.js | UTF-8 | 1,904 | 2.90625 | 3 | [] | no_license | /**
* Welcome to Pebble.js!
*
* This is where you write your app.
*/
var UI = require('ui');
var Vector2 = require('vector2');
var Accel = require('ui/accel');
var home = new UI.Card({
title: '$1500',
subtitle: 'net-income',
body: 'for today',
style: 'large'
});
// Create TimeText
var timeText = new UI.T... | true |
23651b78dd7ccfa9a689da175f3a0897f7466cbd | JavaScript | nikoladupreez/StrangerThings-GAME | /Others.js | UTF-8 | 3,432 | 3.1875 | 3 | [] | no_license | // ------- OTHERS --------
class Others {
constructor(game) {
this.game = game;
this.grid = game.map.grid.gameGrid;
this.others = ['mike', 'will', 'dustin', 'lucas'];
this.namePlaced;
this.nameId;
this.foundOtherSound = document.getElementById('found-other');
}
... | true |
9fc37d3d4f9455f9fd5ec37b19efdbb7f35c8aa6 | JavaScript | kortfolio/manymentors | /js/additionalJS.js | UTF-8 | 1,208 | 2.921875 | 3 | [
"MIT"
] | permissive | /**
* Created by erg on 2016-09-26.
*/
var vid = document.getElementById("bgvid");
var pauseButton = document.querySelector("#polina button");
function vidFade() {
vid.classList.add("stopfade");
}
vid.addEventListener('ended', function()
{
// only functional if "loop" is removed
vid.pause();
// to capture I... | true |
42ea429301137ab1bda764bad10cbbd9d3282c95 | JavaScript | TheCbac/MICA-Desktop | /app/components/Developer/micaTerminal.js | UTF-8 | 4,307 | 2.515625 | 3 | [
"MIT"
] | permissive | /* @flow */
/* eslint react/no-unused-state: 0 */
/* **********************************************************
* File: components/Developer/micaTerminal.js
*
* Brief: Terminal for interacting with CLI of MICA
*
* Authors: Craig Cheney
*
* 2017.10.25 CC - Document created
*
*********************************************... | true |
0f3cbc531d12d945370533786cb3e3961b29686d | JavaScript | CherkasIvan/chat | /src/pages/MainPage/MainPage.jsx | UTF-8 | 1,819 | 2.59375 | 3 | [] | no_license | import React from 'react';
import './MainPage.scss'
import {apiKeys} from "../../constants/ApiMovie";
import {Header} from "../../modules";
const MainPage = ({children}) => {
getMovies(apiKeys.API_URL_TOP_100)
async function getMovies(url) {
const response = await fetch(url, {
headers: {
"Conte... | true |
a67b48c9a698d31c63a2f271014b23773b7d5e4d | JavaScript | golapdk/emoji | /emojiWeb.js | UTF-8 | 2,864 | 3.1875 | 3 | [] | no_license | function emoji_encode(data) {
if (data) {
var str = data;
var highsurrogate = 0;
var suppCP;
var pad;
var outputString = '';
for (var i = 0; i < str.length; i++) {
var cc = str.charCodeAt(i);
if (cc < 0 || cc > 0xFFFF) {
outputString += '!Error in convertCharStr2UTF16: unexpected charCodeAt result, ... | true |
943c09b417c640e50170ad11334da583f82c2b3e | JavaScript | Shirodork/The-Derp-Bot-3 | /src/command tesmp/Plugins/set-plugin.js | UTF-8 | 1,916 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | // Dependecies
const defaultPlugins = ['Fun', 'Giveaway', 'Guild', 'Image', 'Level', 'Misc', 'Moderation', 'Music', 'NSFW', 'Plugins', 'Recording', 'Searcher', 'Ticket'],
Command = require('../../structures/Command.js');
module.exports = class SetPlugin extends Command {
constructor(bot) {
super(bot, {
name: 's... | true |
e618e542f2593bdadd492d39f80287ee69ff40ec | JavaScript | Ange-Crespo/BitcoinHW3 | /mysite/buyAndSell/static/buyAndSell/js/main.js | UTF-8 | 2,638 | 2.71875 | 3 | [
"Unlicense"
] | permissive | //REQUIRE JQUERY !
function getCSRFTokenValue() {
var key= jQuery("[name=csrfmiddlewaretoken]").val();
console.log( "CSRF COOKIE from buyAndSell/main.js :" +key);
return key;
};
function csrfSafeMethod(method) {
// these HTTP methods do not require CSRF protection
return (/^(GET|HEAD|OPTIONS|TRACE)... | true |
34e02d1ec1239a2c903b3d7e872df993b96fce33 | JavaScript | mrecker13/rating-reader | /public/assets/js/app.js | UTF-8 | 10,073 | 2.578125 | 3 | [] | no_license | $(document).ready(function () {
var token = localStorage.getItem("token");
var localId = localStorage.getItem("id");
var localUser = localStorage.getItem("username");
if(token) {
$("#user-greeting").append("<h3>Hello, " + localUser + "!</h3>");
$("#button-field").append("<button type='s... | true |
dfbb64412789e55660b81965aa4bd5e51ea9bb62 | JavaScript | pihh/my-own-angular | /src/lib/pubsub.js | UTF-8 | 938 | 2.578125 | 3 | [] | no_license | 'use strict';
const PubSub = (function(){
let instance;
function createInstance() {
const object = {
__events__: {},
hop: function(prop){
return this.__events__.hasOwnProperty(prop);
}
}
return object;
}
function getInstance(){
if(!instance) {
instance = createI... | true |
2a39a256d48ac54caddb6d0b2fe5676fd217be6b | JavaScript | Aakratigoel/shift_scheduler | /public/js/shiftRequest.js | UTF-8 | 2,262 | 2.578125 | 3 | [] | no_license | $(document).ready(function(){
$.get("/api/shift_request", function(data) {
console.log("shifts data",data);
var keys= Object.keys(data.s[0]);
console.log("keys in shift table" + keys);
var $table = $(document.createElement('table'));
$("#shiftRequestDetails").append($table);
... | true |
9e3ffcd8c71fd0ee58741aa99eb3fb61e23b3bc1 | JavaScript | elenagiura/project-youtube-shortcut | /js/main.js | UTF-8 | 2,818 | 3.015625 | 3 | [] | no_license | var key = "AIzaSyBfMzahwcdSsYmRI2n3h2H1IxeYV1-9QlE";
var unorderedList = document.querySelector('main section ul');
var search = document.querySelector("header input");
var searchButton = document.querySelector("header button");
var iframe = document.querySelector("main iframe");
var iframeSection = document.querySele... | true |
64f6ec58c9ff8cb369daa4e0b2f067ff76afe959 | JavaScript | prashantvermaiiitb/simple-react-node-app | /src/js/components/context/with/MultiContext.js | UTF-8 | 3,026 | 3.0625 | 3 | [
"MIT"
] | permissive | /**
* * idea to show that multiple context exists in the page.
* * then do the context nesting and accessing the Providers.
*/
import React, { createContext, useContext, Component } from 'react';
const Context1 = createContext('default hello from context-1');
Context1.displayName = 'Disco';
const Context2 = createC... | true |
1f3824847572d218dfb9f647ee9a2db93670447e | JavaScript | skywalker212/daigur | /src/Reducers/tempReducer.js | UTF-8 | 361 | 2.828125 | 3 | [] | no_license | const tempReducerDefaultState = {
count:0
};
const tempReducer = (state = tempReducerDefaultState, action) =>{
switch(action.type){
case 'INC':
return {...state,count: state.count+1}
case 'DEC':
return {...state,count:state.count-1}
default:
return st... | true |
d67baca8a266e0ff754b418d4549b5b555a18dec | JavaScript | evanreyes/DojoAssignments | /mean/week1/5_friday/js_library.js | UTF-8 | 1,716 | 3.765625 | 4 | [] | no_license | var _ = {
map: function(array, callback) {
let mapped = [];
for (let i = 0; i < array.length; i++) {
mapped.push(callback(array[i]));
}
return mapped;
},
reduce: function(array, callback, memo) {
let i = 0;
if (memo == undefined) {
memo... | true |
37f8725307b4b94a2c6ef8890a2e56b62554882d | JavaScript | juandavidnh/DSA-arrays | /removeChar.js | UTF-8 | 488 | 3.734375 | 4 | [] | no_license | function removeChars(string, chars){
let restrictedChars = []
let newString = ""
for(let i = 0; i < chars.length; i++) {
restrictedChars.push(chars.charAt(i))
}
for(let j = 0; j < string.length; j++){
if(restrictedChars.includes(string[j])) {
continue
} else {
... | true |
7ccab2785670929ce0f96a849500516b870d7d71 | JavaScript | milkitmoon/javascript_test | /hackerrank/displayInformationfromObject.js | UTF-8 | 839 | 3.484375 | 3 | [] | no_license |
function displayInformation() {
for(var i=0; i<library.length; i++) {
if(library[i].readingStatus == true) {
console.log(readBook(library[i]));
} else {
console.log(unreadBook(library[i]));
}
}
}
function readBook(libraryEle) {
return "Already read '"+librar... | true |
db4dfb1704fbf001313786b527bd14dd2912949c | JavaScript | bkmaibach/andrewm-chatapp | /server/utils/users.test.js | UTF-8 | 2,201 | 2.796875 | 3 | [] | no_license | const {Users} = require('./users');
const expect = require('expect');
describe('Users', () => {
var testUsers;
beforeEach(() => {
testUsers = new Users();
testUsers.usersArray = [
{
id: 1,
name: "One",
room: "Test-A"
},{
... | true |
e5d6688be364d31a7e9dd01ade36e599d958bbae | JavaScript | anilesh-varma22/movies-fetchRedux | /src/Movies.js | UTF-8 | 1,221 | 2.671875 | 3 | [] | no_license | import React, {useState, useEffect} from 'react'
import { store, getMovies } from './Redux_movies';
const Movies=()=>{
const [movies, setMovies]=useState([]);
const [loading, setLoading]=useState(true);
const [error, setError]=useState(false);
useEffect(()=>{
store.subscribe(()=>{
... | true |
145d19ea98bbe0523b698270220618a4c77e0dc5 | JavaScript | jin0kim326/js-momentum | /bg.js | UTF-8 | 451 | 3.390625 | 3 | [] | no_license | const body = document.querySelector("body");
const IMG_NUMBER = 8;
function paintImage(imgNumber) {
const image = new Image();
body.style.background = `rgba(255,255,255,0.1) url(./imgs/${
imgNumber + 1
}bg.jpg) no-repeat center center/cover`;
}
function getRandom() {
const number = Math.floor(Math.random... | true |
b8fbe022d5f6bf6820490d31634249aa61358cf4 | JavaScript | raghavm100/leetcode-easy | /addDigits.js | UTF-8 | 481 | 3.59375 | 4 | [] | no_license | // ==== Problem Statement: https://leetcode.com/problems/add-digits/ ====
/**
* @param {number} num
* @return {number}
*/
var addDigits = function(num) {
// let loopCount = 0
let resultVal = 0
let rem = 0
while(num >= 10){
resultVal = 0
while(num !== 0){
rem = n... | true |
a74e7ba221199c2a97574b3dfd12c43af12313ef | JavaScript | Ninjaneer87/chuckopedia | /src/context/seenJokesContext.js | UTF-8 | 1,311 | 2.75 | 3 | [] | no_license | import React, { useCallback, useState } from "react";
import { createContext } from "react";
const savedJokes = JSON.parse(localStorage.getItem("seenJokes")) || [];
const SeenJokesContext = createContext({
seenJokes: [],
setSeenJokes: (jokes) => {},
addSeenJokes: (jokes) => {},
clearSeenJokes: () => {},
});
... | true |
639529abaf2e20223e84ff0cf177f41828f1d3b6 | JavaScript | norlowska/lastfm-battle | /src/components/User/User.js | UTF-8 | 2,609 | 2.828125 | 3 | [] | no_license | /*
* User
*
* Shows user's info and scrobbling stats.
*/
import React from "react";
import PropTypes from "prop-types";
import "./style.css";
export default function User(props) {
const { user, wins } = props;
// Display now playing track if exists
var nowPlaying = user.nowPlaying ? (
<div className="n... | true |
151e7031ea2fb8ed27051a0e92433b7f8e5dca7b | JavaScript | storkme/adventofcode | /src/day1.js | UTF-8 | 248 | 3.234375 | 3 | [] | no_license | //part1
document.body.innerText.trim().split('').reduce((a,n)=>a+(n=='('?1:-1),0)
//part2
//messy, just take the first result it prints
document.body.innerText.trim().split('').reduce((a,n,i)=>{if(a==-1){console.log(i)};return a+(n=='('?1:-1)},0) | true |
182672602ede0d952e2e680b1759eb85cb4f5ea9 | JavaScript | laialex501/save-the-beat-sheet-heroku | /routes/beat-sheet.route.js | UTF-8 | 4,730 | 2.75 | 3 | [] | no_license | const router = require("express").Router();
let BeatSheet = require("../models/beat-sheet.model");
const passport = require("passport");
const debug = require("debug")("beat-sheet.route");
// Authentication and authorization middleware
const { isLoggedIn, isAuthorizedBeatSheet } = require("../auth/auth-utils");
// HT... | true |
783a3a1ace1fc06218266386ff7be9029cee695c | JavaScript | pb25193/Mead-React | /expensify-app/src/tests/reducers/expenses.test.js | UTF-8 | 1,837 | 2.515625 | 3 | [] | no_license | import expensesReducer from '../../reducers/expenses';
import expenses from '../fixtures/expenses';
test('shoud set up default states', ()=>{
const state = expensesReducer(undefined, { type: '@@INIT' });
expect(state).toEqual([]);
});
test('shoud add an expense', ()=>{
const toAdd = {
description... | true |
43daec99fbc79ff2d4689a65f4e0c4776fe5ade1 | JavaScript | kyukyunyorituryo/Aozora_tts | /青空文庫朗読.js | UTF-8 | 1,588 | 3.234375 | 3 | [] | no_license | // -----------------------------------------------------------------------------
// 青空文庫朗読
// 説明 選択した文字列の青空文庫のルビを開いて読み上げる
//
// -----------------------------------------------------------------------------
var str = document.selection.Text;
str = AozoraRuby(str);
str = AozoraTag(str);
var spkr = new ActiveXObject('SAPI... | true |
1bbd4324208ce4c6c20a94ea33ed93960f152d20 | JavaScript | neveis/AlgorithmPractise | /MergeSort_JS/MergeSort.js | UTF-8 | 1,056 | 3.3125 | 3 | [] | no_license | /**
* lang:JavaScript
* 归并排序算法
* 1.对序列进行折半划分
* 2.假设左右序列分别有序,对左右序列合并排序
*
*/
'use strict'
function MergeArray(data, first, mid, last) {
var i = first;
var j = mid + 1;
var k = 0;
var temp = [];
//排序合并
while (i <= mid && j <= last) {
if (data[i] <= data[j]) {
temp[k++] = ... | true |
c4db41f7eb1e05d1cd925d89e886b5f0122b89ce | JavaScript | amamykeev/module.javascript | /teacherRole.js | UTF-8 | 248 | 2.515625 | 3 | [] | no_license | class TeacherRole {
constructor(teacher, subject) {
this.setTeacher(teacher);
this.setSubject(subject);
}
setTeacher(teacher) {
this.teacher = teacher;
}
setSubject(subject) {
this.subject = subject;
}
}
module.exports = TeacherRole; | true |
fca21e5ef95044030a11df53515dc92c814c4a4a | JavaScript | isery/learnyounode_result | /time_server.js | UTF-8 | 450 | 2.921875 | 3 | [] | no_license | var net = require('net');
var makeTwoDigits = function (value) {
if (value < 10) {
return '0' + value;
}
else {
return value;
}
};
net.createServer(function (socket) {
var date = new Date();
var result = date.getFullYear() + '-' +
makeTwoDigits(date.getMonth() + 1)+'-' +
makeTwoDigits(date.getDate()) ... | true |
b136710f2e85f467389e0a3261e2d895a5680cbe | JavaScript | AhmedRefaatA/tram_movies_js | /js/camera.js | UTF-8 | 1,246 | 2.671875 | 3 | [] | no_license | var video = document.querySelector("#videoElement");
var canvas = document.querySelector("#showscreenshot");
var container = document.querySelector("#container");
var img = document.querySelector("#profilePicture");
async function startCamera(){
if (navigator.mediaDevices && navigator.mediaDevices.ge... | true |
37570ce14f4b3d7aea3398e242d1d36d575f1d32 | JavaScript | JamesCube/ywmj-app | /src/static/js/case/service.js | UTF-8 | 4,633 | 2.59375 | 3 | [] | no_license | $(function() {
var caseId = GetQueryString("caseId"),
companyId = GetQueryString("companyId"),
userId = GetQueryString("userId"),
sourceType = GetQueryString("sourceType"),
appe = GetQueryString("appe"),
twitterId = GetQueryString("uid"), // 推客id
twitterType = GetQ... | true |
53dbc9cb3bed6e5827784ce1e52b7e5c0a9b8891 | JavaScript | codefellows/seattle-code-javascript-401d42 | /class-36/typed-demo/redux-votes/src/components/Votes.js | UTF-8 | 726 | 2.6875 | 3 | [] | no_license | import React from 'react';
// hook that allows us to connector to a store property
import { connect, useSelector } from 'react-redux';
function Votes(props) {
const totalVotes = useSelector(state => state.candidates.totalVotes);
return (
<section>
<p>Total Votes: {totalVotes}</p>
</section>
)
}
... | true |
98668ba57caa1152a689c288826e59ca95c0b8b1 | JavaScript | alexander-braun/algoprep | /Leetcode/PalindromicSubstrings.js | UTF-8 | 362 | 3.625 | 4 | [] | no_license | /**
* @param {string} s
* @return {number}
*/
var countSubstrings = function (s) {
let count = 0;
for (let i = 0; i < s.length; i++) {
for (let j = i; j < s.length; j++) {
if (test(s.slice(i, j + 1))) {
count++;
}
}
}
return count;
};
const test = (s) => {
return s.split('').re... | true |
04ce8e4e87df5e96e0d19d6a70a4a7930e13ff5b | JavaScript | karthikp-ubc/CPEN400A-codesamples | /exams/midterm-2020/Q8-DOM-Manipulation/Solution.js | UTF-8 | 590 | 3.015625 | 3 | [] | no_license | function wrapTest(node, className){
if (node.nodeType === 3 && node.nodeValue.trim()){
var span = document.createElement('span');
span.className = className;
node.replaceWith(span);
span.appendChild(node);
return 1;
}
else if (node.nodeType === 1 && node.className.ind... | true |
d22329df3068dda5e8946539088aee24e65169bf | JavaScript | Junhue94/chat_app | /public/js/index.js | UTF-8 | 5,365 | 2.5625 | 3 | [] | no_license |
$(document).ready(function () {
// Run multiple versions of jQuery
$.noConflict();
// Variables
var $userName = $('#user-name'),
$userMatricNo = $('#user-matric-no'),
$userList = $('#user-list'),
$userDetailsName = $('#user-details-name'),
$userDetailsMatricNo = $('#u... | true |
0bc407831a862dd2a21bb32bc5822b967ac1fc4c | JavaScript | renudesu/contacts-app | /src/services/contactService.js | UTF-8 | 392 | 2.65625 | 3 | [] | no_license | class Contact {
_contacts = [];
_selectedContact = {};
addContacts(value) {
this._contacts.push(value);
}
getContacts() {
return this._contacts;
}
selectedContact(value) {
this._selectedContact = value;
}
getSelectedContact() {
return this._selectedCo... | true |
c4bf9dd41cb9250acccac91956fab730c20b6c10 | JavaScript | ashvora1/healthyFutures | /models/emis.mobile.LogModel.js | UTF-8 | 1,987 | 2.515625 | 3 | [] | no_license | /**
* Model Class to interface the log data with the local memory Functionalities provided: Save the logs Retrieve the logs
* from the memory
*/
ENTITY_LOG = "Log";
emis.mobile.LogModel = function( ) {
this.storage = new emis.mobile.Storage( );
}
emis.mobile.LogModel.prototype.save = function( LogJson... | true |
1af5b96cc52c950b8e5c31e4306f953075ab85a8 | JavaScript | Mahadevan007/terraform-serverless-rds-connect | /Serverless/rds-test/handler.js | UTF-8 | 475 | 2.59375 | 3 | [] | no_license | const connectToDatabase = require("./db"); // initialize connection
// simple Error constructor for handling HTTP error codes
function HTTPError(statusCode, message) {
const error = new Error(message);
error.statusCode = statusCode;
return error;
}
module.exports.healthCheck = async () => {
await connectToDat... | true |
1a2352a2d3a810b92bb532a33bcb3d750001fb02 | JavaScript | TzvetanIG/JavaScript-App | /BaaS-and-Parse.com/data-base-functions.js | UTF-8 | 9,458 | 2.703125 | 3 | [] | no_license | var ParseComDB = (function () {
function ParseComDB(parseAppId, parseRestApiKey) {
this._headers = {
"X-Parse-Application-Id": parseAppId,
"X-Parse-REST-API-Key": parseRestApiKey
};
}
ParseComDB.prototype.setTableName = function (tableName) {
this._t... | true |
be7aa57115aa13e09a6991fee923c10dc3128485 | JavaScript | natedaly/cloudywaters | /lib/util.js | UTF-8 | 1,353 | 3.125 | 3 | [] | no_license | // Returns the user object for the current player.
currentPlayer = function() {
return Meteor.user();
}
// Returns the Id for the current player.
currentPlayerId = function() {
return Meteor.userId();
}
// Sets the current room given a roomId.
setCurrentRoom = function(roomId) {
Session.setPersistent("cur... | true |
664d14aacc1b053e74228bd66c5676e321723e5c | JavaScript | peter-slattery/just_a_website | /blog-functions.js | UTF-8 | 1,467 | 2.8125 | 3 | [
"MIT"
] | permissive | function BlogPostSortFunction (A, B)
{
if (A.hash < B.hash) { return -1; }
if (A.hash > B.hash) { return 1; }
return 0;
}
function SketchSortFunction (A, B)
{
if (A.hash > B.hash) { return -1; }
if (A.hash < B.hash) { return 1; }
return 0;
}
function GetOrderedPostLUT (UnorderedBlogPosts, PrefixLength, SortProc... | true |
b98e0c4acb8a418005d508af943a607cc8d5a902 | JavaScript | mairiv/kekstagram | /js/form.js | UTF-8 | 2,937 | 3.140625 | 3 | [] | no_license | 'use strict';
(function () {
var inputHashtag = document.querySelector('.text__hashtags');
var submitButton = document.querySelector('#upload-submit');
var form = document.querySelector('.img-upload__form');
var imgError = document.querySelector('.img-upload__message--error');
var Hashtags = {
SHARP_POSI... | true |
41a0fad99f47e88345066df76cf1684ce5d219fa | JavaScript | MBoddah/shoppanel | /filter.js | UTF-8 | 4,864 | 2.75 | 3 | [] | no_license | function initFilter() {
const typeSelector = document.querySelector('.type-selector');
const vendorSelector = document.querySelector('.vendor-selector');
const filterButton = document.querySelector('.accept-filters');
const minPriceSelector = document.querySelector('#min-price');
const maxPriceSelec... | true |
751f602f8e24dc1fceb0f85b57d5c12c32d1c20a | JavaScript | chris-creditdesign/nature-mosaic | /site/scripts/main.js | UTF-8 | 2,832 | 2.65625 | 3 | [] | no_license | $(function() {
var header = $(".fixed-header");
var offset = 0;
if (header.length > 0) {
offset = header.offset().top;
}
var nav = $("#top-nav");
var headerLogo = $(".header-logo");
var headerButtons = $(".header-buttons");
var pushLeft, pushDown;
/* Store mouse possition for tweet button on
content sel... | true |
03d2b613573720ee57fca868c7f0c4057bc2d3d0 | JavaScript | zuixjs/zuix | /src/js/helpers/Logger.js | UTF-8 | 5,187 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2015-2023 G-Labs. All Rights Reserved.
*
* https://zuixjs.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE... | true |
e31ae5ceff9e5b5d4987e7c90c37b71fbedb450a | JavaScript | SebGustin/chessTD | /jstd/class/GameLogic.js | UTF-8 | 2,032 | 2.875 | 3 | [
"MIT"
] | permissive | var GameLogic = function(){
// extends Base
//var parent = new Base();
var base = new Base();
var private = {};
private.iteration = 0;
private.isPaused = false;
base.start = function() {
/* ... */
if(!private.isPaused) {
console.log('start');
... | true |
f3ce7871b66b8782286cc4fc5edf3adc4aaa8337 | JavaScript | canIgit/react-main-concepts | /composition-1.js | UTF-8 | 602 | 2.78125 | 3 | [] | no_license | function FancyBorder(props) {
return (
<div className={'FancyBorder FancyBorder-' + props.color}>
{props.children}
</div>
);
}
function WelcomeDialog() {
return (
<FancyBorder color="blue">
<h1 className="Dialog-title">
Welcome
</h1>
<p className="Dialog-message">
... | true |
6668b22ec5bd84800538f804da15c73a1fb4bb22 | JavaScript | prajaktajoshi2390/fileuploadapp | /src/services/GetUserDetails.js | UTF-8 | 632 | 2.65625 | 3 | [] | no_license | import axios from "axios";
const GetUserDetails = (event) => {
return new Promise((resolve, reject) => {
axios.put("https://6yodq3t2a1.execute-api.us-east-2.amazonaws.com/Dev", {
username: event.username
})
.then(function (response) {
const firstname = response.data[... | true |
578f22de58f07ed172944ce20967e85900a0e1e0 | JavaScript | HalkinK/goit-js-hw-11-color-switch | /index.js | UTF-8 | 941 | 3.15625 | 3 | [] | no_license | const colors = [
'#FFFFFF',
'#2196F3',
'#4CAF50',
'#FF9800',
'#009688',
'#795548',
];
const startBtn = document.querySelector('[data-action="start"]');
const stopBtn = document.querySelector('[data-action="stop"]');
const bodyRef = document.querySelector('body');
startBtn.addEventListener('click', onBtnSt... | true |
05d40688aa06f4b009f03501f80cadce813ae14a | JavaScript | Ditmar/experimentalserver | /changeData.js | UTF-8 | 1,261 | 2.53125 | 3 | [] | no_license | const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/moviedb');
var Schema = mongoose.Schema;
var thingSchema = new Schema({}, { strict: false });
var moviesdb = mongoose.model('movies', thingSchema);
//var moviesdb = mongoose.model('category', thingSchema);
var cc = 0;
moviesdb.find({}).exec((er... | true |
2320daedf853d45109641545cc5483fec75ed1c2 | JavaScript | kaloudiyi/book-trading-club | /client/src/reducers/ask_reducer.js | UTF-8 | 568 | 2.609375 | 3 | [] | no_license | import { INIT_ASK, ADD_ASK, REMOVE_ASK } from '../actions/types';
const initialState = { trAsk: [] };
export default function(state = initialState, action) {
switch (action.type) {
case INIT_ASK:
return { trAsk: action.payload };
case ADD_ASK:
return { trAsk: [...state.trAsk, action.payload] };
... | true |
9c2470e310756c3af5c2fb3a84eb89619998dd32 | JavaScript | oceandeng/ship | /public/javascripts/index.js | UTF-8 | 7,054 | 2.890625 | 3 | [] | no_license | /* requestAnimationFrame.js
* by zhangxinxu 2013-09-30
*/
(function() {
var lastTime = 0;
var vendors = ['webkit', 'moz'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
window.cancelAni... | true |
0449d2e50288ff2764dba6e9c6438cfd85d0f4f8 | JavaScript | mateuscostaluz/webmoderno | /05_funcao/desafioFuncaoConstrutora.js | UTF-8 | 288 | 4 | 4 | [] | no_license | function Pessoa(nome) {
this.nome = nome // se não utilizar "this.nome = nome" não será possível alterar o atributo
this.falar = function () {
console.log(`Meu nome é ${this.nome}`) // pode ser utilizado sem o "this.nome"
}
}
p1 = new Pessoa('João')
p1.falar() | true |
01207c9c71c18bd52207208a966c67ff8f3d65de | JavaScript | Kerrenkerren/project | /conditions-task.js | UTF-8 | 908 | 3.46875 | 3 | [] | no_license |
const numberOfFilms = prompt('Сколько фильмов вы уже посмотрели?', '');
const personalMovieDB = {
count: numberOfFilms,
movies: {},
actors: {},
genres: [],
private: false
};
for (let i = 0; i < 2; i++) {
let movie = prompt('Один из последних просмотренных фильмов?', ''),
rating = prompt('На ско... | true |
18a7f06e42db79dc4c5bd6ec5e2fb9a69c2c9f9f | JavaScript | chenxiaoyu233/B-S-Web-News-Distribut | /script/author.js | UTF-8 | 1,694 | 2.953125 | 3 | [] | no_license | var welcomePic = document.querySelector('img#welcome-pic');
var authorMark = document.querySelector('div.author-mark');
var head = document.querySelector('nav.head');
// state
var mouseDownOnHeadFlag = 0;
var delDisY = 0;
var initPosY = 0;
function init() {
welcomePic.style.height = '0px';
welcomePic.style.wid... | true |
8dd6eaf2716b079ea8d0870f1fefab52d2842969 | JavaScript | josefluigihuarangachate/appAki | /layouts/design/js/crud/dialogalert.js | UTF-8 | 9,144 | 2.515625 | 3 | [] | no_license | function DialogAlert(status, msg, ruta) {
if (ruta === "") {
if (status.trim() === "Ok" || status.trim() === "ok") {
var dialogalert = "";
dialogalert += '<div class="modal fade dialogbox" id="DialogOk" data-bs-backdrop="static" tabindex="-1" role="dialog">';
dialogalert ... | true |
3fba32c3ce8be1295a0655b89dd0bd565a546331 | JavaScript | hoyangtsai/javascript-patterns | /chapter6/classical_no5.js | UTF-8 | 544 | 3.84375 | 4 | [] | no_license | // 父建構式
function Parent(name) {
this.name = name || 'Adam';
}
// 在原型中新增功能
Parent.prototype.say = function() {
return this.name;
};
function inherit(C, P) {
var F = function () {};
F.prototype = P.prototype;
C.prototype = new F();
}
// 空的子建構式
function Child(name) {}
// 繼承的魔法
inherit(Child, Parent);
var ki... | true |
db5b78531b2a7f9e4d99cb0a7725e87cd9ac038b | JavaScript | zaidohassan/shelfie | /src/components/Dashboard/Dashboard.js | UTF-8 | 1,344 | 2.59375 | 3 | [] | no_license | import React, { Component } from "react";
import Product from "../Product/Product";
import "./Dashboard.css";
import axios from "axios";
export default class Dashboard extends Component {
constructor() {
super();
this.state = {
inventoryList: []
};
this.deleteButton = this.deleteButton.bind(thi... | true |
dc2e45689ab2bfa88079fc632b10ff7170b62917 | JavaScript | ashverma1810/node3-weather-website | /src/utils/forecast.js | UTF-8 | 959 | 2.640625 | 3 | [] | no_license | const request = require('request')
const getForecast = (long, lat, callback ) => {
const urlDarkSkyWeather = 'https://api.darksky.net/forecast/22f5aab36943fae4c4d270146e4a7005/' + long + ',' + lat + '?units=si'
request ({url: urlDarkSkyWeather, json: true}, (error, response) => {
// console.log (respon... | true |
cb8e88b816b06807c9f524d662af51fc3d9dce1f | JavaScript | walkunderrain/additional_7 | /src/index.js | UTF-8 | 1,091 | 3.140625 | 3 | [
"MIT"
] | permissive | module.exports =
function solveSudoku(matrix) {
for (let row = 0; row < 9; row++)
{
for (let col = 0; col < 9; col++)
{
if (matrix[row][col] === 0)
{
let variants = getVariants(row, col);
for (let variant of variants)
{
... | true |
86949ee62fb9b21584af4f2bf7790815e5c6cdf5 | JavaScript | AllenYangFly/codeAnywhere | /es6/14_Iterator/Iterator.js | UTF-8 | 2,004 | 4.53125 | 5 | [] | no_license | // 一个数据结构只要具有Symbol.iterator属性
// ES6中有类数据结构,原生具有Itertor接口。数组,类数组对象,Set与Map
// 1.数组的Iterator,通过数组实例的Symbol.iterator属性
{
let arr = ['a', 'b', 'c'];
let iter = arr[Symbol.iterator]();
console.log(iter.next());
}
// 2.自定义对象,部署iterator
{
class RangeIterator {
constructor(start, stop) {
this... | true |
ebe7e67eeadbca7b8eb09e2436470f277bc22116 | JavaScript | thegreimor/Keepcoding-JS-Katas | /Kata3/index.js | UTF-8 | 1,781 | 3.75 | 4 | [] | no_license | 'use strict'
/*
Baraja
Cantidad - 52
Palos
Picas
Valores
*2
*3
*4
*5
* 6
* 7
* 8
* 9
* 10 /Ten (T)
* dama/Jack (J)
... | true |
1a474724327ac7071c6ce3567578ad9375e37d1d | JavaScript | sambhavu/javascript_basics | /demo/confirm_leave.js | UTF-8 | 156 | 3.1875 | 3 | [] | no_license | var result = confirm("Do you really want to leave this page?");
if(result==true)
{
alert("Goodbye");
}
else{
alert("Thanks for staying");
}
| true |
169149a93e367351897a6807e8e1ee0066cab0b6 | JavaScript | awwright/contenttype | /contenttype.js | UTF-8 | 4,583 | 2.734375 | 3 | [
"Unlicense"
] | permissive | // Licence: PUBLIC DOMAIN <http://unlicense.org/>
// Author: Austin Wright <http://github.com/Acubed>
function MediaType(s, p){
this.type = '';
this.params = {};
if(typeof s=='string'){
var c = splitQuotedString(s);
this.type = c.shift();
for(var i=0; i<c.length; i++){
this.parseParameter(c[i]);
}
}else... | true |
3730299a0bb0aa2c1b26f84f05c5a70111ef57cf | JavaScript | solispauwels/miflora-raspberry-gateway-frontend | /src/app.js | UTF-8 | 932 | 2.515625 | 3 | [] | no_license | import React from 'react'
import Picture from './picture/picture'
import List from './list/list'
import Charts from './chart/charts'
import config from './config'
import './app.scss'
export default class App extends React.Component {
constructor (props) {
super(props)
this.state = {
items: [],
... | true |
31b36e9f0abb7260284a4cdfbcc57e94fcc13c2e | JavaScript | Jeremy-Jonas/js-calculator | /script.js | UTF-8 | 1,731 | 3.296875 | 3 | [] | no_license | var inputVal = '';
var total = 0;
var currentOperation = '+';
document.onload = refreshDisplay;
function digit(num) {
inputVal += num;
var decimalPoint = function (){
if(num === "decimal") {
inputVal = inputVal + '.'
}
}
refreshDisplay();
}
... | true |
e225c4fe0aaa38f51305267307cb6090582ddac7 | JavaScript | danielpradaaa/clima-app-node | /app.js | UTF-8 | 1,057 | 3.359375 | 3 | [] | no_license | const place = require('./place/place');
const climate = require('./climate/climate');
const argv = require('yargs').options({
direction: {
alias: 'd',
description: 'City to search',
demand: true,
}
}).argv;
console.log('Parámetro ingresado: ' + argv.direction);
// place.get_Lat_Long(ar... | true |
821dabd52930b35e05eb6ffbbcda49b630162a24 | JavaScript | andrewjprice/react-chess | /src/bitboard/bitBoard.js | UTF-8 | 2,068 | 2.984375 | 3 | [] | no_license | /*
Represents a 64 bit unsigned int.
*/
import { u32, bitScanForward } from './utils/32bit';
export default class BitBoard {
constructor(lower, upper) {
this.lower = u32(lower);
this.upper = u32(upper);
}
copy() {
return new BitBoard(this.lower, this.upper);
}
setBit(i... | true |
594a7324f461bcbdb995befa8582f23507226736 | JavaScript | rachelruntu/tugas | /Day 11 - 20/day14/index.js | UTF-8 | 847 | 3.375 | 3 | [] | no_license | // var a=0.6-0.2
// console.log(Math.floor(a))
// var b=a==0.3
// console.log(b)
//cek kekuatan password jangan pake simbol . harus huruf besar dan kecil dan number
//jangan pake regex
// let u=1
// let s=-1
// let t=1
// let b=-1
// var awal=0==u+u+s+t+b+s
// console.log(awal)
// var modus=[1,2,2,2,2,3,4,5,6,7,7,7... | true |
8f275142caf832e1bc0d8fe1239b3379664e0b98 | JavaScript | Harish-Velmurugan/viggi | /src/Components/Survey/TakeSurvey.jsx | UTF-8 | 9,335 | 2.5625 | 3 | [] | no_license | import React, { useState } from "react";
import { Modal, Button, Form } from "react-bootstrap";
import axios from "axios";
class TakeSurvey extends React.Component {
constructor(props) {
super(props);
this.state = {
show: false,
setShow: false,
ans: [],
choice: [],
surveyID: prop... | true |
d928a53c93fbf3c96c2537ff7ab0e448557384f3 | JavaScript | TechnoConserve/grow-with-google | /phase_1/lesson_21/designs.js | UTF-8 | 845 | 2.65625 | 3 | [
"MIT"
] | permissive | // Select color input
$("#colorPicker").spectrum({
color: "#1400ff"
});
// Select size input
let heightInput = $("#inputHeight");
let widthInput = $("#inputWidth");
let gridHeight = heightInput.val();
let gridWidth = widthInput.val();
makeGrid();
// When size is submitted by the user, call makeGrid()
$("#sizePick... | true |