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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1924a727050cf1703f4aee980fb0dacbfff5cb74 | JavaScript | Alehandr0/rushcms | /rc/_control/data/js/libs/rs.fileupload/rs.fileupload.js | UTF-8 | 3,380 | 2.625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | /*
RSModal - стандартная загрузка файлов RushCMS.
В качестве примера php-обработчика посмотрите data/upload.php и handler.php в каталоге этой библиотеки
Использование:
$('.upload_button').rsfileupload({
upload_handler : 'path/to/upload.php', // Путь к php-обработчику загрузки (по умолчанию: [rsfileupload s... | true |
a8bed312a971c93a2f42f3d557414dd09e9eca77 | JavaScript | mohmmadnoorjebreen/project | /js/app.js | UTF-8 | 4,440 | 3.703125 | 4 | [
"MIT"
] | permissive | /* eslint-disable no-empty */
/* eslint-disable no-trailing-spaces */
'use strict';
let out = [];
let user = prompt('Please enter your name');
alert('Welcome '+ user+', to my page');
let myName = prompt('Well ' + user+', now I want to do a quick quiz of 5 questions for you \n to determine how much you know about me\... | true |
3f9bd9fc5d3073e14560dc13b30357a66da49db5 | JavaScript | tirempbs/simple-pod-frontend | /src/App.js | UTF-8 | 3,572 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import { BrowserRouter as Router, Link, Route } from 'react-router-dom';
import Search from './components/Search';
import Profile from './components/Profile';
import Podcast from './components/Podcast';
import Episode from './components/Episode';
const sear... | true |
91ccbb62e4e1542a2be192bce4b026034bf73c8d | JavaScript | rickydomingos97/NLW2 | /src/server.js | UTF-8 | 1,121 | 2.703125 | 3 | [
"MIT"
] | permissive | // importando o express
const express = require('express')
const server = express() // esse server nos retorna um objeto
const { pageLanding, pageStudy, pageGiveClasses, saveClasses } = require('./pages') // added for give-classes.html form
//importando o nunjucks
// TEMPLATE ENGINE:
const nunjucks = require('nunjucks'... | true |
cb83e7984397abe1c3cb651aca832b0b78e6e249 | JavaScript | Daniel-Avramovic/BIT-PP | /Exercises/03-Switch/Task_8.js | UTF-8 | 719 | 4.84375 | 5 | [] | no_license | //8. Write a program that takes as input two numbers and a string denoting the operation (“+”, “-”, “*”, “/”) and prints out the appropriate result. Watch out for division by zero!
var x = 4;
var y = 0;
var operations = '+';
var resOperations;
switch (operations) {
case '+':
resOperations = (x + y);
... | true |
6620fc62b9aabcf759c02de8b57bd8fc6a8b8411 | JavaScript | dexter0201/dexter-app | /app/routes/tasks.js | UTF-8 | 1,805 | 2.5625 | 3 | [
"MIT"
] | permissive | const app = module.exports = require('express')();
const {
getTasks,
getTaskById,
createTask,
updateTask,
deleteTask,
changeStatus
} = require('app/actions').tasks;
app.get('/list', (req, res) => {
getTasks(req.user, req.project, req.query)
.then((tasks) => res.send({tasks}));
... | true |
6cbbd1503a26df8f217f13b1bb90564046c944f2 | JavaScript | pursuedreams/brief-pro | /js/model-display-list.js | UTF-8 | 1,393 | 2.546875 | 3 | [] | no_license | $(function(){
function getUrlParam(name, url) {
url = url || window.location.search;
const reg = new RegExp(`(^|\\?|&)${name}=([^&]*)(\\s|&|$)`, 'i');
if (reg.test(url)) return unescape(RegExp.$2.replace(/\+/g, ' '));
return ''
};
var type = getUrlPara... | true |
e4e25eeadcd687190ff7b094c25716974ae0fec6 | JavaScript | coughka/Not-So-Different | /js/main.js | UTF-8 | 637 | 3.0625 | 3 | [] | no_license | function openNav() {
document.getElementById("myNav").style.width = "100%";
}
function closeNav() {
document.getElementById("myNav").style.width = "0%";
}
function readMore() {
var dots = document.getElementById("dots");
var moreText = document.getElementById("more");
var btnText = document.getEle... | true |
1cbc8dbd266aa403899ad903b6dc6dad66f5ea20 | JavaScript | carlos-palalo/2_DAW | /DWEC/TemarioDWEC/Tema1/teoria/ejemploConcatenacion.js | UTF-8 | 79 | 2.515625 | 3 | [] | no_license | v1 = '10';
v2 = 2;
console.log("'10'+2="+v1+v2);
console.log(typeof(v1+v2)); | true |
6997b86c92b28b3352702011908459137bd99dbe | JavaScript | crstffr/omen.control | /lib/class/page.js | UTF-8 | 1,558 | 3.03125 | 3 | [] | no_license |
export const REPEAT = Array(17).fill().map((v, i) => i); REPEAT.unshift('∞');
export const SPEED = [0.125, 0.25, 0.5, 1, 2, 4, 8];
export class Page {
constructor(i, steps) {
this.i = i;
this.start = 1;
this.end = 64;
this.speed = 1;
this.repeat = 4;
this.temp =... | true |
91b5621f8bd802147b6fa0ac83f8448d6ab5b0c3 | JavaScript | olesj98/node-mysql-docker-compose | /middleware/requestValidator.js | UTF-8 | 598 | 2.53125 | 3 | [] | no_license | const { findOne } = require('../components/products/productsModel');
const requestValidator = async (req, res, next) => {
try {
const { productId, amount, totalPrice } = req.body;
if (!productId || !amount || !totalPrice) {
next(new Error('Wrong request body.'));
}
const [product] = await findO... | true |
cdd374e7ee2c6b6d6993f3d66b48707177b6bb6a | JavaScript | roers1/Studdit | /server.js | UTF-8 | 721 | 2.59375 | 3 | [] | no_license | const mongoose = require('mongoose')
const app = require('./app')
// since app inherits from Event Emitter, we can use this to get the app started
// after the database is connected
app.on('databaseConnected', function() {
const port = 3050
app.listen(port, () => {
console.log(`server is listening on... | true |
0f78a9373ed02ec5ed038c03f9ed911b18c146fa | JavaScript | nahidfawaz123/week01_day05_JS_conditions_loops | /main.js | UTF-8 | 626 | 3.96875 | 4 | [] | no_license | function oddEven(x){
if (x%2==0){
console.log("the number "+(x)+" is even ");
}
else {
console.log("the number"+(x)+" odd");}
}
function score(x){
if (x>=90){
console.log(" the grade is A");
}
else if( x>=80||x<=89){
console.log(" the grade is B");
}
else if( x>=70||x<=79){
console.log(" the gra... | true |
7e618b8a982b56c5d8a8eb4c6644cc5d134cb71f | JavaScript | vguercio10/unit-4-game | /assets/javascript/game.js | UTF-8 | 2,988 | 3.765625 | 4 | [] | no_license | $(document).ready(function () {
// Variables
var wins = 0;
var losses = 0;
var userScore = 0;
var computerNumber = Math.floor(Math.random() * (120 - 19)) + 19;
$("#Numbertoguess").text(computerNumber);
// Crystals generate numbers
var crystal1 = Math.floor((Math.random() * 12) + 1);
$("#green").a... | true |
2d5afc47d2cbe3f79f627093965aee57f7b96589 | JavaScript | erlukas/fog-node | /views/pages/partials/dashboard.js | UTF-8 | 7,115 | 2.625 | 3 | [] | no_license | (function($) {
let free = $('#free').val(),
used = $('#used').val(),
hFree = $.readableBytes(free),
hUsed = $.readableBytes(used);
// Disk Usage
let diskUsageCanvas = $('#diskUsage').get(0).getContext('2d'),
diskUsageData = {
labels: [
`Free: ${hFree}`,
`Used: ${hUsed}`
... | true |
332333387155f27f81242e9f67eaedf631a4db2a | JavaScript | mikeandino/Proyecto1_TBDII | /back_ed/routes/pregunta.js | UTF-8 | 1,752 | 2.640625 | 3 | [] | no_license | const router = require("express").Router();
const Pregunta = require("../models/pregunta.model");
router.route("/").get((req, res) => {
Pregunta.find()
.then((pregunta) => res.json(pregunta))
.catch((err) => res.status(400).json("Error: " + err));
});
router.route("/add").post((req, res) => {
const id = r... | true |
5e0c1034001fed9e853f554bce2cf6450abffd86 | JavaScript | gitter-badger/koa-gate | /lib/type.js | UTF-8 | 1,921 | 2.90625 | 3 | [
"MIT"
] | permissive | var hash = require('object-hash');
var checkers = {
string: function(field, value, config) {
if(!(config.regular instanceof RegExp) || config.regular.test(value)) {
return value;
}
throw new Error(field + ' is not regular!');
},
number: function(field, value, config) {
if(isNaN(value)) throw... | true |
1619a8910af97337ea55b1c40a01daf25e282c11 | JavaScript | SebasG22/SPLOT | /modules/users/usersList.js | UTF-8 | 5,847 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | /**
* Multi-user SPLOT
*/
angular.module('usersSplot')
.controller('userListCtrl',
function (users, $scope, typeUser, $window, userUpdate, $state, projects,$firebaseArray) {
$scope.users = users;
//All the Users -> Firebase Array
$scope.usuarios = users;
... | true |
0a6b158274e810001e0c2bab0c793d3eb6845374 | JavaScript | lzh-kf/react-admin | /src/utils/index.js | UTF-8 | 689 | 2.5625 | 3 | [] | no_license | function findParentElement (data, parentId, tempdata) {
const result = []
const { length } = data
for (let i = 0; i < length; i++) {
const item = data[i]
if (item.menuId === parentId) {
result.unshift({
path: item.path,
name: item.menuName,
menuId: item.menuId,
parent... | true |
78a3be19861af44d87e1406a71d5da88bee8e8b8 | JavaScript | Sithara95Hansanie/assignment-react | /src/Components/Layout/AllPost.js | UTF-8 | 1,625 | 2.515625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { Link } from "react-router-dom";
import axios from "axios";
import ReactPaginate from "react-paginate";
function AllPosts() {
const [offset, setOffset] = useState(0);
const [data, setPosts] = useState([]);
const [perPage] = useState(9);
const [pageCo... | true |
b0bdb65699ed2f85559eed44cbf244f79e3a3561 | JavaScript | tobiasvpini/RickAndMortyAPI | /view/characters/loadingCharactersObject.js | UTF-8 | 499 | 2.875 | 3 | [] | no_license | import Character from "../../objects/Character.js";
export default function loadingCharactersObject(characters){
let charactersArray = [];
for(let character in characters){
charactersArray[character] = new Character(characters[character].id, characters[character].name, characters[character].status, cha... | true |
ff584403fd790dec6eb65de5633a36a310c7e60d | JavaScript | MYyuting/mogujie | /yougou/js/fenlei.js | UTF-8 | 503 | 2.515625 | 3 | [
"MIT"
] | permissive | var arr = [0]
var num = 0
//console.log($(".fenlei-right>div").eq(0).height())
$(".fenlei-right>div").each(function(index){
num += $(".fenlei-right>div").eq(index).height()+3;
arr.push(num);
})
//console.log(arr)
$(".fenlei-left li").on("click",function(){
var index = $(this).index();
$("li").css({backgrou... | true |
bff444b8799233dd97c1a3bf5a017587f3697eb7 | JavaScript | rubythonode/content-module | /lib/core/api.js | UTF-8 | 844 | 2.515625 | 3 | [
"MIT"
] | permissive | import { Router } from 'express'
const fs = require('fs')
export default function createRouter (contentMap, options) {
const router = Router()
contentMap.forEach((contentDirMap, endpoint) => {
if (endpoint === '/') endpoint = '_root_'
const sendContent = curryResponseHandler(contentDirMap, endpoint)
r... | true |
dd3b28e7667ee6adedba1ce9cf1f79b4ebbdd657 | JavaScript | AVGP/js-parallelism-demos | /simple-worker/prime-worker.js | UTF-8 | 514 | 3.046875 | 3 | [
"MIT"
] | permissive | self.onmessage = function(msg) {
var view = new Uint8Array(msg.data),
numPrimes = 0
for(var i=0; i<view.length;i++) {
var primeCandidate = i+2 // 2 is the smalles prime number
var result = isPrime(primeCandidate)
if(result) numPrimes++
view[i] = result
}
self.postMessage({
buffer: view... | true |
e41f04aad36cbc71bd7f41059ea51bb61a223003 | JavaScript | Angel877898/ProyectoNode | /frontend/src/components/Input.js | UTF-8 | 3,880 | 2.65625 | 3 | [] | no_license | import React, { useState } from 'react'
import PropTypes from 'prop-types'
import '../assets/styles/components/Input.css'
const Input = ({ name, type, search, value, onChange }) => {
// name - nombre input
// type - tipo input -> 1:text / 0:password
// search - input de busqueda -> true
const [input... | true |
e3e4d1a414809191187097dfbb06e13397d8c4a6 | JavaScript | etsmit8599/UPiO | /routes/building.js | UTF-8 | 1,657 | 2.546875 | 3 | [] | no_license | var express = require("express");
var router = express.Router();
var User = require("../models/user");
var Item = require("../models/items");
var Bag = require("../models/bag")
router.get("/", function(req,res){
res.render("landing");
});
router.get("/options",function(req,res){
Item.find({}, function(er... | true |
f0f8fae4aefcb47783c28154367ca1a66b4fa1a1 | JavaScript | morlay/react-pure-mdl | /src/toggles/RadioGroup.js | UTF-8 | 1,566 | 2.5625 | 3 | [] | no_license | import { cloneElement, createElement, Component, PropTypes, Children } from 'react';
class RadioGroup extends Component {
static propTypes = {
component: PropTypes.string,
name: PropTypes.string,
// return the selected value
onChange: PropTypes.func,
children: PropTypes.node,
defaultValue: Pr... | true |
7f43b8a242ad51ae7b70a9115673e62e819c1953 | JavaScript | matvey-b/project-lvl1-s320 | /src/games/balance.js | UTF-8 | 1,574 | 3.234375 | 3 | [] | no_license | import runGame from '../runGame';
import { isEven, getRandomInt } from '../utils';
const description = 'Balance the given number.';
export const immutableSort = (list) => {
const left = (x, rest) => rest.filter(val => val <= x);
const right = (x, rest) => rest.filter(val => val > x);
const sort = (x, rest) => [... | true |
8cf32fe4c8cda83baf0d72bbf78874534fb9a197 | JavaScript | floralbit/dungeon | /client/src/components/chatlog.js | UTF-8 | 2,733 | 2.625 | 3 | [] | no_license | import React, { Component, useRef, useEffect, useState } from 'react';
import {sendChat, setTyping} from '../redux/actions';
function ChatLog(props) {
const {log: {log}} = props;
const messagesEndRef = useRef(null);
useEffect(() => {
messagesEndRef.current.scrollIntoView();
}, [JSON.stringify(log)]); // ... | true |
da7dfdb63d99b6a4373a76f803fe34f4691344f6 | JavaScript | orsilarssen/EmeseEeva | /week-07/day-4/onclick.js | UTF-8 | 281 | 3.03125 | 3 | [] | no_license | const party = document.querySelector('body');
const button = document.querySelector('button');
button.onclick = () => {
if (party.className === 'party') {
party.className = '';
} else {
party.className = 'party';
}
console.log(party.className);
}
| true |
6b6f275251edf706b041071925862d3e55ef173e | JavaScript | Eleven-Elevens/interview | /JS高级/16.同步异步和EventLoop.js | UTF-8 | 2,157 | 3.765625 | 4 | [
"MIT"
] | permissive | /**
* JS中的异步编程:
* + 定时器
* + ajax(HTTP网络请求)
* + Promise
* + async/await(generator)
* + 事件绑定
* + requestAnimationFrame
* + ...
*
* JS是单线程的,不能同时处理多个事情
* 1. JS中大部分代码都是同步线程
* 2. 但是可以基于单线程的 EventLoop(事件循环机制) 实现异步效果
*
* 浏览器是多线程的,打开一个页面,浏览器会分配很多线程,同时处理
* + GUI渲染线程:自上而下渲染页面
* +... | true |
296de95a3e4a45f9cb074b5a66924a9888b5bb57 | JavaScript | naimjeem/freecodecamp-algorithm | /basic/longest-string.js | UTF-8 | 478 | 4.03125 | 4 | [] | no_license | const findLongestWord = (str) => {
var arrOfStr = str.split(' ');
//Create an array breaking up every space
var longestStr = '';
//temporary placeholder for longest string
for(var i=0; i<arrOfStr.length; i++) {
if(longestStr.length<arrOfStr[i].length) {
longestStr = arrOfStr[i];
}
}
//iterat... | true |
173351c854f3d57c3e8557af7c23318ec8525862 | JavaScript | Metricall/UI-site | /Metrical/adminmain.js | UTF-8 | 401 | 2.546875 | 3 | [
"MIT"
] | permissive | function goIn()
{
var logins = document.getElementById('logins')
var pas = document.getElementById('pas')
if (logins.value == 'admin' && pas.value == '123')
document.location.href = 'adminmain.html';
else if (logins.value == 'professor' && pas.value == '456')
document.location.href = 'prof... | true |
2d930f5f1b1f4965dabfbab2d97b116e69d6ec2e | JavaScript | matiasdurand/dan-app-frontend | /src/components/order/OrderEdit.js | UTF-8 | 4,473 | 2.515625 | 3 | [] | no_license | import {
Flex,
Button,
FormControl,
FormLabel,
Heading,
Input,
Select,
useColorModeValue
} from "@chakra-ui/react"
import axios from "axios";
import OrderItemTable from "./OrderItemTable"
import { useEffect, useState } from "react";
import { useHistory, useParams } from "react-router-dom";
const OrderE... | true |
3782aa51974fdbb979f55c0989e20e8a4350b295 | JavaScript | kmamal/bytes | /src/var-int.js | UTF-8 | 3,905 | 3.109375 | 3 | [
"MIT"
] | permissive |
const BITS = 7
const BASE = 2 ** BITS
const BIG_BITS = BigInt(BITS)
const BIG_BASE = BigInt(BASE)
const BIG_MASK = BIG_BASE - 1n
const POWERS = []
for (let i = 0; i <= 7; i++) {
POWERS[i] = BASE ** i
}
const big_powers = [ 1n ]
const getBigPower = (i) => {
if (big_powers.length > i) { return big_powers[i] }
cons... | true |
8095715286b85f831659a24fc72e1667cbd79ed8 | JavaScript | dillon-co/react-rails-scraping-practice | /app/assets/javascripts/components/link.es6.jsx | UTF-8 | 2,789 | 2.703125 | 3 | [] | no_license | // import TimerMixin from 'react-timer-mixin';
class Links extends React.Component {
constructor(props, content){
super(props, content);
this.state = {initialLinks: (this.props.initialLinks || "")}
}
componentDidMount(){
setInterval(this.updateLinks.bind(this), 25)
}
updateLinks()... | true |
54de18e935b4559bb60be8c5baa7d6acdf38d65b | JavaScript | Dihsl1986/JS | /LivroLogicaDeProgramacaoComJavaScript/Capitulo_2/js/resp2_b.js | UTF-8 | 798 | 3.390625 | 3 | [] | no_license |
var btnCalcular = document.getElementById("btnCalcular");
function calcularPreco() {
//Criar uma referencia ao elemnto da paginando
const inputPrecoPorMin = document.getElementById("inputPrecoPorMin");
const inputTempoDeUso = document.getElementById("inputTempoDeUso");
const outRes... | true |
06201cf9af87de1d0e715bd79382f1e7e88e7e5c | JavaScript | darren-stoll/WebStuff | /MarkdownPreview/script.js | UTF-8 | 1,488 | 3 | 3 | [] | no_license | // ALLOWS LINE BREAKS WITH RETURN BUTTON
marked.setOptions({
breaks: true
});
const renderer = new marked.Renderer();
renderer.link = function(href, title, text) {
return `<a target="_blank" href="${href}">${text}` + '</a>';
};
const defaultText = `
# Header 1
## Header 2
More \`<div>Inline code</div>\` found... | true |
58bf2c89c88487a134b0c25505fc7f786c5d2c73 | JavaScript | MattSHarker/javascript_practice | /5_higher_order_functions/higherOrderFunctions.js | UTF-8 | 1,056 | 4.71875 | 5 | [] | no_license | /* Higher order functions take in other functions as parameters
* Allows for abstraction over actions, not just values */
// CREATING A FUNCTION WITH A FUNCTION
const greaterThan = x => { // the outer function doesn't need to be an arrow decl.
return y => y > x;
};
let greaterThan5 = greaterThan(5);
console.l... | true |
522c70965c49b676f582cdb52f5782a94dae96ef | JavaScript | Sansanchik/JS-Advansed-HomeWorks | /HomeWork6 - Twitter/main.js | UTF-8 | 6,066 | 3.15625 | 3 | [] | no_license | renderPosts(getUsers(), getPosts());
function getUsers() {
let users = fetch("https://jsonplaceholder.typicode.com/users")
.then(response => response.json());
return users;
};
function getPosts() {
let posts = fetch("https://jsonplaceholder.typicode.com/posts")
.then(response => response.json());
retu... | true |
0c09d262ab375a023050b1a06c0a74a0dd38af9a | JavaScript | Skyrex98/UNCMern | /10-OOP/01-Activities/09-Stu_TDD/Unsolved/algo.js | UTF-8 | 329 | 3.125 | 3 | [] | no_license | function Algo() {}
Algo.prototype.reverse = function (str) {
if (!str) {
return '';
}
return str.split('').reverse().join('');
};
Algo.prototype.isPalindrome = function (str) {
return str === this.reverse(str);
};
Algo.prototype.capitalize = function (str) {
return str.toUpperCase();
};
module.exports... | true |
8cb9b3815cccecacaf56b2d0508c84bdf1ff9447 | JavaScript | Anushabandari/JS | /Majority.js | UTF-8 | 496 | 3.265625 | 3 | [] | no_license | function Majority(arr)
{
var Key=new Map();
var MostTimes=0;
var MajorElement;
for(var i=0;i<arr.length;i++)
{
if( !Key.has(arr[i]))
{
Key.set(arr[i],1)
}
else
{
Key.set(arr[i],Key.get(arr[i]) +1)
}
}
for( var... | true |
1c058ed38aad0b398afc7a1bc82f8a729c1c0bf6 | JavaScript | VitaliyMartyniak/FLX | /FLX_homework_8/homework/js/isSmaller.js | UTF-8 | 128 | 3.296875 | 3 | [] | no_license | function isSmaller (x,y) {
while (x < y) {
return true;
}
return false;
}
console.log(isSmaller(5,3)); | true |
f8e6e087ff77da0b11b7b6864e84a57371077ec4 | JavaScript | superman7117/react-workshop | /compontents/input.js | UTF-8 | 629 | 2.75 | 3 | [] | no_license | import React, {Component} from 'react';
class MyInput extends Component {
constructor(props) {
super(props);
this.state = {text: '' }
}
changeText(e){
console.log("e", e.target.value);
this.setState({ text: e.target.value })
}
click(){
this.props.changeGreeting(this.state.text)
}
... | true |
28c3b13256e0e5f793e2d4c65f29c191dc3718c6 | JavaScript | thanaponyalan/edquiz | /redux/reducers/profileReducer.js | UTF-8 | 452 | 2.578125 | 3 | [] | no_license | import { profileActionTypes } from '../actions/profileAction';
const initialProfileState={
_id: null,
email: null,
familyName: null,
firstName: null,
photoUrl: null
}
const profileReducer=(state=initialProfileState, action)=>{
switch (action.type) {
case profileActionTypes.SET_PROFILE:... | true |
7f5c2e161d769500fbe3cc6fe11584f21c69efa2 | JavaScript | uilyam/webcomponents-gulp | /scripts/generate.js | UTF-8 | 2,585 | 3.109375 | 3 | [
"MIT"
] | permissive | const fs = require('fs-extra');
const mustache = require('mustache');
const componentTemplate = require('./js.template');
const chalk = require('chalk');
const htmlTemplate = require('./html.template');
const scssTemplate = require('./scss.template');
const fileName = process.argv[2].trim();
if (typeof(fileName) !== 's... | true |
5afa542344c362ad078fb5029592317e2a80b480 | JavaScript | osbaldomartinez20/MediaLibrary | /application/config/database_creation_scripts/addOriginTagsToTable.js | UTF-8 | 438 | 2.609375 | 3 | [
"MIT"
] | permissive | //Contributors: Osbaldo Martinez
//This file adds the starting values for the origin table.
const db = require('../db2');
let sql = "INSERT INTO origin (name) VALUES (?);INSERT INTO origin (name) VALUES (?);INSERT INTO origin (name) VALUES (?);INSERT INTO origin (name) VALUES (?);";
let names = ["Manga", "Doujinshi", ... | true |
44b2c4b3d10c29286db6ce87d0bf68cd34f085f8 | JavaScript | intel/zephyr.js | /samples/AutoButton.js | UTF-8 | 1,155 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive | // Copyright (c) 2016-2017, Intel Corporation.
// Sample simulates a button click by toggling a GPIO output up and down;
// Displays the iteration count every 10ms and should run indefinitely.
// This is a useful template for testing for a memory leak or stability
// problem by counting the number of times it can suc... | true |
376d39064cab55a6db7b978dd8ffe7bcdfe98929 | JavaScript | GianoglioEnrico/Subito-A-Maze-Ingly-Puzzle | /utils/dataStructure.js | UTF-8 | 3,021 | 3.46875 | 3 | [] | no_license | "use strict";
const fs = require("fs");
const roomsMap = [];
const adjacencyMap = [];
const objectsMap = [];
/**
* Read the file provided as input via console
*
* @param {string} filePath
*/
function readData(filePath) {
return fs.readFileSync(filePath);
}
/**
* Parse the data into a JS object
*
* @param {... | true |
8c3be47fc347e373a8129526e893f17bdd165082 | JavaScript | ClementBuchanan/401n18-evening-javascript | /class-04/demo/mongo/__tests__/food.test.js | UTF-8 | 1,189 | 2.875 | 3 | [] | no_license | 'use strict';
// Build this first, Without Supergoose ...
// const mongoose = require('mongoose');
// const MONGOOSE_URI = 'mongodb://localhost:27017/food';
// mongoose.connect(MONGOOSE_URI, { useNewUrlParser: true, useUnifiedTopology: true });
// Later, Add Supergoose. What's the difference?
// require('@code-fellow... | true |
524bc38f908e9603eac88c7eb851f5f2c3f36a11 | JavaScript | robert-laws/practice-aug-2020-firebase-context-todo-app | /src/components/todos/Todo.js | UTF-8 | 1,355 | 2.53125 | 3 | [] | no_license | import React, { useContext, useState } from 'react';
import TodosContext from '../../context/todos/todosContext';
const Todo = ({ id, title, category, completed }) => {
const todoContext = useContext(TodosContext);
const { updateTodo, deleteTodo } = todoContext;
const [update, setUpdate] = useState(false);
co... | true |
ef68e06b16c26c6e743ac1b37c9958ac045e62f8 | JavaScript | killsos/deep-in-deep-nodejs | /7-网址/url.hash.js | UTF-8 | 480 | 3.375 | 3 | [] | no_license | /**
* url.hash
* 获取及设置URL的分段(hash)部分
*
* 包含在赋给hash属性的值中的无效URL字符是[百分比编码][]。
* 请注意选择哪些字符进行百分比编码可能
* 与[url.parse()][]和[url.format()][]方法产生的不同
*/
const { URL } = require('url');
const myURL = new URL('https://example.org/foo#bar');
console.log(myURL.hash);
// 输出 #bar
myURL.hash = 'baz';
console.log(myURL.href);... | true |
f3ccb4c54e4f5d7cfe7f5230688ea9eece960a67 | JavaScript | uh-joan/old-uh-joan.github.io | /showcase/quinn/js/scrollSpy.js | UTF-8 | 5,387 | 2.59375 | 3 | [] | no_license | function scrollSpyClickEvent(sP_type, sP_element, sP_windowFlag, sP_range) {
var thisType = $.trim(sP_type);
var thisElement = $.trim(sP_element);
var thisWindowFlag = $.trim(sP_windowFlag);
var thisRange = $.trim(sP_range);
var thisWindow = 0;
if($.isNumeric(thisRange)) {
thisRange = parseInt(thisRange);
}
e... | true |
780ffcb956c4f58adafb41abe71ae5e657e761e7 | JavaScript | caueamaral/demo-shop | /src/js/format.test.js | UTF-8 | 1,166 | 2.859375 | 3 | [] | no_license | import { spacesInsertion, removeLetters, removeNumbers, barInsertion, resetFlag, activeFlag } from './format'
test('add spaces between every 4 numbers', () => {
expect(spacesInsertion('1234123412341234')).toBe('1234 1234 1234 1234')
})
test('remove all the letters, spaces and special characters', () => {
expect(r... | true |
0e7c0c87739b836d8150e356df0eec14836f57dc | JavaScript | tianzx/MyCache | /client/node/memcache/text-protocol/demo/mem_05/index.js | UTF-8 | 2,813 | 2.53125 | 3 | [] | no_license | /**
* Created by tianzx on 2017/7/12.
*/
const net = require("net")
const util = require('util');
const EventEmitter = require('events');
const crlf = '\r\n'
const crlf_length = crlf.length
const space = ' '
Client = exports.Client = function (port, host) {
this.port = port
this.host = host
this.conn = ... | true |
bfef599bdd04bb06ad6a5e1cc69a386aea7ebd21 | JavaScript | blkdm0n/beesbeesbees | /src/HoneyMakerBee.js | UTF-8 | 1,969 | 3.9375 | 4 | [] | no_license | //*************************************************************************************
//create a subClass for HoneyMakerBee that inherits from Bee superClass
//age = 10; job = make honey; honeypot = 0;
//*************************************************************************************
var HoneyMakerBee = function... | true |
18045cc5ec97d6650aecab6b6bcbb5dbb1ea763b | JavaScript | quackhouse/maenads | /app/assets/javascripts/main.js | UTF-8 | 1,392 | 3.015625 | 3 | [] | no_license | // Textarea automatically adding line break
// Turning Cubes
var oldx = 0;
var oldy = 0;
var direction;
var lastTurn = Date.now();
var cubes = document.getElementsByClassName('cube');
var mouseDown = false;
$(document).bind("mousedown", function(){
mouseDown = true;
});
$(document).bind("mouseup", function(){... | true |
b301434d1980f10c0fac5cb2bf56c1a94e261cc3 | JavaScript | ksarpotdar/coupon-api | /src/middlewares/auth.js | UTF-8 | 535 | 2.5625 | 3 | [
"MIT"
] | permissive | const jwt = require("jsonwebtoken");
require('dotenv/config');
module.exports = async (req, res, next) => {
const authHeader = req.headers.authorization;
if(!authHeader) {
return res.status(401).json({message: "No token provided"});
}
const [scheme, token] = authHeader.split(" ");
try {
... | true |
b28b4fdf4e4a5896ab5d138452cfa2583e1e07c8 | JavaScript | bhavsarsiddhesh/MEAN-STACK | /MEAN-JS/Demo/src/Module/mod1.js | UTF-8 | 474 | 2.8125 | 3 | [] | no_license | let str = "Module Exports";
let Day = 2;
const Area = 500;
module.exports.string = str;
module.exports.Days = Day;
module.exports.Areas = Area;
// By using Jason
let cityName = "Mumbai"
let Max_Temp = 26.35;
let Min_Temp = 23;
const Climate = "Haizy";
module.exports = {
city: ... | true |
ce6935290fb578a9912236c8d8e98badd494239f | JavaScript | libterty/Crypto-with-React | /client/src/components/Blocks.js | UTF-8 | 2,042 | 2.75 | 3 | [] | no_license | import React, { Component } from 'react';
import { Button } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import Block from './Block';
class Blocks extends Component {
state = { blocks: [], paginationId: 1, blocksLength: 0 };
componentDidMount() {
// fetch(`${document.location.origin}/api/b... | true |
bcd0078ff918837908658a3b85b6878e9fdd5bd7 | JavaScript | SailorF/study | /doc/求树深度.js | UTF-8 | 443 | 3.21875 | 3 | [] | no_license | var tree = {
val: 3,
left: { val: 9, left: null, right: null },
right: {
val: 20,
left: { val: 15, left: null, right: null },
right: { val: 7, left: null, right: null },
},
};
var maxDepth = function (root) {
console.log(root);
if (!root) {
return 0;
} else {
let leftDeep = maxDepth(r... | true |
355a5546ef794f1aa998d6de688e036990034019 | JavaScript | vakodrazan/hit-parade-react-1 | /src/components/AddSong.js | UTF-8 | 2,281 | 2.6875 | 3 | [] | no_license | import React, { useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { addSong } from '../actions/songsActions';
import styled from 'styled-components';
const FormStyles = styled.form`
display: grid;
grid-template-columns: 300px;
gap: 10px;
input,
select,
textarea {
height: 3... | true |
634baa99ffc37aad4a707ffe25f22f03c41860e0 | JavaScript | goodbossyuan/yesbit-oracle | /contract/OracleMapping.js | UTF-8 | 1,103 | 2.734375 | 3 | [] | no_license | "use strict";
function init(bar)
{
storageStore('owner', sender);
return;
}
function makeKey(name, time) {
return 'S'+name+'T'+time;
}
function setPrice(_stockName, _timeslot, _price ) {
//Ensuring prices are 24 hours
assert(_timeslot >= 0 && _timeslot <= 23, 'prices need to be 24 hours');
storageSt... | true |
5612ab6a9e6cc7ae66e4e4b6075ebd4f1918ba3e | JavaScript | amit036/masai-week-9 | /src/reducers/CarReducer.js | UTF-8 | 546 | 2.640625 | 3 | [] | no_license | const ADD_CAR = "ADD_CAR";
const iState = {
Car:[]
}
const CarReducer=(state= iState,action)=>{
switch (action.type) {
case ADD_CAR:
let temp = {
carName: action.carName,
carModel: action.carModel,
carImgUrl: action.carImgUrl,
carRent: action.car... | true |
f5ef50d7952f2b3f5515925b6983904235f6db3c | JavaScript | jrymal/fretboardlogic | /js/MusicTheory.js | UTF-8 | 13,800 | 3 | 3 | [
"MIT"
] | permissive | "use strict";
const CHAR_FLAT="\u266D";
const CHAR_NATURAL="\u266E";
const CHAR_SHARP="\u266F";
const NOTES = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"];
const MIN_SCALE_INTERVAL = [ 2, 1, 2, 2, 2, 2, 1];
const STD_SCALE_INTERVAL = [ 2, 2, 1, 2, 2, 2, 1];
const STD_SCALE_DEGREES = [ 1, 2, 3, 4... | true |
09a057ded1d30310b17c7885e294cc43b7dd8044 | JavaScript | jcguarinpenaranda/nodejs-starting | /classes/Data.js | UTF-8 | 316 | 2.734375 | 3 | [] | no_license | const data = require('../data/data.json');
module.exports = class Data {
static getBooks() {
return data.books;
}
/**
* Searches the book with the given id
* @param {string} id
* @return {any} The book
*/
static getBook(id) {
return data.books.filter(book => book.id === id)[0];
}
};
| true |
b5ed2084de906ba1640eb75c12a4beed85ff4dd3 | JavaScript | jyothsnav12/cucumber | /resources/pages/NazmulWebsitePage.js | UTF-8 | 1,515 | 2.78125 | 3 | [
"ISC"
] | permissive | const Page = require('./Page');
/**
* Nazmul Website Page Class Methods
*/
class NazmulWebsitePage extends Page {
/**
* Get page elements
* @returns {Object} page elements
*/
get elements() {
return {
myProfileMenu: '#pagebar > li.page_item.page-item-8 > a',
sea... | true |
0f34df35f310eee757ca4af76e2667876f177c94 | JavaScript | RaphaelHaettich/werwolfga.me | /src/components/CounterLabel/index.js | UTF-8 | 1,169 | 2.671875 | 3 | [
"MIT"
] | permissive | /*
* Required Props:
* dbReference: string,
* labelText: string
* state: string
*/
import React, { Component, } from 'react';
import { base, } from '../../config/constants';
import SimpleState from 'react-simple-state';
const simpleState = new SimpleState();
export default class Counterlabel extends Component... | true |
bf049d1a66ba5ed5b8025a5dc3914299bdbf9c3d | JavaScript | SergeichykAndrei/online-library | /web/src/main/webapp/resource/js/save-comment.js | UTF-8 | 997 | 2.90625 | 3 | [
"MIT"
] | permissive | function saveComment(bookId, username) {
let comment = document.getElementById("comment").value;
let reqBody = {
comment: comment,
bookId: bookId,
username: username
};
fetch("/bookInfo", {
headers: {
'Accept': 'application/json',
'Content-Type':... | true |
492ef76ebd33c0b62eb6cb8c11ad7b8359f9c39d | JavaScript | mkstamin/ejs-templeting | /middleware/statusMiddleware.js | UTF-8 | 789 | 2.703125 | 3 | [] | no_license | /*
* Title:Status middleware
* Description:Check status related work
* Author:Mks Tamin
* Date: 04.01.2021
*
*/
// authenticator object - moudle scaffolding
const authenticator = {};
// check error status
authenticator.check = (app) => {
// 404 error status
app.use((req, res, next) => {
const er... | true |
118c4185d1f7fcb1d281c48f1ea3490055e57b49 | JavaScript | aalmunia/fullstack-php-jquery-tutorial | /js/programa.js | UTF-8 | 5,564 | 2.953125 | 3 | [
"MIT"
] | permissive | var b_GLOBAL_Debug = true;
var o_GLOBAL_Gatos = null;
function renderTablaTodosLosGatos(oDatosGatos) {
var sHTMLAdd = "<table width='100%' border='1' class='tblGatos'>";
sHTMLAdd += "<thead><td></td><td>NOMBRE</td><td>RAZA</td><td>COLOR</td><td>EDAD</td><td></td></thead>";
for (var i = 0; i < oDatosGatos.l... | true |
733c95c50e86e29db3a8b6ccbff4cf1d558c61bb | JavaScript | Mansteinr/zhengweiDemos | /node/node_code_new/day01/es6/01.js | UTF-8 | 1,194 | 3.609375 | 4 | [] | no_license | /*
声明变量let和const
*/
// let声明的变量不存在预解析
// console.log(flag);
// var flag = 123;
// let flag = 456;
// ------------------------
// let声明的变量不允许重复(在同一个作用域内)
// let flag = 123;
// let flag = 456;
// console.log(flag);
// --------------------------
// ES6引入了块级作用域
// 块内部定义的变量,在外部是不可以访问的
// if(true){
// ... | true |
37d50130f3c59786d4788506d15b97e91e163fb9 | JavaScript | MantovaniWebDeveloper/javascript-ex-2 | /js/mainDadi.js | UTF-8 | 1,279 | 3.765625 | 4 | [] | no_license | //chiedo i nominativi dei concorrenti
var nomeUtente1 = prompt("Inserisca il suo nome giocatore 1")
var nomeUtente2 = prompt("Inserisca il suo nome giocatore 2")
//Stampo in html i nomi
document.getElementById('nomeGiocatore').innerHTML = nomeUtente1;
document.getElementById('nomeGiocatore2').innerHTML = nomeUtente2;
/... | true |
3fee27702134b19629420b6c3f9e4156eae8cd2c | JavaScript | Cokeeeeman/styled-components-tryout | /src/Example2.js | UTF-8 | 544 | 2.625 | 3 | [] | no_license | /**
* Use interpolations to adjust styles based on props
*/
import React from "react";
import styled from 'styled-components';
const Button = styled.button`
background: ${props => props.primary ?
'palevioletred' : 'white'};
color: ${props => props.primary ?
'white' : 'palevioletred'};
font-size: 1em;
ma... | true |
69e045ef241a036b60c7dfbdd8e7fd7ad26a902f | JavaScript | Romaner811/romaner811.github.io | /lib/pagefiller/pagefiller.js | UTF-8 | 6,071 | 2.703125 | 3 | [] | no_license | "use strict";
class GamePage {
get slug() {
return this._slug;
}
get user() {
return this._user;
}
get title() {
return this._title;
}
get img() {
return this._img;
}
get src_link() {
return this._src_link;
}
get play... | true |
57061517be4bf269f76f94f302212abdb548aec2 | JavaScript | TPei/Malefiz | /js/game/Piece.js | UTF-8 | 950 | 3.4375 | 3 | [] | no_license | "use strict";
/**
* Acts as a piece on the Playfield.
* Can be a player piece or a block piece.
* @constructor
* @this {Piece}
* @param {number} x
* @param {number} y
* @param {number} number of the piece.
* @param {String} color of the piece
*/
function Piece(x, y, number, color) {
this.x = x;
this.y... | true |
e3bbca2da4f75465d5005e49c797a297c376b1e7 | JavaScript | cecil-su/leetcode-js | /167-Two-Sum-II-Input-array-is-sorted.js | UTF-8 | 1,424 | 4.375 | 4 | [] | no_license | /**
* https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/
* Difficulty:Easy
*
* Given an array of integers that is already sorted in ascending order,
* find two numbers such that they add up to a specific target number.
* The function twoSum should return indices of the two numbers such th... | true |
3a1ffa6f9c681a685e4d1f9021566fa1dbc68e1a | JavaScript | cos301-2019-se/FABI-Mobile | /API/DatabaseManagement/api/routes/dropDatabase.js | UTF-8 | 6,934 | 2.5625 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const admin = require('firebase-admin');
const log = require('../sendLogs');
const auth = require('../loginAuth');
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ... | true |
29c445660f12293b49350292e5b5b89f0e2b3eec | JavaScript | ciciwoolf/javascript-challenges | /forofloop.js | UTF-8 | 579 | 4.75 | 5 | [] | no_license |
// Challenge - For Of Loop
// Using the For of Loop, iterate through the array and print into the console, a message like:
// Tom lives in Lisbon
// const students = [
// { name: "John", city: "New York" },
// { name: "Peter", city: "Paris"},
// { name: "Kate", city: "Sidney" }
// ]
// for (const stud... | true |
8842dc75ba134c1b26336d63bbbc7ab2f884e430 | JavaScript | kjgillll/Final-Year-Project-ResidenTT | /routes/crimereports.js | UTF-8 | 2,644 | 2.53125 | 3 | [
"MIT"
] | permissive | const router = require("express").Router();
const CrimeReport = require("../models/CrimeReport");
const { Op } = require("sequelize");
const sequelize = require("sequelize");
const moment = require("moment");
const getCrimeReports = async (range) => {
let reports;
reports = await CrimeReport.findAll({
where: {... | true |
f309a9fd7d8f450911693b0342c10517e49f14d4 | JavaScript | simeonaleksandrov/Softuni-exercises-and-exams | /JS Fundamentals/ExamPrep - 24-April-2018/03. Ancient VS Memory.js | UTF-8 | 624 | 3.21875 | 3 | [] | no_license | function solve(arr) {
let result = '';
for (let string of arr) {
let numbers = string.split(' ');
for (let number of numbers) {
if(number !== '0' && number !== '32656' && number !== '19759' && number !== '32763' && number > 31)
{
let charIndex = Number(num... | true |
5a2145fe3a2c641bd40473e8d297e4a4f718e7a9 | JavaScript | SidharthNambiar/Fullstack-Web-Dev | /bootcamp-prep-master/pre-work-workshops/03-expressions-variables-and-tdd/05-take-the-shortcut/take-the-shortcut.js | UTF-8 | 90 | 2.875 | 3 | [] | no_license | let happyNum = 1000;
// YOUR CODE BELOW
happyNum -= 500;
happyNum *= 1;
happyNum /= 100; | true |
fb78775423d0a1ca18a417512401adee8a30d085 | JavaScript | tatiPFernandes/CodeNation | /Activities_day5/activity6.js | UTF-8 | 208 | 3.28125 | 3 | [] | no_license | let person = {
name: "Tati",
age: 34,
songs: [
"Tati",
"Africa",
"Drown"
],
sayHi(){
return (`Hello my name is ${this.name}`);
}
}
console.log(person.sayHi()) | true |
11143d0155a06a824ff8127ecd220ce48de32c03 | JavaScript | sonika09/adventure | /src/components/pages/Validation.js | UTF-8 | 410 | 2.671875 | 3 | [] | no_license |
const Validation = (values) => {
let errors={};
if(!values.username){
errors.username='name is required'
}
if(!values.email){
errors.email="email is required"
}
if(!values.password){
errors.password="password is required"
}else if(values.password.length<5){
... | true |
e286db807c55dcd236c224ada539ba4731cfb70f | JavaScript | Ivanna-Sivak/frontend_course | /lesson5/js/main.js | UTF-8 | 450 | 2.515625 | 3 | [] | no_license | $(document).ready(() => {
$('.logo-link, .menu-link').each(function (index, element) {
// console.log(index, element);
$(element).click(function () {
const id = $(this).attr('href');
// console.log(id);
const scroll = $(id).offset().top;
// cons... | true |
0bc586f8d33387bdffac14c2f74a0f0cab24fede | JavaScript | benhorst/instance-tracker | /components/NumberInput.js | UTF-8 | 1,689 | 2.625 | 3 | [] | no_license | import React, { Component, PropTypes } from 'react'
import ReactDOM from 'react-dom'
import classNames from 'classnames'
class NumberInput extends Component {
constructor(props, context) {
super(props, context)
this.state = { editing: false, value: this.props.binding || 0 }
}
change(ev) {
this.setS... | true |
20ec3295c968ebb296425753ab335762634e1488 | JavaScript | nigron3/jahnelGroup | /projects/todo2/mainJQ.js | UTF-8 | 3,575 | 3.34375 | 3 | [] | no_license |
$( document ).ready(function() {
function clearMe(){ // clears task text for new user input
$('#taskText').val("");
}
function addNewItem() // adds a new item to the list
{
var itemDiv = document.createElement('div');// contains all elements of one item
$(itemDiv).addClass('itemDivClass')
var it... | true |
12fba177ace92ef6861dde37262864848a580584 | JavaScript | naira-ge/SingIn-SignUp-form | /clients.js | UTF-8 | 1,330 | 3.1875 | 3 | [] | no_license | const clients = document.querySelector('#clients');
let clientTab = document.createElement('div');
clientTab.classList.add('clientList');
clients.addEventListener('click', clientList);
function clientList(e){
clientModal();
clientmodal.appendChild(clientTab);
fetchUserData(e);
}
function fetchUserD... | true |
8f9850489de42429b89e84d6fb8ee2d705478e9d | JavaScript | YoodooMedia/sitegeneric | /file/dooits/suggester/data/strengths.js | UTF-8 | 1,415 | 2.75 | 3 | [] | no_license | dooit.temporaries('strengths','weaknesses','is_strength','is_weakness');
is_strength=function(k) {
for(var s=0;s<strengths.length;s++) {
if (strengths[s]==k) return true;
}
return false;
};
is_weakness=function(k) {
for(var s=0;s<weaknesses.length;s++) {
if (weaknesses[s]==k) return true;
}
return false;
};
v... | true |
77af7d0de12077b07ad4bf9a2ffcc1b3f50fcdca | JavaScript | Enado95/Vidly | /routes/genres.js | UTF-8 | 1,979 | 2.625 | 3 | [] | no_license | const validateObjectId = require("../middleware/validateObjectId");
const auth = require('../middleware/auth');
const admin = require('../middleware/admin');
const { Genre, validate } = require('../models/genre');
const mongoose = require('mongoose');
const express = require('express');
const router = express.Router();... | true |
8c010f73ee1e518bcc33049b69941cc0602ee271 | JavaScript | chun1997/Echarts | /echart/js/index.js | UTF-8 | 31,541 | 3.03125 | 3 | [] | no_license | // 薪资分析--饼图
(function () {
// 实例化对象
var myChart = echarts.init(document.querySelector(".bar .chart"));
// 指定配置和数据
fetch('http://localhost:3000/data').then(res => res.json())
.then(res => {
// console.log(res[1].time);
let money = []
res.forEach(item => {
if (item.title) {
... | true |
eb085df417201a1dc6644fd2ecc491d8dee96063 | JavaScript | Ati810/AF-Beadando | /Hammer/app/app/Http/Controllers/ContentController.js | UTF-8 | 8,376 | 2.53125 | 3 | [] | no_license | "use strict";
const Database = use("Database"),
User = use("App/Model/User"),
Game = use("App/Model/Game"),
Review = use("App/Model/Review"),
Purchase = use("App/Model/Purchase");
//---- HASZNOS ----
//https://adonisjs.com/docs/3.1/lucid
class ContentController {
* main (request, response... | true |
0e0a03856790ed00a043d00b0705f13ef780ef3c | JavaScript | joannabella/mandatory-uxdesign1 | /script.js | UTF-8 | 1,469 | 2.59375 | 3 | [] | no_license | Mds.textField(document.querySelector('.mds-textfield__input'));
let textfield = document.querySelector('.mds-textfield__input');
let mySwitch = document.querySelector('.mds-switch__input');
let checkbox = document.querySelector('.mds-checkbox__input');
let radioButton = document.querySelectorAll('.mds-radio__input');
... | true |
837daa842f4258c942c65ebf1558f9157c8e599a | JavaScript | luxzeitlos/simpd | /legacy/lib/Mpd.js | UTF-8 | 1,542 | 2.515625 | 3 | [] | no_license | "use strict";
import MpdNetClient from './MpdNetClient.js'
const clientSymbol = Symbol()
function parseAttrs(attrs) {
return attrs.split('\n').reduce((result, attr) => {
let parts = attr.split(': ')
result[parts[0]] = parts[1]
return result
}, {});
}
function parseList(str, ...startNames) {
return str.spli... | true |
e3e497ca2a49f2028d1f3975c4dbce23af39701e | JavaScript | OStti/react-pizza | /client/src/utils/getValues.js | UTF-8 | 353 | 2.515625 | 3 | [] | no_license | export const getStringValue = (obj, watchField, field = 'name') => {
return obj.find(({ slug }) => slug === watchField)[field];
};
export const getArrayValues = (obj, watchField, field = 'name') => {
return (
watchField.length !== 0 &&
watchField
.map((item) => obj.find(({ slug }) => slug === item)[f... | true |
c593dd9f9b2dd553f6c0233e12cc843ab151ad4d | JavaScript | mhsnprvr/industryui.com | /components/utils/getOne.js | UTF-8 | 191 | 2.828125 | 3 | [
"MIT",
"CC-BY-3.0"
] | permissive | /**
* Get one object from array
*/
export const getOne = (id, array) => {
const selected = array.filter(i => i.id === parseInt(id))
return selected.length ? { ...selected[0] } : null
}
| true |
3470e1003be24eda401eaeada47c9d9938cd063b | JavaScript | Dmitri111/GITSTUDY | /js basics/js/CallBackFunctions.js | UTF-8 | 947 | 4.5625 | 5 | [] | no_license | /* // FUNCTION DECLARATION
function foo() {
код
}
// Создается до начала выполнения скрипта, можно вызвать перед объявлением */
// FUNCTION EXPRESSION
/* let foo = function() {
код
}
// Создается только тогда, когда доходит поток кода, можно вызвать только после объявления */
/* // СТРЕЛОЧНЫЕ ФУНКЦИИ
() ... | true |
71192f588908834bc4fe0069c3e1f9f2f5ab33b3 | JavaScript | pachecoSen/text_invertido | /app.js | UTF-8 | 805 | 3.109375 | 3 | [
"MIT"
] | permissive | "use strict"
const {resolve} = require('path');
const Main = require(resolve(__dirname, "./src/main"));
const main = new Main();
const cadena = process.argv.slice(2),
help = ">> Sintaxis: \t app --input \"cadena a procesar\"\n";
console.log("..:::Invertir Texto:::..\n\n");
if(0 === cadena.length){
console.... | true |
8c2cc8ffb4b5a06b0e438d9c71419ff4b1cc68d9 | JavaScript | green-fox-academy/lakospal0 | /week-10/example-exam/static/main.js | UTF-8 | 2,228 | 3 | 3 | [] | no_license | /*let button = document.querySelector('#mybtn');
button.addEventListener('click', function() {
console.log("asd")
let text = document.createElement('p');
text.innerHTML = 'fawfawoipjijnnlkjlbnljl';
button.setAttribute('disabled', '');
document.querySelector('body').appendChild(text);
})
let form = ... | true |
d99821b12c84e75001e44994eb39df5fd1c6f428 | JavaScript | blancahc/JS_101 | /lesson_5/practice_problems/17.js | UTF-8 | 1,199 | 4.25 | 4 | [] | no_license | //Each UUID consists of 32 hexadecimal characters (the digitis 0-9 and the
// letters a-f) represented as a string. The value is typically broken into
// 5 sections in an 8-4-4-4-12 pattern, e.g.,
// 'f65c57f6-a6aa-17a8-faa1-a67f2dc9fa91'.
//Write a function that takes no parameters and returns a UUID.
//MY SOLUTION... | true |