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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
134d049ccfc596f688e5aeda1d77d60dc3fdc38a | JavaScript | mllebelamour/Formation-JavaScript | /JavaScript/js/02.js | UTF-8 | 4,687 | 3.125 | 3 | [] | no_license | // Déclarer un tableau indexé
var montableau=[];
var myArray= new Array; // une autre façon d'indexé un tableau
montableau[0]='Hugo';
montableau[1]='Rosemaël';
montableau[2]='Aurélie';
montableau[3]='Elodie';
console.log( montableau);
console.log( montableau[2]);// Aurélie
console.log( montableau[3]); // Elodie
var ... | true |
31fb1586b37474b50f1d06410a706c914569ab0a | JavaScript | sekhonjashan/KnowledgeBase | /server/routes/aras.route.js | UTF-8 | 28,330 | 2.6875 | 3 | [] | no_license | /**
* @description Annotated Relational Algebra System
* @fileoverview Utilities for handling file operations and retrive results from MySql database based on Relational Algebra.
* @author Sadaf Najam
* @year 2019
*/
const express = require('express');
/**
* Relational Algebra parser and SQL converter
... | true |
6f9f34b051bb9c9a6a0fef5493492ff383f9713e | JavaScript | edb394/abc-student-repo | /labs/audio/script.js | UTF-8 | 563 | 2.96875 | 3 | [] | no_license | let on=document.getElementById("on");
let off=document.getElementById("off");
let context = new AudioContext();
console.log(context);
let oscillator = context.createOscillator();
oscillator.type="sine";
oscillator.frequency.value=440;
let gain=context.createGain();
oscillator.connect(gain);
gain.connect(context.des... | true |
9eb358fa8664a6a18a7f62ea1da5a8307e6a7aec | JavaScript | divyarana988/Excel_Clone | /excel1/stack.js | UTF-8 | 2,587 | 3.703125 | 4 | [] | no_license | class stackClass{
constructor() {
this.arr = [];
this.top = -1;
}
push(x) {
this.arr.push(x);
this.top++;
}
pop() {
if (this.top == -1) {
return "error";
}
this.top--;
return this.arr.pop();
}
peek() {
if (... | true |
d51afe4ac5f25ea56b70992de3d66f0248538a2c | JavaScript | lmichel/TAP-complex-data | /import/saadajsbasics/javascript/FitBetterModelAttachedPattern_v.js | UTF-8 | 5,413 | 2.625 | 3 | [
"MIT"
] | permissive | function FitBetterModelAttachedPattern_mVc(params){
AttachedPattern_mVc.call(this, params);
this.patterns = {};
for( var i=0 ; i<params.products.length ; i++){
/*
* Item can run on the same relation, thus relations can not be used as IDs. We used the label (without spaces) instead
*/
var localId = this.pr... | true |
3f3f7d2e8f52642d8384759164711d134d6f814b | JavaScript | neeluhargunani/react-assignments | /src/Components/RegistrationForm.jsx | UTF-8 | 1,416 | 2.546875 | 3 | [] | no_license | import React, { useState } from 'react';
import '../Components/css/Greet.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import {InputGroup, Form,FormControl,Button, Card} from 'react-bootstrap';
const RegistrationForm=()=>{
const [name, setName] = useState();
const [password, setPassword] = useStat... | true |
6e899a3803e186597b830e6575045e5af62459c9 | JavaScript | juan-wd/juan-wd.github.io | /lesson4/js/script.js | UTF-8 | 210 | 2.625 | 3 | [] | no_license |
function toggleMenu() {
document.getElementById("primaryNav").classList.toggle("hide");
}
let oLastModif = new Date(document.lastModified);
document.getElementById("lastModified").innerHTML = oLastModif;
| true |
bd86da332e35c3875c5ff3ce2caa9deee6dc198b | JavaScript | EdgarBag/Vacations | /server/controllers/users-controller.js | UTF-8 | 1,708 | 2.6875 | 3 | [] | no_license | const usersLogic = require("../bll/users-logic");
const express = require("express");
const router = express.Router();
const User = require("../models/user");
//get all users
router.get("/", async (request, response) => {
try {
const users = await usersLogic.getAllUsers();
response.json(users);
... | true |
5684c70aa019037d7965541fbd14dcea8841d046 | JavaScript | Timka-Sawyer/796097-kekstagram-20 | /js/data.js | UTF-8 | 3,815 | 3.25 | 3 | [] | no_license | 'use strict';
(function () {
var COUNT = 25;
var COMMENTS_NAMES = ['Альпака', 'Капибара', 'Енот', 'Тануки', 'Хомяк', 'Суслик'];
var COMMENTS_MESSAGE = [
'Всё отлично!',
'В целом всё неплохо. Но не всё.',
'Когда вы делаете фотографию, хорошо бы убирать палец из кадра. В конце концов это просто непроф... | true |
e60027d10dd46729ccaf309d85f74f1957d32bd8 | JavaScript | holacola1985/velomagg | /app/front/js/main/StationMarker.jsx | UTF-8 | 1,870 | 2.609375 | 3 | [
"MIT"
] | permissive | 'use strict';
import React from 'react';
import Circle from './Circle.jsx';
import Notif from './Notif.jsx';
class StationMarker extends React.Component {
static propTypes = {
station: React.PropTypes.any,
map: React.PropTypes.any,
colors: React.PropTypes.any
};
constructor(props) {
super(prop... | true |
e77f983f09ba63a18bb3a57d973c554b24b8a4c1 | JavaScript | cds-snc/lighthouse-scanner | /src/lib/isLandingPage.js | UTF-8 | 2,357 | 2.828125 | 3 | [
"MIT"
] | permissive | const URL = require("url").URL;
const puppeteer = require("puppeteer");
const isURL = require("isurl");
const langText = ["english", "français"];
const hasLang = node => {
if (node.indexOf(langText[0]) !== -1 || node.indexOf(langText[1]) !== -1) {
return true;
}
return false;
};
const hrefLinks = async page... | true |
41465ff591e388a6cf9228e44008ce79665a9730 | JavaScript | MirekMuras/codecademy | /notes/iterators.js | UTF-8 | 2,337 | 4.125 | 4 | [] | no_license | Link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Iteration_methods
//** ITERATORS */
/** scan through each row and check for the iteam
* 'for' loop is one , but javaScript have access to build-in array looping methods (iteration methods).*/
/******************* A few Ite... | true |
d262c4daf396b467d8c8d9c0a1b5c44b0246463b | JavaScript | hlazardzig/LS-autocomplete | /src/AddressFormClass.js | UTF-8 | 6,648 | 2.984375 | 3 | [] | no_license | import React from 'react'
class AddressFormClass extends React.Component {
constructor(props) {
super(props)
this.state = this.initialState()
this.handlePlaceSelect = this.handlePlaceSelect.bind(this)
this.handleChange = this.handleChange.bind(this)
this.handleSubmit = this.handleSubmit.bind(this... | true |
3cf2b2187d96a962fa5b47e8f2044f483f2f03d7 | JavaScript | agileontheweb/golia-camper | /js/webRadio.js | UTF-8 | 3,024 | 2.75 | 3 | [] | no_license | $(document).ready(function() {
console.log( "Init Web Radio" );
topButton();
pauseAudio()
});
function topButton(){
var radio = '';
$( ".btn-kind" ).click(function(e) {
console.log("genere");
emptyList();
loadTypeOfMuisc();
});
$( ".btn-italian-radio" ).click(function() {
console.log("it... | true |
b2fa580acae79f067e75f53935f72912cea26c32 | JavaScript | GiancarloZ/js-advanced-functions-context-lab-v-000 | /index.js | UTF-8 | 2,291 | 3.640625 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | function createEmployeeRecord([firstName, familyName, title, payPerHour]){
let employee = {};
employee.firstName = firstName
employee.familyName = familyName
employee.title = title
employee.payPerHour = payPerHour
employee.timeInEvents = []
employee.timeOutEvents = []
return employee
}
... | true |
33c3c71e113798f9ccf5c92cff08edd583b49856 | JavaScript | phg98/noc-study | /Chapter3 Angles/polar_experiment.js | UTF-8 | 807 | 3.03125 | 3 | [] | no_license | function setup() {
createCanvas(400, 400)
background(0)
}
let r = 100
let increment
function draw() {
background(0)
strokeWeight(1)
textSize(20)
text('Move mouse in X and Y', 10, 30)
let mx = constrain(mouseX, 0, width-1)
let my = constrain(mouseY, 0, width-1)
increment = map(mx, 0, ... | true |
3382017ad75663b6fbab97885bddda290494156c | JavaScript | levizol/internship-starter-kit | /src/scripts/CallToAction.js | UTF-8 | 510 | 2.71875 | 3 | [] | no_license | import Button from './Button';
/** Class representing the CTA Button.
* @extends Button
*/
class CallToAction extends Button {
defaultColor = '#d7d149'
/**
* Create a button.
* @param {HTMLElement} element - The button element.
*/
constructor(element) {
super(element);
}
/**
* Change the backgrou... | true |
217e3753bbb8ce13af8e783703434f5e1075e9fc | JavaScript | guidumasperes/full-stack-web-developer-learning-path | /js_essential_training/how_to_intro/intro.js | UTF-8 | 889 | 2.8125 | 3 | [] | no_license | /* Install to follow along
- VS Code
Extensions:
- LiveServer
- ES Lint
- Prettier
- Node.js
*/
// You can add js to html using the <script> tag directly in the html document or via external file
var p = document.createElement("p");
p.innerHTML = "This is a paragraph... | true |
e484266198b04e5933f2f8780e160a6b4b129d4d | JavaScript | 314tyu/jQuery-practicing | /scripts.js | UTF-8 | 2,820 | 3.6875 | 4 | [] | no_license | ////////////////////////////////////////
// Data exchange and event practice #3//
////////////////////////////////////////
var list = document.getElementById("toDoInput");
document.getElementById("myBtn2").addEventListener("click", myFunction2);
function myFunction2() {
list = document.getElementById("toDoInput").... | true |
e19717188dc66af3ce7d2dbe6e7e85c60e6cc1f6 | JavaScript | ShamiulIslam388/nodeAuthentication | /routes/user.js | UTF-8 | 3,075 | 2.578125 | 3 | [] | no_license | const express = require('express')
const { check, validationResult } = require('express-validator')
const bcrypt = require('bcryptjs')
const jwt = require('jsonwebtoken')
const router = express.Router()
const User = require('../model/User')
const auth = require('../middleware/auth')
router.post('/sinup',
[
... | true |
ec1e3e613ccb0df225932b09083fd2887b1d26ab | JavaScript | FutureShocker/ChartBeat--WebWorker | /web_worker.js | UTF-8 | 2,431 | 2.703125 | 3 | [] | no_license | const pollURL = 'http://api.chartbeat.com/live/toppages/v3/?apikey=317a25eccba186e0f6b558f45214c0e7&host=avc.com&jsonp=handleResponse';
self.addEventListener('message', function (e) {
WebWorker.start(e);
});
var WebWorker = (function (self) {
//Private Members
self.pollingTimer;
self.currentD... | true |
b318d635de650cc979a8a0ad0e450bb5f762ca94 | JavaScript | hansifer/anagram-server | /src/adapters/MemoryAdapter.js | UTF-8 | 5,141 | 3.234375 | 3 | [
"MIT"
] | permissive | 'use strict';
const isFunction = require('lodash.isfunction');
/**
* A simple AnagramService adapter using JavaScript's Map (no persistence).
*
* See: {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map}
*
* @implements {Adapter}
*/
class MemoryAdapter {
c... | true |
098509f3e668ea0a12d232e282ce888085a8919d | JavaScript | zhangruidong/bugsMenu | /js/index.js | UTF-8 | 655 | 2.9375 | 3 | [] | no_license | (function () { // 整屏设置
let content = document.querySelector(".content");
let screens = document.querySelectorAll(".screen");
screens.forEach( (item) => {
item.style.height = content.offsetHeight + "px";
})
document.body.onresize = function () {
screens.forEach( (item) => {
item.style.height = content.offs... | true |
cbaa47963b6cc3958e6841bf5a6f42f49eda5ab9 | JavaScript | HristoMachikov/03_JSCore | /JavaScript Applications/12. WORKSHOP SINGLE PAGE APPLICATION (EXAM PREP)/spotify/scripts/handlers/song-handlers.js | UTF-8 | 3,336 | 2.671875 | 3 | [] | no_license | handlers.getSong = function (ctx) {
ctx.isAuth = userService.isAuth();
ctx.username = sessionStorage.getItem('username');
ctx.loadPartials({
header: "../templates/common/header.hbs",
footer: "../templates/common/footer.hbs"
}).then(function () {
this.partial('../templates/song.h... | true |
7ecc083f2924189282cede2686366a9c0a40a086 | JavaScript | gmoehler/luminosia | /src/utils/conversions.js | UTF-8 | 1,213 | 3.46875 | 3 | [
"MIT"
] | permissive | // sampleRate: samples in image or sound per second
// resolution: pixels on screen per second (was: pixels per sample)
export function samplesToSeconds(samples, sampleRate) {
return samples / sampleRate;
}
export function secondsToSamples(seconds, sampleRate, toCeil = true) {
return toCeil ?
Math.ce... | true |
91256cf04af5b330a845ade1f7a7b93d8a22087a | JavaScript | Final-Project-Helsinki/Halo-Pets | /client/halo-pets/src/helpers/convertDate.js | UTF-8 | 175 | 2.59375 | 3 | [] | no_license | export default function convertDate(d) {
d = new Date(d);
return [d.getFullYear(), d.getMonth()+1, d.getDate()]
.map(el => el < 10 ? `0${el}` : `${el}`).join('-');
} | true |
2f286e7c6aa69efd3ea0450cc3a2fceef7a2c2e2 | JavaScript | Brayheart/workday-calander | /index.js | UTF-8 | 1,354 | 3.015625 | 3 | [] | no_license | $( document ).ready(function() {
var hour = moment().format("H");
hour = parseInt(hour)
$('#date').text(moment().format("dddd, MMMM Do YYYY"))
var notes = JSON.parse(localStorage.getItem('notes')) || {
"9AM": '',
"10AM": '',
"11AM": '',
"12PM": '',
"1PM": '',
"2PM": '',
"3PM": '',
... | true |
2e668945f76c08913325b7cb858f07014ce3d83c | JavaScript | collingo/hackthebarbican | /www/js/ui.js | UTF-8 | 4,996 | 2.515625 | 3 | [
"MIT"
] | permissive | var barbican = window.barbican || {};
/**
* clockWatcher - clock timing script
*/
(function(document) {
var $target = $('time'),
$timeTarget = $('#test'),
$tarAttr = $('time').attr('datetime'),
time,
lastTimeChange,
pollingChanged;
window.clockWatcher = window.c... | true |
14b960de25689f4f7b272beca16337acfd630f6f | JavaScript | svendp1988/vue_groepswerk | /src/store/index.js | UTF-8 | 5,312 | 2.546875 | 3 | [] | no_license | import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
let url = 'http://localhost:3000/appointments/';
const store = new Vuex.Store({
// https://vuex.vuejs.org/guide/state.html
state: {
appointments: [],
error: ''
},
// https://vuex.vuejs.org/guide/getters.html
getters: {
... | true |
bbb9faf16b7527ce0141d022c451bc843bfc462e | JavaScript | andrew-d-gk/Sitecore82 | /Sitecore82.Web/sitecore/shell/client/Applications/ContentTesting/Components/TooltipCustom/TooltipCustom.js | UTF-8 | 4,608 | 2.71875 | 3 | [] | no_license | //
// Tooltip
//
var TooltipCustom = function (isAnimate) {
this.isAnimate = true;
if (typeof isAnimate !== 'undefined')
this.isAnimate = isAnimate;
this.className = "tooltipCustom";
TooltipCustom.prototype.index++;
this.id = this.getId();
//
this.initialize();
};
TooltipCustom.prototype.index = ... | true |
acf60b189dd0e3c53adb5629fe9c0458b2b2583e | JavaScript | cristinarojas/UI | /findId.js | UTF-8 | 994 | 3.796875 | 4 | [] | no_license | const users = [
{
id: 1,
name: 'Cristina',
lastName: 'Rojas'
},
{
id: 2,
name: 'Efrain',
lastName: 'Rojas'
},
{
id: 3,
name: 'Nayeli',
lastName: 'Rojas'
},
{
id: 4,
name: 'Gonzalo',
lastName: 'Rojas'
},
{
id: 5,
name: 'karolina',
lastName: 'R... | true |
79944b797c74751684312e45159dd0bbd38a6568 | JavaScript | HarshitaGupta16/neog | /Week-3/getting-bored/app.js | UTF-8 | 2,695 | 3.078125 | 3 | [] | no_license | const dropdown = document.querySelector("#activity-select");
const btnFindActivity = document.querySelector("#btn-find-activity");
const outputDiv = document.querySelector("#activity-output");
function disableButton() {
if (dropdown.value === "") {
btnFindActivity.disabled = true;
btnFindActivity.s... | true |
93c481451268b0c8208c12b670568b64309c8121 | JavaScript | rgkbitw/codeaid | /lib/parser.js | UTF-8 | 4,459 | 2.96875 | 3 | [] | no_license | 'use babel'
export default class Parser {
// Method 1: constructor
// Param : url ( string )
// Returns : Nothing
constructor (url) {
console.log('Constructor Created.')
this.url = url
}
// Method 2: Takes the url and parses to get useful data
// Params : None
// Returns : problemJSON objec... | true |
e5cd3220ae94cb288e02f2174713f93d71e850dc | JavaScript | mludovici/nodejskochbuch | /06_Datenformate/040/src/UserService.js | UTF-8 | 329 | 2.5625 | 3 | [] | no_license | const faker = require('faker');
faker.locale = 'de';
module.exports = class UserService {
getAllUsers() {
const users = [];
for (let i = 0; i < 10; i++) {
users.push({
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
title: faker.name.jobTitle()
});
}
return users... | true |
3895fc8376da7074677cdc265b1894a97d28aaa4 | JavaScript | ZacharyKearns/voting-app | /public/src/actions/users.js | UTF-8 | 2,463 | 2.5625 | 3 | [] | no_license | import axios from 'axios';
//Get current user(me) from token in localStorage
export const ME_FROM_TOKEN = 'ME_FROM_TOKEN';
export const ME_FROM_TOKEN_SUCCESS = 'ME_FROM_TOKEN_SUCCESS';
export const ME_FROM_TOKEN_FAILURE = 'ME_FROM_TOKEN_FAILURE';
export const RESET_TOKEN = 'RESET_TOKEN';
//Sign Up User
export const S... | true |
93fa06a29f8ea6829e1f0217c0101506de45b482 | JavaScript | ZoeWang/es6 | /eg/traceur/es6.js | UTF-8 | 183 | 2.578125 | 3 | [] | no_license | var a = [];
for(let i=0; i<10; i++){
a[i] = function() {
console.log(i);
};
}
console.log(a[6]());
// 跨模块常量
export const A = 1;
export const B = 3;
export const C = 4; | true |
22d96e90a01eb4cd5967f87e7887971d076870b4 | JavaScript | christopher-o-todd/coderbyte | /challenges/Simple_Adding.js | UTF-8 | 289 | 3.53125 | 4 | [] | no_license | function SimpleAdding(num) {
var temp = 0;
for (var i=1; i<=num; i++) {
temp = temp + i;
//console.log(temp);
}
return temp;
}
// keep this function call here
// to see how to enter arguments in JavaScript scroll down
SimpleAdding(readline()); | true |
c5c39d01a566fe302590c429a042c491d6bf6369 | JavaScript | yzhbankov/d3-bar-chart | /js/app.js | UTF-8 | 2,755 | 2.96875 | 3 | [] | no_license | /**
* Created by Iaroslav Zhbankov on 27.01.2017.
*/
var margin = {top: 40, right: 20, bottom: 60, left: 80},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
function dateParser(date) {
var theDate = new Date(date);
var year = theDate.getFullYear();
var month ... | true |
989508e1a4210787685f4443046c28273b2f59b9 | JavaScript | juliherms/ProjectWithMongoDBAndReact | /src/utils/parseStringAsArray.js | UTF-8 | 122 | 2.546875 | 3 | [] | no_license |
module.exports = function parserStringAsArray(arrayAsString){
return arrayAsString.split(',').map(s => s.trim());
} | true |
5cbeb7f8d91e57750ca2b27564e34506ecc02335 | JavaScript | overflowz/hcl-todo-be | /handlers/express/middlewares/require-auth.middleware.js | UTF-8 | 353 | 2.53125 | 3 | [
"MIT"
] | permissive | const getUser = authorization => {
try {
return JSON.parse(authorization);
} catch (err) {
return null;
}
};
const onUnauthorized = res => {
res.status(401).end('Unauthorized');
};
module.exports = (req, res, next) => {
req.user = getUser(req.headers.authorization);
if (!req.user) return onUnauth... | true |
377872ca758322221b828b4b52a0cc46b346b984 | JavaScript | ebuyco/Javascript-Fundamentals | /VanillajsTest/Bugfixing.js | UTF-8 | 129 | 2.75 | 3 | [] | no_license | function solution(A) {
for (i = 1; i < 1000000; i++) {
if(!A.includes(i)) return i;
}
}
console.log(solution); | true |
77a87cf33e72d3e5fb654345e8af6edecb3dfed9 | JavaScript | mleluong/valentine | /script.js | UTF-8 | 1,372 | 3.53125 | 4 | [] | no_license | // console.log
console.log('reading js');
// use strict parsing
'use strict';
// declare and populate array
var hearts = ['images/honey.png', 'images/adore.png', 'images/lucky.png', 'images/ily.png', 'images/sweetheart.png', 'images/love.png', 'images/happy.png', 'images/sweetpotato.png', 'images/greencard.png', 'ima... | true |
b580bd21a3b1a8cbefdd7c3ea4446525efd63612 | JavaScript | daveboling/Weather-UI | /app/index.js | UTF-8 | 1,597 | 2.65625 | 3 | [
"MIT"
] | permissive | 'use strict';
var express = require('express');
var app = express();
var morgan = require('morgan');
var request = require('request');
var bodyParser = require('body-parser');
app.set('view engine', 'jade');
app.set('views', __dirname + '/views');
app.use(morgan('dev'));
app.use(bodyParser.urlencoded({... | true |
2b70fa3f6a4cb5b2fb1647d7a415c878501ff2dd | JavaScript | Albertiy/wechat_token_server | /src/model/req_body.js | UTF-8 | 335 | 2.546875 | 3 | [] | no_license | class ReqBody {
/**
* 路由返回体
* @param {number} state 1:正常,0:错误,其他:自定义
* @param {*} [data]
* @param {*} [error]
*/
constructor(state, data, error) {
this.state = state;
this.data = data;
this.error = error;
}
}
module.exports = ReqBody; | true |
f1850db2b0c0c068d5d8e1aebf61b70c6621b0f2 | JavaScript | 6813-stageIt/stageIt | /signup.js | UTF-8 | 1,328 | 2.765625 | 3 | [] | no_license |
function checkForm(){
var username = $('#rUsername').val().trim();
var email = $('#rEmail').val().trim();
var password = $('#rPassword').val().trim();
var re_password = $('#rConfirmpassword').val().trim();
if(username=="" || email =="" || password =="" || re_password == ""){
alert("Please fill out all fields."... | true |
afba53d105f8dccfc70afab3ed565bd02196b849 | JavaScript | Maryucha/EstudosJavaScript | /aulas/aula8.js | UTF-8 | 264 | 3.421875 | 3 | [] | no_license | var idade = 12
console.log(`Você tem ${idade} anos de idade.\n`)
if(idade<16){
console.log("Menor de idade! \nNão vota!")
}else{
if(idade>=16 && idade<65){
console.log("Voto obrigatório!")
}else{
console.log("Voto opcional!")
}
} | true |
c993cef726791269b07790cb696767355ea991cf | JavaScript | nozutaku/elderlyCommunicationPF | /kintone-js/color.js | UTF-8 | 737 | 2.828125 | 3 | [] | no_license | (function() {
"use strict";
// カレンダービュー
kintone.events.on('app.record.index.show', function(event) {
// カレンダービューの表示時にフィールド値の条件に応じて、文字色、フィールドの背景色を変更する
var eles = document.getElementsByClassName("cellitem-value-gaia");
for (var i = 0, il = eles.length; i < il; i++) {
var ele = eles[i];
// ele... | true |
cd07de88eab2da65bfcc93498d93045d086125a7 | JavaScript | bogdankol/goit-js-hw-11-color-switch | /src/index.js | UTF-8 | 1,780 | 3.53125 | 4 | [] | no_license | const colors = [
'#FFFFFF',
'#2196F3',
'#4CAF50',
'#FF9800',
'#009688',
'#795548',
];
const refs = {
body: document.body,
startBtn: document.querySelector('button[data-action="start"]'),
stopBtn: document.querySelector('button[data-action="stop"]'),
};
const { body, startBtn, stopBtn } = refs;
const... | true |
41bcf6626924909acf7c8f802876abbe8c88c009 | JavaScript | OU-CS4263/MyOTV | /client/src/Examples/Account.js | UTF-8 | 35,266 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import Modal from 'react-modal';
import ReactLoading from 'react-loading';
import './Account.css';
const domContainer = document.querySelector('#container');
//ReactDOM.render(App, domContainer);
Modal.setAppElement('#root')
//Displays basic store info
class StoreInfo extends... | true |
f379e414c88ba68953944529338446ecd40d9ab6 | JavaScript | clairelct/checkboxes | /src/App.js | UTF-8 | 3,647 | 2.6875 | 3 | [] | no_license | import React, { useState } from "react";
import "./App.css";
import FormGroup from "@material-ui/core/FormGroup";
import FormControlLabel from "@material-ui/core/FormControlLabel";
import Checkbox from "@material-ui/core/Checkbox";
import { withStyles } from "@material-ui/core/styles";
// Customize Material-UI Checkbo... | true |
bf30ccdfc6ffc85cee446eeaf230cf2e245688b6 | JavaScript | vsafonkin/javascript-algorithms | /src/algorithms/sets/longest-common-subsequence/longestCommonSubsequenceRecursive.js | UTF-8 | 917 | 3.609375 | 4 | [
"MIT"
] | permissive | /* eslint-disable no-param-reassign */
/**
* Longest Common Subsequence (LCS) (Recursive Approach).
*
* @param {string} string1
* @param {string} string2
* @return {number}
*/
export default function longestCommonSubsequenceRecursive(string1, string2) {
/**
*
* @param {string} s1
* @param {string} s2
... | true |
a39c3b83c0cc2271f92f2931b60addefd92baf69 | JavaScript | kavallo/Focus.js | /test/FocusTest.js | UTF-8 | 10,008 | 2.640625 | 3 | [
"MIT"
] | permissive | (function (win, doc, ns, _undefined_) {
if (ns === _undefined_) {
ns = win;
}
function setup()
{
this.oFocus = new ns.Focus();
}
function teardown()
{
delete this.oFocus;
}
TestCase("FocusConstructorTest", sinon.testCase({
setUp: function()
{
setup.call(this);
},
tearDown: function()
{
te... | true |
704811aba7413e893ceb36cdbe679f37bca8e274 | JavaScript | thmsdnnr/javascript30 | /day27/script.js | UTF-8 | 1,180 | 2.953125 | 3 | [] | no_license | window.onload=function() {
let mouseDown=false;
let curXPos=0;
let container=document.querySelector("div.items");
let items=document.querySelectorAll("div.item");
items.forEach((i)=>i.addEventListener('mousedown',handleClick));
items.forEach((i)=>i.addEventListener('mouseup',handleClick));
function hand... | true |
13ea3d2e218cb76f064d4a52035788dd791fd9a8 | JavaScript | PavelDikiy/nodeJs | /first-chat/createDb.js | UTF-8 | 3,026 | 2.765625 | 3 | [] | no_license | // Mongoose
const mongoose = require( './libs/mongoose' );
const async = require( 'async' );
//const User = require( './models/user' ).User;
mongoose.set('debug',true);
async.series([
open,
dropDatabase,
requireModels,
createUsers
], function ( err, results ) {
console.log( 'results----', results ... | true |
f5407ec119e843bccbc72e4137f574ed7aa3a9ec | JavaScript | lilykr/epitech-workshop-snake | /snake_game.js | UTF-8 | 3,335 | 4 | 4 | [] | no_license |
// --------------------------------
// ------- GLOBAL VARIABLES -------
// --------------------------------
// size of square tiles in pixels
const SQUARE_SIZE = 20;
// Informations about the game status
const game = {
status: "playing",
score: 0,
speed: 150
}
// Game boards characteristcs
const board_c... | true |
66749785f366828f0b4c81a515e169a11bb38c78 | JavaScript | TomPridham/zeelib | /src/lesser.js | UTF-8 | 182 | 3.078125 | 3 | [
"MIT"
] | permissive | // @flow
/**
* Returns the lesser of two numbers
* @example
* lesser(1, 2) // => 1
*/
const lesser = (a: number, b: number): number =>
(a < b) ? a : b
export default lesser
| true |
54a4a2f8662d7b364536f9ef29fd409e7af775ba | JavaScript | jiayuliu27/juke-pt1 | /04-sorting/sort.js | UTF-8 | 6,567 | 4.125 | 4 | [] | no_license | /* 04 Sorting
*
* From the live review. Uses ES6:
*
* - Arrow functions: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
* - Destructuring assignment: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
* - Default ... | true |
0f2132183eddc7c801fb93cada4e302ed3ff0c74 | JavaScript | justincarb/javascript-justincarb | /js/script.js | UTF-8 | 250 | 2.578125 | 3 | [] | no_license | function clickme(){
var inputDisplay = document.getElementById('input-display');
var inputBox = document.getElementById('input-box');
inputBox.innerHTML += '<li>' + inputDisplay.value + '<span class="closebtn">X</span>' + '</li></br>';
}
| true |
7f63382851981b9e4cecb90a03f2a5498ef1e979 | JavaScript | Wolkenberg-Gymnasium/StundenplanWebApp | /src/TimeTable/components/Dates/Dates.selector.js | UTF-8 | 2,484 | 2.546875 | 3 | [] | no_license | import { createSelector } from 'reselect';
import Moment from 'moment';
import { extendMoment } from 'moment-range';
const moment = extendMoment(Moment);
const datesSelector = (state) => state.dates.dates;
const dateSelector = (state) => state.timetable.timetableDate;
export const layoutedDatesSelector = createSelect... | true |
a971de807d13f09442253ea8e0cd75248de2b10a | JavaScript | Andy-Smith1/rock-paper-scissors-lizard-spock | /app.js | UTF-8 | 2,556 | 4.0625 | 4 | [] | no_license |
let userScore = 0;
let computerScore = 0;
let gamesPlayed = 0;
console.log('Type "game()" and press enter to begin. Refresh to play again.')
// Get Computers Choice
function computerPlay () {
let randomNumber = Math.floor(Math.random()*100);
if (randomNumber <= 33) {
return 'rock';
... | true |
4cefb0fc0d7b7ec9c2783c817ced1f59cd79f8bd | JavaScript | Marie-Ehrman/Save_The_World | /app.js | UTF-8 | 953 | 3.234375 | 3 | [] | no_license | const body = document.querySelector("body");
const button = document.querySelector(".button");
const input = document.querySelector(".user-input");
const error = document.querySelector(".error");
let userInput;
const code = "UF08300830UF";
let match = false;
console.log(input)
input.addEventListener("keyup", (e) => {... | true |
1d30ee0b195c172364000f91eac08ad0d3c4e335 | JavaScript | IgorBaranov/PolicyLine | /src/expression.js | UTF-8 | 3,442 | 3.015625 | 3 | [
"MIT"
] | permissive | /* based on https://www.barkweb.co.uk/blog/how-to-build-a-calculator-in-javascript */
const operators = ['AND', 'OR', '(', ')'];
const TYPE = {
op: 'OP',
val: 'VAL'
};
const wrapToToken = item => ({
val: item,
type: operators.includes(item) ? TYPE.op : TYPE.val
});
const createTokens = expression => expressio... | true |
27f8072cb80467f6c0ddffae855994e1259a4210 | JavaScript | JackGouldingay/Hue-App | /src/modules/HueColor.jsx | UTF-8 | 1,438 | 2.828125 | 3 | [] | no_license | const mired = require("mired");
const ColorTemperature = require("color-temperature");
function ConvertColor(state = {xy: [1, 1], ct: 255, bri: 255, colormode: "xy"}) {
if (state.colormode === "xy") {
return ConvertXYToRGB(state.bri, state.xy);
} else if (state.colormode === "ct") {
const {r, g, b} = ConvertCTTo... | true |
19b7c477f5c17b8923cdcbe15391db5124939811 | JavaScript | petergoes/ssr-web-components | /lib/serialize.js | UTF-8 | 2,430 | 2.703125 | 3 | [] | no_license | module.exports = function serialize (rootNode) {
function serializeNode (node) {
try {
const lightDomNodes = [...node.childNodes]
const lightDomHtml = node.innerHTML
const templateDom = document.createElement('template')
const scriptData = document.createElement('script')
const slots... | true |
afbe88ac8d3850e272fee485c4966df23ac3373f | JavaScript | theinsidecompany/respaldoQualified | /app/controladores/controllerTrader.js | UTF-8 | 3,092 | 2.734375 | 3 | [] | no_license | var Trader = require('../modelo/trader');
//Metodo que guarda en base de datos los traders.
//----------------------------------------------------------------------------------//
exports.crearTrader = function(req, resp){
var nombreTrader = req.body.nombreTrader;
Trader.find(function(err, trader){
if (trader.l... | true |
948fa371567c9a5317ef096b60cb1de73bdc6c7f | JavaScript | dronwork3/basic-js | /src/transform-array.js | UTF-8 | 1,903 | 2.84375 | 3 | [
"MIT"
] | permissive | module.exports =
function transform(arr) {
if (Array.isArray(arr)) {
let arr1 = arr;
let i = 1;
if (arr1 == []) { return arr1; }
if ((arr1[0] == "--discard-prev") || (arr1[0] == '--double-prev')) { arr1.splice(0, 1); }
if ((arr1[arr1.length] == '-... | true |
42c27fd36108739205543b070a882d401c828b16 | JavaScript | Tanninator/gathertown-escape-rooms | /src/components/Bookshelf.js | UTF-8 | 1,527 | 2.53125 | 3 | [] | no_license | import React from 'react';
import weirdBookshelf from '../images/bookshelf/bookshelf-weird-book.jpg';
import emptyBookshelf from '../images/bookshelf/bookshelf.jpg';
import db from '../firebase.js'
import firebase from 'firebase/app';
import 'firebase/firestore';
class Bookshelf extends React.Component {
constructor... | true |
2d8753afbe23f80def31d281a2781ebdc1a69fd4 | JavaScript | Anais05/Openclassrooms-P3 | /js/diapo.js | UTF-8 | 2,486 | 2.953125 | 3 | [] | no_license | // diaporama
var Diapo =
{
current : 0,
pause : document.getElementById("pause"),
play : document.getElementById("play"),
droite : document.querySelector(".fa-chevron-right"),
gauche : document.querySelector(".fa-chevron-left"),
slides : document.querySelectorAll(".slide"),
InitDiapo : function... | true |
e33aff5b6533073df55de0caed828f5be0246970 | JavaScript | KriegerSeele/multiplicate-node | /multiplicate/multiplicate.js | UTF-8 | 1,329 | 2.90625 | 3 | [] | no_license | // Se acostumbra siempre colocar al inicio los required
const fs = require('fs');
const colors = require('colors');
const { resolve } = require('path');
const { reject } = require('assert');
// Otros tipos de required
// const fs = require('express');
// Estos son tipos de archivos que vamos creando en el proyecto
//... | true |
5e8abbfeac1da25cd86bc4e4c2ad7b90e02351bd | JavaScript | leighannecanner/Random-movie-generator | /index.js | UTF-8 | 3,548 | 3.265625 | 3 | [] | no_license |
class RandomMovieGenerator {
constructor(){}
generateRandomMovie(){
const movies = [
{title: 'Harry Potter', explanation: 'This movie is about a dude with a stick...', hint: 'It\'s Magic'},
{title: 'Just Go With It', explanation: 'This movie is about people who go on holiday...', hint: 'Ad... | true |
d89fdf7760aa63500d1b899a18ff79043b033d02 | JavaScript | kpicaza/fcc-voting-app | /src/user/infrastructure/db/mongo-user-store.js | UTF-8 | 1,639 | 2.59375 | 3 | [
"MIT"
] | permissive | 'use strict';
var mongo = require('mongodb').MongoClient;
var Promise = require('rsvp').Promise;
module.exports = function (data, method) {
return new Promise(function (resolve, reject) {
mongo.connect(process.env.MONGO, function (err, db) {
if (err) {
reject(err);
}
var store = new S... | true |
f845f87b19839297cd4da46481fad4af60aae8e5 | JavaScript | phodal/vmap | /static/js/UserMarker.js | UTF-8 | 2,362 | 2.671875 | 3 | [
"MIT"
] | permissive | define(['leaflet', 'js/data', 'jquery', 'mustache'], function (L, Data, $, Mustache) {
var VIP_USERS = Data.VIP_USERS;
var UserMarker = function (map) {
this.map = map;
};
var handleUserClickMarker = function (e) {
var popup = e.target.getPopup();
var githubUserName = e.target.... | true |
0f8d74828003ed07551dc4aac1a3ebd64808b97a | JavaScript | kswope/shelf-demo | /src/components/shelf_menu.js | UTF-8 | 5,473 | 2.75 | 3 | [] | no_license |
import React from 'react';
import Data from '../../src/data/shelves'
function nbspPrepend( count, text ) {
let result = text
for ( let i = 0; i < count; i++ ) {
result = "\u00a0" + result
}
return result;
}
class _Class extends React.Component {
//------------------------------------------------------... | true |
bf4282fa844a8cacc35078f50e7024365c1cde21 | JavaScript | samwebber11/Mongo-db | /mongoose/hashing.js | UTF-8 | 588 | 2.640625 | 3 | [] | no_license | const {SHA256} = require('crypto-js');
const jwt=require('jsonwebtoken');
var data={
id:10
}
var token=jwt.sign(data,'123abcd');
console.log(token);
var decoded=jwt.verify(token,'123abcd');
console.log(decoded);
// var data={
// id:4
// };
// var token={
// data,
// hash:SHA256(JSON.stringify(data)+'somesecrets').t... | true |
3bce7d9671c8c64c4da63e60d86676562fc6e2d0 | JavaScript | zhaiyjgithub/DoctorFinderRN | /src/component/utils/Utils.js | UTF-8 | 1,754 | 3 | 3 | [] | no_license | import MD5 from 'crypto-js/md5'
const FormatPhone = (phone) => {
let formatedPhone = phone
if (phone && phone.length >= 10) {
let header = phone.substr(0, 3)
let middle = phone.substr(3, 3)
let last = phone.substr(6, 4)
formatedPhone = '(' + header + ')' + middle + '-' + last
}
return formatedPhone
}
co... | true |
0741090512c17c76fc78a95a0a62052e6f7bbec2 | JavaScript | Dmitriy-Ivanov-04/photoalbum_web_application | /src/main/resources/static/js/addFriendScript.js | UTF-8 | 683 | 2.53125 | 3 | [] | no_license | $(document).ready(function () {
let flag = 0;
$(".add-friend").click(function() {
$(".add-friend-plus").queue('fx', []);
if(flag == 0){
$(".add-friend-plus").animate(
{rotate: 45},{
duration: 300,
step: function(now) {
$(this).css({ transform: "rotate(" + now + "deg)" });
}
}
);... | true |
65472ea12462eda8b30c3faad4da6ff735330109 | JavaScript | briangmcmillan/w4d4-make-a-stopwatch | /js/global.js | UTF-8 | 1,757 | 3.5 | 4 | [] | no_license | var tenthOfSeconds = 0
var seconds = 0
var minutes = 0
var watchInput = document.getElementById('watchInput')
var start_button = document.getElementById('startBtn')
var startTime
var pauseTime
var resetTime
start_button.addEventListener('click', function() {
if (this.innerHTML === 'Start') {
beginWatch()
t... | true |
2a25b26f6111ba31f96796857739a4edafdf0293 | JavaScript | jastral/31-05-2021 | /Assignment-1/src/index.js | UTF-8 | 1,564 | 2.65625 | 3 | [] | no_license | import react from 'react'
import ReactDOM from 'react-dom'
const ingredients = [ 'tomato', 'asafoetida', 'cumin seeds', 'peppercorns', 'ginger', 'curry leaves', 'coriander leaves', 'salt as required', 'water' ]
const steps = "Soak the tomatoes and ginger in lukewarm water with half a tsp of salt and this will remove... | true |
27c5fe91167a40b437a4d9d5d4434003a9c3bd48 | JavaScript | ichbinjaeger/ichbinjaeger.github.io | /js/hangman.js | UTF-8 | 5,847 | 3.734375 | 4 | [] | no_license | // GLOBAL VARIABLES
// add array of words and create alphabet array
const wordArr = [
'Ashtray',
'Anomaly',
'Almonds',
'Ballroom',
'Bastard',
'Braille',
'Citizen',
'Chastise',
'Colonialism',
'Dickbutt',
'Doorbell',
'Diplomat',
'Empire',
'Electricity',
'Eel',
'Frankly',
'Focus',
'Fi... | true |
7c77aea313f56ec7f78c263ea0b47502026fbca5 | JavaScript | Diana-Doe/calendar_react | /src/views/Calendar/index.jsx | UTF-8 | 2,275 | 2.765625 | 3 | [] | no_license | import React, { Component } from "react";
import CalendarHeader from "../../modules/Calendar/components/Header";
import CalendarBody from "../../modules/Calendar/components/Body";
import CalendarEvents from "../../modules/Calendar/components/EventList";
import "./styles.css";
class Layout extends Component {
constru... | true |
24685b11180e59c2534b91abe2bf2b26160d735d | JavaScript | flaviocdc/nodejs-socketio-shell | /app.js | UTF-8 | 911 | 2.59375 | 3 | [] | no_license | var express = require('express')
, app = express()
, server = require('http').createServer(app)
, io = require('socket.io').listen(server)
, spawn = require('child_process').spawn
, carrier = require('carrier');
server.listen(8080);
app.use(express.logger());
app.use(express.static(__dirname + '/public'));... | true |
5263d3a5e391f1618bfc6bdddb08227b9a2ca4af | JavaScript | aguecida/node-playground | /notes-node/playground/json.js | UTF-8 | 421 | 3.21875 | 3 | [] | no_license | const fs = require('fs');
let originalNote = {
title: 'Some title',
body: 'Some body'
};
let originalNoteString = JSON.stringify(originalNote);
fs.writeFile('notes.json', originalNoteString, err => {
if (err) {
console.log(err);
}
fs.readFile('notes.json', (err, data) => {
let no... | true |
8939da02eb1e63ca640a0250e0dc7cc9ef842356 | JavaScript | tonny-chan/countdow | /app.js | UTF-8 | 5,929 | 3.25 | 3 | [] | no_license | var CANVAS_WIDTH = 1024; //画布宽度
var CANVAS_HEIGHT = 768; //画布高度
var RADIUS = 8; //小球半径
var MARGIN_LEFT = 30; //左边框距离
var MARGIN_TOP = 30; //上边框距离
var currentTimeSeconds = 0; //当前秒数
var DIGIT_COLOR = "rgb(0,102,153)"; //小球颜色
var obstruction = 0.75; //阻力系数
var curDate = new Date();
const endDateTime = new Date(curDate... | true |
e0a31bced27896257530aebb4e254f0982b0adfa | JavaScript | Nasko-Kurtakov/WebProject | /scripts/general.js | UTF-8 | 2,306 | 2.703125 | 3 | [] | no_license | (function () {
ko.bindingHandlers.enterKey = {
init: function (element, valueAccessor, allBindings, viewModel) {
var callback = valueAccessor();
element.addEventListener("keypress",function (event) {
var keyCode = (event.which ? event.which : event.keyCode);
... | true |
c51aebdcbbda05c7632957dc46edb1300d4a44ff | JavaScript | AndrewFriendTech/filigree | /public/javascripts/main/components/GroupActions/GroupActionsComponent.js | UTF-8 | 1,341 | 2.6875 | 3 | [] | no_license | function GroupActionsComponent(element){
let elementHTML = `
<div class="header">
<h2>Group Actions</h2>
</div>
<div class="action" id = "viewMembers">
<button class="btn" id="btn-viewMembers">View Members</button>
</div>
<div class="action" id = "fileSharing">
<button class="btn" id="btn-fileSharing">M... | true |
86a16a1e20ac91f198a6b325cadd19547d0b47ba | JavaScript | m-triple-m/react_extra_classes | /map.js | UTF-8 | 153 | 2.90625 | 3 | [] | no_license | nums = [4, 5, 6, 7];
// const cubes = nums.map( (n) => { return n*n*n } );
const cubes = nums.map( n => n*n*n );
console.log(cubes);
console.log(nums); | true |
7e5bbdaed74c6974eb3f908563545d7240071a72 | JavaScript | leandrokanis/expensify-app | /src/playground/distructuring.js | UTF-8 | 917 | 3.125 | 3 | [] | no_license | // const person = {
// name: "leandro",
// age: '28',
// location: {
// city: "Gama City",
// temp: 21,
// }
// }
//
// // const age = person.age;
// // const name = person.name;
//
// const { name, age } = person;
// console.log(`${name} is ${age}`);
//
// const {temp: temperature, address: add = "seto... | true |
7e193085f2790006db21153bace27c308ff5ffaa | JavaScript | saldesign/game | /js/script2.js | UTF-8 | 14,388 | 2.921875 | 3 | [] | no_license | /*To Do
add more lvls
reformat health/air bars lvl/points pause
Intro Details: Fish Points, Air, Shark
Game Win point
Flying Fish
Spearable intro fish
Unlt range during intro
*/
//Elements
var diver = $('#diver'),
stage = $('#gameStage'),
sharkFreq = 10000,
sharkSpeed = 6000,
targetFreq = 1500,
targetSpeed = 4... | true |
02f971a270bf0e3367ac695c7be6a8bf4a227afa | JavaScript | Flaw1331/Class | /D3/Day 2/D3_2_Start/script_10.js | UTF-8 | 1,998 | 3.234375 | 3 | [] | no_license | // Define SVG area dimensions
var svgWidth = 960;
var svgHeight = 500;
// Define the chart's margins as an object
var margin = {
top: 60,
right: 60,
bottom: 60,
left: 60
};
// Define dimensions of the chart area
var chartWidth = ""
var chartHeight = ""
// Select body, append SVG area to it, and set its dimen... | true |
166bb1cabdef9fbc72d16c28752f9db8a0099a35 | JavaScript | SanderCokart/Javascript-C2 | /studieblok1/opdracht3.js | UTF-8 | 127 | 3.25 | 3 | [
"MIT"
] | permissive | // This is a function that takes 2 variables and calculates them by multiplying
function calculate(a,b){
return ((a*b));
}
| true |
82afab04d3e46b7898562981a3a9e9ffa8cea3bf | JavaScript | masinette/lotide | /middle.js | UTF-8 | 1,212 | 3.421875 | 3 | [] | no_license | const assertArraysEqual = require(".//assertArraysEqual");
const eqArrays = require("./eqArrays");
//Implement middle which will take in an array and return the
//middle-most element(s) of the given array.
const middle = function(array){
let middle = [];
let value;
//arrays with one or two elements, there is no... | true |
1ad680dae524e77988d01978328d3604a7bdabbe | JavaScript | garrettgraber/JS4.1--Intro-to-jQuery | /main.js | UTF-8 | 529 | 3.09375 | 3 | [] | no_license |
$('.little-button').on('click', function() {
console.log('Button pressed');
$('body').append('<p>Text added to the body</p>');
});
$('.button2').on('click', function() {
$('body').append('<h1>Header added to the body</h1>');
});
$('.button3').on('click', function() {
console.log('button3 has fired');
var list... | true |
ffe0044679db354e0273b65002df43bc00403628 | JavaScript | Ahmis/ohjelmistokehitys-school-task | /client/src/App/App.js | UTF-8 | 2,516 | 2.96875 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import Product from './Product';
import AddProduct from './AddProduct';
class App extends Component {
constructor( props ) {
super( props );
// Initialize the state.
this.state = {
products: []
}
// Bindings.
this.onAdd = this.onAdd.bind(... | true |
c0563d065968173a907af011e5d2449d65fb86b0 | JavaScript | Alexey-Girin/transport | /src/network.js | UTF-8 | 1,172 | 3.03125 | 3 | [] | no_license | /** Описание объекта, хранящего ссылки на созданные объекты моделей транспортной сети */
class Network {
constructor() {
this.bus_graph = null;
this.troll_graph = null;
this.tram_graph = null;
}
get_graph(tr_type) {
if (tr_type == 0) {
return this.bus_graph;
... | true |
b27df2842f1ebffa1abb5c429cd38d0506bdcfee | JavaScript | Saideepak01/Dictionary | /script.js | UTF-8 | 4,227 | 3.390625 | 3 | [] | no_license | //webpage title and searchbar
const topPg = document.querySelector(".fixedTop");
topPg.innerHTML = `
<div class="row d-flex">
<h1>Dictionary <span>📖</span></h1>
<div class="col top">
<form class="test">
<input type="text" class="form-control searchbar" placeholder... | true |
ce9f14da0c125dd2f7e3f594c9409723e37294ed | JavaScript | medamineDev/laravel5.2-angular1 | /public/js/services/sharedService.js | UTF-8 | 491 | 2.515625 | 3 | [] | no_license |
angular.module('sharedService', [])
.factory('sharedData', function() {
var sharedData = {
userName: ''
};
return {
setData : function(data) {
console.log("set -> "+sharedData.userName);
sharedData.userName = data;
},
... | true |
9f2771b2b28344c41c31290403dc05a38b02478d | JavaScript | rushi-pa/work_EXP | /angular and react/react/a2/web422_assignment2/js/main.js | UTF-8 | 3,145 | 2.984375 | 3 | [] | no_license |
let saleData = [];
let page = 1;
const perPage = 10;
const saleTableTemplate = _.template(`
<% _.forEach(sales, function(sale){ %>
<tr data-id = "<%- sale._id %>">
<td><%- sale.customer.email %></td>
<td><%- sale.storeLocation %></td>
<td><%- (sale.items).length %></td>
... | true |
efdc635a7708c926744c518dcba4135fa5aa99fc | JavaScript | analourdescr/Practicas-en-clase | /llamadahttp.js | UTF-8 | 538 | 2.59375 | 3 | [] | no_license | const fetch = require('node-fetch');
(
async()=>{
const solicitud = await fetch("http://0bdcfd77b44b.ngrok.io/api/data",{
method: 'POST',
headers: {
'Content-Type': 'aplication/json',
'User-Agent': `nodejs/${process.version}`,
'Accept'... | true |
edbb199b8e46690c09a1d3ba99237dee307d6978 | JavaScript | BrailaAlex/javascript | /Lesson6.Massives/hw12/index.js | UTF-8 | 1,472 | 3.6875 | 4 | [] | no_license | // function removeDuplicates(array) {
// if (!Array.isArray(array)) return null;
// const uniqueSet = [...new Set(array)];
// return uniqueSet;
// }
// console.log(removeDuplicates([25, 65, 32, 65, 95, 75, 85, 95]));
// function removeDuplicates(array) {
// if (!Array.isArray(array)) return null;
// ... | true |
cd147f5a64dbdcd5fa0945f78875bc0bc57cd141 | JavaScript | mkessel007/bb-extra-fields | /geocode-field/bb-geocode.js | UTF-8 | 1,978 | 2.796875 | 3 | [] | no_license | /**
* Get the Lat Lng Marker location using GMaps geocode
* @param string location [description]
* @return {[type]} [description]
*/
( function ( $ ) {
$( document ).ready ( function () {
$( 'body' ).delegate( '.geo-button', 'click', function() {
GEO._getGeoLocation( $ ( '#geo_' + $( this ).data... | true |