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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1e8ca285cb9cac112677ad8b418088bb98bc720d | JavaScript | taiganakagawa/make_decision | /main.js | UTF-8 | 2,132 | 2.609375 | 3 | [] | no_license | var start_t;
var fnt_t;
var gyoukai;
var diff;
var i = 0;
var data = [];
gyoukai = ["農業、林業","漁業","鉱業、採石業、砂利採取業","建設業","製造業","電気・ガス・熱供給・水道業",
"情報通信業","運輸業、郵便業","卸売業、小売業","金融業、保険業","不動産業、物品賃貸業","学術研究、専門・技術サービス業",
"宿泊業,飲食サービス業","生活関連サービス業、娯楽業","教育、学習支援業","医療、福祉","複合サービス業"];
function shuffle(){
return Math.random() -... | true |
d9d231bf7216e6e02887bd91f377942e74487026 | JavaScript | 1910javareact/js-assignment-msbeeman | /problems/02-bubble-sort/02-bubble-sort.js | UTF-8 | 930 | 4.75 | 5 | [] | no_license | /* 2. Bubble Sort
Define function: bubbleSort(numArray)
Use the bubble sort algorithm to sort the array.
Return the sorted array. */
//Implemented using same bubblesort O(n^2) logic in Java from class
function bubbleSort(numArray) {
//Exceptions
if(Array.isArray(numArray) === false){
throw new Error... | true |
7f54e54c48de7e8c55d7096bdac9d5de0e23fd78 | JavaScript | jelywrig/lighthouse-js-fundamentals | /lastIndexOf.js | UTF-8 | 462 | 3.609375 | 4 | [] | no_license | const lastIndexOf = function (array, num){
let result = -1;
array.forEach(function (item, index){
if (item === num ) result = index;
return item;
});
return result;
}
console.log(lastIndexOf([ 0, 1, 4, 1, 2 ], 1), "=?", 3);
console.log(lastIndexOf([ 0, 1, 4, 1, 2 ], 2), "=?", 4);
console.log... | true |
45a583859d1796445d2a41a2fbe8dc676ef1a9aa | JavaScript | immayurpanchal/resume-bootstrap | /src/components/ProfessionalExperience/ProfessionalExperience.js | UTF-8 | 3,197 | 2.5625 | 3 | [] | no_license | import React from "react";
import { connect } from "react-redux";
import {
PROFESSIONAL_EXP_COMPANY,
PROFESSIONAL_EXP_DESCRIPTION,
PROFESSIONAL_EXP_GUIDE,
PROFESSIONAL_EXP_END,
PROFESSIONAL_EXP_START,
PROFESSIONAL_EXP_TEAM
} from "../../constants/constants";
const ProfessionalExperience = props => {
cons... | true |
b5cbbe02be075d6122cb8aa11d639ce158e96448 | JavaScript | thinkful-ei26/RandyS-Bryan-DSA-Sorting | /drills.js | UTF-8 | 4,470 | 4 | 4 | [] | no_license | // Input:
// Create a method that takes three parameters. Input, Length and Start.
// Input is an unsorted array -> Length is how many times we need to loop. Pivot item is last item in the array
// so that our loop ends before the pivot value
// Start -> Starts loop from 0
// Output
// Pseudocode
let qsCount = 0
const... | true |
63f20b9ec860f9b3f3cbfd18eac81e4cd3798dab | JavaScript | asipser/LampColors | /scripts.js | UTF-8 | 734 | 2.6875 | 3 | [] | no_license |
function updateSlider(color){
slider_ctx.clearRect(0,130,130,50);
slider_ctx.fillStyle = color;
slider_ctx.rect(0,130,130,50);
slider_ctx.fill();
}
function componentToHex(c) {
var hex = c.toString(16);
return hex.length == 1 ? "0" + hex : hex;
}
function rgbToHex(r, g, b) {
r = Math.floor... | true |
0a86a7e39ce704c79c8fc51b6e1f5a90d778ccaa | JavaScript | paigen11/udemy-algos-data-structs | /searchingAlgorithms/binarySearch.js | UTF-8 | 2,141 | 4.96875 | 5 | [] | no_license | /* faster than linear search - eliminate half the remaining elements
BUT binary search only works on SORTED arrays
basically, you just keep picking the halfway point in the array
narrowing it down each time by half
until you reach the value you're looking for
dividing and conquering */
/* big o: worst and average ... | true |
75cc0d2388ec6dd9e96fd942874e7f02b39d0b34 | JavaScript | BhanuprakashThota/appchallenge2 | /jslogic.js | UTF-8 | 285 | 3.4375 | 3 | [] | no_license | function MaxNumberCalc()
{
const First=parseInt(document.querySelector('#FirstNum').value)
const Second=parseInt(document.querySelector('#SecondNum').value)
const MaxNum = Math.max(First,Second);
document.getElementById("MaxNumber").innerHTML = MaxNum;
} | true |
a4fd1629778c795122d6b7ab2b3e73b67001291f | JavaScript | nabajitroy/editable-row-example | /server/socket.js | UTF-8 | 860 | 2.671875 | 3 | [] | no_license | const socketIo = require("socket.io");
function listner(httpServer,req, res, next ) {
console.log("listner called");
return function(req, res, next) {
const options = {
cors: { origin: '*' }
}
const io = socketIo(httpServer,options );
io.on("connection", (socket) => {
console.log("New cl... | true |
4f21e0e336cd2044587b719de262d11f264f49a6 | JavaScript | omkarmanjare/JavaScript | /JavaScript_Udemy_Assignments/hoisting.js | UTF-8 | 2,833 | 4.5625 | 5 | [] | no_license |
calculateAge(1991);
function calculateAge(year){
console.log(2019-year); //28 as output
}
//Here we have called the funcion first and then declared it. Reaon why this will run is,
//global execution context becomes aware at line 2 that there will be a function named 'calculateAge'.
//What we did above ... | true |
52a273b225214b4a09ede7796b0a6bea445c68fc | JavaScript | dylnslck/restle | /lib/router/utils/parse-sort-query.js | UTF-8 | 541 | 2.953125 | 3 | [
"MIT"
] | permissive | function trimDelimiter(field) {
const hasDelimiter = field && (field[0] === '-' || field[0] === '+');
return hasDelimiter
? field.slice(1)
: field;
}
/**
* Serializes a sort query into an object that Restle can consume.
*
* @private
* @param {String} queru
* @return {Object} sort
*/
export default f... | true |
3173539df5ae9043053347a50498cd34e29e990d | JavaScript | mguldemir/FullStackJavaScript-TheOdinProject | /WomenTechmakersBerlinJSCrash/week-3/IDo/week2Async/index.js | UTF-8 | 948 | 2.859375 | 3 | [
"MIT"
] | permissive | const Database = require('./database')
const Meetup = require('./meetup')
/*
const Chalk = require('chalk')
const armagan = new Person("Armagan", 35)
const mert = new Person("Mert", 34)
const wtmb = new Meetup("Women Techmakers Berlin")
armagan.attend(wtmb)
mert.attend(wtmb)
wtmb.printAttendeeNames()
console.log(Ch... | true |
51022a79609f1070b31c1e8e834fbe9bb0d24d5b | JavaScript | natasha4/simple-chat | /server/app.js | UTF-8 | 1,269 | 2.6875 | 3 | [] | no_license | var express = require('express')
var bodyParser = require('body-parser')
const hostname = '127.0.0.1';
const port = 3001;
var app = express()
app.use(bodyParser.json())
var messagesList = [];
var usersList = [];
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*")
res.header(... | true |
db97ed1b52b09ebcea3afc795937d7dec511dc48 | JavaScript | jesperronn/atom-status-bar-blame | /lib/utils/find-repo.js | UTF-8 | 763 | 2.65625 | 3 | [
"MIT"
] | permissive | /** @babel */
import { Directory } from 'atom';
const cache = {};
export default async function repositoryForPath(goalPath) {
if (cache[goalPath]) {
return cache[goalPath];
}
try {
const repo = await atom.project.repositoryForDirectory(new Directory(goalPath));
if (repo) {
cache[goalPath] = re... | true |
a02c43e252dbe1b887453456f779a70a0d56441d | JavaScript | uphillstruggle/teamchallenge | /models/model-strava.js | UTF-8 | 4,146 | 2.65625 | 3 | [] | no_license | const stravaApi = require('strava-v3');
var moment = require('moment');
const request = require('request-promise')
function fetchAccessToken(req, res, next)
{
// use athlete's refresh token to get a current access token to fetch their data
if (typeof req.refreshToken === 'undefined') {
throw(new Error("Refres... | true |
8e844eac627a7c12bcb46cfda562d658baa21d0c | JavaScript | jerry92k/learning_algorithm | /easy/easy_937_recorder_data_in_log_files.js | UTF-8 | 2,291 | 3.765625 | 4 | [] | no_license | /**
* @param {string[]} logs
* @return {string[]}
*/
let reorderLogFiles = function(logs) {
for (let i = 0; i < logs.length - 1; i++){
for (let j = 0; j < logs.length - 1 - i; j++){
if (compareTo(logs[j], logs[j + 1])) {
let temp = logs[j + 1];
logs[j + 1]... | true |
f5aabf0376d308016f3c22e0a62dbf0265c2e10b | JavaScript | rxfxngel/ecmascript | /src/acortarObjetos.js | UTF-8 | 226 | 2.9375 | 3 | [] | no_license | const crearObjeto=(nombre,edad)=>{
return {
nombre,
edad,
mostrarInfo(){
return `${nombre} tiene ${edad}`;
}
}
}
console.log(crearObjeto('Rafa',23).mostrarInfo()); | true |
b96c54c87ff67292c3990ae920fcf0e5ba96cb34 | JavaScript | jepetersohn/phase-3-guide | /week-2/discussions/javascript-modules/modules/object_literals.js | UTF-8 | 125 | 2.515625 | 3 | [] | no_license | var Obj = {
name: "object",
fullName: function() {
function() {
return this.name;
}
}
}
Obj.fullName()
| true |
e35a8f5202ff287ca779d39b9a3f358b10d43ca6 | JavaScript | louisbranch/zombination | /test/integration/full_game.js | UTF-8 | 1,492 | 2.9375 | 3 | [] | no_license | var assert = require('assert');
var Game = require('../../models/game.js');
var Player = require('../../models/player.js');
var fixture = require('../fixtures/game.json');
describe('Game', function(){
it('plays a full game', function(){
var game = new Game();
var player = new Player({name: 'Luiz'});
var... | true |
ca8a14bb93805e0adffcc7cc3370220e9501b6a0 | JavaScript | Vractos/CursoWeb | /exercicios-web/Array/arrayMetodos.js | UTF-8 | 1,020 | 4.125 | 4 | [] | no_license | const pilotos = ['Vettel', 'Alonso', 'Raikkonen', 'Massa']
pilotos.pop() // Removo o ultimo elemento do array
console.log(pilotos)
pilotos.push('Verstappen') // Adiciona um novo elemento ao Array (no final do array)
console.log(pilotos)
pilotos.shift() // Remove o primeiro elemento
console.log(pilotos)
pilotos.unshi... | true |
d7192bcecc240e844f572e8f56632eb5c11b003c | JavaScript | sunilvaishnav45/dms | /WebContent/resources/js/admin.js | UTF-8 | 6,323 | 2.671875 | 3 | [] | no_license | /**
* To handle all the events in admin page this object will be used
*/
var adminObj = {
init : function(){
adminObj.showHistoryOfTask();
adminObj.cancelExistingTask();
adminObj.addNewTask();
},
/**
* To add new task this method will be triggered <br>
* It will make a websocket request to ser... | true |
e38451806af21adceefaa935b866b5414d5ac295 | JavaScript | randychoc/users_frontend | /src/components/Users.js | UTF-8 | 2,765 | 2.578125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import { firestore } from "../base";
import UsersForm from "./UsersForm";
const dbUsers = firestore.collection("users");
const Users = () => {
const [usuarios, setUsuarios] = useState([]);
const [currentId, setCurrentId] = useState("");
const addOrEditUser = a... | true |
2b483eb304b19665ab8de3c62854e0bcfe421fb5 | JavaScript | mtammam/VehicleTracker | /VehicleTrack/VehicleTrack/Scripts/index.js | UTF-8 | 1,417 | 2.53125 | 3 | [
"MIT"
] | permissive | $(function () {
// The view model that is bound to our view
var ViewModel = function () {
var self = this;
// Whether we're connected or not
self.connected = ko.observable(false);
// Collection of machines that are connected
self.vehicles = ko.observableArray();
}... | true |
4070ad86b9e58b5f30d27dc8bad0357a7cc08d75 | JavaScript | Godswilldev/AI-FOR-ENERGY-HACKATHON | /src/hooks/useInputState.js | UTF-8 | 290 | 2.515625 | 3 | [] | no_license | import { useState } from "react";
const useInputState = (initialState) => {
const [state, setState] = useState(initialState);
const reset = () => setState("");
const onChange = (evt) => setState(evt.target.value);
return [state, onChange, reset];
};
export default useInputState;
| true |
6beeb97b2656bd9a275a985f1a13309fefd3b556 | JavaScript | SkSumit/Digitalocean | /Gaurav Rawat/src/State_Table.js | UTF-8 | 3,871 | 2.515625 | 3 | [
"MIT"
] | permissive | import React from "react";
import axios from "axios";
import { Row, Col, Card, Table, Button, Spinner } from "react-bootstrap";
import { Link } from "react-router-dom";
import virus from "./virus.png";
import cured from "./cured.png";
import dead from "./dead.png";
import CountUp from "react-countup";
class State_Tabl... | true |
502a1b7fcc8dccac80c1392d471a3b8fbba2fecb | JavaScript | Burning-Synapses/horribleConvenience | /massLinkClicker/massLinkClicker.js | UTF-8 | 2,741 | 2.6875 | 3 | [] | no_license | javascript:(function(){
if (document.querySelector("div.show-more a") !== null) {
alert('The page is not displaying every chapter available.' +
'\nClick on "Show more" until there are no more results to load before continuing');
return;
}
/*Initializing control variables*/
let rawT... | true |
46c5c2f2a762719a0dd765ddc6202e26200fbc4a | JavaScript | Platon-spv/thedots | /public/controller_example.js | UTF-8 | 2,204 | 2.546875 | 3 | [
"MIT"
] | permissive | // angular.module('myApp', []);
var myApp = angular.module('myApp', []);
myApp.factory('socket', function($rootScope) {
var socket = io.connect();
return {
on: function(eventName, callback) {
socket.on(eventName, function() {
var args = arguments;
$rootS... | true |
e0b788915fcae917cba496c1f8c3b2e4e723fbb9 | JavaScript | meryavchyk/Linear | /Класи-3/js/Staff01.1.js | UTF-8 | 5,498 | 3.53125 | 4 | [] | no_license | // Задача 4. База даних співробітників фірми містить наступні дані:
// паспортні дані, освіта, спеціальність, посада, оклад. Створити програму для пошуку усіх працівників :
// 1)з вищою освітою;
// 2) усіх інженерів;
// 3) усіх, у кого оклад є більшим за 10000.
class Staff {
constructor(staff) {
this.st... | true |
90dc5ea68891b1f017c26335501c1ce70207357e | JavaScript | sellerg/mealcamp | /src/components/pages/About.js | UTF-8 | 2,680 | 2.53125 | 3 | [] | no_license | import React from "react";
import styled from "styled-components";
import mandssurvey from "./../../Assets/mandssurvey.PNG";
import man from "./../../Assets/man.jpg";
import woman from "./../../Assets/woman.jpg";
export default function AboutPage() {
return (
<Container>
<Maindiv>
<h1>About Page</h... | true |
78c80288c7251861bc1070cfffd431f9e98ac816 | JavaScript | cajacko/lib | /packages/lib/src/components/ExpandingTextInput/ExpandingTextInput.component.js | UTF-8 | 4,781 | 2.765625 | 3 | [] | no_license | // @flow
// Loosely follows https://gist.github.com/bleonard/f7d748e89ad2a485ec34
import React, { Component } from 'react';
import ExpandingTextInput from './ExpandingTextInput.render';
import { LINE_BREAKS } from '../../config/regex';
type Ref = {
focus: () => void,
};
type LayoutEvent = {
nativeEvent: {
l... | true |
a8b17f900abd28def02a57f9cac026def2596080 | JavaScript | mancjs/service-worker-todo-app | /todo-app/src/view.js | UTF-8 | 6,854 | 2.625 | 3 | [] | no_license | import { ItemList } from './item.js';
import { qs, $on, $delegate } from './helpers.js';
import Template from './template.js';
/** @type {(element: HTMLElement) => number} */
const _itemId = element => {
const { parentNode } = element;
if (parentNode instanceof HTMLLIElement && parentNode.dataset.id) {
return par... | true |
a25fa5112cd77609d579f3490ffcb102df396cae | JavaScript | lystyp/bleno | /examples/uart/txcharacteristic.js | UTF-8 | 1,561 | 2.53125 | 3 | [
"MIT"
] | permissive | var util = require('util');
var bleno = require('../..');
var BlenoCharacteristic = bleno.Characteristic;
function str2byte(data) {
var byteArr = [];
if (data.substring(0, 2) == "0x") {
for (i = 2; i < data.length; i = i + 2){
byteArr.push(parseInt(data.substring(i, i + 2), 16));
}
}
retur... | true |
8a7f6233f745399bfa71eab346c6ed57e5b8e92e | JavaScript | GlebSlivko/Projects | /Step_project-Doctor_visit/src/js/partials/showMore.js | UTF-8 | 291 | 2.828125 | 3 | [] | no_license | export function showMore(cards) {
cards.forEach(card => {
card.addEventListener("click", e => {
let button = e.target
if (button.classList.contains("show-more")) {
let currentCard = e.currentTarget
currentCard.classList.toggle("show")
}
})
})
}
| true |
563d93d64f4bb7aa5b954e35f822725b599e71d7 | JavaScript | NaqashAhmed471/TimeManagment | /src/Redux/UpdateUser/updateUserAction.js | UTF-8 | 1,141 | 2.515625 | 3 | [] | no_license | import axios from "axios";
import {
UPDATE_REQUEST,
UPDATE_SUCCESS,
UPDATE_FAILURE,
} from "./updateUserType";
const updateUserRequest = () => {
return {
type: UPDATE_REQUEST,
};
};
const updateUserSuccess = (signUpData) => {
return {
type: UPDATE_SUCCESS,
payload: signUpData,
};
};
const u... | true |
3998f95f78c91aef2601e25c0b9418116e8f8c51 | JavaScript | supromikali/react-children-toggler | /src/index.js | UTF-8 | 812 | 2.96875 | 3 | [
"MIT"
] | permissive | import React, { useState } from "react";
import ReactDOM from "react-dom";
const Toggler = ({ children }) => {
const [isVisible, setVisible] = useState(true);
const renderChildren = React.Children.map(children, (el, index) => {
// content should be returned "as is" if it is visible
if (index) return isVisi... | true |
16fece052e0317aabcc73d65f6cc2efd8f433abc | JavaScript | AllenWeb/my____s____i____n____a____j____s | /t3/miniblog/js/diy/constellation.js | UTF-8 | 993 | 2.53125 | 3 | [] | no_license | /**
* @author Robin Young | yonglin@staff.sina.com.cn
* 根据日期,等到星座
*/
$import("sina/sina.js");
$import("sina/app.js");
(function(proxy){
proxy.constellation = function(m,d){
var res = m*31 + d;
var con = [
'Capricorn',
'Aquarius',
'Pisces',
'Aries',
'Taurus',
'Gemini',
'Cancer',
'Leo',
... | true |
d099d061587f99c7248a945721fc9443963e7fa6 | JavaScript | kmchuc/damKamCube | /src/cube.js | UTF-8 | 2,315 | 2.515625 | 3 | [] | no_license | import * as THREE from "https://threejs.org/build/three.module.js"
import { OrbitControls } from "https://threejs.org/examples/jsm/controls/OrbitControls.js";
//import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
let camera, controls, scene, renderer, mesh;
init();
animate();
function init(){
//s... | true |
0e26f48d3d2d6dc4c030e1ef3070e67705425c80 | JavaScript | Anywhere-Fitness-tt47/Back-end | /api/server.test.js | UTF-8 | 9,638 | 2.53125 | 3 | [
"MIT"
] | permissive | const request = require("supertest")
const db = require("../data/db-config")
const server = require("./server")
let corey = {
username: "Corey1248",
first_name: "Corey",
last_name: "Power",
email: "CPower1248@gmail.com",
password: "Reyxco",
role: "instructor"
}
let phil = {
username: "Phil1248",
first_... | true |
1d2fd16b0d01895ede8828037b122fe56cc5a40c | JavaScript | silky/hypVR | /js/436.js | UTF-8 | 1,919 | 2.96875 | 3 | [] | no_license | // Schlafli symbol {4,3,6} is cubes with 6 around each edge
function acosh(arg) {
// discuss at: http://phpjs.org/functions/acosh/
// original by: Onno Marsman
// example 1: acosh(8723321.4);
// returns 1: 16.674657798418625
return Math.log(arg + Math.sqrt(arg * arg - 1));
}
var dist = 2*acosh( Math... | true |
e18253600ddb13e2a03d27238d0581f0ec051ad8 | JavaScript | Minierre/fortysix | /server/api/room/sandbox.spec.js | UTF-8 | 1,202 | 2.546875 | 3 | [] | no_license | const request = require('supertest')
const { should, expect } = require('chai')
const chai = require('chai')
const { describe, it, beforeEach, afterEach } = require('mocha')
const app = require('../../index.js')
const db = require('../../db')
const Room = db.model('room')
// Make sure databbase is seeded
describe('sa... | true |
f0e4db65582e6880a174bcedf126e4c13e1bd78b | JavaScript | geoerika/JavaScript | /javascripting/concat.js | UTF-8 | 452 | 3.4375 | 3 | [] | no_license | function concat(array1, array2) {
for (var index = 0; index < array2.length; index++) {
array1.push(array2[index]);
}
return array1;
}
console.log(concat([ 1, 2, 3 ], [ 4, 5, 6 ]), "=?", [ 1, 2, 3, 4, 5, 6 ]);
console.log(concat([ 0, 3, 1 ], [ 9, 7, 2 ]), "=?", [ 0, 3, 1, 9, 7, 2 ]);
console.log(conc... | true |
24e823ff71936ae2e4fc5981e534422243072564 | JavaScript | JohnClever/recon-system | /index.js | UTF-8 | 2,237 | 2.53125 | 3 | [] | no_license |
{
document.querySelector('#analyse').addEventListener('click', () => {
// let chart = document.querySelector("#myChart").getContext('2d');
// let chartNom = new Chart(chart, {
// type: 'bar',
// data: {
// labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', '... | true |
237c3e5459fa34c0194c5b4fcd2ecbbf14028d22 | JavaScript | pinkjs/pink | /src/action.js | UTF-8 | 493 | 2.5625 | 3 | [] | no_license | /**
* Created by zhoujun on 2017/6/7.
*/
module.exports = function ( action ) {
return async function ( ctx,next ) {
try{
var resBody = await action(ctx,next);
if( resBody == undefined || typeof resBody != 'object'){
Promise.reject('action 没有返回值');
}
if(resBody.hasOwnProperty('result') ){
res... | true |
538a98b7a9e19f650f040ca5476c69888f7c1a8a | JavaScript | AnanthKumarD/CodePractice | /HackerEarth_problems/AGameofNumbers.js | UTF-8 | 753 | 3.078125 | 3 | [] | no_license | const fs = require('fs')
fs.readFile('./inputFile.txt', 'utf-8', (err, input) => {
if (err) throw err;
var inputLines = input.trim().split("\n");
var searchGreater = []
for (i = 1; i < inputLines.length; i++) {
var j = i;
while (j != inputLines.length) {
if (inputLines[j] ... | true |
ab6ca95493023e951ece8b9b2097bf367597e097 | JavaScript | Arigatouz/Porn-immunity-extention | /app.js | UTF-8 | 345 | 3.375 | 3 | [] | no_license | replaceWord(document.body);
function replaceWord(element) {
if (element.hasChildNodes()) {
element.childNodes.forEach(replaceWord);
} else if (element.nodeType === Node.TEXT_NODE) {
if (element.textContent.match(/sex/gi)) {
document.body.innerHTML = `<h1> NOPE</h1>`
document.body.className = "r... | true |
77a902dee224f0a05ef9b3769b76cbe9d05a1e54 | JavaScript | cesarcortes19/tesis-talleres | /src/main/webapp/resources/js/validation.js | UTF-8 | 1,896 | 3.140625 | 3 | [] | no_license | function onlyNumber(e) {
var key;
var keychar;
if (window.event) {
key = e.keyCode;
}
else if (e.which) {
key = e.which;
} else {
return true;
}
if ((key == 9) || // Tabulador
(key == 8) ||
(key >= 48 && key <= 57)) { //BACKSPACE, || (key == 3... | true |
3050e7639300b8d91f348cb52d40566a45d49967 | JavaScript | k4rimel/qang | /src/factories/quizFactory.js | UTF-8 | 774 | 2.734375 | 3 | [] | no_license | (function(){
'use strict';
angular
.module('app')
.factory('Quiz', quizFactory);
function quizFactory($http, $q) {
var factory = {};
factory.quiz = {};
factory.quizzes = [];
function makeRequest(url) {
var deferred = $q.defer();
$http.get(url).then(function(resp) {
deferred.re... | true |
697d788012873f8e267429e4a3eb0736a0b6685f | JavaScript | daikiueda/studies.js | /test/Scope.js | UTF-8 | 1,398 | 3.390625 | 3 | [] | no_license | if( !chai ) var chai = require( "chai" );
var expect = chai.expect;
describe( "Scope", function(){
describe( "変数の巻き上げ", function(){
it( "未宣言の変数を参照するとエラーが発生する。", function(){
expect( function(){
return hoge;
} ).to.throw( Error );
} );
it( "変数宣言があれば参照はできるが、代入式より前の行では、変数の値はundefine... | true |
1824f08bfe279cc50bbaa1f966da58778da5d912 | JavaScript | jeasoncc/d3-Learning | /chapter4/08.js | UTF-8 | 2,140 | 2.96875 | 3 | [] | no_license | import * as d3 from "d3";
//Width and height
var w = 600;
var h = 250;
var dataset = [
5,
10,
13,
19,
21,
25,
22,
18,
15,
13,
11,
12,
15,
20,
18,
17,
16,
18,
23,
25,
];
var xScale = d3
.scaleBand()
.domain(d3.range(dataset.length))
.rangeRound([0, w])
.paddingInner(0.05... | true |
f4d1f418dd8219476521092fc2b01bf8b6e090e7 | JavaScript | pearpages/games | /platform/src/actors/Coin.mjs | UTF-8 | 1,024 | 2.890625 | 3 | [] | no_license | import { ACTORS } from "../models.mjs";
import { Vector } from "../Vector.mjs";
import { State } from "../State.mjs";
const wobbleSpeed = 8,
wobbleDist = 0.07;
export class Coin {
constructor(pos, basePos, wobble) {
this.pos = pos;
this.basePos = basePos;
this.wobble = wobble;
}
get type() {
... | true |
db14ed9b2d0a114e1c58020df35bf8b85d7c729f | JavaScript | mrSerhi/mizuxe | /src/js/data.js | UTF-8 | 352 | 3.125 | 3 | [] | no_license | export const setDataInFooter = () => {
const dataInit = new Date("2007").getFullYear();
let dataNow = new Date().getFullYear();
return `${dataInit} - ${dataNow}`;
};
/**
*
* @param {String} id
* @param {String} date string with date
*/
export const getDataElement = (id, date) => {
document.querySelector(`... | true |
b0089ee720d3c8200dfb9202ee29023f8c285377 | JavaScript | sschepis/cdn | /alive!/utils.hex.js | UTF-8 | 3,932 | 2.609375 | 3 | [] | no_license | /** @namespace */
var $$ = $$ || {};
/**
* $$.hex.grid
*/
$$.hex = (function () {
return {
/**
*
* @param z
* @param r
* @returns {{width: *, height: number, side: *}}
*/
metricsForSideLengthAndRatio : function (z, r) {
if(!z) z = 11.1;
... | true |
54713964136ccc56059a4b676cec0a38e0596a9d | JavaScript | stoll2882/social-app | /data/poststore.js | UTF-8 | 1,005 | 2.6875 | 3 | [
"MIT"
] | permissive | const Post = require('../models/post');
class PostStore {
static async getAll() {
try {
let posts = await Post.find().exec();
return posts;
} catch(err) {
console.log('Error - could not get all posts: '+email);
return [];
}
}
sta... | true |
7377cbacf0e583c7dd024259e0476e12d4e4cd51 | JavaScript | WarpPrism/Advanced-WFE | /Canvas_draw_arc/index.js | UTF-8 | 1,308 | 3.640625 | 4 | [] | no_license | var CANVAS_WIDTH = 1060;
var CANVAS_HEIGHT = 530;
// The center of the canvas
var CENTER_X = CANVAS_WIDTH / 2;
var CENTER_Y = CANVAS_HEIGHT / 2;
// The coordinates of the arc
var COORDINATES = [];
var index = 0;
window.onload = function() {
var canvas = document.getElementById("canvas");
canvas.width = CANVAS_... | true |
2e86dc550ea2cf8aaa24a3f088019ec10274ee10 | JavaScript | naeunchan/programmers_study | /kakao/파괴되지 않은 건물.js | UTF-8 | 1,165 | 3.09375 | 3 | [] | no_license | const solution = (board, skill) => {
let answer = 0;
const row = board.length;
const col = board[0].length;
const imos = Array.from({length: row + 1}, () => Array(col + 1).fill(0));
for(let i = 0; i < skill.length; i++){
const [type, r1, c1, r2, c2, degree] = skill[i];
... | true |
0d6176e79976cf5caa059c8ed239eb5932233254 | JavaScript | bgangware/Code-Command-Examples | /javaScript/Question Mark/questionMark.js | UTF-8 | 513 | 3.328125 | 3 | [] | no_license | window.setTimeout(function() {
alert("Hello Brand");
$("h1").text("jQuery is Working");
var textColorReq = "blue";
$("#button1").click(function() {
textColorReq = "blue";
setTextColor ();
});
$("#button2").click(function() {
textColorReq = "green";
setTextColor ();
});
function setTextColor (){
var... | true |
94550a6aadab4144495bf29ef489fbf2d57e1bec | JavaScript | Liphin/lawWxFront | /project/public/src/officialPages/phone/study/serviceGeneral.js | UTF-8 | 4,370 | 2.609375 | 3 | [] | no_license | /**
* create by lxc on 2019年03月20日
*/
var app =angular.module('myApp');
app.factory('MyGeneralSer',function ($window, $document, $http, MyData, $location) {
/** 工具类 **************************************************************************************/
/**
* 对数据进行判空处理
* @param data
*/
va... | true |
1d057dfb7fb62484104749fb947f98617c811ed1 | JavaScript | roonmorton/nodejs-course | /8 - Node-MongoDB/models/User.js | UTF-8 | 2,024 | 2.75 | 3 | [] | no_license | var mongoose = require("mongoose");
/*
mongoose.connect('mongodb+srv://Ron:Adminn@test-rmhjh.gcp.mongodb.net/SchemaTest?retryWrites=true&w=majority',
{ useNewUrlParser: true},
err =>{
if (err) throw err;
console.log(`Successfully connected to database.`);
});*/
//promise
mongoose.connect(
'mongodb+srv... | true |
c019551fc347c11563c4f9edd0d5e93211a5380b | JavaScript | forever-homes/week-6-proj | /draft-script.js | UTF-8 | 4,610 | 2.828125 | 3 | [
"MIT"
] | permissive | var app = {};
app.shelterID = []; // ID will pulled from findShelter function, and used to getPets
app.shelters = [];
app.findShelter = function() {
$.ajax({
url: 'http://api.petfinder.com/shelter.find',
type: 'GET',
dataType: 'jsonp',
data: {
key: 'bdb306e78ac3127c515483ecdef0c671',
location: 'M6P1H9'... | true |
c7dd07cc4d8b47bee50803cc11d91e46ba5aba8d | JavaScript | dmitryk-dk/simple_sagas_chart | /src/reducers/users.js | UTF-8 | 461 | 2.546875 | 3 | [] | no_license | import * as actionTypes from '../actions/action_types';
const users = (state=[], action) => {
switch(action.type) {
case actionTypes.ADD_USER:
return state.concat([
{
name: action.user,
id: action.id,
}
]);
... | true |
7d43fbd1112bb8ccd7162c154410791539ad9218 | JavaScript | imlikhita/shipgamecapstone | /Ship game Capstone/sketch.js | UTF-8 | 2,513 | 3.265625 | 3 | [] | no_license | var PLAY = 1;
var END = 0;
var gameState = PLAY;
var skybg, waterbg, shipimg, helicopterimg, bombimg,restartimg,gameoverimg;
var water, ship, helicopter, bomb,gameover;
var helicopterGroup, bombGroup;
var score = 0;
function preload(){
skybg = loadImage("skybg.jpg");
waterbg = loadImage("waterbg.png");
shipim... | true |
ab44f1a8ed85c31ccedaca2015d57fdee946416c | JavaScript | Megacy/Powerhouse-landing | /js/pbar.js | UTF-8 | 1,012 | 2.78125 | 3 | [
"MIT"
] | permissive | // JavaScript Document
"use strict";
$(function() {
$('.progress_bar').each(function() {
var progressbar = $(this),
progressLabel = $(this).find( ".progress-label" ),
progressvalue = $(this).attr('data-value');
console.log(progressvalue);
progressbar.progressbar({
value: false,
... | true |
25be986dc9eb6ce4ef1fed7e704feaf4cb491826 | JavaScript | Abineshwar/e-commerce | /model/UserItem.js | UTF-8 | 1,245 | 2.546875 | 3 | [] | no_license | var mongoose = require('mongoose');
var Schema=mongoose.Schema;
class UserItem {
constructor(UserID, Item, ItemCode, Rating, ReadIt) {
this._userID = UserID;
this._item = Item;
this._itemCode = ItemCode;
this._rating = Rating;
this._readit = ReadIt;
}
ge... | true |
1ea10df9fbdbb4ce286d1f7494bee2f3e1b2173e | JavaScript | LoiKos/nodeAPI | /app/model/Product.js | UTF-8 | 1,993 | 2.65625 | 3 | [] | no_license | 'use strict';
const helper = require('../helper');
const db = require('../database');
const ApiError = require('../helper-error');
module.exports = class Product {
constructor() {
}
table() {
return 'products';
}
create(json) {
let obj = {
refproduct: helper.generateRef(),
name: null,
picture: ... | true |
b140752e1138135b1857490d425147b6b549eb0f | JavaScript | Ocelotworks/OcelotBOTv5 | /commands/8ball.js | UTF-8 | 1,062 | 2.546875 | 3 | [] | no_license | const Command = require("../util/Command");
const questions = ["am", "are", "is", "will", "does", "can", "should", "r", "czy", "could", "when", "has", "what", "why", "how", "did", "where", "do", "thats", "that's"]
module.exports = class EightBall extends Command {
name = "Magic 8-ball"
usage = "8ball :question... | true |
7b88d0c2f008fb2e048cf0c6a13ee0e39ad27c34 | JavaScript | rhogeranacleto/domestic-pig | /test.js | UTF-8 | 1,370 | 2.8125 | 3 | [] | no_license | var data;
if (process.env.TEST) {
data = require('./data.test.js');
} else {
data = require('./data.js');
}
const catalog = data.catalog;
const sales = data.sales;
const purchases = data.purchases;
var value = 0;
sales.forEach(sale => {
value += sale.price;
});
purchases.forEach(purchase => {
value -= purch... | true |
52005e60beb0c4348dd5a6f8dbccc365770bfcb3 | JavaScript | dael-victoria-reyes/jo | /src/jo/ast/file.js | UTF-8 | 1,237 | 2.625 | 3 | [
"MIT"
] | permissive | // TODO: Generate Flow types for AST from babel-core/lib/types
interface Program {
body: Node[];
}
interface File {
name: string; // filename, e.g. "foo/bar/baz.js"
program: Program; // program AST
macros?: MacroDef[]; // macro definitions
diagnostics?: Diagnostic[]; // diagno... | true |
1a21f5eb8a75602225428c68b2ddbb28099e6af4 | JavaScript | Vikitorony/retry | /index.js | UTF-8 | 1,993 | 3.46875 | 3 | [] | no_license | // 1. adattípusok
// konstans
const pi = 3.14;
// változó
let a = 2;
a = 'szöveg';
// tömb, 1 vagy több dimenziós
let array = [];
array = [1, 2, 4, 8];
array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
// objektum, kulcs-érték pár
const object = {
napraforgo: a,
kutya: 'vau',
cica: 'miau'
};
// 2. referencia vs érté... | true |
4ecfdcc351190352702b6cd2408f98c82693fdbc | JavaScript | avshalomh/display-server | /src/components/login/Login.js | UTF-8 | 1,591 | 2.53125 | 3 | [
"MIT"
] | permissive | import React, {Component} from 'react';
import RaisedButton from 'material-ui/RaisedButton';
import TextField from 'material-ui/TextField';
import axios from 'axios';
require('./login.stylus');
class Login extends Component {
state = {
user: '',
password: ''
};
updateUser = (e) => {
this.state.user =... | true |
c80dafeeac27bb5c3c2e8dd619c7c03c3d025f74 | JavaScript | OneSmallStepfortheWeb/string-methods-extension | /test/app.js | UTF-8 | 4,152 | 3.25 | 3 | [] | no_license | //Test this module with Chai
//npm install chai --save-dev
//npm test
//npm test -s
const assert = require('chai').assert;
//const sayHello = require('../app').sayHello;
//const addNumbers = require('../app').addNumbers;
//const app = require('../app');
describe('stringMethods', function(){
it(`"test\ntest\ntest."... | true |
6598a288b3bd88557274eef98ce7a4593ba505ad | JavaScript | orangleLi/orangleLi.github.io | /node/nodeTest/handlePath.js | UTF-8 | 602 | 2.859375 | 3 | [] | no_license | /*
处理请求路径的分发
1、req对象是Class:http.IncomingMessage的实例对象
2、res对象是Class:http.ServerResponse的实例对象
*/
// node handlePath.js
// http://localhost:3000/index.html 显示 /index.html
// http://localhost:3000/about.html 显示 /about.html
const http = require('http');
http.createServer((req, res) => {
// req.url可以获取URL中的路径(... | true |
a4e12f2877ebeb03e5252dd2c3108671bbd4152e | JavaScript | ekostadinov5/nick-project | /nick-project-frontend/src/components/Categories/categories.js | UTF-8 | 2,352 | 2.53125 | 3 | [] | no_license | import React, {useEffect, useState} from "react";
import {Link} from "react-router-dom";
import RecipeRepository from "../../repository/recipeRepository";
const Categories = () => {
const [categoriesCollapsed, setCategoriesCollapsed] = useState(window.innerWidth < 992);
const [togglerUp, setTogglerUp] = useSt... | true |
5233272a3b937a97fbcf54695f67e21900a401f8 | JavaScript | utsav0209/dl | /js/captcha.js | UTF-8 | 1,110 | 3.53125 | 4 | [] | no_license |
// Captcha Script
var code;
function checkform(theform){
var msg = "";
if(theform.CaptchaInput.value == ""){
msg += "- Please Enter CAPTCHA Code.\n";
}
if(theform.CaptchaInput.value != ""){
if(ValidCaptcha(theform.CaptchaInput.value) == false){
msg += "- The CAPTCHA Code Does Not Match.\n";
}
}
if(... | true |
4f42a0f0542e52cab32671238b7f9e48c9d8e7b4 | JavaScript | Akinnochen123/mongoose-test | /models/index.js | UTF-8 | 1,872 | 3.140625 | 3 | [] | no_license | const Instructor = require("./instructor");
const elie = new Instructor ({firstName: "Elie"});
//invoking the create method directly on the model
Instructor.create ({firstName: "Elie"})
.then(newInst => {
console.log(newInst);
})
.catch(err => {
console.log("Error creating!");
});
//finding multiple records... | true |
4511b8e1d888ed41c49a5977ba259fc4ed159c42 | JavaScript | aelawson/film_comments_chrome | /spec/indexSpec.js | UTF-8 | 1,839 | 2.828125 | 3 | [] | no_license | describe("Index page functionality", function() {
it("expect URL to be content-URL", function() {
var testCase = "https://www.netflix.com/watch/20559714?trackId=1";
expect(isContentPage(testCase)).toBeTruthy();
});
it("expect URL to be non-content-URL", function() {
var testCase = "https://www.netfl... | true |
5bc244b8e64c229541d9884419b1f0f78c5a8ddb | JavaScript | YellowBird-UG/calculateur28web | /script.js | UTF-8 | 4,698 | 3.25 | 3 | [
"MIT"
] | permissive | // Ovulation Predictor Calculator using Vue.js + Vue Datepicker + MomentJS + Bulma CSS
new Vue({
el: '#app',
components: {
vuejsDatepicker
},
data() {
return {
calcReturned: false,
date: new Date(),
cycleSelected: 28,
fertileFrom: "",
... | true |
28b131da546f8c9c3828e0c3abbd91afa3b6cfbb | JavaScript | florindanciu/jobify.frontend | /src/components/UserComponents/UserProfileUpdate.js | UTF-8 | 5,953 | 2.53125 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { useHistory, useParams } from "react-router-dom";
import axios from "axios";
import { Card } from "react-bootstrap";
import authHeader from "../../services/auth-header";
import { colors } from "@material-ui/core";
export default function UserProfileUpdate() {... | true |
8e65ab217d5265e3f0984c8858adb4494a092238 | JavaScript | TaniaBondarenko/frontend-2021-homeworks | /submissions/5mountains/tiny-js-world/index.js | UTF-8 | 2,733 | 4 | 4 | [
"MIT"
] | permissive | /* Refer to https://github.com/OleksiyRudenko/a-tiny-JS-world for the task details
Complete the below for code reviewers' convenience:
Code repository: _put repo URL here_
Web app: _put project's github pages URL here_
*/
// ======== OBJECTS DEFINITIONS ========
// Define your objects here
const man = {
... | true |
13e8f807e2b6e0baf3464251bdebfb7d0552b91d | JavaScript | Babacar-seck/PROJETJS | /Backend/src/routers/users.js | UTF-8 | 2,023 | 2.53125 | 3 | [] | no_license | const express = require("express")
const argon2 = require("argon2")
const validator = require("email-validator");
const Users = require('../../models/user')
const router = new express.Router()
router.post("/users", async (req, res) => {
const newUser = new Users(req.body)
const email = validator.validate(newU... | true |
cea4a98a612ea5cd9196f9ebd7f0820352b6c001 | JavaScript | son2005/CoFi | /Challenge/Javascript/houseRobber.js | UTF-8 | 324 | 2.765625 | 3 | [] | no_license | // https://app.codesignal.com/challenge/DhSw9hKytEtAbJMnP
o = e = 0
// 82 chars
// m = (a,b) => a > b ? a : b
// houseRobber = n => n.map((v,i) => i & 1 ? e = m(e + v, o) : o = m(o + v, e)) | m(e, o)
// 79 chars
m = _ => o > e ? o : e
houseRobber = n => n.map((v,i) => i & 1 ? (e += v, e = m()) : (o += v, o = m())) | ... | true |
1c52757707313aa042645805e84054e820f2bad7 | JavaScript | yashaba/gallery2 | /js/main.js | UTF-8 | 1,668 | 2.578125 | 3 | [
"MIT"
] | permissive | function renderPortCards() {
var cards = getPortCards()
var cardsContainer = $('.port-container')
cards.forEach(card => {
$('.port-container').append(`
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" onclick= setModal('${card.id}') href="... | true |
896235f4be7321c5ad2b958e425c140bd421cd0c | JavaScript | Sadia765/practice | /DataStructures/BinarySearchTrees/BSTCodePractice.js | UTF-8 | 3,240 | 3.515625 | 4 | [] | no_license | class Node{
constructor(data, left = null, right = null){
this.data = data;
this.left = left;
this.right = right;
}
}
class BST{
constructor(){
this.root = null;
}
add(data){
const node = this.root;
if (node === null){
node = new Node(data);
return;
}
... | true |
df9c073de23383fe848a88e72ffe04c50e41dc3a | JavaScript | tbrands13/putting_it_together | /src/components/Card.js | UTF-8 | 792 | 3.03125 | 3 | [] | no_license | import React, {Component} from 'react';
class Card extends Component{
constructor(props){
super(props);
this.state = {
count: 0
}
}
render(){
const { firstName, lastName, age, hairColor } = this.props;
const addYear = () => {
this.setState({
... | true |
6e92df85ede3d11de6fff0c98f73ef54e12fe1db | JavaScript | vetikett/swag-alert | /swag-alert.js | UTF-8 | 3,326 | 2.96875 | 3 | [] | no_license | // constructor
function SwagIt( title, text, btnValue, imgUrl, themeColor ) {
var self = this;
this.title = title;
this.text = text;
this.btnValue = btnValue;
this.imgUrl = imgUrl || 'https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/128/bell.png';
this.themeColor = themeColor;
// create Html
v... | true |
75c633f96d2614ce9694d9a4946763f3bf6b2b06 | JavaScript | trentsena/intro-to-js-may19 | /vinson/class-ideas/web-components/XCounter.js | UTF-8 | 1,799 | 3.234375 | 3 | [] | no_license | const template = document.createElement('template');
template.innerHTML = `
<style>
button, p {
display: inline-block;
user-select: none;
}
</style>
<button aria-label="decrement">-</button>
<p>0</p>
<button aria-label="increment">+</button>
`;
class XCounter extends HTMLElement {
/... | true |
a2a3a103e6d36b0a27dc1d43f58305649dbe66ac | JavaScript | runningdeveloper/js13k2021 | /src/state.js | UTF-8 | 470 | 2.671875 | 3 | [] | no_license | export const states = { START: 'start', STARTED: 'started', TOO_FAST: 'too fast', TOO_FAR: 'too far', DOCKED: 'docked', NO_OXYGEN: 'no oxygen' }
export let defaultState = { state: states.START, fuel: 80, oxygen: 90, distance: 5 }
export let state = defaultState
export const setState = (nextState) => {
if (nextS... | true |
e8b1541c968005cd46275d95c0528b436af10a3f | JavaScript | iceglow/hermes | /assets/www/spec/map.spec.js | UTF-8 | 17,325 | 2.859375 | 3 | [] | no_license | describe('Location model', function () {
describe('when creating an empty location', function () {
beforeEach(function () {
this.location = new Location();
});
it('should have id 0', function () {
expect(this.location.get('id')).toEqual(0);
});
it('should have name "unknown"', functi... | true |
571d02efcd76ba9b4debbebaeb0630d81355a9ef | JavaScript | MironovDmitriy/diargam | /src/defs.js | UTF-8 | 1,492 | 2.59375 | 3 | [] | no_license | import sectorsData from './sectorsData.js';
import brands from './brands.js';
const svg = d3.select('body').append('svg').attr('id', 'defsSvg');
sectorsData.forEach(x => {
const outerLinearGradient = svg.append("defs")
.append("linearGradient")
.attr("id", "outerGradient" + x.outerGradientId)
.attr('x1', '0%')... | true |
4c1b39f3947763fcb67f2f1a090a60bc2bde00a6 | JavaScript | AElfProject/aelf-block-explorer | /src/utils/GetReturnFromPaid.js | UTF-8 | 1,027 | 2.765625 | 3 | [] | permissive | /**
* @file calculateCrossConnectorReturn
* @author zhouminghui
* Computing Equivalent Value
*/
import { Decimal } from 'decimal.js';
// bt: balanceTo bf: balanceFrom wt: weightTo wt: weightFrom a: buy/sell balance
// Calculate the valuation according to the calculating formula
export default function GetReturnFr... | true |
4cb81e571c264de15e489bf025b139e6f3f96633 | JavaScript | jbblackett/Spotify-Visualisation | /public/progress.js | UTF-8 | 1,675 | 3.03125 | 3 | [] | no_license | var socket;
var songData;
var currentPos = 0;
var songLength;
var songName;
var songArtists;
var state = "False";
var img;
var bands = 512;
function preload() {
font = loadFont('product-sans.ttf');
}
function setup() {
mic = new p5.AudioIn();
mic.start()
fft = new p5.FFT(0.75,bands);
fft.setInput(mic);
... | true |
508c34993a26639be0af9b9520a6891438772479 | JavaScript | mfbx9da4/money-guru-assignment | /TestePratico/ferramenta/js/site.js | UTF-8 | 911 | 2.515625 | 3 | [] | no_license | jQuery(document).ready(function($) {
// show regster form
$('#editUserData').on('click', function(event) {
event.preventDefault();
$('#userDataEditForm').show()
});
// $('.details').on('click', function() {
// var url = "http://dev.moneyguru.com.br/tool/health-insurance/health-plan";
// $.ajax({... | true |
3c8efeb695d28019e8b165abb5a1d53dbe98ce6b | JavaScript | ScottDenton/Dog-suggestor-app | /index.js | UTF-8 | 8,071 | 3.03125 | 3 | [] | no_license | //create dogs
function dog (breed, build, activityLevel, inside, hair) {
this.breed = breed;
this.build = build;
this.activityLevel = activityLevel;
this.inside = inside;
this.hair = hair;
this.calculatePoints = function(){
var points = 0;
if(this.build === 'small'){
... | true |
33f8ae2b95080fbefe2c597fa3b83a5d9e8ee1b1 | JavaScript | julius1986/react-transition-group-example | /src/components/TransitionGroupComponent/TransitionGroupComponent.js | UTF-8 | 1,094 | 2.6875 | 3 | [] | no_license | import React, { useState } from "react";
import { CSSTransition, TransitionGroup } from "react-transition-group";
import usersData from "./usersData";
import "./TransitionGroupComponents.css";
/*
//NOTE: Если нам нужно использовать CSSTransition для массива,
то мы должны обернуть массив в TransitionGroup, а каждый эле... | true |
e982a6d0801ddee32d628501196fe34acb6ea4a2 | JavaScript | TarasPetryshak/SkillUp_homeworks | /Lesson16(this_closure)/Task3/js/script.js | UTF-8 | 316 | 3.8125 | 4 | [] | no_license | function Calculator(x, y) {
this.x = x;
this.y = y;
this.sum = function() {
return this.x + this.y;
};
this.mul = function() {
return this.x * this.y;
}
}
var calculator = new Calculator(2, 3);
alert("Сума="+calculator.sum());
alert("Добуток="+calculator.mul()); | true |
a979e559465568f77a0c4e0bcc3d001afc7dbe9f | JavaScript | ha3158987/Rubiks-Cube | /index.js | UTF-8 | 2,191 | 4.09375 | 4 | [] | no_license | /* 1단계: 단어 밀어내기 */
class PushWord {
init() {
this.addClickEvent();
}
addClickEvent(){
const button = document.querySelector(".button_enter");
button.addEventListener("click", this.getInputValue.bind(this));
}
getInputValue(){
const form = document.querySelector(".... | true |
375c97810f7a8b5984ef975e85ab15001e4acd59 | JavaScript | AlanysF/Exercicios_JSReact | /src/App09.js | UTF-8 | 381 | 3.09375 | 3 | [] | no_license | import './App.css';
var raio = prompt("Digite o valor do raio do círculo: ")
function circulo() {
var area = (raio*raio) * Math.PI
return area
}
function App() {
return (
<div className = "App">
<h2>Área do círculo</h2>
<p>O valor da área do círculo corresponde a: {circul... | true |
272c30c53f0b422957661e56345ff3cec714010b | JavaScript | labs14-lambda-app-store/FE2 | /src/actions/userActions.js | UTF-8 | 2,390 | 2.6875 | 3 | [
"MIT"
] | permissive | import axios from "axios"
import Cookie from "js-cookie"
import { baseUsersUrl } from "../constants"
export const LOGIN_USER_START = "LOGIN_USER_START"
export const LOGIN_USER_SUCCESS = "LOGIN_USER_SUCCESS"
export const LOGIN_USER_FAIL = "LOGIN_USER_FAIL"
// checks for user_id cookie set on successful login and retur... | true |
e66ea9081112275b4c3621ab2edd1d7aa53dfd7f | JavaScript | edgargcg/ReactLearning | /02-intro-javascript/src/bases/10-condition.js | UTF-8 | 158 | 2.9375 | 3 | [] | no_license | const isActive = true;
const message = (isActive) ? 'Activo' : 'Inactivo';
const message2 = isActive && 'Activo';
console.log(message);
console.log(message2) | true |
22352591f5fade00960bf8d9a70a44ffa49960bf | JavaScript | LaCinquette/WikiCode | /src/wiki.js | UTF-8 | 2,889 | 2.734375 | 3 | [] | no_license | const axios = require('axios').default;
const stripHtml = require("string-strip-html").stripHtml;
const scrape = require('website-scraper');
const nodePath = require('path');
const wikiURL = "https://en.wikipedia.org/w/api.php";
//////////////////////////////////////////////////////////////////////////////////////
fu... | true |
e05889ecd22bc1dc0eb4921eca0de04375b5e789 | JavaScript | Teepo/Tarot | /src/js/deck.js | UTF-8 | 1,338 | 3.4375 | 3 | [] | no_license | /* @flow */
import { Card } from './card';
export class Deck {
cards : Array<Card>
constructor() {
this.cards = [];
for (let i = 1; i <= 78; i++) {
this.cards.push(new Card(i));
}
}
/**
* @param {array<Card>} cards
*
*/
setCards(cards : Array... | true |