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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b0709cc97dac3cee04eabf9b6ab3094799d702dd | JavaScript | Th3BrainOfAl3x/pdfjs | /src/internals/core.js | UTF-8 | 13,395 | 2.5625 | 3 | [
"MIT"
] | permissive | // Size in pt of various paper formats
var PDF_VERSION = '1.3';
/**
*Initialize new document object.
*@constructor
*@memberof pdfJS
*@Author Trinh Ho (https://github.com/ineedfat/pdfjs)
*@classdesc Representing a PDF document.
*@param {string|array} [format=letter] Paper format nam... | true |
64252ada96deb7a275c61599a5f8493e686f7b64 | JavaScript | gitter-badger/boldr | /src/shared/components/org.BoldrEditor/temp/header/StyleButton.jsx | UTF-8 | 925 | 2.515625 | 3 | [] | no_license | import React, { Component, PropTypes } from 'react';
import FlatButton from 'material-ui/FlatButton';
/**
* Class representing a control button for styles on the editor
* @extends React.Component
* @prop {boolean} active
* @prop {string} label
* @prop {function} onToggle
* @prop {string} style
*/
class StyleBut... | true |
9f41af4d1328a97b55293b425b33e7d7a03193ea | JavaScript | SepideNik/LMSCF-TS-DAY01-Sepide-Lisa | /challenge/challenge.js | UTF-8 | 2,609 | 3.1875 | 3 | [] | no_license | var lol;
lol = [{
id: 1,
name: "Avocado Pizza",
image: "img/1.jpg",
Decs: "tomato sauce , mozzarella , basil",
star: 5,
price: 12,
Currency: "€"
}, {
id: 2,
name: "Avocado Pizza2",
image: "img/2.jpg",
Decs: "tomato sauce , mozza... | true |
9412f882c89260b1984793ec0021c169b32c2148 | JavaScript | chiafangcheng/chiafangcheng.github.io | /quizzes/3-1/3-1.js | UTF-8 | 718 | 3.4375 | 3 | [] | no_license | var longArray = [78, 12, 5, 6, 19, 67, 1, -56, 10];
//Replace the third and seventh value with 100 and 1000 respectively
//Calculate the product of the first, second and the seventh values
//Divide the last value by the first three values
longArray[2] = 100;
longArray[6] = 1000;
var num1 = longArray[0]*longArray[1... | true |
0d5979d0f120050e43d9e53980ac13b6cade217a | JavaScript | regorodrijl/CajonDesastreRaspberry | /www/www.regorodri.noip.me/public_html/fireBase/js/index.js | UTF-8 | 1,872 | 3.34375 | 3 | [] | no_license | // Fijarse que la ruta de partida ahora es la colección productos:
var firebase=new Firebase('https://regoapp.firebaseIO.com/productos');
var productos={};
// Eventos de lectura sobre Firebase
// https://www.firebase.com/docs/web/guide/retrieving-data.html
/*
Evento: value
The value event is used to read a static ... | true |
3b08712b11fc86ad093acb794538acb1058bcb56 | JavaScript | yangxin1994/farvekonfigurator | /color-modular/color677.js | UTF-8 | 119 | 2.53125 | 3 | [] | no_license | (function() {
// Make the color #677
HTMLElement.prototype.color677 = function() { this.style.color = '#677' }
})() | true |
9649b320b684a05ff4d7efd3602ad26fdef2b906 | JavaScript | henryhhuang/Scarborough-Dining | /frontend/scarborough_dining/src/components/RestaurantVerification/__tests__/index.test.js | UTF-8 | 4,561 | 2.609375 | 3 | [] | no_license | import React from 'react';
import axios from 'axios';
import { render } from '@testing-library/react';
import { shallow } from 'enzyme';
import RestaurantVerification from "../index";
jest.mock('axios');
/**
* Test suite for RestaurantVerification page
*/
describe('<RestaurantVerification />', () => {
let pag... | true |
30b97fd13754b1a1068b83ee846b89d1ac3f935a | JavaScript | sebastianray/docker-exercise | /controllers/user.js | UTF-8 | 4,181 | 2.578125 | 3 | [] | no_license | const { User } = require('../models')
const { decryptPwd } = require('../helpers/bcrypt')
const { tokenGenerator } = require('../helpers/jwt')
const { Op } = require('sequelize')
class UserController {
static async getAllUser(req, res) {
try {
const users = await User.findAll({
... | true |
2a54f74170322142fed1c8e121daebaebccac409 | JavaScript | florcarpanetto/dwfe-online-09 | /sesion 42/src/App.js | UTF-8 | 1,913 | 2.84375 | 3 | [] | no_license | /**
* Dependencies
*/
import React, { useEffect, useState } from 'react';
/**
* Components
*/
import Person from './components/person/Person';
import Button from './components/button/Button';
/**
* Styles
*/
import './App.css';
/**
* Others
*/
import { request } from './utils/requests';
function App() {
const ... | true |
c651c74b391bb62dcecc93e4143548170a7612ab | JavaScript | ChrisSchmidt6/Pacman-Chris-Edition | /map maker/script.js | UTF-8 | 5,043 | 2.890625 | 3 | [] | no_license | var cW = $("#mainCanvas").width();
var cH = $("#mainCanvas").height();
var tW = 32, tH = 32;
var columns = cW / tW, rows = cH / tH;
var tiles = [];
var map = 0;
var originalMap = [[1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0... | true |
192565fd8839441a45e3dbbdb475e15e4101998a | JavaScript | ZakharchynYurii/guess-number | /script.js | UTF-8 | 1,213 | 3.625 | 4 | [] | no_license | let input = document.querySelector('.field');
let alert = document.querySelector('.alert');
document.querySelector('.form-group').addEventListener('submit', (e) => {
let userNumber = +input.value;
let generateNumber = numberGenerator();
if(userNumber <= 0 || userNumber >= 11){
alert.innerH... | true |
2e9eeea53b4dd422a8e1db9d320e4b0115869ebf | JavaScript | roger2000hk/musescore-plugins | /intervals/plugin/intervals.js | UTF-8 | 4,972 | 2.8125 | 3 | [] | no_license | /**
*
* Get a score, or the current score.
*
**/
function getScore(score){
return score || curScore;
}
/**
*
* Loop through the parts of a score and let a callback handle each part.
*
**/
function forEachPart(callback, score){
score = getScore(score);
if (typeof(score) === "undefined") return;
var numParts = s... | true |
21ec400d49aa4ec0c370b8f8e6fab403938885c6 | JavaScript | puneet166/Frontend-with-React | /src/components/Login.js | UTF-8 | 3,558 | 2.625 | 3 | [] | no_license | import React, { useEffect } from 'react'
import {useState} from 'react' // props is unmutable so import usestate its use for declare variable and later update that particular variable
import APIService from '../APIService';
import {useCookies} from 'react-cookie';// import cookies for user token jissai baar baar login ... | true |
f1580984d3455c8b7531e6208472b720d0379a50 | JavaScript | BuildForSDGCohort2/Team-956-easy-manager-backend | /app/controllers/teamController.js | UTF-8 | 3,169 | 2.578125 | 3 | [] | no_license | //app/controller/adminController.js
const Team = require('../models/teamModel.js');
const helpers = require('../helpers/validation');
const message = require('../helpers/status');'../helpers/status';
/**
* Create A Admin
* @param {object} req
* @param {object} res
* @returns {object} reflection object
... | true |
6bd65be16e254104a6f93ae3736468a0b068b111 | JavaScript | mnaglic7/zadatak-vue-2018-11 | /js/script.js | UTF-8 | 2,493 | 2.640625 | 3 | [] | no_license | var vm = new Vue({
el: '#search',
data:{
status:[]
},
methods:{
delJoke(index){
this.$delete(this.status, index);
},
searchJokes: function(item) {
this.status = 'Loading...';
var vm = this;
... | true |
059f196941d11de3133c7cb8e6dfe3a90b8deb47 | JavaScript | adiathasan/now.com-Quiz | /pages/api/login.js | UTF-8 | 468 | 2.546875 | 3 | [] | no_license | import { sign } from 'jsonwebtoken';
// fake login ***https://reqres.in/api/login was not responding !
export default ({ body }, res) => {
const { email, password } = JSON.parse(body);
if (email.trim() === '' && password.trim() === '') {
res.statusCode = 401;
res.json({ error: 'Invalid email or password'... | true |
7115e6054969b7c8d84b99eecf0365a2a7b4f2dc | JavaScript | cyngonzalezabero/jap | /js/products.js | UTF-8 | 1,287 | 2.90625 | 3 | [] | no_license | //hacer peticion
async function mostrarProductos() {
let promesa = await getJSONData(PRODUCTS_URL)
let productos = promesa.data
productos.forEach(producto => {
let contenedor = document.getElementById("listado-productos")
contenedor.innerHTML += `
<a href="product-info.html" class="list-group-i... | true |
facd66f5cd5f412138b6e4b91efac019f208a975 | JavaScript | Thomas-Chabot/ods_web_design | /h5p_server/lib/assets/exercise/modules/BinaryTree.js | UTF-8 | 3,313 | 3.6875 | 4 | [
"MIT"
] | permissive | var BinaryTree = require("./BinaryTree/BinaryTree.js");
const ADD = 'add';
const REM = 'rem';
const SET = 'set';
// some values for adding, removing, setting for use with the getRandOp
const ADD_OP = 1;
const REM_OP = 0;
const SET_OP = 2;
const NUM_OPS = 20;
// random chances of getting each operation ...
const OPS... | true |
6de7f990774a699955d3643de4976e5e91773a4e | JavaScript | efratChen/final-project | /client/src/store/reducers/list.js | UTF-8 | 1,142 | 2.546875 | 3 | [] | no_license | import * as at from "../actionTypes";
const initalState = {
user: [],
}
export const TodoReducer = (state = { todoList: [] }, action) => {
switch (action.type) {
//filter- check if to put it here :
case at.ALL_FILTER:
// return { todoList: [todoList, action.payload] }
case a... | true |
e4ffdfedc58089355f5eeef4bdb33b00db5e781b | JavaScript | jschwantz/js-deli-counter-js-apply-000 | /index.js | UTF-8 | 1,353 | 3.609375 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | function takeANumber(curline, person) {
// add the new person to the end of the line
curline.push(person);
// have already added the person, so can just use the length
return 'Welcome, ' + person + '. You are number '+curline.length + ' in line.';
}
function nowServing(katzDeliLine) {
// return app... | true |
d21bcfc1d6f6ad0be257f5138a81bfd5f674a210 | JavaScript | osirislab/CSAW-CTF-Anubis-2020 | /web/src/useGet.jsx | UTF-8 | 863 | 2.5625 | 3 | [] | no_license | import {useState} from "react";
import axios from 'axios';
/**
* loading, error, data
* @param path
* @param params
*/
export default function useGet(path, params) {
const [state, setState] = useState({
loading: true, error: null, data: null
});
if (!params) params = {};
if (!state.loading) return sta... | true |
c33d7f352e196ec6834d684e2dbb0a74a74f0c4d | JavaScript | knasirov/2048 | /lib/game.js | UTF-8 | 5,426 | 3.0625 | 3 | [] | no_license | const Tile = require('./tile.js');
class Game {
constructor() {
this.restart();
this.generateRandomTile = this.generateRandomTile.bind(this);
this.restart = this.restart.bind(this);
this.moveMade = false;
}
restart() {
$(".tile").each(function() { $(this).remove(); });
$(".game-over").re... | true |
24f7b10fe1dc23dedc94818cb3e593ec0adb0dc4 | JavaScript | CSKingMartin/project-minotaur | /src/molecules/Editor/Toggle.jsx | UTF-8 | 2,762 | 2.53125 | 3 | [
"MIT"
] | permissive | import React from 'react';
import PropTypes from 'prop-types';
import StatefulContext from 'react-stateful-context';
import EditorWrapper from './EditorWrapper';
// Toggle Editor
class ToggleEditor extends React.Component {
constructor(props) {
super(props);
this.initialValue = props.context[props.name] || p... | true |
fe2cd3ce6524191f0106b86d05adac767a72f71b | JavaScript | platiagro/web-ui | /src/utils/Generic.utils.js | UTF-8 | 6,375 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | import { notification } from 'antd';
import { formatTensorValues } from './Results.utils';
/**
* Get the error message
*
* @param {Error} error error
* @returns {string} error message
*/
export const getErrorMessage = (error) => {
return error.response?.data?.message || error.message;
};
/**
* Sleep method
... | true |
ce81909e05cf6bb8ff497e5d93b31a664bb105c8 | JavaScript | phuje/InfoVisProject | /bubbleChart.js | UTF-8 | 7,483 | 2.53125 | 3 | [] | no_license | var margin = { top: 10, right: 10, bottom: 10, left: 10 },
width = document.getElementById("bubbleChart").offsetWidth - margin.left - margin.right,
height = 380//600/*window.innerHeight*/ ,
sizeDivisor = 50,
nodePadding = 2.5;
var svgBubble = d3
.select("#datavis")
.append("svg")
.attr("width", "100%")
.... | true |
9c9ad2c134aa4853909b80149cb396f66ee6ed6a | JavaScript | Zloy-Ashot/JVP-Layout-Maker | /js/JVP-Layout-Maker/tabs.js | UTF-8 | 1,150 | 2.828125 | 3 | [] | no_license | function Tab(tabset, tabHead, tabContent){
var tab = this
, tabs = tabset.tabs;
tab.unselect = function(){
tabHead.classList.remove('selected');
tabContent.style.display = 'none';
}
tab.select = function(){
tabset.currentTab.unselect();
tabset.currentTab = tab;
tabHead.classList.add('se... | true |
c018bcc2e273521de58106350e34b961cc451693 | JavaScript | Zac1164/learnMaze | /js/actions.js | UTF-8 | 1,735 | 3.765625 | 4 | [
"MIT"
] | permissive |
var numMoves = 0;
/**
* Move character
* @param {string} direction Direction to move
*/
function move(direction){
if(!isWall(direction) && !renderer.game.isDead() && !renderer.game.isComplete()){
renderer.game.move(direction,numMoves);
renderer.render();
numMoves++;
}
}
/**
* Check whether an ad... | true |
06df084c384831e0cdf4a7caf81178e164ffc5b0 | JavaScript | sherlock78/sherlock78 | /DesignWeb/untitled2/pos,neg.js | UTF-8 | 83 | 2.71875 | 3 | [] | no_license |
var i =1;
for(i = 1; i <= 15; i++){
document.write("yeeeeeeet!!! <br>");
}
| true |
709c174f77af4fdde80facec250bc378f2fd1911 | JavaScript | HridayPalash/es6-practice | /template.js | UTF-8 | 351 | 3.609375 | 4 | [] | no_license | const firstName = 'Justin';
const lastName = 'Timberlake';
// const fullName = firstName + lastName + "is a good boy";
const fullName2 = `${firstName} ${lastName} ${20+30+50+60} is a good boy`;
console.log(fullName2);
const multipleLine = `My name is Hriday.
My home district is Barisal.
My favourite hobby is programmin... | true |
d833ae153b32dde7fc60d112ca0241082decd631 | JavaScript | FakiTayran/FoodOrderApp-With-React | /src/context/BasketProvider.js | UTF-8 | 2,679 | 2.71875 | 3 | [] | no_license | import React,{useReducer} from 'react';
import BasketContext from './basket-context';
const defaultBasketState = {
items: [],
totalAmount:0
};
const basketReducer = (state,action) => {
switch (action.type) {
case 'ADD-ITEM':
const updatedTotalAmount = state.totalAmount + action.payload... | true |
0aa3b827b218e93d930872971f5f6f53a4c77c66 | JavaScript | loveAlakazam/prj_2020 | /sparta08/0614/homework/myShop/static/animation.js | UTF-8 | 4,823 | 3.03125 | 3 | [] | no_license | // 화면 html파일이 로딩 시작되자마자 시작하는 함수.
$(document).ready(function () {
$('#list-box').empty(); //주문자 리스트박스를 먼저 없애버리고.
//listing() 함수를 실행한다.
listing();
});
function listing() {
//Get방식
let list = $('#list-box'); //id=list-box 인 프로퍼티를 구한다.
$.ajax({
type: 'GET',
url: '/show/orderer',
... | true |
97ef6c9bfbb6ed40ac7e14e1de5c28bdbac8bc40 | JavaScript | wrainsgaming/CSCI3100-Software-Enigeering-group-project | /CUSS/records.js | UTF-8 | 625 | 2.640625 | 3 | [] | no_license | const {EventEmitter} = require("events");
let instance;
let data = [];
let MAX = 50;
class Records extends EventEmitter {
constructor () {
super();
}
push (msg) {
data.push(msg);
if (data.length > MAX) {
data.splice(0, 1);
}
this.emi... | true |
42aa8566b3cf15d7c9bbde37845c005902ab0e90 | JavaScript | doinbean/angular-gulp | /webapp/partner/js/core/Foundation.js | UTF-8 | 2,254 | 2.515625 | 3 | [] | no_license | /**
* 广播方法封装
*/
(function () {
angular
.module('app.core')
.factory('Foundation', ['$rootScope', '$state', Foundation]);
function Foundation($rootScope, $state) {
return {
on: on,
publish: publish,
go: go,
clone: clone,
goLog... | true |
7f8b891be529f353f456b675058d65634dbe7746 | JavaScript | dat2/pixi-tiledmap | /src/ImageLayer.js | UTF-8 | 582 | 2.5625 | 3 | [
"MIT"
] | permissive | var ImageLayer = function ( layer , route ) {
PIXI.Container.call( this );
for ( var property in layer ) {
if ( layer.hasOwnProperty( property ) ) {
this[ property ] = layer[ property ];
}
}
this.alpha = parseFloat( layer.opacity );
if (layer.image && layer.image.source) {
var sprite = new PIXI.Sprite.... | true |
9cf54ac10537a38b27589cd3a0ee48e2e28ee910 | JavaScript | jessiedeleon/airplane | /airplane 1942/dist/assets/js/main.js | UTF-8 | 5,165 | 2.828125 | 3 | [] | no_license | "use strict";
let new_player;
let startPlay;
window.onload = function () {
class PlaySettings {
playSettings(element_id, tile, index, action, classname) {
if (action == "add") {
document.getElementById(element_id).children[tile].children[index].classList.add(classname);
... | true |
4a48d40931a86b0054f452bbbc744ebc1414cb61 | JavaScript | risticd/Bugtracker-React-Redux | /frontend/src/app/lib/i18n.js | UTF-8 | 1,178 | 2.53125 | 3 | [
"MIT"
] | permissive | /*
===============================================================================
The i18n File contains all the translation of static text across the app
How to use it?
---------------
Add an import statement with reference to this file
- import I18n from 'filepath/i18n'
Now instead of putting text directly add th... | true |
a76099abc016a746d84244e9e4232cdbe205be97 | JavaScript | CristianBrazales/Rental_Finder | /BackEnd/BackEnd/helperFunctions/validator.js | UTF-8 | 1,249 | 2.6875 | 3 | [] | no_license | //module declarations
var express = require("express");
var router = express.Router();
var User = require("../database/users");
var passport = require("passport");
var postcode = require('postcode-validator');
module.exports = {
//this functi... | true |
12913301d426deaa2e7b9e56357ffc1530ccbb25 | JavaScript | phani-rajbn/NichiInTraining_latest | /HTML Training/Scripts/Arrays.js | UTF-8 | 1,048 | 4.15625 | 4 | [] | no_license | //Arrays.js
//What is an Array? An Array is a collection of similar types of data which is represented as a single unit...
//A unit could be a combination of different data types which is called as object...
var emp = function(id, name, address){
this.empID = id;
this.empName = name;
this.empAddress = address;
}//cr... | true |
c890b447196cbb7b041b286fb1374c77ab29afe6 | JavaScript | la-studio/Cabinet-Schmidt | /resources/assets/js/admin-script.js | UTF-8 | 3,103 | 2.609375 | 3 | [] | no_license | //character module
$(function(){$.fn.clearTextLimit=function(){return this.each(function(){this.onkeydown=this.onkeyup=null;});};$.fn.textLimit=function(limit,callback){if(typeof callback!=='function')var callback=function(){};return this.each(function(){this.limit=limit;this.callback=callback;this.onkeydown=this.onkey... | true |
d73ea09339890e88b66a638414e4f3bc8a04cc38 | JavaScript | ihgSherryLee/leetcode | /Algorithms/javascript/longestConsecutive.js | UTF-8 | 1,050 | 3.671875 | 4 | [] | no_license | /**
*Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
*
*For example,
*Given [100, 4, 200, 1, 3, 2],
*The longest consecutive elements sequence is [1, 2, 3, 4]. Return its length: 4.
*
*Your algorithm should run in O(n) complexity.
*
*Subscribe to see which companies as... | true |
cae5ae9ea8b87807d4df29a609b4f51752074856 | JavaScript | TheRealKevBot/LongestWord | /index.js | UTF-8 | 1,737 | 4.1875 | 4 | [] | no_license | /*
* Return the length of the longest word in the provided sentence.
* ReturnYour response should be a number.
*/
function findLongestWordLength(str) {
let strArray = str.split(' ')
let bigWord = strArray[1]
strArray.forEach(word => {
if (word.length >= bigWord.length) {
bigWord = w... | true |
95c775dc6255fc448ae9da578550b195f8d473db | JavaScript | vlatk/Chelik | /commands/unban.js | UTF-8 | 2,449 | 2.71875 | 3 | [] | no_license | const Discord = require("discord.js");
exports.name = "unban";
exports.guildonly = true;
exports.run = async (robot, mess, args)=>{
if(!mess.guild) return mess.reply({embeds: [new Discord.MessageEmbed({title: 'Ошибка!', description: 'Эта команда недоступна в лс!'}).setThumbnail('https://cdn.discordapp.com/emojis/... | true |
65551807fab7693046f6af6b86c45b6ab771a7b1 | JavaScript | Salamandery/Painel_Civi | /sml/resources/js/oclock.js | UTF-8 | 684 | 3.171875 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
moveRelogio();
});
function moveRelogio() {
momentoAtual = new Date();
hora = momentoAtual.getHours();
minuto = momentoAtual.getMinutes();
segundo = momentoAtual.getSeconds();
str_segundo = new String (segundo);
if (str_segundo.length == 1)
segundo... | true |
f35651332fdaec7786d3f98e99aa59b2e85c427d | JavaScript | lizvoila/anki-online-dict-helper | /src/bg/js/ankiconnect.js | UTF-8 | 1,494 | 2.515625 | 3 | [
"MIT"
] | permissive | class Ankiconnect {
constructor() {
this.options = null;
}
setOptions(options) {
this.options = options;
}
createNote(note) {
let options = this.options;
let ankinote = {
deckName: options.deckname,
modelName: options.typename,
fi... | true |
d5d192bd5983da31c52f0d0d2de8ee1302d2cdfc | JavaScript | cernst11/solais-web | /src/libs/ColorHelper.js | UTF-8 | 1,163 | 2.953125 | 3 | [
"MIT"
] | permissive | /* eslint-disable */
export default new class ColorHelper {
HSVtoHEX(h, s, v) {
let r, g, b, i, f, p, q, t;
i = Math.floor(h * 6);
f = h * 6 - i;
p = v * (1 - s);
q = v * (1 - f * s);
t = v * (1 - (1 - f) * s);
switch (i % 6) {
case 0:
... | true |
02de06c61641518469a23ada97c4db809ff021ba | JavaScript | pap7tomek/task1 | /pages/modal.js | UTF-8 | 1,653 | 2.515625 | 3 | [] | no_license | import styles from './css/modal.module.css'
import Link from 'next/link'
import React, { useState } from 'react';
import _ from 'lodash'
async function fetchMachines(value ,setMachines) {
fetch(`/api/products?query=${value}`)
.then(response => response.json())
.then(data => {
if(_.isEmpty(value)... | true |
6a6d592986bdf8799ddacf240deb7145a04c2439 | JavaScript | batshn/facebook-lite | /asset/myjs.js | UTF-8 | 8,626 | 2.703125 | 3 | [] | no_license |
$(document).ready(function(){
populatePost();
/*********** fetching all posts******************/
function populatePost()
{
var action="select";
$.ajax({
url: "post/posts.php",
method: "POST",
data:{action:action},
success:function(data){
$('#txtNewPost').val('');
$('#action').text("Post");
... | true |
f8f40b860c5d67e32abe345137c5fb5fb6e50b55 | JavaScript | Cleancookie/quiz | /services/SocketService.js | UTF-8 | 3,563 | 3 | 3 | [] | no_license | const socketio = require('socket.io');
const {
uniqueNamesGenerator,
adjectives,
animals,
} = require('unique-names-generator');
const getRandomEmoji = require('./functions/getRandomEmoji');
const io = socketio();
let state = {
players: {},
background: null,
blindfold: false,
};
let playerArc... | true |
8c07af1ed2f02f462495f83fe243fcd4e96f8066 | JavaScript | pravallikac/React-CRUD-App | /src/App.js | UTF-8 | 1,957 | 2.71875 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import AddItem from './AddItem';
import ProductItem from './product-item';
const products=[
{
name:'iPad',
price:200
},
{
name:'Iphone',
price:650
}
]
localStorage.setItem('products',JSON.stringify(products));
class App extends Compon... | true |
cd36b334da08c6b11afc416aecb7a8af12b6f40a | JavaScript | rklabs/noms | /js/src/browser/bytes.js | UTF-8 | 3,184 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | // @flow
// Copyright 2016 Attic Labs, Inc. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
import {TextEncoder, TextDecoder} from './text-encoding.js';
import {SHA512} from 'asmcrypto.js-sha512';
const decoder = new TextDecoder();
const encoder =... | true |
5f6d35fa9fa0f5035e6dc88ea97933d701409592 | JavaScript | james-priest/node_samples | /hello_world/b-querystring.js | UTF-8 | 561 | 2.78125 | 3 | [] | no_license | var http = require( 'http' );
var url = require( 'url' );
var port = 8080;
http.createServer( function( request, response ) {
var url_parts = url.parse( request.url, true );
console.log( url_parts );
var name = url_parts.query.name;
response.writeHead( 200, { 'content-type': 'text/plain' } );
res... | true |
643875cd028739d1d555d7ef6a54397e7da4dcc8 | JavaScript | akshpnwr/Clock-JavaScript | /script.js | UTF-8 | 905 | 3.53125 | 4 | [] | no_license | const hourHand = document.querySelector(".hour");
const minuteHand = document.querySelector(".minute");
const secondHand = document.querySelector(".second");
let secDeg;
let minuteDeg;
let hourDeg;
const init = function () {
const now = new Date();
const hour = now.getHours();
const minute = now.getMinutes();
... | true |
247058b05a49b0110116811cc2352b0520f562b7 | JavaScript | ayelet/React-Exercises | /hello/src/Components/Ex17_1_Mock_API/NewAuthor.jsx | UTF-8 | 2,210 | 2.796875 | 3 | [] | no_license | import React, { Component } from "react";
class NewAuthor extends Component {
constructor(props) {
super(props);
this.state = { error: "", isValidName: false, isValidUrl: false };
}
handleChange = (e) => {
console.log(e.target.type, e.target.value);
this.setState({ error: "" });
if (e.target... | true |
5f83f14364456018bb0b3aa415c3d3491c417904 | JavaScript | JS-0-beginner/more-problem-solving | /count.js | UTF-8 | 1,251 | 4.125 | 4 | [] | no_license | /// node count.js \\\
/*
Jungle Zoo
10animals/mile in the 1st 10 miles
50animals/mile in the 2nd 10 miles (20miles)
100animals/mile after 20miles and so on..
*/
function animalCounter(miles)
{
const tenAnimals = 10;
const fiftyAnimals = 50;
const hundredAnimals = 100;
if(miles <=10)
{
... | true |
d0ef4a359a6415bb71ef5d11a345c2d14febc0af | JavaScript | moonformeli/leetcode | /easy/valid_anagram.js | UTF-8 | 525 | 3.46875 | 3 | [] | no_license | /**
* https://leetcode.com/problems/valid-anagram/
* https://leetcode.com/submissions/detail/343481242/
*/
var isAnagram = function (s, t) {
if (s.length !== t.length) {
return false;
}
const arrS = new Array(26).fill(0);
const arrT = new Array(26).fill(0);
for (let i = 0; i < s.length; i += 1) {
... | true |
016ec0842bf13767bf1afad66e8f2d0b466f3ee1 | JavaScript | viktorovaleksandr/jQuery_Gallery_Request | /docs/js/task.js | UTF-8 | 1,273 | 3.109375 | 3 | [] | no_license | const $containerGalleryAlbums = $('.js-gallery-albums');
const $containerGalleryPhotos = $('.js-gallery-photo');
// REQUEST
function sendGetAlbumsRequest() {
return fetch('https://jsonplaceholder.typicode.com/albums').then((response) => response.json())
.then((albums) => {
renderAlbums(albums);
sendGetPhotosR... | true |
ba994c59230a62109fcad3227ef58299a80d6d7f | JavaScript | Suvratha/learn-vuejs | /Recap/basics-assignment-4-problem/app.js | UTF-8 | 953 | 2.71875 | 3 | [] | no_license | const app = Vue.createApp({
data(){
return {
user1Entered: false,
user2Entered: false,
visible: true,
inputColor : ''
};
},
methods: {
selectedUser(input){
if(input.target.value === 'user1'){
this.user1Entere... | true |
371f31054617ad48cabe49b7f9875cb1dc11a2ea | JavaScript | Javran/leetcode | /serialize-and-deserialize-binary-tree/solution.js | UTF-8 | 2,829 | 4.09375 | 4 | [
"MIT"
] | permissive | /**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
function TreeNode(val) {
this.val = val;
this.left = this.right = null;
}
/*
encoding: let's invent a stack-based binary tree building language:
- <num>: push a number ... | true |
fd996398b375ed97d614aae0616e874cde2d55da | JavaScript | chirgwin/bayareastripmalleateries | /js/app.js | UTF-8 | 12,414 | 2.625 | 3 | [] | no_license | var ViewModel = function() {
// pointer to outer this
var self = this;
// FIXME:
$.ajaxSetup({
async: false
});
$.getJSON("https://sheetsu.com/apis/v1.0su/f7360390fc37", function(data) {
locations = data;
// Now use this data to update your view models,
// and Kno... | true |
24169947812397b0e6aed96400e611abfb08e475 | JavaScript | AdriJAVA/discos | /main.js | UTF-8 | 1,914 | 3.140625 | 3 | [] | no_license | var app = (function(){
var lista = [];
var listaDOM = document.getElementsByTagName('option');
var encontrarDisco = function(idElegido){
var elegido = document.getElementById('lista').selectedIndex;
var idElegido = listaDOM[elegido].id;
for(var i = 0; i < lista.length... | true |
6550596e21a08cf6e05a8cdb1efeaa275a1050d7 | JavaScript | emiljohansson/understreck | /test/startCase.js | UTF-8 | 640 | 2.65625 | 3 | [
"MIT"
] | permissive | import test from 'ava'
import startCase from '../src/startCase'
test('falsy', t => {
t.is(startCase(''), '')
t.is(startCase(), '')
t.is(startCase(null), '')
t.is(startCase(' '), '')
})
test('upper case first character', t => {
t.is(startCase('--foo-bar--'), 'Foo Bar')
t.is(startCase('fooBar'), 'Foo ... | true |
d1e479e9a312e3f054df0cee367853608571828d | JavaScript | lullabyjune/leetcode | /array/generateMatrix-59.js | UTF-8 | 1,287 | 3.640625 | 4 | [] | no_license | /**
* @param {number} n
* @return {number[][]}
*/
var generateMatrix = function(n) {
// 话说突然想起来这种矩阵的题,其实我好像一直都不太会做- -...
// 追根溯源想到高中立体几何也很捞比...嘛....
// 蛋疼...
if (n === 1) return [[1]];
let matrix = [];
let currentValue = 1;
let row = (col = top = left = 0);
let bottom = (right = n - 1);
let max... | true |
cf153e34376f50d47290377fd117b351baa22b36 | JavaScript | newbabyfly/fs-gallery | /src/routes.js | UTF-8 | 2,736 | 2.609375 | 3 | [] | no_license | // src/routes/index.js
const router = require('express').Router();
const mongoose = require('mongoose');
// Get Most recent images
router.get('/image', function(req, res, next) {
const Image = mongoose.model('Image');
Image.find({deleted: {$ne: true}}).sort({created_at: 'desc'})/*.limit(6)*/.exec( function(err,... | true |
e249b5f2b690020d3b695a3c86f7a70a53eefdf6 | JavaScript | viewstools/demo | /web/src/cities/index.js | UTF-8 | 2,022 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | import * as cities from './cities.js'
import geolib from 'geolib'
const sortAlphabetically = (a, b) => (a < b ? -1 : a === b ? 0 : 1)
const byAddress = (a, b) => sortAlphabetically(a.address, b.address)
const byDistance = (a, b) => a.distance - b.distance
const byName = (a, b) => sortAlphabetically(a.name, b.name)
ex... | true |
1fec18b697f36c2f1311909a707ced238bb0f8ad | JavaScript | Software-Engineering-Final-Project/articleRecommender | /src/Components/Modals/starred_topic_modal.js | UTF-8 | 4,231 | 2.796875 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import CategoryComponent from '../category_view'
/** A Modal to display all images Requires the following props:
* @param { boolean } showModal: True if the modal should be displayed
* @param { string } modalTitle: The title of the modal
* @param { callback } clos... | true |
6457831322115a0fed9f0d90fdedb41de97ae1c1 | JavaScript | cainiac/jxml | /packages/component/base.js | UTF-8 | 10,664 | 2.53125 | 3 | [] | no_license | $(function() {
// Constructor
var c = JXML.define('component.base', Class.extend({
/**
* Initialize the component
* @param Object jQuery DOM Selector result
* @param Object Options
* @return Boolean
*/
initialize: function(dom, options) {
this.options = {
loading: fals... | true |
cd73c3421624414b684decfaaba46fb0e401e217 | JavaScript | bahromjon1993/Converter | /app.js | UTF-8 | 504 | 2.765625 | 3 | [] | no_license | let convert=0;
document.getElementById('currencyInput').addEventListener('input',
function(e){
let convert= e.target.value;
document.getElementById('rublOutput').innerHTML=convert*0.0070;
document.getElementById('euroOutput').innerHTML=convert*0.0001;
document.getElementById('dollorOutput').innerHTML=c... | true |
c77937ea4b3951f932ca1a73b110f01363ee2664 | JavaScript | Los-nonos/Realtime-Node | /client/app/reducers/LoginReducer.js | UTF-8 | 921 | 2.53125 | 3 | [] | no_license | import { actionNames } from "../utils/constants/actionConstants";
const stateDefault = {
loggedIn: false,
userData: {},
error: { errors: {} },
changePasswordModalShow: false
};
const loginReducer = (state = stateDefault, action) => {
switch (action.type) {
case actionNames.loggedIn:
... | true |
df86ffc39e8882a7d358a06abb98b14aa95238cb | JavaScript | OfferShow4531/Opentd | /js/main.js | UTF-8 | 2,798 | 3.046875 | 3 | [
"MIT"
] | permissive | function runOnKeys(func, ...codes) {
let pressed = new Set();
document.addEventListener('keydown', function(event) {
pressed.add(event.code);
for (let code of codes) {
if (!pressed.has(code)) {
return;
}
}
pressed.clear();
func();
});
document.addEventListener('keyu... | true |
a99663a9af5c9f5f9657d3e45bfc85802f3a3598 | JavaScript | kalpitshah72/backend-test | /routes/movie.js | UTF-8 | 1,657 | 3.078125 | 3 | [] | no_license | const express = require("express");
const Movie = require("../models/Movie");
const router = express.Router();
//GETS BACK ALL THE MOVIES
router.get("/", async (req, res) => {
try {
const movies = await Movie.find().populate("genres");
res.json(movies);
} catch (error) {
res.status(500).json({ message:... | true |
31d18ce034ecae3367d50ee32738555060005261 | JavaScript | elijy/learn-redux | /learn-redux/client/reducers/posts.js | UTF-8 | 410 | 3.109375 | 3 | [] | no_license | // We need the empty array for the first time it runs
function posts(state = [], actions) {
switch(actions.type) {
case 'INCREMENT_LIKE':
// Grab a copy of state
let tempState = [...state];
// Add the value back to state
tempState[actions.index].likes++;
// Return state
retur... | true |
4af79081f67b150e5c83402cb94b752ae8cb8ab1 | JavaScript | nbaccus/art-musuem-website | /src/components/contact.js | UTF-8 | 11,077 | 2.671875 | 3 | [] | no_license | import React, {useState, useEffect} from 'react';
import './contact.css';
import check from '../imgs/check.png';
function Contact() {
const [FullName, setName] = useState("");
const [EmailAddress, setEmail] = useState("");
const [PhoneNumbers, setPhone] = useState([]);
const [Message, setMessage] = us... | true |
7f980e0e316cdb97bec306adc1ea0b61cac8087f | JavaScript | msinnes/mike | /packages-core/types/__tests__/Object.spec.js | UTF-8 | 476 | 2.515625 | 3 | [] | no_license | const { isType } = require('@mike/class');
const ObjectType = require('../Object');
describe('ObjectType', () => {
it('should be a type', () => {
expect(ObjectType).toBeDefined();
expect(isType(ObjectType)).toBe(true);
});
it('should return true if the input is a type', () => {
expect(ObjectType.is... | true |
6d12c23f4a53ffe867b4d1f8865bd60bb98f5ce0 | JavaScript | TRINITY-21/REACT-TUTORIALS | /src/component/Message.js | UTF-8 | 491 | 2.578125 | 3 | [] | no_license | import React from 'react'
class Message extends React.Component{
constructor(){
super();
this.state = {
message :'Welcome Tri',
}
this.handleMessage = this.handleMessage.bind(this)
}
handleMessage(){
this.setState({
message:'Thanks for Subscribing'
})
}
render(){
cons... | true |
ee59c27229eba4362d4877bea424e37551f16b94 | JavaScript | pewh/CCC-frontend | /script.js | UTF-8 | 3,466 | 2.546875 | 3 | [] | no_license | var CCC_SETTING = function() {
var defaultServerName = '0.0.0.0';
var defaultPort = '8888';
if ( localStorage ) {
var prevServerName = localStorage.getItem('ccc-server');
var prevPort = localStorage.getItem('ccc-port');
return {
server: prevServerName || default... | true |
acd50e9ec5e138eef07059fb11a78b9e4ed06aff | JavaScript | Lguerra1/simulation-1 | /src/component/form/Form.js | UTF-8 | 1,269 | 2.640625 | 3 | [] | no_license | import React, {Component} from 'react'
export default class Form extends Component {
constructor(){
super()
this.state = {
imgUrl: '',
productName: '',
price: ''
}
}
imgUrlInput(val){
this.setState({
imgUrl: val
... | true |
e229cbba80eb2627ffc8326562e07cae162a25d9 | JavaScript | wangdongcheng/leetcode_practice | /_accepted/0028_implement-strstr.js | UTF-8 | 1,694 | 4.375 | 4 | [] | no_license | // 28. Implement strStr()
// Implement strStr().
// Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
// Example 1:
// Input: haystack = "hello", needle = "ll"
// Output: 2
// Example 2:
// Input: haystack = "aaaaa", needle = "bba"
// Output: -1
// Clarificatio... | true |
2fa437a3a990fa9a5506e8480684a399d8143d03 | JavaScript | enriqueRamirezGal/data_types | /js/index.js | UTF-8 | 3,428 | 3.203125 | 3 | [] | no_license | let marcaAuto = "Mitsubishi"; // Variable con marca de automovil
let edad; // Variable para almacenar la edad
let hacker1 = "Enrique"; // Variable con nombre del conductor
console.log("El nombre del conductor es: " + hacker1); // Imprime el nombre del conductor
let numUno = 38;
let numDos = 14;
console.log(... | true |
cbc3c1b30c2c3c70312acfa9da221ef137c176c5 | JavaScript | jperl/record-screen | /index.js | UTF-8 | 6,792 | 2.734375 | 3 | [
"MIT"
] | permissive | /*
* Screen recording function using ffmpeg.
* Defaults to using x11grab, but also supports other input formats.
*
* Copyright 2019, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
'use strict'
const fs = require('fs')
const util = require('... | true |
8a1d742eef02d4d38379bdf1d23c1b3e0fcec30a | JavaScript | foobarjimmy/Javascript-html-css | /DynamicLabeling.js | UTF-8 | 1,035 | 3.296875 | 3 | [] | no_license | //File for DOM-Malipulation Demo
function insertParagraph(text){
var str = "<p>";
str += text;
str += "<p>";
document.write(str);
}
function insertDiv(){
var divHtml = document.getElementById('testdiv');
divHtml.innerHTML = '<p>This is <em>my</em> content</p>';
}
function createPara(){
para = document.creat... | true |
6e33760acf7ea19fb76c00e99e40408d3e9649c5 | JavaScript | StuckiSimon/js-base | /src/utils/fetch.js | UTF-8 | 1,608 | 2.546875 | 3 | [
"MIT"
] | permissive | /**
* Fetch module.
* @module base/utils/fetch
*/
import fetchJsonP from 'fetch-jsonp'
import { stringifyQuery } from './url'
export let defaultOptions = {
credentials: 'same-origin',
headers: {
http_x_requested_with: 'fetch'
}
}
export let defaultJsonpOptions = {
timeout: 5000,
jsonpCallback: 'call... | true |
f2c2e00248b9ebe166f7931f8b3c3ad832266917 | JavaScript | wingerlang/Eulerproject | /js/problems/21.js | UTF-8 | 823 | 4.09375 | 4 | [] | no_license | /*
Amicable numbers
Problem 21
Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b are called amicable numbers.
For example, the proper divisors of 220 are 1, 2, 4, 5, ... | true |
d5b2c1c4b6d278d2520ab5f0e64e7feaeadb8dc1 | JavaScript | mohaneie/Anram | /Routes/timers.js | UTF-8 | 3,338 | 2.625 | 3 | [
"MIT"
] | permissive | 'use strict';
const {
Punch
} = require('../Models');
function getDateAsYearMonthDate(dateObj) {
const year = dateObj.getFullYear();
const month = dateObj.getMonth();
const date = dateObj.getDate();
return {
year,
month,
date
};
}
module.exports = func... | true |
e889f048e3f94fc98efab62fb624f9b759fc0d43 | JavaScript | fkoerich/jdenticon | /src/renderer/point.js | UTF-8 | 280 | 2.609375 | 3 | [
"MIT"
] | permissive | /**
* Jdenticon
* https://github.com/dmester/jdenticon
* Copyright © Daniel Mester Pirttijärvi
*/
/**
* Represents a point.
*/
export class Point {
/**
* @param {number} x
* @param {number} y
*/
constructor(x, y) {
this.x = x;
this.y = y;
}
}
| true |
1307a13cd0cab3b1c14bee7278203921e365c7c8 | JavaScript | TheQuengineer/interactive_web_dev-notes | /interactive_front_env_dev/ch03/js/object-literal2.js | UTF-8 | 315 | 3.171875 | 3 | [] | no_license | var hotel = {
name: 'Park',
rooms: 120,
booked: 77,
checkAvailability: function() {
return this.rooms - this.booked;
}
};
var eleName = document.getElementById('hotelName');
eleName.textContent = hotel.name;
var eleRooms = document.getElementById('rooms');
eleRooms.textContent = hotel.checkAvailability(); | true |
daee087edb501ca7dab5218c1dbe3c651d4ea005 | JavaScript | Wayne-Bai/AST-normalize | /data/blacktail/real-edit/public_src/scripts/common/utils.js | UTF-8 | 4,665 | 2.625 | 3 | [] | no_license | define([
'lodash'
], function (_) {
return {
loadScript: function (url, cb) {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = url;
document.body.appendChild(script);
script.onload = cb || function () {};
},
merge: function (text, changes... | true |
f1727ad2ad2d2913be34731ebefc653157241e92 | JavaScript | edupb3/js-courses | /desafios-freecodecamp/js-basic/068-menor-igual.js | UTF-8 | 907 | 4.375 | 4 | [] | no_license | /**
* Comparar com o operador menor ou igual
O operador menor ou igual (<=) compara os valores de dois números. Se o número à esquerda for menor ou igual ao número à direita, retornará true. Se o número à esquerda for maior que o número a direita, retornará false. Assim como o operador de igualdade, o operador de meno... | true |
af764b9879a611e1c5afeeffc011d6c437632f04 | JavaScript | Ben987/Bondage-College | /BondageClub/Scripts/Element.js | UTF-8 | 16,875 | 3.140625 | 3 | [] | no_license | "use strict";
/**
* Handles the value of a HTML element. It sets the value of the element when the Value parameter is provided or it returns the value when the parameter is omitted
* @param {string} ID - The id of the element for which we want to get/set the value.
* @param {string} [Value] - The value to give to t... | true |
71f508cb455ee3e103663ed044508ea8c84c84af | JavaScript | daniel-rdnz/galaxy-gen | /gulp/warn-match.js | UTF-8 | 864 | 2.671875 | 3 | [] | no_license | /* eslint no-invalid-this:off */
const assert = require('assert');
const chalk = require('chalk');
const log = require('fancy-log');
const through = require('through2');
// patterns = { 'No eval': /\beval\b/ }
module.exports = function (patterns) {
assert.equal(typeof patterns, 'object');
for (let key in patterns)... | true |
423eab2a1dc23eaf56126d80525ea16c1bb9f649 | JavaScript | Patdlg/bitcoin-brickbreaker | /script.js | UTF-8 | 4,430 | 3.1875 | 3 | [] | no_license | var canvas = document.getElementById('myCanvas');
var ctx = canvas.getContext('2d');
var x = canvas.width/2;
var y = canvas.height - 30;
var dx = 2;
var dy = -2;
var ballRadius = 16;
var paddleHeight = 10;
var paddleWidth= 75;
var paddleX = (canvas.width-paddleHeight)/2;
var rightPressed = false;
var leftPressed = fa... | true |
a59803f2e663a47136cdf0c2847fa889d7521091 | JavaScript | josy1024/josycodeprojects | /itunes/start_itunes_playlist .js | UTF-8 | 2,162 | 2.671875 | 3 | [] | no_license | // SOURCE: http://discussions.apple.com/thread.jspa?threadID=1907539
// ALSO INTERESTING: http://mysite.verizon.net/teridon/itunesscripts/
var PlaylistName="playlist name";
// You do not need to edit below this Line!
var iTunesApp = WScript.CreateObject("iTunes.Application");
var volume=iTunesApp.SoundVolume... | true |
b2a47e5872f3020f47d892538c5bbacade8f88a3 | JavaScript | cfarque/Front-Marvel | /src/Components/SearchBar.js | UTF-8 | 2,620 | 2.734375 | 3 | [] | no_license | import React, { useState } from "react";
import { useParams } from "react-router-dom";
import axios from "axios";
import { useEffect } from "react";
const nbResultByPage = 100;
function SearchBar({
search,
setSearch,
checkBoxComics,
setCheckBoxComics,
checkBoxCharacter,
setCheckBoxCharacter,
setData,
s... | true |
345545d7756c70377f15717675eb69e74d7fdafd | JavaScript | jazcarate/elm-dev-day | /backend/src/palabrasRouter.js | UTF-8 | 473 | 2.8125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var delay = process.env.DELAY || 0
const sample = (array) => array[Math.floor(Math.random() * array.length)]
const palabraRandom = () => sample(["Rascarse", "Panal", "Grabar", "Mundo", "Celda", "Espalda", "Corriente", "Boomerang", "Disparo", "Oliva" ])... | true |
141698b504e808163f1c6e7df8ef6edb4091548d | JavaScript | marykatj/react-karaoke-challenge | /src/containers/KaraokeContainer.js | UTF-8 | 1,593 | 2.671875 | 3 | [] | no_license | import React, { Component } from 'react';
import Filter from '../components/Filter';
import SongList from '../components/SongList';
import KaraokeDisplay from '../components/KaraokeDisplay';
//import songs from '../data/songs';
const songURL = `http://localhost:4000/users/11/songs`
class KaraokeContainer extends Comp... | true |
512cbadaf1c9323a868290888051a52ccde5c35d | JavaScript | tomasperalta613/Proyecto-final | /workstation/app/public/wp-content/themes/twentytwentyone/assets/js/customize-helpers.js | UTF-8 | 1,030 | 3.46875 | 3 | [
"GPL-2.0-or-later",
"GPL-1.0-or-later",
"MIT",
"GPL-2.0-only",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /**
* Get luminance from a HEX color.
*
* @param {string} hex - The hex color.
*
* @return {number} - Returns the luminance, number between 0 and 255.
*/
function twentytwentyoneGetHexLum( hex ) { // jshint ignore:line
var rgb = twentytwentyoneGetRgbFromHex( hex );
return Math.round( ( 0.2126 * rgb.r ) + ( 0.71... | true |
cacaad09bf9165a72972311fdb868aca66b2582b | JavaScript | joe-was-here/nestableColumns | /js/script.js | UTF-8 | 38,349 | 2.578125 | 3 | [] | no_license | 'use strict';
(function () {
var nestedColumns = {
//used to set source of dragging items
dragSrc: {},
//rules for dragging
dragRules: {
//max number of columns allowed
maxGenerations: 3
},
//start a count for new node ids
newNodes: -1,... | true |
fc0e7366c87a1051cc96cbdeeb04b6ab61f22845 | JavaScript | ohmatey/socialQuote | /src/generate-quotes.js | UTF-8 | 1,269 | 2.734375 | 3 | [] | no_license | import sketch from 'sketch/dom'
import UI from 'sketch/ui'
import createQuoteArtboard from './createQuoteArtboard'
const quoteCategories = [
'inspire',
'management',
'sports',
'life',
'funny',
'love',
'art',
'students'
]
const amounts = [1, 3, 6, 9, 12, 15, 30]
export default context => {
context.... | true |
22f9c148cebf30cd4cb588d79b593fc074a56fd2 | JavaScript | RizkyWellyanto/accounting-app | /src/model/Customer.js | UTF-8 | 388 | 2.609375 | 3 | [] | no_license | export class Customer {
constructor(comp_name, f_name, l_name, addr1, addr2, city, state, zip, price){
this.company_name = comp_name;
this.first_name = f_name;
this.last_name = l_name;
this.address1 = addr1;
this.address2 = addr2;
this.city = city;
this.state ... | true |
90a07adf8ff6e73596dcf02d5177a4b4ff57a8e5 | JavaScript | larkinds/hs-js-cartoon-collections-js-cartoon-collections-000 | /index.js | UTF-8 | 1,118 | 3.203125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | function dwarfRollCall(dwarves) {
let empty = ''
for (let i = 0; i < dwarves.length; i++) {
let counter = i + 1
let name = dwarves[i]
empty += `${counter}. ${name} `
}
return empty
}
function summonCaptainPlanet(planeteerCalls) {
let arr = []
let upperArr = []
for (let i = 0; i < planeteer... | true |
6ea92877485cd56922455c9eec89f4a440fd9a90 | JavaScript | pomeo/node-insales | /lib/error.js | UTF-8 | 629 | 2.53125 | 3 | [] | no_license | /**
* Output Request-Promise error, used to create Promise reject
*
* @param {Object} response Required, full response data
* @returns {Object}
* @property {String} type Name of error
* @property {String} url Url where error happen
* @property {String} method Http method
* @property {String} msg Error message
... | true |