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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9d742bb1a973e8f849bb448350a22788ab3dd76b | JavaScript | codebot-caffeine/currency-conversion | /src/Components/SignUp/index.js | UTF-8 | 3,657 | 2.75 | 3 | [] | no_license | import { Component } from "react";
import Header from "../Header";
import "./index.css";
class SignUp extends Component {
state = {
firstName: "",
password: "",
email: "",
userData: [],
errorMessage: "",
};
componentDidUpdate() {
this.storingInLocalStorage();
}
storingInLocalStorag... | true |
539703a83fc90603ca715d9b8278d508c75ee855 | JavaScript | flibbles/tw5-relink | /plugins/relink/js/filteroperators/references.js | UTF-8 | 1,211 | 2.765625 | 3 | [
"BSD-3-Clause"
] | permissive | /*\
module-type: relinkfilteroperator
Given a title as an operand, returns all non-shadow tiddlers that have any
sort of updatable reference to it.
`relink:backreferences[]]`
`relink:references[]]`
Returns all tiddlers that reference `fromTiddler` somewhere inside them.
Input is ignored. Maybe it shouldn't do this.... | true |
0ca95bde4ecd710566a065745cdf4f6b2aafd036 | JavaScript | ryan-sherman/SDD-Preferate | /WebDocs/js/group.js | UTF-8 | 998 | 3.0625 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | //Javascript for make/edit group
$(document).ready(function(){
//localhost;8080/createGroup?owner_id=_&group_name=Hello&members=1-2-3
//when the user clicks create group
$("#CreateGroup").click(function(){
var friends = [];
$.each($("input[name='friend']:checked"), function(){ ... | true |
0528618eb89d32a95268d40bcdda27e3a680421e | JavaScript | letsgot/gitScrap | /gitScrapper/repo'sUrl.js | UTF-8 | 1,326 | 2.578125 | 3 | [] | no_license | const request = require("request");
const cheerio = require("cheerio");
const fs = require("fs");
request("https://github.com/topics",callback);
let gitTopics = [];
function callback(err,res,html){
if(err){
console.log(err);
}
else{
const $ = cheerio.load(html);
let topicAnchorTag ... | true |
43b1ccfdb27df20b794fd9bae029e9a28ed83c08 | JavaScript | thinkful-ei-emu/DSA-Searching-Nick | /App.js | UTF-8 | 3,351 | 3 | 3 | [] | no_license | import React from 'react';
import './App.css';
class App extends React.Component {
constructor() {
super()
this.state = {
searchNum: 0,
searchedFor: null,
searchType: null,
dataSet: [89, 30, 25, 32, 72, 70, 51, 42,
25, 24, 53, 55, 78, 50, 13, 40, 48, 32, 26, 2,
14, 33... | true |
1a19cdbcfcef10107bd2bbfa310b23498c59f277 | JavaScript | Aquamenthol/jscsshtmlstudy | /WebContent/script.js | UTF-8 | 268 | 3.296875 | 3 | [] | no_license | const content = "최수현의 포트폴리오"
const text = document.querySelector(".text")
let index = 0;
function typing(){
text.textContent += content[index++]
if(index > content.length){
text.textContent = ""
index = 0;
}
}
setInterval(typing, 500) | true |
119be0bb70e69479ded6a72061cf4f60a6d7dee1 | JavaScript | ATHULKNAIR/30-Days-0f-code-MySolutions | /Day-9-Recursions.js | UTF-8 | 167 | 3.90625 | 4 | [] | no_license |
function factorial(n){
var fact =1 ;
for(let i = n;i>0;i--){ // Get factorial of the number
fact = fact * i
}
return fact;
}
| true |
bfa076eff567840df4a12d6cca002ccfdb351d8f | JavaScript | mengyliu/turtle | /script.js | UTF-8 | 2,535 | 3.1875 | 3 | [] | no_license | $(document).ready(function() {
console.log( "ready!" );
init()
});
var color = '#FF0000'
function init() {
var paint = true;
canvas = document.getElementById('canvas')
canvas.setAttribute("width", window.innerWidth * 0.8)
canvas.setAttribute("height", window.innerHeight * 0.8)
ctx = canvas.getContex... | true |
0974db050b632d1687f8ac21cfa13e0a5023443a | JavaScript | glomotion/tesseract-js | /test/notifications.js | UTF-8 | 2,185 | 2.84375 | 3 | [
"MIT"
] | permissive | var tesseract = require('../src/Tesseract.js');
// Tests for listening to notifications.
function connectAndRun(test, body) {
test.expect(2);
tesseract.connect(null, function (err, client) {
test.equals(err, null);
body(client);
});
}
var insertInterval;
function fireInserts(client) {
... | true |
86919046e69926f2d3372a2f6b1f5a6e55eec4d3 | JavaScript | dennis/bombermanjs | /public/js/canvas_manager.js | UTF-8 | 463 | 2.765625 | 3 | [
"MIT"
] | permissive | "use strict";
function CanvasManager() {
this.mapWidth = 0;
this.mapHeight = 0;
}
CanvasManager.prototype.init = function(canvasId, mapWidth, mapHeight) {
this.canvas = document.getElementById(canvasId);
if(this.canvas.getContext) {
this.context = this.canvas.getContext('2d');
this.canvas.width = this.mapWi... | true |
299704dcba1602061edd878b2ffc9eea77248524 | JavaScript | aleksanderbrymora/sei-36 | /warmups/week10/day2/withInquirer.js | UTF-8 | 2,280 | 4.09375 | 4 | [] | no_license | const inquirer = require('inquirer');
// Reverse a string
const revStr = (str) => {
// str.split('').reverse().join('');
let out = '';
for (let i = str.length - 1; i >= 0; i--) {
out += str[i];
}
return out;
};
// console.log('Reverse a string:', revStr('stuff'));
// Print odd numvers from 1 to 99
const odds ... | true |
25c3d04c5f5a1f07c26dfda4b552fb14a3c829a2 | JavaScript | holynova/algorithm | /速算24/getAllSolutions.js | UTF-8 | 346 | 3.21875 | 3 | [] | no_license | const log = console.log.bind(console)
const Combinatorics = require('js-combinatorics');
function range(start = 1, end = 13) {
let arr = []
for (let i = start; i <= end; i++) {
arr.push(i)
}
return arr
}
log(range(1, 4))
let cmb = Combinatorics.combination(range(1, 13), 4)
log(cmb.toArray())
function get... | true |
6a7c07b3cfd2e7ff2150dfae932a69adf8f3786a | JavaScript | ehgoodenough/jumpdude | /source/scripts/models/Hero.js | UTF-8 | 5,054 | 2.65625 | 3 | [] | no_license | var Keyboard = require("<scripts>/functions/Keyboard")
var Hero = function() {
var protohero = {
width: 1,
height: 1.5,
color: "#FC0",
position: {
x: 3,
y: 148
},
velocity: {
x: 0,
y: 0
},
direction: {
... | true |
797a9491dc24a555a4766840c91b11df18f62ca4 | JavaScript | pashkovorg/es6 | /src/destructuring/1.js | UTF-8 | 147 | 3.65625 | 4 | [] | no_license | //destructuring arrays
let [firstName, lastName] = ["Tyrion", "Lannister"];
console.log(firstName); // Tyrion
console.log(lastName); // Lannister | true |
4375bbd8313d70b4ce8a3159bca7a45fc283930a | JavaScript | bgoonz/UsefulResourceRepo2.0 | /MY_REPOS/INTERVIEW-PREP-COMPLETE/notes-n-resources/Data-Structures-N-Algo/_DS-n-Algos/_JavaScript/minOfThreeNums7.js | UTF-8 | 245 | 4.03125 | 4 | [
"MIT"
] | permissive | //7. Write a JS Program to get minimum of three numbers
function minOfThreeNums(a, b, c) {
console.log(a < b < c ? a : b < c ? b : c);
}
minOfThreeNums(1, 2, 3);
minOfThreeNums(1, 20, 3);
minOfThreeNums(-1, 12, 30);
minOfThreeNums(0, 0, 0);
| true |
4e524b41855b2f78aeca5fb1030cdafda70e46d3 | JavaScript | Derlys/javascript1 | /Curso JS Moderno - Fin/13-DOM/js/05-scripts.js | UTF-8 | 1,069 | 3.453125 | 3 | [] | no_license | // en este video estaremos viendo querySelectorAll
// la buena noticia es que la sintaxis para selectores es la misma, es decir similar a CSS, con el punto para las classes y el numeral o signo de gato para los ID's, también puedes añadir un selector especifico..
// Pero la diferencia principal, es que querySelectorA... | true |
3e937fac92d9a551d691b908bf31616f40b63224 | JavaScript | ilqarilyasov/typescript | /main.js | UTF-8 | 1,309 | 3.65625 | 4 | [] | no_license | "use strict";
exports.__esModule = true;
var message = 'Welcome back!';
console.log(message);
var x = 10; // can be without init value
var y = 20; // always init value
var sum;
var title = 'Learn Typescript';
// boolean, number, string - primitive type
// Boolean, Number, String - object type
var isBeginner = true;
var... | true |
c3d18a7552aded779a895b9408b83ba9d64bc7fd | JavaScript | ManasviBendigeri/Compiler | /compiler.js | UTF-8 | 1,141 | 4.125 | 4 | [] | no_license | //User input for calcution
let input = ['sum',200,200]
//Lexical Analysis
let operArr = []
let numberArr = []
//Tokenization
for(let i = input.length-1; i >=0;i--){
if(typeof input[i] === 'string'){
operArr.push(input[i])
}else{
numberArr.push(input[i])
}
};
//Intializing value
let value = 0
//Actio... | true |
18c3bb3f1ca374fa3f3f0caffe84ae58122c0a1d | JavaScript | LearnChemE/LearnChemE.github.io | /lab-experiments/garage_door/src/js/svg/SVG.js | UTF-8 | 1,321 | 2.84375 | 3 | [] | no_license | const SVGObject = require("./SVGObject");
/** Creates an SVG object for the <svg> element. */
class SVG extends SVGObject {
/**
* @constructor
* @param {object} options - Default options
* @property {element} parent - The SVGObject parent (default {element: document.body})
* @property {string} id - Id of the... | true |
b424141858ed239abe31fe3ea5183a6fb33fe59f | JavaScript | jocelynlozano/calculadora | /app.js | UTF-8 | 2,977 | 3.90625 | 4 | [] | no_license | {var opcion = parseInt(prompt("elija una de las siguientes opciones \n" +
"1. Calculadora Aritmetica \n" +
"2. Caluladora Relacional"));
switch(opcion){
case 1:
var opcionElegida1 = parseInt(prompt("ingrese la operacion deseada \n" +
"1. Suma \n" +
"2. Resta \n" +
"3. Multiplicacion \n" +
"4. D... | true |
e3a425d028c6b09d108f0136bbcc0ce4c80b8d24 | JavaScript | mrako/todo-nodejs-server | /app/routes.js | UTF-8 | 1,899 | 2.546875 | 3 | [] | no_license | 'use strict';
var Todo = require('./models/todo');
module.exports = function(app) {
// GET ALL ====================================================================
app.get('/api/todos', function(req, res) {
Todo.find(function(err, todos) {
if (err) {
res.send(err);
}
res.json(todos)... | true |
7ec2ca4e4cdbd27d144ce26db3a520c217ad7941 | JavaScript | codingbits/MindMap | /es6/structs/AbstractGraph.js | UTF-8 | 4,078 | 3.046875 | 3 | [
"MIT"
] | permissive | "use strict";
load.provide("mm.structs.emptyGraph", (function() {
/** Just a simple, emtpy graph
*
* For use when a graph is needed, but none is provided.
* @type object
*/
return {
"version":1,
"nodes":[],
"edges":[],
"canvas":{
"height":200,
"width":200,
}
};
}));
load.provide("mm.struct... | true |
7446a88555d8fa8bd7e066cbce9f55c7d7914d3f | JavaScript | drewthedev9-tech/API-server | /server.js | UTF-8 | 1,949 | 2.609375 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const bcrypt = require('bcrypt-nodejs');
const cors = require('cors');
const knex = require ('knex');
const register = require('./controllers/register');
const signin = require('./controllers/signin');
const profile = require('./controllers/... | true |
5e0d0e5b1486b9d69b356d7e5ceca5b4306b1dd0 | JavaScript | Swethad98761/ReactAssignment-ToDoApp- | /src/containers/MyTasks/MyTasks.js | UTF-8 | 1,999 | 2.59375 | 3 | [] | no_license | import React, { Component } from "react";
import "./MyTasks.css";
import MyTask from "./MyTask/MyTask";
class MyTasks extends Component {
constructor() {
super();
this.state = {
reminder: "",
toggleTasks: false
};
}
handleToggleTask(currentReminder) {
var toggleTasks = !this.state.togg... | true |
4f51c29a1540cc6758fb8aac9d0c1fd19bb61100 | JavaScript | josephBenjaminDeveloper/todolist | /src/App.js | UTF-8 | 1,625 | 2.625 | 3 | [] | no_license | import Header from "./componentes/Header";
import ContainerTask from "./componentes/Container";
import React,{ useEffect,useState } from "react";
import "../src/styles/app.css"
function App() {
const [taskTodolist,setTaskTodolist] = useState(null)
const [datafilter,setDatafilter] = useState(null)
useEffect(()... | true |
78ba5d63db76d554e2633eae855f707ea9fef077 | JavaScript | gsc229/typescript-with-react | /simple-typescript/dist/utility-types2.js | UTF-8 | 652 | 3.828125 | 4 | [] | no_license | "use strict";
const myObject = {
sayHello() {
return this.helloWorld();
}
};
myObject.sayHello = myObject.sayHello.bind({
helloWorld() { return "Hello World"; }
});
console.log(myObject.sayHello());
function makeObject(desc) {
let data = desc.data || {};
let methods = desc.methods || {};
... | true |
2fa8618433cfefd440269daa69c1a696ce4969eb | JavaScript | jordandivyansh/gradient_bg | /script.js | UTF-8 | 760 | 2.96875 | 3 | [] | no_license | var c1 = document.querySelector(".c1");
var c2 = document.querySelector(".c2");
var css= document.querySelector("h3");
var body= document.getElementById("gradient");
var buttonl = document.getElementById("buttonl");
var buttonr = document.getElementById("buttonr");
function bgchange(){
body.style.background= "r... | true |
2f4b61e44f598855a2589f2aecf3e2abac4550b4 | JavaScript | HuyckS/C-.NET-Core | /algos/day4.js | UTF-8 | 3,414 | 4.40625 | 4 | [] | no_license | class Queue {
constructor() {
this.values = [];
}
/**
* Adds a value and returns the new size.
*
* @param {any} val
* @returns {number} the new size
*/
enqueue(val) {
this.values.push(val);
return this.values.length;
}
/**
* @returns {any} the removed (front) value
*/
... | true |
f79ec9864879e51d174bf074808b9a77e511b27a | JavaScript | timcritt/updated-learn-redux | /src/index.js | UTF-8 | 2,103 | 2.859375 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
//import App from './App';
import * as serviceWorker from './serviceWorker';
import { Provider, connect } from 'react-redux';
//redux imports
import {createStore } from 'redux';
// If you want your app to work offline and load faster, ... | true |
9e16c0bdb797e382d5ed28e904a5d6b0a56317da | JavaScript | kporcelainluv/100_days_of_JS | /avgAlth.js | UTF-8 | 580 | 3.171875 | 3 | [] | no_license | function orbitalPeriod(arr) {
let getOrbPeriod = obj => {
var GM = 398600.4418;
var earthRadius = 6367.4447;
let avgAlth = obj["avgAlt"];
let pi = Math.PI;
let res = 2 * pi * Math.sqrt((earthRadius + avgAlth) ** 3 / GM);
delete obj["avgAlt"];
obj["orbitalPeriod"] = Math.round(res);
ret... | true |
5cf4f732a0c74edbc40d118db1e35b88eba954b8 | JavaScript | O-Liruk/JS | /homework_17/script.js | UTF-8 | 2,990 | 3.328125 | 3 | [] | no_license | 'use strict';
const TODOS_URL = 'https://jsonplaceholder.typicode.com/todos/';
const DONE_CLASS = 'done';
const DELETE_BTN_CLASS = 'delete-btn';
const TASK_ITEM_CLASS = 'task-item';
const TASK_ITEM_SELECTOR = '.' + TASK_ITEM_CLASS;
const taskInput = document.getElementById('taskNameInput');
const taskTemplate = docume... | true |
7130b8f4f2a03ddda71e72c61b04bc9cff6c82d9 | JavaScript | prakhar-161/-Registration-Form | /src/app.js | UTF-8 | 2,110 | 2.59375 | 3 | [] | no_license | const express = require('express');
const path = require('path');
const hbs = require('hbs');
const app = express();
require('./database/connect');
const Register = require('./models/students');
const port = process.env.PORT || 3000;
//important
const static_path = path.join(__dirname,"../public");
const template_pat... | true |
fd90befde9ae698de95ed55ed3f86957b5aef83b | JavaScript | CHOEJANGHYEOK/quantcash | /front/src/store/reducers/algo.js | UTF-8 | 785 | 2.75 | 3 | [] | no_license | const initialState = {
allAlgorithmList: [],
ownedAlgorithmList: [],
};
const algoReducer = (state = initialState, action) => {
switch (action.type) {
case 'RESET':
console.log(state);
return initialState;
case 'GET_OWNED_ALGORITHM':
return {...state, own... | true |
e5584ecd4810ec538f3e8812b92d6ec76edb9c8e | JavaScript | campeon19/Lab10_Web_Calculadora | /src/componentes/util/calcular.js | UTF-8 | 2,557 | 2.890625 | 3 | [] | no_license | /* eslint-disable no-alert */
import Big from "big.js";
import operate from "./operar";
import isNumber from "./isNumber";
export default function calculate(obj, buttonName) {
Big.DP = 7;
if (buttonName === "AC") {
return {
total: null,
siguiente: null,
operacion: null,
};
}
if (isNu... | true |
79b46651685bad27c0c80aedbe8cb74cd64ce5a2 | JavaScript | YehorZapara/Ucode | /Sprint_04/ezapara/t01_elements/js/script.js | UTF-8 | 714 | 2.921875 | 3 | [] | no_license | let li = document.getElementsByTagName('li');
for (let i = 0; i < li.length; i++) {
if (li[i].className !== 'good' && li[i].className !== 'evil' && li[i].className !== 'unknown') {
li[i].className = 'unknown';
}
if (!li[i].hasAttribute('data-element')) {
li[i].setAttribute('data-element', '... | true |
4ef3354ad704f2707e312b6abbba516a38be324a | JavaScript | Mitch-Kenward/Lotide | /test/tailTest.js | UTF-8 | 770 | 3.453125 | 3 | [] | no_license | const { assert } = require("chai");
const tail = require("../tail");
describe("#tail", () => {
const words = ["bright", "Lighthouse", "Labs"];
it("returns 3 for words.length", () => {
assert.strictEqual((words.length), 3);
});
it("returns 2 for tail(words).length", () => {
assert.strictEqual(tail(words... | true |
efc99910f82b0a645883948f829e161d56464546 | JavaScript | Subhadeep-sm/bmi-calculator | /js/bmi.js | UTF-8 | 2,216 | 3.609375 | 4 | [] | no_license |
function weightunit(){
if (document.getElementById('weight-unit').value == "Pounds"){
let x = parseFloat(document.getElementById('weight').value);
document.getElementById('weight').value= 0.45359237 * x;
}
else{
let x = parseFloat(document.getElementById('weight').value);
}
}
... | true |
6b1e2c2e6c877b281efac46d7a9e5e2ef1169283 | JavaScript | fullmontis/fullmontis.github.io | /monster-girl-diaries/menu.js | UTF-8 | 1,700 | 3.375 | 3 | [] | no_license | "use strict";
var stories = document.getElementsByClassName("story");
var story_buttons = document.getElementsByClassName("monster-button");
var story_close = document.getElementById("button-close");
var story_close_container = document.getElementsByClassName("button-close-container")[0];
function jump_to( id ) {
... | true |
b8ccf33ff7b82d9aafc9cd61392517ff43146156 | JavaScript | vladstepway/english-for-kids | /src/js/utils/router.js | UTF-8 | 2,824 | 2.6875 | 3 | [] | no_license | // const main = <h1>Categories</h1>;
// const animals = <h1>Animals</h1>;
// const countries = <h1>Countries</h1>;
// const emotions = <h1>Emotions</h1>;
// const fairyTales = <h1>Fairy Tales</h1>;
// const food = <h1>Food</h1>;
// const halloween = <h1>Halloween</h1>;
// const weather = <h1>Weather</h1>;
// const hosp... | true |
3b2e3b8d7e68985a1f4ee10343ecd6a9e52cfc32 | JavaScript | Jstewart3313/headcount2.0 | /src/Card.js | UTF-8 | 873 | 2.65625 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
const Card = ({stats, location, compareCards}) => {
let years = Object.keys(stats);
let cardCounter = 0;
const schoolData = years.map( year => {
return <p className={(stats[year] > .5) ? 'data-above' : 'data-below'}
name={loca... | true |
ea5101d58267ba5283ebc3853473d0dd133b29ea | JavaScript | simtemple/industry | /WebApp/src/admin/pages/home/approveActions.jsx | UTF-8 | 2,498 | 2.53125 | 3 | [] | no_license | import { toastr } from 'react-redux-toastr';
// Accept company method
export const acceptUser = (ID) =>
async (dispatch, getState, {getFirestore}) => {
const firestore = getFirestore();
try {
await firestore.update(`users/${ID}`, {
approved: true,
approvalStatus: 'accepted'
})
... | true |
da8be7d7bdce6a898b8f2eef2503733186ac6db3 | JavaScript | danuzclaudes/COMP426-F14-A2 | /js/minesweeper.js | UTF-8 | 382 | 2.5625 | 3 | [
"MIT"
] | permissive | /**
* Created by chongrui on 2014/9/25 0025.
*/
$(document).ready(function (){
// Initially has 10 bombs and 8*8 table
var bombSize = 10;
var row = 8;
var col = 8;
buildBoard(row,col);
setBomb(row,col,bombSize);
myEvent(row,col,bombSize);
// if GameOptions are reset, will invoke st... | true |
aa5e9f2cd150afeb42bec555837956876c351799 | JavaScript | Hiro-mackay/react-nagoya-learning-4 | /src/components/Form.jsx | UTF-8 | 1,321 | 3.078125 | 3 | [] | no_license | import React, { useState } from "react";
import firestore from "../config/firestore"; // This one is new
const Form = () => {
// Initial item
const initialItemValues = {
name: "",
message: ""
};
const [item, setItem] = useState(initialItemValues);
// Formが牛んされると実行
// 名前とメッセージに文字が入っていれば、
// オブジェ... | true |
1513a31161b48bfad628724d2e261388cfd23e0a | JavaScript | stefanus1292/h8-p0-w4 | /w4-ex 9.js | UTF-8 | 508 | 3.375 | 3 | [] | no_license | function checkAB(num) {
var A, B;
for (let i = 0; i < num.length; i++) {
if (num[i] === 'a') {
A = i;
} else if (num[i] === 'b') {
B = i;
}
var jarak = Math.abs(B - A) - 1;
}
if (jarak === 3) {
return true;
} else {
return false;
}
}
// TEST CASES
console.log(checkAB('lane borrowed')); // true
c... | true |
01010a58049fdb9b7b9789358b7057ccf98e1f07 | JavaScript | andogq/rts | /server.js | UTF-8 | 5,813 | 2.59375 | 3 | [] | no_license | // Imports
const http = require("http");
const url = require("url");
const fs = require("fs");
class Server {
constructor(port, staticDir) {
this.port = port == undefined ? 8000 : port;
this.staticDir = staticDir == undefined ? "static" : staticDir;
this.server = http.createServe... | true |
7a0e0101755df1b0be6770b4acde82647bbda7df | JavaScript | YuryRegis/StarKid | /comandos/tags.js | UTF-8 | 5,477 | 2.734375 | 3 | [] | no_license | const { MessageEmbed } = require("discord.js");
const getID = require('../funcoes/ids.json');
const { promptMessage } = require("../funcoes.js");
const { verificaPerm } = require('../funcoes/members');
const opcoes = [`👤`,`👥`,`👑`,`🤠`,`🎹`,`🎨`,`🔰`,`🗺️`,`🧢`,`🧚`,`🤳`,`🎒`,`❤️`,`💍`,`💍`,`😄`,`💋`, `💙`,`🧓`,`🃏`... | true |
83407c4f014c30ef74a309c35e2a0d198b120b05 | JavaScript | alok-singh/leetcode | /backtracking/letterCasePermutation.js | UTF-8 | 1,457 | 4.09375 | 4 | [] | no_license | // https://leetcode.com/problems/letter-case-permutation/
/**
* @param {string} S
* @return {string[]}
*/
// const letterCasePermutation = (S, currentString = '') => {
// if(currentString.length === S.length) {
// return [''];
// }
// let currentChar = S[currentString.length];
// if(currentChar.toUpper... | true |
3f33349ac2985b60e2eae2e8d8ec3b023d517a3d | JavaScript | Badjessa-git/vr-engine | /Engine/Entities/zoneScript.js | UTF-8 | 835 | 2.84375 | 3 | [] | no_license | //This entity script will be attached to zones
(function()
{
//set up entity id storage
var _selfEntityID;
//Subscribe to channel to listen to notices
Messages.subscribe("zoneNotice");
//Stores entity id on creation
this.preload = function(entityID)
{
_selfEntityID = entityID;
};
Messages... | true |
5ca05f949d376cab668425b21163ddb68104c7f1 | JavaScript | danielcawen/buggy-todomvc | /cypress/integration/todo_list_spec.js | UTF-8 | 7,436 | 2.875 | 3 | [] | no_license | context('TODO List', () => {
beforeEach(() => {
cy.visit('http://qa-challenge.gopinata.com/')
cy.get('body').then($element => {
if ($element.find("[type='checkbox']").length > 0) {
cy.get('.todo-list li')
.each(function($el, index, $list){
$el.find('.destroy').click()
... | true |
d3ac87f1e26dcd782c1aa3d0af9dc28cc220eef9 | JavaScript | nch0w/uprising | /commands/draw.js | UTF-8 | 2,364 | 2.796875 | 3 | [] | no_license | const { games, backup } = require("../models");
const { deepCopier } = require("../helpers");
function execute(message, args, user) {
if (message.channel.id in games) {
let person = message.author;
if (message.mentions.members.first()) {
person = message.mentions.members.first().user;
}
const p... | true |
e4dbefde452e7b13a3ad0d2b9e122d2a329bdc86 | JavaScript | DetlefDmann/dentist_react | /src/components/Patients.js | UTF-8 | 2,495 | 2.796875 | 3 | [] | no_license | import React, { useContext, useState } from 'react'
import { GlobalContext } from '../GlobalContext'
import { v4 as uuid } from "uuid"
const Patients = () => {
const [state, setState] = useContext(GlobalContext);
const [newPatient, setNewPatient] = useState({
firstName:"",
lastName:"",
... | true |
1f463b5ca58ad1612ffa3973754f905f28710113 | JavaScript | inkyysleeves/cruise-shipz | /__tests__/port.test.js | UTF-8 | 327 | 2.625 | 3 | [] | no_license | const Port = require("../src/port.js");
describe("port", () => {
it("returns a port object", () => {
const port = new Port("dover");
expect(new Port()).toBeInstanceOf(Object);
});
it("can see a port has a name", () => {
const port = new Port("Dover");
expect(port.name).toEqual('Dover');
}... | true |
c925ca636006a74596e6f1e81a535d336e214a26 | JavaScript | Project-AirPods/booking-module | /database/index.js | UTF-8 | 4,369 | 2.53125 | 3 | [] | no_license | const config = require('./config.js');
const { Pool, Client } = require('pg');
const client = new Client(config);
client.connect();
module.exports.getCoreData = function getBaseDataForListing(listingId, callback) {
const query = `SELECT l.*, ROUND(AVG(p.cost_per_night), 0) as avg_cost_per_night
FROM listings l
... | true |
d7ba186688c36ecdf5243163fc2e3c0a7ea1b29e | JavaScript | KhangNguyen007/cliexa | /public/javascripts/Rectangle.js | UTF-8 | 1,293 | 3.15625 | 3 | [] | no_license | class Rectangle{
constructor() {
}
//Create without onClick
create(x,y,height,width,fill,zIndex){
let svgns = "http://www.w3.org/2000/svg"
var rect = document.createElementNS(svgns, 'rect'); //Create a path in SVG's namespace
rect.setAttributeNS(null, 'x', x.toString());
... | true |
8f3da745544be5303a2bdda2ae19d04196d29c16 | JavaScript | enodi/phone-number-generator | /client/src/pages/DetailsPage/index.js | UTF-8 | 2,037 | 2.625 | 3 | [] | no_license | import React, { Fragment, useEffect, useState } from "react";
import Header from "../../components/Header";
import SubHeader from "../../components/SubHeader";
import Button from "../../components/Button";
import { getPhoneNumbers, downloadPhoneNumbers } from "../../../helpers/config";
import "./style.scss";
const Det... | true |
0c4d6095764791b473043167bcec505a3e8cd7db | JavaScript | dlevenson44/blockchallenge-2 | /client/src/components/BtcController.jsx | UTF-8 | 2,524 | 2.765625 | 3 | [] | no_license | // import dependency
import React, { Component } from 'react';
class BtcController extends Component {
constructor(props) {
super(props)
// bind functions
this.sendToDb = this.sendToDb.bind(this)
}
sendToDb() {
// do not sent to DB until all API calls are ran, prevent 0... | true |
99a57f9f1d56fc424169677997299e2f47fdc221 | JavaScript | grayson073/lab10-BusMall | /js/app.js | UTF-8 | 1,705 | 2.953125 | 3 | [] | no_license | /* globals ImageDisplay ResultsDisplay imageArray getRandomImage */
/*exported App */
const appTemplate = document.getElementById('app-template');
class App {
constructor() {
this.products = imageArray;
this.totalVotes = 0;
}
getThreeRandomImages() {
const displayImages = [];
... | true |
9e063b7282b0917ccd420d0dad97e510d01bde25 | JavaScript | SonavAgarwal/java-swing-component-creator | /src/components/JavaComponents/ScreenClassMaker.js | UTF-8 | 3,139 | 3.0625 | 3 | [] | no_license | import { getJavaClass, getJavaTextAlignConstant } from "./JComponentData";
export function makeClassText(components) {
let componentDeclarations = "";
components.forEach((element) => {
componentDeclarations += "private " + getJavaClass(element.type) + " " + element.variableName + ";\n";
});
con... | true |
ddac26efc7861b698a3d9a4edc543770655e62a3 | JavaScript | Gitkat91/Level_0_Coding_Challenge | /Task4.js | UTF-8 | 165 | 3.359375 | 3 | [] | no_license | function evenOrOdd(numb) {
if (numb % 2 == 0) {
rtnString = "even";
} else {
rtnString = "odd";
}
return console.log(rtnString);
}
evenOrOdd(781);
| true |
e54e4034c251db113a558c76cc138ecc1c0fbfce | JavaScript | levythu/encloure.io | /utils/lock.js | UTF-8 | 908 | 2.90625 | 3 | [] | no_license | // Multiple-Lock, use queue to maintain holder. Each lock instance could be held by
// at most k functions. The rests have to wait.
//
// Author: Levy (levythu)
// Date: 2016/04/02
(function() {
var Queue=require("./queue");
function Lock(maxHolder)
{
if (maxHolder==null)
this.rest=1;
... | true |
58f2744039b975404e315a87bbf77cc3f0252e6f | JavaScript | DWL321/Web2.0_homework | /web第七次作业/优化/修改后/js/Whac-a-mole.js | UTF-8 | 2,277 | 2.9375 | 3 | [] | no_license | /*19335040 丁维力*/
/*打地鼠小游戏脚本文件*/
/*初始化全局变量*/
var time_ = 30;
var timer = null;
var score_ = 0;
var mole = -1;//纪录地鼠出现位置,-1表示未出现地鼠
var hit = -2;//记录打击位置,-2表示地鼠未出现,-1表示未击打
var playing = false;
/*添加当玩家鼠标点击元素时触发的事件监听器*/
$(function () {
$('#start').click(game_start);
$('#stop').click(game_over);
$('[... | true |
e0eb70b81969e71d1556820f05336ef5cf6b2384 | JavaScript | apparition47/LeetCode | /124 - Binary Tree Maximum Path Sum.js | UTF-8 | 785 | 3.328125 | 3 | [] | no_license | // https://leetcode.com/problems/binary-tree-maximum-path-sum/
/**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
/**
* @par... | true |
bba4af331d6baeba98be0898157d585ee1ee66b9 | JavaScript | floraxue/TextThresher | /app/components/quiz/QuizContext.js | UTF-8 | 1,019 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | import React from 'react';
export default React.createClass({
displayName: 'QuizContext',
propTypes: {
context: React.PropTypes.object.isRequired
},
render() {
var text = this.props.context.text;
var highlights = this.props.context.highlights;
var start = 0;
var tail = '';
var l = hi... | true |
1acffb274176662e4b0935b2e239ad8b63eb478e | JavaScript | CaliZam/skylab-bootcamp-202004 | /staff/albert-manzano/web-components/app-custom/logic/search-users.js | UTF-8 | 870 | 3.125 | 3 | [] | no_license | function searchUsers(query) {
debugger
query=query.toLowerCase()
const _users = users.filter(function(user){
const {name, surname,email}= user
return name.toLowerCase().includes(query)||surname.toLowerCase().includes(query)||email.toLowerCase().includes(query)
})
//san... | true |
eac6e79a7494e10df0b29e24a4fa2081dfdcb6ba | JavaScript | HirokoAB/visitor_hp | /umi/js/map-env.js | UTF-8 | 13,429 | 2.5625 | 3 | [] | no_license | /***************** Google Map API ******************/
//
//function initialize() {
// var latlng1 = new google.maps.LatLng(38.824771, 141.586855);
// var latlng2 = new google.maps.LatLng(38.814585, 141.567160);
// var latlng3 = new google.maps.LatLng(38.824771, 141.586855);
//
// var opts1 = {
// zoom: 13,
//... | true |
28df1b78e45a38743a573f5cb65863146690c4a8 | JavaScript | DeLaChance/TravelApp | /backend/test/unit-tests/FileBasedRepositoryUnitTest.js | UTF-8 | 2,564 | 2.578125 | 3 | [] | no_license | const common = require('../common');
const expect = common.expect;
const FileBasedRepository = require('../../domain/TravelDestination/FileBasedRepository');
const User = require('../../domain/TravelDestination/User');
const ErrorMessage = require('../../utils/ErrorMessage');
const uuid = require('uuid/v4');
const fs ... | true |
dc4ef8c35f7af0d2a265819935efc8b6734b2945 | JavaScript | khmais93/myreads-app | /src/SearchBookInput.js | UTF-8 | 1,189 | 2.671875 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { search } from "./BooksAPI";
function SearchBookInput(props) {
const { onSearch } = props;
const [searchValue, setSearchValue] = useState("");
const changeHandler = (e) => {
setSearchValue(e.target.value);
};
useEffect(
() => {
asyn... | true |
47e011225b2332e33af43abdf6edfdf67c24c975 | JavaScript | internetfriendsforever/Wireframes.sketchplugin | /Contents/Sketch/wireframes.js | UTF-8 | 5,210 | 2.515625 | 3 | [] | no_license | function writeTextToFile (filePath, text) {
const t = [NSString stringWithFormat:@"%@", text]
const f = [NSString stringWithFormat:@"%@", filePath]
return [t writeToFile:f atomically:true encoding:NSUTF8StringEncoding error:nil]
}
function chooseFolder () {
const openPanel = [NSOpenPanel openPanel]
[o... | true |
87ef23747aa0e3b2300d6dab4d27837f0a235eae | JavaScript | phandeeyar/malicious-users-dashboard | /dashboard/static/vendor/sb-admin-2/js/demo/chart/bar.js | UTF-8 | 2,599 | 2.546875 | 3 | [] | no_license | 'use strict';
// Set new default font family and font color to mimic Bootstrap's default styling
Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
Chart.defaults.global.defaultFontColor = '#858796';
const fbRootURL = 'h... | true |
65ae3e1eceb337b9fda4f327a48af335456415ea | JavaScript | matthewwolfe/Soundcloud-Client | /src/js/actions/users.js | UTF-8 | 878 | 2.703125 | 3 | [] | no_license | import { getUserById } from '../core/soundcloud/soundCloudSDK';
/*
* Action types
*/
export const ADD_USER = 'ADD_USER';
export const REMOVE_USER = 'REMOVE_USER';
/*
* Action creators
*/
export function addUser(user){
return {type: ADD_USER, user: user};
}
export function removeUser(id){
return {type: RE... | true |
94ab9e4c8ceba796596711d6a39f3c3d9cf52c95 | JavaScript | santoshbaggam/cli-qpg | /src/questions.js | UTF-8 | 1,592 | 3.203125 | 3 | [] | no_license | "use strict";
// import fs module for interacting with the filesystem
const fs = require('fs');
const questionsFilePath = __dirname + '/../data.json';
// check if the questions file exists or not
// throw error if it doesn't
if (! fs.existsSync(questionsFilePath))
throw new Error('Questions file is required for yo... | true |
e2f00423bf240350638d8004de6a0f4c59b92bd4 | JavaScript | kolbeypruitt/oo_warmupSuper8Camera | /camera.js | UTF-8 | 371 | 2.796875 | 3 | [] | no_license | function Camera() {
this.loaded = false;
this.totalFrames = 0;
this.fps = 18;
}
Camera.prototype.shoot = function(rate){
if (rate === 'fast'){
this.fps = 9
} else if(rate === 'slow'){
this.fps = 36
} else this.fps = 18
}
Camera.prototype.addFilm = function() {
this.loaded = true;
thi... | true |
fd1efd57dd671faacee214c2ed8065aa3cd3f59f | JavaScript | foaex/react | /14_src_search参数传递/pages/Home/Message/Detail/index.jsx | UTF-8 | 1,195 | 2.84375 | 3 | [] | no_license | import React, { Component } from 'react'
import qs from 'querystring'
// let obj = {
// name: 'zhangsan',
// age:18
// }
// console.log(qs.stringify(obj)) // name=zhangsan&age=18
// let carName = "name=奔驰&price=199"
// console.log(qs.parse(carName)) //{name: "奔驰", price: "199"}
export default class Detail extends... | true |
91f978dbba67f7016d692d7688ebff4ef369d48e | JavaScript | KaicPierre/React-e-Next.js-Cod3r | /exercicios/pages/render/repeticao1.jsx | UTF-8 | 599 | 3.359375 | 3 | [
"MIT"
] | permissive | export default function repeticao1() {
const listaAprovados = [
'Kaic',
'David',
'Joao',
'Felipe',
'Luiz'
]
function renderizarLista(){
return listaAprovados.map((nome, index)=> <li key={ index }>{ nome }</li>)
}
return (
<ul>
{... | true |
cae606df39fc914bf34e322c167f62f06324ba8c | JavaScript | lerayj/tag | /app/selectionHelpers.js | UTF-8 | 2,327 | 2.671875 | 3 | [] | no_license | import Sizzle from 'sizzle';
import * as log from 'loglevel';
//Track select change event from config
//TODO: move into selectAttrValue pour avoir une methode generique
function selectValueAttrHandler(config, configKeyName, selectDom, callback){
var selector = config[configKeyName];
if(config[configKeyName][0]... | true |
6ab065bc0f794928518e8b5669f88e9df7a6c634 | JavaScript | Sergey-Zhestovsky/ScanUP | /src/classes/Validator.js | UTF-8 | 5,082 | 2.921875 | 3 | [] | no_license | export default class Validator {
constructor(config = {}) {
this.config = null;
this.init(config);
}
init(config) {
this.config = walkThroughConfig(config, {});
function walkThroughConfig(currentConfig, object) {
for (let fieldName in currentConfig) {
let fieldConfig = currentConf... | true |
a2ab86c036d7b7da2c3e1ca98221499369e0dc02 | JavaScript | wiiickedlady/web-to-plex | /src/sites/couchpotato/index.js | UTF-8 | 1,737 | 2.71875 | 3 | [
"ISC"
] | permissive | /* global wait, modifyPlexButton, parseOptions, findPlexMedia */
function init() {
wait(
() => document.querySelector('.media-body .clearfix').children.length > 1,
() => initPlexThingy(isMovie()? 'movie': 'show')
);
}
function isMovie() {
return /^\/movies?\//.test(window.location.pathname);
}
function isShow(... | true |
d09516bcb01061ca3fef396345740d5a15d00f7f | JavaScript | carl-rasmus/cackaa | /js/socket.js | UTF-8 | 955 | 2.703125 | 3 | [] | no_license | // $(function () {
// var socket = io();
// $('#lid').click(function(e){
// socket.emit('chat message');
// });
// socket.on('chat message', function(msg){
// $('#lid').toggleClass('lid-rotate');
// $('.birdSound').trigger("play");
// });
// });
$(function () {
var socket = io();
$('#lid').cl... | true |
0a06a48771bcb7f7a9ed110f1ff35895b0aa98ca | JavaScript | Colinkai/JS_FIP_CN | /curriculum/Js/script.js | UTF-8 | 836 | 2.671875 | 3 | [] | no_license | "use strict";
const styles = {
border: "0",
cellpadding: "0",
cellspacing: "0",
id: "table-data-wrap",
};
// const divDom = $("table-data-wrap");
const divDom = window.Colin.$("table-data-wrap");
const tableDome = window.Colin.createEl("table"); //creatElement 创建dom对象
tableDome.width = "100%"; //setAttribute 设置... | true |
e00b5ef5ec67f411f994979c63b36db06e2d92f3 | JavaScript | makkoli/wiki_viewer | /wiki.js | UTF-8 | 1,090 | 3.203125 | 3 | [] | no_license | $(document).ready(function() {
// Begin search for new item
$("#container").on('click', '.search', function() {
getWikiPages();
});
});
// Grabs the first 8 wikipedia titles and summaries using wikipedia api
// @term: term to search wikipedia for
function getWikiPages(term) {
// Get the results from the se... | true |
c1f353853ebe661597d9bede2e7dc221f056d1b0 | JavaScript | AndreyChernykh/redux-presentation-examples-2018-06-14 | /src/example7/App.js | UTF-8 | 895 | 2.703125 | 3 | [] | no_license | import React, { Component, PureComponent } from 'react';
import './../App.css';
const SubChild = ({ name }) => (
<div>|______<b>{name}</b></div>
);
const Child = ({ name }) => (
<div>
|__ Child
<SubChild name={name} />
</div>
);
const SubChildWithAction = ({ changeName }) => (
<div>
|______<butto... | true |
1e735b1c8df21efcfc7f4bdf8abf090bb0f6051f | JavaScript | steveamorris/gt-bootcamp-connect | /public/js/dashboard.js | UTF-8 | 224 | 2.578125 | 3 | [
"MIT"
] | permissive | $(document).ready(function () {
$(".catBtn").on("click", function () {
console.log($(this));
let catId = $(this).data("value");
console.log(catId);
window.location.replace("/dashboard/" + catId)
});
});
| true |
36e7401cb5887f3b66c02573d7fcc78512d1f706 | JavaScript | luismigeek/bootcamp | /js/main.js | UTF-8 | 1,939 | 3.578125 | 4 | [
"MIT"
] | permissive | function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
var efect = "tada";
var gift = document.getElementById('gift');
var preload = document.getElementById('preload');
var loading = document.getElementById('loading');
var code = document.getElementById('code');
var fullname = d... | true |
fab12a187ea6f26b7f35b609abc786302cc2edc5 | JavaScript | TomDiaz/GameT-shirts | /js/main.js | UTF-8 | 9,895 | 2.578125 | 3 | [] | no_license | //Variables
var canvas, cx, objetos, objetoActual, barra, pos ;
var incioX = 0, incioY = 0, cont=0;
var ropa = new Image();
var caja = new Image();
var conRemeras = 0, remeras, total, sumar = false, color=1, r=0, id=1;
var rojo = new Image();
var naranja = new Image();
var amarillo = new Image();
var verde = ne... | true |
fc816ae647444a2c83dd62ec511718c42cd857b3 | JavaScript | fcordon/elans2019 | /client/src/components/Top.js | UTF-8 | 10,396 | 2.59375 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import axios from 'axios'
import { Row, Col, Card, Table } from 'react-bootstrap'
const Top = () => {
const [pointeurs, setPointeurs] = useState([])
useEffect(() => {
let isSubscribed = true
getJoueur()
.then(res => {
let joueurTabl... | true |
8dea24686aaaf6cf9946452e130def352b2ccc85 | JavaScript | Enirate/unit-test-101 | /age-guard.test.js | UTF-8 | 411 | 2.875 | 3 | [] | no_license | const ageGuard = require('./age-guard');
it('There should be function named ageGuard', () => {
expect(ageGuard).toBeDefined();
});
it('Persons under 18 should not be granted access', () => {
expect(ageGuard(14)).toBe('You are not old enough to access this site');
});
it('Persons 18 and above should be granted ac... | true |
ce1f282b5b06ded8ece430d2bddd8b53aeb23d0c | JavaScript | hhernan83/Hernans-repo | /07_Node/SuperProject/App.js | UTF-8 | 445 | 3.1875 | 3 | [] | no_license | var marvel = require('marvel-characters')
console.log(marvel())
console.log(`# of characters in the db: `+marvel.characters.length)
let names = marvel.characters.filter(function(el){
return el.substring(0,3) == "Man"
})
console.log(names)
let IronMan = marvel.characters.filter(el=>{
return el == "... | true |
0dfad7f8a5189a8e7f213b551650ed8c63c223e5 | JavaScript | landonbar/muta | /src/pathResolver.js | UTF-8 | 965 | 2.828125 | 3 | [] | no_license |
// the PathResolver is a namespace that uses a browser hack to generate an
// absolute path from a url string -- using an anchor tag's href.
// it combines the aliasMap with a file and possible base directory.
const PathResolver = {};
const ANCHOR = document.createElement('a');
PathResolver.resolveFile = function ... | true |
308fcf4490edba61bc9f6732510d399a950ce21c | JavaScript | rlong/javascript.lib.dinky_require | /dinkyRequire.js | UTF-8 | 3,644 | 2.640625 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2017 Richard Long
//
// Released under the MIT license ( http://opensource.org/licenses/MIT )
//
"use strict";
var microRequireModules = {};
{
var loadResource = function( path, callback, errorCallback ) {
var xhr = new XMLHttpRequest();
var finished = false;
xhr.onabo... | true |
5f54739fbb20393801a634a6f42369f1455b1a3f | JavaScript | Hugovarellaa/verificador-de-idade | /app.js | UTF-8 | 1,805 | 3.515625 | 4 | [] | no_license |
const button = document.querySelector('button');
button.addEventListener('click', () => {
const data = new Date();
const anoAtual = data.getFullYear()
const ano = document.querySelector('input#txtano').value;
const hoje = Number(anoAtual) - Number(ano)
const sexo = document.getElementsByName('rad... | true |
a1be1505f57d90778b773c69daed8aab9eafcdb7 | JavaScript | VOXearch/Grow-IoT | /tests/test-grow-hub.js | UTF-8 | 6,157 | 2.5625 | 3 | [
"BSD-2-Clause-Views",
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | const Thing = require('Grow.js');
var inquirer = require('inquirer');
var _ = require('underscore')
const growfile = require('./tomato.js')
var args = process.argv.slice(2);
var uuid = args[0];
var token = args[1];
var questions = [
{
type: 'input',
name: 'uuid',
message: 'Enter device UUID (you are giv... | true |
5f4f9b1ab3743f11acda465fa1261aa2b4549b9f | JavaScript | alexpower1/man-utd | /src/components/Pages/OldTrafford/OldTrafford.js | UTF-8 | 2,332 | 2.984375 | 3 | [] | no_license | import React, { Component } from "react";
import Spinner from "../../Layout/Spinner/Spinner";
class OldTrafford extends Component {
state = {
latitude: null,
longitude: null,
distance: "00.00KM",
errorMessage: "",
calculated: false
};
componentDidMount() {
// On mount, use Geolocate API ... | true |
a93bb1ab2f187e54f8f2ed265361d1fee869ca05 | JavaScript | syntax01/music_box | /js/app.js | UTF-8 | 1,917 | 2.9375 | 3 | [] | no_license |
$(document).ready( function() {
const playClass = 'playing';
const playDelay = 300;
var clicks = [];
const keyCodes = [67, 72, 65, 82, 76, 69];
const keyChars = ["c","d","e","f","g","a","b"];
var eKey = 69;
var eFlag = 0;
function playAudio(x) {
let box = document.getEleme... | true |
632637cec3e2673f8d0e16ba92cd3ddd6f9e2636 | JavaScript | ControleVersion/DBM_PORTAL | /painel/public/site/js/regDegust.js | UTF-8 | 618 | 3.03125 | 3 | [
"MIT"
] | permissive | //recuoera o valor do cookie para colocar no input de email
var useremail = document.cookie;
var useremail = useremail.split(';');
var getEmail = getCookie('useremail');
$('#form-register-email').attr('value', getEmail);
function searchStringInArray (str, strArray) {
for (var j=0; j<strArray.length; j++) {... | true |
ea105e38b284d5187d73ae7472cdc4c61507a540 | JavaScript | sveem/Vanilla-JavaScript | /Fundamentals/Strings's letters organizer/sortString.js | UTF-8 | 905 | 5.09375 | 5 | [] | no_license | /*
* Write a JavaScript function sortLetters(string, boolean) that gets as an input a string and a boolean. The function
* sorts all letters in the string in alphabetical order and returns the newly formed string. The sorting is ascending if
* the boolean is true otherwise the sorting is in descending order.
* Note... | true |
68f82c8e4306775df973cc84ff9b26ebae212b79 | JavaScript | jacobmccaskey/ascend-coding-challenge | /functions.js | UTF-8 | 5,991 | 2.890625 | 3 | [] | no_license | const { routes } = require("./data/data");
function findAllRoutes(startPoint, endPoint, startDistance) {
let routeChain = {
totalDistance: startDistance,
start: startPoint,
end: endPoint,
connections: [],
};
if (!routeChain.cache) {
routeChain.cache = [];
}
if (startPoint === endPoint) {... | true |
058cbef916920ec3037cf6b3290e1b8c65880463 | JavaScript | TrueMistake/quizVanillaJs | /script.js | UTF-8 | 2,276 | 3.234375 | 3 | [] | no_license | const quizData = [
{
question: 'How old is Florin',
a: '10',
b: '17',
c: '26',
d: '110',
correct: 'c'
},
{
question: 'What is the most programming language in 2019',
a: 'Java',
b: 'C',
c: 'Python',
d: 'Java... | true |
5431ed2472a772c1cfac5b82c043ab486758e851 | JavaScript | kamilkrol95/JavaScrip-SpaceInvaders | /Alien.js | UTF-8 | 312 | 3.03125 | 3 | [] | no_license | function Alien(x, y) {
this.x = x;
this.y = y;
this.r = 15;
this.dd = false;
this.show = function() {
noStroke();
fill(47,79,79);
ellipse(this.x, this.y, this.r*2, this.r*2);
}
this.dead = function() {
this.x += 1000;
this.dd = true;
}
this.move = function() {
this.y += level*0.3;
}
} | true |
156de92adb6005d9b29585fbf1f73300f3d2b114 | JavaScript | Redoxfox/mysite | /app/static/js/todos/sobre-my.js | UTF-8 | 246 | 2.578125 | 3 | [] | no_license | var sobre_my = document.getElementById('sobre-my');
var titulo_items = document.getElementById('titulo-items');
sobre_my.addEventListener('mouseout', function(e) {
sobre_my.style.background = "white";
titulo_items.background = "white";
}) | true |
b1d8e3faababbe8949bbe7199ce6964761b0064e | JavaScript | JooLuiz/RotaSeguraAPI | /rotasegura/frontend/src/reducers/tipoDenuncias.js | UTF-8 | 708 | 2.59375 | 3 | [] | no_license | import {
GET_TIPO_DENUNCIA,
DELETE_TIPO_DENUNCIA,
ADD_TIPO_DENUNCIA
} from "../actions/types";
const initialState = {
tipoDenuncias: []
};
export default function(state = initialState, action) {
switch (action.type) {
case GET_TIPO_DENUNCIA:
return {
...state,
tipoDenuncias: action... | true |