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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
708a2330235ffeebcefbaabe3520a536f1657b1b | JavaScript | zinct/javascript-fundamental | /javascriptFundamental/tipeData.js | UTF-8 | 373 | 3.6875 | 4 | [] | no_license | // Tipe data pada javascript
// Number
var number = 1
// String
var string = 'Tipe data string'
// Boolean
var bool = true // Bisa juga dengan nilai false
// Array
var array = [
'Pisang',
'Apel'
]
// Object
var object = {
'nama' : 'indra Mahesa'
}
console.log(number)
console.log(string)
c... | true |
6ac7480c5248b84c0fb43adcf532944f85c6c94c | JavaScript | f-trivino/pr-ci-dashboard | /src/components/PullRequests/PullRequestLabels.js | UTF-8 | 1,899 | 2.609375 | 3 | [
"MIT"
] | permissive | import React from 'react';
// source: https://stackoverflow.com/questions/35969656/
function padZero(str, len) {
len = len || 2;
var zeros = new Array(len).join('0');
return (zeros + str).slice(-len);
}
// source: https://stackoverflow.com/questions/35969656/
function invertColor(hex, bw) {
if (hex.in... | true |
aab4fafb0fc364e0d6bdae3049b4383e5697cc85 | JavaScript | koko1313/react-mobx-state-tree-example | /src/models/WishList.js | UTF-8 | 1,079 | 2.59375 | 3 | [] | no_license | import { types, getParent, destroy } from "mobx-state-tree";
export const WishListItem = types
.model({
name: types.string,
price: types.number,
}).actions(self => ({
changeName(newName) {
self.name = newName;
},
changePrice(newPrice) {
self.price... | true |
d7d255ae5ffbc8729e0d9b36b025773953372fdf | JavaScript | YA7MO/Tic-Tac-Toe | /main.js | UTF-8 | 5,957 | 3.390625 | 3 | [] | no_license | $(document).ready(function() {
startGame();
// main array for board game in order
var arrGame = ['oneF', 'twoF', 'threeF', 'oneS', 'twoS', 'threeS', 'oneTh', 'twoTh', 'threeTh'];
var playerOneScoreCount = 0;
var playerTwoScoreCount = 0;
// save input of users in these variable
... | true |
13a53bff3880868f9bb8971731d6c84973161767 | JavaScript | mariakourtesi/shoppingCart-js-tdd | /_tests_/checkOffer.spec.js | UTF-8 | 1,248 | 2.859375 | 3 | [] | no_license | import { addOffer, getOfferTotal } from '../src/offerCalculator';
describe('the offer calculator', function() {
it('should allow you to add an offer', function() {
expect(addOffer).toBeTruthy();
});
it('should allow you to get an offer total', function() {
expect(getOfferTotal).toBeTruthy();
});
descr... | true |
ec82586cf858fcc907b7a245c0d1e5bf3f559b39 | JavaScript | reedlex98/intermediate-algorithm-scripting-challenge | /Convert HTML Entities /code.js | UTF-8 | 830 | 3.859375 | 4 | [] | no_license | /*
Intermediate Algorithm Scripting: Convert HTML Entities
Convert the characters &, <, >, " (double quote), and ' (apostrophe), in a string to their corresponding HTML entities.
*/
function convertHTML(str) {
return str.split('').map(char => {
switch (char) {
case "'":
... | true |
9a15eccb220a5a3bb0f927694d4f3ef26fdfbf84 | JavaScript | nitz333/backend-server-udemy | /routes/index.js | UTF-8 | 1,256 | 3.09375 | 3 | [] | no_license | /*
* Archivo de rutas principales
*/
// En primer lugar debemos cargar la librería de 'express':
var express = require('express');
// Inicializamos el express.
var rutas = express();
// Establecemos nuestra primera ruta (con tipo de petición get).
// Donde el primer argumento es el path (en este caso la raíz);
//... | true |
cba42bdb51f4dc9e77ab71f3acb96bbb972843af | JavaScript | EB1234/eunity | /public/assets/js/wmodal3.js | UTF-8 | 706 | 3.28125 | 3 | [
"MIT"
] | permissive |
// Get the modal
var winmodal = document.getElementById('myWinmodal');
// Get the button that opens the winmodal
var btn = document.getElementById("myBtn2");
// Get the <span> element that closes the winmodal
var span = document.getElementsByClassName("closing")[0];
// When the user clicks the button, open the winmo... | true |
8e653e7f934e3b003b2948fbd992545a2fc83f10 | JavaScript | SieurCartier/test-inferno | /src/PhoneList.js | UTF-8 | 2,165 | 2.609375 | 3 | [] | no_license | import Component from 'inferno-component';
import Phone from './Phone' ;
class PhoneList extends Component {
constructor(props) {
super(props);
this.state = {
phones: [],
query: '',
orderProp: 'age'
};
}
componentDidMount() {
fetch('./Pho... | true |
9857f233f355680466b223762cd068e72cd43ebd | JavaScript | gregoriB/algorithm-exercises-Javascript | /codesignal/arcade/4-adjacentElementsProduct.js | UTF-8 | 238 | 3.40625 | 3 | [] | no_license | function adjacentElementsProduct(arr) {
let largest = Number.NEGATIVE_INFINITY;
for (let i = 0; i < arr.length; i++) {
largest = arr[i] * arr[i - 1] > largest ? largest = arr[i] * arr[i - 1] : largest;
}
return largest;
} | true |
2b855dde677dddfa594f01543cf94b503c22de60 | JavaScript | 0onhattruongo0/GitProject | /JavaScript/dientichhinhtron.js | UTF-8 | 195 | 2.53125 | 3 | [] | no_license | let R= parseInt ( prompt("Bán Kính"));
let DT= (3.14*R*R);
let CV= (2*R*3.14);
document.write("Diện Tích Hình Tròn là:"+DT);
document.write ("<br/>")
document.write("Chu vi hình tròn:"+CV)
| true |
46d9e14d96654f997c57436b9bbb6013cda30039 | JavaScript | orcade/erpV2 | /ERPSyl/js/components/product/product-edit.js | UTF-8 | 2,903 | 2.640625 | 3 | [] | no_license | const ProductEdit = {
template: `
<div>
<h1>Mettre à jour le produit n°{{ $route.params.id }} </h1>
<div v-if="loading" class="loading">
Loading...
</div>
<div v-if="error" class="error">
{{ error }}
</div>
<form>
<div v-if="item">
... | true |
9b18b20997793d374a1662181e1bfdc7b9f73a05 | JavaScript | UPIIDK/UPIIDK.github.io | /UPI/rv/Source/JsEjercicios/Laberinto/Mapa.js | UTF-8 | 4,471 | 2.640625 | 3 | [] | no_license | function Wall(size,x,y,z){
THREE.ImageUtils.crossOrigin = ' ';
var texturaW = THREE.ImageUtils.loadTexture('../Imagenes/hoja-metalica.jpg');
THREE.Mesh.call(this,new THREE.BoxGeometry(size,size,-0.2+(0.4/1)+(0.5/1)+(1/1)+(0.3/1)+(0.5/1)+(0.2/1)+2.25),new THREE.MeshPhongMaterial({map: texturaW}));
this.size=... | true |
fa5e75367fae2c570a78a734681b2cbec05c8ade | JavaScript | ebeaudet/Project2 | /public/assets/js/triviaquery.js | UTF-8 | 3,189 | 3.515625 | 4 | [] | no_license | $(document).ready(function () {
// first we ping our API for all of its available categories
var catQueryUrl = "https://opentdb.com/api_category.php";
$.ajax({
url: catQueryUrl,
method: "GET"
})
// after data comes back from the request
.then(function (response) {
// we store the data from... | true |
0712a158607786effdfef8244337cbe7161377a5 | JavaScript | ptbw-rideforlife/client | /ride-for-life/src/components/PreviousTrips/DriverPrevious.js | UTF-8 | 2,034 | 2.5625 | 3 | [
"MIT"
] | permissive | import React from 'react';
import { Previous, Button, Container } from '../../simple-library';
class DriverPrevious extends React.Component {
state = {
seeReview: false
}
previousText = {
paddingLeft: '20px'
}
render() {
return (
<Container>
{t... | true |
2aa0c0ea656ae1dba5f978742b4ff04878a9168a | JavaScript | PiNengShaoNian/algorithms-fourth-edition | /ch3/3.5.24.js | UTF-8 | 1,107 | 3.171875 | 3 | [] | no_license | const RedBlackTopDown234Trees = require('../lib/BlackRedTree')
function Interval(index, start, end) {
this.index = index
this.start = start
this.end = end
}
class NonOverlappingIntervalFinder {
constructor(intervals) {
this.redBlackBST = new RedBlackTopDown234Trees()
for (const interval of intervals)... | true |
625304794100f0cac114ed0ae7a75c31bfc13a46 | JavaScript | mikegagnon/fiesty | /fiesty.js | UTF-8 | 3,546 | 3.203125 | 3 | [] | no_license |
var delay_value = 10;
var delay_new_pet_min_base = 50;
var delay_new_pet_max_base = 100;
var delay_hide_pet_min_base = 300;
var delay_hide_pet_max_base = 600;
var delay_new_pet_min = delay_new_pet_min_base * delay_value;
var delay_new_pet_max = delay_new_pet_max_base * delay_value;
var delay_hide_pet_min = delay_h... | true |
94b025ec3c3aec635ea3cd993157cb8e16355a0e | JavaScript | BenediktHofirek/time-tracker | /src/components/timer.jsx | UTF-8 | 3,202 | 2.546875 | 3 | [] | no_license | import React, { Component } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import getMiliseconds from "../services/getMiliseconds";
import getTimeWithoutMiliseconds from "../services/getTimeWithoutMiliseconds";
class Timer extends Component {
state = {};
componentDidMount() {
... | true |
1a5c79bdad5a1eb30a9cb81d78cfeb42c7e530c8 | JavaScript | ccbass/acl-ct-musicbrainz-project | /src/containers/AlbumContainer.jsx | UTF-8 | 1,599 | 2.6875 | 3 | [] | no_license | /* eslint-disable max-len */
import React, { useState, useEffect } from 'react';
import AlbumList from '../components/presentations/AlbumList';
import { getAlbums } from '../components/services/MusicBrainzApi';
import { useParams } from 'react-router-dom';
function AlbumContainer() {
const [albums, setAlbum] = use... | true |
1c43d67d2d7e0e7b297a38bbef40bc99d110dc5c | JavaScript | stecb/react_examples | /src/components/input.jsx | UTF-8 | 902 | 2.984375 | 3 | [
"MIT"
] | permissive | import React from 'react';
//
// Fifth example
//
export class Input extends React.Component {
constructor() {
super();
this.state = {txt: ''};
}
componentDidMount() {
this.refs.myInput.focus();
}
render() {
return (
<div>
<input type='text' ref='myInput' placeholder='look!' o... | true |
91356627f7c70fb5acedf5f4748336299d9aaeb9 | JavaScript | actarian/framework | /module/events/ui.service.js | UTF-8 | 6,058 | 2.5625 | 3 | [] | no_license | /* global angular */
(function() {
"use strict";
var app = angular.module('framework');
app.factory('Vector', function() {
function Vector(x, y) {
this.x = x || 0;
this.y = y || 0;
}
Vector.make = function(a, b) {
return new Vector(b.x - a.x, b.... | true |
3548a1afe3275f6266807d39b58c3a4df939e63c | JavaScript | form-in-code/node-stuff | /weather-app/utils.js | UTF-8 | 1,288 | 2.828125 | 3 | [] | no_license | const request = require("request")
const geoCode = (address,callback) => {
const url = 'https://api.mapbox.com/geocoding/v5/mapbox.places/'+address+'.json?access_token=pk.eyJ1IjoibWFuaXNoLW5vZGUtdGVzdCIsImEiOiJja283cmZka3kxZXJuMnZtbG1pd3NoeHRrIn0.Zz9n-LCHp3naoVYqpoX9UA'
request({url:url, json: true},(error,res... | true |
6b5a2b91d33f6adee188903d0f65df0db7748699 | JavaScript | netrebel/nodejs-notes | /playground/debugging.js | UTF-8 | 113 | 3.015625 | 3 | [] | no_license | var person = {
name : 'Miguel'
};
person.age = '37';
debugger;
person.name = 'Mike';
console.log(person); | true |
c78b779df8184ebdccf667272d5cc5ad69091df2 | JavaScript | David-Aires/GreenR | /Web app/include/unitTest.js | UTF-8 | 4,644 | 2.765625 | 3 | [] | no_license | function verifPseudo(champ){
if(champ.value.length < 2 || champ.value.length > 25)
{
surligne(champ, true);
return false;
}
else
{
surligne(champ, false);
return true;
}
}
function verifMail(champ){
var regex = /^[a-zA-Z0-9._-]+@[a-z0-9._-]{2,}\... | true |
8d81033bdd06fecec979448cc4d92f6ff4d1dc44 | JavaScript | OskarGrzenda/DCWAProject | /mongoDAO.js | UTF-8 | 1,572 | 2.546875 | 3 | [] | no_license | const MongoClient = require('mongodb').MongoClient;
const url = 'mongodb://localhost:27017';
const dbName = 'headsOfStateDB'
const collName = 'headsOfState'
var headsOfStateDB
var headsOfState
//connects my mongo database to my project
MongoClient.connect(url, { useNewUrlParser: true, useUnifiedTopology: true })
... | true |
f7305df0e9246bd6d1fde3758751309bc4c4d9b7 | JavaScript | toke74/react-calculator | /src/components/converter/currency/CurrencyConverter.js | UTF-8 | 1,783 | 2.9375 | 3 | [] | no_license | import React, { Component } from "react";
import CountryCodes from "./CountryCodes";
import Navbar from "../../navbar/Navbar";
import "./CurrencyConverter.css";
export class CurrencyConverter extends Component {
state = {
currency: {},
date: new Date(),
from: "USD",
to: "SEK",
amount: " 1",
r... | true |
f19624a7ec2db1e96ac79494d851c1aa291da3ea | JavaScript | Nicholasdeveault/Judo-training-manager | /frontend/src/addExerciseBar.js | UTF-8 | 1,988 | 2.625 | 3 | [] | no_license | import React, { useState } from "react";
import styled from "styled-components";
const AddBar = () => {
const [addedToList, setAddedToList] = useState({ type: "", name: "" });
const handleButtonClick = () => {
fetch("/newExercise", {
method: "POST",
headers: { "Content-Type": "application/json" },... | true |
98bf30d1a4833efdd74a0cac1abbe79d26da3aa7 | JavaScript | cunninghamge/javascript-foundations | /oregon-trail/src/settler.js | UTF-8 | 728 | 2.96875 | 3 | [] | no_license | class Settler {
constructor(obj) {
obj && Object.assign(this, obj);
if (!this.nationality) this.nationality = 'unknown';
this.ailments = [];
this.status = 'healthy';
}
experienceDistress(ailment) {
if (this.status === 'dead') return;
this.ailments.push(ailment);
switch (this.ailm... | true |
fc5102b96b8b9efb168c04075f49d1dd2504f24e | JavaScript | ronizshakya/React | /17. Js Math/index.js | UTF-8 | 856 | 3.28125 | 3 | [] | no_license | Math.PI; // returns 3.141592653589793
Math.round(4.7); // returns 5
Math.round(4.4); // returns 4
Math.pow(8, 2); // returns 64
Math.sqrt(64); // returns 8
Math.abs(-4.7); // returns 4.7
//Math.ceil(x) returns the value of x rounded up to its nearest integer:
Math.ceil(4.4)... | true |
b816b8705f8e9869cf3bae0be111d00252f06696 | JavaScript | MatsLanGoH/frontend_playground | /js/keyboard_events.js | UTF-8 | 778 | 3.515625 | 4 | [] | no_license | /*
Add Event listener for keypresses
Note: event.keyCode is deprecated,
and event.key should be used if available.
Webkit doesn't support event.key at the time of writing
*/
document.addEventListener('keydown', (event) => {
var elem = document.getElementById('keyevent-keydown');
elem.innerHTML = parseKey(event) + ... | true |
c47fe57f7c8dfdd61cf80554efa4f9fbe9829092 | JavaScript | karu-10/karu-10.github.io | /js/main.js | UTF-8 | 7,214 | 3.421875 | 3 | [] | no_license | 'use strict';
{
class Panel{
constructor(game){
this.game=game;
this.el=document.createElement('li');
this.el.classList.add('pressed');//elはプロパティ
}
getEl(){
return this.el;
}
active(num){//パネルを決定
this.el.classList.remove('pressed');
if(num ===... | true |
37c4aca10c1339985265b8c0a0024fef6c3beab4 | JavaScript | kazu2012/gss | /app/models/user.js | UTF-8 | 1,162 | 2.59375 | 3 | [] | no_license | var mongoose = require('mongoose'),
bcrypt = require('bcrypt'),
uid = require('uid');
var UserSchema = new mongoose.Schema({
email: {
type: String,
required: true,
unique: true,
match: /^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$/
},
password: {
... | true |
7553b071fe42c48931b9a3137840530ffd66d909 | JavaScript | anka-213/advent_of_code_2017 | /DonKarlssonSan-JavaScript/day3.js | UTF-8 | 1,319 | 3.359375 | 3 | [] | no_license | /*
37 36 35 34 33 32 31
38 17 16 15 14 13 30
39 18 5 4 3 12 29
40 19 6 1 2 11 28
41 20 7 8 9 10 27
42 21 22 23 24 25 26
43 44 45 46 47 48 49
*/
let value;
let values = new Map();
let x, y;
function steps(sq) {
value = 1;
x = 0;
y = 0;
addCurrent();
... | true |
ea489ce67aeb48c4874796d1fde6b7086a965bd1 | JavaScript | SamuelSTPL/m2-5-js--events-P1 | /workshop/exercise-1.2/app.js | UTF-8 | 735 | 3.75 | 4 | [] | no_license | let win = document.createTextNode("You Win!");
let loose = document.createTextNode("You Loose");
let p = document.getElementById("result");
let isWin = false;
let timeSpan = document.getElementById("time");
let random = function () {
return Math.floor(Math.random() * 5 + 1);
};
let timeLeft = random();
timeSpan.inne... | true |
69d272d3b3afdf5085379984f544092e2da93f78 | JavaScript | bidiu/the-host | /app/assets/js/ui/Banner.js | UTF-8 | 4,187 | 2.578125 | 3 | [] | no_license | const withNotifications = (WrappedComponent) =>
(props) => (
<NotificationContext.Consumer>
{({ entries, addNotification, removeNotification }) => (
<WrappedComponent entries={entries}
addNotification={addNotification}
removeNotification={removeNotification}
{...props... | true |
d77e97b84edd59fe57d120b3677b77e17aef8ffb | JavaScript | Remilo7/startopole | /src/main/webapp/resources/static/js/affix.js | UTF-8 | 505 | 3.5 | 4 | [] | no_license | var header = document.getElementById("nav");
var sticky = header.offsetTop;
var sticked = false;
function myFunction() {
if (window.pageYOffset > header.offsetTop) {
header.classList.add("sticky");
sticked = true;
}
if (window.pageYOffset < sticky && sticked){
header.classList.remov... | true |
10342a71de0cda464bb3382b0d44ba05dc4f04d8 | JavaScript | r-schultz/apt_search | /src/AptSearch.js | UTF-8 | 2,720 | 2.546875 | 3 | [] | no_license | var moment = require('moment');
require('grouped-categories');
var EssexSearch = require('search/essex-search');
var TritonSearch = require('search/triton-search');
var date = new moment().add(30, 'days').format('MM-DD-YYYY');
var AptSearchApp = function() {
var app = this;
//Bind date button
$('.date').val(dat... | true |
89e7964f4df0d60ec45f95cc5fbfa89aa5ed7a92 | JavaScript | dpaula/advancing-javascript | /js/buscar-pacientes.js | UTF-8 | 848 | 3.203125 | 3 | [] | no_license |
let btBuscarPaciente = document.querySelector("#buscar-paciente");
//cria um evento de clique para o botao
btBuscarPaciente.addEventListener("click", function () {
//instancia um controlador de xml response request
let xhr = new XMLHttpRequest();
//abre com a url com metodo get
xhr.open("GET", "... | true |
d43aa5b2ecdaf789dc9f3fefc363f1b9ae681c5c | JavaScript | dingproject/ting | /modules/ting_availability/js/ting.availability.ting_object_view.js | UTF-8 | 2,154 | 2.546875 | 3 | [] | no_license | /**
* @file
* Specific availability behavior for detailed object page.
*/
Drupal.behaviors.tingAvailabilityTingObjectView = function () {
"use strict";
// Use get_details to load detailed data for each item on the page.
Drupal.tingAvailability.get_details(function (data, textStatus) {
// Update the stand... | true |
00b76bef885ca2ca6dd045d409addc13965ac4e2 | JavaScript | rahul1321/Todo-app | /app/api/api.js | UTF-8 | 352 | 2.53125 | 3 | [] | no_license | import axios from 'axios';
const Api = {
fetchAllTodos : async ()=> {
let data = [];
await axios.get('https://jsonplaceholder.typicode.com/posts')
.then(res=>{
data = res.data;
})
.catch(error=>{
//console.log(error);
})
return da... | true |
3cfcd71341d0524bf03194e41b2c4a68da77af41 | JavaScript | Doesntmeananything/coding-problems | /Algorithms/Length of Last Word.js | UTF-8 | 334 | 3.609375 | 4 | [] | no_license | /**
* @param {string} s
* @return {number}
*/
var lengthOfLastWord = function(s) {
const toArray = s.trimEnd().split(" ");
return toArray[toArray.length - 1].length;
};
console.log(lengthOfLastWord("Hello World"));
console.log(lengthOfLastWord("My Name Is Andrey"));
console.log(lengthOfLastWord("I've come to ba... | true |
bf77750155eb076e1554319d2e8e87be36f45471 | JavaScript | simbaa345/millionaire | /client/js/rendering/element/QuestionAndChoicesElement.js | UTF-8 | 6,937 | 2.828125 | 3 | [] | no_license | const CanvasElement = require('./CanvasElement.js');
const Choices = require('../../../../server/question/Choices.js');
const Colors = require('../Colors.js');
const Constants = require('../Constants.js');
const MillionaireBubble = require('./MillionaireBubble.js');
const MillionaireBubbleBuilder = require('./Millionai... | true |
a917b9443c0ec4a79a1851892174a2be470ddc12 | JavaScript | Yuuanother/mocha-tutorial-primeros-pasos | /ejemplo_2.unite_test.mocha_jquery/ejemplo.con.jquery/test/test.js | UTF-8 | 1,859 | 2.609375 | 3 | [] | no_license | var assert = require("assert");
var counter = require('../js/counter');
var jsdom = require("jsdom").jsdom;
var Faker = require('Faker');
global.$ = require('jquery')(jsdom().parentWindow);
describe('Counter', function() {
beforeEach(function(){
$('body').html('<textarea class="description" maxlength="500">... | true |
9e3cf33cf6b27174afbd50b1e87eb69d7fff862d | JavaScript | Yalgie/hamagram | /client/src/components/Forms/RegisterForm.js | UTF-8 | 2,863 | 2.578125 | 3 | [] | no_license | import React, { useState } from 'react';
import { connect } from 'react-redux';
import { createUser } from "../../store/actions";
import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';
import useStyles from "../Styles/form";
const RegisterForm = ({ createUser }) => {
//... | true |
bcfa32b60b802cad61ab1985d98438bbb11489a6 | JavaScript | pedropamn/utils | /utils.js | UTF-8 | 1,750 | 3.34375 | 3 | [] | no_license | //Buscar qualquer informação em uma tabela. Insira onkeyup="Busca()" no campo de input.
function Busca() {
// Declare variables
var input, filter, table, tr, td, i;
input = document.getElementById("myInput"); //Id do campo input
filter = input.value.toUpperCase();
table = document.getElementById("myTab... | true |
cdf1feb2d0e3addac7f7bc61c345aedcf7ba08ac | JavaScript | RashidUjang/node-fileserver | /fileserver.js | UTF-8 | 5,745 | 3.21875 | 3 | [] | no_license | const { createServer } = require("http");
// Stores the objects that will handle the GET, PUT & DELETE methods
// Object is not inherited from anything, instead of creating with {}, which inherits methods and properties of Object.prototype
// These properties are such as .toString()
const methods = Object.create(null)... | true |
9e93d6fdfd3f98fec063b4c47950d5b047865a2b | JavaScript | rafdul/pizzeria-portal | /public/front/js/components/Booking.js | UTF-8 | 15,196 | 2.6875 | 3 | [] | no_license | import {select, settings, templates, classNames} from '../settings.js';
import {utils} from '../utils.js';
import AmountWidget from './AmountWidget.js';
import DatePicker from './DatePicker.js';
import HourPicker from './HourPicker.js';
class Booking{
constructor(containerOfBooking){
const thisBooking = this;
... | true |
f60a3d45be052f1997fc98b52b4cc13bc8cf0682 | JavaScript | yued-fe/lulu | /theme/hope/ui/Popup/index.js | UTF-8 | 14,732 | 2.5625 | 3 | [
"MIT"
] | permissive | /**
* @author zhangxinxu
* @create 2022-02-14
* @description 弹出层处理
**/
/**/import UiOverlay from '../Overlay/index.js';
class UiPopup extends HTMLElement {
static get observedAttributes () {
return ['open', 'height', 'width', 'radius', 'background', 'close-icon'];
}
constructor (params) {
... | true |
32b966c94c5ae0b56143d1af8915bf387e54c236 | JavaScript | michealbmullin/todolistapp | /reacttodolist/todolist/src/TaskUpdater.js | UTF-8 | 1,837 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import {Connection} from './Constants';
import './Main.css';
export default class TaskUpdater extends Component {
constructor(props){
super(props);
this.state={
taskId:(this.props.taskPassId),
statusState:"true",
text:(th... | true |
6317cd1d2dac635984dd4df7ea1204e5fdd79410 | JavaScript | thejoggeli/mandelbrot-logistic | /jogg/util/Numbers.js | UTF-8 | 2,852 | 3.140625 | 3 | [] | no_license | import Strings from "./Strings.js"
function Numbers(){}
Numbers.PI2 = Math.PI*2
Numbers.rad2deg = 1/Math.PI*180
Numbers.deg2rad = 1/180*Math.PI
Numbers.clamp = function(x, min, max){
if(x < min) return min
if(x > max) return max
return x
}
Numbers.linspace = function(start, stop, num, endpoint){
var out = ne... | true |
50f996c14fa0a57ded536fe5db299b94dc58d218 | JavaScript | pierreyfl/ormdo | /app/assets/javascripts/_a_d_s.js | UTF-8 | 1,762 | 2.84375 | 3 | [] | no_license | var $visitTypeSelect;
var $viewTypeSelect;
$(document).ready(function() {
$visitTypeSelect = $('.ads #ad_visit_type');
$viewTypeSelect = $('.ads #ad_view_type');
var visitTypeValue = $visitTypeSelect.val();
var viewTypeValue = $viewTypeSelect.val();
toggleFieldsForSelectIDAndValue('ad_visit_type', visitTyp... | true |
e5012093cfe1aaf931e46466b53b43281bae37b3 | JavaScript | rupeshjatav/Task_3_ECOM-WEBSITE | /ecom-website/MAC/SHOP/static/SHOP/javaecom.js | UTF-8 | 4,827 | 2.703125 | 3 | [] | no_license | let cart=document.querySelectorAll('.order');
console.log(cart.length);
for(let i=0; i < cart.length;i++){
cart[i].addEventListener("click",myFunction);
}
function myFunction(e) {
let productNumbers = localStorage.getItem('cartNumbers');
var product_id = this.da... | true |
aa657fbc3c8f781dd283532043ce718f13548370 | JavaScript | jamesbting/learning-file-watching | /watch.js | UTF-8 | 980 | 2.890625 | 3 | [] | no_license | const fs = require("fs")
require("log-timestamp")
const md5 = require("md5")
const buttonPressesLogFile = "./logs/button-presses.log"
console.log(
`Watching for file changes on ${buttonPressesLogFile} using fs.watch`
)
//this will watch for content changes AND for rename events
// fs.watch(buttonPressesLogFile, (ev... | true |
383340c0291754aec55be30479761c5da2ca6f4b | JavaScript | ericdwz/TestField | /WebContent/testJS.js | UTF-8 | 778 | 3.296875 | 3 | [] | no_license | function main() {
var snowNum = 0;
var cloud = setInterval(snowDrop, 3000);
function snowDrop() {
snowNum++;
if (snowNum > 30) {
clearInterval(cloud);
}
var snow = creatImg();
var pos = -200;
var contain = document.getElementById("contain");
setInterval(frame, 5);
snowNum++;
var h = contain.offs... | true |
c0e55f0893158812cbdec8076cb9b02ded49c4f3 | JavaScript | Veronika-Cheverdynska/math-game | /js/main.js | UTF-8 | 4,326 | 3.484375 | 3 | [] | no_license | //Define variables
var playing = false; //we don't play yet
var score;
var action;
var timeForCountDown;
var correctAnswer;
var correctPosition;
//Game
document.getElementById("start-reset").onclick = function() {//when we click on start-reset button
//if we are playng
if (playing == true) {
loca... | true |
9c98ce3f8613607e8fd3a654d44fdf66bfd2ee18 | JavaScript | mikedeswert/spaceshooter | /src/ships.js | UTF-8 | 9,246 | 2.609375 | 3 | [] | no_license | var ships = (function(hulls, ai, upgrades, utils) {
var game;
var enemies;
function preload(newGame) {
game = newGame;
}
function create() {
enemies = new Enemies();
}
function Enemies() {
var ships = [];
this.group = game.add.group();
this.group.e... | true |
612e94d4d42909a46b198ad278bbeae6be4d93e3 | JavaScript | yutung1028/-Integrated-Employment-Assistance-Programme-for-Self-reliance-Management-System | /api/services/CommonService.js | UTF-8 | 5,110 | 2.921875 | 3 | [] | no_license | //Common Service
module.exports = {
changeDateFormat: function(date_object) {
//TODO:check whether its a date object
date_object = date_object.getFullYear() + "-" + (date_object.getMonth() + 1) + "-" + date_object.getDate();
return date_object;
},
changeExcelDate: function(excel_date) {
var date_array = exc... | true |
236a6c4df59af2d3a6d0d32c1f06355d4a0e1880 | JavaScript | belloumiolfa/Make-it | /Back-end/Validators/ComingSoon/ContactValidator.js | UTF-8 | 1,056 | 2.78125 | 3 | [] | no_license | import Validator from 'validator';
import isEmpty from './is-empty.js';
function ContactValidator(data) {
let errors = {};
data.email = !isEmpty(data.email) ? data.email : '';
data.name = !isEmpty(data.name) ? data.name : '';
data.subject = !isEmpty(data.subject) ? data.subject : '';
data.message = !is... | true |
37490f7c345a3bbfed25d6e188a35c7661b48ca9 | JavaScript | xiaohan2013/fe-ex | /ts/basic_test/demo_01.js | UTF-8 | 1,713 | 3.828125 | 4 | [] | no_license | // 布尔值
var isDone = false;
// 数值
var decLiteral = 5;
var hexLiteral = 0xf00d;
var binaryLiteral = 10;
var octalLiteral = 484;
// 字符串
var _name = "Bob";
var name2 = "Smith";
// 模板字符串
var name1 = "Gene";
var age = 37;
// 数组
var list = [1, 2, 3];
// 泛型数组
var list1 = [1, 2, 34, 5];
// 元祖
var x;
x = ['helllo', 10];
// 枚举
va... | true |
78fff82a9bedd5c2790ecbe9448c4086ea76b6fb | JavaScript | 17x/17x.github.io | /z-copy/zcopy.js | UTF-8 | 2,549 | 2.921875 | 3 | [] | no_license | const ZCopy = ({ input, mode = 'text', fileOption = null, cb, error, alertMsg = '' }) => {
let isClipApi = 'ClipboardItem' in window && navigator.clipboard;
const CopyText = (text) => {
// Clipboard api
if('ClipboardItem' in window && navigator.clipboard){
// let _i = [new Clipboard... | true |
1332c992305147babfa101d96df63866e16bebaa | JavaScript | AlisaMilyukhina/Mesto-Yandex.Praktikum | /scripts/index.js | UTF-8 | 7,159 | 2.59375 | 3 | [] | no_license | import { Card } from './Card.js';
import FormValidator from './FormValidator.js';
//массив изначальных карточек
const initialCards = [
{
name: "Архыз",
link:
"https://pictures.s3.yandex.net/frontend-developer/cards-compressed/arkhyz.jpg",
},
{
name: "Челябинская область",
link:
... | true |
2f49c9dad72bb0171cbc6f96367c18c01927bc27 | JavaScript | MattMS/todo_Ramda_React | /text_input_component/render.js | UTF-8 | 626 | 2.671875 | 3 | [
"MIT"
] | permissive | const R = require('ramda')
const h = require('../h')
const ENTER_KEY = 13
const ESC_KEY = 27
//
// Exports
//
module.exports = R.curry(function (send, attributes) {
let input_node = null
function onKeyDown (event) {
if (event.keyCode === ESC_KEY) {
// send(null)
return
}
if (event.keyCode !== ENT... | true |
5f32378388b2e7aa64e337962c0df591e7898dee | JavaScript | omaracrystal/Job_Pocket_V2 | /server/bot/scraper.js | UTF-8 | 2,333 | 2.59375 | 3 | [] | no_license | // var https = require('https');
// var http = require('http');
// var cheerio = require('cheerio');
// var util = require('util');
// var EventEmitter = require('events').EventEmitter;
// var STATUS_CODES = http.STATUS_CODES;
// // var url = "http://denver.craigslist.org/sof/5263214272.html";
// /*
// * Scraper Cons... | true |
a139fda5f26d0989e3c60d514ec560e221b53f97 | JavaScript | edthedev/edthedev.github.io | /js/art/dots_and_boxes.js | UTF-8 | 2,168 | 3.34375 | 3 | [] | no_license | /*
This is a Live Art work created by Edward Delaporte.
This script is Copyright Edward Delaporte 2021.
This script and the art it creates are licensed under
a Creative Commons Attribution-ShareAlike 4.0
International License.
http://creativecommons.org/licenses/by-sa/4.0/
You can share your own remix of this co... | true |
e702de40365e12d2f17ce5491b08ecd581015153 | JavaScript | rafiq/JS109 | /secondSetOfEasyProblems/runningTotal.js | UTF-8 | 923 | 3.484375 | 3 | [] | no_license | function runningTotal(array) {
// let newArray = [];
let sum = 0;
return array.map((num,idx) => {
// if (idx === 0) return num;
sum += array[idx];
return num = sum;
})
// array.reduce((acc,curr,idx) => {
// if (idx = 0) return newArray.push(acc);
// acc += cu... | true |
5bce6462862609158f12b6ea7a8516ba25ceffb5 | JavaScript | monad-one/meiosis | /tutorial/mithril/03-update-model-solution.js | UTF-8 | 744 | 3.453125 | 3 | [
"MIT"
] | permissive | /*global m*/
// Pass an object as the model
var model = { label: "The Counter", value: 0 };
// Change the increase function to increase the model value
var increase = function(_event) {
model.value = model.value + 1;
m.render(element, view(model));
};
// Add a decrease function
var decrease = function(_event) {
... | true |
d39f51968f0ba7936b750857c6f0093ad990b384 | JavaScript | tomlagier/code-samples | /PHP/WordPress projects/The_Wharf/js/custom.js | UTF-8 | 7,616 | 2.609375 | 3 | [
"MIT"
] | permissive | jQuery( function( $ ){
//User agent detection - not greeeaaat.
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.us... | true |
6079bcd9f02d13dbb0cba6edd5938671b8480900 | JavaScript | Jowagoal/Jowagoal.github.io | /snakeskins/sketch.js | UTF-8 | 33,174 | 3.296875 | 3 | [
"Unlicense"
] | permissive | // 2D Grid - Snake
// Jordie Walter
// Nov 12, 2019
//
// Extra for Experts: I'm not sure how much this qualifies for
// extra for experts but I'm really proud of the code for the size
// of the grid. How I wrote the code allows the program to create
// the smallest possible grid for the number of skins there are.
/... | true |
84a4012c43225e1420feed8d6390729ebbf0ac8f | JavaScript | Elevationacademy/js-week-1-Shorouq-Mohammad | /maine3.js | UTF-8 | 206 | 3.296875 | 3 | [] | no_license | let performance = "stellar"
let salary = 10000
const goodBonus = 1000
const stellarBonus = 3000
if(performance == "stellar"){
salary += stellarBonus
}else{
salary += goodBonus
}
console.log(salary) | true |
f7f2b8128cd40910a16fa3ea60192575592b081a | JavaScript | Sugarfooot/VeggyBot | /Assets/Standard Assets/Scripts/MenuAccueil/MenuManager.js | UTF-8 | 2,219 | 2.703125 | 3 | [
"MIT"
] | permissive | #pragma strict
import UnityEngine.SceneManagement;
import UnityEngine.UI;
@Tooltip ("Niveau à charger quand le joueur clique sur JOUER")
var levelToLoad : String;
var cursorsParent : Transform;
var cursorInterval : float = 0.2;
var loadingScreen : GameObject;
var loadingProgress : Image;
private var cursorIdx : int... | true |
9521865754fdf9012ea8af562cb9dd27dbacf404 | JavaScript | Mazucu/my-library-functions | /src/BookSearch.js | UTF-8 | 3,414 | 2.6875 | 3 | [] | no_license | import React, { useState } from "react";
import { Link } from "react-router-dom";
import Shelf from "./Shelf";
function BookSearch(props) {
const [inputText, setInputText] = useState("");
let noResult = false;
props.searchBooks.length === 0 ? (noResult = true) : (noResult = false);
const handleChange = (e) =>... | true |
e4681d7598d0d9023452a4355adcf336a12689fe | JavaScript | ZacGipp/jmake-resource | /天津有限/js/iframeObj.js | UTF-8 | 2,275 | 2.609375 | 3 | [] | no_license | /*! All rights reserved, Pirates must investigate! 2019-04-11 */
function popUP(t) {
this.left = parseInt(t.left) || 0, this.top = parseInt(t.top) || 0, this.width = parseInt(t.width) || 1280, this.height = parseInt(t.height) || 720, this.id = t.id || "__ifr", this.url = t.url || "", this.callBack = t.callBack || f... | true |
3ae2c417dffa31970b8e8b42e67ea526c41ef89c | JavaScript | st3xupery/hexo-theme-daedalus | /source/js/main.js | UTF-8 | 5,785 | 2.53125 | 3 | [
"MIT"
] | permissive | (function() {
var module = window;
module.parseHTML = function(str) {
var tmp = document.implementation.createHTMLDocument();
tmp.body.innerHTML = str;
return tmp.body.children;
};
module.scrollToTop = function scrollToTop(scrollDuration) {
var scrollStep = -window.scrollY / (scrollDuration / 15),
s... | true |
0f919ca2966af2dfc57994f977b9c2516171aafc | JavaScript | kino156/feExercise | /javascript/2/js.js | UTF-8 | 975 | 3.65625 | 4 | [] | no_license | window.onload = function () {
// 在注释下方编写代码
// 遍历读取aqiData中各个城市的数据
// 将空气质量指数大于60的城市显示到aqi-list的列表中
var aqiData = [
["北京", 90],
["上海", 50],
["福州", 10],
["广州", 50],
["成都", 90],
["西安", 100]
];
//filter过滤代替if条件、forEach循环代替for循环
... | true |
4671aea670c13620289ee714ab611159fe952fce | JavaScript | Wolfhan99/LeetCode-Javascript-Solution | /常考代码/手撕代码/实现一个forEach.js | UTF-8 | 1,174 | 4.5 | 4 | [] | no_license | /*
forEach()方法对数组的每个元素执行一次给定的函数
arr.forEach(function(currentValue, currentIndex, arr) {}, thisArgs)
// currentValue 必需.当前元素
// currentIndex 可选. 当前元素的索引
// arr 可选.当前元素所属的数组兑现
// thisArg 可选.当执行到回调函数时,用作this的值
*/
Array.prototype._forEach = function (fn, thisArgs) {
if (typeof fn !== 'function') throw '参数必需为函数';
i... | true |
7887d94ae5e3e8cf7f8b5889763f34e908ca6985 | JavaScript | guntoroyk/webbootcamp | /Section 10 Introduction to Javascript/02 Age Calculator/script.js | UTF-8 | 122 | 3.8125 | 4 | [] | no_license | var age, ageDays;
age = prompt("What's your age?")
ageDays = age * 365;
alert(age + " is roughly " + ageDays + " days"); | true |
4525271e8327164e500466200dae0e72355d5edd | JavaScript | LBbot/stock-updater | /dist/quantityCalculator.js | UTF-8 | 344 | 2.859375 | 3 | [] | no_license | export const quantityCalculator = (transactionsArray, quantity) => {
transactionsArray.forEach(transaction => {
if (transaction.type === "order") {
quantity += transaction.qty;
}
else if (transaction.type === "refund") {
quantity -= transaction.qty;
}
});
... | true |
7f6217a333467d79000c0da7ccb21d63c2bfcdb5 | JavaScript | kinsney/smartSchool | /src/render/table/floors/floor.js | UTF-8 | 1,174 | 2.671875 | 3 | [
"MIT"
] | permissive | const THREE = require('three')
const store = require('../../../store')
const build = exports.build = (name,x=0,y=0,z=0) =>
{
const loader = new THREE.JSONLoader()
let floorLength = store.building.floors.length
let mesh = new THREE.Mesh()
let buildingName = store.building.name
mesh.name = `${build... | true |
ed2af1aa7a8702afc0027fe346d0699328017b99 | JavaScript | lucaastorres/webmoderncod3r | /fundamentos/exercicios/exec_28.js | UTF-8 | 458 | 4.25 | 4 | [] | no_license | /*28)Ler um vetor de números inteiros e imprimir quantos são pares e quantos são ímpares*/
function paresImpares(vetor) {
let numeroDePares = 0
let numeroDeImpares = 0
for(let i = 0; i < vetor.length; i++){
if(vetor[i] % 2 ==0){
numeroDePares++
} else {
numeroDeImpa... | true |
be7c739583ac69c90f325889497f38293056f541 | JavaScript | fczbkk/workshop-js-principles | /30-async/30-promise/50-all.js | UTF-8 | 482 | 3.203125 | 3 | [] | no_license | function delayedResponse (seconds) {
return new Promise(function (resolve, reject) {
if (isNaN(seconds)) {
reject('Not a number.');
// setTimeout(reject, 2500, 'Not a number');
} else {
setTimeout(resolve, seconds * 1000, seconds);
}
});
}
var my_promises = [
delayedResponse(1),
... | true |
a63062a2c4c1b1e585635e65cb6def6588192abd | JavaScript | AAI-USZ/FixJS | /input/100+/after/f417b2e751b32f99ac3b8774882b5f0845f18b6f_1_10.js | UTF-8 | 49,341 | 2.859375 | 3 | [
"MIT"
] | permissive | function() {
/**
* @id debug
* @module 1
* @configurable no
* @name Debugging Support
*/
function error(msg) {
if (window.console) console.log(msg);
throw Exception("MINI debug error: " + msg);
}
/**
* @id dollar
* @module 1
* @requires dollarraw addelementlistfuncsstart
* @configurable yes
... | true |
fd5e4c89fa5ebbec5bc887414c3ef88cab292a4b | JavaScript | kamilkow1123/blogpage | /src/actions/auth.js | UTF-8 | 2,681 | 2.578125 | 3 | [] | no_license | import {
USER_LOADED,
USER_LOADING,
AUTH_ERROR,
LOGIN_SUCCESS,
LOGIN_FAIL,
LOGOUT_SUCCESS,
REGISTER_SUCCESS,
REGISTER_FAIL,
} from "./types";
import resultsAPI from "../apis/resultsAPI";
import history from "../history";
//check token & load user
export const loadUser = () => async (dis... | true |
ac09a1d84d7bed5b304963ebcacc58a306c1a49b | JavaScript | CamiloFrancoDW/Javascript-Practicas | /Condicionales/condicionales.js | UTF-8 | 2,160 | 4.125 | 4 | [] | no_license | /***
* Condicionales
*/
let numero = 5;
if(numero > 2)console.log( `${numero} es mayor a 2`);
let numeros = -106;
if(numeros < 2){
console.log( `${numeros} es menor a 2`);
}else {
console.log( `${numeros} es mayor a 2`);
}
let num1 = 500;
let num2 = -1;
if (num1 > 0) {
if (num2 > 0) {
co... | true |
ea35a611638072a59b9d19411d228a172a90d086 | JavaScript | yiqingfeng/node-i18n-translate | /test.js | UTF-8 | 898 | 3 | 3 | [] | no_license | var translate = require('./libs/google-translate-api');
//
// var api = require('google-translate-api');
// api('中文的撒', {from: 'zh-CN', to: 'en'}).then(res => {
// console.log(res);
// console.log(res.text);
// //=> Ik spreek Nederlands!
// console.log(res.from.text.autoCorrected);
// //=> true
// ... | true |
f2366419af723b71a795aacc2a1556d23810ae19 | JavaScript | NadiaGryn/FEM5 | /JS/HW_JS_07/HW_JS_07.js | UTF-8 | 543 | 3.734375 | 4 | [] | no_license | // Document Object Model (DOM) - это среда для работы JS, иерархическая структура всех элементов,
// находящихся на странице.
function createList(array) {
const list = document.createElement(`ul`);
array.map((item) => {
let listItem = document.createElement(`li`);
listItem.innerText = `${item}`;
ret... | true |
ce901ef62f7f582db671e93693067cf503cfca26 | JavaScript | juanpetterson/javascript-practice-problems | /Button 5/script.js | UTF-8 | 1,001 | 4.03125 | 4 | [] | no_license | function createButtons() {
for (let i = 1; i <= 5; i++) {
var button = document.createElement('BUTTON');
button.innerHTML = 'Button ' + i;
button.onclick = function () {
alert('This is button ' + i);
};
document.body.appendChild(button);
}
}
function createButtons2() {
for (let i = 1; i... | true |
e0f32ae91e79c3745bb7fddcca641cdf1b544010 | JavaScript | Bertil/Leykam | /inst/application/www/js/shiny_to_d3_wien.js | UTF-8 | 5,522 | 2.671875 | 3 | [] | no_license |
Shiny.addCustomMessageHandler(
"wien-jsondata",
function(message){
var dataset = JSON.parse(message);
//d3.select("#wien-starChart").selectAll("*").remove();
var xScale = d3.scale.ordinal()
.domain(d3.range(dataset.length))
.rangeRoundBands([0, w], 0.125);
var yScale = d3.scale.linear()
.d... | true |
8c80911d2552ee903e7c939baea763e5f2704171 | JavaScript | didiercabrera/dev-blame | /examples/constructor.js | UTF-8 | 223 | 3.03125 | 3 | [] | no_license | function Person (name) {
this.name = name;
}
Person.prototype.saludar = function() {
console.log('Hola');
};
Person.prototype.method_name = function(first_argument) {
// body...
};
module.exports = Person; | true |
82284e1ff80700f331beaec17c9b1712b246bf4c | JavaScript | nobusiva/react-drip-form | /www/src/pages/examples/normalizing.js | UTF-8 | 4,868 | 2.578125 | 3 | [
"MIT"
] | permissive | /* eslint-disable no-alert */
/* eslint-disable import/extensions */
/* eslint-disable import/no-unresolved */
/* eslint-disable import/no-extraneous-dependencies */
import React, { Component } from 'react';
import { dripForm } from 'react-drip-form';
import { Input, Select } from 'react-drip-form-components';
import {... | true |
bf5ded8f42fc7e7e3b35e4384052060391a38508 | JavaScript | Jose-Mu/MedConsultation-Website | /mental/js/signup.js | UTF-8 | 483 | 2.734375 | 3 | [] | no_license | // Get the modal
var modal = document.getElementById('id01');
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
var passwordPairs = {
"sarahford": "password",
"sford85": "password2"
}
function ... | true |
c9db3a93d62a7806d717c54a886962e96ea93f07 | JavaScript | usman-tahir/es6-design-patterns | /structural-patterns/bridge/src/js/index.js | UTF-8 | 1,256 | 3 | 3 | [] | no_license | (function() {
'use strict';
class Abstraction {
constructor() {}
Operation() {
this.implementor.OperationImplementor()
}
}
class RefinedAbstraction extends Abstraction {
constructor() {
super()
console.log('RefinedAbstraction()')
}
setImplementor(implementor) {
... | true |
d8c9959fe3421cb7d91709dd182e8ae7e7694735 | JavaScript | felicityzhao99/Movie-Platform | /target/fabflix/js_files/payment.js | UTF-8 | 2,812 | 2.953125 | 3 | [] | no_license | let payment_form = $("#payment_form");
var first_name = "";
var last_name = "";
var credit_card = "";
var month = "";
var year = "";
var movie_ids = [];
var total_prices = 0;
jQuery.ajax({
dataType: "text",
method: "POST",
url: "api/shoppingCart",
success: handleCartResult,
error: handleError
});
... | true |
192522a5e9fc196a4133b404407e9ea69df35f05 | JavaScript | SrAdem/MIASHS_M2_2019_2020_DevWebMobile | /game.js | UTF-8 | 19,383 | 3.21875 | 3 | [] | no_license |
/* tableau représentant l'état du jeu
0: case vide
1: pion noir
2: pion blanc
3: reine noire
4: reine blanche
*/
var plateauBasic = [
[1, 0, 1, 0, 1, 0, 1, 0, 1, 0],
[0, 1, 0, 1, 0, 1, 0, 1, 0, 1],
[1, 0, 1, 0, 1, 0, 1, 0, 1, 0],
[0, 1, 0, 1, 0, 1, 0, 1, 0, 1],
... | true |
62cdae190903901bc3b91d46bb22b7ea322e861f | JavaScript | Zenquan/react-learning | /Practice/review-react-todolist/src/Todolist.js | UTF-8 | 1,442 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react';
// import TodoItem from './TodoItem';
class Todolist extends Component {
constructor(props) {
super(props);
this.state = {
inputValue: '',
list: ['learn vue', 'learn vue-router']
}
// 绑定this指向
this.handleInputChange = this.ha... | true |
ee7a958d5b2e54f4458f8489878103bee36bdbcd | JavaScript | JonathanR89/todo-list | /js/model.js | UTF-8 | 497 | 2.75 | 3 | [] | no_license | var myModel = {
name: "Jonathan",
age: 28,
friends: [
{ name: "Erens", age: 30 },
{ name: "Warren", age: 40 },
{ name: "Megan", age: 32 }
]
};
Vue.component('sitepoint', {
props: ['chanel'],
template: '<a href="https://www.sitepoint.com/{{ channel | lowercase }}">{{ channel }} @Sitepoint</span>',
});
var myV... | true |
8b2d90360ce1baabd8c6f4566fa48aeb5139a4f3 | JavaScript | mushkab/mush-assignment | /test/getNumberOfMonthDaysInRange.test.js | UTF-8 | 1,335 | 3.03125 | 3 | [] | no_license | const getNumberOfMonthDaysInRange = require('../getNumberOfMonthDaysInRange');
test('no end date should return full month', () => {
expect(getNumberOfMonthDaysInRange('2014-12', '2014-11-02')).toBe(31);
});
test('no end date should return partial month from start date to end of month', () => {
expect(getNumbe... | true |
d03f120bd46bd69eb061b291bb1791834868e1a2 | JavaScript | jasonleonhard/civic | /packages/budget/src/components/MyTest/index.js | UTF-8 | 1,730 | 2.515625 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
import Slider from 'rc-slider';
import BubbleChart from './BubbleChart';
import { bubbleData, min, max, step, marks, style } from './utils';
import 'rc-slider/assets/index.css';
class StickySlider extends Component {
constructor(props) {
super(props);
this.handleCl... | true |
e07028fb21cef1d80835c2146e208e44922918c4 | JavaScript | didemertens/udemy_webdev | /Front/JavaScript/Level One/js_part_3.js | UTF-8 | 169 | 3.234375 | 3 | [] | no_license | var amountLbs = prompt("Weight in pounds (lbs): ");
var amountKg = amountLbs * 0.454;
alert("That is " + amountKg + " kilograms.");
console.log("Conversion completed");
| true |
56221581165c646d02b5ead3f27402c8226f7f16 | JavaScript | antoniojnr/webdev | /test/teste.js | UTF-8 | 1,195 | 2.578125 | 3 | [] | no_license | //During the test the env variable is set to test
process.env.NODE_ENV = 'test';
//Require the dev-dependencies
let chai = require('chai');
let chaiHttp = require('chai-http');
let server = require('../index');
let should = chai.should();
chai.use(chaiHttp);
//Our parent block
describe('Users', () => {
describe('/G... | true |
352b8b510896bdc74631d033ea541a4494ccc5f1 | JavaScript | DimitarNikolovv06/NotesApp | /src/core/api/notes.api.js | UTF-8 | 924 | 2.671875 | 3 | [] | no_license | import axios from "axios";
const apiURL = "https://notes-db.herokuapp.com";
export function getNotes(id) {
return axios.get(`${apiURL}/notes?authorId=${id}`);
}
export function makeNote(note) {
return axios.post(`${apiURL}/notes/`, note);
}
export function deleteNote(id) {
return axios.delete(`${apiURL}/notes... | true |