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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c81a79b8ba8e9e8ecf3ba59d060bbf7e88055d03 | JavaScript | tshewang-rinzin/dzongkha-typing-tutor | /src/assets/sounds/Sounds.js | UTF-8 | 1,478 | 2.515625 | 3 | [
"MIT"
] | permissive | import React, { Component, createRef } from "react";
import stroke from "/assets/sounds/keystroke.wav";
import tink from "/assets/sounds/tink.wav";
import ride from "/assets/sounds/error.wav";
import { connect } from "react-redux";
class Sounds extends Component {
constructor(props) {
super(props);
... | true |
45a1289dea3068e4cfc66b861ddfdbd0536f4d78 | JavaScript | Daniel1984/60fps | /public/jj/js/CocoonJS_App_ForWebView.js | UTF-8 | 9,952 | 2.765625 | 3 | [
"MIT"
] | permissive | (function(){
if (typeof window.CocoonJS === 'undefined' || window.CocoonJS === null) throw("The CocoonJS object must exist and be valid before adding more functionalities to an extension.");
if (typeof window.CocoonJS.App === 'undefined' || window.CocoonJS.App === null) throw("The CocoonJS.App object must exist... | true |
fb83bb2d6d0dfd0aa771e35505b7682fc322303a | JavaScript | popkinj/polymorph | /polymorph.js | UTF-8 | 2,911 | 3.328125 | 3 | [] | no_license | /*
# polymorph
Convert one svg path into another. Produce a new shape with the same
amount of nodes as the first input yet shaped like the second input.
This allows for sane transitions between the two shapes.
*/
var polymorph;
polymorph = {
version: '1.1'
};
/*
## transpose
Duplicate node positioning from one ... | true |
eebdcf46cef6a5b3a81248b504e31a4b3693b996 | JavaScript | Dunkelheit/emese | /lib/emese.js | UTF-8 | 5,470 | 2.78125 | 3 | [
"MIT"
] | permissive | 'use strict';
var async = require('async');
var EventEmitter = require('events').EventEmitter;
var glob = require('glob');
var path = require('path');
var util = require('util');
var lang = require('./lang');
/**
* The class constructor.
*
* @param {object} [api] - If you already have an API object you want to lo... | true |
e010ae3119f93ed35ebc38285070a1869f805971 | JavaScript | denis-shubochkin/bhj-diploma | /public/js/ui/forms/CreateTransactionForm.js | UTF-8 | 2,130 | 2.765625 | 3 | [] | no_license | /**
* Класс CreateTransactionForm управляет формой
* создания новой транзакции
* Наследуется от AsyncForm
* */
class CreateTransactionForm extends AsyncForm {
/**
* Вызывает родительский конструктор и
* метод renderAccountsList
* */
constructor( element ) {
if(!element){
throw new Error('элем... | true |
b548e206a7a11337adedb892d0e7c42cf54c8e48 | JavaScript | Cyberman-tM/beq | /bot_modules/utils/kSplit.js | UTF-8 | 2,258 | 2.984375 | 3 | [] | no_license | /*
Split a text into syllables/words
For example:
tlhIngan vIjatlh vIneH
->tlhIngan vI- jatlh neH
*/
var winston = require('winston');
var logger = winston.createLogger(
{
level: 'info',
format: winston.format.json(),
transports: [
new winston.transports.Console()
]
}
);
//Local copy of transcoder
var ... | true |
169bab9c2274ffb2f4a6070ffca64624ff25db85 | JavaScript | nafisa003/blockchain-lottery | /test/Lottery.test.js | UTF-8 | 3,915 | 2.734375 | 3 | [] | no_license | const assert=require('assert');
const ganache=require('ganache-cli');
const Web3=require('web3');
const web3=new Web3(ganache.provider());
const {interface,bytecode} =require( '../compile.js');
let lottery;
let accounts;
beforeEach(async ()=>{
//get a list of accounts from ganache
accounts=await web3.eth.getA... | true |
af8010a2b825dbaa0729a5fe7c408e63e86a5f3d | JavaScript | issaicjeon/Todo_List | /src/Form.js | UTF-8 | 1,225 | 2.625 | 3 | [] | no_license | import React from "react";
import Button from "./CSS/Button.js";
import shortid from "shortid";
import Input from "./CSS/Input.js";
export default class Form extends React.Component {
state = {
text: "",
};
//sets text to whatever is typed into input box
handleChange = (event) => {
this.setState({
... | true |
56893f9c7e4857f7049abbcac0181380ac8961ec | JavaScript | Laura0120/guitar-shop | /src/js/components/filter-price.jsx | UTF-8 | 3,445 | 2.5625 | 3 | [] | no_license | import React, { useRef } from "react";
import { connect } from "react-redux";
import {
getMinPrice,
getMaxPrice,
addSpacesAfterThreeCharacters,
} from "../utils";
import { CATALOG } from "../const";
import { ActionCreator } from "../store/action";
import { FUNCTION, NUMBER } from "../prop-type";
const FilterPri... | true |
45b6a1b722c1ff0cc3f81dc0d22e36be08a23c94 | JavaScript | XccelerateTech/tommytse | /Exercise/06-objects&arrays/G/G.js | UTF-8 | 352 | 4 | 4 | [] | no_license | //return the index of the middle number
function middle (arr) {
var output = arr.filter(element=>element!==Math.max(...arr)&&element!==Math.min(...arr));
return arr.findIndex(element=>element==output);
}
console.log(middle([2, 3, 1])); //0 -> 2 at index 0 lies between 3 and 1
console.log(middle([88, 7, 55])); ... | true |
19e271be0e4e1f54d1eb3879ad89666e872b70d7 | JavaScript | aonye/library | /src/index.js | UTF-8 | 4,628 | 2.953125 | 3 | [] | no_license | import { editTable } from "./modules/editTable";
import { libraryArray } from "./modules/libraryArray";
import { formDOM } from './modules/form';
const form = document.querySelector('form');
const addBook = document.getElementById('addbook');
const toggle = document.querySelector('.toggle input');
const main = (() =>... | true |
8d9a3228743dd0cf3ab74636b4fc2a5519b0e20d | JavaScript | rcomito1/cit382-project4 | /src/DataInput.js | UTF-8 | 578 | 2.734375 | 3 | [] | no_license | import React, { Component } from "react";
import { useState } from "react";
export function DataEntry({ addName = (f) => f }) {
const name = "";
const handleInputChange = (e) => {
console.log("handleInputChange()");
console.log("Input: ", e.target.value);
name.setState({ input: e.target.value }... | true |
b1148e31e0969892c41a52d4f6cc566fb2753ec3 | JavaScript | zvaigen/weather-app---react | /src/component/Header/Header.js | UTF-8 | 1,708 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
//import { Button } from 'reactstrap';
import Section from './../Section/Section'
import {getWeather} from './../../actions/mainActions'
import './Header.css'
import {Button} from "reactstrap";
import Loading from "../Loading/Loading";
class Header extends Component {
state... | true |
39c1e91ba2fd7bb94f535213267a842994f02f01 | JavaScript | EnglishFitzPercy/Programming-3 | /lesson 3/index.js | UTF-8 | 358 | 2.625 | 3 | [] | no_license | var express = require("express");
var app = express();
app.get("/gl", function(req, res){
res.redirect('http://google.com');
});
app.get("/gl/:item", function(req, res){
var item = req.params.item;
res.redirect('http://google.com/search?q=' + item);
});
app.listen(3000, function(){
console.log("Ex... | true |
945d05f94679c9114c1f48032963c6d961545235 | JavaScript | alexeispirit/udemy-react-colt-full-course | /13-forms-in-react/forms/src/NameForm.js | UTF-8 | 900 | 2.921875 | 3 | [] | no_license | import React, { Component } from 'react'
class NameForm extends Component {
constructor(props) {
super(props);
this.state = { fullName: ''}
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleSubmit(event) {
ev... | true |
251ba2810bf067737d787d62668e632524f31a5c | JavaScript | cavenaghi1988/infinite | /src/main.js | UTF-8 | 1,555 | 3.328125 | 3 | [] | no_license | const imgContainer = document.getElementById("img-container");
const loader = document.getElementById("loader");
let ready = false
let imgLoaded = 0;
let totalImg = 0;
let photoArray = [];
function setAtr(elem, atr) {
for (const key in atr) {
elem.setAttribute(key, atr[key])
}
}
function imgLoad() {
imgLo... | true |
6fe30ed23f295e4e9863be8f42e5a3fad58a391c | JavaScript | ericandrewlewis/find-with-react-blessed | /index.js | UTF-8 | 2,592 | 2.546875 | 3 | [] | no_license | import React, {Component} from 'react';
import blessed from 'blessed';
import {render} from 'react-blessed';
import { exec, spawn } from 'child_process';
import glob from 'glob';
import debounce from 'debounce';
class App extends Component {
constructor(props) {
super(props);
this.state = {
searchStri... | true |
c63d8d3dc7f17eda8c881d35301d85af63258a12 | JavaScript | ganorberg/algorithms-javascript | /dynamic-programming-and-recursion/combinatorics/sum-all-subsets.js | UTF-8 | 721 | 4.5625 | 5 | [
"MIT"
] | permissive | /* Write a method to sum all subsets of a set.
*
* ASSUMPTIONS
* - valid input
* - no duplicates, as expected with a mathematical set
*
* STRATEGY: O(N) time and O(1) space complexity
* Each number appears 2^(N - 1) times. So multiply each number by that amount
* then sum. Factor out 2^(N - 1) term to simplify ... | true |
8a51a9e3b1d7daa4be16f8ac6ae7c4e82c653866 | JavaScript | devenpitaliya/webapp5 | /backend/src/main/resources/static/assets/js/event-form.js | UTF-8 | 369 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive |
$(document).ready(function(){
$(".check-mostrar").click(function(evento){
var valor = $(this).val();
if(valor == 'true'){
$("#div-mostrar").css("display", "block");
}else{
$("#div-mostrar").css("display", "non... | true |
8666c27bd9f86340a4d3292247bb00b43f07e097 | JavaScript | andis716/javascript-basic | /js/prototype.js | UTF-8 | 1,843 | 4.03125 | 4 | [] | no_license | // Modul E
// materi 4 terusan object.created()
// Prototype dan Class
// const methodMoba = {
// ngebuff : function (jumlah) {
// this.healty += jumlah ;
// console.log(`saya ${this.nama} ambil buff`);
// },
// ulti : function (power) {
// this.healty -= power ;
// console.log(`saya ${this.nama} le... | true |
8bb7f9623195caa284cacb3f5f1fd1b626e525b1 | JavaScript | dhivdhav/timepass | /jobs/job-25/project/client/src/hooks/useSocket.jsx | UTF-8 | 684 | 2.5625 | 3 | [] | no_license | import { useEffect, useRef, useState } from 'react';
import socketIOClient from 'socket.io-client';
import config from '../config/config';
const NEW_COINS_EVENT = 'coins';
const useSocket = () => {
const [coinsData, setCoins] = useState([]);
const socketRef = useRef();
useEffect(() => {
... | true |
3e6d4974d41c944a5ec7a7113fdc25e5723a04ad | JavaScript | Murdalay/mdParse | /typedetect.js | UTF-8 | 1,491 | 3.234375 | 3 | [] | no_license | var util = require('util'),
typeArray = ['RegExp', 'Object', 'Array', 'String', 'NaN', 'Number', 'Undefined', 'Boolean', 'Function'],
suppTypes = function(){
return typeArray
},
typeDetect = function(item){
if (typeof item === 'object' && item.constructor.name === 'RegExp'){
// console.log('type dete... | true |
e213ab7c8ccabaa53cc9c84ad853851bb24142e1 | JavaScript | bondarenkomaksym/gc_lessons | /js_lessons/js8/task5/index.js | UTF-8 | 458 | 3.625 | 4 | [] | no_license | // How to work on tech tasks. Step by step guide
// 1. Learn requirements
// 2. Create step by step algo (& input/output for funtions)
// 3. Create prototype solution & testing - черновое решение
// 4. Final testing & refactoring -> final solution
//input: function
//output: key prop
"use strict";
const obj = {
na... | true |
502b7fc7085cc4b134cc28d3b170c794c942e579 | JavaScript | Arquisoft/viade_es3b | /src/components/Ruta/rutas.test.js | UTF-8 | 2,170 | 2.625 | 3 | [] | no_license | import { cleanup } from 'react-testing-library';
import Rutas from './rutas';
import getJsonRoute from './../../utils/defaultJsonRoute'
import getJsonComments from './../../utils/defaultJsonComments'
import { Point, WayPoint } from './point';
import Ruta from './ruta';
describe('RUtas', () => {
afterAll(cleanup);
... | true |
4409113e47923236565f7e542c774b2ab09286ba | JavaScript | Qindet/auto-react-redux | /src/reducers/auto-item.js | UTF-8 | 871 | 2.609375 | 3 | [] | no_license | const initialState = {
autoItem: {},
loadingItem: true,
errorItem: false
}
export default function autoItemReducer(state=initialState, action) {
switch (action.type) {
case 'FETCH_ITEM_REQUESTED':
return {
...state,
loadingItem: true,
... | true |
4602d7c1d4dc67c14f65c18454d297d5f30b7949 | JavaScript | anklav24/Google-Spreadsheet-Scripts | /copy_value_and_paste.gs | UTF-8 | 1,681 | 3.234375 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Функция с помощью которой можно скопировать и вставить данные на строку ниже из одной таблицы в другую или из одного листа
// либо вставить строку и значение в нее
// в другой, также можно и на одном листе все провернуть.
// Не забываем подключить тригер иначе не будет все работать когда таблица закрыта и скрипт не... | true |
3900876031c6ccc612f2236db254463c2c1bbba1 | JavaScript | randyaraujoreyes/The-Legend-Of-Zelda | /script.js | UTF-8 | 163 | 2.5625 | 3 | [] | no_license | $("button").click(function() {
$("h2").text("double click image"); });
$("image").dblclick(function(){
$("body").css("background-color", "yellow"); });
| true |
f748f142dbfc9015504ff6a7a4345c118a4dc554 | JavaScript | coderHBB/coderHBB.github.io | /js/resizer.js | UTF-8 | 2,262 | 2.703125 | 3 | [] | no_license | function resizeCanvasBasedOnWindowSize() {
var roomIndex = 0;
var roomButtons = document.getElementsByClassName("room-btn");
for (i = 0; i < roomButtons.length; i++) {;
if (roomButtons[i].className.includes('active')) {
roomIndex = i;
}
}
switch (roomIndex) {
case... | true |
54f2d0ccbf631c93bf087dcf09129764403b5072 | JavaScript | edomin/FantasyNameGensRus | /Gen_Names_Drow/generator.js | UTF-8 | 12,957 | 2.59375 | 3 | [
"Unlicense",
"LicenseRef-scancode-public-domain"
] | permissive | function Generate()
{
malePrefixes = new Array();
femalePrefixes = new Array();
maleSuffixes = new Array();
femaleSuffixes = new Array();
function AddMalePrefix(prefix)
{
malePrefixes[malePrefixes.length] = prefix; //Добавить префикс
return;
}
function AddFemalePrefix(prefix)
{
femalePrefixes[femalePre... | true |
8affe14378bed3af1a9bbfea5c923f29a1ae1238 | JavaScript | Chrisw1996/sbcontentblocks | /src/tooltip.js | UTF-8 | 4,898 | 2.640625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | import { Util, Dom } from './util.js';
const dom = new Dom();
class Tooltip{
constructor(builder) {
const util = new Util(builder);
const builderStuff = util.builderStuff();
this.builderStuff = builderStuff;
let tooltip = builderStuff.querySelector('.is-tooltip');
... | true |
adb3527eb90124260228b38fa170e6792376e7b8 | JavaScript | sergiofm/tdciasc | /parte-3/index.js | UTF-8 | 570 | 2.703125 | 3 | [] | no_license | var cep = require("cep-promise");
var http = require('http');
var url = require('url');
var server = http.createServer(function (req, res) {
var query = url.parse(req.url, true).query;
console.log("buscando cep ", query.cep);
cep(query.cep).then(function(address){
console.log("endereço encontrado ", address)... | true |
cc6433e60b9a18112e8bd90226cfdbfca66109a0 | JavaScript | nmakarov/excercises | /Interview/axios.js | UTF-8 | 1,531 | 2.625 | 3 | [
"MIT"
] | permissive | const axios = require("axios");
const { auth } = require("config");
const { dataUrl } = require("endpoints");
const makeGetRequest = async (url, headers, params) => {
const req = {
url,
method: "GET",
headers,
params,
validateStatus: false,
};
const response = await ... | true |
3acf4b17bf963587fe6a1bb582d7a631365945ed | JavaScript | DoubleGio/websiteHCI | /HCIWebsite-master/js/header.js | UTF-8 | 728 | 2.8125 | 3 | [] | no_license | $(document).ready(function(){ //Transforms header from horizontal menu to dropdown menu for mobile mode
$("#menubutton").click(function(event) {
event.preventDefault();
var x = document.getElementById("header");
if (x.className === "header") {
x.className += " responsive";
... | true |
1259c3e4b854aab3f5e15a9772c4de3fdca9be3a | JavaScript | magee/Suppr | /src/components/recipe-variation/Ingredients.js | UTF-8 | 1,953 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react';
import { Field } from 'redux-form';
import {quantityField, itemsField} from './form-fields'
const Group = (props) => {
return (
<div className="inner-flex-body">
<div className="inner-flex-element">
<label className={props.index===0?"":"hide-label"}>Quantity<... | true |
e5c1dbc53e02e73939da9d2bf8e181066fda25b9 | JavaScript | jahidulislamjahid/js-cart-calculation | /js/app.js | UTF-8 | 3,267 | 3.015625 | 3 | [] | no_license | // memory section
document.getElementById('base-memory').addEventListener('click', function () {
document.getElementById('memory-cost').innerText = 0;
document.getElementById('base-memory').disabled = true;
document.getElementById('extended-memory').disabled = false;
subtotal();
});
document.getElemen... | true |
fdd89a24d20435b79a2eb9030b9f05b0170ded1a | JavaScript | pratiksanghavi/NodeJS-JWT-RefreshToken | /utils/maskId.js | UTF-8 | 196 | 2.546875 | 3 | [] | no_license | const maskId = id => {
const midpoint = Math.floor(id.length / 2);
const mask = 'x'.repeat(id.length - midpoint);
return `${id.slice(0, midpoint)}${mask}`;
};
module.exports = maskId; | true |
079a36533df850a5d1760c3b6fd8971ace63c48b | JavaScript | 418sec/ganon | /lib/convertCentimetersToInches.js | UTF-8 | 272 | 3.15625 | 3 | [
"MIT"
] | permissive | /**
* Convert centimeters to inches where 1 cm equals 0.393701 inches
* @param {number} cm
* @return returned value in inches
*/
function convertCentimetersToInches(cm){
// Your code goes here
throw("Invalid Type");
}
module.exports = convertCentimetersToInches;
| true |
718d25373d77b29b23ab3c2bdb3c056be3319264 | JavaScript | Jeremie-git/TP-DAM | /Desktop/Tous les TP de tout/exercices/Calculatrice/calculatriceJQ.js | UTF-8 | 5,574 | 2.78125 | 3 | [] | no_license | var champ = document.getElementById("zone_affichage");
var saisie = champ.value;
var memory = 'undefined';
var edition = false;
var boutonsLibres = document.getElementsByClassName("bouton_libre");
// Vide la zone d'affichage quand on appuie sur le bouton CE//
function rab(){
$("#zone_affichage").val("");
}
functio... | true |
93cc426c5895c18f2647e842c17c4c6f5e8168ab | JavaScript | melodymennen/no-database-project | /server/controller.js | UTF-8 | 1,249 | 2.6875 | 3 | [] | no_license | const links = []
let id = 0
const axios = require('axios')
module.exports = {
kanye(req, res) {
res.status(200).send('http://i63.tinypic.com/2j9y8p.png')
},
create(req, res) {
const {week, day, link, status} = req.body;
links.push({
id: id,
week: week,
... | true |
470a69de772207216fcc3c214fd3f3c17efb3c09 | JavaScript | mibweblab/talktotech | /server/config/key.js | UTF-8 | 476 | 2.5625 | 3 | [] | no_license | //key.js - figure out what set of credentials to return
//when we are on heroku, heroku has this already set for you so that's how we can figure out whether we are in production or not because when we are on our local machine there's no NODE_ENV
if (process.env.NODE_ENV === 'production') {
//we are in production - re... | true |
842497368503a8fa01915f9d87f37df61b6c4b45 | JavaScript | shubhamjadon/ProjectEuler100 | /SumSquareDifference.js | UTF-8 | 196 | 3.125 | 3 | [] | no_license | function sumSquareDifference(n) {
let i = 1, sumOfSquare = 0,squareOfSum = 0;
sumOfSquare = n*(n+1)*(2*n+1)/6;
squareOfSum = (n*(n+1)/2)**2;
return(squareOfSum-sumOfSquare);
} | true |
0b6ae9ae8a6f81609d93312b8ed48a949b160dae | JavaScript | caathylee/movie-app | /src/components/Searchbar/Searchbar.js | UTF-8 | 2,313 | 2.859375 | 3 | [] | no_license | import React, { useState } from 'react';
import './Searchbar.scss';
import { uniqBy } from 'lodash';
export const Searchbar = (props) => {
const { updateSearchData, updateSearchValue, searchValue, updateShowResultsMessage } = props;
const [page, setPage] = useState(1);
const API_KEY = "8ca67d21";
co... | true |
96c0dd12166ca59897c768d6b11afbf03a13b125 | JavaScript | rmfarrell/teatime-shopify-theme | /src/assets/scripts/cart.js | UTF-8 | 3,350 | 2.578125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import { cart as cartEvents } from './events'
import { $, $$, each, delegate } from './utilities';
import fetch from 'unfetch';
/**
* Shopping cart
* @param {Function} afterUpdate callback for when cart update occurs
*/
export function Cart(afterUpdate = function () { }) {
const $container = $('#shopping-cart');
... | true |
0929dec79354c35727e3b196cc7070a8c5429d01 | JavaScript | schw240/React | /src/Statechange2.js | UTF-8 | 390 | 2.59375 | 3 | [] | no_license | import React from 'react';
function Statechange2() {
const [number, setNumber] = React.useState([1,2,3,4,5,6,7,8,9]);
const click2 = () => {
setNumber([...number.slice(0,4), 0, 0, ...number.slice(6,9)])
}
return (
<>
<div>{JSON.stringify(number)}<button onClick={click2}>클... | true |
dbcc6ddbc1296c74b9706b1e50d2c1c2539b159c | JavaScript | goredani/udacity_nlp | /src/client/js/urlChecker.js | UTF-8 | 186 | 2.78125 | 3 | [] | no_license | function urlChecker(inputText) {
console.log("Checking URL", inputText);
const r = new RegExp(/^(http|https):\/\/[^ "]+$/);
return r.test(inputText);
}
export { urlChecker } | true |
472f99db940541d1fdb1dcee2de5506573838fa7 | JavaScript | shubha-rajan/video-store-consumer | /src/components/MovieCard.js | UTF-8 | 2,504 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {Card, Button} from 'react-bootstrap'
import moment from 'moment';
import './MovieCard.css';
class MovieCard extends Component {
constructor(props) {
super(props);
this.state = {
numCopies: 0
};
}
o... | true |
ca48b3e2d5279e7d83e442b68558aa1c5497300a | JavaScript | lukyans/javascript-basics-challenge | /logest_string/longest_string.js | UTF-8 | 208 | 2.828125 | 3 | [] | no_license | function longestString(str){
str.sort(function(a, b){
return b.length - a.length;
})
console.log(str[0])
return str[0]
}
longestString(['horses', 'cats', 'pineapples']);
module.exports = longestString | true |
e730184559fc78e636f312a5d4c1dac8ccfc8241 | JavaScript | Circuit-killer/nodeschool | /nodebot-workshop/2015-07-05/barcli-clock.js | UTF-8 | 522 | 2.5625 | 3 | [] | no_license | var Barcli = require("barcli");
var hours = new Barcli({ label: "Hour", range: [0, 23]});
var minutes = new Barcli({ label: "Minute", range: [0, 59]});
var seconds = new Barcli({ label: "Second", range: [0, 59]});
var milliseconds = new Barcli({ label: "Millisecond", range: [0, 999]});
var intervalID = GLOBAL.setInte... | true |
a6f7d108cac454dd9ddcd74de09bf60ef1e3a904 | JavaScript | DigitEgal/CollaboDev | /static/js/updateStatusColour.js | UTF-8 | 627 | 2.53125 | 3 | [
"MIT"
] | permissive | /* exported updateStatusColour */
/* global CSRF_TOKEN */
function updateStatusColour (userID, target) {
var request = new XMLHttpRequest()
request.open('POST', '/accounts/user_status/')
request.setRequestHeader('X-CSRFToken', CSRF_TOKEN)
request.onreadystatechange = function () {
if (request.ready... | true |
737f61a1b0ee01d347eff78b735e599660e57dfc | JavaScript | DannyNemer/aang | /lib/deprecated/pfsearchNearestNeighbor/pfsearchNearestNeighbor.js | UTF-8 | 27,035 | 2.828125 | 3 | [] | no_license | /**
* This implementation of `pfsearch` and `calcHeuristicCosts` only creates a single new path from the previous path's cheapest sub node, then adds the previous path back to the heap with the next cheapest sub's minimum cost. This reduces the number of paths created. Nevertheless, this decreases overall performance ... | true |
84d4705ecb3d9fc7c88e2ea5c2fe1ac76a6d5766 | JavaScript | tackc/cs-challenges | /05-merge-sort/mergesort.js | UTF-8 | 740 | 3.3125 | 3 | [] | no_license |
function mergeSort(arr) {
if (arr.length < 2) {
return arr
}
let mid = Math.ceil(arr.length / 2)
let leftArr = arr.slice(0, mid)
let rightArr = arr.slice(mid, arr.length)
var sortedLeftArr = mergeSort(leftArr)
var sortedRightArr = mergeSort(rightArr)
return merge(sortedLeftArr, sortedRightArr)
f... | true |
936e266b1b843b62f0e438074663b109072807fb | JavaScript | JsKingBoo/SableyeBot | /bot/commands/item.js | UTF-8 | 1,409 | 2.59375 | 3 | [
"MIT"
] | permissive | 'use strict';
var utils = require(`${__dirname}/../../utils/utils.js`);
var items = require(`${__dirname}/../../data/items.js`)['BattleItems'];
module.exports = {
desc: "Gives brief information on an item.",
longDesc: "Gives a description of an item's effects and the generation it was introduced in. If appli... | true |
2c9348430eaa51275204577408db51442129c207 | JavaScript | juanjofs96/dawG6FloresHerrera | /proyecto1p/js/script.js | UTF-8 | 1,788 | 3.078125 | 3 | [] | no_license | function addNew(titulo, contenido) {
var title = $("<h5/>", {
"class":"card-title",
html: titulo
})
var p = $("<p/>",{
"class": "card-text",
html: contenido
})
var div = $( "<div/>", {
"class": "card-body",
"id": "news"
});
title.appendTo(div)
p... | true |
dd878d1fd2c7abd67ffcf7e3a90b25d9a4399166 | JavaScript | sureshkumarn/time-check | /chrome/clock.js | UTF-8 | 1,040 | 2.765625 | 3 | [
"MIT"
] | permissive | // clock.js
var cur_min = (new Date()).getMinutes();
var n = 60 - cur_min;
var beeper_alarmInfo = {
when: (Date.now() + n * 60000),
//when: (Date.now() + 2000),
periodInMinutes: 60
};
var beeper_alarm;
var create_beeper = function() {
console.log('beeper created!!!');
chrome.alarms.create('beepe... | true |
0eebfff357b36061a9b56ed348e63d13629dac3f | JavaScript | bernajs/bernajs | /app.js | UTF-8 | 402 | 2.890625 | 3 | [] | no_license | $(document)
.ready(function () {
$('#todo')
.click(function () {
$('.app, .web').show('slow');
});
$('#app').click(function () {
$('.app').show('slow');
$('.web').hide('slow');
});
$('#web').click(function () {
... | true |
40a8499b69848c752274b43b695db5d8cab7f7b9 | JavaScript | santiago-elustondo/watson-flights | /web-client-server/src/services/ConversationService.js | UTF-8 | 778 | 2.59375 | 3 | [] | no_license | import SocketIO from 'socket.io-client';
import { receiveMsg } from '../actions/conversationActions';
import { updateArrivalCity } from '../actions/flightsActions'
class ConversationService {
constructor(store){
this.store = store;
this.socket = SocketIO('http://localhost:8080');
this.socket.on('connect... | true |
63bb4e1ac285d181c93e12a49092209f36cf7bb2 | JavaScript | darmalovan/mywarwick | /test/assets/js/stream_test.js | UTF-8 | 3,996 | 2.796875 | 3 | [
"ISC"
] | permissive | import moment from 'moment';
import _ from 'lodash-es';
import {
onStreamReceive,
getStreamPartition,
mergeReceivedItems,
takeFromStream,
getStreamSize,
getNumItemsSince,
freeze,
} from '../../../app/assets/js/stream';
let item = (id, date) => ({id: id, date: moment('2015-01-01').add(date, 'd').format()}... | true |
d0d87dffd5feb9d155ebeb094d164a50b6f5275d | JavaScript | y-git/myAccumulation | /测试/前台/jasmine/spec/bomberSpec/component/BitmapSpec.js | UTF-8 | 1,707 | 2.875 | 3 | [] | no_license | describe("Bitmap.js", function () {
var bitmap = null;
beforeEach(function () {
});
afterEach(function () {
});
//it("使用时要创建实例", function () {
// bitmap = new new Bitmap($("#test_img")[0], 2, 3);
// //实例没有prototype属性,而类(函数)有prototype属性
// expect(bitmap.prototype).toBeUnd... | true |
1b6af2ad95965ef0956d13eb7c9eff6f012a75a6 | JavaScript | bryan-da-silva/e-commerce | /frontend/src/components/Profil/Profil.js | UTF-8 | 8,709 | 2.59375 | 3 | [] | no_license | import React,{useState, useEffect} from 'react';
import './Profil.css';
const Profil = () => {
const [token, setToken] = useState(null);
const [email, setEmail] = useState("");
const [oldPassword, SetOldPassword] = useState('');
const [newPassword, SetNewPassword] = useState('');
const [newPassword... | true |
c74ff5c90c8c3933d0c33b7d917f9015b3310582 | JavaScript | jeremiah-ang/graphical-stuff | /isometric/IsometricSquare.js | UTF-8 | 4,267 | 3 | 3 | [] | no_license | function IsometricSquare (x, y, offsetX, offsetY, l) {
var base = IsometricSquare.sqCoordToIsoCoord (x, y, offsetX, offsetY, l);
var left = IsometricSquare.sqCoordToIsoCoord (x - 1, y + 1, offsetX, offsetY, l);
var right = IsometricSquare.sqCoordToIsoCoord (x + 1, y + 1, offsetX, offsetY, l);
var bottom = Isometric... | true |
951810585682534c43b01eb1c0d47d71a1b78259 | JavaScript | rickets100/CS-Drills | /src/linked-list/doubly_linked_list.js | UTF-8 | 4,827 | 3.859375 | 4 | [] | no_license | 'use strict';
function Node(val, next, prev) {
this.val = val
this.next = next
this.prev = prev
}
// ===== DOUBLY LINKED LIST =====
function DoublyLinkedList() {
this.head = null
this.tail = null
this.length = 0
}
// ===== GET NODE AT =====
DoublyLinkedList.prototype.__getNodeAt = function(index) {
le... | true |
f86d7063472263d0b287f489a5e57e2f77884ed6 | JavaScript | stargaze-100/TI-sem2 | /p5/p5/bouncing ball/curve1.js | UTF-8 | 338 | 3.0625 | 3 | [] | no_license | let r;
function setup() {
createCanvas(400, 400);
let r= 150;
}
function draw()
{
r = mouseX;
background(220);
noStroke();
fill (0);
for (let t=0; t<360; t++)
{
d= radians (t);
let x = width/2 + t* sin(d) + random (0, 15);
let y = height/2 + t* cos(d) + random (0, 15);
ellipse (x,... | true |
59db5971ae4be9631b9561a80a003e76d3c18d64 | JavaScript | TreywRoberts/Introduction-to-JavaScript | /index.js | UTF-8 | 5,964 | 4.78125 | 5 | [] | no_license | /************************************************************** Task 1: Warm-up! **************************************************************/
//Task a: declare a variable called votingAge, console log true if age > 18 (no function required)
const votingAge = 19;
if(votingAge >= 18){
console.log(true);
} else{
... | true |
820b4776a64c5076ede272ffba611b4bb53d1af9 | JavaScript | rspilker/hdd | /decks.js | UTF-8 | 2,665 | 2.6875 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2017, Roel Spilker. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
var deckDecoder = function() {
var reader = function(encoded) {
var index = 0;
var bytes = atob(encoded);
va... | true |
11170bdd61db1fb01c8fb0533f1cd254fa0b5e09 | JavaScript | HelloMissGu/hxqymp | /utils/util.js | UTF-8 | 755 | 3.28125 | 3 | [] | no_license | const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return [year, month, day].map(formatNumber).join('-')
}
const formatNumber = n => {
n... | true |
bd1fabaa509a977db44fb97f6a415760a993ec56 | JavaScript | nzthiago/ImHungryBot | /Node/dialogs/findbytype.js | UTF-8 | 2,311 | 2.53125 | 3 | [
"MIT"
] | permissive | var builder = require('botbuilder');
var yelputil = require('../util/yelp');
var location = require('./location');
module.exports = [
function (session, args, next) {
//Only ask again if it's been more than 5 mins
if (yelputil.ShouldAskForLocation(session.userData.lastAskedForLocation)) {
... | true |
44e39895dca6880cdeebb93eaa5142930eee4d05 | JavaScript | DJCordhose/javascript-einfuehrung | /playground/javascript-4-java/kap6.js | UTF-8 | 2,148 | 3.34375 | 3 | [
"MIT"
] | permissive | 'use strict';
//var person = {name: "Olli"};
//console.log(this.person);
//// => Object {name: "Olli"}
//console.log(person === this.person);
//// => true
//console.log(this === window);
//// => true
//console.log(this.person === window.person);
//// => true
function Person(name) {
this.name = name;
}
Person.prot... | true |
8e8de4325a1fcd114c6d64ec9bbe1c9219020f96 | JavaScript | Detilly/chapitre06 | /index.js | UTF-8 | 2,252 | 2.875 | 3 | [] | no_license | const http = require('http');
const path = require('path');
const fs = require('fs');
const PORT = process.env.PORT || 8000;
let serveur = http.createServer((requete, reponse) => {
console.log(requete.url);
/* if(requete.url === '/favicon.ico') {
// on ne fait rien...
} else */ if(requete.url === '/... | true |
02f1ac988ffabafc3d60900e00733aba3ad75221 | JavaScript | duilmarc/Exercises-NePro | /eloquend_book/chapter7.js | UTF-8 | 754 | 3.203125 | 3 | [] | no_license | function runRobot1(state, robot, memory = []) {
for (let turn = 0 ;; turn++) {
if (state.parcels.length == 0) {
return turn
}
let action = robot(state, memory); // pick a random direction from parcels
state = state.move(action.direction); // move to direction
memory = ac... | true |
6444e4d465a2bf01b981a8ae858d641c316df05d | JavaScript | deniztraka/ark-world | /client/entities/mountain.js | UTF-8 | 287 | 2.515625 | 3 | [] | no_license | export class Mountain extends Phaser.GameObjects.Sprite {
constructor(scene, x, y) {
super(scene, x, y);
this.setTexture('mountains');
this.setPosition(x, y);
this.setOrigin(0, 0.5);
this.depth = y;
scene.add.existing(this);
}
} | true |
1813f5446d8f2b585cd089fa3883294fe1da6765 | JavaScript | vsnaichuk/JS | /js_advanced/1.proto/index.js | UTF-8 | 514 | 4.25 | 4 | [] | no_license | /* const person = new Object ({
name: 'Maxim',
age: 25,
greet() {
console.log('Greet!')
}
}) */
const person = {
name: 'Maxim',
age: 25,
greet() {
console.log('Greet!')
}
}
Object.prototype.sayHello = () => console.log('Hello')
person.sayHello()
const liza = Object.c... | true |
37601b4a63b1e11b7853ea553621bb8f7001a61e | JavaScript | mateng8364/Blog | /node/express/index.js | UTF-8 | 258 | 2.5625 | 3 | [] | no_license | const express = require('express');
const app = express();
app.get('/abc', (req, res) => {
// console.log(req)
const array = [{
a: 1,
b: 2
}]
res.send(array);
})
app.listen('8080', () => {
console.log(`服务运行在8080端口成功`)
}) | true |
7c57faeb4a004356ccd35df4dac33b751c7325ae | JavaScript | liatcohen/Priceless | /server/send-email.js | UTF-8 | 2,938 | 2.625 | 3 | [] | no_license | const nodemailer = require("nodemailer")
let emailSender = function(seller, topBidders, concertInfo){
console.log("emailSender")
console.log(seller)
console.log(topBidders)
console.log(concertInfo)
const transporter = nodemailer.createTransport({
port: 465,
... | true |
40d3730adf1f62f451b6b6ffe9ae7486f9f3a6f7 | JavaScript | LukasBombach/v8-ui-app | /js-runtime-deno/src/app.js | UTF-8 | 644 | 2.546875 | 3 | [] | no_license | export function createWindow() {
const id = Deno.core.opSync("op_create_window");
const getSize = () => getSizeById(id);
const getPosition = () => getPositionById(id);
const on = (n, l) => addEventListener(id, n, l);
const off = (n, l) => removeEventListener(id, n, l);
return { id, getSize, getPosition, on,... | true |
a4b0da966ce618db2875cefe6fd33eb4829bb15c | JavaScript | jmksm96/task6 | /src/Components/Employees.jsx | UTF-8 | 1,864 | 2.921875 | 3 | [] | no_license | import React from "react";
export default class Employees extends React.Component {
constructor() {
super();
this.state = {
employee: [],
value: ""
}
this.textInput = React.createRef();
}
componentDidMount() {
this.getEmployees();
}
... | true |
18ed1d07b12e0e66f8e1dfb87ec5d65d6a6edf7d | JavaScript | rangsansith/process-dashboard | /browser/lib/submit.js | UTF-8 | 482 | 3.140625 | 3 | [
"MIT"
] | permissive | var ENTER = 13
module.exports = submit
function submit(elems, listener) {
Object.keys(elems).forEach(function (key) {
var elem = elems[key]
if (elem.tagName === "BUTTON") {
elem.addEventListener("click", listener)
} else if (elem.tagName === "INPUT") {
elem.addEven... | true |
dd15bd927a9eb8a99c8df76250a467ab5c6c0478 | JavaScript | yogitasinkar/dBugTrackerApp | /server/client/src/context/AuthContext.jsx | UTF-8 | 1,218 | 2.75 | 3 | [] | no_license | import React, { createContext, useState, useEffect } from "react";
import AuthService from "../services/AuthService";
export const AuthContext = createContext(); // Create context gives us a provider and a consumer. So AuthContext.Provider is used below. And the consumer is used in App.js
const AuthProvider = (props... | true |
36a927ac1e9c2ddaac54320f6cc3c6ce4e7488d2 | JavaScript | pavanteja6690/simongame | /index.js | UTF-8 | 3,550 | 3.109375 | 3 | [] | no_license | $(document).ready(function ()
{
$(".instruction2").hide();
$(".instruction3").hide();
//green=1; blue=2; red=3; yellow=4;
$(document).on("keypress", function (event)
{
if (event.key == "Enter")
{
$("h2").hide();
$(".instruction1").slide... | true |
9e4f2898bab632ef2957291592c4ea79dc1fbcb5 | JavaScript | tridmwpg/nodewpg | /js/index30.js | UTF-8 | 114 | 3.125 | 3 | [] | no_license | let sideLength = 5;
let area = 4 * sideLength;
console.log("Area is " + area + ", side length is " + sideLength); | true |
0530f5b252886eddb810fec318066a2de66a7ef0 | JavaScript | abikrishnasamypillai/poc1 | /index.js | UTF-8 | 729 | 3.546875 | 4 | [] | no_license | let input=document.getElementById('inputval');
let input1=document.getElementById('inputval2');
let output=document.getElementById('display');
let result=0
function addition()
{
temp=parseInt(output.value);
result=temp+1;
if(result>=0 && result<=10)
{
output.value=result;
}
... | true |
34b7efb3bf2a57df0219778cddc26f89827cd701 | JavaScript | CodrinCarpovici/JS-HTML-CSS-Learning | /0. Js Exercises/2. Replace characters.js | UTF-8 | 259 | 3.71875 | 4 | [] | no_license | /*
Replace every character in a given string with the character following
it in the alphabet
*/
const moveChars = (str) =>
str
.split('')
.map(char => String.fromCharCode(char.charCodeAt(0) + 1))
.join('');
console.log(moveChars("abcdefg")); | true |
eed2cda37ae854d9738d2842f0653f33761c6575 | JavaScript | rhydomako/rhydomako.ca | /posts/cot2016OperatingBudget/js/script.js | UTF-8 | 5,109 | 2.734375 | 3 | [
"MIT"
] | permissive | var ndx;
var ProgramChart = dc.compositeChart("#program-chart");
var CategoryChart = dc.compositeChart("#category-chart");
var ExpenseRevenueChart = dc.pieChart("#expense-revenue-pie-chart");
var LineItemTable = dc.dataTable("#lineitem-table");
var formatCurrency = d3.format("$,.2f");
d3.csv('/posts/cot2016OperatingB... | true |
971d17fd3e4ebd21e95bd95eb25e41f2cfc1ef5f | JavaScript | arnaudceol/htsflow | /web/pages/secondary/expression_quantification/submitFunctions.js | UTF-8 | 4,821 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2015-2016 Fondazione Istituto Italiano di Tecnologia.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless re... | true |
9fd9776ce6e95789834cbd44b481164a3e7d5879 | JavaScript | krsivanov/SoftUni-1 | /Programming fundamentals/Arrays Advanced/DistinctArray.js | UTF-8 | 219 | 3.375 | 3 | [] | no_license | function solve(arr) {
let output = [];
for (let i = 0; i < arr.length; i++) {
if (!output.includes(arr[i])) {
output.push(arr[i]);
}
}
console.log(output.join(` `));
} | true |
606923a2cc8735036292794b644de735a7f8c2e8 | JavaScript | ulascanimoglu/Chess-Pawns | /pawns/deneme1.js | UTF-8 | 2,054 | 3.828125 | 4 | [] | no_license | // İlk piyon beyaz olmak zorunda
// 2 tane siyah piyon yan yana gelmemek zorunda
// 8 tane piyonu satranç tahtasındaki satıra kaç farklı şekilde dizebiliriz.
// Beyaz yerine 1, siyah yerine 0;
console.log("-------------- Hello --------------\n\n");
console.log("8 tane piyonu aşağıdaki kurallara göre di... | true |
be2f69b3b50b2469dc2df3346ad4908ba8a102d5 | JavaScript | akbarjondev/phone-book | /js/scripts.js | UTF-8 | 1,151 | 3.296875 | 3 | [] | no_license | // functions
var getObject = function(selector, node = document) {
return document.querySelector(selector);
}
var getObjects = function(selector, node = document) {
return document.querySelectorAll(selector);
}
// general variables
var form = getObject('.form');
var submitButton = getObject('.btn', form);
var alert... | true |
bdafa2286a0367190a484579e154c917bb6bdc9d | JavaScript | kittyosaka/RandomNameDiscord | /index.js | UTF-8 | 6,302 | 2.84375 | 3 | [] | no_license | const Discord = require('discord.js');
const Keyv = require('keyv');
const client = new Discord.Client();
const frenchWords = require('an-array-of-french-words');
require('dotenv').config();
const botToken = process.env.BOT_TOKEN;
const botPrefixCommand = "!";
let keyv = new Keyv();
if (process.env.DATABASE_URL)
k... | true |
51a723374f3f0874e061dd969f46ee0940ebc5b4 | JavaScript | AmauryVanEspen/KnowledgeRepository | /Technology/Software/ProgrammingLanguage/JavaScript/Functions/Functions.js | UTF-8 | 1,247 | 4.65625 | 5 | [
"MIT"
] | permissive | // Primitive parameters (numbers, strings, ...) are passed by value
// Objects (Arrays, Sets, Maps included) are passed by reference
// Default and "all other arguments" parameters
function square(number = 1, ...many_args) {
return number * number;
}
// Function expressions
let cube = function(number) { return numbe... | true |
cd0d673ac97b2574f253f264d5e74b019dcbee05 | JavaScript | Poulami1/Resort-Website | /validation.js | UTF-8 | 2,669 | 3.1875 | 3 | [] | no_license | function CheckFn(Fn)
{
var alpha = /^[A-Za-z]/;
if (Fn=='')
{
document.getElementById('diserrorFn').innerHTML="Please Enter First Name";
document.getElementById('fn').focus();
}
else if(!alpha.test(Fn))
{
document.getElementById('diserrorFn').innerHTML="Please Enter Alphabetic Value"; ... | true |
18f60b7c297dd6d49aa85c63f8b719df3067055a | JavaScript | rickyle88/Educative-learn-html-css-javascript-from-scratch | /Chapter4_ProgramFlow_DataStructure/02ProgramFlow_ConditionalStatement.js | UTF-8 | 696 | 3.65625 | 4 | [] | no_license | let sellStock = function(stockPrice, sellPrice){
if(stockPrice >= sellPrice){
return true;
}else{
return false;
}
}
var weather = function(temperature){
console.log("The temperature outside is", temperature, "degrees farenheight.");
if(temperature <= 30) {
console.log("It... | true |
6f038de6c0588cbcf2b80823db8d1230b7d653c3 | JavaScript | rafaelsnsantana/exercicios-js | /exercicio3.js | UTF-8 | 411 | 3.59375 | 4 | [] | no_license | let n1 = prompt("Informe nota1");
let n2 = prompt("Informe nota2");
let n3 = prompt("Informe nota3");
let n4 = prompt("Informe nota4");
let n5 = prompt("Informe nota5");
let nome = prompt("Informe nome");
n1 = parseFloat(n1);
n2 = parseFloat(n1);
n3 = parseFloat(n1);
n4 = parseFloat(n1);
n5 = parseFloat(n1);
let medi... | true |
d8c1c00e0351aeea651d674b7ff80ca0b6dbdd24 | JavaScript | donghaowxr/HTML5Demo | /CallJavaTest/app.js | UTF-8 | 723 | 2.640625 | 3 | [] | no_license | /**
* Created by donghao on 2015-12-21.
*/
window.onload=function(){
var btnTest=document.getElementById("btnTest");
var btnTestReturn=document.getElementById("btnTestReturn");
var btnClear=document.getElementById("clear");
btnTest.onclick=function(){
window.control.callJs("Call Java Success")... | true |
f779ea2e97705f40d0fc74849b79d730eb748272 | JavaScript | Peacha/pf-url-shortener | /routes/getURL.js | UTF-8 | 647 | 2.75 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const {getLongUrlfromShortUrl} = require('../appFunctions');
//this router handles gets for existing URLs
router.get("/:urlID",(req,res)=>{
//from the provided shorturl, return the long input. If nothing was found return a 404 else redirect to the w... | true |
dca68e123e79d745c27a9607d58cf521efab97af | JavaScript | gcandal/med | /javascript/validateinviteform.js | UTF-8 | 1,283 | 2.578125 | 3 | [] | no_license | var idorganization = $("#idorganization").val();
var errorMessage = $('#licenseIdError');
var submitButton = $('#submitButton');
var licenseid = $('#licenseid');
$(document).ready(function () {
licenseid.bind("paste drop input change cut", function () {
checkIfInviteUnsent();
});
checkIfInviteUnsen... | true |
c62d02b2966e2a7b657fab59cf4783b1345b4988 | JavaScript | ShivrajRath/AngularTesting | /app/js/service.js | UTF-8 | 1,118 | 2.515625 | 3 | [] | no_license | /**
* @ngdoc service
* @name testApp.services
**/
var services = angular.module('services', [])
services.factory('hackerNewsAPI', ['$http', '$q', function($http, $q) {
var factory = {};
var _hackerNewsTop100 = 'https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty';
/**
* Top 100... | true |
0d2929bd6234d3b089889974e7505c19ab42dcf8 | JavaScript | NPC/math-mate | /src/components/MathTest.js | UTF-8 | 4,264 | 3.140625 | 3 | [] | no_license | import React, { Component } from 'react';
import MathQuestion from './MathQuestion';
import MathTestResult from './MathTestResult';
// Operations to allow
const operations = [
//'+',
//'-',
'x',
'/'
];
class MathTest extends Component {
constructor(props) {
super(props);
this.st... | true |
9e34b5a3b910c5c2ded26ca20b072ed209798cce | JavaScript | Existrace/lift_board_game | /src/components/games/GamingRoom.js | UTF-8 | 1,181 | 2.6875 | 3 | [] | no_license | import React, {Component} from 'react';
import {Typography} from "@mui/material";
/*export default class GamingRoom {
const code;
const players;
const game;
function getCode() {
return code;
}
function setCode(newCode) {
code = newCode;
}
function getPlayers() {
return players;
}
function setPla... | true |
06e6ab30491ae6a77026d1c1bbc552acb87c53c4 | JavaScript | brandonvilla21/NodeJS-and-MySQL-API | /models/products.js | UTF-8 | 2,155 | 2.578125 | 3 | [] | no_license | var conn = require('../connections/mysql');
let Products = {};
Products.all = (callback) => {
if(conn) {
const sql = "SELECT * FROM products";
conn.query(sql, (error, rows) => {
if(error) {
console.log(error);
return callback(error);
}
... | true |
e14d98c8ee7e58f818ce056b6c4fafe27aa58700 | JavaScript | sinsys/knex-practice | /src/drills.js | UTF-8 | 1,771 | 2.875 | 3 | [] | no_license | require('dotenv').config();
const knex = require('knex');
const knexInstance = knex({
client: 'pg',
connection: process.env.DB_URL
});
// 1. Get all items that contain text
searchList = (searchTerm) => {
knexInstance
.from('shopping_list')
.select(
'name',
'price',
'checked',
'da... | true |
30bba03e6452c2db4590d6854b45c44c3b69715c | JavaScript | fmarina/ejercicio-lista-de-tareas | /js/script.js | UTF-8 | 2,810 | 3.546875 | 4 | [] | no_license | var task = [];
var tareas = [
['tarea 1', false],
['tarea 2', false]
];
function agregarTarea(){
var tarea
do {
tarea = prompt("Ingrese la tarea que desea agregar");
if(tarea != "" && tarea != null){
if(verificarExistencia(tarea)){
alert(`La tarea ${tarea} ya existe.`);
}
... | true |