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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ed17f22ec9fa88a0ae649975ffe59b48a47ce5d8 | JavaScript | qwee5465/zl_boyan | /utils/common.js | UTF-8 | 4,404 | 2.515625 | 3 | [] | no_license | const network = require("network.js");
/**
* 格式化日期
*/
function dateFormat(date, str) {
var Week = ['日', '一', '二', '三', '四', '五', '六'];
str = str.replace(/yyyy|YYYY/, date.getFullYear());
str = str.replace(/yy|YY/, (date.getYear() % 100) > 9 ? (date.getYear() % 100).toString() : '0' + (date.getYear() % 100));
... | true |
96a286ad8ffff07f8d3d1a52200cd837c5583ff4 | JavaScript | chloe-shin/weatherforecast | /src/components/Forecast.js | UTF-8 | 2,209 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | import React, {useState, useEffect} from 'react';
import Card from 'react-bootstrap/Card';
import CardGroup from 'react-bootstrap/CardGroup';
import Row from 'react-bootstrap/Row'
import Col from 'react-bootstrap/Col'
function convertKelvinToCelsius(kelvin) {
if (kelvin < (0)) {
return 'below absolute zero (0 K)';
... | true |
e79f4abdc627f14e2462002f8f7e25d98558a675 | JavaScript | KristenXu/JavascriptUtils | /Research/This/objectThis.js | UTF-8 | 154 | 2.546875 | 3 | [] | no_license | /**
* Created by chainn on 2017/12/7.
*/
var v = 2;
var a = {
v: 1,
ac: function () {
console.log(this.v)
}
}
var b = a.ac;
b()//2 | true |
bd784da057ecf05acdca42f84928bb97c56edd30 | JavaScript | DoCongSon/Js_basic | /lesson_15(JSON)/main.js | UTF-8 | 216 | 3.578125 | 4 | [] | no_license | // cover JSON to Obj Js
var json = '{"firstName":"John", "lastName":"Doe"}'
console.log(JSON.parse(json))
var person = {
firstName: 'Do',
lastName: 'Cong Son',
age: 20
}
console.log(JSON.stringify(person)) | true |
08eb0ed7b12f33e328dab910175cde9b75228e46 | JavaScript | iOcariApp/app | /__test__/utils/validation/validEmail.test.js | UTF-8 | 1,966 | 3 | 3 | [
"MIT"
] | permissive | // from https://blogs.msdn.microsoft.com/testing123/2009/02/06/email-address-test-cases/
import { validEmail } from "utils/validation/validEmail";
import validEmailValidation from "utils/validation/validEmail";
const testEmailValid = email => {
const result = validEmail(email);
expect(result).toBe(true);
};
cons... | true |
452c682141fd3c7e3dab26a6feaad243c91fc6e1 | JavaScript | talkohen/shenkar-show | /controllers/routeController.js | UTF-8 | 2,393 | 2.546875 | 3 | [] | no_license | var mongoose = require ('../database');
var route = require ('../schemes/route');
//Get all routes in database
exports.getAllRoutes = function (req, res) {
route.find ({}).exec (function (err, routes) {
res.json (routes);
return;
});
};
//Search route by id
exports.getRouteById = function ... | true |
7956f2cef38a01071f214cabc72bbe4d73ca5696 | JavaScript | madev1288/fixmycode-violation | /public/js/custom.js | UTF-8 | 5,274 | 2.671875 | 3 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | $(document).ready(function () {
//select the POPUP FRAME and show it
$('#popup').hide().fadeIn(1000);
//close the POPUP if the button with id="close" is clicked
$('#close').on('click', function (e) {
e.preventDefault();
$('#popup').fadeOut(1000);
});
});
/******************************************... | true |
07b622e0d49d0b1bb2b00698856f9512cd665106 | JavaScript | BobrovPavel/glacy | /js/catalog.js | UTF-8 | 1,121 | 2.703125 | 3 | [] | no_license | var searchInput = document.querySelector("#site-search");
var searchLabel = document.querySelector("#site-search + label");
var formEmaillInput = document.querySelector("#email-field");
var formEmaillLabel = document.querySelector("#email-field + label");
var formPasswordInput = document.querySelector("#password-field"... | true |
7955f5443496a6bf458c66395d3a2a880950405d | JavaScript | cemalihsan/Atolye15-and-Kodluyoruz-Javascript-Bootcamp | /Atölye15 and Kodluyoruz Javascript Bootcamp/Week 3/attributes.js | UTF-8 | 456 | 3.28125 | 3 | [] | no_license | // getAttribute, setAttribute and hasAttribute, removeAttribute
const addresses = document.querySelectorAll("input[name='address']")
addresses.forEach(element => {
const inputElement = element
const id = inputElement.getAttribute("id")
const type = inputElement.getAttribute("type")
inputElement.s... | true |
bda91951dba0e25ae90669b79458c85a22694fdc | JavaScript | devpuppet/algos-and-data-structures | /src/problem_solving_patterns/multiple_pointers_pattern/test.js | UTF-8 | 2,239 | 3.21875 | 3 | [] | no_license | const sumZero = require('./sumZero');
const uniqueVal = require('./countUniqueValues');
const duplicates = require('./areThereDuplicates');
const averagePair = require('./averagePair');
const isSubsequence = require('./isSubsequence');
console.log("Naive solution found: " + sumZero.naiveSolution([-3,-2,-1,0,1,2,3]));
... | true |
71093a6d2eb2e20dc27044102ee100a288f46bd1 | JavaScript | JamesVanWaza/codeclinicjs | /builds/codeclinic/js/script4.js | UTF-8 | 2,596 | 2.515625 | 3 | [] | no_license | (function() {
var mySoundContext,
myOscillator,
myGain,
myDistortion,
myOscillator,
originalYPos,
originalXPos,
originalFrequency,
scaleFrequencies = [
110, 123.47, 130.81, 146.83, 164.81, 174.61, 196,
220, 246.94, 261.63, 293.6... | true |
9a97bcf1a6e97f12ddc27f58c42418eec6ecb37b | JavaScript | lvchougui/syyj | /api/lib/utils.js | UTF-8 | 1,086 | 3 | 3 | [] | no_license | var utils = module.exports;
/**
* clone an object
*/
utils.clone = function (origin) {
if (!origin) {
return;
}
var obj = {};
for (var f in origin) {
if (origin.hasOwnProperty(f)) {
obj[f] = origin[f];
}
}
return obj;
};
/**
* 验证手机号码
* @param string 手机号... | true |
daab636d377cddc8d6874859b64cd3c00315aaf6 | JavaScript | nahidalam/dataflow | /server.js | UTF-8 | 7,366 | 3.109375 | 3 | [
"MIT"
] | permissive | /*
To use this file, stick it in the same directory as the files you want to serve.
Next, open a terminal, cd to the file location, and then type "node server.js"
You may want to do this in a Screen on unix/osx, as you will have to leave it running.
This will only serve on the local network by default.
BASIC WEB PAGE ... | true |
a7a419e56a17467b0de5a620b2464983b904adb8 | JavaScript | tammyhlf/fm-web | /src/utils/passwordEncrypted.js | UTF-8 | 1,089 | 2.6875 | 3 | [] | no_license | /**
* 加密登录以及注册的密码
* @author tammy 2019.9.29
*/
import crypto from 'crypto';
/**
* 加盐,sha1产生一个密码
* @param {number} phone-手机号码
* @param {string} password-帐号密码
*/
function passwordEncrypted(key, value){
const algorithm = crypto.createHash('sha256'); //createHash指定加密的hash算法,如'sha1', 'md5', 'sha256', ... | true |
132a6bdb114d0755885035461303ed84fee32f22 | JavaScript | xigongmeigonghe/decoding-nature | /final-project/Decoding Nature Final Project/yufeiGame/ghost.js | UTF-8 | 5,074 | 3.046875 | 3 | [
"MIT"
] | permissive | function Ghost(x,y,img){
this.x = x;
this.y = y;
this.radius = 16;
this.img = img;
this.velocity = 32;
this.movement = false;
this.direction = 1;
this.show = function(){
imageMode(CENTER);
image(this.img,this.x,this.y,32,32);
}
this.move = function(d) {
this.prevDirection = d;
if ... | true |
4f76af601d7728a8ffc56fca5583c0f98cd52ffc | JavaScript | niikawa/customer | /client/scripts/directives/calendar.js | UTF-8 | 5,936 | 2.59375 | 3 | [] | no_license | var myApp = angular.module('myApp');
myApp.controller('CalendarCtrl',['$scope','Calendar', 'Utility', function ($scope, Calendar, Utility)
{
$scope.calendarList = [];
$scope.calendarofMonthList = [];
$scope.isWeek = false;
$scope.isMonth = false;
var isDisabled = false;
$scope.initialize = funct... | true |
778817faffada44b19587e5fe62ad6881d8f9270 | JavaScript | Juliancwt77/unit2M1 | /car.js | UTF-8 | 435 | 2.90625 | 3 | [] | no_license | var Car = function (speed, color, convertible) {
this.speed = 0;
this.color = color;
this.convertible = convertible;
this.accelerate = function(addspeed) {
this.speed += addspeed
}
this.setColor = function(addColor) {
this.color = addColor
}
}
// car.protoptype.accelerate = function(addspeed... | true |
92a800a623a2c36c5b49da2eb596866b0914d3c0 | JavaScript | dzkb/mtasa-discord-bot | /src/library/Server.js | UTF-8 | 3,874 | 2.734375 | 3 | [
"ISC"
] | permissive | "use strict";
const net = require("net");
const crypto = require("crypto");
const EventEmitter = require("events").EventEmitter;
const Session = require("./Session");
const DenyAuthPacket = require("./packets/DenyAuthPacket");
const GrantAuthPacket =... | true |
238aadb22eba28ae84762f6f30b3078e81950e7e | JavaScript | Meunier-Emmanuel/Learning-JS | /1.exercises/08-dom/07-generate-table-one/script.js | UTF-8 | 920 | 3.3125 | 3 | [] | no_license | /* becode/javascript
*
* /08-dom/07-generate-table-one/script.js - 8.7: génération d'un tableau (1)
*
* coded by leny@BeCode
* started at 26/10/2018
*/
// NOTE: don't focus on the existing code structure for now.
// You will have time to focus on it later.
// (() => {
// var table = document.createElement("... | true |
57f6b69713c0f0e830577754c131ba3f041a5a4b | JavaScript | w1ndblow/nodejs_learning | /3rd_tutorial/tests/makebuffer.test.js | UTF-8 | 480 | 2.625 | 3 | [] | no_license | import makeBuffer from '../src/makebuffer.js';
var buffer = makeBuffer();
describe('Buffer', function() {
var buffer = makeBuffer();
it('should be string', function() {
buffer('Замыкания');
buffer(' Использовать');
buffer(' Нужно!');
expect(buffer()).toBe('Замыкания Использовать Нужно!');
});... | true |
1457c0efbcd1fb656adb72513f9c5a5cfcb3ad0b | JavaScript | gathurian/WebGL | /SW5/WireFrame.js | UTF-8 | 3,936 | 3.015625 | 3 | [] | no_license | //
// Computer Graphics
//
// WebGL Exercises
//
// Register function to call after document has loaded
window.onload = startup;
// the gl object is saved globally
var gl;
// we keep all local parameters for the program in a single object
var ctx = {
shaderProgram: -1,
aVertexPositionId: -1,
... | true |
dd973790a91c16df1018b9c177a78968941cf62d | JavaScript | ringmaj/ringmaj.github.io | /src/sat.js | UTF-8 | 9,951 | 2.625 | 3 | [] | no_license | import * as THREE from "three";
import { SelectiveGlow } from "./SelectiveGlow.js";
import { clone } from "three/addons/utils/SkeletonUtils.js";
import { View } from "./View.js";
import { Outline } from "./Outline.js";
if (View.MUTE_LOGS) console.log = function () {};
function setup() {
// this.ONLY_SCENE_ZOOM = t... | true |
9f8cc9a43374cbe8674d726a59ca3437f524a398 | JavaScript | Adrian2305/codigo-virtual-3 | /Semana5/Dia3/02-date.js | UTF-8 | 1,575 | 4.15625 | 4 | [] | no_license | // Date() clase cuyos objetos trabajan con fechas
let hoy = new Date();
console.log(hoy);
/**
* getFullYear(); retorna el año de una variable de tipo fecha
*/
let anioActual = hoy.getFullYear();
console.log("Año Actual: ");
console.log(anioActual);
/**
* getMonth() retorna el mes de una variable de tipo fecha
* R... | true |
21f6a38145960c415845168d9adfdb6e59ad75a5 | JavaScript | takuu/js-demos | /todolist/js/components/list.js | UTF-8 | 1,007 | 2.65625 | 3 | [] | no_license | var React = require('react');
var TodoActions = require('../actions/TodoActions');
var TodoStore = require('../stores/TodoStore');
var List = React.createClass({
getInitialState: function() {
return {
name: this.props.name || ''
};
},
removeMe: function() {
console.log('... | true |
83a0640f76afdf51240f0827e8506ae66667c2b4 | JavaScript | sjdodge123/interstellar | /public/Game/gameObjectBuilder.js | UTF-8 | 1,075 | 2.796875 | 3 | [] | no_license |
function spawnAsteroidsRandom(evt) {
var inner = 4 + Math.floor(Math.random() * 30);
var outer = inner + Math.floor(Math.random() * inner);
var assTard = new Asteroid(Math.random() * world.width, Math.random() * world.height,inner,outer,0,'white');
asteroids.push(assTard);
gameObjectList.push(assTard);
}
functi... | true |
b386c86bcb53b40a35232ce8d93eccbbbf499fbc | JavaScript | cxiaolng/weChat | /app/static/js/my_room.js | UTF-8 | 1,686 | 2.734375 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
// 获取后台数据
get_room_list("1");
// 进入房间
});
// 获取房间列表
function get_room_list(page){
$.ajax({
url: urlPath + '/my_rooms',
type: "GET",
success: function(data){
if(data == undefined){
$(".room-list").append("暂无数据");
... | true |
f3a1f979d87552528123ab5879975f9409479d87 | JavaScript | salmondev/MEAN-Stack-pnr | /backend/backup.js | UTF-8 | 2,130 | 2.84375 | 3 | [] | no_license | // 1. import express ด้วยการใช้ require
const express = require('express');
const mongoose = require('mongoose')
// 2. express() เป็นฟังค์ชั่น และ assign ไว้ที่ตัวแปร server
const server = express();
server.use(express.json())
mongoose.connect('mongodb://128.199.208.132:27017/product', { useNewUrlParser: true })
... | true |
a0d74437e99e1fb0c3fcbf013f514c6d87387687 | JavaScript | Bauffeuvre/kumojin | /kumojin-api/src/components/ActualTime.jsx | UTF-8 | 919 | 2.8125 | 3 | [] | no_license | import React from 'react'
import moment from 'moment'
class ActualTime extends React.Component {
constructor(props) {
super(props);
this.state = {
time: new Date()
};
}
componentDidMount() {
this.intervalID = setInterval(
() => this.tick(),
1000
);
}
componentWillUnmount... | true |
a157801eb87a7782e001e5325411ae6c1193aa13 | JavaScript | eshamay/rasputin | /report_file.js | UTF-8 | 1,175 | 2.703125 | 3 | [] | no_license | var fs = require('fs');
var through = require('through');
var split = require('split');
module.exports = {
// Load and parse all the reports into an array that is passed into the supplied callback
loadReports: function(filename, callback) {
filename = filename || defaultFilename;
fs.exists(fi... | true |
862e0a1da5b7181445dcf443990aa56e74df60f8 | JavaScript | Arup-datta/Weather-App | /src/styles/images.js | UTF-8 | 613 | 2.609375 | 3 | [] | no_license | import React from 'react'
import one from "../images/1.jpg";
import two from "../images/2.jpg";
import three from "../images/3.jpg";
import four from "../images/4.jpg";
import five from "../images/5.jpg";
// import imageFolder from "../images/";
export const images = () => {
// Need to modify this function when ... | true |
71d8b5fde4d3f31f3fc49e800838bce83373610c | JavaScript | soundarkarunagaran/formBuilder-2 | /unitTests/specs/types/tier0/text.spec.js | UTF-8 | 1,715 | 2.8125 | 3 | [
"MIT"
] | permissive | /**
* Testing text data-type
*
* Regex type
*/
'use strict';
describe('The text data-type', function(){
var testContainer = window.formBuilderTesting.testContainer;
var chars = window.formBuilderTesting.chars;
var batchTest = window.formBuilderTesting.batchTest;
var typeName = 'text';
var type = $.formBuilder... | true |
f5e0c6897fa0899ac66dd7587dc03f78ac988c7c | JavaScript | monody517/dom-1 | /main.js | UTF-8 | 809 | 2.78125 | 3 | [] | no_license | const div = dom.create('<div>newDiv</div>')
// dom.wrap(test,div)
// dom.remove(test)
// const empty = dom.empty(window.test)
// console.log(empty)
// dom.attr(test,'title','hi,i')
// console.log(dom.attr(test,'title'))
// dom.text(test,'111')
// dom.style(test,{color: 'red'})
// dom.style(test,'color','red')
// ... | true |
65a0013994b2e8275282dd8879afe29c6ddb8137 | JavaScript | keigokimura/Omote-IoT-remote | /scripts/historyList.js | UTF-8 | 851 | 2.953125 | 3 | [] | no_license | $(function(){
init().then(result => {
getHistoryofWater().then(result => {
setCurrentJpy().then(result2 => {
setHistory(result);
dispHistory();
});
});
});
});
//全期間リスト表示
function dispHistory() {
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth();
var len = waterH... | true |
ddaec56c9320c5682595e4be5a0a52ae7f949434 | JavaScript | gildolev/react-exercises2 | /src/Filter/Filter.js | UTF-8 | 599 | 2.828125 | 3 | [] | no_license | import React, {useState} from 'react';
import './Filter.css';
function Filter() {
const[value,setValue]=useState('');
const [items] = useState([
'Big fox',
'Small elephant',
'Big ant',
'Small dinosaur',
'Medium dog'
]);
return (
<div className="Filter">
<p>Filter the list as you type.</p>
<in... | true |
bdef86057a61792eccfb0e4c9a42988e8fff5898 | JavaScript | karalkou/js-computer-science-mentoring_hometasks | /recursion-and-loops/recursion.js | UTF-8 | 3,087 | 3.9375 | 4 | [] | no_license | /**
* This recursive algorithm helps to count greatest common divisor (GCD)
* @param a {number}
* @param b {number}
* @return {number}
*/
function euclidianAlgorithmRecursive(a, b) {
if ( a !== 0 && b !== 0 ) {
if ( a > b ) {
return euclidianAlgorithmRecursive(a % b, b)
} else {
return eucl... | true |
eac163bc6fc3f677af3eb283de72b18ade81438a | JavaScript | emveleva/Programming-Basics-JS | /More Exercises - Drawing Figures/sunglasses.js | UTF-8 | 403 | 3.09375 | 3 | [] | no_license | function sunglasses([n]) {
console.log('*'.repeat(2 * n) + ' '.repeat(n) + '*'.repeat(2 * n));
for (let row = 1; row <= n - 2; row++) {
let middle = (row === Math.ceil((n - 2) / 2) ? '|' : ' ').repeat(n);
console.log(`*${'/'.repeat(2 * n - 2)}*${middle}*${'/'.repeat(2 * n - 2)}*`);
}
con... | true |
f238943f867a66856e2cfde41c1864c8c0df7672 | JavaScript | Smebbs/it2810-prosjekt1 | /script.js | UTF-8 | 4,303 | 3.140625 | 3 | [] | no_license | $("document").ready(function() {
// Set up documentation
let documentation = "#doc-layout, #doc-art, #doc-jquery, #doc-testing, #doc-sources"
$(documentation).hide();
$("#btn-show").click(function() {
if ($(documentation).is(":hidden")) {
$(documentation).show();
}
el... | true |
5ceabd204686ad9aeda2d92af2a99700264ca458 | JavaScript | dvwhite/sleep-tracker-be | /api/routes/users/users-router.js | UTF-8 | 4,952 | 2.640625 | 3 | [
"MIT"
] | permissive | const express = require("express");
const jwt = require("jsonwebtoken");
const router = express.Router();
// Db helpers, utils
const { find, findBy, update } = require("./users-model");
const { errDetail, sanitizeUser } = require("../../utils/utils");
// Objects
const authError = {
message: "Invalid credentials",
... | true |
f58688de37ea408541ff101191948d3a91c67c26 | JavaScript | MJbae/200620_PlayGames_JS | /움짤검색기/Vicky/components/SearchResult.js | UTF-8 | 560 | 2.84375 | 3 | [] | no_license | function SearchResult(data, target) {
if (!(this instanceof SearchResult)) {
throw new Error('error: SearchResult must be called with new!');
}
this.images = data;
this.targetContainer = target;
this.render = () => {
const htmlString = `${this.images
.map(
(image) => `<li><img src="${i... | true |
88db864ff884ba4b80a3fe48ee99dca0e580d426 | JavaScript | saiftase/ganon | /lib/objectPick.js | UTF-8 | 1,566 | 3.6875 | 4 | [
"MIT"
] | permissive | /**
* Returns an Object composed of picked object properties.
*
* var obj = { name: "Aaron", age: 32, cake: { cat: 12 } }
*
* -- Admits alien keys as undefined
* objectPick(obj, ["name", "bing"]);
* >> { name: "Aaron", "bing": undefined }
*
* -- Allows nested picks
* objectPick(obj, ["age", ["cake",["cat... | true |
85cb86dbf28f4e91fa7cdf909d2fd8016c9e0427 | JavaScript | zaid-saadeh93/cars | /test.js | UTF-8 | 948 | 2.671875 | 3 | [] | no_license |
var num1 =parseInt(prompt('Enter the first num'))
var num2 =parseInt( prompt('Enter the second num'))
function sum(x,y){
return x+y ;
}
function addImage(){
return'<img src="var num1 =parseInt(prompt('Enter the first num'))
var num2 =parseInt( prompt('Enter the second num'))
function sum(x,y){
return x+... | true |
13e21d9cd2be4a594d453cbeda19c3c48319417e | JavaScript | anotherminh/Pixelate | /app/assets/javascripts/components/pages_buttons.js.jsx | UTF-8 | 1,301 | 2.71875 | 3 | [] | no_license | (function(root) {
'use strict';
root.PagesButton = React.createClass({
render: function () {
var currentPage = parseInt(this.props.currentPage);
var maxPageNum = Math.ceil(DrawingsStore.getDrawingsCount() / 20);
var pages = [currentPage];
// try to add 2 of the previous pages, if they a... | true |
dd9deb47e9e57d36fc923cdfbb0a6750650dcb68 | JavaScript | kalashnikoffee/OOP_Template-Engine | /lib/generateMainHtml.js | UTF-8 | 1,502 | 2.8125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | const generateCard = require("./generateCard.js");
function generateMainHtml(team) {
let cardsHtml = "";
for (let member of team) {
cardsHtml += generateCard(member);
}
return `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-... | true |
632fae3abf873fb120b51af0fba4bae8b326b39d | JavaScript | Daesuh/daesuh.github.io | /bdotimers/js/app.js | UTF-8 | 7,538 | 2.875 | 3 | [] | no_license | var clock = document.getElementById('clock');
function clockFunc() {
var timo = new Date();
var hours = timo.getHours();
var minutes = timo.getMinutes();
var seconds = timo.getSeconds();
var ampm = hours >= 12 ? 'pm' : 'am';
hours = hours % 12;
hours = hours ? hours : 12; // the hour '0' sh... | true |
39f496abc08ce4a4ea73d8431c5c5771c01cab02 | JavaScript | prateeksharma0112/WebLiveMay21 | /Lecture-19/Async-Await/app.js | UTF-8 | 1,257 | 3.890625 | 4 | [] | no_license | // Async - Await
// async function add(x, y) {
// if (typeof x !== 'number' || typeof y !== 'number') {
// throw "x and y are not a number"
// }
// return x + y;
// }
// const p = add(4, 5);
// p.then((data) => {
// console.log("Inside Resolve")
// console.log(data);
// })
// .catch((er... | true |
2c529b32033d31f09fb7394054010a462f41063c | JavaScript | qubitnju/qubitnju.github.io | /JS/gradual_1.js | UTF-8 | 655 | 2.765625 | 3 | [] | no_license | console.clear();
const elApp = document.querySelector("#app");
const elBackgrounds = Array.from(document.querySelectorAll(".background"));
const elArticles = Array.from(document.querySelectorAll(".content article"));
elArticles.forEach(article => {
article.addEventListener("click", e => {
const index = el... | true |
0e094fd64450578d9413e1485a0c8ae0053f6ff5 | JavaScript | eddieb2/fcc_coding_challenges | /JavaScript_Algorithms_and_Data_Structures_Projects/roman_numeral_converter.js | UTF-8 | 2,187 | 4.375 | 4 | [] | no_license | /*
JavaScript Algorithms and Data Structures Projects: Roman Numeral ConverterPassed
Convert the given number into a roman numeral.
All roman numerals answers should be provided in upper-case.
*/
/** Number to Roman Numeral Converter
* - Converts a whole number to a Roman Numeral (up to 9999)
*
* @param {Number... | true |
9ed6e6945e95c583509de222e9e4684f7e5f7d5b | JavaScript | gsmile-star/actividades_pendientes | /Actividad5_todolist-kevin-logic/src/js/main.js | UTF-8 | 2,064 | 3.5625 | 4 | [] | no_license | let list = [
{
id: 1,
name: "Replicar el eje del profe",
done: false,
},
{
id: 2,
name: "Replicar el eje del profe 2",
done: true,
},
{
id: 3,
name: "Replicar el eje del profe 3",
done: false,
},
{
id: 4,
name: "Replicar el eje del profe 4",
done: false,
}... | true |
1c89bde1793cd47b1a82a9d345072a29a4f3839c | JavaScript | Thalyson42/tabela-de-classifica-o | /index.js | UTF-8 | 6,175 | 3.34375 | 3 | [
"MIT"
] | permissive | var players = [];
var ids = 0;
function addPlayer() {
const playerName = document.getElementById("playerName");
const photoUrl = document.getElementById("photoUrl");
const name = playerName.value;
const photo = photoUrl.value;
const player = {
id: ids,
name: name,
photo: photo,
win: 0,
... | true |
7716c5c1c25c75fb2c73b8eb6d0cc48523b4b3d3 | JavaScript | mcli28/HTML-CSS-JS | /learninghtml5gameprogramming/chapter1/geolocation.js | UTF-8 | 555 | 2.609375 | 3 | [] | no_license | if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (pos) {
var latitude = pos.coords.latitude;
var longitude = pos.coords.longitude;
var options = {
position: new google.maps.LatLng(latitude, longitude),
title: "Your location"
}
var marker = new google.maps.Circle({
map... | true |
30fe2f05c02bcd1abe2a4b52f681a3deff78f551 | JavaScript | richwbanks/Weather-API | /js/Weather_API.js | UTF-8 | 11,300 | 3.234375 | 3 | [] | no_license | //Miami
$.getJSON("https://api.openweathermap.org/data/2.5/weather?q=Miami&units=imperial&appid=eac9ea6079578a93ed7d1b5fc9ce3c3c", function(data) {
console.log(data);
var icon_MI = "http://openweathermap.org/img/w/" + data.weather[0].icon + ".png";
var temp_MI = Math.floor(data.main.temp);
var weather_MI = data.wea... | true |
0c160f1eaaba9a676d052963e0f048f72e257bf7 | JavaScript | Suha19/Fashion-Scraper | /routes/article-api-routes.js | UTF-8 | 2,218 | 2.640625 | 3 | [] | no_license | var db = require("../models");
var axios = require("axios");
var cheerio = require("cheerio");
var express = require('express');
var router = express.Router();
// router
// =============================================================
router.get('/', function(req, res, next) {
db.Article.find({})
... | true |
a52367a2260bdcab268e4d668fa767024b6fa16b | JavaScript | VaidasMakstutis/bit-javascript | /2/fifth_task.js | UTF-8 | 1,922 | 3.59375 | 4 | [] | no_license | function rand(min, max) { //funkcija generuoja atsitiktinius skaicius uzduotame intervale
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
let x = rand(-10, 10);
let y = rand(-10, 10);
let z = rand(-10, 10);
let xNumberLowerThanZero; //simbolis... | true |
1f518082757179399b531da0e05c82fb0204f174 | JavaScript | PascalLuginbuehl/Minigame | /dist/common/Vector.js | UTF-8 | 2,061 | 2.9375 | 3 | [
"MIT"
] | permissive | "use strict";
var V = (function () {
function V(x, y) {
if (typeof (x) == "object") {
this.x = Math.round(x.x * 10) / 10;
this.y = Math.round(x.y * 10) / 10;
}
else {
this.x = Math.round(x * 10) / 10;
this.y = Math.round(y * 10) / 10;
}... | true |
6be4147607eed52bf36e33ffaf82588e3836f27e | JavaScript | EnochMtzR/TypeScript | /javaScriptBugs.js | UTF-8 | 351 | 3.671875 | 4 | [] | no_license | const josias = {
name: "josias",
age: 25,
sayHi: () => {
console.log(`Hi my name is ${this.name}`);
}
};
const abner = {
name: "abner",
age: "20"
};
const receivePersonAndSayHi = person => {
person.age = person.age + 25;
console.log(person.age);
person.sayHi();
};
receivePersonAndSayHi(josias);... | true |
26d4e534358667b254e515b94d9417834965f9ee | JavaScript | soundstep/soma-template | /tests/spec/api/events.js | UTF-8 | 25,205 | 2.8125 | 3 | [
"MIT"
] | permissive | describe("api - events", function () {
beforeEach(function () {
createContainer();
createTemplate();
});
afterEach(function () {
disposeTemplate();
disposeContainer();
});
it("parse event", function () {
ct.innerHTML = '<button id="bt1" data-click="clickHandler()">click</button><button id="bt2" data-m... | true |
61528d1266e71bc933126f1ace8198078a236746 | JavaScript | shuklaAk14/myAngular | /third.js | UTF-8 | 2,376 | 2.90625 | 3 | [] | no_license | const tt = require('./mods');
const mt = require('./mods2');
const nt = require('./mods3');
const bact = require('./fourth');
const bArr = require('./sixth');
// console.log(tt);
// mt.name = "Guruvayurappan";
// console.log(mt);
// // console.log(nt());
// let ar = nt().split(';');//converting string to a... | true |
50b28e2ceb6415c5c00ecc7106fad8d97f8a11c6 | JavaScript | lijile/blog | /blog-ui/src/main/webapp/web/js/editor.js | UTF-8 | 993 | 2.53125 | 3 | [] | no_license | /**
* Created by test on 12/20/2017.
*/
$(function(){
$(".submitArticle").click(function () {
$("#myModal").modal("show");
});
$(".inputType input").on("keydown",function(e){
//回车事件
var keyCode = e.keyCode;
switch (keyCode){
case 13:
... | true |
6c5f4a4bfccb979fbecebb0162ffdc775da33dde | JavaScript | Shin-John/SeleniumHQ-Webbot | /index.js | UTF-8 | 1,956 | 2.78125 | 3 | [] | no_license | const {Builder, By, Key, util, WebElement, WebDriver} = require("selenium-webdriver");
const { Keyboard } = require("selenium-webdriver/lib/input");
async function realmLottery() {
let driver = await new Builder().forBrowser("chrome").build();
await driver.get("https://realmstock.com/");
await (awa... | true |
4027cdef590faf33b0f72fb7d78da1117e8ab4a8 | JavaScript | SergeyKudryashov17/almacor | /js/yandexmap.js | UTF-8 | 4,313 | 2.71875 | 3 | [] | no_license | var map,
objectManager;
$(document).ready(function () {
if($('#map-yandex-contacts').length) {
ymaps.ready(initMapContact);
}
if($('#map-yandex-objects').length) {
ymaps.ready(initMapObject);
chooseCategoryObjects();
}
});
// Инициализация карты контактов
function initMapCo... | true |
606f022fc5ba02b5d862909f93d30a75bef819f3 | JavaScript | lcl-1124/mtzhipin | /src/api/index.js | UTF-8 | 807 | 2.625 | 3 | [] | no_license | /*
包含多个接口请求函数的模块
调用ajax函数向后台发送请求
*/
import ajax from './ajax'
//用户注册请求
export const reqRegister = user => ajax('/register',user,'POST');
//用户登录请求
export const reqLogin = ({username,password}) => ajax('/login',{username,password},'POST');
//用户更新请求
export const reqUpdate = user => ajax('/update',user,'POST');
//... | true |
343b5915f4f01d3426bc7d23fef30257826777c1 | JavaScript | ninawtt/CourseRegistrationSystem | /react-client/src/components/ShowCourse.js | UTF-8 | 2,268 | 2.609375 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import axios from 'axios';
import Spinner from 'react-bootstrap/Spinner';
import { withRouter } from 'react-router-dom';
function ShowCourse(props) {
const [students, setStudents] = useState([]);
const [course, setCourse] = useState({});
const [showLoading, set... | true |
bfc6f285dfac5dd45be702e1b5b257da3feeb670 | JavaScript | guimulu/cs-node | /utils/index.js | UTF-8 | 1,086 | 2.65625 | 3 | [] | no_license | 'use strict';
/**
* Monta a resposta padrão para erros de validação
* @param res {Object} O objeto de resposta
* @param erros {Array} A lista de erros de validação
*/
var formatarErrosValidacao = function formatarErrosValidacao(res, erros) {
return res.status(400).json({
message: 'Alguns dados enviados são ... | true |
1a0e8a292124672249cc12dc230347ce4f4a04aa | JavaScript | ZeHaoW/LeetCode | /661/solution.js | UTF-8 | 1,548 | 3.484375 | 3 | [] | no_license | /**
* @param {number[][]} M
* @return {number[][]}
*/
var imageSmoother = function(M) {
var A = M;
var rowindex = 0;
var colindex = 0;
var sum = 0;
var count = 0;
for(var row of M){
for(var j of row){
if(rowindex-1 < 0 && colindex-1 < 0){
sum =... | true |
a684ca4d7738088869ed68a1d874fab468bf8564 | JavaScript | trentspi/binaryBanana | /binarybanana.js | UTF-8 | 2,731 | 3.015625 | 3 | [] | no_license | 'use strict';
var Alexa = require('alexa-sdk');
var APP_ID = undefined; //OPTIONAL: replace with "amzn1.echo-sdk-ams.app.[your-unique-value-here]";
var SKILL_NAME = 'Binary Banana';
/**
* Array containing space facts.
*/
var FACTS = [
"If the last digit of a binary number is 1, the number is odd; if it’s 0, the... | true |
e6af26741ae70d64da0ad7cbabedcc14752032ef | JavaScript | mwazovzky/mw-module | /index.js | UTF-8 | 146 | 2.765625 | 3 | [
"MIT"
] | permissive | module.exports = function(str) {
if(!str) {
str = 'Error. No input provided.';
}
console.log(str);
return str;
} | true |
b58a86fcafdbae0a70c9399e51a03cf6cd6b3d0f | JavaScript | nightmare711/usermap | /src/components/Sidebar1/Weather/WeatherContainer.js | UTF-8 | 2,753 | 2.6875 | 3 | [] | no_license | import React from 'react';
import Weather from './WeatherRes/weather';
import 'weather-icons/css/weather-icons.css';
const API_key = "3daeebf9d8726d3a26ec61b6a29f2e3e";
export class WeatherContainer extends React.Component {
constructor(props) {
super(props)
this.state = {
city:undefined,
cou... | true |
4e685fdc650896555b2e918cb0f2c239191f9b16 | JavaScript | Isrrc/PROJETOS-JS- | /tarefa3/js/tarefa.js | UTF-8 | 209 | 3.046875 | 3 | [] | no_license | function calcular() {
var formulario = document.getElementById("formulario");
var multiplicacao = +formulario.numero1.value * +formulario.numero2.value;
formulario.resultado.value = multiplicacao;
} | true |
d9e49ab8e87f9fce1cfd6040d2a77206486cd2ff | JavaScript | mstahl/big_integer.js | /test/initialization_test.js | UTF-8 | 966 | 2.6875 | 3 | [
"MIT"
] | permissive | var BigInt = require('../lib/big_integers')
var should = require('should')
describe('BigInt', function () {
describe('#initialize', function () {
it('should initialize with a small integer', function () {
var i = new BigInt(1)
i.representation.should.eql([1])
})
it('should initialize with a... | true |
612ba8c3722f00729271eafb590cd2ee9abd0227 | JavaScript | fanswangwei/vue-admin | /node_serve/utils/common.js | UTF-8 | 1,704 | 3.1875 | 3 | [] | no_license | /**
* Created by Wangwei on 2020/2/7.
* 创建文件夹帮助类
*/
var fs = require("fs");
var path = require("path");
// 递归创建目录 异步方法
function mkdirs(dirname, callback) {
fs.exists(dirname, function (exists) {
if (exists) {
callback();
} else {
//console.log(path.d... | true |
1b10daefaa6a5b243fad19229b2393cac0b8c67f | JavaScript | Md-Abdul-Hameed/Assignment | /command/display.js | UTF-8 | 391 | 2.703125 | 3 | [] | no_license | let fs = require("fs");
function readF(files){
for(let i = 0; i < files.length; i++){
let exist = fs.existsSync(files[i])
if(exist){
fs.readFile(files[i],"utf8",(err,data)=>{
if(err){
console.error(err);
return;
}
console.log(data);
})
}else{
conso... | true |
eb046f66c42bbfc011a5e036ad3dc456ee8795bd | JavaScript | isaiahaiasi/idoit-task-tracker | /src/save_local.js | UTF-8 | 2,380 | 2.796875 | 3 | [] | no_license | import ModelBase from './model/modelBase';
import Task from './model/task';
import Project from './model/project';
import Directory from './model/directory';
import defaultData from './demo_dir.json';
const _getConstructor = (saveableItemLiteral) => {
// This is so annoying, because I feel like I'm close to being cl... | true |
ef3347294c92fc9f7fc6e6d821e56999d58dbbcd | JavaScript | missMHWGO/txzcky | /txzc/static/js/scripts/index_ori.js | UTF-8 | 14,670 | 2.75 | 3 | [
"MIT"
] | permissive | ;
(function(win) {
var rem = win.innerWidth / 16;
var em = win.innerHeight / 16;
var canvas = document.getElementById('photo');
var ctx = canvas.getContext('2d');
canvas.width = win.innerWidth;
canvas.height = win.innerHeight;
var say;
var image_nopic = new Image();
ima... | true |
f92101aabd2fafc0c038501449ad2d9a66d9afe4 | JavaScript | nkorganci/my-js-folder | /CoodingCamp/BasicJavaAndES6/L05_Functions.js | UTF-8 | 2,556 | 4.71875 | 5 | [] | no_license | //Functions
console.clear();
//--> Reusable JavaScript with Functions
function f() {
console.log("call function");
var a = 2;
console.log(a)
}
f();//You can call as much as you want
//--> Passing Values to Functions with Arguments
function f1(a, b) {
console.log(a, b);
}
f1(5, 9);
function f2(a,... | true |
96637d738ecd4b7413f6a1bb97240daf709ee888 | JavaScript | shogunsea/learnyounode | /firstio.js | UTF-8 | 3,270 | 3.90625 | 4 | [] | no_license | // #####################################################################
// ## ~~ MY FIRST I/O! ~~ ##
// #####################################################################
// Write a program that uses a single synchronous filesystem operation to read a file and prin... | true |
2eb2a1ce120aedc27bc01b53de77cba8be60b94b | JavaScript | CourteousBin/NodeJs | /node_one/03-3/readFile.js | UTF-8 | 377 | 3.09375 | 3 | [] | no_license | /*
练习
- 读取文件夹,判断文件夹的内容是文件还是文件夹
*/
var fs = require('fs');
fs.readdir('./fs_Test',(err,files)=>{
for(var i = 0;i<files.length;i++){
var resutl = fs.statSync('./fs_Test/'+files[i]);
if(resutl.isFile()){
console.log(files[i] + '是文件');
}else {
console.log(files[i] + '是文件夹');
}
}
}); | true |
db69c84b1b26d5183dea150fcf67fc3b66cdc1c6 | JavaScript | 343829084/500lines | /web-server/01-echo-request-info/server.js | UTF-8 | 1,050 | 2.609375 | 3 | [
"MIT",
"CC-BY-3.0"
] | permissive | var http = require('http');
var template = require('es6-template-strings');
var page = '<html>' +
'<body>' +
'<h1>Nitinat/Node V1.0 Page</h1>' +
'<table>' +
'<tr> <td>Date and time</td> <td>${date_time}</td> </tr>' +
'<tr> <td>Client host</td> <td>${client_host}</td> </tr>' +
'<tr> <td... | true |
78fbd6210fa7e2d007de08f6db2a92e21727be3c | JavaScript | kirubhag/loader | /js/loader.js | UTF-8 | 4,749 | 2.765625 | 3 | [] | no_license | function inherit(baseClass) {
function inheritance() {};
inheritance.prototype = baseClass;
return new inheritance();
}
var library = {
/*global variable declaration goes here*/
scriptTag: null,
linkTag: null,
urlRegEx: /^(ftp|http|https):\/\/[^ "]+$/,
allowedType: ["js", "cs... | true |
63179dcf23416a2a42570543f1bce383c42fda4d | JavaScript | jamil4128/task-manager | /src/playground/promise-chaining-task.js | UTF-8 | 718 | 2.578125 | 3 | [] | no_license | require("../db/mongoose")
const Task = require("../model/task")
// Task.findByIdAndDelete("5f395f974457f3392cfe427f").then((task) => {
// console.log(task)
// return Task.countDocuments({ completed: false })
// }).then((result) => {
// console.log(result)
// }).catch((e) => {
// console.log(error)
// }... | true |
6cfcaca7f4f58465eab11d3b1d8557ba15276344 | JavaScript | KyleMaulsby/Set-Card-Game | /card-arr.js | UTF-8 | 6,556 | 2.828125 | 3 | [] | no_license | 'use strict';
//(function(){
const color = ["Red","Green","Purple"];
const fill = ["E","H","F"];
const amount = ["1","2","3"];
const shape = ["D","S","O"];
const path =["M25 0 L50 50 L25 100 L0 50 Z",
"M38.4,63.4c0,16.1,11,19.9,10.6,28.3c-0.5,9.2-21.1,12.2-33.4,3.8s-15.8-21.2-9.3-38c3.7-7.5,4.9-14,4.8-20 c0-16.1-1... | true |
bd7e78e08dc96f805745bd67c63f738013640eaa | JavaScript | TrajkovStefan/HomeWorks | /JavaScript Basic HomeWorks/homework#9/homeworkFetch.js | UTF-8 | 1,120 | 3.6875 | 4 | [] | no_license | let myButton = document.getElementById("myBut");
let myDiv = document.getElementById("myDiv");
let number = prompt(`Enter the number of todo`);
myButton.addEventListener("click", function(){
fetch(`https://jsonplaceholder.typicode.com/todos/${number}`)
.then(response =>{
response.json()
.then(d... | true |
593342af33030d9bd36f5faf2a32d4c86d76f456 | JavaScript | OlivierCroisier/LP4J | /lp4j-emu-web/src/main/resources/web/emulator.js | UTF-8 | 7,806 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2015 Olivier Croisier (thecodersbreakfast.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | true |
2a551f908f1a920c8dbc8dd1c646a5d28a8b2319 | JavaScript | sobanskikarol91/Front-End-Projects | /JS3-Slider/scripts.js | UTF-8 | 584 | 3.265625 | 3 | [] | no_license | var currentNr = Math.floor(Math.random()*5)+1;
var timer1 = 0;
var timer2 = 0;
function hide()
{
$("#slider").fadeOut(500);
}
function changeSlide()
{
currentNr++;
if(currentNr > 5) currentNr = 1;
var file = "<img src=\"slajdy/slajd" + currentNr + ".png\"/>";
document.getElementById("slider").innerHTML = file... | true |
f28180bb8bc2b81cf6256a80d144cbef4d850cfe | JavaScript | piyushsri92/chrome_extension | /modules/scripts/datalistController.js | UTF-8 | 1,818 | 2.703125 | 3 | [] | no_license | /**
* @ngdoc controller
* @requires $scope
* @requires performActionService
* @description
* datalistCtrl act as a main controller to display quotes on daily basis at 10:00 a.m and also on a click of extension.
*/
var myApp=angular.module('datalist.controller',[]);
myApp.controller('... | true |
be589b861a01c9fd6eec2287950856a4111f42d0 | JavaScript | shannonmh/ClickyGame | /src/components/Navbar.js | UTF-8 | 905 | 2.8125 | 3 | [] | no_license | import React from "react";
//import "../styles/Navbar.css";
// By importing the Navbar.css file, it is added to the DOM whenever this component loads
const styles = {
navbar: {
background: "green",
display: "flex",
justifyContent: "flex-end",
color: "white",
fontSize: "1.3rem",
textAlign: "c... | true |
9e792972a6c51ab3888341a3cfe693d5e75d0d79 | JavaScript | leviceccato/astro | /packages/astro/test/fixtures/custom-elements/src/components/my-element.js | UTF-8 | 369 | 2.515625 | 3 | [
"MIT"
] | permissive | export const tagName = 'my-element';
class MyElement extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `<span id="custom">Hello from a custom element!</span>`;
this.innerHTML = `<div id="custom-light">Light dom!</div>`
}
}
customElements.defin... | true |
976d7ed0751f691ef90680a10409647ed2340138 | JavaScript | davidwhitney/StarBastardCore | /Old/HtmlPrototype/game/gameplay/gamecontext.js | UTF-8 | 1,947 | 2.859375 | 3 | [] | no_license | function gameContext(gameboard, updateUiFunction) {
$this = this;
var $gameboard = gameboard;
var $currentRound = 0;
var $currentPlayerTurn = 0;
var $thisTurn = null;
var $currentPlayer = null;
var $updateUiFunction = updateUiFunction;
var $players = new Array();
$players[1] = new p... | true |
9083b30a243bb10c836bb3b2a3cf25b5e77418d6 | JavaScript | softberry/memory-game | /src/lib/tools/middle.js | UTF-8 | 388 | 3.328125 | 3 | [] | no_license | /**
* if total number of images are not even, then one canvas is
* not required. In this case place this in the middle of the layout
* @module
* @param {array} matrix col,row counts of the game.
* @return {integer} index of the mid-element otherwise -1
*/
export function oddMiddle(matrix) {
const [col, row] = m... | true |
b1d477b3bd093309ef5bf46917dbc8e7207ea179 | JavaScript | antoinepairet/cornerstoneTools | /src/imageTools/freehand.js | UTF-8 | 14,377 | 2.65625 | 3 | [
"MIT"
] | permissive | var cornerstoneTools = (function ($, cornerstone, cornerstoneMath, cornerstoneTools) {
"use strict";
if (cornerstoneTools === undefined) {
cornerstoneTools = {};
}
var toolType = "freehand";
var mouseLocation = {
handles : {
start: {
highlight: true,
... | true |
3f24d91c16880bd588458dbb9f140ab4eda9172a | JavaScript | andreassosilo/chickuiz | /highscores.js | UTF-8 | 875 | 3.375 | 3 | [
"MIT"
] | permissive | const highScoresList = document.getElementById('highScoresList')
// Get the high scores from the local storage
const highScores = JSON.parse(localStorage.getItem('highScores')) || []
// Add each scores in the unordered list (li)
highScoresList.innerHTML = highScores.map(score => {
if (score.score > 90) {
return ... | true |
740f0714b915a2f1c9605dc616d09a7c3808b729 | JavaScript | Mr-Ouya/Mr-Ouya.github.io | /burgers/public/assets/javascript/script.js | UTF-8 | 415 | 2.578125 | 3 | [] | no_license | $(function () {
$(".form-group").on("submit", function (event) {
event.preventDefault();
var newburger = name = $("burger").val().trim();
$.ajax("/api/burgers", {
type: "POST",
data: newburger
}).then(function () {
... | true |
c2cf5a4f52b02007846be2c9b54149dad3c7c6ed | JavaScript | mmmajuri/es6-starter | /src/js/components/pages/FirstPage.js | UTF-8 | 585 | 2.515625 | 3 | [] | no_license | import React from 'react';
import 'styles/FirstPage.styl';
const FrontPage = React.createClass({
getInitialState() {
return {showHello: true};
},
toggleShowHello() {
this.setState({showHello: !this.state.showHello});
},
render() {
return (
<div id="FirstPage">
<h1>FirstPage</h1>... | true |
d2758066baffa2eb2b63ad3a9d413858b0b1f186 | JavaScript | csiqueirasilva/dbzccg | /webapp/lib/worker/tween.js | UTF-8 | 8,176 | 2.671875 | 3 | [] | no_license | self.addEventListener('message', function(event) {
if (event.data instanceof Object) {
// var _interpolationFunction = event.data.interpolationFunction;
var _valuesEnd = event.data.valuesEnd;
var _valuesStart = event.data.valuesStart;
var time = event.data.time;
var _startTi... | true |
34711ec3ab1c3e58036c403682b4229b28817b3e | JavaScript | gankaKalyhanka/git-js-courses | /locators.homework.js | UTF-8 | 1,220 | 2.703125 | 3 | [] | no_license | console.log(document.querySelector("input#orb-search-q")) //нашла поле поиска
a = $x('//*[@id="orb-search-q"]') //то же самое через икспас
console.log(document.querySelector("li.orb-nav-worklife").querySelector("a")) //нашла ссылку на один из разделов
console.log(document.querySelector('[href="https://www.bbc.com/wor... | true |
1436676b0d521dad3642a06effcee4cbda4504e5 | JavaScript | raduOprescuOsf/raduOprescuOsf | /controllers/UserController.js | UTF-8 | 2,440 | 2.75 | 3 | [] | no_license | const userServices = require('../services/UserServices');
let session = "";
/*
functions will render the specific pages and will use information from requsets to create a new user or to verify if the user exists
*/
async function getAuthentification(req, res){
res.render('signIn.ejs', {title: "Alibazon", ses... | true |
0af3f207ef1638d5d307f7957242edee2b14356e | JavaScript | Mukola1983/falling_shapes_PIXI | /src/view/gameLoop.js | UTF-8 | 1,977 | 2.59375 | 3 | [] | no_license |
import * as PIXI from 'pixi.js'
import { Utils } from '../model/utils';
import {randShape, gravity} from './../model/shapes'
import { drawShapes, countShapes } from '../controller/shapesControl';
import { UpperUi, curentShapes } from './upperUI';
import { ContainerForShapes} from './containerForShapes';
import { Bott... | true |
71cade777e4e14be607551328ecec0140aa55c6c | JavaScript | rak3n/rak3n.github.io | /index.js | UTF-8 | 4,842 | 3.03125 | 3 | [] | no_license | var obstacle, target, population;
var popSize = 10;
var lifespan = 300;
var maxforce = 0.5;
var count = 0;
var pops = 1;
var p;
var pause = false;
function setup() {
createCanvas(800, 600);
frameRate(60);
population = new Population();
obstacle = new Obstacle();
target = new Target(64);
p = createP();
}
functio... | true |
10fb636b73fcb7a6e426a5c69aa7952bad550608 | JavaScript | kunalkukreja/rque | /lib/producer.js | UTF-8 | 2,117 | 2.59375 | 3 | [
"MIT"
] | permissive | 'use strict';
/**
*
* Wrapper on rqueue. Exposes producer functionality for background processing
*
**/
var RQ = require('rqueue');
var config = require('../../config');
var util = require('util');
var rq = new RQ(config.rq);
/**
*
* Producer constructor
* @param {Object} options: like exchangeObj etc
*
**/... | true |
63d446506f55e115f2d82202dfa9edd82fdbd0bf | JavaScript | frigsamo/BookList | /src/components/BookForm.js | UTF-8 | 1,075 | 2.515625 | 3 | [] | no_license | import React, {useContext, useState} from 'react';
import { BookContext } from '../contexts/BookContext';
const BookForm = () => {
const {addBook} = useContext(BookContext);
const [book,setBook] = useState({})
const handleInput = e => {
setBook({
...book,
[e.target.name]: e.tar... | true |
daad06c1ab17a04777e5d1472305a062246b2d4d | JavaScript | StevenMeiklejohn/Blokus | /client/src/models/specs/gameboard_specs.js | UTF-8 | 3,409 | 3.125 | 3 | [] | no_license | var assert = require('chai').assert;
var GameBoard = require('../gameboard.js');
var GamePiece = require('../gamepiece.js');
describe('GameBoard', function() {
beforeEach(function(){
var rel = [
[2],
[2],
[2],
[2,3],
[]
];
piece = ... | true |