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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
caa1fd16e6e0cd10b4b20aa15320218e3332cf2b | JavaScript | roerdinkholder/dndwm | /client/src/core/applyComponentDefaults.js | UTF-8 | 1,027 | 2.890625 | 3 | [] | no_license | // Vendor
import React from 'react';
function shallowEqual(objA, objB) {
if (objA === objB) {
return true;
}
var key;
// Test for A's keys different from B.
for (key in objA) {
if (objA.hasOwnProperty(key) &&
(!objB.hasOwnProperty(key) || objA[key] !== objB[key])) {
... | true |
5f5538f3de18c51954c12e99085f1646bdc16d7a | JavaScript | feida/POS | /pos-server/hotload/load.js | UTF-8 | 2,648 | 2.515625 | 3 | [] | no_license | const path = require('path')
const fs = require('fs-extra')
const request = require('request')
const unzip = require('unzip')
const { log } = require('../app/util/fileUtil')
const appDir = process.cwd()
const packName = 'RestoPlus'
const tmpdir = path.join(appDir, '../tmp')
const unzippath = path.join(tmpdir, packName... | true |
bf61d9890fa07db43d609415c285bad4230a2f7d | JavaScript | uk-gov-mirror/DFE-Digital.login.dfe.profile | /src/app/addOrganisation/search.js | UTF-8 | 2,139 | 2.546875 | 3 | [
"MIT"
] | permissive | const { searchOrganisations, getOrganisationCategories, getOrganisationStates } = require('./../../infrastructure/services');
const fixMultiSelect = (value) => {
if (!value) {
return [];
}
if (value instanceof Array) {
return value;
}
return [value];
};
const doSearch = async (req) => {
const crit... | true |
7037673b1e36597cf2ed7dc6a228c560cfbf6a60 | JavaScript | jokeralive/Weather-Journal-Udacity-Project- | /weather-app/website/app.js | UTF-8 | 3,170 | 3.640625 | 4 | [] | no_license | // Global API Variables
const baseURL = 'https://api.openweathermap.org/data/2.5/weather?zip=';
// My API key that I just created befpre submission wasn't working at the time of submission with error 401 (Your API key is not activated yet. Within the next couple of hours, it will be activated and ready to use.): https... | true |
47173582b8b74e6283eb1e0266d949c238dc8d30 | JavaScript | ONSdigital/eq-questionnaire-runner | /tests/functional/helpers.js | UTF-8 | 2,335 | 2.734375 | 3 | [
"MIT",
"LicenseRef-scancode-proprietary-license"
] | permissive | export const checkItemsInList = async (itemsExpected, listLabel) => {
await $(listLabel(1)).waitForDisplayed();
for (let i = 1; i <= itemsExpected.length; i++) {
await expect(await $(listLabel(i)).getText()).to.equal(itemsExpected[i - 1]);
}
};
export const checkListItemComplete = async (listItemLabel) => {... | true |
29d156d7d803a6c86ea06290277766c088ccc872 | JavaScript | sofiamerenych/home_work | /home_work_3.js | UTF-8 | 8,316 | 4.1875 | 4 | [] | no_license | // 1) Використовуючи оператор "Рівності (==)" порівняйте два значення так, щоб в першому випадку ви отримали "false" а в другому випадку "true".
// * Виведіть результат порівняння в консоль за допомогою "console.log"
let a = 1;
let b = 3;
let c = "1";
let d = true;
a == b;
console.log (a==b);
false
a == c;
console.lo... | true |
e922e1e83ded4e5eb0fa4062962180d51075927d | JavaScript | kjjindal/ubereats-catch-react | /src/Header.js | UTF-8 | 2,878 | 2.5625 | 3 | [] | no_license | // note --- component file name should be Start With capital letter like Header.js not header.js
import React,{useState} from "react";
import "./Header.css";
import { Menu, LocationOn,WatchLater,ArrowDownward } from "@material-ui/icons";
function Header() {
const [headbg,setheadbg]=useState('transparen... | true |
7cd2b4a339f647f906a94dba42e203040d83c43f | JavaScript | irtep/hyFullStack2020palautukset | /osa1/unicafe/src/index.js | UTF-8 | 936 | 2.734375 | 3 | [] | no_license | import React, { useState } from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import { Button, Statistics } from './components.js'
const App = () => {
const [good, setGood] = useState(0)
const [neutral, setNeutral] = useState(0)
const [bad, setBad] = useState(0)
const newGood = () => {
set... | true |
ec7a09f12314416441aff1fec232b3484bbaf9f7 | JavaScript | gre/gl-react | /examples/cookbook-rn-shared/examples/blurxy/index.js | UTF-8 | 1,966 | 2.53125 | 3 | [
"MIT"
] | permissive | //@flow
import React, { Component } from "react";
import { Shaders, Node, GLSL, connectSize } from "gl-react";
import { Surface } from "../../gl-react-implementation";
const shaders = Shaders.create({
blur1D: {
// blur9: from https://github.com/Jam3/glsl-fast-gaussian-blur
frag: GLSL`
precision highp float;
... | true |
83f2eff69eb38fa808b65973e4c18c2d3256b666 | JavaScript | namninja/bee-well-journal | /public/main.js | UTF-8 | 4,466 | 3.140625 | 3 | [] | permissive | 'use strict'
// initialize our Global Variables
const SERVERBASE = "//gentle-chamber-86652.herokuapp.com/";
const LOCAL = 'http://localhost:8080/'
// plotly data variables
const morning = {
x: [],
y: [],
type: 'scatter',
name: 'morning mood'
};
const evening = {
x: [],
y: [],
type: 'scatter',
name: 'e... | true |
2dd130b40bed560d499ab6a08171ff01c60e578f | JavaScript | dthuesen/nodejskurs | /app_old_12.js | UTF-8 | 1,145 | 2.65625 | 3 | [] | no_license | var http = require('http');
var fs = require('fs');
var server = http.createServer(function(req, res) {
if (req.url.indexOf("/public") === 0) {
fs.readFile("." + req.url, {}, function(err, data){
if(err) {
res.writeHead(404, {
"Content-Type": "text/plain"
});
res.end("404 file not found")
} e... | true |
b12d9c937a49e1f6b4ff3ea7c774979ce7aa26a7 | JavaScript | fduch2k/sequelize-virtual-fields | /lib/utils.js | UTF-8 | 846 | 3.484375 | 3 | [
"MIT"
] | permissive | // --------------------
// utility functions
// --------------------
// modules
var _ = require('lodash');
// exports
module.exports = {
// array splice but inserts several elements provided as array, rather than as several arguments
// e.g. _.spliceArray([1,2,3], 1, 1, [8,9]) => [1,8,9,3]
// equivalent to [1,2,3]... | true |
1f280789d62a4fdf186ea09372686054b250c65e | JavaScript | CODEheures/destockeurope | /gulp-sprite.js | UTF-8 | 1,267 | 2.515625 | 3 | [
"MIT"
] | permissive | // ------------------------
// Build SVG symbol sprites
// ------------------------
// Each directory matching assets/icons/sprite-* may contain individual SVG files,
// and will be turned into a SVG symbol spritesheet.
let gulp = require('gulp');
let path = require('path');
let glob = require('glob');
let svgSprite =... | true |
449c1443c0c9d02a1e984d2ec7da9abeb413d883 | JavaScript | carozozo/Closed-OA-package-system | /oa_extend_lib/_apiCaller.js | UTF-8 | 1,939 | 3.015625 | 3 | [] | no_license | /**
* The extend lib for tl.apiCaller
* @author Caro.Huang
*/
tl.apiCaller = (function () {
var self = tl.apiCaller;
/**
* convenience formatting startPage & pageSize
* OPT
* useClone: if use cloned obj for not replacing original obj
* useSimpleKey: obj.startPage => obj.page, obj.pageSiz... | true |
37f219de2b11ccb66899129b4adfb466088a39ca | JavaScript | DerfMongol/indecision-app-react | /src/playground/es6-arrow-function.js | UTF-8 | 807 | 4 | 4 | [] | no_license | const square = function (x) {
return x * x
}
console.log(square(4))
// const squareArrow = (x) => {
// return x * x
// }
const squareArrow = (x) => x * x
console.log(squareArrow(7))
const getFirstName = (fullName) => fullName.split(' ')[0]
console.log(getFirstName('Lee Martin'))
const add = (... | true |
9f74814ec5d9170e173dd43929d89f0d8410306c | JavaScript | Esper06/Team-Profile-Generator | /assets/js/__tests__/Intern.test.js | UTF-8 | 901 | 3.609375 | 4 | [
"MIT"
] | permissive | //first we bring in our intern constructor
const Intern = require('../constructors/intern');
test('creates an Intern object', () => {
const intern = new Intern('Test', 30, 'test@gmail.com', 'testSchool');
//checks that the school data is in string form
expect(intern.school).toEqual(expect.any(String));
})... | true |
94728e4ba29d9ebffe4f331d8d4080defb93ce49 | JavaScript | sjmarel/texio | /model.js | UTF-8 | 2,474 | 2.84375 | 3 | [] | no_license | class Model
{
constructor()
{
this.paragraphs = []
this.event = null
this.eventBuffer = []
this.range = {
start:
{
node: null,
offset: null
},
end:
{
node: null,
... | true |
137e851ed2e781cc1f932f1b8f7422343f0f63ea | JavaScript | tales-lopes/sorocaba-verde | /frontend/src/components/FormSolicitation.js | UTF-8 | 3,133 | 2.546875 | 3 | [] | no_license | import "./styles/FormSolicitation.css";
import axios from 'axios';
function FormSolicitation(props) {
const handleSubmit = (event) => {
event.preventDefault();
const imagesQtd = event.target[3].files.length;
let photosURL = [];
for(var i = 0; i < imagesQtd; i++)
... | true |
e77aa9b4c8ab5552f159b66d89318b090c1b64aa | JavaScript | Rockncoder/EnterpriseJavaScript | /designPattern/observer.js | UTF-8 | 1,556 | 3.328125 | 3 | [] | no_license | /**
* User: Troy
* Date: 11/4/12
* Time: 8:41 PM
*/
function ObserverList(){
this.observerList = [];
}
ObserverList.prototype = {
Add: function ( obj ){
return this.observerList.push( obj );
},
Empty: function () {
this.observerList = [];
},
Count: function () {
re... | true |
f9bd4da49df32d90f5b26b9476b83872e7cd6cbd | JavaScript | shreyasiitr/CS653_Project_Typosquatting | /lib/advertLink.js | UTF-8 | 711 | 3.15625 | 3 | [
"MIT"
] | permissive | /**
* Taken an array of links and return an array that has only advertisements links
* @param array
* @param callback
*/
var getAdverts = require('./getAdvertisements');
var advertLink = function(array, callback) {
getAdverts(function(error, advertArray){
var result = [];
for (var i = 0; i < array.le... | true |
9b238a7478e0af61a5f7c1b29aa64a616c9e67bb | JavaScript | kmubigdatalab/serverless-architectures-aws | /chapter-9/Listing 9.4 - Updated Transcode Function/index.js | UTF-8 | 2,006 | 2.609375 | 3 | [
"MIT"
] | permissive | /**
* Created by Peter Sbarski
* Serverless Architectures on AWS
* http://book.acloud.guru/
* Last Updated: Feb 12, 2017
*/
'use strict';
var AWS = require('aws-sdk');
var firebase = require('firebase');
var elasticTranscoder = new AWS.ElasticTranscoder({
region: process.env.ELASTIC_TRANSCODER_REGION
});
f... | true |
5b18574a64251c87b061a1e6e4926ef5ab794019 | JavaScript | stubma/electron-dockable-demo | /editor-framework/test/renderer/register-element.js | UTF-8 | 1,845 | 2.6875 | 3 | [
"MIT"
] | permissive | 'use strict';
suite(tap, 'Editor.UI.registerElement', {timeout: 2000}, t => {
t.test('the return value should be a constructor, and have the correct tagName', t => {
let UITest = Editor.UI.registerElement('ui-test', {});
t.type( UITest, 'function' );
t.equal( UITest.tagName, 'UI-TEST' );
t.end();
... | true |
3a836233b741e96d4acf33446bebf4544008ed01 | JavaScript | elbajo001/project_domi_foods | /frontend/src/products.js | UTF-8 | 5,871 | 2.84375 | 3 | [] | no_license | import React, { Component } from 'react';
import ProductList from './my_components/product_list';
import ToggleableProductForm from './my_components/toggle_product_form';
class Products extends Component {
/*Componente que despliega la lista de los productos asociados a un restaurante.
*Los parámetros de entrada ... | true |
985ce3384654587beb58bc75d8405fa8fd351fc2 | JavaScript | TNRIS/tnris.org | /static/js/gio_calendar_quad.js | UTF-8 | 2,693 | 3.40625 | 3 | [
"MIT"
] | permissive | // get gio calendar events from tnris api
// inject events into html; append html to template html
function retrieveNextFourEvents() {
var eventsUrl = 'https://api.tnris.org/api/v1/tnris_org/gio_calendar';
return fetch(eventsUrl).then(function(response) {
if (!response.ok) {
throw new Error('Could not ret... | true |
f41dc189976304378aa1eb3f5035fc3403cb34e1 | JavaScript | zhuheyang/js-recurrence | /Code_10_BinarySearch/FindLocalMinimum.js | GB18030 | 2,208 | 4.09375 | 4 | [] | no_license | // ⷨ
// ǰѾеֵ, ʵ岻, 㷨˼άʮа
function findLocalMinimum1(arr) {
if(arr[0] < arr[1]) {
return arr[0]
} else if(arr[arr.length - 1] < arr[arr.length - 2]) {
return arr[arr.length - 1]
} else {
for(let i = 1; i < arr.length - 1; i++) {
if(arr[i] < arr[i - 1] && arr[i] < arr[i + 1]) {
... | true |
9ef2592b91f440ac62533db7bb01b863e8e82366 | JavaScript | stiffy89/BoostScreens | /src/ReUsableComponents/QuizCardCreation.js | UTF-8 | 2,095 | 2.515625 | 3 | [] | no_license | import React from 'react';
import {
Typography,
Paper,
ListItem,
List,
InputBase,
} from '@material-ui/core';
import {makeStyles} from '@material-ui/core/styles';
const useStyles = makeStyles({
root: {
width: "100%",
height: "auto",
backgroundColor: "#e8e4d5",
... | true |
9963eb33425130d0bbb3e78b4c3dccf5732cf1d4 | JavaScript | kirkbrauer/ctrl-test | /index.js | UTF-8 | 2,670 | 2.6875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // modules =================================================
var express = require('express');
var app = express();
var server = require('http').createServer(app);
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var robot = require('robotj... | true |
be7aed187ae159f40c3e1539575e9cf792de4cf2 | JavaScript | ietuday/book-app | /server/src/api/favourite/favourite.controller.js | UTF-8 | 1,791 | 2.828125 | 3 | [] | no_license | 'use strict';
import Favourite from './favourite.model';
function handleError(res, statusCode) {
statusCode = statusCode || 500;
return function(err) {
console.log(err);
return res.status(statusCode).send(err);
};
}
/**
* get favourites by user
*/
export function get(req, res) {
return Favourite.fi... | true |
97f302c9eaea3efa9c7eae19c08872990d343dff | JavaScript | maltez/react_native | /HomeWork/vladyslav.saminin/hw3/index.js | UTF-8 | 1,144 | 3.859375 | 4 | [
"MIT"
] | permissive | //1. Fake REST call
function makeFakeCall(requestParameters) {
return new Promise((resolve, reject) => {
let callLength = Math.floor(Math.random() * 3) + 1;
setTimeout(() => {
let responseBody = requestParameters;
if (responseBody.includes("error")) {
reject... | true |
a61088f460066713e56caf1b4c276d88c6fb0683 | JavaScript | zwmhly0823/alibaixiu | /demos/promise/01-promise基本使用.js | UTF-8 | 2,998 | 4.21875 | 4 | [] | no_license | // Promise 就是承诺、许诺、
// I promise you. 我向你保证。
//
// 在 ECMAScript 6 中,新增了一个构造函数:Promise
// Promise 用于解决异步回调代码嵌套的问题
// 可以以一种很优雅的代码来进行异步任务流程控制
// Promise 的使用
// 一、封装
// 1. 创建一个 Promise 对象
// 2. Promise 构造函数接收一个函数作为参数
// 3. 函数有两个参数
// resolve
// reject
// 4. 在参数函数中(Promise容器中)进行异步任务操作(读写文件、定时器、操作数据库)...
// 5.... | true |
98d83d71fd51245586df4048cf19128870087a49 | JavaScript | craig1123/craigponent-library | /src/lib/NumberInput/numberInput.helpers.js | UTF-8 | 986 | 3.265625 | 3 | [] | no_license | export function limitToScale(numStr, scale) {
let str = '';
for (let i = 0; i < scale; i += 1) {
str += numStr[i] || '';
}
return str;
}
export function addCommas(v, scale = 2) {
const value = `${v}`; // converts any type:number to string
if (value === '') {
return '';
}
// limit to only numb... | true |
2f69d3f73d4091460d567ef9ebe09a449a99d9ad | JavaScript | g9020/SAMI-VAPALS-ELCAP | /docs/www/lib/formvalidation/dist/es6/validators/id/mxId.js | UTF-8 | 2,426 | 2.546875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | import isValidDate from '../../utils/isValidDate';
export default function mxId(value) {
const v = value.toUpperCase();
if (!/^[A-Z]{4}\d{6}[A-Z]{6}[0-9A-Z]\d$/.test(v)) {
return {
meta: {},
valid: false,
};
}
const blacklistNames = [
'BACA', 'BAKA', 'BUEI... | true |
c63d899a5fc93cc767247110f76971238d2dee8d | JavaScript | psaigal/text_effects_component | /public/comp.js | UTF-8 | 4,105 | 3.25 | 3 | [] | no_license | var newComponent = (function(element){ // eslint-disable-line no-unused-vars
"use strict";
//CACHE DOM
function injectElement(elm) {
var domElm = document.getElementById(elm);
domElm.appendChild(componentContainer);
}
var componentContainer = document.createElement("div");
var header = document.createEleme... | true |
6df9728e546bacba4a35faa2fa5b5bc8a90adafd | JavaScript | Jafeth22/VueJs | /Clase 4/JS/estilos.js | UTF-8 | 1,831 | 3 | 3 | [
"MIT"
] | permissive |
const appClase5 = new Vue({
el: "#app",
data: {
mensaje: "",
contador: 0,
},
//Datos que van a tener lógica
computed:{
msjInvertido(){
/**
* split: separa el string, devuelve un array
* reverse: le da vuelta
* join: une lo ... | true |
625633bbb459b99fe7ef7486d01c46819f03eb37 | JavaScript | aslxwjh/jiuxianwang | /modulejs/js/list.js | UTF-8 | 4,973 | 2.84375 | 3 | [] | no_license | $(function(){
//加载已有的购物车信息
loadCart();
//给购物车按钮加一个点击事件
$("#buy").click(function(){
location.href = "cart.html";
})
//给加入购物车按钮添加点击事件
$(".goodInfo .addToCart").click(function(e){
//获取商品的id(用来区分不同的商品)
var goodId = $(this).parent().attr("data-good-id");
//获取商品的名称
va... | true |
85178038eaba5f91b6c279182c845a80056c7c95 | JavaScript | jandresh/cg2021i | /sesion16/group06/FinalProjectCG/src/AdventuresOfDye/Objects/Minion.js | UTF-8 | 4,648 | 2.578125 | 3 | [] | no_license | /* File: Minion.js
*
* Creates and initializes a Minion object
* overrides the update funciton of GameObject to define
* simple sprite animation behavior behavior
*/
/*jslint node: true, vars: true */
/*global gEngine, GameObject, LightRenderable, IllumRenderable, SpriteAnimateRenderable */
/* find out more abou... | true |
87a6082e4b65f64f2bc5a921f4f7a644a7715ae1 | JavaScript | Silent0330/QuickFlop | /public/js/game.js | UTF-8 | 5,232 | 3.15625 | 3 | [] | no_license | var socket = io.connect();
var col_num = 10,
row_num = 10;
var user_name = getCookie('user_name');
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
else return null;
}
function ... | true |
0f1b196b86af2bd5ba06bfe35fcc9d53e6db025b | JavaScript | jiss02/Practice | /01_NodeJs/NodeJs_basic_by_opentutorials/practice/syntax/arrloop.js | UTF-8 | 183 | 3.375 | 3 | [] | no_license | var num = [44,2,6,7,34,76];
var i = 0;
var sum = 0;
while (i < num.length) {
console.log(num[i]);
sum += num[i];
i += 1;
}
// template literal
console.log(`total: ${sum}`);
| true |
903451c2e3ab784fc3fb8cc7b438e61cf006ab69 | JavaScript | herculesgabriel/share-web | /src/components/MessageList/index.jsx | UTF-8 | 1,681 | 2.765625 | 3 | [
"MIT"
] | permissive | import { useEffect, useState } from 'react';
import axios from '../../services/messagesAPI';
import './style.css';
const MessagesList = () => {
const [messages, setMessages] = useState([]);
const [totalMessagesOnServer, setTotalMessagesOnServer] = useState(0);
const [readMessages, setReadMessages] = useState(0... | true |
d01e8a36f3ee357bea06dbd2f501d95e6d8a8e89 | JavaScript | dgwn/fcc | /js_algorithms/sum_primes.js | UTF-8 | 657 | 4.3125 | 4 | [] | no_license | function sumPrimes(num) {
let primes = [];
let thisPrime = 0;
let checkPrime = 0
while (thisPrime <= num) {
//checks if number is prime and if so, adds it to array
if (isPrime(checkPrime)) {
primes.push(checkPrime);
console.log(primes);
}
checkPrime = thisPrime + 1;
thisPrime = c... | true |
09d03ecdf54d6576cca9ccc995ef155af23d924b | JavaScript | Anaphalis/babel-dev-server | /libs/filer.js | UTF-8 | 1,597 | 2.6875 | 3 | [
"MIT"
] | permissive | var glob = require('glob');
var Log = require('./log.js');
function getFiles(pattern){
return new Promise((resolve,reject)=>{
glob(pattern,(err,files)=>{
if(err){
throw err
}else{
//console.log(pattern,'--->',files);
resolve(files);
}
})
})
}
function isNegative(pat... | true |
c9fe49897695571cf9b25c8b7afd29fae962556a | JavaScript | liran/hello-utils | /src/fetch.browser.js | UTF-8 | 1,575 | 2.65625 | 3 | [
"MIT"
] | permissive | const { AbortController } = require('abort-controller/dist/abort-controller.umd');
const sleep = require('./sleep');
const browserFetch = async (url, options = {}) => {
// Number of error retries
let retry = 3;
if (options.retry) {
retry = options.retry;
delete options.retry;
}
// Waiting time for ... | true |
9a023c708944cbb1ff31054762de247d4a4ea816 | JavaScript | lastkindness/restaurant-theme | /src/components/header/index.js | UTF-8 | 2,620 | 2.796875 | 3 | [] | no_license | export default function initDropdown() {
const menuListItem = document.querySelectorAll('.header-nav-list-item');
for (let i = 0; i < menuListItem.length; i++)
new HeaderMenuListItem(menuListItem[i]);
}
const DROPDOWN_TRANSITION_DURATION = 300;
class HeaderMenuListItem {
constructor(item) {
... | true |
dd8736fbe0fdf83fbcc8db9a85a8b6eee5c9b01d | JavaScript | tianfengs/nodejs | /node201509_homework/胡林海/7.buffer/4.buffer.js | UTF-8 | 2,947 | 3.15625 | 3 | [
"MIT"
] | permissive | /**
* Created by Administrator on 2015/12/30.
*/
var buf1=new Buffer(3);
console.log(buf1)
buf1.fill(0);
console.log(buf1);
buf1[0]=0x61;
buf1[1]=0x62;
buf1[2]=0x63;
console.log(buf1);
console.log("=======================================");
var buf2=new Buffer([0x61,0x62,0x63]);
var buf3=new Buffer("abc",'utf-8');
c... | true |
fb88c64df5a61bfb66ff5200ef6343b65a11ff22 | JavaScript | abhishekvirat0/Online_College_Portal-website | /js/council.js | UTF-8 | 1,925 | 2.671875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | $(document).ready(function(){
$('#btncoul').click(function(event) {
// alert("no function");
event.preventDefault();
var name = $('#name').val();
var mobile = $('#mobile').val();
var dob = $('#dob').val();
var address = $('#addre... | true |
617260b11a4a2ddebc25b69f7130396d17c1c5c8 | JavaScript | NotMyself/react-courses | /reactjs-getting-started/module-02.js | UTF-8 | 1,506 | 2.875 | 3 | [
"MIT"
] | permissive | const Card = props => {
return (
<div style={{margin: '1em'}}>
<img width="75" src={props.avatar_url} />
<div style={{display: 'inline-block', marginLeft: 10}}>
<div style={{fontSize: '1.25em', fontWeight: 'bold'}}>
{props.name}
</div>
<div>{props.company}</div>
<... | true |
20019a61eea3fccf210e9e7f9f539ca9c9e8d24c | JavaScript | Gilyongyi/Cookle | /recipemaster/src/main/webapp/js/node/pushEmail.js | UTF-8 | 2,804 | 2.515625 | 3 | [] | no_license | ///////////////////////////////////////////
function getContextRoot(port){
return "http://52.78.170.190:"+port+"/";
// return "http://localhost:"+port+"/";
}
var nodemailer = require("nodemailer");
var generator = require('xoauth2').createXOAuth2Generator({
user: "somangily@gmail.com",
clientId: "854303379765-qf... | true |
84c9061aa9c55d5ab2a8ce1ac4a91a993ad72ae1 | JavaScript | sufiyank97/ticket-master | /client/src/components/customers/Form.js | UTF-8 | 3,030 | 2.546875 | 3 | [] | no_license | import React from "react";
class CustomerForm extends React.Component {
constructor(props) {
super(props);
console.log("form customer");
this.state = {
name: props.customer ? props.customer.name : "",
email: props.customer ? props.customer.email : "",
mobile: props.customer ? props.cust... | true |
8997ffc8066aa51f5fba6a0331541742594c9e4f | JavaScript | jymfony/jymfony | /src/Component/Debug/src/Exception/FlattenException.js | UTF-8 | 4,702 | 2.546875 | 3 | [
"MIT"
] | permissive | const FlattenExceptionInterface = Jymfony.Contracts.Debug.Exception.FlattenExceptionInterface;
const HttpExceptionInterface = Jymfony.Component.HttpFoundation.Exception.HttpExceptionInterface;
const RequestExceptionInterface = Jymfony.Component.HttpFoundation.Exception.RequestExceptionInterface;
const Response = Jymfon... | true |
5385de0134f765378868b5f1ee94f2c7cbbba592 | JavaScript | amoschen614/precourse-review-site | /public/snippets/cycle-ponies.js | UTF-8 | 208 | 2.59375 | 3 | [] | no_license | document.getElementById('btn-cycle-ponies').addEventListener('click', function(e) {
let images = document.querySelectorAll('.my-little-pony');
images[1].parentNode.insertBefore(images[1], images[0]);
});
| true |
4c275d30bad8b01d2a7bc14eb6999b413fde8bbe | JavaScript | BoqnKostakev/bits-of-code | /homework-solutions/search_in_text.js | UTF-8 | 818 | 3.3125 | 3 | [] | no_license | // Write a function that finds all the occurrences of
// word in a text
var text = 'Perspiciatis, maiores commodi tenetur dolorem / mobich nemo Java-script jaba accusamus Bobich nesciunt dolores voluptatum / doloribus Bobich placeat autem ratione';
function searchText (text ,word) {
var wordLength = word.leng... | true |
fcc5305a743676909af6feab9168b2f4aba5e501 | JavaScript | Mujj/Constellation | /doc/archive/html/js/constellation_sponsor.js | UTF-8 | 94,823 | 2.59375 | 3 | [] | no_license | /*=============================
jquery.barousel.js
v.0.1
Julien Decaudin - 03/2010
www.juliendecaudin.com
=============================*/
(function ($) {
$.fn.barousel = function (callerSettings) {
var settings = $.extend({
imageWrapper: '.barousel_image',
contentWrapper: '.ba... | true |
9a3a800b1ab124bdc1890a1274c3952af4cf78e1 | JavaScript | OriPekelman/dpsv | /scripts/shared/butlast.js | UTF-8 | 184 | 2.953125 | 3 | [
"MIT"
] | permissive | 'use strict';
module.exports = function(arr) {
if (arr.length === 0) {
// Always return a new object
return [];
}
return arr.slice(0, arr.length - 1);
};
| true |
754c467c81f28560febcfc9f49fbf7aa5ac53fca | JavaScript | quicoide/labMVCTarea | /mvclesson/libs/functions.js | UTF-8 | 1,895 | 3.40625 | 3 | [
"MIT"
] | permissive | /*
Alumno: Enrique Manuel Gorian Lemus
Profesor: Octavio Aguirre Lozano
Materia: Computacion en el servidor Web
Trabajo: Manejo de datos en el servidor e interacción con cliente mediante una aplicación web.
*/
/*
Función en la cuál se validará la forma para que no se guarde ningún campo vacío.
En caso de que ... | true |
e7c75de3e143cde36f46594a72d5b963f28a5825 | JavaScript | lisaferrier/hackathon_halloween | /src/components/suggarlist/Sugargrid/Sugargrid.js | UTF-8 | 2,357 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react'
import Sugarcard from './Sugarcard'
import './Sugargrid.css';
export default class Sugargrid extends Component {
state = {
sugar: [{
name: "Fraises Tagada",
score: 14,
image: "https://www.zupimages.net/up/18/44/hlyl.jpg"
}... | true |
153018dafc7571951388e71c85a9d4c0a0b8035d | JavaScript | sarvagya8/web-health-check | /public/javascripts/module/editor/editor.js | UTF-8 | 519 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | $(document).ready(function() {
$('select').material_select();
});
$('#create').click(function () {
var title = $('#title').val();
var url = $('#url').val();
var frequency = $('#frequency').find(':selected').val();
var param = {
title:title,
url: url,
frequency:frequency
... | true |
cbe21841183dfded97ef805cbf560303367fa651 | JavaScript | hisham24/image_labeler | /labeler/src/hooks/useCanvas.js | UTF-8 | 981 | 2.546875 | 3 | [] | no_license | import { useEffect, useRef } from 'react';
import { useSelector } from 'react-redux';
// const SCALE = 0.1;
// const OFFSET = 80;
export const canvasWidth = window.innerWidth * 0.75;
export const canvasHeight = window.innerHeight * 0.75;
export const drawRectangle = (ctx, info) => {
const { x, y, w, h } = info;
c... | true |
5a34218fb9f0e5db3333dfea8979047890eafc6a | JavaScript | MD-Mehedi-Hasan18111/dutch-bangla-bank | /js/login.js | UTF-8 | 497 | 2.875 | 3 | [] | no_license |
document.getElementById('login-button').addEventListener('click', () => {
const emailInput = document.getElementById('email-input').value;
const passwordInput = document.getElementById('password-input').value;
const errorMessage = document.getElementById('error-message');
if (emailInput === 'user@gma... | true |
76a562b50b56d483d72f7efa5304ca950c4cdbdf | JavaScript | Natedogg0408/Class-80 | /main.js | UTF-8 | 1,984 | 3.296875 | 3 | [] | no_license | var name_of_students_array = [];
function submit() {
var display_student_array = [];
for(var j = 1; j<= 4; j++)
{
var name_of_students = document.getElementById("name_of_the_student_"+j).value;
console.log(name_of_students);
name_of_stu... | true |
84134d7e60a9272a34c026ce2db9bef5b3937c94 | JavaScript | benediktharter/nodepress | /routes/index.js | UTF-8 | 6,902 | 2.625 | 3 | [] | no_license |
/*
* GET home page.
*/
var config = require('../nodepress_config.js')
, request = require("request")
, cache = require("memory-cache")
, the_date = new Date; // Generic JS date object
var pagedata=[];
var unixtime_ms = the_date.getTime(); // Returns milliseconds since the epoch
var now = parseInt(unixtime_ms /... | true |
719d8635135a0b6e24f84543c157d36b671543d8 | JavaScript | codyw9524/JavaScript-Algorithms | /rSumOfSquares.js | UTF-8 | 1,183 | 3.78125 | 4 | [] | no_license | function isSquare(n){
return n > 0 && Math.sqrt(n) % 1 === 0;
}
function rGetSquares(n, arr=[]){
if(isSquare(n)){
arr.push(n);
}
if(n == 1){
return arr;
}
return rGetSquares(n - 1, arr);
}
function permuteArr(arr, n, sub=[], permArr=[]){
var length = arr.length;
if(sub.... | true |
3d9a45348dba76efab50ed6f4484b475c05cb7e9 | JavaScript | sayyedhammadali/sheila | /routes/api/requestData.js | UTF-8 | 5,756 | 2.53125 | 3 | [] | no_license | // packages imports
const request = require('request');
// variables imports
const keys = require('../../config/keys');
let token;
let groupName = 'lucid';
function getProjectsData (groupRequested,loginUser, callback) {
token = loginUser.access_token;
var groupProjectsURL;
if(groupRequested == 0) {
... | true |
6c558c11d1f83d88e54a6cf112343dbf190b1353 | JavaScript | 08fdange/the_shoppies | /server/routes/api-routes.js | UTF-8 | 959 | 2.578125 | 3 | [
"MIT"
] | permissive | // api-routes.js
// Initialize express router
let router = require('express').Router();
// Set default API response
router.get('/', function (req, res) {
res.json({
status: 'API Working',
message: 'Welcome to The Shoppies API!',
});
});
// Import user controller
var userController = require('... | true |
e818c48b0acfde4d7c16749525619d422a65a0aa | JavaScript | dimchoo/CoderMerch | /static/js/login.js | UTF-8 | 5,790 | 2.765625 | 3 | [
"MIT"
] | permissive | class Login {
constructor() {
this.login = false;
this.email = '';
this.password = '';
this.data = {};
this.contentHeader = {};
this.modalTitle = document.querySelector('.modal-title');
this.button = document.querySelector('... | true |
74f38f0882c473ab21d6b7d479b98bc3d94ba84a | JavaScript | wade1990/flynn | /test/runner/assets/build-log.js | UTF-8 | 530 | 2.765625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /* globals $:false, EventSource:false */
$(function() {
"use strict";
var logs = $("#logs");
var stream = new EventSource(document.location.href);
stream.onmessage = function(e) {
var line = JSON.parse(e.data);
// convert ANSI colour codes to HTML spans
line = ansi_up.ansi_to_html(line);
//... | true |
d677dde3343c3453420925b5c61e217198ef4208 | JavaScript | ReportersLab/TheVideoNotebook_Public | /videotext/apps/core/static/js/models.js | UTF-8 | 6,438 | 2.546875 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive | $(function(){
window.Video = Backbone.Model.extend({
initialize: function(){
//make a real JS date out of the date string we got in JSON.
if(this.get('time')){
var dt = new Date(this.get('time'));
}else{
var dt = new Date();
... | true |
fb851b2301ccaa40a4d045bff0031597cdf8ce7b | JavaScript | kntASK/cmp | /src/operation/TestOperation.js | UTF-8 | 5,053 | 2.578125 | 3 | [] | no_license |
const environment =
{
"name": "開発環境",
"landScape": 1,
"status": 1,
"specLevel": 2,
"vpcType": 1,
"mainComponents": [
{
"id": 99,
"name": "SpringBootAp",
"caption": "SpringBootAp",
"type": 1,
"params": []
}
],
"s... | true |
941423c44c32766a7c543de1ad690c5cdf5ae259 | JavaScript | radrex/SoftuniCourses | /Programming Fundamentals/JS/07.Associative Arrays/Exercise/p04_PartyTime.js | UTF-8 | 1,470 | 2.765625 | 3 | [
"MIT"
] | permissive | function solve(arr = []) {
let vip = [];
let regular = [];
let reservation = arr.shift();
while (reservation !== 'PARTY') {
if (/^\d+/.test(reservation)) {
vip.push(reservation);
} else {
regular.push(reservation);
}
reservation = arr.shift();
}
for (let guest of... | true |
b54a1bb0f9506fb5a14ca0bb617179968b25af53 | JavaScript | EastMeridian/ReactGameMap | /src/engine/system/renderer/Renderer.js | UTF-8 | 4,282 | 3.015625 | 3 | [] | no_license | const assetMap = {
0: 'floor',
1: 'items',
};
function Renderer({
context,
assets,
map,
camera,
shouldDrawGrid = true,
shouldDrawResources = true,
}) {
this.context = context;
this.assets = assets;
this.map = map;
this.camera = camera;
this.selectedTile = null;
this.shouldDrawGrid = shouldD... | true |
956b7b8aa65c3f89f7d1d6c2777cb55e420a0fc2 | JavaScript | metalralf/webprogketto | /js/components/BlockPainter.js | UTF-8 | 1,968 | 3.1875 | 3 | [] | no_license | class BlockPainter {
constructor(props) {
this.parent = props.parent;
this.canvas = document.createElement('canvas');
this.parent.append(this.canvas);
this.ctx = this.canvas.getContext('2d');
this.columns = props.columns;
this.rows = props.rows;
this.backgroun... | true |
52bb7b45e44fe8348633432807555d04b051c994 | JavaScript | YusukeNakatsubo/javascript_algorithm | /beginner/linearSearch/linearSearch.js | UTF-8 | 409 | 3.765625 | 4 | [] | no_license | /**
* @param {*[]} array
* @param {function(a, b)}
* @return {number} result
*/
const linearSearch = (array, number) => {
let result = -1;
let seekElement = number;
if (array.length < 1) { return result; }
array.forEach((element, index) => {
if (element == seekElement) { return result = index; }
... | true |
0de7c8640558664ccc35188f40e87e75be0fbc28 | JavaScript | beneroan/api | /server.js | UTF-8 | 2,532 | 2.578125 | 3 | [] | no_license | const express = require('express');
const app = express();
const cors = require('cors');
const PORT = 5000;
const { exec } = require('child_process');
const request = require('request');
app.use(cors());
const lastFreeDb = {};
const numbersDb = ['16822131240'];
const peopleToNumber = {
'c7d986e8-f760-4df4-8366-123... | true |
1c42d2ee5f240e41bdf37b35998c23f4bccca7ca | JavaScript | LucasDachman/Creative-Dev-Tools-Portal | /src/copy/cat-dog/script.js | UTF-8 | 2,359 | 3.203125 | 3 | [
"MIT"
] | permissive | const scene = document.querySelector('a-scene');
function getRandom(min, max) {
return Math.random() * (max - min) + min;
}
function getCat() {
const x = String(getRandom(-15, 15));
const y = String(getRandom(20, 30));
const z = String(getRandom(-5, 5));
const position = x + ' ' + y + ' ' + z;
... | true |
d27e1a4e66808363e7b43c6c513d8bc9587eb09b | JavaScript | makander/fullstackopen-mooc | /part2/dataforcountries/src/App.js | UTF-8 | 2,684 | 2.921875 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import './App.css';
import axios from 'axios';
function App() {
const [countries, setCountries] = useState([]);
const [filterCountries, setFilter] = useState([]);
const [country, setCountry] = useState(null)
const [weather, setWeather] = useState(null)
... | true |
e0024c49913a913afc770f088c0e040786ed805c | JavaScript | codejunky/neda | /client/modules/App/AppReducer.js | UTF-8 | 445 | 2.609375 | 3 | [
"MIT"
] | permissive | // Import Actions
import { LOGIN_USER_SUCCESS } from './AppActions';
// Initial State
const initialState = {
authenticated: false,
user: { },
};
const AppReducer = (state = initialState, action) => {
switch (action.type) {
case LOGIN_USER_SUCCESS:
return {
...state,
authenticated: tru... | true |
188e3529efacfd0146a2661c9a57bc2e05d72ceb | JavaScript | Claussen-Bekah/cs313-node | /index.js | UTF-8 | 2,524 | 2.921875 | 3 | [] | no_license | const express = require('express')
const path = require('path')
const PORT = process.env.PORT || 5000
express()
.use(express.static(path.join(__dirname, 'public')))
.set('views', path.join(__dirname, 'views'))
.set('view engine', 'ejs')
.get('/', (req, res) => res.render('pages/index'))
.get('/math', formInp... | true |
f9ffb7cada051bb4c16909d98ae70ff3e8562235 | JavaScript | dlresende/extreme-carpaccio | /server/javascripts/services/seller.js | UTF-8 | 4,141 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | var url = require('url')
var utils = require('../utils')
var UrlAssembler = require('url-assembler')
var _ = require('lodash')
function SellerService (_sellers, _configuration) {
this.sellers = _sellers
this.configuration = _configuration
}
module.exports = SellerService
var service = SellerService.prototype
ser... | true |
9fe717cb412faa862a67aefd81209da408c4206a | JavaScript | hexiang-code/UI | /packages/components/music/music-canvas.js | UTF-8 | 1,959 | 2.84375 | 3 | [] | no_license | let AudioContext
let audioContext
let analyser
let audioSrc
let canvas
let ctx
let grd
let grd2
let het = 0
let globalID
let canvasHeight
let canvasWidth
/**
* 渲染背景动画
*/
function render() {
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
let dataArray = new Uint8Array(analyser.frequencyBinCount);
analyser.getBy... | true |
42efb93514a406e9523e20af3acaa17c86070e0a | JavaScript | Ann1Iona/Nikitka | /results.js | UTF-8 | 2,131 | 2.859375 | 3 | [
"MIT"
] | permissive |
var reference = [
"Nikitka",
"Vlad",
"Ilya",
"NikitaK",
"GoshaA",
"GoshaK",
"German",
"Alesha",
"Sanya",
"Kolya",
"Egor",
"Danya",
];
let queryString = decodeU... | true |
f825c0bfded33340c89a65a5f55926b574351a8d | JavaScript | aadarshpatel17/nodejs-test | /week1/day2/test/inheritance/app.js | UTF-8 | 815 | 3.625 | 4 | [] | no_license | // var Emitter = require('events')
// var util = require('util')
// function greetR() {
// this.greeting = 'greeting!!!'
// }
// util.inherits(greetR, Emitter);
// greetR.prototype.greet = function() {
// console.log(this.greeting)
// this.emit('greet')
// }
// var greeter1 = new greetR();
// greeter1.... | true |
9f4c1870d56c43dce09368d0f6efae46a23411c8 | JavaScript | steveblock-co-uk/plotter | /100k.js | UTF-8 | 2,802 | 2.828125 | 3 | [] | no_license | document.head.innerHTML = '';
document.body.innerHTML = '';
var x = document.createElement('script');
x.src = 'https://plotter.steveblock.co.uk/plotter.js';
x.addEventListener('load', go);
document.head.appendChild(x);
function go() {
var r = new XMLHttpRequest();
r.open('GET', 'https://connect.garmin.com/modern/... | true |
a198c4d2635e2bc4a53b347b6db0970c8677c393 | JavaScript | titon/toolkit | /build/tasks/import-scss-index.js | UTF-8 | 683 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | 'use strict';
var fs = require('fs'),
path = require('path');
/**
* A custom node-sass importer that appends an "index.scss" to folder paths.
*
* @param {String} url
* @param {String} prev
* @param {Function} done
*/
module.exports = function(url, prev, done) {
// If the import is not a relative path
... | true |
8228bedaf966b126cb1d53893ffdbd0099e715b4 | JavaScript | laocaicaicai/algorithm | /Week_04/id_11/LeetCode_169_11.js | UTF-8 | 463 | 3.140625 | 3 | [] | no_license | /**
* @param {number[]} nums
* @return {number}
*/
var majorityElement = function(nums) {
if(nums.length == 1){
return nums[0]
}
let maj = {}
let majNum
nums.forEach(num => {
if(maj[num] == null){
maj[num] = 1
} else {
maj[num] = maj[num] + 1
... | true |
15e1fa9439f6e46ba6f22a514f0e056fb8413665 | JavaScript | phenax/pipey | /test/createPipes.test.js | UTF-8 | 1,846 | 3.140625 | 3 | [
"MIT"
] | permissive |
import { createPipes, compose } from '../src';
describe('createPipes', () => {
it('should return an object with all method accessors', () => {
const methods = [ 'hello', 'world', '-', '+' ];
const pipes = createPipes(methods);
expect(Object.keys(pipes).sort()).toEqual(methods.sort());
... | true |
c7b6efa037428b1012a9e55c3779bd79b8d422c3 | JavaScript | gunaveeramallu/projectAncons | /login.js | UTF-8 | 1,904 | 2.90625 | 3 | [] | no_license |
function login(){
var email = document.getElementById("email").value;
var password = document.getElementById("password").value;
firebase.auth().signInWithEmailAndPassword(email, password).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var err... | true |
eceb23c78711fbe981ba03210a47b2aa8a8b67f7 | JavaScript | LeovannyF/GameOfLife2 | /test/spec.js | UTF-8 | 2,574 | 3.4375 | 3 | [] | no_license | const expect = require('chai').expect;
const GameOfLife = require('../GameOfLife.js');
describe('Game of life constructor exists', ()=>{
it('exists', ()=> {
expect(GameOfLife).to.be.ok;
});
});
describe('it properly uses the make board function', ()=>{
it('can make a 2D Array 3x3', ()=>{
const game = n... | true |
66d89c9f7ebec834f84c49e64346978fe1c22e3b | JavaScript | vygoda/vygoda.github.io | /modules/event/js/event-config.js | UTF-8 | 720 | 3.09375 | 3 | [] | no_license | var extractYearMonth = function(date) {
var month = date.getUTCMonth() + 1; //months from 1-12
var year = date.getUTCFullYear();
return {month: month, year: year};
};
var generateArchive = function(firstDate, endDate) {
var archives = {};
for (var year = firstDate.year; year <= endDate.year; year... | true |
4c7aac683c9a72a275e9ce3895522485783906e9 | JavaScript | iigmir/Takami | /old/getlist.js | UTF-8 | 2,375 | 2.578125 | 3 | [] | no_license | var basic_plugin = require("./basic_plugin.js");
var request = basic_plugin.request;
var cheerio = basic_plugin.cheerio;
var fs = basic_plugin.fs;
var lovelive_wiki = basic_plugin.lovelive_wiki;
var hrefs = new Array();
var output = fs.createWriteStream("output/song_url.js");
var song_groups = [
"http://love-live.wik... | true |
3ab6d7c50fc43651b46f1fa8f3fe2742f122ed12 | JavaScript | stephaneAG/Javascript_tests | /EspruinoWebappTests/js/serial_to_audio.js | UTF-8 | 2,168 | 2.75 | 3 | [
"MIT"
] | permissive | /*
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
*
* Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http... | true |
1420b27b13c3559138960fbfe41629f870db8b62 | JavaScript | pawan43563/Webpage-rendering | /src/components/Hamburger.js | UTF-8 | 238 | 2.65625 | 3 | [] | no_license |
export const Hamburger=(image)=>{
const menu=document.createElement("div");
menu.classList.add("hamburger-menu")
const img=document.createElement("img")
img.src=image.imageSrc;
menu.appendChild(img);
return menu
} | true |
1c67fc87582f653b986966b273f95ca722d195ff | JavaScript | Chel0cean/IntroToWebDev | /javascript/displayEvens.js | UTF-8 | 1,597 | 3.546875 | 4 | [] | no_license |
var evenNumbers = [];
function calculate() {
evenNumbers.length = 0;
document.getElementById("inv").innerHTML = "";
document.getElementById("tables").innerHTML = "";
var num1 =
Number(document.getElementById("first-number").value);
var num2 =
Number(document.getElementById("second-number").value);
va... | true |
e244aea165c21882c6953aa778ec18405f5f7079 | JavaScript | blittle/rxws-socketio | /src/SocketIOBackend.js | UTF-8 | 614 | 2.546875 | 3 | [
"MIT"
] | permissive | import io from 'socket.io-client';
import { Observable } from 'rx';
const MESSAGE_TYPE = '__rxwsData';
let socket;
export default {
connect(url) {
return Observable.create((observer) => {
socket = io(url);
socket.on('connect', function() {
observer.onNext()
});
socket.on('disconnect', function() ... | true |
b85b51c246365ab9c064efdcd31fd76e59ba8dfe | JavaScript | jpauloconnor/WebDevelopmentFundamentals | /javascriptfundamentals/0.07_loops_for.js | UTF-8 | 934 | 4.1875 | 4 | [] | no_license | //for loops
//STUDENTS: YOU WILL USE THESE A LOT!!!!
//What if we wanted to print a range of numbers all the way to 100.
console.log(1);
console.log(2);
console.log(3);
console.log(4);
console.log(5);
/*
That would be really annoying.
That's going to take a lot of space and time to write out.
*/
//For Loops take ... | true |
0e49ddd94d807a40f783fddd7449aca294caa82c | JavaScript | ali-Alrubaye/Exercises-React-Redux | /client/src/services/Service.js | UTF-8 | 1,473 | 2.515625 | 3 | [] | no_license | import axios from 'axios';
export async function getScores() {
const response = await axios.get('http://localhost:8000/highscores');
return response;
}
export async function getHighScores() {
const response = await axios.get('http://localhost:8000/highscores/high');
return response;
}
export async function ge... | true |
f3606605fc409f37b6dd66b3f5a59e085465b1ab | JavaScript | joseph-yp-kim/algorithm_datastructures | /src/delayed_print.js | UTF-8 | 520 | 5 | 5 | [] | no_license | // Write a function that will print the numbers 0 - 5, printing each number one second apart
function print() {
// create a counter variable
let count = 0;
// create a closure that is immediately invoked
(function loop() {
// print the counter variable
console.log(count);
// increment the counter v... | true |
9abb370f19c77c227bb6bc09cc4ff86d14efc48c | JavaScript | ZackRLawrence/CatchTheseFives | /OurGame/js/menu.js | UTF-8 | 3,050 | 2.875 | 3 | [] | no_license | var menuState = {
create: function() {
menuMusic = game.add.audio('Menu');
menuMusic.play();
var logo = game.add.sprite(300, -100, 'logo');
logo.scale.setTo(.8, .8);
/*
var nameLabel = game.add.text(80, 80, 'Player1',
{ font: '50px Arial', fill: '#ffffff' });
var instructions = ga... | true |
898b1f7719c3b2f03bc7bafe2e07c067e6cb7448 | JavaScript | NetheRinchik/bckgchange | /script.js | UTF-8 | 361 | 3.171875 | 3 | [] | no_license | function changeColor() {
let color;
let r;
let g;
let b;
r = Math.floor(Math.random() * (256)),
g = Math.floor(Math.random() * (256)),
b = Math.floor(Math.random() * (256)),
color = '#' + r.toString(16) + g.toString(16) + b.toString(16);
document.b... | true |
9c717d378f6c6243ec75db570323d368c55b34e9 | JavaScript | mannongaidien82/OverlayViewController | /OverlayViewController/assest/test.js | UTF-8 | 1,185 | 2.9375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | var isMobile = false;
$(document).ready(function () {
//For performance!
// document.getElementById("parent").onclick = function (e) {
// //We only want events on the spans, so let's check that!
// if (e.target.tagName.toLowerCase() == "span") {
// this.className = "parent__clicked";
// }
// };... | true |
52ef2dbeb07e3666446c05198daacd6d30dc8054 | JavaScript | jm0ran/JS-Discord-Bot | /commands/uptime.js | UTF-8 | 382 | 2.71875 | 3 | [] | no_license | module.exports = {
name: "uptime",
description : "returns the bot's uptime",
execute(message, args, Discord, uptime){
const newEmbed = new Discord.MessageEmbed()
.setColor('#0099ff')
.setTitle("Uptime")
.setDescription(`Bot has been running for ${Math.floor(uptime... | true |
e8e86d1be470bc42b21a0099204ff3ec02cac5a8 | JavaScript | mattconsto/fireworks | /script.js | UTF-8 | 6,805 | 3 | 3 | [
"MIT"
] | permissive | var scaling = 2
var drawing = false
var particles = []
var stars = []
var raining = false
var snowing = false
var tool = createFireworks
for(var i = 0; i < 100; i++) stars.push({x: Math.random(), y: Math.random()})
var canvas = document.getElementById("canvas")
canvas.context = canvas.getContext("2d")
window.addEven... | true |