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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
61cca59345fb2f47e453fb1cdfbac8c764c516c2 | JavaScript | ScienceCommons/www | /client/utils/ScrollIntoView.js | UTF-8 | 1,063 | 3 | 3 | [
"MIT"
] | permissive | "use strict";
function scrollIntoViewIfOutOfView(el) {
//var scrollY = window.pageYOffset();
//var scrollX = window.pageXOffset();
var heightOfPage = window.innerHeight;
var widthOfPage = window.innerWidth;
var rect = el.getBoundingClientRect();
var yOffset = window.pageYOffset;
var xOffset = window.pa... | true |
09fcba8175b67162fc63d290fccbc1c67f2a7785 | JavaScript | zfalen/mfc-rawnode | /email_config.js | UTF-8 | 871 | 2.546875 | 3 | [] | no_license | const email = require('emailjs');
module.exports = (sender_name, sender_email, sender_subject, sender_body) => {
let email_server = email.server.connect({
user: process.env.EMAIL_USERNAME,
password: process.env.EMAIL_PASSWORD,
host: "smtp.googlemail.com",
ssl: true,
port: 465
});
return new Prom... | true |
7b9fa37770ddab5d1b57c8e1995e36be64a1c417 | JavaScript | anasbajjouk/NodeFarm | /Index.js | UTF-8 | 1,953 | 2.703125 | 3 | [] | no_license | const fs = require('fs');
const http = require('http');
const url = require('url');
const slugify = require('slugify');
const replaceTemplate = require('./modules/replaceTemplate');
// Reading templates
const templateOverview = fs.readFileSync(
`${__dirname}/templates/template-overview.html`,
'utf-8',
);
const t... | true |
e2636851ec2c402df776a8c0b6c4dbde3efa85d1 | JavaScript | Andriy-Lesyk/goit-js-hw-07 | /task-3/task-3.js | UTF-8 | 842 | 2.828125 | 3 | [] | no_license | const images = [
{
url:
'https//images.pexels.com/photos/140134/pexels-photo-140134.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260',
alt: 'White and Black Long Fur Cat',
},
{
url:
'https://images.pexels.com/photos/213399/pexels-photo-213399.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1... | true |
b0922edc0ef7c96687ec0065320e8beac5d72952 | JavaScript | theblacksquid/sigil_generator | /app/lib/raphaeljs-drag-n-drop.js | UTF-8 | 5,284 | 3.1875 | 3 | [] | no_license | /**
* @blog
* http://terryyoung.blogspot.com/2011/08/raphaeljs-drag-and-drop-on-steroids.html
*/
///////////////////////////////////////////////////////////////////////////////
// Scroll to the bottom to see the simple demo code.
//
// These below are a bunch of my extensions to Raphael
// that enables the... | true |
c8fea1931f8f6ce10425e31c92165741a47f34fa | JavaScript | cindy1408/btn-pokemon-api | /mewtwo/index.js | UTF-8 | 772 | 3.484375 | 3 | [] | no_license |
const getPokemonDetails = async () => {
let id = document.getElementById('userInput').value;
const responseObject = await fetch(
`https://pokeapi.co/api/v2/pokemon-species/${id}/`
);
// console.log(responseObject);
const extractJson = await responseObject.json();
// console.log(extrac... | true |
54c0be4482b0ea6dca67f60b13ffa16ff5695e27 | JavaScript | AlxndrPsclt/jasone | /static/js/main.js | UTF-8 | 2,790 | 2.984375 | 3 | [] | no_license | function loadDoc(url, cFunction, cArgs) {
var xhttp;
xhttp=new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
cFunction(this, cArgs);
}
};
xhttp.open("GET", url, true);
xhttp.send();
}
function getArticlesList(xhttp) {
var text = ... | true |
983d3d5312a1af0e3b74dbc923075b7d7113b440 | JavaScript | dallaswolf1896/falconTravelApi | /controllers/user.js | UTF-8 | 3,891 | 2.65625 | 3 | [] | no_license | const User = require('../models/user')
const crypto = require('crypto')
const service = require('../services')
const passwordEncryption = (password) => {
const algoritmo = 'aes-256-cbc'
let key = crypto.createCipher(algoritmo, password)
let passCrypto = key.update(password, 'utf8', 'hex')
passCrypto +... | true |
dac3a76ac9cec96a2524dc99c907f7149f41f58e | JavaScript | thago-offredi/CondicooesJavaScript | /ex14/scripit.js | UTF-8 | 572 | 3.40625 | 3 | [
"MIT"
] | permissive | function carregar(){
var msg= document.getElementById("msg")
var img=document.getElementById("imagem")
var data= new Date()
var hora= data.getHours()
var minutos= data.getMinutes()
var segundo= data.getSeconds()
msg.innerHTML="agora são " + hora + ":" + minutos + ":" + segundo + " horas "
if(hora >= 0 && hora < 12) {
... | true |
298254838b07d6d0fbf2ec9366f506710daef47b | JavaScript | JiangWeixian/Algo | /docs/leetcode/06Z字型排列字符串.js | UTF-8 | 1,272 | 3.671875 | 4 | [
"MIT"
] | permissive | /**
* 将字符串Z字型排列
* @param {string} s
* @param {number} numRows
* @return {string}
*/
var convert = function(s, numRows) {
if (numRows <= 1) {
return s
}
const results = []
// 以 2 * numRows - 2个一组读取数据
const circle = 2 * numRows - 2
let start = 0
let circleCount = 0
let len = s.le... | true |
3f82b420f3dc4a711ffd3cf5f292f6a6f6ce3947 | JavaScript | CanadianCommander/bbenetti | /webroot/script/effects/RadialGradientEffect.js | UTF-8 | 1,112 | 3.03125 | 3 | [] | no_license | import GraphicObject from '../canvasGraphics2d/GraphicObject.js'
import Position from '../logic/Position.js'
export default class RadialGradientEffect extends GraphicObject(Position(Object)) {
constructor (x, y, radius, color0, color1) {
super()
this.setX(x)
this.setY(y)
this.radius = radius
thi... | true |
369991b7ce8351c329ac6143363401b6d995e702 | JavaScript | webkinder/cato.js | /src/util/domClasses.js | UTF-8 | 220 | 2.609375 | 3 | [
"MIT"
] | permissive | 'use strict'
const addClass = function(el, className) {
// see youmightnotneedjquery.com
if (el.classList) {
el.classList.add(className)
} else {
el.className += ' ' + className
}
}
export { addClass }
| true |
5af42a73699635e4e9d2880a4ca33d194e9a3c89 | JavaScript | kevin-leptons/trop_atom_parser | /lib/index.js | UTF-8 | 4,222 | 3.3125 | 3 | [] | no_license | const numeral = require('numeral')
const lodash = require('lodash')
// Input
// * target / Object - Contains attributes need to parse as primitive types
// * schema / Array<Array<String, String, any>> - Contains list of schemas
// * schema[][0] / String - Path of attribute, see argument path from
// lodash.set() for... | true |
4f532ee9e02e00536182fef560b11392e00d8964 | JavaScript | chrisd27/djNash | /public/js/custom.js | UTF-8 | 3,393 | 2.5625 | 3 | [] | no_license |
var waypoint = new Waypoint({
element: document.getElementById('services'),
handler: function() {
console.log('services triggered')
}
});
var waypoint = new Waypoint({
element: document.getElementById('portfolio'),
handler: function() {
console.log('portfolio triggered')
}
});
var setCarouselRig... | true |
24948a2bec3aa63ff5f334bdadc77986115cd9a4 | JavaScript | wandizer/ece-2020-fall-webtech | /courses/webtech/modules/03.storage/correction-lab3/app/controllers/channel_controller.js | UTF-8 | 2,641 | 2.546875 | 3 | [
"0BSD"
] | permissive | const {
listAllChannels,
createNewChannel,
showChannel,
updateChannel,
deleteChannel,
} = require('../models/channel_model');
exports.index = async (req, res) => {
const channels = await listAllChannels();
return res.status(200).json(channels);
};
exports.create = (req, res) => {
cons... | true |
33abeb38ebb91f51fa7e5989c84299fe225cc291 | JavaScript | brandonjwang/node-adaptivethrottle | /index.js | UTF-8 | 6,771 | 2.84375 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2013 Brandon Wang
//
// See the file license.txt for copying permission.
//
var url = require("url");
var queue = require("./queue.js");
DEBUG = true;
var d = function(l) {
if (DEBUG) {
console.log(l);
}
}
// rate: times/second
var Throttler = function(rate) {
this.lastCheck = D... | true |
abe65e4db78bdf9aba42d4dabc4b622836f0fbd8 | JavaScript | JB0925/Connect-Four | /connect4.test.js | UTF-8 | 1,426 | 3.1875 | 3 | [] | no_license | describe('create the in-memory game board', () => {
it('should create the in-memory game board', () => {
expect(board.length).toEqual(6);
expect(board[0].length).toEqual(7);
});
});
describe('create the html board', () => {
let gameBoard = document.querySelector('#board');
it('shou... | true |
9dc7375aa1bc2d3887cadcb6343933b79118de68 | JavaScript | GustavoGuke/Curso-JavaScript-TypeScript | /modulo-2logica/tryCath.js | UTF-8 | 426 | 3.65625 | 4 | [] | no_license | function soma(x, y){
if (typeof x != 'number' || typeof y != 'number'){
// com throw eu posso fazer meu proprio erro para teste
// ou tratar um erro de uma forma diferente
throw new Error ('apenas numero')
}
return x + y
}
// tente
try {
console.log(soma(1,'2'))
} catch (err... | true |
478fc57e452a939ff40871c94d9c2bbd04964bcc | JavaScript | morfeii/memory-game | /components/Cell.js | UTF-8 | 1,000 | 2.921875 | 3 | [] | no_license | import React from 'react';
// LOGIC
// cell = {
// symbol: "A",
// status: Status.Open,
// }
export let Status = {
Open: 'Open',
Closed: 'Closed',
Done: 'Done',
Failed: 'Failed'
};
export let isOpen = (cell) => cell.status === Status.Open;
export let isClosed = (cell) => cell.status === Status.Closed;
ex... | true |
531c99796b0c3855beb0e6fca8aad530024942e5 | JavaScript | EstrellaBF/ecommerse-product-final | /public/js/verProducto.js | UTF-8 | 3,728 | 2.859375 | 3 | [] | no_license | $(document).ready(function() {
var $amountProduct = $(".amount-product");
var productId = getParameterByName('product_id');
console.log(productId);
$.ajax({
url: `https://api.mercadolibre.com/items/${productId}?access_token=APP_USR-4292162118521145-022606-3ecd599a8baeee0c815b2da69327bb92__A_C__-206830841`,... | true |
9065e3aeee617a30ba3110aa8a2a4c117e6090fa | JavaScript | MasterOfMenace/699319-taskmanager-10 | /src/utils/utils.js | UTF-8 | 680 | 3.171875 | 3 | [] | no_license | import moment from 'moment';
export const getBoolean = () => {
return Math.random() > 0.5;
};
const getRandomNumber = (min, max) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
export const getRandomDate = () => {
const date = new Date();
const sign = getBoolean() ? 1 : -1;
const diff = s... | true |
d0f66e8029c7748b63a3446189965b6b1fbfc1b8 | JavaScript | MarkusDanilow/MadPuzzleCraft_WebGame | /js/entities/BaseEntity.js | UTF-8 | 991 | 3.1875 | 3 | [] | no_license | class BaseEntity {
constructor(x, y) {
this.worldCoordinates = { x: x, y: y };
this.worldPosition = { x: 0, y: 0 };
this.fillColor = 'red';
}
/**
* This sets absolute pixel values for the world position
* @param {*} worldX
* @param {*} worldY
*/
transformToWo... | true |
1e26b14ac22e5170b514a2b3996d08c05aa8a722 | JavaScript | gregorywyz/baby_book | /app/assets/javascripts/time.js | UTF-8 | 2,301 | 2.734375 | 3 | [] | no_license | $(document).ready(function() {
if(!gon || !gon.baby) return;
// Timeline source. Passed through in DOM within createStoryJS in "source".
var eventObject = {
"timeline":
{
"headline":gon.baby.name,
"type":"default",
"text":"Born on "+gon.birthday,
... | true |
83bc71000caaa97ffde25238acca77dc3e2cc5f9 | JavaScript | miraDask/JS-Advanced-June-2019 | /Exam_prep/JS Advanced Exam - 15 July 2018/01. Notes/solution.js | UTF-8 | 1,183 | 3.203125 | 3 | [] | no_license | function addSticker() {
const addBtn = document.getElementById('add-sticker');
const inputs = document.querySelectorAll('input');
const title = inputs[0].value;
const text = inputs[1].value;
const stickerList = document.getElementById('sticker-list');
if(!title || !text) {
return
}
... | true |
a070bc9d907eaec40ed22ac11316d8a202d72ac1 | JavaScript | buruhin/frontend-project-lvl1 | /src/index.js | UTF-8 | 663 | 3.125 | 3 | [] | no_license | import readlineSync from 'readline-sync';
export const GAME_LENGTH = 3;
export const getName = () => {
console.log('Welcome to the Brain Games!');
const name = readlineSync.question('May I have your name? ');
console.log(`Hello, ${name}!`);
return name;
};
export const getRandomInt = (max) => Math.floor(Math... | true |
5bbe6992e92f305872cac75e41169858ea896de6 | JavaScript | Dmcdominic/debate-network | /src/sketch.js | UTF-8 | 9,258 | 2.890625 | 3 | [] | no_license | /// <reference path="TSDef/p5.global-mode.d.ts" />
/* sketch.js and associated src/ files based on i-am-not-alone - https://github.com/Streakman/i-am-not-alone */
/* i-am-not-alone based on this project - https://editor.p5js.org/kaganatalay/sketches/vFlDyAsEC */
// NETWORKING - based on Paolo's mouses code - https://... | true |
31ca78596ac6928bfedc01ac01e506446c4566a2 | JavaScript | MarcAnt/practicas-js | /spa/app/App.js | UTF-8 | 855 | 2.515625 | 3 | [] | no_license |
//APP se encarga de llamar los archivos y ejecutar las funciones
import {Header} from "./components/Header.js";
import {Loader} from "./components/Loader.js";
import {Main} from "./components/Main.js";
import {Router} from "./components/Router.js";
import {InfiniteScroll} from "./helpers/infinite_scroll.js";
e... | true |
c1b0507c1c84c7c6e73e8f8101f4f31adc865bf5 | JavaScript | Aveek-Saha/js-data-structs | /src/rabin_karp.js | UTF-8 | 1,350 | 3.515625 | 4 | [
"MIT"
] | permissive | // Rabin Karp
/**
* This function finds all occurrences of a pattern in a text.
* @param {string} pattern The pattern to search for
* @param {string} text The string to search for in the pattern in
* @param {number} prime A prime number to use for hashing
* @param {number} num_chars The number of possible charact... | true |
9df32d60befba43bee40b0b8d257769ebb11c01e | JavaScript | SophiaMuntyanu/Museum-St.Pet | /js/preferential.js | UTF-8 | 1,002 | 3.453125 | 3 | [] | no_license | let buttonCountPlusTwo = document.getElementById('buttonCountPlusTwo');
let buttonCountMinusTwo = document.getElementById('buttonCountMinusTwo');
let countTwo = document.getElementById('buttonCountNumberTwo');
let count2Two = document.getElementById('numTwo');
let numberTwo = 0;
let priceTwo = 150;
let calculateTwo = d... | true |
3ebb6a9bc8f5eec02998f09d65e8813f1dfb716b | JavaScript | bell21202/p2pApp | /src/helpers/memTypeConverter.js | UTF-8 | 666 | 3.28125 | 3 | [] | no_license | export default(type) => {
// first time loggin in
if (!type)
{
return {"tutor": false, "mentor": false, "scholar": false};
}
// loaded from db
if (typeof type ==='string') {
t = type.includes('1');
m = type.includes('2');
s = type.includes('3');
return {"t... | true |
8fd9824feb1d2fa6886d169400dde82638d877d4 | JavaScript | mmkerai/boldchat-demo | /server.js | UTF-8 | 6,898 | 2.578125 | 3 | [] | no_license | // Boldchat test script for Nodejs
//******** Set up Express Server and socket.io
var http = require('http');
var https = require('https');
var app = require('express')();
var fs = require('fs');
var crypto = require('crypto');
var bodyParser = require('body-parser');
app.use( bodyParser.json() ); // to support ... | true |
f590837936b2e6fb0d6fddbc4308b737657318a3 | JavaScript | JTR354/Frontend-01-Template | /week14/component/src/main.js | UTF-8 | 3,977 | 2.734375 | 3 | [] | no_license | import { createElement } from './createElement'
const data = [
' https://static001.geekbang.org/resource/image/bb/21/bb38fb7c1073eaee1755f81131f11d21.jpg ',
' https://static001.geekbang.org/resource/image/1b/21/1b809d9a2bdf3ecc481322d7c9223c21.jpg ',
' https://static001.geekbang.org/resource/image/b6/4f/b6d65b2f... | true |
9a2f0ef27b2394b5616257affc8c5c5031c86f25 | JavaScript | yzffvinz/html5_css3 | /DomArt/animation/animation.js | UTF-8 | 1,142 | 3.046875 | 3 | [] | no_license | function positionMessage() {
if(!doCheck('id')) return;
var elem = document.getElementById('message');
if (!elem) return false;
elem.style.position = 'absolute';
elem.style.left = '50px';
elem.style.top = '100px';
}
function moveMessage(elemId, stepX, stepY) {
if(!doCheck('id')) return;
... | true |
9911bc6550b692603053895d08335efe057f8b0d | JavaScript | answebdev/Onion-Scraper | /config/routes.js | UTF-8 | 8,841 | 2.71875 | 3 | [] | no_license | var scrape = require("../scripts/scrape");
var headlinesController = require("../controllers/headlines");
var notesController = require("../controllers/notes");
module.exports = function (router) {
router.get("/", function (req, res) {
res.render("index");
});
router.get("/saved", function (req, re... | true |
46393b1748c3d66de633a2072a94ff837372191b | JavaScript | Yasmin-AlGhamdi/In-class-social-media-project | /authentication/src/Contact.js | UTF-8 | 316 | 2.546875 | 3 | [] | no_license | import React, {useState, useEffect} from 'react'
export default function Contact() {
const [number, setNumber] = useState("")
useEffect(() => {
setNumber("0555699110")
}, [])
return (
<div>
<h1> Contact </h1>
<h1> {number} </h1>
</div>
)
}
| true |
e6eabb5564a7cd8e8523da58625577967685d249 | JavaScript | nanghele/redux-intro | /src/reducers/reducer-bad.test.js | UTF-8 | 2,842 | 2.640625 | 3 | [] | no_license | import { INCREMENT, DECREMENT } from '../actions/types'
const ADD = 'adding'
const DEL = 'delete'
const UPDATE = 'update'
const UPDATE_TIME = 'update_time'
const reduce = (state, action) => {
let newState = { ...state }
switch (action.type) {
case ADD:
const id = Object.keys(state).reduce(
(maxId... | true |
fc63d37324048a794e8ba3750e483ef45b2821bf | JavaScript | Jackstone92/Algorithm-Scripting | /1. Basic Algorithm Scripting/10. Chunky Monkey.js | UTF-8 | 1,148 | 4.4375 | 4 | [] | no_license | // ======= Chunky Monkey ========= //
// Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a two-dimensional array.
function chunkArrayInGroups(arr, size) {
//create empty array to add values to later
var holderArray = [];
//while loop c... | true |
2d6e800891bb3a629e3b7c81c13a37e4d364b9eb | JavaScript | jocelyn-yuchiyuan/carebridge | /app/javascript/components/emergencyBtn.js | UTF-8 | 871 | 2.875 | 3 | [] | no_license | const passLocationToEmergencyBtn = (pos) => {
const emergencyBtn = document.getElementById('emergency-button')
if (emergencyBtn) {
const crd = pos.coords;
// console.log('Your current position is:');
// console.log(`Latitude : ${crd.latitude}`);
// console.log(`Longitude: ${crd.longitude}`);
//... | true |
52554b29af91b45d0412195aa0b6853ff2dbe7c0 | JavaScript | shawncook/pure-mke | /src/utils/slugify.js | UTF-8 | 552 | 3.1875 | 3 | [] | no_license | /**
* Slugify a string for use in a URL.
* @param {String} string string to "slugify"
* @return {String} "slugified" string
*/
export default function slugify(string) {
return string.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/\/+/g, '-') // Replace slashes wi... | true |
fa806af95e1591ba9acc5d5499b6e1c891f097a7 | JavaScript | mat250/meta-api-sdk | /test.js | UTF-8 | 2,834 | 2.515625 | 3 | [
"MIT"
] | permissive | var Mapi = require('./index.js');
// var mapi_sdk = new Mapi("prod");
// mapi_sdk.spell("5a072a2b13cd7329eca1450d", [
// {
// "name": "address_departure",
// "value": "36 rue Ernest Renan, 92130 Issy les Moulineaux"
// },
// {
// "name": "address_arrival",
// "value": "1 rue de Rivoli, 75001 Par... | true |
8abb6f35b83c55afc3f2a6278bce205db89c0a1b | JavaScript | lumoslabs/aleph | /app/assets/javascripts/angular/services/model/model_base.js.es6 | UTF-8 | 1,915 | 2.5625 | 3 | [
"MIT"
] | permissive | !(angular => {
'use strict';
function ModelBaseImports($q) {
return class ModelBase {
constructor(resource) {
this._resource = resource;
this.item = {};
}
internalize(item) {
if (item) {
this.item = item;
} else {
this.item = {};
... | true |
510d72ac359417d78bfc5f74676ddd0fc0b0efa6 | JavaScript | EdinsonNM/unu | /commons/libs/compromisopago/compromisopagoingresante.js | UTF-8 | 3,627 | 2.515625 | 3 | [] | no_license | 'use strict';
/* jshint esnext:true*/
var Ingresante = require('../../../models/IngresanteModel.js');
var Alumno = require('../../../models/AlumnoModel.js');
var CompromisoPagoModel = require('../../../models/CompromisoPagoModel.js');
var TasaModel = require('../../../models/TasaModel.js');
var PeriodoModel = require('... | true |
cdb8907a54e8c9715887333c42fc8b7e4db64135 | JavaScript | chepkuruipurity/Codewars | /javascript/twoOldest.js | UTF-8 | 552 | 4.25 | 4 | [] | no_license | // return the two oldest/oldest ages within the array of ages passed in.
let ages=[1,5,87,45,8,8];
function twoOldestAges(ages){
// take an array of numbers, sort by compare function
//introduce new array push the last two and reverse
ages.sort((a,b)=>b-a);
let oldest=ages.shift();
let older=ages.shift()
return [olde... | true |
7a7d4dd5b59b28f93a68e52f18bffb6ab21dcba1 | JavaScript | edofrata/Ecommerce | /js/account_settings.js | UTF-8 | 4,061 | 3.421875 | 3 | [] | no_license |
// function for the account settings
async function update_user(element) {
let email;
let password;
// variable to send the form and needs to return true
let send_form = true;
// the parsed data received
let parsing;
// variable that takes the name for the form
let form_element = elem... | true |
bf9ebbfd13f72a31d29b88fc62e21e3b352b48cf | JavaScript | BeemoLin/test | /includes/chkAccount.js | UTF-8 | 3,176 | 3.0625 | 3 | [] | no_license | var xmlHttp;
var proc;
// 此函式在建立 XMLHttpRequest 物件
function createXMLHttpRequest() {
if (window.ActiveXObject) { // IE
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) { // Other browser
xmlHttp = new XMLHttpRequest();
}
}
// ... | true |
0bf929af1aa66626b6a625c2894499df57576937 | JavaScript | zhengyimeng/vue-model | /src/utils/socket/heartbeat.js | UTF-8 | 1,649 | 3.03125 | 3 | [] | no_license | /**
* 心跳
*/
import moment from 'moment'
const INTERVAL = 5000 // ping 的间隔
const TIMEOUT = INTERVAL * 2 // 超时时间(只能是INTERVAL的整数倍数,超过这个时间会触发心跳死亡事件) 默认为 ping 两次没有响应则超时
const DIE_EVENT = new CustomEvent("die") // 心跳死亡事件 => 超时时触发
export default class Heartbeat extends EventTarget {
constructor(ws, interval, timeout) {
... | true |
717d4c9843d0ede98872aa2e861939cd0a0fe8ba | JavaScript | FranciaMoran/AtronomyWebsite | /astronomy.js | UTF-8 | 8,628 | 2.6875 | 3 | [] | no_license |
$(meteorVideoPopUp)
function meteorVideoPopUp () {
$('#meteor-button').on('click', function(event) {
$('#meteor-dialog').html(theMeteorVideo());
$('#meteor-dialog').dialog('open');
$('#meteor-dialog').parent().css('position','absolute');
$('#meteor-dialog').parent().css('top', $(window).height()*.0... | true |
d714c7b5aa95217c9799ee1854b389909df1ea9b | JavaScript | alexand1r/SoftUni-JavaScript-Fundamentals | /homework/Data Types, Expressions, Statements/Distance in 3D.js | UTF-8 | 256 | 3.59375 | 4 | [] | no_license | function distanceIn3D(input) {
let [a1, b1, c1, a2, b2, c2] = input.map(Number);
let distance = Math.sqrt(Math.pow(a1 - a2, 2) + Math.pow(b1 - b2, 2) + Math.pow(c1 - c2, 2));
console.log(distance);
}
distanceIn3D(['1','1','0','5','4','0']);
| true |
e910684d687951fedca15e231e912dbbf4432ea5 | JavaScript | Allucard79/pogoda | /src/getDate.js | UTF-8 | 239 | 3.3125 | 3 | [] | no_license | export function returnWeekDay(index = 0) {
const weekDays = ['Niedziela','Poniedziałek','Wtorek','Środa', 'Czwartek','Piątek','Sobota'];
let today = weekDays[(new Date().getDay() + index) % weekDays.length];
return today;
} | true |
600e07db92a092ef950e8d562befb611793d503c | JavaScript | TobiasCanabarro/TP_LaboratorioIV_api_rest | /web/controllers/loginController.js | UTF-8 | 1,491 | 2.953125 | 3 | [] | no_license |
let isLogin = () => {
let login = localStorage.getItem("email");
if(login != null){
let body = {};
body.email = login;
let request = new XMLHttpRequest();
request.open('POST', 'rest/login/login', true);
request.setRequestHeader('Content-Type', 'application/json');
... | true |
9747d32868967908526ae64af018772438dfa6cb | JavaScript | nitoloz/salary-report | /filters/range-filter.js | UTF-8 | 4,996 | 2.546875 | 3 | [
"MIT"
] | permissive | class RangeFilter extends BaseFilter {
constructor(areaId, label, dataKey, step = 1, filtersMapKey) {
super(areaId, label, dataKey, filtersMapKey);
this.values = {from: null, to: null};
this.selectedValues = {from: null, to: null};
this.type = FILTER_TYPES.NUMBER_RANGE;
this.... | true |
b4c15d9c1619c824cf2f32a0da9ac30bd9b0e822 | JavaScript | google/filament | /third_party/meshoptimizer/js/benchmark.js | UTF-8 | 2,282 | 2.546875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"CC0-1.0"
] | permissive | var encoder = require('./meshopt_encoder.js');
var decoder = require('./meshopt_decoder.js');
var { performance } = require('perf_hooks');
process.on('unhandledRejection', error => {
console.log('unhandledRejection', error);
process.exit(1);
});
function bytes(view) {
return new Uint8Array(view.buffer, view.byteOf... | true |
f91fb2179259aff0b98fbe889e38537a72fbcba2 | JavaScript | ppseprus/globalxplorer-tile-enhancer | /enhance.js | UTF-8 | 3,995 | 2.515625 | 3 | [
"MIT"
] | permissive | const enabledUrlPartial = 'globalxplorer.org/explore';
const maximumBrightness = 30;
const maximumContrast = 15;
let horizontalLegend,
verticalLegend;
function asPercentage(number) {
return (number * 100).toFixed(1) + '%';
}
function injectLegends() {
if (document.getElementsByClassName('tile-enhancement-legend')... | true |
92bdec96cbb29fba375b0f79495ff76ddf626967 | JavaScript | Irina-wong/blog | /src/resources/static/js/main.js | UTF-8 | 500 | 2.515625 | 3 | [
"MIT"
] | permissive | "use strict";
$(function() {
// return to top of the page
NProgress.start();
$(window).scroll(function(){ // as window scroll
var scrollt = document.documentElement.scrollTop + document.body.scrollTop;
if( scrollt >200 ){
$("#goToTop").fadeIn(400);
}else{
... | true |
6e011731677293614c08458cc24e9c6ab15d0b45 | JavaScript | rayhan999/JavaScriptBasic-PH-Assignment3 | /assignment.js | UTF-8 | 3,227 | 3.9375 | 4 | [] | no_license | // github link: https://github.com/rayhan999/JavaScriptBasic-PH-Assignment3
//--------------------------------------Problem 1-----------------------------------------------------
//Kilometer to Meter Convesion
function kilometerToMeter(kilometer) {
// 1 kilometer = 1000 meter
if (kilometer >= 0) {
... | true |
d14f5c7b2f3ad0f8dd62f39444ee1ad7ecc22fc5 | JavaScript | kimgova/blueloop | /src/main/webapp/js/loop/loopGrid/loopElementCollection.js | UTF-8 | 949 | 2.640625 | 3 | [] | no_license | loopElementCollection = Backbone.Collection.extend({
model: loopElementModel,
byOwner: function (ownership) {
this.each(function(model){
if(ownership === 'Archived'){
if (model.attributes['archived'] === true ){
model.trigger('show')
}
else{
... | true |
b14216f24416f9784b853888ecb7a82d9e169244 | JavaScript | AlecxMoritz/shadrClient | /src/auth/SignIn.js | UTF-8 | 2,102 | 2.515625 | 3 | [] | no_license | import React from 'react';
import { Form, FormGroup, Input, Button } from 'reactstrap';
import styled from 'styled-components';
const SignInHeader = styled.h1`
position: relative;
bottom: .3em;
color: #FF8921
`;
export default class SignIn extends React.Component {
constructor(props) {
super(p... | true |
731720199d51304ce20dcc4093950a56cff84d1d | JavaScript | SidorovWeb/fs | /src/js/modules/switchDarkMode.js | UTF-8 | 575 | 2.6875 | 3 | [
"MIT"
] | permissive | const switchDarkMode = () => {
const switchDarkMode = document.querySelectorAll('.switch-dark-mode'),
body = document.body;
switchDarkMode.forEach((item) => {
item.addEventListener('click', (e) => {
if (body.classList.contains('them-light')) {
body.classList.remove('... | true |
b17100ad54ebe65ac11996a8eec596ebae5ac5c6 | JavaScript | atomiton/HelloTQLjs | /lib/tqlParse.js | UTF-8 | 3,918 | 2.828125 | 3 | [
"MIT"
] | permissive | //
// this module implements conversion of a request object into the server's
// XML format query.
//
// {select: {
// parkingSpace: {sid: '*'}
// }}
//
// {create: {
// stuff
// }}
//
// more to come...
//
TqlError = require('./tqlUtil').TqlError;
//
// module private functions
//
// select transaction
fu... | true |
c00da068f2b300649dc1013eef87363cd197142d | JavaScript | emersonrf227/React-Native | /screens/detalhes/index.js | UTF-8 | 2,591 | 2.515625 | 3 | [] | no_license | import React from 'react';
import { StyleSheet, Text, Image } from 'react-native';
import { SafeAreaView, ScrollView } from 'react-navigation';
import { Container, Header, Content, List, ListItem, Left, Right, Icon, Button } from 'native-base';
import { Linking } from 'react-native';
import Wiki from '../../assets/wiki... | true |
38308478d18ea3daa8fa0a9f7f039caec19c0e89 | JavaScript | usamatahir00004/test | /script.js | UTF-8 | 372 | 2.890625 | 3 | [] | no_license | function calculation(input) {
if (form.displayResult.value === "0") {
form.displayResult.value = input;
} else {
form.displayResult.value = form.displayResult.value + input;
console.log(form.displayResult.value);
}
}
function clearInput() {
form.displayResult.value = eval(form... | true |
af7bf416d007afefe8d3419a795404c12e2908c3 | JavaScript | erikshumkov/techdegree-project-nine | /js/app.js | UTF-8 | 9,200 | 2.765625 | 3 | [] | no_license | // Application ****************** //
// ****************************** //
// Sticky navbar from https://www.w3schools.com/howto/howto_js_navbar_sticky.asp
// When the page get scrolled, use the stickyNav function.
window.onscroll = () => stickyNav();
const navigation = document.querySelector(".navigation--sidebar");
... | true |
e9c98dd162894d3a4cd1c5aa037bc25fad573d75 | JavaScript | srenault-efrei/codeflix.oav.01 | /parseEnv.js | UTF-8 | 680 | 2.8125 | 3 | [] | no_license | const fs = require("fs");
const newFileName = require("./helper")
module.exports = function parseEnv(content) {
let object = {}
let regex = /^([\w]+)=(.+)/g
const lines = content.split("\n")
for (const line of lines) {
let matchLine = line.match(regex);
if (matchLine != null) {
... | true |
dcc8fb87d73f74d3db6d3df2add3871539f5a61a | JavaScript | michael-gia/Giacchetta_Michael_WPF | /finalExam/js/finalExam.js | UTF-8 | 1,264 | 3.671875 | 4 | [] | no_license |
/*
Michael Giacchetta
Final Exam
WPF 1411
11-19-2014
*/
//alert("Testing 1,2,3");
//original item cost (60.00)
var itemCost =prompt("How much does Item #1 cost?");
itemCost =validateMeNum(itemCost);
//The percent that the item is dicounted (40%)
var discountperct = prompt("How much percent off was this item?... | true |
29eb06db563f8635efbae9948279f0e0b8afc82d | JavaScript | d-rat/movie-search | /src/components/App.js | UTF-8 | 1,544 | 2.71875 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import "./App.css";
import Header from "./header";
import Search from "./search";
import Movie from "./movie";
import Footer from "./footer";
const defaultSearch = "https://www.omdbapi.com/?s=redemption&apikey=46a207f6";
function App() {
const [movies, setMovies] =... | true |
dc47aba7c7e4757c9d920e8631ae11265b938e2a | JavaScript | AytacAnil/Mean-Stack-Web-Application | /Server/controllers/AuthController.js | UTF-8 | 2,772 | 2.65625 | 3 | [] | no_license | //Require the express package and use express.Router()
const express = require('express');
const router = express.Router();
const user = require('../models/User');
const session = require('../models/Session');
const jwt = require('jsonwebtoken');
const secretKey = require("../secretKey");
//Check to make sure header i... | true |
ffb75031d73c1ca85b16619e807730a091989161 | JavaScript | CodeTrainerFormation/MEAN | /hello.js | UTF-8 | 618 | 2.828125 | 3 | [] | no_license | var fs = require('fs');
/*
var read = fs.readFileSync('read.txt', 'utf8');
fs.writeFileSync('write.txt', read);
console.log(read);
fs.readFile('read.txt', 'utf8', function(err, data){
fs.writeFile('writeAsync.txt', data, function(err) {
console.log("Copie terminée");
});
});*/
/*fs.mkdir('test');
fs.rmdir('... | true |
f4cbc6239cec88310bfe24a38749ce91acfa37e3 | JavaScript | dbm-network/mods | /actions/await_response_call_action_MOD.js | UTF-8 | 9,577 | 2.5625 | 3 | [
"MIT"
] | permissive | /* eslint-disable no-unused-vars */
module.exports = {
name: 'Await Response Call Action',
displayName: 'Await Response',
section: 'Messaging',
meta: {
version: '2.1.7',
preciseCheck: false,
author: 'DBM Mods',
authorUrl: 'https://github.com/dbm-network/mods',
downloadURL: 'https://github.c... | true |
d472651d07ca13e3b450f55191d01d242d645de7 | JavaScript | 1kohei1/ChromeExtension-Word-Counter | /content_script.js | UTF-8 | 1,810 | 3.265625 | 3 | [
"MIT"
] | permissive | /************ Make a connection ************/
var port = chrome.runtime.connect({name: "background"});
port.onMessage.addListener(function (request) {
if (request.step == 1) {
var num = wordCount();
if (num > 0) {
showWordCount(num, request.today_word_count);
port.postMessage({step: 2, wordCount: num});
}
... | true |
f9287556b94f332ed47c97c7ce2f8d2a1261a223 | JavaScript | DLWCE/nishuihan | /js/index.js | GB18030 | 20,773 | 2.703125 | 3 | [] | no_license | /**
* Created by samsung on 2018/12/6.
*/
var audio1 = document.getElementById("audio1");
window.onload = function(){
audio1.play();
}
$(function(){
//
//for(var i = 0;i < $(".nav-wrap ul li").length;i++){
// $(".nav-wrap ul li")[i].style.backgroundImage = "url(./images/xy/nav_884f8a3.png)";
//... | true |
71f4158e449d87f5cb2407099babdcd923d37aec | JavaScript | openHPI/better_meetings | /BetterMeetingsWithReact/api/controllers/ToDoItemController.js | UTF-8 | 7,200 | 2.53125 | 3 | [] | no_license | /**
* ToDoItemController
*
* @description :: Server-side logic for managing Todoitems
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
module.exports = {
create: function (req, res) {
sails.log('Creation started');
sails.log(req.param('title'));
var title = req.pa... | true |
60624821d9ea45787802ed33842a7c58d3f2f318 | JavaScript | green-fox-academy/Aaron-Xiaoxingchen | /week-01/day-03/product-databases2.js | UTF-8 | 812 | 4.5 | 4 | [] | no_license | /* We are going to represent our products in a map where the keys are strings representing the product's name and the values are numbers representing the product's price.
Create a map with the following key-value pairs.
Product name (key) Price (value)
Eggs 200
Milk 200
Fish 400
Apples 150
Bread 50
Chicken 550
Create... | true |
0c063c712543ed1dfe104d623419a0faac1abf48 | JavaScript | TomCaserta/rollup | /test/function/samples/handle-object-rest-spread-patterns/main.js | UTF-8 | 371 | 3.09375 | 3 | [
"MIT"
] | permissive | const obj1 = {foo: false};
const obj2 = {foo: false};
const {a, ...b} = {a: obj1, c: obj2 };
if (a.foo) {
throw new Error('"a" was not properly declared');
}
a.foo = true;
if (!obj1.foo) {
throw new Error('"a" was not tracked');
}
if (b.c.foo) {
throw new Error('"b.c" was not tracked');
}
b.c.foo = true;
if (!obj2... | true |
813261eeff38245711b20a84715e88572e0cb5f1 | JavaScript | Dutraz/galeria_virtual | /page-result/js/sidenav.js | UTF-8 | 293 | 2.53125 | 3 | [] | no_license | sidebar = false
function changeNav() {
if (!!sidebar) {
document.getElementById("mySidenav").style.width = "0";
} else {
document.getElementById("mySidenav").style.width = "250px";
}
sidebar = !sidebar
}
$('.sidenav a').click(function () {
changeNav()
}); | true |
2d3c2c50aaa7baa333685f153752b9faaf789398 | JavaScript | SleepyWerewolf/haze | /src/components/LoadScript/index.js | UTF-8 | 654 | 2.84375 | 3 | [] | no_license | import { Component } from 'react';
const loadScript = (url) => {
// Adding the script tag to the head as suggested before
const body = document.getElementsByTagName('body')[0];
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
body.appendChild(s... | true |
6499befc8c77249b6c38b9441ecb331b6cab49c6 | JavaScript | Paul-Ukaegbu/calculate-planet-weight | /calculateWeight.js | UTF-8 | 1,432 | 4.46875 | 4 | [] | no_license | // Though an object’s mass remains consistent throughout the universe, weight is determined by the force of gravity on an object. Since different planets have different gravity, the same object would weigh different amounts on each of those planets! Cool, huh?
// Write a function, calculateWeight(). It should:
// hav... | true |
b581e1f32b6b601133bd0774054f03cea2941e4c | JavaScript | cag2050/es6_demo_webpack_160929 | /src/js/es6/箭头函数.js | UTF-8 | 126 | 2.765625 | 3 | [] | no_license | /**
* Created by chenanguo on 2016/9/29.
*/
var sum = (a, b) => {
return a + b;
};
console.log("sum(4,3)=" + sum(4, 3)); | true |
480d2bb9833b2d33713168b8e62d934839828236 | JavaScript | cup-of-Aygiz/siaod_laba2 | /modules/queens/solve.js | UTF-8 | 609 | 2.890625 | 3 | [] | no_license | import {SetQueens} from "./setQueen.js";
import {Print} from "./Print.js";
import {RemoveQueens} from "./removeQueen.js";
export const Solve = (i, boardSize, board,queensQuantity, answers) => {
for (let j = 0; j < boardSize; j++) {
if(board[i][j]===0){
board = SetQueens(i,j,boardSize,board)
... | true |
5cbdf0faf64c7deae28a3956a870c72c379106ae | JavaScript | MayyadahShehadeh/back-practice | /controller/UpdateData.js | UTF-8 | 762 | 2.515625 | 3 | [] | no_license | 'use strict';
const drinksModel = require("../models/Fav");
function updateData(req,res){
const { name,img } = req.body
const id = req.params.id
console.log('in update 1')
drinksModel.find({ _id: id }, (err, data) => {
console.log('in update 2')
if (err)... | true |
57004f4edc5ff2bd8d3665a338e1c08a5040748c | JavaScript | andjela-kostic/AndjelaPHP | /js/regex.js | UTF-8 | 7,674 | 2.59375 | 3 | [] | no_license |
var regUsername=/^([A-ZČĆŽĐŠ][a-zčćžđš]+([ ]?[a-zčćžđš]?["-]?[A-ZČĆŽĐŠ][a-zčćžđš]+)*)$/;
var regEmail=/\b[\w\.-]+@[\w\.-]+\.\w{2,4}\b/;
var regPassword=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z]).{8,}$/;
var regNumber=/[^a-z ]\ *([.0-9])*\d/g;
var br;
var podaciZaSlanje= [];
var ime,user... | true |
fa29e63332cd7613e87ae8785c6293d3cc2364b8 | JavaScript | chiefmoyo15/Dojoassignments | /WebFundamentals/Javascript/random.js | UTF-8 | 470 | 3.5625 | 4 | [] | no_license | function randomChance(quarters){
var countWon = 0;
var countLost = 0;
var coinsWon = Math.floor(Math.random()*100);
while (quarters!=0) {
var chance = Math.floor(Math.random()*100);
if (chance == 1) {
console.log("I won!!!!");
console.log(countWon++);
quarters+=coinsWon;
return ... | true |
4a75f0272ea5198a4bb80ccffbd9d2a108c17485 | JavaScript | adejumodaniel17/Recipe-App | /src/App.js | UTF-8 | 1,341 | 2.5625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import dotenv from 'dotenv'
import Recipe from './Recipe'
import './App.css';
dotenv.config();
//const API_ID = process.env.API_ID
//const API_KEY = process.env.API_KEY
const API_ID="5b825bb6"
const API_KEY="724259bfbbaa7a4e13d32bd36a7d3ebf"
const App = () => {
... | true |
141766adb239a06a1538bc34b9e1c09b8de2a66e | JavaScript | reenz/Bank-tech-test | /spec/BankSpec.js | UTF-8 | 1,720 | 3.046875 | 3 | [
"MIT"
] | permissive | describe ('Feature test',function(){
var bank;
beforeEach(function() {
bank = new Bank();
});
describe('Bank transactions',function(){
it('displays initial balance',function(){
expect(bank.currentBalance()).toEqual(0);
});
it('customer can deposit ',fu... | true |
c4334ef97adb173847714f8ab1d93cae82c729bc | JavaScript | WendyChenj/My-Burger-Builder | /src/components/Burger/Burger.js | UTF-8 | 1,100 | 2.53125 | 3 | [] | no_license | import React from 'react';
import { useSelector } from 'react-redux';
import './Burger.css';
import BurgerIngredient from './BurgerIngredients/BurgerIngredient';
const Burger = React.memo( () => {
const { ingredients } = useSelector( state => ({
ingredients: state.burgerBuilder.ingredients,
}));
... | true |
bcbb3cffb431fd62630f0d3ab0ebe4b74be3977b | JavaScript | jasonlwj/blog-app | /tests/user_api.test.js | UTF-8 | 4,330 | 2.515625 | 3 | [] | no_license | const mongoose = require('mongoose')
const supertest = require('supertest')
const app = require('../app')
const api = supertest(app)
const User = require('../models/user')
const bcrypt = require('bcrypt')
const helper = require('./helpers/test_helper')
describe('when creating a new user', () => {
beforeEach(async() =... | true |
341024c1e10934b4e6c6f541db1cfd8da1891a64 | JavaScript | paulcuth/fxos-weather | /js/main.js | UTF-8 | 11,813 | 2.765625 | 3 | [
"MIT"
] | permissive | var rumble = rumble || {};
(function () {
var cities,
views = [],
days = [],
mainElement = document.getElementsByTagName('main')[0],
cityContainer = document.getElementById('cities'),
scale,
listTemplate,
cityTemplate,// = document.getElementById('city-template').innerHTML,
scrolling = false,
... | true |
ee5f4fc330c7287f6b036dab7e5225aa0cb69d85 | JavaScript | bjnord/coding_practice | /advent-2019/day-10/test/asteroid_map_test.js | UTF-8 | 12,311 | 2.609375 | 3 | [] | no_license | 'use strict';
const expect = require('chai').expect;
const AsteroidMap = require('../src/asteroid_map');
describe('asteroid map constructor tests', () => {
// .#..#
// .....
// #####
// ....#
// ...##
it('should parse 5x5 asteroid map correctly [puzzle example #1]', () => {
const asteroidMap = new Aster... | true |
9568f35b88b4af64e75f07ff0f05d2ba7847db96 | JavaScript | SwapnilPakolu/node-weather-website | /public/js/app.js | UTF-8 | 718 | 2.765625 | 3 | [] | no_license |
const form = document.querySelector('form');
const search = document.querySelector('input');
const message1 = document.querySelector('#message_1');
const message2 = document.querySelector('#message_2');
form.addEventListener('submit',(event)=>{
event.preventDefault();
message1.textContent = 'loading... | true |
d868dab06001e60e11d705f55608d6b0aaa1e6e4 | JavaScript | francisegbujor/MyRetail_Service | /routes/products.js | UTF-8 | 1,663 | 2.90625 | 3 | [] | no_license | const express = require('express')
const router = express.Router()
const Product = require('../models/product')
//Gets all the item in the list
router.get('/', async(req,res) => { // => = function with no name
try{
const products = await Product.find()
res.json(products)
}catch(err){
... | true |
857d1855210117939b9107a38152dc473f55af3b | JavaScript | kma3a/js-challenges | /palindrome/palindrome.js | UTF-8 | 593 | 3.75 | 4 | [] | no_license | function palindrom(word) {
word = word.replace(/[\W]/g, "");
var length = word.length - 1;
var half = Math.ceil(length/2);
for(let i = 0; i < half; i ++) {
if(word[i].toLowerCase() !== word[length - i].toLowerCase()) {
return false;
}
}
return true;
}
console.log(palindrom("tacocat") === true... | true |
845bdf34524fbac5e7ae2be31fd3b5d8b3b72d95 | JavaScript | evilseanbot/tictactoe | /ticTacToe.js | UTF-8 | 3,897 | 2.625 | 3 | [] | no_license | angular.module('ticTacToe', []);
function Ctrl($scope, $http) {
$scope.endState = function(message) {
$scope.outcomeText = message;
$scope.messageVisible= true;
$scope.gameOver = true;
}
// AI marks a space and checks endgame conditions.
$scope.aiMove = function(playerMove, computerTeam) {
$... | true |
d8f2d02f9c164998790665848d4da11fd494ebce | JavaScript | rebeccahernandez/party-exquisite-corpse | /section-2/scripts/app.js | UTF-8 | 1,045 | 2.78125 | 3 | [] | no_license | $(document).ready(function(){
setInterval(function() {
$( ".person-3" ).effect( "pulsate", "slow" )
}, 1000);
setInterval(function() {
$('.person-4').effect('bounce',1000)
}, 1000);
setInterval(function() {
$('.person-1').effect('shake', "slow")
}, 20... | true |
c2420041f8377628ae4e04983b04629370bbdf7f | JavaScript | wahidCarvan/friend-finder | /app/data/friends.js | UTF-8 | 420 | 2.640625 | 3 | [] | no_license | // we need to send the data to our templates
once the user completes the survey i need modal to pop with their match
// friends.js will hold our data
// saving our data in an array of objects
var userData =[
{
"name":"Wahid",
"photo":"add a link",
"scores":[
5,
1,
4,
4,
5,
1,
... | true |
92027f3dcc6e1ead843a614d3f1f91ed290abcd1 | JavaScript | diegomura/react-pdf | /packages/yoga/tests/justifyContent.test.js | UTF-8 | 34,154 | 2.609375 | 3 | [
"MIT"
] | permissive | const Yoga = require('..');
describe('Justify content', () => {
test('justify_content_row_flex_start', () => {
const root = Yoga.Node.create();
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setWidth(102);
root.setHeight(102);
const child0 = Yoga.Node.create();
child0.setWidth(10);
... | true |
ed002d5d759085cb23cdc3e3d044705b410b1fef | JavaScript | chernykhal/triton-test | /src/components/Payment.jsx | UTF-8 | 3,013 | 2.515625 | 3 | [] | no_license | import React from "react";
import axios from "axios";
const Payment = ({ confirmPayment }) => {
const frontCard = React.useRef(null);
const bankLogo = React.useRef(null);
const brandLogo = React.useRef(null);
const numberField = React.useRef(null);
const expMonthDate = React.useRef(null);
const expYearDate... | true |
4d7e2693eee762c1efb9f6314878544e5e7fe72c | JavaScript | migmanu/fullstackopen_course | /part2/data_for_countries_app/src/components/CountryButton.js | UTF-8 | 620 | 3.046875 | 3 | [] | no_license | import React from 'react'
const CountryButton = (props) => {
/* React component with input «entry» and «setQuery». When handler onClick
triggered sets state «query» to that of selected country. Returns button.
*/
const handleQuery = () => {
/* I don't know if this is appropriate to have... | true |
a073f4c1597e477d8cd9cdc983b227f8f5799a77 | JavaScript | richardneililagan/dtx-simfile-catalog-node | /app.js | UTF-8 | 2,212 | 2.65625 | 3 | [] | no_license | const fs = require('fs')
const path = require('path')
const chalk = require('chalk')
const pkg = require('./package.json')
const program = require('commander')
.version(pkg.version)
.option('-p, --parallel [number]', 'Directories to open at the same time', parseInt)
.parse(process.argv)
const filesService = re... | true |
6d696a543374ab9ec9cc9fb3f18a5f2cd1ff87a4 | JavaScript | Robert9310/React | /clothes-market-app/src/components/auth/Login.jsx | UTF-8 | 1,796 | 2.78125 | 3 | [] | no_license | import React from 'react';
class Login extends React.Component{
constructor(props){
super(props);
this.state={
username:'',
password:''
};
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
... | true |
65df3386e26ea40b003834ea27e5773823dd1b43 | JavaScript | Gnu-Sauvage/miaou | /src/main-js/jquery.reveal.js | UTF-8 | 865 | 2.75 | 3 | [
"MIT"
] | permissive | $.fn.scrollToShow = function($element){
var conTop = this.offset().top,
conLeft = this.offset().left,
elTop = $element.offset().top,
elLeft = $element.offset().left,
conHeight = this.height(),
conWidth = this.width();
if (
elTop<conTop ||
elTop>=conTop+conHeight ||
elLeft<conLeft ||
elLeft>=conLeft+... | true |
8162e541d95216e39c2a3eabb7f697b42e1a9cd8 | JavaScript | tooltwist/juiceconfig | /website/lib/standard-stuff.js | UTF-8 | 5,115 | 2.796875 | 3 | [] | no_license | // function api_url_prefix() {
// const { protocol, host, port, prefix } = webconfig
// const urlPrefix = `${protocol}://${host}:${port}/${prefix}`
// return urlPrefix
// }
// function endpoint() {
// const { protocol, host, port } = webconfig
// const endpoint = `${protocol}://${host}:${port}`
// return e... | true |