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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
843e8c535896139c61a8845cb2b02579e4c51ce2 | JavaScript | AFeese/Code-Quiz | /scores.js | UTF-8 | 875 | 3.6875 | 4 | [] | no_license | // Declared variables, using DOM to select area to use for scoring.
var finalScore = document.querySelector("#finalscores");
//Obtaining final scores from the client-side local storage until cleared by user.
var allScores = localStorage.getItem("allScores");
allScores = JSON.parse(allScores);
if (allScores !== null)... | true |
1b2fface382fc40fe7f572fede4a4a325e21d444 | JavaScript | Mah-D/DwarfCucumber | /lib/tint.js | UTF-8 | 2,302 | 2.640625 | 3 | [
"MIT"
] | permissive | /*jshint node:true*/
/**
* Terminal string coloring and styling
*/
'use strict';
var proc = process; // used for stubbing
var tint = module.exports;
var styles = tint.styles = {};
var props = {};
var colorEnabled = true;
// define ansi escape codes: <key> : [<open code>, <close code>]
var codes = {
reset: [0, ... | true |
c65d88d4df12a406829a7e5a719eeb6476fa4590 | JavaScript | Botazio/UCD-DublinBus | /frontend/src/components/stop-bus-arrivals/StopBusArrivals.js | UTF-8 | 2,639 | 2.5625 | 3 | [
"MIT"
] | permissive | import { useTheme } from "@material-ui/core";
import { useState } from "react";
import useFetch from "../../helpers/useFetch";
import Waiting from "../../reusable-components/waiting/Waiting";
import StopBusArrivalsCSS from "./StopBusArrivals.module.css";
import PrimaryPagination from "../../reusable-components/custom-p... | true |
81aab630a33e6e0feaf89b8a6316461fdf467dbb | JavaScript | kmlproduct/getAllDiv | /main.js | UTF-8 | 562 | 2.921875 | 3 | [] | no_license |
document.querySelector("button").onclick = function(){
var myDivParent = document.querySelectorAll(".dis-none");
var myArray = ["container", "container2", "container3", "container4"];
RandomClass = Math.floor(Math.random() * myArray.length);
console.log(RandomClass);
var AllDiv = document.... | true |
e363efd804ee2d11fa6d17d25c74657c9d100a47 | JavaScript | ViaxCo/todolist-v3-react-netlify-functions | /functions/db/defaultItems.js | UTF-8 | 657 | 2.78125 | 3 | [
"MIT"
] | permissive | const { Item } = require("./models");
// Original task items
const item1 = new Item({
task: "Welcome to your todo list",
completed: false,
});
const item2 = new Item({
task: "Hit the + button to add a new item",
completed: false,
});
const item3 = new Item({
task: "Hit the delete button to delete an item",
... | true |
4cc04c404e226d256a53817094f7f9e0d89d226f | JavaScript | kk00563160/techmahindra-training | /task-codes/product-app/src/product-maneger.js | UTF-8 | 1,129 | 2.984375 | 3 | [] | no_license | 'use strict'
document.getElementById('p1').innerHTML = `<b>Hello</b>`
//manager object
const productManager = function () {
const productExists = (id) => {
//debugger
let status;
for (let index = 0; index < products.length; index++) {
const productObj = products[index];
... | true |
c183d70e20ffce9fa6dfb1322b0c46bc2564882a | JavaScript | thoang21/RVRCommitmentProject | /main.js | UTF-8 | 10,761 | 3.921875 | 4 | [
"MIT"
] | permissive | /* The code below is set up to demonstrate three functions that run on the Sphero RVR. Each function runs a single stage.
Stage one: drive forward three VEX field tiles (120 cm) using a PID algorithm at a heading of 90 degrees.
Note: This uses the y-coordinate of the robot as the setpoint.
Stage two - make a 90 degr... | true |
d61b9b67913bbba9fcd75045d12da71eded13001 | JavaScript | bgpoythress/jarvis | /ModelState.js | UTF-8 | 5,274 | 3.046875 | 3 | [] | no_license | //ModelState.js
//Written by Brandon Poythress
//25APR2018
//Description:
//This is the top level model class
function ModelState(){
//Inherits from ModelObject but because it is the top level object
//it does not use id, parentId, or parentDirtyListCallback so they
//are set to null. It also does not need Mode... | true |
f2a655887a713745d77ce0fac90b8e485764532a | JavaScript | npatel023/Algorithms | /sortByHeight/sortByHeight.js | UTF-8 | 868 | 3.734375 | 4 | [] | no_license | function sortByHeight(a) {
//find all -1s and place the index in an array
const tree = function(){
let arr = [];
for(let i = 0; i < a.length; i++){
if(a[i] === -1){
arr.push(i);
}
}
return arr;
}
const getPeople = function(){
... | true |
bf47129485295816bce277aa619296b82e7d027a | JavaScript | IanaBabanu/closures-prototypes-oop | /prototypes.js | UTF-8 | 1,048 | 3.4375 | 3 | [] | no_license | const Developer = function(name, experience, language) {
this.name = name;
this.experience = experience;
this.language = language;
}
Developer.prototype.getStartYear = function() {
return `${this.name} works since ${new Date().getFullYear() - this.experience}`;
}
Developer.prototype.getLanguage = fun... | true |
46afeea68c53345e1d9acd0bb42f9084b94c1446 | JavaScript | garethhunt/timer-react | /src/RunTimer.js | UTF-8 | 1,294 | 2.8125 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
import formatTime from './formatTime';
import './RunTimer.css';
class RunTimer extends Component {
constructor(props) {
super();
this.state = {
phase: 'countdown',
...props.config
}
}
changePhase() {
var newPhase;
switch(this.state.phas... | true |
48069b2e5b4f45955fd1c2a48e288ff545a3b6e3 | JavaScript | BrokenArmsOw/brokenarmsow.github.io | /js/PckReplay/DonneesReplay/DossierReplay.js | UTF-8 | 2,363 | 2.5625 | 3 | [] | no_license | /**
* Generated On: 2018-5-12
* Class: DossierReplay
*/
import Dossier from '../../Donnees/Dossier.js';
import FichierReplay from './FichierReplay.js';
class DossierReplay extends Dossier {
constructor(Nom){
super();
this.nom = Nom;
this.nombreFichiers;
this.fichiers = new Map();
}
/*
* @return
*
*/
... | true |
4235bab83fb2a665f79996797594c37c819cc46e | JavaScript | troufster/fulbot | /resourceManager.js | UTF-8 | 1,610 | 2.609375 | 3 | [] | no_license | "use strict";
var fs = require('fs');
var ResourceManager = function(){
var resourcePath = './resources/';
function writeFile(filename, data, _cb) {
fs.open(filename, 'w', 666, function(err, d) {
if(err) {
_cb(err);
}
return fs.write(d, data, null, undefined, function(err, written... | true |
93cb1ef3bf7c103f14af4632972b68a01b1ff686 | JavaScript | Ma-Zhuang/Game | /core/TimeOut.js | UTF-8 | 525 | 2.890625 | 3 | [] | no_license |
//超时简单小功能
function TimeOut(timeOut)
{
this.startTime = 0;
this.timeOut = timeOut;
}
//设置超时时间
TimeOut.prototype.setTimeOut = function(timeOut)
{
this.timeOut = timeOut;
}
//是否超时
TimeOut.prototype.isTimeOut = function()
{
var delta = Date.now() - this.startTime;
if(delta >= this.tim... | true |
520eaf758e45affb2d6d4da9b8e8c53fb7455500 | JavaScript | jesusemendoza/whiteboard-challenges | /00-template/__test__/solution.test.js | UTF-8 | 1,094 | 3 | 3 | [
"MIT"
] | permissive | 'use strict';
const solution = require('../lib/solution');
const SLL = require('../lib/sll')
require('jest');
describe('Solution Module', function() {
describe('#Two Largest', function() {
let sll = new SLL();
sll.insertHead(0);
sll.insertEnd(1);
sll.insertEnd(2);
sll.insertEnd(3);
sll.... | true |
c9b9ad3cf82863d7466272eaf8db88e2ab9e9a48 | JavaScript | severi/spin_prototype | /Prototyp/js/app.js | UTF-8 | 8,271 | 2.609375 | 3 | [] | no_license | function App(){
var self = this;
//INIT 3D SCENE
if(self.init()){
self.addEventListener();
self.renderScene();
self.introLevel();
}
}
App.prototype.loadSettings = function(){
var self = this;
var tCubeRadius;
self.fps = settings.fps;
self.rows = settings.rows;
self.cubeSize = settings.cubeSize;
s... | true |
4b6bb08b2089a605fc986b8da18686336cbbcc8f | JavaScript | albatrocity/belly-flop | /lib/calendar.js | UTF-8 | 1,203 | 2.59375 | 3 | [] | no_license | const formatter = require('./formatter')
function getDescription(event, options) {
let description = event.info || ''
if ( options.bandsInDescription && event.bands.length ) {
if (description != '') { description = `${description}\n`}
description = `${description} ${event.bands.map(b => b.name).join(', ')}... | true |
ea6a37805a9907931f8dd349b4f2f9c22624c418 | JavaScript | coder11233/crashing-tram-pilot | /sketch.js | UTF-8 | 2,604 | 2.625 | 3 | [] | no_license | const Engine = Matter.Engine;
const World= Matter.World;
const Bodies = Matter.Bodies;
const Constraint = Matter.Constraint;
var engine, world;
var bg, ground;
var boggie1, boggie2, boggie3;
var chain1;
var trainSound, crashSound;
var flag = 0;
function preload() {
bg= loadImage("images/bg.jpg");
... | true |
a6d058fc0ddea09b6aa9c69376f01df1345c82c3 | JavaScript | Addi-11/Yelp-Camp | /ver4/seeds.js | UTF-8 | 3,360 | 2.546875 | 3 | [] | no_license | var mongoose = require("mongoose");
var Campground = require("./models/campgrounds");
var Comment = require("./models/comments");
var campground = [
{name : "Salmon Creek",
image : "https://proxy.duckduckgo.com/iu/?u=http%3A%2F%2Fd2y0su6ixv655t.cloudfront.net%2Fwp-content%2Fuploads%2F2016%2F03%2F1611... | true |
e9efc906c985062987eb83ba3ebc8c0de69bef53 | JavaScript | leifoolsen/webpack2-boilerplate | /src/utils/js-xpath.js | UTF-8 | 6,397 | 3.828125 | 4 | [
"MIT"
] | permissive | /**
* Access JavaScript objects using XPath
* @author Leif Olsen
*/
import isNumeric from './is-numeric';
import isObject from './is-object';
/**
* Wrap a key
* @param key
* @returns {String} The key wrapped in brackets if the key is numeric,
* otherwise the key is prefixed with a '/'
*/
con... | true |
cfc105462f23889fc95d42471a431f29ac7586a5 | JavaScript | SoftUni-Internal/OpenJudgeSystem | /automated_testing/update_restore_queries/helpers/graphs.js | UTF-8 | 2,099 | 2.640625 | 3 | [] | no_license |
const {
isNil,
} = require('./checkers');
const {
getDepedenciesQuery,
} = require('./queriesBuilder');
const buildDependencyGraph = async (sql, tableNames) => {
const depsQuery = getDepedenciesQuery(tableNames);
const { recordset: edges } = await sql.query(depsQuery);
const graph = tableNames.r... | true |
f28c0789baaa015c7a1ef1be384bcfef39f0fb65 | JavaScript | diketso-setho16-ITvarsity/Module-11-Assessment-3 | /js/js.js | UTF-8 | 2,816 | 2.90625 | 3 | [] | no_license | var rooPath;
function init(){
rootPath = "https://mysite.itvarsity.org/api/mini-blog/";
document.getElementById("getAll").addEventListener("click", getAllPosts);
document.getElementById("getPopular").addEventListener("click", getPopularPosts);
document.getElementById("getLatest").addEventListener("clic... | true |
fbbcf7495157b2ca12d20c29bdf4553756d628f5 | JavaScript | ClockworkNet/cwfm | /models/playlist.js | UTF-8 | 2,456 | 2.578125 | 3 | [] | no_license | exports.build = function(mongoose, toJSON) {
var name = 'Playlist';
var schema = mongoose.Schema({
name: String,
description: String,
owners: [{ type: mongoose.Schema.Types.ObjectId, ref: 'User' }],
songs: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Song' }]
});
schema.methods.toJSON = function() {
va... | true |
fe2a99aa9dabd42879028cf3c1a43db2050c0ccf | JavaScript | peanra/Form3 | /js/services/selectService.js | UTF-8 | 895 | 2.875 | 3 | [] | no_license | // Factory permettant la récupération des données des listes déroulantes.
angular.module('myApp')
.factory('SelectFactory', function(){
var selectFactory = {};
// Données de la liste déroulante "Poste".
selectFactory.postes = [{
nom : 'Dev',
id: 1
},
{
nom: 'CP',
id: 2
},
{
nom: 'MOA',
... | true |
cae7788a3b07d651940200904366131ed0bac658 | JavaScript | Iandonmorgan/movies-practice | /src/scripts/movieManager.js | UTF-8 | 721 | 3.328125 | 3 | [] | no_license | const movieHTML = (movie) => {
return `
<div class="movieItem">
<p class="movieTitle">${movie.title}</p>
<p><img src="${movie.image}" alt="${movie.title}"></p>
<p class="movieText">Released: ${movie["release-date"]}</p>
<p class="movieText">${time_conv... | true |
30134bfc152d67209c62807e946b99ab4cb90b6d | JavaScript | reprograma/On11-TodasEmTech-Javascript-I | /exerciciosParaCasa/alunas/nathaliaMicheloni/exercicio08.js | UTF-8 | 1,256 | 3.78125 | 4 | [] | no_license | // Exercício para casa nº 8:
/*
* João, Pescador, comprou um microcomputador para controlar
* o rendimento diário de seu trabalho. Toda vez que ele traz
* um peso de peixes maior que o estabelecido pelo regulamento de
* pesca do estado de São Paulo (50 quilos) deve pagar uma multa
* de R$ 4,00 por quilo exceden... | true |
a719895d77081d6b096918d31f236dbd5214d095 | JavaScript | labsvisual/razorpay-sdk | /lib/base/entity-base.js | UTF-8 | 1,504 | 2.828125 | 3 | [
"MIT"
] | permissive | const { CaseConverter } = require( '../utils' );
/**
* Defines the base class for all the entities.
* @virtual
* @requires module:utils/CaseConverter
*/
class EntityBase {
/**
* Initializes a new instance of the EntityBase class.
* @param {String} entityName the name of the entity extended from this... | true |
4d376794b6b522fd07a87b0ec530c43b0a67bcc6 | JavaScript | gkuzlo/Bardia | /src/layout/UI.Material.js | UTF-8 | 5,887 | 2.625 | 3 | [
"MIT"
] | permissive | /**
*
*/
UI.Material = Class.create({
/**
*
* @param config
*/
initialize: function(config) {
this.config = Object.extend({
inside: window.document.body,
effect: "from-left",
position: "top:100px; left:100px; width:500px; height:500px",
modal: fals... | true |
e0f9654984a5b4959b367ccffa39633963477577 | JavaScript | PoisonusPanther/Mobilenet | /main.js | UTF-8 | 802 | 2.515625 | 3 | [] | no_license | Webcam.set({
height: 250,
width: 250,
image_type: "png",
png_quality: 50,
constraints:{
facing_mode: "environment"
}
});
Webcam.attach("#camera");
function snapshot(){
Webcam.snap(function (data_uri){
document.getElementById("snapshot").innerHTML = "<img id='picture' src=... | true |
47d4f70bd39859bb6052b95476600eaee5dd0f3e | JavaScript | alto94320/uno_c2i_1016 | /app.js | UTF-8 | 1,524 | 2.640625 | 3 | [] | no_license | const path = require('path');
var express = require('express');
var http = require('http');
var app = express();
var port = 3000;
var fs = require('fs');
var handler = function handler(req, res) {
var filePath = req.url;
if (filePath == '/') {
filePath = './public/index.html';
} else {
fileP... | true |
4e9de0af5f89ae258160d08cdd25db3e6ceaf0ad | JavaScript | SHISME/LeetCode | /src/171/index.js | UTF-8 | 1,182 | 3.5625 | 4 | [] | no_license | /*
* @lc app=leetcode id=171 lang=javascript
*
* [171] Excel Sheet Column Number
*
* https://leetcode.com/problems/excel-sheet-column-number/description/
*
* algorithms
* Easy (50.71%)
* Total Accepted: 265.2K
* Total Submissions: 496.7K
* Testcase Example: '"A"'
*
* Given a column title as appear in a... | true |
be3b9fedf341905d344edfd71c1e2d7080dff752 | JavaScript | Reed-Schimmel/enventor | /screens/LinksScreen.js | UTF-8 | 858 | 2.515625 | 3 | [] | no_license | //Description: This file provides the description for the links.
import React from 'react';
import { ScrollView, StyleSheet } from 'react-native';
import { ExpoLinksView } from '@expo/samples';
//Description of the function LinksScreen:
//@pre None
// @post main function for link screen
// @param No... | true |
87b0d9369c4925306be5f7cd8d6d263918a0e98b | JavaScript | nvbcode/StarvingArtists | /public/js/app.js | UTF-8 | 7,894 | 3.09375 | 3 | [] | no_license |
$(function () {
// SIGN IN FUNCTION
const signIn = function (e) {
e.preventDefault();
signInData = {
user_name: $('#userName').val(),
password: $('#password').val()
};
console.log(signInData);
$.ajax({
method: 'POST',
url:... | true |
ebc59851dfb21cda81aeef29fb91aa7e970821f8 | JavaScript | IanAranha/JavaScript-Algorithms | /Algorithms2.js | UTF-8 | 1,695 | 4.09375 | 4 | [] | no_license | /*
Introduction to Stacks
This code was written ALONG with the online video
*/
var Stack = function()
{
this.storage = " "
}
Stack.prototype.push = function(item)
{
this.storage = this.storage.concat("-"+item)
}
Stack.prototype.pop = function()
{
//first we create ... | true |
08482745a939494c87c7c28133161928fd6599e6 | JavaScript | WRNoble/Rome | /routes/politician.routes.js | UTF-8 | 1,711 | 2.921875 | 3 | [] | no_license | const router = require("express").Router();
let Politician = require("../models/politician.model");
//get all politician
router.route("/").get((req, res) => {
Politician.find()
.then((politician) => res.json(politician))
.catch((err) => res.status(400).json("Error: " + err));
});
//add a new politician
ro... | true |
505c4fe7022b78ebc5a9599da569cfc0f84a42e8 | JavaScript | lgrkvst/visarch | /svg2png/svg2png.js | UTF-8 | 1,556 | 2.875 | 3 | [] | no_license | // svg2png.js
var svg2png = require('svg2png');
// Load the http module to create an http server.
var http = require('http');
var fs = require('fs');
// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {
response.setHeader('Access-Contr... | true |
e412ecbff8a4d0e22b2af71253709e41108915c6 | JavaScript | WindUpDurb/LZReplica | /tools/models/PropertyModel.js | UTF-8 | 3,575 | 2.78125 | 3 | [] | no_license | "use strict";
let mongoose = require("mongoose");
let propertySchema = new mongoose.Schema({
demo: {type: Boolean},
siteTitle: {type: String},
propertyAddress: {type: String},
propertyDescription: {type: String},
floorPlanText: {type: String},
//amazon S3 url:
floorPlanImage: {type: String... | true |
595ec094729999c1fb2829e91f475d9d1ad55915 | JavaScript | Nitrus/lba2remake | /src/renderer/stats.js | UTF-8 | 1,567 | 2.71875 | 3 | [
"MIT"
] | permissive | import Stats from './tools/Stats';
let stats = null;
let useVR = false;
export default function setupStats(pUseVR) {
useVR = pUseVR;
return {
begin: () => {
if (stats) {
stats.begin();
}
},
end: () => {
if (stats) {
st... | true |
053123f35ea8cd4c124fc96bcbc8000613433039 | JavaScript | spun/python-is1 | /js/blackboard.js | UTF-8 | 12,957 | 2.65625 | 3 | [] | no_license | var BlackBoard = {
init: function( config ) {
this.config = config;
this.context = this.config.board[0].getContext('2d');
this.createCanvasRender();
this.tool;
this.tools = {};
this.isPenDown = false;
this.penDownPos = {};
this.locked = true;
this.initTools();
if (!this.c... | true |
d11c9e176f30bd0f405d87cf44ae5fab753217af | JavaScript | 99Chris99/react-events-in-detail-lab-london-web-080519 | /src/components/CoordinatesButton.js | UTF-8 | 443 | 2.6875 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Code CoordinatesButton Component Here
import React, { Component } from 'react';
export default class CoordinatesButton extends Component {
onClickFn = (event) => {
const data = []
data.push(event.clientX)
data.push(event.clientY)
this.props.onRec... | true |
83cc23b76afa2282d59cf19021d8b7dba5d34d13 | JavaScript | anha1/fitbit-acidclock | /AcidClock-export/app/battery-indicator.js | UTF-8 | 598 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | import { battery } from "power";
export let BatteryIndicator = function(document) {
let self = this;
let batContainerEl = document.getElementById("bat");
let batEl = document.getElementById("bat-count");
let batFillEl = document.getElementById("bat-fill");
let batIcon = document.getElementById("bat-icon... | true |
eee833355e8e6790401c00eb6e3d75959058a05d | JavaScript | wjthornberry/FriendFinder | /app/routing/htmlRoutes.js | UTF-8 | 768 | 2.90625 | 3 | [] | no_license | // Dependencies
// Path allows us to get the right file path for the HTML
var path = require('path');
// Routing
// HTML GET Requests - the below code handles when a user visits a page
// In this case, HTML content will be displayed to them - either the survey page or the home page
module.exports = function (app) {
... | true |
cd0edccf60861fd773deeb3646b8185fd6c0496d | JavaScript | bhovhannes/junit-report-merger | /src/domHelpers.js | UTF-8 | 632 | 2.703125 | 3 | [
"MIT"
] | permissive | function getNodeAttribute(node, name) {
for (const attrNode of node.attributes) {
if (attrNode.name === name) {
return attrNode.value
}
}
}
function isTestSuiteNode(node) {
return node.nodeName.toLowerCase() === 'testsuite'
}
function isTestSuitesNode(node) {
return node.nodeName.toLowerCase() =... | true |
0b6e66ea711473150b116d31a8f4b88874ccf04f | JavaScript | ezequielfrias20/Starwars-Blog-Reading-List | /src/js/component/CardPeople.js | UTF-8 | 1,698 | 2.5625 | 3 | [] | no_license | import React, { useContext, useState } from "react";
import { useHistory } from "react-router-dom";
import "../../styles/home.scss";
import PropTypes from "prop-types";
import { Context } from "../store/appContext";
export const CardPeople = ({ item }) => {
const { store, actions } = useContext(Context);
const [desc... | true |
1492b0cedbc391725c2a9fcfeb7f9eb92513ca27 | JavaScript | justapixel/GroupTracker | /source/script.js | UTF-8 | 1,020 | 3.046875 | 3 | [] | no_license | var map;
var myCenter = new google.maps.LatLng(-3.7937466,-38.5779125);
var marker;
var infowindow;
var track;
function initialize() {
var mapProp = {
center: myCenter,
zoom: 12,
mapTypeId: google.maps.MapTypeId.ROADMAP,
draggableCursor: 'default'
};
map = new google.maps.Map(document.getElement... | true |
1a9dbba2d73e06f3e37a1b68178c78f9d60ca398 | JavaScript | 913363140/fe-write | /js/trim.js | UTF-8 | 319 | 3.34375 | 3 | [] | no_license | String.prototype.myTrim = function () {
return this.replace(/^\s*|\s*$/, '')
}
String.prototype.myTrim2 = function() {
return this.replace(/\s*|\s*$/, '')
}
let str = ' 1 2 3 '
console.log('str.trim() :>> ', str.trim())
console.log('str.Trim() :>> ', str.myTrim())
console.log('str.Trim() :>> ', str.myTrim2()) | true |
48c07f019b438792d68db903489a50d6e6ef79d9 | JavaScript | kiiiu15/TSP-Solver | /src/public/selectCities.js | UTF-8 | 2,647 | 3.359375 | 3 | [] | no_license |
const tbody = document.getElementById("tbody");
const select = document.getElementById("cityAdd");
const form = document.getElementById("formAdd");
const btn = document.getElementById("btnAdd");
form.addEventListener("submit", (e) => { e.preventDefault(); })
btn.addEventListener("click", addCity);
function Retriev... | true |
a7505610df3b2e3edf43210df47a176ca9ca7a45 | JavaScript | pondjames007/NatureOfCode | /hw1_selfAvoidingWalker/walker.js | UTF-8 | 1,099 | 3.640625 | 4 | [] | no_license | class Walker {
constructor() {
this.x = floor(mouseX/10);
this.y = floor(mouseY/10);
this.color = color(random(255), random(255), random(255));
// this.pos = createVector(width/2,height/2);
}
render(grid) {
fill(this.color);
rect(this.x*10, this.y*10, 10, 10);
grid[this.x][this.y] = t... | true |
ac47a94433128e62ab655ad24ee17f9ccb109a12 | JavaScript | miltonbecker/nodejs-api | /test/user-info.js | UTF-8 | 2,701 | 2.875 | 3 | [] | no_license | 'use strict';
let request = require('supertest');
let app = require('./../js/app');
const testUser = { name: 'Test', age: 40 };
describe('Add/update user info', function () {
const route = '/api/addOrUpdateUser';
it('Returns http code 200', function (done) {
request(app)
.post(route)
... | true |
d976290f24d8d2c0b105afb8f8966ebdce629e3e | JavaScript | Kelvinblaze/kelvinblaze.github.io | /todoApp/assets/js/main.js | UTF-8 | 2,968 | 3.1875 | 3 | [] | no_license | // Date
var today = new Date();
var day = today.getDate();
var month = today.getMonth();
var year = today.getFullYear();
switch (month) {
case 0:
month = "January";
break;
case 1:
month = "Feburary";
break;
case 2:
month = "March";
break;
case 3:
month = "April";
break;
case 4... | true |
66668818c27ede53c7b22585e6345eccbbd7c18e | JavaScript | FlumpStudios/APReplacementWireFrame | /src/scripts/fiLod.js | UTF-8 | 1,340 | 2.765625 | 3 | [] | no_license | let customerDetail = {
customerName: "",
postcode: "",
email: "",
telephone: "",
firstContact: "",
deferredSalesStatusID: "",
customerInitiated: false
};
$(document).ready(function() {
$("#delivery-date").datepicker({
uiLibrary: "bootstrap4"
});
$("#log-date").dat... | true |
255ff15633e4c5998df84d4b28bf6509b06679f3 | JavaScript | HackerWithDrip/pre-bootcamp-coding-challanges | /Task-4/Task4.js | UTF-8 | 465 | 3.671875 | 4 | [] | no_license | function number3Check(num1, num2) { //checks if either numbers or thier sum contains a 3
const num = num1 + num2;
if (num1 === 3 || num2 === 3 && num.toString().match(/3/) != null) {
return true;
} else {
return false;
}
}
console.log(numberCheck(3, 10)); // true
console.log(numberCheck... | true |
cd3fbc270250fd433579ff14f227f8b587ecd5d4 | JavaScript | Dunn-Austen/Refactor-tractor-Fit-lit | /test/Sleep-test.js | UTF-8 | 824 | 2.59375 | 3 | [] | no_license | const chai = require('chai');
const expect = chai.expect;
import sleepData from '../data/sleep-test-data';
import userData from '../data/users-test-data';
import allSleepData from '../data/sleep';
import Sleep from '../src/Sleep';
import User from '../src/User';
describe('Sleep', () => {
let user, sleep, fullSle... | true |
a08529074c92c9200c12c5281e2dc87f1f16d5f9 | JavaScript | Hokkie/Lets-Upgrade-JavaScript | /Assignment 16-7-2020/Assignment3.js | UTF-8 | 723 | 4.28125 | 4 | [] | no_license | //Question 1
const num = 5;
console.log(`The number entered is ${num} and`);
if(num % 2 == 0) {
console.log('Number is even!');
} else {
console.log('Number is odd!');
}
//Question 2
let os = {
name : "Andorid",
version : 9,
};
console.log(`The OS name is ${os.name} and version is ${os.ver... | true |
e3e7271c24cbd7629eade2d2caf51aa81cab7ca2 | JavaScript | 2002Bishwajeet/JavaScript-Notes-and-Projects | /regex/regestut.js | UTF-8 | 11,146 | 3.765625 | 4 | [] | no_license | let myString = 'Hello World';
let myregex = /Hello/; // yaha pe quotation nhi aaenge this var contains to find the particular word
let result = myregex.test(myString); // jiska check karna hai jo / word / mein hai woh pehle aata hai
console.log(result);
let petString = "James has a pet cat.";
let petRegex =... | true |
e01cfcb2e56c30fed2d6ecd47c23db62aa952736 | JavaScript | prasadbobby/react-repo | /src/index.js | UTF-8 | 1,550 | 2.90625 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
function DisplayEmployeeInfo(employee){
return <div>
<h1> Page...!</h1>
<p>
<label>Bobby: <b>{employee.Id}</b></label>
</p>
<p>
<label>Employee Id: <b>{employee.Name}</b></labe... | true |
ed4d04a4fca4c39ac2270ae5b6e4393f18c388e1 | JavaScript | DevSwazy/modbot | /src/commands/legacy/caps.js | UTF-8 | 1,208 | 2.625 | 3 | [
"MIT"
] | permissive | const util = require('../../util.js');
const GuildConfig = require('../../GuildConfig');
const command = {};
command.description = 'Turn caps moderation on or off';
command.usage = 'enabled|disabled';
command.names = ['caps','capsmod'];
command.execute = async (message, args, database, bot) => {
//Permission c... | true |
e9f004c1d4f7aa67877653dad3f0e30cc5cb56af | JavaScript | danielstephany/new-portfolio-site | /src/assets/js/main/header_nav_ctrls.js | UTF-8 | 3,959 | 2.578125 | 3 | [] | no_license | 'use strict';
(function($){
header_nav_ctrls();
function header_nav_ctrls(){
var breakpoint = 768;
var slidetime = 300;
var windowWidth = $(window).width();
headerHoverEvent();
headerClickEvent();
navToggle();
// headerHoverEvent handles the lodgic for the main navs hover states
function headerHove... | true |
e238f4ba9d7d49028b24d68bf16905000dde8c8b | JavaScript | bargalya/MetalFest | /js/filters/startFromFilter.js | UTF-8 | 373 | 2.515625 | 3 | [] | no_license | (function (app) {
'use strict';
var filterName = 'StartFromFilter';
var filterDependencies = [startFromFilter];
app.filter(filterName, filterDependencies);
////////////////////////////////////////////////////////
function startFromFilter() {
return function(input, start) {
... | true |
9e38b9d1ced7788f4c624a5a7cc89b9c6154e40f | JavaScript | rmorbach/CodeFights | /isListPalindrome.js | UTF-8 | 977 | 4.5625 | 5 | [] | no_license | /*
Given a singly linked list of integers, determine whether or not it's a palindrome.
Example
- For l = [0, 1, 0], the output should be
isListPalindrome(l) = true;
- For l = [1, 2, 2, 3], the output should be
isListPalindrome(l) = false.
Input/Output
[execution time ... | true |
45cfc1ae1d2ca73618d7d8395bb2f31cb671cc31 | JavaScript | Vylda/JAK | /lib/main.js | UTF-8 | 8,453 | 3.515625 | 4 | [
"MIT"
] | permissive | /*
Licencováno pod MIT Licencí, její celý text je uveden v souboru licence.txt
Licenced under the MIT Licence, complete text is available in licence.txt file
*/
/**
* @overview Deklarace "jmenného prostoru" knihoven JAK. Dále obsahuje rozšíření
* práce s poli dle definice JavaScriptu verze 1.6. Při použití této kn... | true |
437fc2bac75121927b4528edcf72bc23dbaaaa83 | JavaScript | WenheLI/PixelFantasy | /js/PointsToShapeVertices.js | UTF-8 | 2,673 | 3.296875 | 3 | [] | no_license | class PointsToShapeVertices {
//the JarvisMarch class is built to sort an array of points
//in the sorted order, they can be connected and build a polygon
constructor(points) {
this.points = points;
}
compare(a, b) {
return ((a.y < b.y) || (a.y === b.y && a.x < b.x));
}
cro... | true |
ad2fce971511c98ba17dfd000222b87988382e09 | JavaScript | maig14/olcalcium | /invis/utils/graph.js | UTF-8 | 1,047 | 2.96875 | 3 | [] | no_license | /*
*
* File : graph.js
* Author: Cagatay Demiralp (cagatay)
* Desc : Graph using adjacency list representation
*
* Example:
*
* Date : Sun Jun 2 22:55:36 2013
* Modified: $Id$
*
*/
function Graph(file){
this.a_={};
this.readIn(file);
}
Graph.prototype.readIn = function(file) {
var oReq = ne... | true |
1a345664d2f36642ef4931802af34898693482b8 | JavaScript | Arneoldenhave/countryApp | /countryApp.js | UTF-8 | 2,390 | 3.8125 | 4 | [] | no_license | // // Exercise
// console.log(Username)
// console.log(password)
// // Country Information App
// // Part 1 Create a Node.js application that does the following:
//
// //node countryApp.js Germany
// console.log(process.argv[2])
// Takes in one parameter from the command line, the name of a country. Note: ... | true |
5233badc2b177e324daa4ea7dea9580a5a679899 | JavaScript | isabella232/cccmc-sustainable-rubber-pub | /platform/src/config/sources.js | UTF-8 | 4,217 | 2.71875 | 3 | [
"MIT"
] | permissive | /**
* Sources state which data the map should display. Specify the type of source
* with the "type" property, which must be one of vector, raster, raster-dem,
* geojson, image, video. Adding a source isn't enough to make data appear on
* the map because sources don't contain styling details like color or width.
* ... | true |
f1cb674453f597247c2b8c987ec3397f817ec464 | JavaScript | aichi/URL-Shortener | /administration/scripts/newurl.js | UTF-8 | 7,769 | 2.59375 | 3 | [
"MIT"
] | permissive | (function(Shortener){
var gel = document.getElementById.bind(document),
FALSE = !1,
TRUE = !FALSE,
NewUrl =
/**
* @class This module generates form for creating new shortened URL. It also checked
* if given optional hash is not used by other shortened URLs. When everything
* is fine all data are... | true |
b6986974294d3ac5f484384ae31520138bf66cff | JavaScript | edmccrea/CS50 | /CS50x/Week_One/Credit/app.js | UTF-8 | 2,544 | 3.53125 | 4 | [] | no_license | const cardInput = document.querySelector('input')
const resultDisplay = document.querySelector('h2')
const submit = document.querySelector('button')
const cardIcon = document.querySelector('.iconActual')
const cardIcons = ['fa-cc-amex', 'fa-cc-mastercard','fa-cc-visa']
let card = {
number: cardInput.value,
ty... | true |
707ed9f69193a94b22a4987bfa4afad103bdc7b7 | JavaScript | eduardo-mior/URI-Online-Judge-Solutions | /Ad-Hoc/URI 1893.js | UTF-8 | 439 | 3.390625 | 3 | [] | no_license | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = input.split('\n');
var line = lines.shift().split(" ");
var inicio = parseInt(line[0]);
var final = parseInt(line[1]);
if (inicio >= 0 && final <= 2) {
console.log('nova');
} else if (final > inicio && final <= 96) {
console.log('cresce... | true |
6745a213a0b415f62ebf29eb333a7e7a0f2376a9 | JavaScript | macikokoro/Data-Structures-Algorithms-Javascript | /tests/sorts/sortTests.js | UTF-8 | 1,951 | 2.953125 | 3 | [] | no_license | 'use strict';
var expect = require('chai').expect,
globalRandomArray = require('../../lib/utilities/randomArray')(1000),
bubbleSort = require('../../lib/sorts/bubbleSort'),
selectionSort = require('../../lib/sorts/selectionSort'),
insertionSort = require('../../lib/sorts/insertionSort'),
shellSort = require('../.... | true |
987c5dfaa88b36366eab01f0f3cb3d892f652a64 | JavaScript | AmjadMua/HW_Week2_Day3_Array_methods | /script.js | UTF-8 | 496 | 4.3125 | 4 | [] | no_license | // Question 1:
const friends = ["Melissa", "Marc", "Andrew", "Nick"];
friends.forEach(function (friend) {
console.log("I have a friend named " + friend.toLocaleLowerCase());
})
// Question 2:
const numbers = [1, 5, 8];
const squared = numbers.map(function (num) {
return num ** 2;
}); console.log(squared);... | true |
813c195cc40f07d67db0f45ca6087b0846923785 | JavaScript | divyatiwari5/find-overlapping-time-range-sensors | /src/scripts/runScript.js | UTF-8 | 996 | 2.65625 | 3 | [] | no_license | const {createData} = require("./importer");
// TODO: Add parameters path here
const jsonPath = "./data/smallData.json"
const equipName = "Equipment1"
const startTime = "10:28"
const endTime = "16:15"
let jsonData = require(jsonPath);
// Check if jsonData is generated by dataGenerator
if (jsonData.input) {
jsonDa... | true |
086ee20905e3065bfb811b89d7fa11001eb4edb4 | JavaScript | Wayne-Bai/AST-normalize | /data/20tab/upy/upy/upy_static/gmaps/js/gmaps.js | UTF-8 | 1,331 | 2.546875 | 3 | [] | no_license | jQuery(function(){
//append the 'on' event to all the country select boxes (live)
$('body').on('change', '[id^="id_"][id$="country"]', function(){
//detect the continent of the selected country
var new_continent = $(this).find(':selected').parent().attr('class');
//detect the central part of the id (to consid... | true |
5c45e5d73acf0a98729a368ed757dd29ae4c66d4 | JavaScript | sunnieray/dynamic-dogs | /events.js | UTF-8 | 215 | 3.1875 | 3 | [] | no_license | var daisy = document.getElementById("Daisy")
console.log("daisy", daisy);
var dogFunction = function(){
return console.log("invoked dog function")
}
daisy.addEventListener("click", () => console.log("hiiiii"))
| true |
a7ac0fd0312b2de85d30af96fe65da2bd50138db | JavaScript | TIY-DC-FEE-2016-Mar/notes | /week-9/day3/src/js/user/user.service.js | UTF-8 | 1,221 | 2.71875 | 3 | [] | no_license | (function() {
'use strict';
angular.module('app')
.factory('UserService', UserService);
UserService.$inject = ['$http'];
function UserService($http) {
var loginData = null;
return {
find: find,
login: login,
getLoginData: getLoginData
... | true |
66a5a3ff075a33cf4141eaa5e6db5b72e8befafc | JavaScript | ckarande/aws-serverless-website-workshop | /lab3/scripts/admin-post.js | UTF-8 | 599 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | document.querySelector('form').addEventListener('submit', (event) => {
event.preventDefault();
var title = document.querySelector('form input');
var body = document.querySelector('form textarea');
var headers = {
Authorization: readCookie('authToken'),
'Content-type': 'application/json'
}
var body ... | true |
742f76a0f05acecb20e8e38421f653f166e4b117 | JavaScript | Saksham-coder/file_upload_react | /frontend/src/Component/FileUpload.js | UTF-8 | 1,629 | 2.953125 | 3 | [] | no_license | import { useState } from "react";
import "./../App.css";
const FileUpload = () => {
const [selectedFile, setSelectedFile] = useState();
const [isFilePicked, setIsFilePicked] = useState(false);
const changeHandler = (event) => {
setSelectedFile(event.target.files[0]);
event.target.files[0] && setIsFilePi... | true |
5cd78c42b0923ae0aa4e5a840de2f272ea267b4d | JavaScript | awuuu0716/redux-observable-practice | /src/redux/reducer.js | UTF-8 | 722 | 2.578125 | 3 | [] | no_license | import types from './types';
const defaultState = {
isBtnAClicked: false,
message: 'Click the buttons',
url: '',
};
function reducer(state = defaultState, action) {
switch (action.type) {
case types.CLICK_BTN_A:
return {
...state,
};
case types.CLICK_BTN_B:
return {
.... | true |
3b026571f1621b3541acde87635400fce840d03c | JavaScript | arpan-code/Beginner-Full-Stack-Web-Development-HTML-CSS-React-Node | /Javascript/javascript/fun_game.js | UTF-8 | 1,008 | 4.4375 | 4 | [] | no_license |
/*
Write a JavaScript program which iterates the integers from 1 to 100. But for multiples of three print Code instead of the number and for the multiples of five print Monkey. For numbers which are multiples of both three and five print CodeMonkey
*/
// multipes of three it will print "CODE"
// multipes of five ... | true |
57a67ed62a02dd7733ddc65b1ded1ae18276eab7 | JavaScript | nss-day-cohort-17/music-history-api-lukeschuyler | /models/song.js | UTF-8 | 1,024 | 2.6875 | 3 | [] | no_license | 'use strict'
// <Define a model using bookshelf that describes a song object, as well as
// static methods for getting one or all songs from the db>
// When adding the 'table' property use your old friend DB Browser for SQLite to
// open up the musichistory db and inspect the tables. Add the appropriate table name ... | true |
743552fef81d744762acd09abbe856267c3ac81e | JavaScript | AllanKT/Stefanini_ChatBots_TechnicalMeeting | /dialogflow/code/src/app/controllers/DialogflowController.js | UTF-8 | 719 | 2.515625 | 3 | [] | no_license | import CreateTicket from '../intents/createTicket';
import FindTicket from '../intents/findTicket';
class DialogflowController {
async action(req, res) {
try {
const data = req.body;
const intent = data.queryResult.intent.displayName;
const intents = {
'CriandoChamado - yes': new Cre... | true |
fc1942b4ca480cb013bba740b83d539a81e46b13 | JavaScript | szyszak/react-redux-todo | /src/components/AddTodo.js | UTF-8 | 1,318 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react';
import './AddTodo.scss';
import { connect } from 'react-redux';
import * as actionTypes from '../actions/actionTypes';
class AddTodo extends Component {
constructor(props) {
super(props);
this.state = {
input: ''
};
}
handleChange = event => {
thi... | true |
013e9f7be1b4fd770c1867b99186e8c61d827775 | JavaScript | jalvaran/ts5_V3 | /modulos/contabilidad/jsPages/documentos_equivalentes.js | UTF-8 | 26,849 | 2.546875 | 3 | [] | no_license | /**
* Controlador para Documentos contables
* JULIAN ALVARAN 2019-04-10
* TECHNO SOLUCIONES SAS
* 317 774 0609
*/
function MuestraXID(id){
document.getElementById(id).style.display="block";
}
function OcultaXID(id){
document.getElementById(id).style.disp... | true |
19b0193febf6677156fb739e2210cba49390861b | JavaScript | lytvyn139/algo-codewars-js | /7k/057-are-the-numbers-in-order.js | UTF-8 | 353 | 3.84375 | 4 | [] | no_license | //https://www.codewars.com/kata/56b7f2f3f18876033f000307/solutions/javascript
function inAscOrder(arr) {
for(let i = 0; i < arr.length - 1; i++) {
if (arr[i] > arr[i+1]) {
return false;
}
}
return true;
}
console.log(inAscOrder([1, 2, 4, 7, 19])); //true
console.log(inAscOrder([1... | true |
85245479b89dff6f6709d4d4f891d94b5c19e857 | JavaScript | Thundix/speed-man | /composable/buildingBlocks/states/firingState.js | UTF-8 | 867 | 2.921875 | 3 | [] | no_license | /**
* Created by Thundax on 13/05/2016.
*/
FiringState.prototype = new State();
FiringState.prototype.constructor = FiringState;
function FiringState(gameItem){
State.call(this);
var state = this;
state.getMethodsToPullUp = getMethodsToPullUp;
state.treatInputs=treatInputs;
state.treatCollision... | true |
ee2b1c0a865272765fde7ad4a3a0f1eda8e92063 | JavaScript | Ronaldo-Vieira/aula-javascript-revisao-01 | /atividade3.js | UTF-8 | 331 | 3.296875 | 3 | [] | no_license | function horario(hora) {
if (hora >= 6 && hora <= 12) {
console.log("Bom Dia!")
} else if (hora > 12 && hora <= 17) {
console.log("Boa Tarde!")
} else if ( hora > 17 && hora <= 24 ) {
console.log("Boa Noite!")
} else {
console.log("Valor Inválido!")
}
}
h... | true |
3591fc8fb0f0736c9f82998dd4e20991350dc79d | JavaScript | Nikolay-Shirokov/mesto | /src/components/Card.js | UTF-8 | 2,784 | 3.0625 | 3 | [] | no_license | export default class Card {
constructor(cardObject, templateSelector, userId, { handleCardClick, handleDeleteCard, setStateLike }) {
this._name = cardObject.name;
this._link = cardObject.link;
this._templateSelector = templateSelector;
this._handleCardClick = handleCardClick;
this._handle... | true |
1f64f20d1735cd0282e7a356b6fa42e64ccaa92e | JavaScript | chloeloveall/pig-dice | /js/scripts.js | UTF-8 | 1,404 | 3.71875 | 4 | [
"MIT"
] | permissive | // Business Logic for Game ---------
function Game() {
this.players = {};
// this.gameOver = true;
}
Game.prototype.addPlayer = function(player) {
this.players[player.playerName] = player;
}
// Business Logic for Player ---------
function Player(playerName) {
this.playerName = playerName;
this.roundScore = ... | true |
fe392ba114ddbd228504d14b3fdd52d27e8df2ba | JavaScript | lattenwald/user.js | /reelmagic.user.js | UTF-8 | 1,433 | 2.515625 | 3 | [] | no_license | // ==UserScript==
// @name Reelmagic downloader command generator
// @namespace q.alexander.reelmagic.dl
// @version 0.2
// @author Alexander Q <qalexx@gmail.com>
// @match https://reelmagicmagazine.com/*
// @grant none
// ==/UserScript==
function stuff() {
var playlist;
if ... | true |
c98b10a9ac119bcaf2748c11fbfecd72be136a55 | JavaScript | xushuxin/study | /normal-test/jsApi/AJAX和倒计时抢购/2.倒计时抢购.js | UTF-8 | 2,101 | 3.296875 | 3 | [] | no_license | /*
* 拿当前时间和目标时间进行对比:对比的差值中算出还剩多少小时、多少分钟、多少秒
* new Date() 获取当前客户端本地时间(因为这个时间用户自己可以改)
* 倒计时抢购的当前时间应该以服务器时间为准(服务器返回的响应头信息中有服务器时间)
* 思路:加载页面首先从服务器获取时间(尽可能减少时间差),把获取的服务器时间保存起来,以后每间隔1秒中,让获取的时间向上累加
*/
let target = new Date("2020/05/29 22:14:50"),
now = new Date(),
box = document.querySelector('#box'),
s... | true |
8790b0175f656ef2e93c829a3b6eba8777c81162 | JavaScript | Meldrion/ignisJS | /js/game/Layer.js | UTF-8 | 933 | 2.953125 | 3 | [] | no_license | "use strict";
/**
*
* @constructor
*/
function Layer() {
this.width = 20;
this.height = 15;
this.layerMatrix = [];
this.buildMatrix();
}
/**
*
*/
Layer.prototype.buildMatrix = function () {
this.layerMatrix = [];
for (var w = 0; w < this.width; w++) {
var innerArray = [];
... | true |
4f297996a86faf82517341907773dc40ab6880a6 | JavaScript | Nazar13/mastermind-game | /src/components/EditPlayer/EditPlayer.js | UTF-8 | 1,259 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react';
import PropTypes from 'prop-types';
class EditPlayer extends Component {
state = {
name: this.props.player[0].name,
}
inputHandler = (e) => {
this.setState({name: e.target.value});
}
cancelPlayerModifyActionHandler = () => {
th... | true |
920526a22e51d4f447b1ea47b555d04865d493c7 | JavaScript | iamtimleonard/quiz-app | /classes/questionClass.js | UTF-8 | 582 | 3.15625 | 3 | [] | no_license | class Question {
constructor({ question, correct_answer, incorrect_answers }) {
this.question = question;
this.correctAnswer = correct_answer;
this.allAnswers = [...incorrect_answers, correct_answer];
}
isCorrect = (answer) => (answer === this.correctAnswer ? true : false);
shuffleAnswers() {
fo... | true |
2cfca5b49dd6b85762d02a58aee02c51dfc1f80d | JavaScript | thachmle/Blog-Website | /app/scripts/views/blog_edit_view.js | UTF-8 | 1,659 | 2.625 | 3 | [] | no_license | var BlogEditView = Backbone.View.extend({
// el:'.blog_edit',
//className: 'blog_edit', this will create a div inside the page
events: {
'submit #updateData' : 'updateBlog',
'click .delete' : 'deleteBlog'
},
initialize: function (attrs) {
this.blog = this.collection.get(attrs.postid);
this.... | true |
f02e04eb6e68c62ed3a4a20904a790ea3d9d64ab | JavaScript | jude98/facebookpages | /src/components/Auth.js | UTF-8 | 511 | 2.859375 | 3 | [] | no_license | // For handling Authentication. Callback function pushes path to props.history.
// (When logout pushes '/' to history and
// so can't simply redirect to dashboard without login)
class Auth {
constructor(){
this.authenticated = false
}
login(callback){
this.authenticated = true
... | true |
ecd7478a418c184377c8f8ced6be9a82b2360811 | JavaScript | benoneal/ECS-Study | /src/systems/wingMovement.js | UTF-8 | 911 | 2.5625 | 3 | [] | no_license | 'use strict'
import filter from 'lodash/filter'
import forEach from 'lodash/forEach'
import ECS from '../ECS'
let baseSpeed = 0.5
const WingMovement = entities => {
entities = filter(entities, entity => {
let { delicious, tooSpicy, spawn } = entity.components
return !!delicious || !!tooSpicy || !!spawn
}... | true |
79dd43bea5be4a8df03e01cd3bece18033196321 | JavaScript | arturmh/asdd | /src/store/schemes/selectors.js | UTF-8 | 469 | 2.625 | 3 | [] | no_license | import { createSelector } from "reselect";
export function selectSchemes(mainState) {
return mainState.schemes;
}
function selectOptionsName(mainState, { name }) {
return name;
}
export function makeSelectSchemeByName() {
return createSelector(selectSchemes, selectOptionsName, (schemes, name) => {
for (let... | true |
3be5d233a8d44fcad503aadd4879f118fbd3f7de | JavaScript | saltykovdg/rent-alpha-minimal | /rent-web/src/modules/Address/AddressReducer.js | UTF-8 | 3,871 | 2.65625 | 3 | [
"MIT"
] | permissive | import streetTypeReducer from './reducers/StreetTypeReducer';
import streetReducer from './reducers/StreetReducer';
import buildingReducer from './reducers/BuildingReducer';
import apartmentReducer from './reducers/ApartmentReducer';
import {
buildingMeterReducer,
getBuildingMeterIsLoading,
getBuildingMeterIsReq... | true |
24a26f8a459963e27b90c05202f02182347cd7db | JavaScript | mirekratman/simple-api-modules | /__tests__/fileManager.test.js | UTF-8 | 1,446 | 2.796875 | 3 | [] | no_license | "use strict";
import {FileManager} from '../src/Modules/FileManager/fileManager.js';
/**
* Presets
* @type {string}
*/
const resourcesDir = './__tests__/resources/FileManager';
const fileListInput = ["file1.txt", "file2.txt", "file3.txt"];
const testFile1 = 'File1.txt';
const testFile1Content = 'File1 text';
const ... | true |
479c1754c255227460b8818f77bd1829b9a4454b | JavaScript | KDlamini/Rock-Paper-Scissors | /script.js | UTF-8 | 3,055 | 3.765625 | 4 | [] | no_license | //Retrive DOM elements
const input = document.querySelectorAll(".input");
let display = document.querySelector("#output")
const results = document.querySelector("#results")
const clearBtn = document.querySelector(".clear")
//Declare variables globally
let wins = 0,
loses = 0,
tie = 0,
cache = "";
//Retriv... | true |
40aaa78c62c6b1a230062f625f4666f5b0d59fbe | JavaScript | AgmarTorres/js | /node/funcionarios/funcionarios.js | UTF-8 | 661 | 3.140625 | 3 | [] | no_license | const url = 'http://files.cod3r.com.br/curso-js/funcionarios.json';
const axios = require('axios')
const filtrarChines = f => f.pais ==='China'
const filtrarMulheres = f => f.genero === 'F'
const filtrarSalarios = (funcionario, funcionarioAtual) =>{
// console.log(funcionario)
return funcionario.salari... | true |