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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4a8dc92550fb89322b0a151c2f3516713dd0b1d3 | JavaScript | niofis/ymxb | /js/light.js | UTF-8 | 13,843 | 2.921875 | 3 | [] | no_license | //For ASCII banners:
//http://www.network-science.de/ascii/
//font: banner3
var lens ={}
lens.Vector3 = (function () {
var v=function (x,y,z){
this.x = x || 0;
this.y = y || 0;
this.z = z || 0;
}
v.prototype.length = function () {
return Math.sqrt(this.x*this.x + this.y*this.y + this.z*this.z);
}
v.pro... | true |
962fce03089ecde29d2bdd0020464e0860da020c | JavaScript | StrawberryCindy/2048 | /js/interrupt.js | UTF-8 | 3,012 | 2.890625 | 3 | [] | no_license | window.onload = function () {
document.body.onselectstart = function(){ return false; } //禁止页面文本选择
ifStart = 0;
/*set the ID of the clock*/
clock = "";
if (!localStorage.getItem("highestGrade")) localStorage.setItem("highestGrade",0);
currentGrade = 0;
iniPosition = new Position();
endPosition = new Positi... | true |
678e2a44b30c491dfdd0d37641401d87df22bd41 | JavaScript | ksokalla/jQuery | /js/4-find-each.js | UTF-8 | 410 | 2.703125 | 3 | [
"MIT"
] | permissive | $(function() {
'use strict';
// wyszukiwanie w dokumencie w body, paragrafów i odwoływaniu się do drugiego z nich
$("body").find("p").eq(1).css({'color': 'green'});
// pętla dodająca do paragrafów klasę - this odnosi się do aktualnie iterowanego elementu - w tym przypadku 'p'
$('p').each(function(index) {
... | true |
568c42e262c5bbd88774cb1cbf8708cb73258a57 | JavaScript | bui4ik/AuctionBackend | /api/routes/privateRoute.js | UTF-8 | 688 | 2.625 | 3 | [] | no_license | const jwt = require('jsonwebtoken');
function privateRoute(req, res, next) {
try {
const token = req.header('Authorization');
if(!token) return res.status(401).send('Access Denied');
const accessToken = jwt.verify(token, process.env.TOKEN_SECRET);
if(accessToken.type !== 'access') {
return res.... | true |
1c7b15e388612293a10642b076993cf7d50e9ae6 | JavaScript | tech-cow/big4 | /webdevbootcamp/back_end/node/basic/hello.js | UTF-8 | 61 | 2.65625 | 3 | [] | no_license | for (var i = 0; i < 5; i++) {
console.log("I love pho");
}
| true |
d173784e19496fbbeb175287545647d8e178e976 | JavaScript | jphelps413/js-practice | /commas.js | UTF-8 | 682 | 3.578125 | 4 | [] | no_license | /*
* Given a positive integer in the form of 123321456654, programmatically
* convert the value into a more human readable format by inserting commas.
* For example: 123 => 123
* 12345 => 12,345
* 123321456654 => 123,321,456,654.
*/
"use strict";
function toHuman(n) {
return [...[...... | true |
206bb3106df8df932bfb37d55175f3ddec2b43e7 | JavaScript | RutvikJogdand/masai-sprint-2.1 | /script.js | UTF-8 | 7,749 | 3.1875 | 3 | [] | no_license | var food_calories=[]
var workout_calories=[]
var mntc_calories
var fitness_goal
function submit_fitness_goals()
{
var get_fitness_goal= document.getElementById("goal").value
fitness_goal=get_fitness_goal
var get_mtnc_calories= document.getElementById("user_maintain_calories").value
mntc_calories=... | true |
fa7f6d3764de3f37b697afcae0bc725a26d50655 | JavaScript | cancamilo/binge-list-react | /src/tools/mathHelper.js | UTF-8 | 385 | 3.671875 | 4 | [] | no_license | export const CalculateMedian = (array) => {
const sortedArray = array.sort( (a, b) => a.rating - b.rating);
const length = sortedArray.length;
if( (length % 2) === 0) {
const median = (sortedArray[(length/2) - 1].rating + sortedArray[(length/2)].rating) / 2;
return median;
} else if... | true |
1725be955dbcfde99765c4483d15710b337e4dea | JavaScript | masterkai/KaohsiungTravelingInfo | /app/assets/scripts/App.js | UTF-8 | 5,455 | 2.625 | 3 | [] | no_license | // 當有滾動的時候
window.onscroll = function () {
// 移動的距離
var scPos = window.pageYOffset;
if (scPos > (window.innerHeight) / 5) {
document.querySelector('.gototp').style.display = '';
} else {
document.querySelector('.gototp').style.display = 'none';
}
};
document.querySelector('.gototp'... | true |
b8a7457bb2dff2e1f4d33b6ac164c1d8b9b926ac | JavaScript | blakecontreras/vulgaritor | /server.js | UTF-8 | 803 | 2.6875 | 3 | [
"MIT"
] | permissive | var express = require('express');
var bodyParser = require('body-parser');
var app = express();
var words = require('./server/words');
var port = process.env.PORT || 8000;
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
app.use(express.static(__dirname));
app.get('/', (req, res) => {
c... | true |
3a8213fb3c97fa2dc076fd9a534f6081a063700b | JavaScript | kirillherz/Learning-JavaScript | /Data Structures/LinkedList/Tests/push.js | UTF-8 | 1,927 | 3.125 | 3 | [] | no_license | describe("push", function () {
it("Добавляет элемент в пустой список", function () {
var list = {_data: [],
_nextAdress: [],
_head: null,
_tail: null,
_size: 0,
_getEmptyCell: function () {
this._data.push(null);
t... | true |
7d94bfa4c7a012cfe1b7bef4ee552438a01c1bcd | JavaScript | bill-lin/parse-server-example | /cloud/aniclub.js | UTF-8 | 14,059 | 2.625 | 3 | [] | no_license | /*jshint esversion: 6 */
const DEFAULT_MAX_MEMBER_NUMBER = 100;
Parse.Cloud.define("getMyClubs", function(request, response) {
var username = request.params.username;
var promises = [];
var clubQuery = new Parse.Query("Aniclub");
clubQuery.equalTo("owner", username);
promises.push(clubQuer... | true |
7c860d0720a123b3d8d814db338b044c5e201423 | JavaScript | MocaCDev/extras | /javascript/LEARNING/otherStuff/main.js | UTF-8 | 855 | 4 | 4 | [] | no_license | // .forEach
let list = []
for(let i = 0; i < 100; i++) {
list.push(i+1);
}
list.forEach(listItem => {
console.log(listItem);
});
// .map
const newList = list.map(w => {
return w+10;
});
newList.forEach(item => {
console.log(item);
});
// .filter
const newList2 = newList.filter(item => {
return item<110;
});
n... | true |
65f098aa0288528c21fe908cf0c8d5ba1a4cbe8b | JavaScript | andbuitra/gpnds | /public/assets/js/comment.js | UTF-8 | 1,244 | 3.03125 | 3 | [
"MIT"
] | permissive | var ref = new Firebase("https://radiant-torch-3037.firebaseio.com/");
function timeStamp() {
var now = new Date();
var date = [now.getMonth() + 1, now.getDate(), now.getFullYear()];
var time = [now.getHours(), now.getMinutes()];
var suffix = (time[0] < 12) ? "AM" : "PM";
time[0] = (time[0] < 12) ? time[0] : ... | true |
6da63b502089307cff522f77dcb372f5a10ffaa0 | JavaScript | zhongxia245/ZX_HT | /Web/assets/js/zhongxia/Form/Common.js | UTF-8 | 3,449 | 2.796875 | 3 | [] | no_license | var zhongxia = (function() {
//合并对象[JS方法]
var extend = function(defaultParams, params) {
var value = new Object();
//0. 如果没传值,则默认为空对象
defaultParams = defaultParams || {};
params = params || {};
//1. 遍历默认的参数,放到新建的对象中
for (key in defaultParams) {
value[... | true |
8777dc8198c5e690d6ad9f53a57a47b64e508241 | JavaScript | Josh-Weidenaar/plotly-challenge | /static/js/app.js | UTF-8 | 3,394 | 2.765625 | 3 | [] | no_license | var data = "./samples.json";
var bubble = d3.select("#bubble")
var gauge = d3.select("#gauge")
var bar = d3.select("#bar")
function init(input){
// Fetch the JSON data and console log it
d3.json(data).then(function(data) {
initDropdown(data)
// console.log(data)
var filtered = filterD... | true |
63f61d2d3b537a50f418314883760d7575ed80cc | JavaScript | hubermar/antsjs | /src/js/Position.js | UTF-8 | 1,016 | 3.453125 | 3 | [] | no_license | const PIXEL_SIZE = 3;
export default class Position {
constructor(x, y) {
this._x = x;
this._y = y;
}
get x() {
return this._x;
}
get y() {
return this._y;
}
translate(h, v) {
let newX = Math.max(this._x + h, 0);
let newY = Math.max(this._y + v, 0);
/... | true |
fd793a1e062b9d55914948622cfe257bc56dc791 | JavaScript | chus55/Gestion_Vacaciones_Unitec | /GestionVacacionesUnitec/Scripts/Login.js | UTF-8 | 1,426 | 2.53125 | 3 | [] | no_license | $(document).ready(function () {
console.log("DOM ready")
$emailInput = $("#USERNAME");
$passwordInput = $("#PASSWORD");
$loginSubmit = $("#SUBMIT");
$dashboardLink = $("#url");
$dashboardLink.hover(function (e) {
e.preventDefault();
console.log("Dashboard link has been ... | true |
efaa6b9612b76961c815bf2a4c6a3e9abb4d49cc | JavaScript | nostaff/vimo | /src/config/history.js | UTF-8 | 6,674 | 2.84375 | 3 | [
"MIT"
] | permissive | /**
* @class History
* @classdesc 通过vue-router的onRouteChangeBefore事件构建本地历史记录
*
* ## 问题
*
* 单页应用的一个需求是需要知道路由切换是前进还是后退, 但是浏览器对路由切换只给了两个事件 `hashchange` 和 `popstate`, 故无从判断当前操作是后退还是前进.
*
* ## 解决方案
*
* 这个类通过vue-router的onRouteChangeBefore事件构建本地历史记录. 当路由切换时, 内建历史记录数组, 类似于一个stack, 这个能正确反映当前app的浏览历史记录.
*
* 完成的功能如下:
... | true |
a6c87c2bac1788d72905eb01f278400e2ba855e4 | JavaScript | kushalsheth91/forum.github.io | /internship code share/src/projectforum.js | UTF-8 | 2,574 | 2.625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import './index.css'
import GetLocal from './getlocalstorage.js';
import SetLocalVote from './setlocalstoragevotes'
import "../node_modules/bootstrap/dist/css/bootstrap.css"
const Forum =()=>{
const [data,setdata]=useState([])
const [count,setcount]=useSta... | true |
b247e8933063970ba92a488230cd60034a13c5f2 | JavaScript | amensiko/tableau_wdc | /Examples/js/stack.js | UTF-8 | 2,521 | 2.671875 | 3 | [
"MIT"
] | permissive | (function() {
// Create the connector object
var myConnector = tableau.makeConnector();
myConnector.init = function(initCallback) {
tableau.authType = tableau.authTypeEnum.basic;
initCallback();
};
//Setting up the Basic Authorization Header
// $.ajaxSetup({
// headers: {'Authoriza... | true |
c41453361ab5b5eb1f8e86b1c1b941419587753d | JavaScript | berekashvili22/DjangoPolls | /PollsProject/polls/static/polls/js/navbar.js | UTF-8 | 398 | 2.765625 | 3 | [] | no_license | const navSlide = ()=> {
const burger = document.querySelector('.navbar__burger');
const nav = document.querySelector('.navbar');
var body = document.getElementsByTagName('body')[0];
burger.addEventListener('click', ()=>{
body.classList.toggle('hide-flow');
nav.classList.toggle('responsi... | true |
e8a73722c1d7f7bd893448aaa5898a083d03190d | JavaScript | tengqingya/react-demos | /d18/index.js | UTF-8 | 2,347 | 3.1875 | 3 | [
"BSD-3-Clause"
] | permissive | //var UserGreeting= React.createClass({
// render:function(){
// return <h1>Welcome back!</h1>;
// }
//})
//
//var GuestGreeting= React.createClass({
// render:function(){
// return <h1>Please sign up.</h1>;
// }
//})
function UserGreeting(props) {
return <h1>Welcome back!</h1>;
}
funct... | true |
f28d286b256957449878c604aec2b135d53b595a | JavaScript | arbabali/chat-app | /src/index.js | UTF-8 | 3,089 | 2.578125 | 3 | [] | no_license | const path = require('path')
const http = require('http')
const express = require('express')
const scoketio = require('socket.io')
const Filter = require('bad-words')
const hbs = require('hbs')
const { title } = require('process')
const {
generateMessage,
generateLocationMessage} = require('./utils/messages')
c... | true |
bff564bc80b6f0d553c128e8ddd62c0b46e65855 | JavaScript | shaungt1/JavaScript | /index.js | UTF-8 | 2,487 | 4.21875 | 4 | [] | no_license | /*Type of loops
***Basic conditional logic****
for
for..of
for..in
while
do..while
****high order array:****
map
Weakmap
forEach
Developer: Shaun P
*/
// would have to writre out n maount of times without loops
// console.loop('loop')
/* for() loop parts intiilization ,condition, and iteration */
// runs the strin... | true |
8fb2f2bb1605e5253e00006c80c37a4d699250b2 | JavaScript | immartinsk/Scraper | /scraper.js | UTF-8 | 2,567 | 2.515625 | 3 | [] | no_license | const request = require('request-promise');
const cheerio = require('cheerio');
const SteamUser = require('steam-user');
const account = new SteamUser();
const config = require('./botConfig.json');
let scrape = async () => {
const url = 'https://atdodmantas.lv/';
const response = await request(url);
con... | true |
33e52c166bc137e7f222094d2707a8a4572e8868 | JavaScript | bruuthais/simple-project-frontend | /src/utils/category/Category.js | UTF-8 | 1,781 | 2.734375 | 3 | [] | no_license | //Carrossel de categorias!!
import "./style.scss";
import React from "react";
import {useHistory} from "react-router-dom";
import {useState, useEffect} from "react";
import AliceCarousel from "react-alice-carousel";
import "react-alice-carousel/lib/alice-carousel.css";
import api from "../../api/api";
const responsive... | true |
7c2648f679501f7321b4fcce469da2c30dad78e5 | JavaScript | petcompufc/v-web | /aula11/questão03/script.js | UTF-8 | 188 | 3.015625 | 3 | [] | no_license | const inp1 = document.querySelector("#inp1");
const p = document.querySelector("#result");
inp1.addEventListener("keypress", (event) => {
event.target
p.innerHTML = inp1.value
})
| true |
529fe016b2a6e5bb0f3720badcbc063a5052afe1 | JavaScript | yskrios/webComponentsJS | /cicloDeVida/app.js | UTF-8 | 389 | 2.953125 | 3 | [] | no_license | class MyCustomeElement extends HTMLElement {
constructor() {
super();
console.log("Hola desde el constructor - Memoria");
}
connectedCallback() {
console.log("Hola desde el DOM");
}
disconnectedCallback() {
console.log("Adios al DOM");
}
}
customElements.define("my-custome-element", MyCus... | true |
da1a811968270a8685251b09c434d10e1a82105a | JavaScript | rohit-gta-tech/spinner | /spinner2.js | UTF-8 | 210 | 2.71875 | 3 | [] | no_license | let i = 0;
let arr = ['| ', '/ ', '- ', '\\ ', '| ', '/ ', '- ', '\\ ', '| \n'];
for (let i = 0; i < 9; i++) {
setTimeout(() => {
process.stdout.write('\r' + arr[i]);
}, i*200+100);
}
| true |
c0f226053cbf3f6f893f73c5c053355af92c7484 | JavaScript | mjedg3/domIntro | /script.js | UTF-8 | 764 | 2.890625 | 3 | [] | no_license | const redSquare = document.getElementById("redSquare");
const button1 = document.getElementById("button1");
const D = document.getElementsByTagName("h1");
const word = document.getElementById("word");
const image = document.getElementById("image");
const button2 = document.getElementById("button2");
const inputBox = do... | true |
94b62ed17bc12fef9f33c7ce63c80b02ff5591a1 | JavaScript | wojciechsmolarek/jasmine-unit-test | /app/rectArea.js | UTF-8 | 506 | 3.484375 | 3 | [] | no_license | function Rectangle(a,b) {
this.setA(a);
this.setB(b);
}
Rectangle.prototype.countArea = function () {
return (this.a*this.b);
}
Rectangle.prototype.setA = function (valueA) {
var a = parseFloat(valueA);
if (a>0) {
this.a = a;
return true;
}
return false;
}
Rectang... | true |
c19ec42c3b344459667179d8b0c11b4a8d85440a | JavaScript | sarakhandaker/react-async-gif-search-lab-seattle-web-030920 | /src/containers/GifListContainer.js | UTF-8 | 789 | 2.5625 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
import React, { Component } from 'react'
import GifList from '../components/GifList.js'
import GifSearch from '../components/GifSearch.js'
export class GifListContainer extends Component {
state={
gifs:[]
}
componentDidMount(){
this.fetchFunction("code")
}
fetchFunction=(query)=>{... | true |
dcd181214d1ea02af8d097c7c6fd2d4dac61127c | JavaScript | joelwatson/semblance | /src/generator/Lorem.js | UTF-8 | 2,986 | 2.671875 | 3 | [] | no_license | Ext.define('Semblance.generator.Lorem', {
extend: 'Semblance.generator.Base',
alias: 'semblance.lorem',
sentenceMin: 15,
sentenceMax: 20,
paragraphMin: 3,
paragraphMax: 7,
defaultCount: 1,
defaultType: 'sentence',
words: ["ad", "adipisicing", "aliqua", "aliquip", "amet", "anim", "aut... | true |
be34b3968748a787ead2d8565f1e1b49e9681cc0 | JavaScript | lydiazheng/PuzzleGame | /puzzle.js | UTF-8 | 7,951 | 3.03125 | 3 | [] | no_license | //global variavles
var tableHeight, tableWidth;
var arr = [], left_side = [], table_head = [];
var check_arr = [];
var leftSide_html = "";
var tableHead_html = "";
var map_html_tr = "";
var map_html_td = "";
// initialize the puzzle board when the webpage is first loaded
window.onload = function() {
showSmallPuzzl... | true |
8497ef41b22e02175c866a8db861b0162764797e | JavaScript | luuck/FeatureCollection | /m3/viewport.js | UTF-8 | 1,528 | 2.546875 | 3 | [] | no_license | (function () {
var win = window;
var doc = win.document;
var psdWidth = 720;
var tid;
var throttleTime = 100;
var metaEl = doc.querySelector('meta[name="viewport"]');
if (!metaEl) {
metaEl = doc.createElement('meta');
metaEl.setAttribute('name', 'viewport');
doc.head.... | true |
6fefb6a9dc56157ec4b736cc81a8c2bcdaafa1f0 | JavaScript | Afalls89/Covid19 | /src/utils/dataFormating.js | UTF-8 | 2,241 | 2.84375 | 3 | [
"MIT"
] | permissive | // const parser = require("simple-excel-to-json");
// const covid19Data = parser
// .parseXls2Json("../data/COVID-19-geographic-disbtribution-worldwide.xlsx")
// .flat();
// const xlsxj = require("xlsx-to-json");
// xlsxj(
// {
// input: "../data/COVID-19-geographic-disbtribution-worldwide.xlsx",
// output: "..... | true |
96a3c272c251bd93cb51d50ee7455627e3d0f6a5 | JavaScript | mateusfelixss/sorteioOnline | /script.js | UTF-8 | 732 | 3.46875 | 3 | [] | no_license | function sorteio(){
const min = document.getElementById("minimo").value;
const max = document.getElementById("maximo").value;
let sort = Math.floor(Math.random() * Math.floor(max))
while(sort < min){
sort = Math.floor(Math.random() * Math.floor(max));
}
//const ... | true |
77d925a15cb49b441e384491c7055511cdfe4f83 | JavaScript | Pablo-Limbargo/Education-project-React | /src/Redux/store.js | UTF-8 | 5,456 | 2.59375 | 3 | [] | no_license | import profileReducer from "./profileReducer";
import messagesReducer from "./messagesReducer";
import sidebarReducer from "./sidebarReducer";
let store = {
_state: {
messagesPage: {
dialogs: [
{id: 1, name: 'Valera', avatar: 'https://schoolsw3.com/tryit/avatar.png'},
... | true |
455b1d55d77ac51afe87af6ae7721449d102edbd | JavaScript | naman-gulati3/javascript-test-code | /timer.js | UTF-8 | 370 | 3.546875 | 4 | [] | no_license |
function currentTime(){
var timer= new Date();
var hour = timer.getHours();
var min = timer.getMinutes();
var seconds = timer.getSeconds();
if(min < 10){
min = "0"+min;
}if(seconds < 10){
seconds = "0" +seconds;
}else if(hour<10){
hour = "0"+ hour;
}
setInterval(currentTime,1000);
console.log('Time is: ' +... | true |
63109b1f7ffb6364477ae2e9187be5a3df41370d | JavaScript | rkwan94/rkwan94.github.io | /biblioBuddy/controllers/sourceController.js | UTF-8 | 6,043 | 2.546875 | 3 | [] | no_license | app.controller('sourceController', function($scope, $http) {
monthNames = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
];
function cr... | true |
70b72ac2a8f49770cdff39b9ff8a55013d9a1122 | JavaScript | marijabp/lunch-manager-webapp | /src/components/AddOptionToFood/AddOptionToFood.jsx | UTF-8 | 4,947 | 2.515625 | 3 | [] | no_license | import React, { Component, Fragment } from 'react';
import Button from '@material-ui/core/Button';
import Paper from '@material-ui/core/Paper';
import InputLabel from '@material-ui/core/InputLabel';
import MenuItem from '@material-ui/core/MenuItem';
import FormControl from '@material-ui/core/FormControl';
import Select... | true |
463d366ea8bfabb87c451ceafbfe725b5e685072 | JavaScript | pantsachin/Profit-Loss_Stocks-WebAPP | /app.js | UTF-8 | 1,128 | 3.5625 | 4 | [] | no_license | var unitCostPrice = document.querySelector("#stockPrice");
var quantityOfStocks = document.querySelector("#quantityOfStocks");
var presentCostPrice = document.querySelector("#currentPrice");
var btnCalculate = document.querySelector("#buttonCalculate");
var absoluteVal = document.querySelector("#profitOrLossAbs");
... | true |
c5ad7bb01b8ee6d05cf6ce7a0ecec34f434cec73 | JavaScript | tcsulb/spring20final | /main.js | UTF-8 | 668 | 3.65625 | 4 | [] | no_license | const num1 = parseInt(document.getElementById('num1').value);
const num2 = parseInt(document.getElementById('num2').value);
document.getElementById("inputs").addEventListener("submit", validateInputs);
function validateInputs() {
let inputs = document.querySelector('inputs');
let f = parseInt(inputs.getElemen... | true |
d138f7ebabd58a04d35702e005db485b31dc6811 | JavaScript | csrapr/uphold_challenge_backend | /Uphold.test.js | UTF-8 | 621 | 2.625 | 3 | [] | no_license | /**
* @jest-environment node
*/
//o comentário acima é um fix para um erro de CORS do axios quando se usa o jest
const UpholdApi = require("./Uphold");
test("Fetches USD-BTC ticker from Uphold API and returns an array of length 1", async () => {
expect.assertions(1);
const data = await UpholdApi.requestCurrenci... | true |
2d6ea89006dec0ba6db478f1b9cd2860d6aa70be | JavaScript | vagabond0079/casehawk-frontend | /src/reducer/events.js | UTF-8 | 687 | 2.78125 | 3 | [
"MIT"
] | permissive | let validateEventCreate = (event) => {
if(!event.title || !event.start || !event.end || !event.eventType){
throw new Error('VALIDATION ERROR: event requires name, start and end time and event type.');
}
};
export default (state=[], action) => {
let {type, payload} = action;
switch(type){
case 'EVENT_CRE... | true |
c97a045474003a31b29c09866e17431cad4bb4a9 | JavaScript | RagghavR/Pirates6 | /sketch.js | UTF-8 | 3,259 | 2.640625 | 3 | [
"MIT"
] | permissive | const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Constraint = Matter.Constraint;
var engine, world;
var canvas, angle, tower, ground, cannon;
var balls = []
var boats = []
var boatAnimation = []
var brokenboatAnimation = []
var score = 0
function preload() {
... | true |
ca07f47d0f7c53618d8fe0ecc66440a43a431abc | JavaScript | n3h4/blackjack | /js/main.js | UTF-8 | 1,281 | 2.84375 | 3 | [] | no_license | const { prop, filter, map, sortBy, propEq, join, compose, pluck } = R
const deckUrl = 'https://deckofcardsapi.com/api/deck/new/shuffle/?deck_count=1'
/*
HTML
*/
const deckCardHtml = u => `<div class="deck-card"><img width="160" height="245" src="${u}"/></div>`
const shuffleCardHtml = img => `<div class="shuffle-car... | true |
570e9a1470532c540598e632e2584925330abc74 | JavaScript | gride29/FCC-Front-End-Libraries-Projects | /markdownpreviewer/src/App.js | UTF-8 | 1,307 | 2.515625 | 3 | [] | no_license | import React, { Component } from "react";
import logo from "./logo.svg";
import "./App.css";
import FormGroup from "react-bootstrap/FormGroup";
import FormLabel from "react-bootstrap/FormLabel";
import FormControl from "react-bootstrap/FormControl";
let marked = require("marked");
class App extends Component {
stat... | true |
bf52110b0beb72c6d510a429988a748e14562a34 | JavaScript | mattlockyer/iat455 | /workshop-5/main.js | UTF-8 | 5,784 | 2.90625 | 3 | [
"MIT"
] | permissive | // This is our projection matrix.
var camera;
// This is where all mesh will be stored.
var scene;
// Should we use canvas? WebGL? SVG? DOM+CSS? This object determines that.
var renderer;
// This will be our cube object. Typically, "geometry" will represent an array
// of vertices, and its connections (in other word... | true |
babfd1df7f62ef760409c20255a49f1776ea2e4e | JavaScript | luckettj/learning-javascript | /script.js | UTF-8 | 1,439 | 4.3125 | 4 | [] | no_license | var computerWins = 0;
var userWins = 0;
var playerChoice = function(){
var userChoice = prompt("rock (r), paper (p), or scissors (s)?");
while (userChoice !== r || p || s){
userChoice = prompt("rock (r), paper (p), or scissors (s)?");
}
return userChoice;
}
var compChoice = function(){
var computerChoice = Ma... | true |
4f83733e39ea20d5a875fd2dcda4edc695ff6070 | JavaScript | pawe9N/Gomoku | /server.js | UTF-8 | 2,054 | 2.515625 | 3 | [
"MIT"
] | permissive | const express = require('express');
const path = require('path');
const app = express();
const server = require('http').Server(app);
const io = require('socket.io')(server);
let numberOfRooms = 0;
app.use(express.static('.'));
app.get('/', (request, respond) => {
respond.sendFile(path.join(__dirname, 'views/inde... | true |
abe3ac6175798d358cc3f685ea98c73ecaa8acb1 | JavaScript | pawanpanth/Hackathon-11---Pomodoro | /src/components/App.js | UTF-8 | 3,850 | 2.796875 | 3 | [] | no_license | import React, { Component, useEffect, useRef, useState } from "react";
import "../styles/App.css";
const App = () => {
const [Minute, setMinute] = useState(25);
const [Seconds, setSeconds] = useState(0);
const [Break, setBreak] = useState(5);
const [Work, setWork] = useState(25);
const [started, setStarted] =... | true |
40116327ab04648e36d7357e6fe556224a27a6c9 | JavaScript | jet10000/reboost-test-app | /src/react/App.jsx | UTF-8 | 528 | 2.640625 | 3 | [] | no_license | import * as React from 'react';
export const App = () => {
const [count, setCount] = React.useState(0);
console.log('Source map test');
return (
<div>
<h1>React App</h1>
<p>Count is {count}</p>
{/* <p>New content</p> */}
<button onClick={() => setCo... | true |
97f1613d936b9f6ac7991a0318845e9b00cc3fc9 | JavaScript | inezav/final_project | /server/helpers.js | UTF-8 | 331 | 2.625 | 3 | [] | no_license | module.exports = function checkLoginData(loginData, users){
let checkUser = users.filter(user => {
if (loginData.login === user.login) {
if (loginData.password === user.password) {
return true;
}
} else {
return false;
}
})
return c... | true |
481466cd2e12809a7b6c3d47e9d12cbf94779792 | JavaScript | tpdeliezer/como-trabalhar-com-formularios-no-react | /src/App.js | UTF-8 | 2,788 | 2.921875 | 3 | [
"MIT"
] | permissive | import { useState } from 'react';
import './App.css';
function App() {
const [formValues, setFormValues] = useState({});
const handleInputChange = (e) => {
const { name, value, type, checked } = e.target;
const isCheckbox = type === 'checkbox';
const data = formValues[name] || {};
if (isCheckbox)... | true |
f3fe14862420059b6316b52b84e62256c7703170 | JavaScript | BlackAtlasStudio/gradient | /js/main.js | UTF-8 | 8,634 | 2.78125 | 3 | [
"MIT"
] | permissive | //Contains all color stops
var gradient = [new ColorStop(241, 206, 239, 0), new ColorStop(241, 206, 239, 50), new ColorStop(199, 122, 218, 100)];
var defaultGradient = [new ColorStop(0, 0, 0, 0), new ColorStop(255, 255, 255, 100)];
//Other needed variables
var angle = 0;
var radialTrack = false;
var radialWidth = 0;
v... | true |
19d384e7936f99278dfc3a293ad255cdfa9ecd18 | JavaScript | coditva/proxy-server | /lib/middlewares/authenticate.js | UTF-8 | 1,108 | 2.828125 | 3 | [] | no_license | const config = require('../../config');
/**
* Sends back 403 response
*
* @param {Object} res - The response object
*/
function respondWithDenied (res) {
res
.status(403)
.json({
error: {
code: 403,
message: 'You need to be authenticated to perform this action.'
}
})
.... | true |
3d1d82f43c81fe4e6986f10b651ac0ab5a0c7656 | JavaScript | DenisDuev/StudentsGuide | /mockup/js/login.js | UTF-8 | 561 | 2.578125 | 3 | [] | no_license | function changeActionOfForm() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
var form = document.getElementById("loginForm");
if (username === "admin" && password === "admin") {
form.action = "administration/logedHomeEdi... | true |
6fc0aea7e10923e84dc96480a0cf2e9e03b1701e | JavaScript | izzuddin23ali/tictactoe | /ttt.js | UTF-8 | 5,567 | 3.1875 | 3 | [] | no_license | var boxes = document.querySelectorAll(".box");
let turnScreen = document.getElementById("turnScreen");
let turn = true;
let resultScreen = document.getElementById("resultScreen");
let blueScoreScreen = document.getElementById("blueScore");
let redScoreScreen = document.getElementById("redScore")
var blueScore = 0;
va... | true |
ee13dd466e529df04752719ae2eab307e060de6a | JavaScript | yengobilly4063/user_mern | /backend/utils/passwordUtil.js | UTF-8 | 265 | 2.71875 | 3 | [] | no_license | import bcrypt from "bcryptjs"
export const hashPassword = async (password) => {
return await bcrypt.hash(password, 10)
}
export const comparePassword = async (enteredPassword, hashedPassword) => {
return await bcrypt.compare(enteredPassword, hashedPassword)
} | true |
61d167077396443ca269fbbcbe4ea06e0096805a | JavaScript | FredericHeem/rubico | /_internal/TimeInLoopSuite.js | UTF-8 | 3,403 | 3.109375 | 3 | [
"MIT"
] | permissive | const timeInLoop = require('./timeInLoop')
const timeInLoopAsync = require('./timeInLoopAsync')
/**
* @name formatRunOutput
*
* @synopsis
* ```coffeescript [specscript]
* formatRunOutput(
* description string,
* loopCount number,
* duration number
* ) -> formatted string
* ```
*/
const formatRunOutput... | true |
a5fa62107721a461b8484d23a01f318c68c5ed3f | JavaScript | em-yu/voxel-editor | /interactions.js | UTF-8 | 5,436 | 2.75 | 3 | [] | no_license | // INTERACTIONS
const rotPerDrag = 1/800;
const truckperDrag = 1/1000;
var firstClickPos = null;
var drag = false;
var down = false;
var button = null;
// CLICK AND DRAG ON CANVAS EVENTS
function getCubeFace(event, canvas) {
// Get click coordinates
var correction = canvas.getBoundingClientRect();
var t = vec... | true |
da90af84d8c8c392a4d21ccc972334acea7b0b33 | JavaScript | kagero900/424141-kekstagram | /js/preview.js | UTF-8 | 4,381 | 2.828125 | 3 | [] | no_license | 'use strict';
(function () {
var LOAD_COMMENTS_LIMIT = 5;
var remainingComments;
var commentsQuantity = {};
var picturesContainer = document.querySelector('.pictures');
var bigPicture = document.querySelector('.big-picture');
var previewImage = bigPicture.querySelector('.big-picture__img img');
var prev... | true |
665680365afcbf977e5d255bff4800f2492693fa | JavaScript | hussienAbdien/crud-project | /crud-project/script.js | UTF-8 | 4,603 | 3.125 | 3 | [] | no_license | var productName=document.getElementById("prName");
var productPrice=document.getElementById("productPrice");
var productCategory=document.getElementById("productCategory");
var productDesc=document.getElementById("productDesc");
var proudectNameAlert=document.getElementById("proudectNameAlert");
// var errors='... | true |
1c729490a9999f1341fa99f54cadb7b506760bc2 | JavaScript | merenfck/lab-javascript-functions-and-arrays | /rover/dist/script.js | UTF-8 | 2,282 | 3.859375 | 4 | [
"MIT"
] | permissive | //Iteration 1
// Rover object goes here:
const rover = {
direction:'N',
direction:'S',
direction:'E',
direction:'W',
};
// ======================
//Iteration 2
function turnLeft(rover) {
switch (rover) {
case 'North':
console.log('West');
break;
case 'West':
console.log('South'... | true |
081943af80bf3f24915cd570f42b2b28578b1dd5 | JavaScript | wang0630/PM-react-native | /src/components/spinner/spinner.js | UTF-8 | 1,801 | 2.609375 | 3 | [] | no_license | import React from 'react';
import {
Animated,
View,
} from 'react-native';
import style from './spinner-style';
export default class Spinner extends React.Component {
constructor(props) {
super(props);
this.state = {
scaleY0: new Animated.Value(20),
scaleY1: new Animated.Value(20),
scal... | true |
c87b4686cc5248775fdb912c6cfc85a1b33864a8 | JavaScript | LTeather/University6Mans | /commands/admin/flip.js | UTF-8 | 4,096 | 2.65625 | 3 | [] | no_license | const commando = require('discord.js-commando');
const discord = require('discord.js');
class FlipMatch extends commando.Command {
constructor(client) {
super(client, {
name: 'flip',
group: 'admin',
memberName: 'flip',
description: '!flip <matchID>... | true |
d2caad7561831486d0f0ccc558ee09382f40de46 | JavaScript | lf-marques/siss-front | /src/services/Helper.js | UTF-8 | 1,795 | 2.640625 | 3 | [] | no_license | import moment from 'moment';
const Helper = {
getResponseError(error) {
let msg = ''
if(
error &&
error['response'] &&
error['response']['data'] &&
error['response']['data']['erros']
) {
msg = error.response.data.erros.reduce((re... | true |
ca7100b780c5f1a502d7d0a4449792a6d139e03e | JavaScript | iisakjanova/js_group_11_homework_59_irina_isakzhanova | /src/containers/Jokes/Jokes.js | UTF-8 | 1,825 | 3.046875 | 3 | [] | no_license | import {useEffect, useState} from 'react';
import React from 'react';
import './Jokes.css';
import Joke from "../../components/Joke/Joke";
import JokesButton from "../../components/JokesButton/JokesButton";
const Jokes = () => {
const [jokes, setJokes] = useState({});
useEffect(() => {
getJokes(3)
... | true |
68750f73aa15043f364c42bfe612c24ce9ba224c | JavaScript | IKSHIT-BANSAL/Social-Networking-Site | /workers/comment_email_worker.js | UTF-8 | 455 | 2.515625 | 3 | [] | no_license | const queue=require('../config/kue');
const commentsMailer=require('../mailers/comments_mailer'); //as we to mail required people who commented
//process function tells every worker to add task to this queue whenever a new task enters
queue.process('emails',function(job,done){ //emails is name of queue as 1s... | true |
279d7798a0c757bf602e099fcc40dfdb1aebb22e | JavaScript | mrdzugan/zadachki | /index.js | UTF-8 | 1,976 | 4.5 | 4 | [] | no_license | 'use strict';
task1(); // to check: task{number_of_task}();
// ============= WHILE
// #1
function task1() {
let count = Number(prompt('Input your count'));
while (count-- > 0) {
document.write('#');
}
}
// #2
function task2() {
let value = Number(prompt('Input your value'));
if (valu... | true |
d2d23730e8e1da4916e1ea60e81a86184b7d5858 | JavaScript | b8bauer/hw_2 | /sketch_5.js | UTF-8 | 185 | 2.6875 | 3 | [] | no_license | function setup (){
createCanvas(200,200);
background(0);
stroke(255);
var x = 0;
for (var repeat = 0; repeat < 50; repeat++){
line(x,200,x,200-random(180));
x = x + 5;
}
}
| true |
277de85d00d75bcbaaafa3e48b7351be4ac69ddf | JavaScript | SpiderISoft/Raagam.Kendo.MVC.TextileManagement | /Raagam.MVC.TextileManagement.UI/Scripts/CommonScripts.js | UTF-8 | 551 | 2.5625 | 3 | [] | no_license | disableControls = function (controlArrary) {
$.each(controlArrary, function (key, control) {
$(this).attr('readonly', 'readonly');
});
}
enableControls = function (controlArrary) {
$.each(controlArrary, function (key, control) {
$(this).attr('disabled', false);
});
}
function ... | true |
650a06ed857ba3f221a92b2222f8a88d2d8d8d8f | JavaScript | Vetronus/managebit-real-estate | /script/boot.js | UTF-8 | 1,216 | 2.71875 | 3 | [] | no_license |
function boot()
{
var loginBtn = document.getElementById('login-btn');
console.log(data);
var realPass = localStorage.pass;
if(realPass)
{
loginBtn.addEventListener('click', function()
{
var pass = document.getElementById('pass-input').value;
if(pass ==... | true |
fade1ae2fdc827d0d52f0b4e47e78ea1a4bbb3f8 | JavaScript | 22ndteam/js | /WIP/level1.js | UTF-8 | 9,964 | 2.71875 | 3 | [] | no_license | // collect stars, no enemies
class level1 extends Phaser.Scene {
constructor ()
{
super({ key: 'level1' });
this.liveCount = 3;
this.isDead = false;
}
preload ()
{
this.load.atlas('tomoe','assets/TomoeTex.png','assets/TomoeTex.json')
this.load.atla... | true |
8f59578759872f61d9214bc84e1b575ee31943b2 | JavaScript | StephanieGeraAmil/Another-Weather-App | /src/context/GlobalState.js | UTF-8 | 1,680 | 2.609375 | 3 | [] | no_license | import React,{createContext, useReducer } from "react"
import AppReducer from './AppReducer.js'
import cityWeather from '../city-weather';
//initial state
const city={
name: cityWeather[0].name,
max: cityWeather[0].main.temp_max,
min: cityWeather[0].main.temp_max,
main: cityWeather[0].we... | true |
6aaa8ece3d6c553fb4532d25bf85b47fe464be0c | JavaScript | katyeh/medium-clone-project | /public/js/main.js | UTF-8 | 1,724 | 2.640625 | 3 | [] | no_license | import { dateFormatter, randomIcon } from "./utils.js";
const followingContainer = document.querySelector(
".following-users-container"
);
const clapsContainer = document.getElementById("main__clapsList");
const getUserInfo = userId => {
return fetch(`api/users/${userId}`, {
headers: {
Authorization: `Be... | true |
7d27e8fc3652f62a4e2da273e7a982660439f463 | JavaScript | GMementoMori/aLevel | /DopWorks/Анкета в военкомат/js.js | UTF-8 | 582 | 2.640625 | 3 | [] | no_license | $(document).ready(function(){
$("#sub").click(function(){
var values = [];
var keys = [];
var arr = [];
var elements = document.getElementsByClassName('info');
for (var i = 0; i < elements.length; i++) {
values[i] = elements[i].value;
}
console.log(values);
... | true |
bffe3ff1b642cd17c46c7f7faa52472b45a281a9 | JavaScript | DevelopingProgress/fullecomm | /js/main.js | UTF-8 | 8,550 | 2.921875 | 3 | [] | no_license | //wow.js
new WOW().init();
//global
let products = [];
let cartItems = [];
let cart_n = document.getElementById("cart_n");
//divs
let fruitDiv = document.getElementById("fruitDIV");
let juiceDiv = document.getElementById("juiceDIV");
let saladDiv = document.getElementById("saladDIV");
//information
let FRUIT=[
{... | true |
ef597c18b3ea4a9de645b195092db70e7181b746 | JavaScript | Khyrat7/login-web-app- | /services/registerService.js | UTF-8 | 1,998 | 2.75 | 3 | [] | no_license | const db = require("../configs/connectingDB");
const bcrypt = require("bcrypt");
const promise = require("promise");
const { resolve, reject } = require("promise");
let createUser = (user) => {
return new promise(async (resolve, reject) => {
console.log("entering the registerService.js");
try {
... | true |
61450d2778feb6329faf3838d51c1447f9e4dcf7 | JavaScript | nickscaglione/robotSimulator.js-web-0916 | /lib/robot.js | UTF-8 | 1,597 | 3.875 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | 'use strict';
const compass = ['north', 'east', 'south', 'west']
class Robot {
constructor(bearing) {
this.bearing = bearing
this.coordinates = [0,0]
}
orient(direction) {
if (compass.includes(direction)) {
this.bearing = direction
return this.bearing
} else {
throw new Error(... | true |
e3256672972652c0d3890b68d86cdea9ad53179d | JavaScript | ManelGUEDDARI1/react-state | /src/AppClass.js | UTF-8 | 1,625 | 2.703125 | 3 | [] | no_license | //rcc //rfce
import React, { Component } from 'react'
class AppClass extends Component {
// constructor (props){
// super (props)
state ={
Person : { fullName: "Manel Gueddari", bio:"futur developer", imgSrc:" https://www.missnumerique.com/blog/wp-content/uploads/reussir-sa-... | true |
5f0f4c4e6819cc129df92bd4c9110acfbe511e60 | JavaScript | onedata/onedata-gui-common | /addon/utils/chartist/custom-css.js | UTF-8 | 2,080 | 2.734375 | 3 | [
"MIT"
] | permissive | /**
* Plugin for Chartist which changes chart elements styles to custom values
* using data.customCss. It has to be a list with objects in format e.g.:
* {
* slice: {
* 'color': 'white',
* }
* }
* Name of an element is the same as the one we can obtain from data.type,
* where `data` if from `chart.on(... | true |
6a772485ca8281aa43319cd6f15123e641d14ee8 | JavaScript | msingh356-87/react-registration-crud-app-backend | /services/user.services.js | UTF-8 | 1,406 | 2.546875 | 3 | [] | no_license | var userModel = require('../models/user.model')
exports.getUsers = async function (query, page, limit) {
try {
var users = await userModel.find(query)
console.log("users" + users)
return users;
} catch (e) {
// Log Errors
console.log('Error while retrieving Users')
}... | true |
8a447368a8299965a5dd82ccaabe2a204dd76530 | JavaScript | babiesinspace/phase-0-tracks | /js/explore.js | UTF-8 | 502 | 4.9375 | 5 | [] | no_license | // Write a function which reverses and returns a string:
// Take a string as input
function reverse(stringIn){
var reverse = "Your reversed string is: ";
// Starting from the last character to the first, create reversed string
for (var y = (stringIn.length - 1); y >= 0; y--) {
reverse += stringIn[y];} // Store... | true |
6475e9b5f14cab3adeacfcf995f97d0cf39a0327 | JavaScript | fanjirong/shop | /src/component/until/http.js | UTF-8 | 1,503 | 2.546875 | 3 | [] | no_license | import Vue from 'vue'
import axios from 'axios'
console.log(process.env.NODE_ENV)
//测试服务器t
const testurl = '192.168.43.8:3000'
const onlineurl = '192.168.43.8:3000' || 'http://m.jd.com'
let instance = axios.create({ //创建实例
header:{
"Content-Type":"application/json"
},
baseUR:testurl
//baseUR... | true |
e0dd97972e2998ecce4d30f5c93b9dfd70ad7f3f | JavaScript | YaseminLi/nodeJS | /demos/36_unlink.js | UTF-8 | 238 | 2.640625 | 3 | [] | no_license | //删除文件
const fs=require('fs');
// fs.unlink('./test.txt',err=>{
// if(err) throw err;
// console.log('done');
// });
fs.unlink('test.txt', (err) => {
if (err) throw err;
console.log('文件已删除');
}); | true |
9d20906bcc66f52418230a34fa24ccc9e99ef4c7 | JavaScript | AhmadHerzallah/react-shows | /src/Components/MovieSearch.js | UTF-8 | 2,879 | 2.578125 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import style from '../search.module.css';
import { Search } from 'react-feather';
import ShowMovie from './ShowMovie';
import { Heart } from 'react-feather';
const MovieSearch = () => {
const [query, setQuery] = useState('Breaking bad');
const [search, setSearch]... | true |
2e662f0f9a2a8ea4ad9ad79ce46e86840576fe77 | JavaScript | DesignQin/BillRecords | /js/home.js | UTF-8 | 3,248 | 2.609375 | 3 | [] | no_license | //初始化
(function() {
console.log(localStorage.timestamp);
mui.init({
gestureConfig: {
tap: true,
doubletap: true,
longtap: true,
swipe: true,
drag: true,
hold: false,
release: false
}
});
//开启轮播
// mui('.mui-slider').slider({
// interval: 5000
// });
//预加载record
document.addEventListene... | true |
2f66d7f8247d4d10abb4b1d421ecb7ea74f20402 | JavaScript | Daniel-Chin/WorldOfBlogs | /front/src/component/ReadTimeHUD.js | UTF-8 | 2,747 | 2.53125 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import ReactTooltip from 'react-tooltip';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faQuestionCircle, faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import FloatIn from './FloatIn';
import { is_mobile } from '../helpe... | true |
04519b202f615e78dc7fef1ec3ba1e4d82cbf5c0 | JavaScript | thedeagler/spazzinglicorice | /server.js | UTF-8 | 1,566 | 2.546875 | 3 | [
"MIT"
] | permissive | /*************************************
DEPENDENCIES
**************************************/
var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var Board = require('./db/board');
var port = process.env.PORT || 8080;
var handleSo... | true |
b8503deed575dec6cb94996821584aceec3ed244 | JavaScript | johnmarinelli/cracking-the-coding-interview | /3/3.js | UTF-8 | 2,744 | 3.109375 | 3 | [] | no_license | "use strict";
class Node {
constructor(val) {
this.mValue = val;
this.mNext = null;
this.mId = Node.ID++;
}
};
Node.ID = 0;
class Queue {
constructor() {
this.mHead = null;
}
peek() {
if (this.mHead === null) return null;
else {
let t = this.mHead;
while (t.mNext !== nu... | true |
e538cf7e1d839d4cabe6ebb9b0a441ece391a166 | JavaScript | christinexiaxiaxia/web2019 | /act-2/saving-grace/public/js/client.js | UTF-8 | 11,805 | 2.796875 | 3 | [] | no_license |
/////////////////////////////////
//////////////////////
///////////
// WARNING: ALL VERY BRUTE FORCE... SORRY! MY PEA-BRAIN JUST CAN'T TAKE IT RIGHT NOW!
///////////
//////////////////////
/////////////////////////////////
$(function () {
var socket = io({reconnection:false});
// SEND MOUSE POSITIO... | true |
c042b448534e328f0111f190e0ab29de07df86fe | JavaScript | tauhidul0821/testingApi | /test/lib.test.js | UTF-8 | 477 | 2.625 | 3 | [] | no_license | const app = require('../app');
describe('absolute',()=>{
it('absolute - should return a positive number if input is positive ',()=>{
const result = app.absolute(1);
expect(result).toBe(1);
});
it('absolute - should return a positive number if input is nagative ',()=>{
const result = app.absolute(-1);
expec... | true |
ddaf438d150cd28e0cfec374c0e2d24ba8fbadf1 | JavaScript | bloodycoder/WebVN | /engine/core/class.js | UTF-8 | 4,088 | 2.734375 | 3 | [
"MIT"
] | permissive | /**
* This module provide the basic class inheritance.
* @namespace webvn.class
*/
webvn.module('Class', function (util, exports) {
var ObjCreate = Object.create;
/**
* Create a New Class
* @function webvn.class.create
* @param {object} px prototype methods or attributes
* @param {object... | true |
604da0128c07a2adf31709ba6712ccedf5dbbe7e | JavaScript | emilie-Apple/HackathonWCS_2 | /src/DefiBundle/Resources/public/js/index.js | UTF-8 | 1,478 | 2.59375 | 3 | [
"MIT"
] | permissive | function togglescroll() {
$('body').on('touchstart', function(e) {
if ($('body').hasClass('noscroll')) {
e.preventDefault();
}
});
}
$(document).ready(function() {
togglescroll()
$(".icon").click(function() {
$(".mobilenav").fadeToggle(500);
$(".top-menu").to... | true |
6a88b3e2ff6e9edd89289335dd09d3357a05b97a | JavaScript | front-ant/udacity-p7-myreads | /src/ShelfBook.js | UTF-8 | 1,033 | 2.796875 | 3 | [] | no_license | import React, {Component} from 'react';
class ShelfBook extends Component {
state = {
currentShelf: this.props.shelf
};
handleChange = event => {
const newShelf = event.target.value;
const currentBook = this.props.book;
// call onChangeShelf method that was passed down from App.js, causing a rer... | true |
22320ba059a810e7291be7c881e31201d50aff1c | JavaScript | HYEOK999/TIL | /javaScript/playground/poiemaweb_pratice/pratice14.js | UTF-8 | 362 | 3.46875 | 3 | [
"MIT"
] | permissive |
function problem14() {
console.log('14번 문제입니다.');
const line = 5;
let star = '';
for (let i = line; i > 0; i--) {
for (let j = i - 1; j > 0; j--) {
star += ' ';
}
for (let k = i - 1; k < line; k++) {
star += '*';
}
star += '\n';
}
console.log(star);
console.log('---------... | true |
c0afcc7e62e75995a481662ff3c6dcdbe480bca0 | JavaScript | AdamUhh/Simple-fontsize-firefox-extension | /content_script.js | UTF-8 | 543 | 2.953125 | 3 | [] | no_license | let style;
style = document.createElement('style');
document.body.appendChild(style);
browser.storage.onChanged.addListener((changes, area) => {
if (area === 'local' && 'value' in changes && 'elements' in changes && 'checked' in changes) {
if (changes.checked.newValue == 1) {
update(changes.val... | true |