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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
78215e2b1d6f6a03ccd5722fee22873c8c13ee89 | JavaScript | didac3141592/Vue | /flash-oop/js/app.js | UTF-8 | 1,914 | 2.734375 | 3 | [] | no_license | import { nanoid } from 'https://cdn.jsdelivr.net/npm/nanoid/nanoid.js'
class Flashcard {
constructor(q, a) {
this.question = q;
this.answer = a;
this.id = nanoid();
this.displayAnswer = false;
this.editMode = false;
}
}
const app = Vue.createApp({
data() {
r... | true |
86b76c9942910a9067452816293d5a50dd3f2842 | JavaScript | hzhil/item | /src/js/app/move.js | UTF-8 | 1,794 | 2.9375 | 3 | [] | no_license |
function loops(){
var banner = document.querySelector(".move");
var lis = document.querySelectorAll(".moveBox>ul>li");
var autoTimer,changeTimer,outTimer,timer1;
var x = 0;
var num = 0;
setTimeout(function(){
autoMove()
},3000)
// autoMove()
function autoMove(){
autoTimer = setInterval(function(){
... | true |
dd0f1a3dbf0315617859257a86ca3cde02f00ce7 | JavaScript | the-cc-dev/stdobj | /lib/flatten.js | UTF-8 | 1,032 | 3.171875 | 3 | [] | no_license | const isObj = require('./isObj')
const keys = require('./keys')
/**
* Flattens a (possibly) multi-level object literal to a dot-notated key
* single-level object
* @param {Object} o Object to flatten
* @param {String} parent The parent key - for recursion
* @param {Object} flatObj The aggregator - for recursion
... | true |
d8edc006fce5d0f0b500d10c64ec12f346e92473 | JavaScript | letnoxn/letnoxn.github.io | /js/index.js | UTF-8 | 7,769 | 2.578125 | 3 | [] | no_license | $(function () {
//错误提示弹窗
$('#error').dialog({
autoOpen : false,
modal : true,
closeOnEscape : false,
resizable : false,
draggable : false,
width : 180,
height : 50,
}).parent().find('.ui-widget-header').hide();
//加载中提示弹窗
$('#loading').dialog({
autoOpen : false,
modal : true,
closeOnEscape : fa... | true |
400639164a4deb3e8051bb5d578154a0fd7b347e | JavaScript | Peleke/git-viz | /js/config.js | UTF-8 | 321 | 2.578125 | 3 | [] | no_license | const state = {
currentBranch: null,
update (property) {
return function updateValue (value) {
if (value == undefined) {
return
}
switch (property) {
case 'currentBranch':
updateBranch(value)
break
default:
break
}
}
}
... | true |
414e0fea253911ccda846df95f22a0fe96011e1b | JavaScript | MayconDionisio/functions-sandbox | /test/Require.test.js | UTF-8 | 3,378 | 2.609375 | 3 | [
"MIT"
] | permissive | const expect = require('chai').expect;
const Require = require('../lib/Require');
const requireFunction = require;
describe('Require', () => {
let sandboxRequire;
describe('generateRequire', () => {
let encapsulatedRequire;
before(() => {
const myModule = {
'./module1': () => ({}),
... | true |
0635addff576ec2ccabb2c40735eada2b1a0dd13 | JavaScript | CSIS-iLab/tradeguys-viz | /tariff-impact-states/src/index.js | UTF-8 | 825 | 2.515625 | 3 | [] | no_license | import './scss/main.scss'
import { extent } from 'd3-array'
import { format } from 'd3-format'
import * as d3Fetch from 'd3-fetch'
import chart from './js/chart'
const dataSrc = './data/data.csv'
let data
function loadData() {
const dataPromise = d3Fetch.csv(dataSrc)
let result = Promise.all([dataPromise])
.... | true |
dc6dfc13a616fdfb6aea439021e01e3774789161 | JavaScript | EkaterinaPanchenko/Note | /js/metrics.js | UTF-8 | 1,210 | 3.265625 | 3 | [] | no_license | // Метрика ------------------------------------------
// offsetWidth/Height - внешняя ширина и высота (ширина контента + padding + border)
// clientWidth/Height - размер области внутри рамок (ширина контента + padding)
// scrollWidth/Height - полный размер с учётом прокрученной области
// scrollLeft/scrollTop - ширина/... | true |
9fe2bc249a6b99b433f325450b41f47376ac1359 | JavaScript | shmaliy/shmaliy | /public/cms/js/dnd.js | WINDOWS-1251 | 1,430 | 2.828125 | 3 | [] | no_license | //dnd
var moveState = false;
// ,
var x0, y0;
// ,
var divX0, divY0;
var dnd = {
d : document,
w : window,
md : null,
div : function(id){return this.d.getElementById(id);},
defXY : function(e){
var x = y = 0;
if (this.d.attachEvent != null) { // IE & Opera
x = this.w.event.clientX + this.d.document... | true |
9d8c2b540ca7d971266b9ce5a4e82880b56cea05 | JavaScript | omiltoro/PatientForm | /assets/js/senddata.js | UTF-8 | 2,159 | 2.78125 | 3 | [] | no_license | function foo(){
var currentTime = new Date();
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();
var time= hours + ":" + minutes;
var date= document.getElementById("dp4").value;
var date_time= date + " " +time;
var dataObj = new Object();
dataObj.datasource = datasource... | true |
e9693fbe9103f5540c0864e24c156117dfe9aef0 | JavaScript | simonj-suts/FoodEdgeWeb | /editmenu.js | UTF-8 | 3,839 | 3.265625 | 3 | [] | no_license | var nameerrorMessage = "";
var cuisineerrorMessage = "";
var paxerrorMessage = "";
var priceerrorMessage = "";
var descerrorMessage = "";
function checkname() {
var name = document.getElementById("packagename").value;
var nameregex = /^[a-zA-Z ]+$/;
var nameregexresult = nameregex.test(name);
var name... | true |
10340fb918755982980971931820ef2a2a8f86c1 | JavaScript | FOLLGAD/multiplayer-test | /player.js | UTF-8 | 1,782 | 2.796875 | 3 | [] | no_license | let vector = require("./vector"),
shortid = require("shortid");
let random = Math.random;
module.exports = class player {
constructor({ client }) {
this.client = client
this.id = shortid.generate()
this.color = `rgb(${random() * 255 | 0}, ${random() * 255 | 0}, ${random() * 255 | 0})`
this.size = 40
thi... | true |
12d1705379691389875534b07923c639d1f662dc | JavaScript | pablooliveiraceni/BuscaCep | /app.js | UTF-8 | 905 | 2.6875 | 3 | [] | no_license | const express = require('express')
const app = express()
const bodyParser = require('body-parser')
const buscaCep = require('./src/functions/buscaCep')
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({extended:true}))
// declarando que vou usar o ejs
app.set('view engine', 'ejs')
//Mostrando para o express... | true |
0751fa9ea551b40c7e35a4cf7bea3741bdb688af | JavaScript | pizzalord22/snake | /js/fps.js | UTF-8 | 778 | 3.0625 | 3 | [] | no_license | console.log("loaded fos module");
const outputEl = document.getElementById('fps-output');
const decimalPlaces = 2;
const updateEachSecond = 1;
// Cache values
const decimalPlacesRatio = Math.pow(10, decimalPlaces);
let timeMeasurements = [];
// Final output
let fps = 0;
const tick = functi... | true |
bf75010e49e6c4200830e6302766b67532156fd7 | JavaScript | sravantangudu/todo-application-assignment1 | /app.js | UTF-8 | 8,654 | 2.765625 | 3 | [] | no_license | const express = require("express");
const sqlite3 = require("sqlite3");
const { open } = require("sqlite");
const path = require("path");
var format = require("date-fns/format");
var isValid = require("date-fns/isValid");
const databasePath = path.join(__dirname, "todoApplication.db");
let database = null;
const app ... | true |
93713e16a4a8ffeeec09237cfa437c1bf9a8246b | JavaScript | AlgoRen/VeryBarebonesNodeJS | /controller/validation/hours.js | UTF-8 | 9,132 | 3.25 | 3 | [] | no_license | const weatherData = require('../../model/weatherModel')
const errorHandler = require('../error')
const { checkParamIsInt, checkIntIsInRange } = require('./hour')
// Global scope const
const hours = {"from": null, "to": null}
async function isHoursSearchSuccessful (req, res) {
try {
// A Promise resolvin... | true |
a877c8554e4256d2ebe8116fce6360c7f3cc259c | JavaScript | Hibbarcd/MongoScraper | /server.js | UTF-8 | 2,879 | 2.59375 | 3 | [] | no_license | const express = require("express");
const logger = require("morgan");
const mongoose = require("mongoose");
const axios = require("axios");
const cheerio = require("cheerio");
const db = require("./models");
const PORT = process.env.PORT || 3000;
const app = express();
app.use(logger("dev"));
app.use(express.urlenco... | true |
748ca01fb67b18e612b3c274aae3301a479e6d77 | JavaScript | syncromatics/syncromatics-track-api | /src/resources/Asset.js | UTF-8 | 2,206 | 3.078125 | 3 | [] | no_license | import Resource from './Resource';
/**
* Asset resource
*/
class Asset extends Resource {
/**
* Creates a new Asset.
*
* @param {Client} client Instance of pre-configured client
* @param {Array} rest Remaining arguments to use in assigning values to this instance
*/
constructor(client, ...rest)... | true |
9220afbc3c22e711ecb0ce2e3d58e7ca484bf11a | JavaScript | johanbx/AoC-2020 | /days/5b.js | UTF-8 | 987 | 3.140625 | 3 | [] | no_license | const list = process.env.PUZZLE.split("\n");
module.exports = () => {
const seatIds = list.reduce((acc, curr) => {
let [lower, upper] = [0, 127];
let [row, column] = [0, 0];
for (let i = 0; i < 7; i += 1) {
if (curr[i] === "B") {
lower += (((upper - lower) / 2) | 0) + 1;
} else if (cu... | true |
e3988eaca1968904601b98d20625fe1e27a3be87 | JavaScript | kn06497/fuentes_aheeva3.x.x | /usr/apache-tomcat-5.5.17/webapps/aheevaccs/aheevaManager.ratto.new/Resources_pages/xmlDomFunctions.js | UTF-8 | 1,771 | 3.28125 | 3 | [
"Apache-2.0"
] | permissive | /**
* loadXML() : Loads the XML String and returns the document created
* @param xmlString String
* @return Document
*/
function loadXML(xmlString)
{
var xmlDoc = null;
if (window.ActiveXObject) // Internet Explorer code
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.loadXML(x... | true |
0ff9a00c0c99e617c077ae714c51253bd6ebffa4 | JavaScript | lan-alan/9527VirtualMall | /WebContent/scripts/function.js | UTF-8 | 5,113 | 3.0625 | 3 | [
"MIT"
] | permissive | // JavaScript Document
window.onload = function() {
insertYear();
insertMonth();
insertDay();
}
function FocusItem(obj) {
obj.parentNode.parentNode.className = "current";
var msgBox = obj.parentNode.getElementsByTagName("span")[0];
msgBox.innerHTML = "";
msgBox.className = "";
}
function CheckItem(obj) {
obj.... | true |
a5edafc9ec7b71f19e6d6ea291c8361e7f525464 | JavaScript | vigohanuratama/Week9 | /Soal1/soal1.1.js | UTF-8 | 1,326 | 3.703125 | 4 | [] | no_license | // Buatlah sambungan program menggunakan then catch dan juga try catch untuk mengecek hari kerja
// dari kode Asynchronous dibawah dan jelaskan penggunaan then catch dan try catch dengan
// memberikan komentar di bawahnya:
// Synchronous = perintah dieksekusi satu persatu sesuai urutan kode yang anda tuliskan
// Async... | true |
5958933c4fa36959e2ffa0f14dfb723a3cfe8810 | JavaScript | YT-Projects/Spotify-Playlist-Generator1 | /app/static/js/main.js | UTF-8 | 1,537 | 2.953125 | 3 | [
"MIT"
] | permissive | function addSelectedClass(elem) {
if (elem.classList.contains('list-group-item-success')) {
elem.classList.remove('list-group-item-success');
elem.classList.remove('selected');
} else {
elem.classList.add('list-group-item-success');
elem.classList.add('selected');
}
}
functi... | true |
d4630bc7fb863d0f77d86982bd9780f8b70cebae | JavaScript | enricokoetsier/ICT-BOL4-COHORT-2019-AO | /Labs/Q1 week 8 labs/script/opdracht2.js | UTF-8 | 122 | 3.171875 | 3 | [] | no_license | function plus(getal1, getal2) {
return getal1+getal2;
}
var som1 = plus(10, 12)
document.write ("10 + 12 = "+som1) | true |
44fdf298cb3a1c094d800f888e31c67d434e44df | JavaScript | Abdelazeem-Fouad/Memory-Game | /js.js | UTF-8 | 3,141 | 3.265625 | 3 | [] | no_license | // start button
document.querySelector(".control-buttons span").addEventListener('click', function(){
// ask user by prompt
let yourNAme = prompt('what is your name ')
//check the name
if( yourNAme == null || yourNAme == ""){
document.querySelector(".name span").innerHTML = 'UnKnown';
... | true |
ddd6b52c7d062af752112c3eaa7f45e4c479000d | JavaScript | DaDudek/Uwr | /WWW/lista3/zad1/script.js | UTF-8 | 1,981 | 3.4375 | 3 | [] | no_license | const accountNumber = document.getElementById('accountNumber');
accountNumber.addEventListener('focusout', (event) => {
accountNumberValidation();
});
const pesel = document.getElementById('pesel');
pesel.addEventListener('focusout', (event) => {
peselValidation();
});
const date = document.getElementById('da... | true |
a9f82837ac8b2a9ee449f11424f635fa694eab3d | JavaScript | AliBaroudi/Scraping-github | /ScruppingGithub/index.js | UTF-8 | 3,632 | 2.546875 | 3 | [] | no_license | const puppeteer = require('puppeteer');
const CREDS = require ('./creds');
const mongoose = require('mongoose');
const User = require('./models/user');
/*
Recuperer mongoose
Récuperer le model 'user'
*/
async function run(){
const browser = await puppeteer.launch({
headless : false
});
const page... | true |
531b14e8fd53e37002d83b149066fc9518875a47 | JavaScript | dreamzoul/javascript-task-1 | /roman-time.js | UTF-8 | 2,666 | 3.34375 | 3 | [] | no_license | 'use strict';
/**
* @param {String} time – время в формате HH:MM (например, 09:05)
* @returns {String} – время римскими цифрами (IX:V)
*/
function romanTime(time) {
// Немного авторского кода и замечательной магии
if (typeof time === 'undefined' || typeof time === 'object') {
throw new TypeError('З... | true |
cb16f4806290c89376335e88f24b2985faea344b | JavaScript | 42kohd/yun-control-light-all-strips-together | /www/functions.js | UTF-8 | 3,441 | 2.625 | 3 | [
"Unlicense"
] | permissive | function sendCommandtoServer(cmd) {
$.get( cmd, function( data ) {
$("#sendCommandOutput").append("\n----new command----\n" + data);
});
$('#sendCommandOutput').scrollTop($('#sendCommandOutput')[0].scrollHeight);
}
// server command 0
function turnOffAll() {
server="/arduino/light/0";
sendCommandtoServer(server)... | true |
8c50576d7d84c8f92ae9057574046c176be0822e | JavaScript | joesbell/Js- | /7.函数表达式/递归.js | UTF-8 | 3,023 | 4.4375 | 4 | [] | no_license | (function(){
//函数有一个非标准 数据类型属性 name,其值为函数名。
function foo(){
console.log("1")
}
console.log(foo.name);//foo
//可以看到,函数的name属性的writable属性是false的。
//函数的name属性可以说是在定义函数时就确定了。
console.log(Object.getOwnPropertyDescriptor(foo,"name"));
var goo=foo;
//我们也不能说 name属性的值就是变量名本身的字符串值。
console.log... | true |
01d781a05f457e53b3611606cd11cd1624e82f58 | JavaScript | lp24/cg | /P2/js/utils.js | UTF-8 | 589 | 3.5625 | 4 | [] | no_license | const pi=Math.PI;
function cos(x){
return Math.cos(x);
}
function sin(x){
return Math.sin(x);
}
function arctg(x){
return Math.atan(x);
}
function Abs(x){
return Math.abs(x);
}
function squared(x){
return x*x;
}
function sqroot(x){
return Math.sqrt(x);
}
function randFloat(min,max){
... | true |
2c2f2b71acef80f1a71b2e191d78452690ba7e28 | JavaScript | saxal28/FitTools | /src/components/tools/TestPage.js | UTF-8 | 2,513 | 2.703125 | 3 | [] | no_license | import React, { Component } from "react";
import { connect } from "react-redux"
import RaisedButton from 'material-ui/RaisedButton';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import Paper from 'material-ui/Paper';
// const style = {
// width:"24%",
// marginLeft : "5px",
// textAlign: ... | true |
c19d125e7c1d5d768814ca0c57094bf5859ad0ac | JavaScript | chameides/rpi-ia | /js/hide-social.js | UTF-8 | 1,395 | 2.671875 | 3 | [] | no_license | //when an input is focused, add class social-off
$( "input" ).focus(function() {
$(document.body).addClass('social-off');
});
//when a textarea is focused, add class social-off
$( "textarea" ).focus(function() {
$(document.body).addClass('social-off');
});
//when a select is focused, add class social-off
$( "select" ... | true |
e0f3f30397445f6b69f84ba3ffeddc1db76234dd | JavaScript | ashlaurencarroll/clickygame | /src/App.js | UTF-8 | 2,105 | 2.9375 | 3 | [] | no_license | import React, { Component } from "react";
import FriendCard from "./components/FriendCard";
import Wrapper from "./components/Wrapper";
import friends from "./friends.json";
class App extends Component {
state = {
score: 0,
friends,
clicked: [],
};
setClick = event => {
const character = eve... | true |
43cd4f407e3c171b1bcff136acfaf8add5d1565b | JavaScript | Sarina0627/Tecklinks_Sarina | /public/script.js | UTF-8 | 759 | 2.6875 | 3 | [] | no_license | $(function () {
$('#publish_btn').click(function () {
$('#publish').fadeIn();
});
$('#close_btn').click(function () {
$('#publish').fadeOut();
});
$(".fav-button").click(function(e){
let id = $(this).attr("id");
id = parseInt(id);
let tempThis = $(this);
$.ajax("/fa... | true |
894152d48e95dd8cf07b197082384a7eeee2197a | JavaScript | whiteskylife/study-demo | /基于vue实战 实现Excel表格上传与导出/20200430EXCEL表格上传和导出-讲义课件/服务端/utils/tools.js | UTF-8 | 697 | 2.75 | 3 | [] | no_license | // MD5的二次加密处理
function handleMD5(val = '') {
val = val.substring(4);
val = val.split('').reverse().join('');
val = val.substring(4);
return val;
}
// 返回结果的批处理
function success(flag = true, options = {}) {
let defaults = {
code: flag ? 0 : 1,
codeText: flag ? 'OK' : 'NO'
};
return Object.assign(defaults, opt... | true |
579bea66b1f7ba626015b87b7c6b9d0a3c8bfa1b | JavaScript | RodrigoBarrios88/inversiones | /SISTEM/assets.3.6.2/js/modules/app/padre.js | UTF-8 | 9,217 | 2.90625 | 3 | [] | no_license | //funciones javascript y validaciones
function Limpiar(){
swal({
text: "\u00BFDesea Limpiar la p\u00E1gina?, si a\u00FAn no a grabado perdera los datos escritos...",
icon: "info",
buttons: {
cancel: "Cancelar",
ok: { text: "Aceptar", value: true,},
}
}).then((value) => {
switch (value) {
... | true |
9129fdc00fea826edfd3346e41813b38d35df707 | JavaScript | pedrolyma/desafio-dio | /javascript/typescript/filaDoBanco.js | UTF-8 | 1,944 | 3.390625 | 3 | [] | no_license | // fila do banco
// O banco que você trabalha sempre tem problemas para
// organizar as filas de atendimento dos clientes.
// Após uma reunião com a gerência ficou decidido que os
// clientes ao chegar na agência receberão uma senha
// numérica em seu aparelho de celular via sms e que a
// ordem da fila será d... | true |
df38a04e8062a25c362a66acf7fc4698b20555eb | JavaScript | karthikuncc/React-Room-Booking-App | /src/services/RoomsService.js | UTF-8 | 1,946 | 2.765625 | 3 | [] | no_license | import Room from "../models/Room";
function RoomsService(observer) {
let roomsList = [
new Room({
roomId: 'Room1',
meetings: []
}),
new Room({
roomId: 'Room2',
meetings: []
}),
new Room({
roomId: 'Room3',
... | true |
2e9b16aba4b557f26ae8fe5703e71a939203de66 | JavaScript | manishadureja/Myapp | /OpenModal.js | UTF-8 | 1,074 | 2.78125 | 3 | [] | no_license | //Imports
import React, { useState } from "react";
import { Button, Image, View } from "react-native";
//This component is used to open a modal.
const OpenModal = (props) => {
// This function will open the modal on click of a button.
const [imgOpacity, setImgOpacity] = useState(0);
const openModalProject = () =... | true |
63cbacd4f613fbac50b88a49c3ea8e435d5743f9 | JavaScript | kenhoff/overwatch-stats-api | /index.js | UTF-8 | 4,419 | 2.515625 | 3 | [] | no_license | const debug = require("debug")("ow-stats-api");
const sortObj = require("sort-object");
const moment = require("moment");
debug("Starting up...");
if (process.env.NODE_ENV != "production") {
require("dotenv").config();
}
const express = require("express");
const app = express();
const knex = require("knex")(requir... | true |
7fc776f1af7605105b930ff3b0275ee05a6701af | JavaScript | rabiii3/rabi-tictactoe-winter-2019 | /src/actions/fruit.js | UTF-8 | 1,277 | 2.53125 | 3 | [] | no_license | import { getOneFruit } from '../request';
import { reduce, times } from 'ramda';
export const CELL_FRUIT_LOADED = 'CELL_FRUIT_LOADED';
export const loadFruits = () => dispatch => {
const promises = times(index => dispatch(loadFruitUntillPaperPlane(index)), 9);
return Promise.all(promises);
};
export const loadOn... | true |
4973274ca71553bd8e7a4fe3d7fa7bcd8ead73f2 | JavaScript | alamius/animations | /circle_inversion.js/Para_function.js | UTF-8 | 4,111 | 2.65625 | 3 | [] | no_license | function Para_function(fx, fy, range){
this.fx = fx || function(t){ return t; };
this.fy = fy || function(t){ return t; };
if(range !== undefined){
this.t = new Range(range);
}else{
this.t = new Range([0, 6.28, 0.05]);
}
this.G = [];
this.get_graph = function... | true |
b5c4d43ae334e51ea6704c35d515379565b4b32a | JavaScript | TrueFisherKing/js-object-patterns | /js/script.js | UTF-8 | 1,498 | 3.796875 | 4 | [] | no_license | var button = document.querySelector('.button');
var peopleFactory = function(name, age, state){
var temp ={};
temp.age = age;
temp.name = name;
temp.state = state;
temp.printPerson = function(){
console.log(this.name + ", " + this.age + ", " + this.state);
}
return temp;
}
var person1 = peopleFacto... | true |
87e6dc9d9bb20b18f26e8988d99a688f830fb7a5 | JavaScript | brianbochicchio/wegner2file | /wegner2file.js | UTF-8 | 1,718 | 3.125 | 3 | [
"MIT"
] | permissive | /*
Copyright 2023 by Brian Bochicchio for BE DIGITAL MEDIA LLC
Listens on TCP port 5001 (default) for input TITLE;ARTIST\r\n
from Wegner StorQ2 reciever. Then ouputs a TRE-friendly
with a static cut id, category and duration
Optional: Port argument can be added
USE: node wegner2file.js 8765
*/
//Requires & Default ... | true |
cb0ba0665bc195bf8b20936368690f1ecc764fbd | JavaScript | tlowerison/tilings | /www/src/components/canvas/utils.js | UTF-8 | 4,862 | 2.703125 | 3 | [
"MIT"
] | permissive | const canvasRadiusRefs = {};
const containerRefs = {};
const subContainerDetailRefs = {};
const defaultSubContainerDetail = {
element: null,
left: 0,
top: 0,
right: 0,
bottom: 0,
width: 0,
height: 0,
};
export const getContainer = (globalId) => containerRefs[globalId] && containerRefs[globalId].current;... | true |
d9b76c32de63f1b65eaf661c08ea4ced174df7e4 | JavaScript | ning8877/mall | /src/store/getters.js | UTF-8 | 614 | 2.53125 | 3 | [
"MIT"
] | permissive | const getters = {
// 购物车-商品数量
cartLength(state) {
return state.cartList.length
},
// 购物车-商品列表
cartList(state) {
return state.cartList
},
// 购物车-商品价格
totalPrice(state) {
return state.cartList.filter(item => {
return item.checked
}).reduce((preValue, item) =>{
ret... | true |
65927bef7f71505851878ece40710ee6078709f9 | JavaScript | jensvrai/meteor-translator | /src/inject/accept-language-test.js | UTF-8 | 1,669 | 2.734375 | 3 | [
"MIT"
] | permissive | var LanguageArray = Translator.LanguageArray;
var detect = function (acceptLanugage) {
var headers = {
'accept-language': acceptLanugage
};
return Translator._createLangaugeArrayFromHeader(headers);
};
// normalize the testing envirement
Translator.setLanguage(null); // ignore automated sources
Translator.set... | true |
7abb98899eafd42ea083a53a0b10439ba6873fca | JavaScript | michaelcoitim/CursoEmVideoJS | /aula11/exe008.js | UTF-8 | 219 | 2.734375 | 3 | [] | no_license | var vel = 60.0
console.log(`sua velocidade é de ${vel} Kh`)//condição simples
if(vel>60){
console.log(`Você passou a velocidade permitida, MULTADO!`)
}
console.log('Diriga sempre com segurança , use cinto!')
| true |
32086ffa49ebe9504aa78d0e903cb7c5652b5147 | JavaScript | Dhanya110/Project-25 | /sketch.js | UTF-8 | 857 | 2.703125 | 3 | [] | no_license | var paper1,groundSprite,world,waste1,waste2,waste3;
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
function preload()
{
}
function setup() {
createCanvas(1200, 700);
engine = Engine.create();
world = engine.world;
//Create the Bodies Here.
... | true |
9bc9c746c194903436868ebcb08d4446208aaf0a | JavaScript | joFolta/node-weather-app | /public/js/app.js | UTF-8 | 1,158 | 3.21875 | 3 | [] | no_license | console.log("Client side javascript file is loaded!");
const weatherForm = document.querySelector("form");
const search = document.querySelector("input");
const place = document.querySelector("#place");
const icon = document.querySelector("#icon");
const description = document.querySelector("#description");
const temp... | true |
a6e8373501d2e20d37c79453797d5de336acfe38 | JavaScript | bennymeier/react-credit-card-component | /src/App.js | UTF-8 | 2,314 | 2.84375 | 3 | [] | no_license | import React from "react";
import CardList from "./components/CardList";
import CardInput from "./components/CardInput";
import CardMonth from "./components/CardMonth";
import CardYear from "./components/CardYear";
class App extends React.Component {
state = {
cardNumber: "",
cardHolder: "",
month: "MM",... | true |
1d8c55e685d6605b74058d1e12c7a1ee0051e4e0 | JavaScript | Exairus/FOOD_DIST | /js/tries/script1.js | UTF-8 | 9,214 | 3.09375 | 3 | [] | no_license | window.addEventListener("DOMContentLoaded", () => {
// tabs
const tabs = document.querySelectorAll(".tabcontent"); //выбор всех табов
const items = document.querySelectorAll(".tabheader__item"); //выбор всех ссылок
const itemsParent = document.querySelector(".tabheader__items"); // выбор родителя для ... | true |
45b6a27282141f32dee2592f849a140abe3b27d7 | JavaScript | MatthewAnstey/screen-reader-image-test | /js/descriptions-toggle.js | UTF-8 | 586 | 2.875 | 3 | [] | no_license | (function () {
var $button = document.querySelector('.js-tests-toggle'),
$description = document.querySelectorAll('.js-description');
$button.addEventListener('click', descriptionToggle);
function descriptionToggle () {
var ariaExpanded;
for (var i = 0; i < $description.length; i++) {... | true |
877faf4c790daf5eb8a11658dd3b36a214f2d394 | JavaScript | philippe-blanquier/JeuEquipe | /js/snake.js | UTF-8 | 4,890 | 3.0625 | 3 | [] | no_license | var canvas = document.getElementById('zoneJeu');//identifier le canvas par son id
var contexte = canvas.getContext('2d');//definir le contexte de jeu avec 2 dimensions
var largeur = hauteur = 20; //definir les variables pour le snake
var x = Math.trunc(Math.random() * canvas.width / largeur) * largeur; //positionner ab... | true |
0c3449d2b80e87dc1f34be59d4b831e10eff1ef3 | JavaScript | linzhuangqq/vue-watch-demo | /src/observer/dep.js | UTF-8 | 394 | 2.6875 | 3 | [] | no_license |
let uid = 0
/**
* A dep is an observable that can have multiple
* directives subscribing to it.
*
* @constructor
*/
export default class Dep {
constructor () {
this.id = uid++
this.subs = []
}
addSub (sub) {
this.subs.push(sub)
}
notify () {
this.subs.forEach(sub => ... | true |
b17b3c024dc2162a0793ae9f4f74654b2f454856 | JavaScript | ekasapta/ekasapta.github.io | /assets/js/drag.js | UTF-8 | 2,418 | 3.140625 | 3 | [
"MIT"
] | permissive | // === Define Variables and Elements ===
var elements = document.querySelectorAll('.webTools .item');
var targetEl;
var wrapper = document.getElementById("boxWebTools");
var itemClip = document.getElementById("itemClip");
var scopeObj;
// === Event Binding ===
for (var i = 0, max = elements.length; i < max; i++) {
... | true |
ffd3d35c0692250579a7b7642bb581f2ad26ebf3 | JavaScript | nailkhasipov/elife | /docs/bundle.js | UTF-8 | 18,425 | 2.5625 | 3 | [] | no_license | /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ re... | true |
c30db5065c391a8ff66cf90e0e6851af6d1a81b9 | JavaScript | ikzsl/javascript-hexlet | /05_sequences/06_reduce.js | UTF-8 | 813 | 2.875 | 3 | [] | no_license | // BEGIN (write your solution here)
export const reduce = (func, acc, elements) => {
if (isEmpty(elements)) {
return acc;
} else {
const item = head(elements);
const newAcc = func(item, acc);
return reduce(func, newAcc, tail(elements));
}
};
export const emptyTagsCount = (tag, elements) => {
co... | true |
7cc1c749b9d52f741699cd512363aa8facc9e227 | JavaScript | gejiawen/test-async | /Control Flow/applyEach/1.3.js | UTF-8 | 1,149 | 2.953125 | 3 | [
"MIT"
] | permissive | /**
* @file: 1.3
* @author: gejiawen
* @date: 15/10/27 17:52
* @description: 1.3
*/
var async = require('async');
var t = require('../../t');
var log = t.log;
/**
* applyEach,可以实现给一数组中每个函数传相同参数,通过callback返回。
* 如果只传第一个参数,将返回一个函数对象,我可以传参调用。
*/
// applyEach(fns, args..., callback)
/**
* applyEachSeries与apply... | true |
630e14d6d68e6d54e5478ceefdee16e074d6e7f3 | JavaScript | bchen03/MovieMagic | /src/reducers/reducer-movies.js | UTF-8 | 674 | 2.953125 | 3 | [
"ISC"
] | permissive |
// Movie reducer
// Pure function that returns new movie state object
// Look at allReducers to see top-level Redux store state
export function moviesReducer(state={isFetching: false}, action) {
console.log("moviesReducer state:", state, ", action:", action );
switch (action.type) {
case "MOVIES_REQ... | true |
f861a4cac0f1af596a38c2a03470fd838e6548fb | JavaScript | Bit4z/Node.js | /undu.js | UTF-8 | 177 | 2.734375 | 3 | [] | no_license | var arr=[10,12,15,18,19,21,26]
console.log(arr)
var _=require('underscore')
var newArr=_.filter(arr,function(item){return item%2==0})
console.log("this is the even:",newArr) | true |
75d14b170f5f1e76d5c4ce1c9f296bfb7c514593 | JavaScript | potaeko/node-course-2-todo-api | /playground/mongodb-connect.js | UTF-8 | 1,652 | 3.28125 | 3 | [] | no_license |
//MongoDB module V3
// add with insertOne method
//const MongoClient = require('mongodb').MongoClient;.
//ES6 destructuring
const {MongoClient, ObjectID} = require('mongodb');
//take two arguement (string, callback function)
MongoClient.connect('mongodb://localhost:27017/TodoApp',(err, client)=>{
if(err){
... | true |
ba7ae4bb31504c516b94fc4d9d70a7685943e903 | JavaScript | ninoshen94/signpost-test | /public/js/test-page.js | UTF-8 | 7,937 | 2.8125 | 3 | [] | no_license | import { loading } from './main.js'
const submitButton = document.getElementById('submit')
const inputs = document.getElementsByTagName('input')
const quesContainers = document.getElementsByClassName('ques')
const readyButton = document.getElementById('ready')
const questionArea = document.getElementById('question-area... | true |
5767f37000031e8fd1d522bebc0e996b246f141e | JavaScript | geekingfrog/frontend-experiments | /app2/stores/favoriteStore.js | UTF-8 | 2,153 | 2.625 | 3 | [] | no_license | 'use strict';
// @flow
var { createStore } = require('../utils/storeUtils');
var actionTypes = require('../constants/actionTypes');
var appDispatcher = require('../dispatcher/appDispatcher');
var persistPrefix = 'fav-';
var localStorage = window.localStorage;
// declare class Map<K, V> {
// clear(): void;
// d... | true |
3510b3b1ba5623386a8446a3cb0ac6e15504f868 | JavaScript | hollowayjenelle/comp3101-finalproject | /priority.js | UTF-8 | 2,286 | 3.203125 | 3 | [] | no_license | function addprocess(){
var table = document.getElementById("algoTable");
var lastRow = table.rows[table.rows.length-1]; //gets the contents of the last row
var firstCell = lastRow.cells[0].innerHTML; //gets the content of the first cell in the last row
var lastRowNumber, arrival;
if (table.rows.length <= 1){... | true |
b9b1700f48f6e2c6ec82ffd27bab491e48ba8dc8 | JavaScript | straiforos/starling | /constants/questions.js | UTF-8 | 1,665 | 2.734375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT",
"Apache-2.0"
] | permissive | const copiesRegex = new RegExp('^[1-9]$');
const priceRegex = new RegExp('^\\d+$');
const questions = [
{
type: 'input',
name: 'copies',
message:
'how many copies of your data do you want to store on the network?',
default: function() {
return '1';
},
validate: function(answer) {
... | true |
97192db6b8112af4ecffc2dfc102abfd092a0dfb | JavaScript | saileshkasaju/tile-game | /js/app/classes/display/Display.js | UTF-8 | 1,070 | 2.9375 | 3 | [] | no_license | /**
* Created by sailesh on 7/7/17.
*/
define([], function() {
class Display {
constructor(_title, _width, _height) {
this.title = _title;
this.width = _width;
this.height = _height;
this.createDisplay();
}
createDisplay() {
document.ti... | true |
11ccf36f5142935e6663f4ad06023eb33ad207c1 | JavaScript | GiaPrograms/Honour_Project | /jia-v2.0-master/src/components/Review/Favourites.js | UTF-8 | 1,779 | 2.78125 | 3 | [] | no_license | /**
* @file
* Component for step 3 "Review & select treatment options"
* Contains the "My Favourites" tab section
* @author <akel.ms93@gmail.com>
*/
import React, {useState, useEffect} from 'react';
import {Row} from "reactstrap";
import TreatmentCard from '../TreatmentCard'
const Favourites = ({favs, setFavs, t... | true |
4b30055b4a67faacbfe83610132f52b80882e414 | JavaScript | AdamLandfrasz/pokedex-react | /src/context/CatchContext.js | UTF-8 | 957 | 2.53125 | 3 | [] | no_license | import React, { useState, useEffect, useContext, createContext } from "react";
import { UserContext } from "../context/UserContext";
import dbManager from "../db/dbManager";
export const CatchContext = createContext();
export function CatchProvider(props) {
const [caughtPokemons, setCaughtPokemons] = useState([]);
... | true |
ca9975b5641534cbdc0468dc86531212c3855e95 | JavaScript | habibcodes/lighthouse-js-fundamentals | /finalPosition.js | UTF-8 | 992 | 4.15625 | 4 | [] | no_license | // X Marks the Perfect Shot Assingment
/*
- array movements mapped to cardinal directions
- south and west are negative values
- north and east are positive values
- directions come from "moves array"
- output array will contain final coordinates in nums
- starting position is [0,0]
*/
const ... | true |
07df77ed47bcc28b6900eeca544a449aeeb9974e | JavaScript | evgenykuzyakov/artcoin | /src/components/Dash.js | UTF-8 | 3,498 | 2.65625 | 3 | [] | no_license | import React, {useEffect, useState} from 'react'
import ReactEcharts from "echarts-for-react";
import * as echarts from "echarts";
export const API_URL = 'https://api.artcoin.network/prices'
export const coinList = ['art', 'aNEAR', 'aBTC', 'aGOLD', 'aSPY', 'aEUR']
const Dash = () => {
const [day, setDay] = useSta... | true |
44f060c809c85a4e931233d2178abf887bde2efe | JavaScript | wykolor/knowledge | /es6/proxy.js | UTF-8 | 2,029 | 3.703125 | 4 | [] | no_license | {
let obj = {
time: '2020--01-07',
name: 'kolor'
}
let objProxy = new Proxy(obj, {
get(target, key) {
return target[key].replace('2020', '2021')
},
set(target, key, value) {
console.log('设置了值', key, value)
},
has(target, key) {
if(key === 'na... | true |
32c8f0375fb489bfbe7ef720007266db0595858c | JavaScript | pdewouters/Game-Of-Life-ReactJS | /src/App.js | UTF-8 | 4,122 | 2.8125 | 3 | [] | no_license | import React, { Component } from 'react'
import _ from 'underscore'
export default class App extends Component {
constructor(props){
super(props)
this.state = {
rowCount:50, colCount:70, rows:[], generations:0, delay: 2000
}
}
componentDidMount(){
this.initGrid(... | true |
0e1d0afaab7a14d1732b655548cb2abd9c0dc996 | JavaScript | rileric/retrack-client | /src/TimelineSys/AddTimelineEvent/AddTimelineEvent.js | UTF-8 | 3,929 | 2.546875 | 3 | [] | no_license | import React from 'react';
import { withRouter } from 'react-router-dom';
import PropTypes from 'prop-types';
import ApiContext from '../../ApiContext';
import config from '../../config';
import '../../App.css';
import { getEventsForTimeline } from '../../EventSys/events-helpers';
class AddTimelineEvent extends React.... | true |
9db357d92e3dca722c693cd2acebb6aa26e882ad | JavaScript | EdgarM510/trainScheduler | /app.js | UTF-8 | 3,891 | 2.765625 | 3 | [] | no_license | let config = {
apiKey: "AIzaSyCCMTvz5zud8S2uhfENn2TA_DwnzkmPTxo",
authDomain: "denshasolutions.firebaseapp.com",
databaseURL: "https://denshasolutions.firebaseio.com",
projectId: "denshasolutions",
storageBucket: "denshasolutions.appspot.com",
messagingSenderId: "500363251448"
};
firebase.initializeApp(conf... | true |
1c296d1af6a298b6c3f6df89aa9f092ea395e0ff | JavaScript | Yqi9979/zhihu | /src/pages/Home/index.js | UTF-8 | 2,150 | 2.59375 | 3 | [] | no_license | /**
* @author Yqi
* @description 首页
*/
import React, { Component } from "react";
import "./main.css";
import { getNews } from "../../api/index";
/* 组件 */
import HomeHead from "../../components/home/home-head/index";
import Carousel from "../../components/common/carousel/index";
import ArticleList from "../../compo... | true |
794e85e3c6abc887c998e8e29c37fd18f57a816e | JavaScript | edirates/codewars | /4kyu/next-bigger-number-with-same-digit.js | UTF-8 | 3,431 | 4.6875 | 5 | [
"MIT"
] | permissive | /*
You have to create a function that takes a positive integer number and returns the next bigger number formed by the same digits:
12 ==> 21
513 ==> 531
2017 ==> 2071
If no bigger number can be composed using those digits, return -1:
9 ==> -1
111 ==> -1
531 ==> -1
*/
function nextBigger(n){
// First change numb... | true |
d773eeafe405038aa615177d16655a2868d35332 | JavaScript | KrimsonKing1337/gordey-backend | /src/utils/collectionChangeCase.js | UTF-8 | 1,555 | 3.5 | 4 | [
"MIT"
] | permissive | const isArray = require('lodash/isArray.js');
const isObject = require('lodash/isObject.js');
const flattenDeep = require('lodash/flattenDeep.js');
const changeCase = require('change-case');
/**
*
* @param obj {object}
* @param [variant] {string}
*/
function objectChangeCase(obj, variant = 'camelCase') {
if (isO... | true |
eca23a8d975a68f87fa427ab3e9b7545f2cd1123 | JavaScript | behzadiv/comment-app | /src/components/NewComment.jsx | UTF-8 | 1,600 | 2.53125 | 3 | [] | no_license | import { useState } from "react";
import { addNewComment } from "../services/addCommentService";
const NewComment = ({ onAddComment }) => {
const [comment, setComment] = useState({
name: "",
email: "",
body: "",
});
const changeHandler = (e) => {
//console.log(e.target.id,e.target.value);
se... | true |
ec354e883682e55ba3da25b8c5c0122d5d7df986 | JavaScript | Aurorum/coronavirus-slogan-generator | /scripts.js | UTF-8 | 2,052 | 2.875 | 3 | [] | no_license | window.onload = function () {
canvasUpdate();
collectStatistics("new view");
};
function buildCanvas(canvasId, version) {
var canvas = document.getElementById(canvasId);
var ctx = canvas.getContext("2d");
var img = document.getElementById(version);
ctx.drawImage(img, 10, 10);
var ctx = canvas.getContext(... | true |
feb85bbca67e9ff00769a548c025d6e081f8798d | JavaScript | nathnaelweldegiorgis/nathnaelweldegiorgis.github.io | /W3D5/q2/index.js | UTF-8 | 984 | 3.046875 | 3 | [] | no_license | const express = require('express');
const app = express();
const port = 3000;
app.get('/', (req, res) => {
res.send(`<form action = '/result' method = "post">
Name <input type = "text" name = "nameText" size="10"/>
Age <input type = "text" name = "ageText" size="10"/>
... | true |
4169b9fd3479e7843e85cdbfbdd9b186cec2a3c5 | JavaScript | Magnus-web/Home_task_7_js | /js/task_4.js | UTF-8 | 511 | 3.546875 | 4 | [] | no_license | let span = document.querySelector("#value");
let counterValue = +span.textContent;
function increment() {
document
.querySelector('button[data-action="increment"]')
.addEventListener("click", () => {
counterValue += 1;
span.textContent = counterValue;
});
}
function decrement() {
document
... | true |
773880daabcb7e78ac01a7deb8bd7cd94aeff8ed | JavaScript | Jxiang-jc/daily_practise | /20.网易公开课/1.jquery源码分析/jQuery.1.js | UTF-8 | 3,329 | 3.03125 | 3 | [] | no_license | /*!
* jQuery JavaScript Library v3.3.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/ 选择器引擎
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2018-01-20T17:24Z
*/
// 闭包
( function( global, factory ) {
"use stri... | true |
d1aec7e0472bc689cf96b8a061214f6896b35671 | JavaScript | Ibexian/node-markov | /test/cycles.js | UTF-8 | 781 | 2.703125 | 3 | [
"MIT"
] | permissive | var test = require('tape');
var markov = require('../');
var fs = require('fs');
test('cycles', function (t) {
var to = setTimeout(function () {
t.fail('never finished');
}, 5000);
var m = markov(1);
var these = 'the THE tHe ThE thE The';
m.seed(these, function () {
clearTimeout(t... | true |
705be7ba426f5bc955e41ca4c507a6d0097c2e27 | JavaScript | coderforever/bamboo-ui | /components/Grid/Col.js | UTF-8 | 2,800 | 2.578125 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
const REGEX = /^(\d+)\/(\d+)$/;
function getMatch(numerator, denominator, total) {
const multiple = (total / denominator);
if (multiple !== Math.floor(multiple)) return null;
return `${numerator * multiple}-${total... | true |
b16fdc5b868f7efb86b413586a59be0ae3383c19 | JavaScript | Octane2/Initial-Pre-Work | /5-Introduction-to-JavaScript/3-Storing-Values-with-the-Assignment-Operator.js | UTF-8 | 232 | 3.296875 | 3 | [] | no_license | /* For this module, I learned how to assign numerical values to two different
variables.*/
// Setup
var a;
var b = 2;
//My solution for Part 3.
// Only change code below this line
var a = 7;
var b = a;
//----------------------
| true |
4c356a33d4a0417ce4550597e24d18ae812f6f34 | JavaScript | vlladin/advent-of-code-2018 | /1-2.js | UTF-8 | 641 | 3.28125 | 3 | [] | no_license | const fs = require('fs');
const data = fs.readFileSync('1.in').toString();
let numbers = data.split('\n').map(item => {
return parseInt(item);
});
let seenFreq = { 0: true };
let currentFreq = 0;
let duplicateFreq;
findSameFreq();
function findSameFreq() {
for (let i = 0; i < numbers.length; i++) {
... | true |
982b3d3526528905b92ffbebbfd2545a2c0d1a58 | JavaScript | laffed/Leetcode-JS | /OA/wordSearch.js | UTF-8 | 1,582 | 4.09375 | 4 | [] | no_license | /*
79. Word Search
Medium
Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.
Example:
board =
[
['A',... | true |
7287be240e7659d7a656b55d08fa9b69ae587f04 | JavaScript | heron2014/Eloquent_Javascript_exercises | /chapter5_ flattening.js | UTF-8 | 190 | 3.203125 | 3 | [] | no_license | function flattening(array) {
return array.reduce(function(prev, cur){
return prev.concat(cur);
})
}
var arrays = [[1, 2, 3], [4, 5], [6]];
var newArray = flattening(arrays); | true |
7a14ced7d41413b8f91537de724a669ef56e34fc | JavaScript | axeldamian/nodeprimerp | /public/funciones.js | UTF-8 | 578 | 3.03125 | 3 | [] | no_license | function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
/*element.style.visibility = 'visible... | true |
86add325c21d35830ccaf336a322e8ea86317a75 | JavaScript | sebastiancdhf/SADE | /resources/js/directivos/components/eventos.jsx | UTF-8 | 3,102 | 2.6875 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import peticion from '../utils/peticion';
import { meses } from '../../publico/utils/fecha';
import Cargando from '../../publico/components/cargando';
import Evento from './evento';
import Calendario from '../../publico/components/calendarios';
import NuevoEvento from... | true |
1e338b68fb48e0d2a3d82ffb60605bb7fd936a89 | JavaScript | Elton1021/github-explorer | /src/App.js | UTF-8 | 1,416 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import Navbar from './component/layouts/Navbar';
import Search from './component/layouts/Search';
import Users from './component/users/Users';
import axios from 'axios';
import spinner from './spinner.gif';
class App extends Component {
state = {
user... | true |
908ee7922115911b2d9c7daed32aaadfb7193779 | JavaScript | yunikoro/phaser-start | /src/components/EnemiesPool.js | UTF-8 | 2,214 | 2.703125 | 3 | [] | no_license | import Phaser from 'phaser'
import Enemy from './Enemy'
export default class EnemiesPool extends Phaser.Physics.Arcade.Group {
constructor({ scene, config }) {
const { maxSize = 8 } = config
super(scene.physics.world, scene)
this.scene = scene
this.maxSize = maxSize
this.cu... | true |
221aa5cb88521b75acc1ed3ea2053e281ab8a7b2 | JavaScript | green-fox-academy/davidjakoi | /week-07/day-1/frontend/app.js | UTF-8 | 1,723 | 2.921875 | 3 | [] | no_license | const express = require('express');
const app = express();
const PORT = 8080;
const path = require('path');
var bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use('/assets', express.static('assets'));
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'index.html'));
});
function s... | true |
2de9ab7c29ef0eb3c56daa036d8452419ce717ba | JavaScript | XinRuiFang/B_Note | /N_Note/js/note.js | UTF-8 | 1,666 | 2.515625 | 3 | [] | no_license | function noteClass(x,y){
var obj = new Object();
obj.x = x;
obj.y = y;
obj.showlayout = function(){
var c_div = document.createElement("div");
c_div.className = [c_div.className, 'note_box'].join(' ');
c_div.style.top = obj.x +"%";
c_div.style.left = obj.y +"%";
var c_u... | true |
20323262994a47668775707d75aeb7f39ee3fb5f | JavaScript | Keikeu/Pegs | /src/components/board.js | UTF-8 | 634 | 2.640625 | 3 | [] | no_license | import React from 'react';
import Peg from './Peg.js';
class Board extends React.Component {
renderPeg(i) {
return (
<Peg
key={i}
value={this.props.pegs[Math.floor(i/this.props.width)][i%this.props.height]}
onClick={() => this.props.onClick(Math.floor(i/this.props.width), i%this.pro... | true |
81f64fd6a24fcce1c1a8714df852b359bb10a08e | JavaScript | immafrady/FreeCodeCamp | /Intermediate Algorithm Scripting/Pig Latin.js | UTF-8 | 553 | 3.203125 | 3 | [] | no_license | function translate(str) {
var vowel=['a','e','i','o','u'];
str=str.split('');
var index=[];
for (var i in vowel){
if (str.indexOf(vowel[i])>-1) index.push(str.indexOf(vowel[i]));
}
index=index.sort(function(a,b){
return a-b;
});
var min=index[0];
if (min===0){
str.push('way');
str=str... | true |
3135f603aa4f70d6c428e377d9e745d2833549cb | JavaScript | kellolo/js-2-08_21.11 | /students/Maxim Sozinov/project/src/server/cartCore.js | UTF-8 | 1,178 | 2.734375 | 3 | [] | no_license | const fs = require('fs');
function rewriteCart (cart, file) {
let newCart = {
"amount": '',
"countGoods": '',
"contents": cart
};
fs.writeFile(file, JSON.stringify(newCart, null, 2), (err) => {
if (err) {
throw err;
}
});
return (JSON... | true |
13e6387361774571ee8c952b9e4f3473c14a33d1 | JavaScript | PatrickCHennessey/Data_Visualization_Project | /static/radar_scripts.js | UTF-8 | 741 | 3.328125 | 3 | [] | no_license | // Create an event listener for the radar graph update button click
document.getElementById("update_radar").addEventListener("click",update_radar);
// Create the JS to generate the radar graph
//const update_radar = () => {
function update_radar() {
// Get year from dropdown selector
let e = document.getElem... | true |