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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
425a9bb8c4343dccd7a0393606c3245ea3d6d7fc | JavaScript | joemalov/week-4-game | /assets/javascript/game.js | UTF-8 | 1,441 | 3.78125 | 4 | [] | no_license |
var wins = 0;
var losses = 0;
var targetNumber = 0;
var createtargetNumber = function() {
targetNumber = Math.floor((Math.random() * 100) + 1);
$("#random-number").text(targetNumber);
}
createtargetNumber();
var counter = 0;
var numberOptions = [10, 5, 2, 1];
for (var i = 0; i < numberO... | true |
e137facd0e04828db8497d9f3abb71eed86bbd21 | JavaScript | CrystaJeffcoat/MovieFinder | /assets/js/script_1.js | UTF-8 | 3,546 | 3.15625 | 3 | [] | no_license | /* initalized variables from html */
const movieInput = document.getElementById("search-bar");
const searchBtn = document.getElementById("searchBtn");
const clearBtn = document.getElementById("clearBtn");
const similarMovieList = document.getElementById("rel-movie-1");
const similarMovieList1 = document.getElementById(... | true |
657552c1181a50f7036635892890e62e540d0c47 | JavaScript | travisldunn/course | /5-math/practice/5-random.js | UTF-8 | 1,535 | 4.53125 | 5 | [] | no_license | // # Math - Random Number
// #### Prompt
// Given a function `foo` that produces random numbers between 1 - 5 with equal probability, write a function `bar` that generates numbers between 1 - 7, that uses`foo` internally and ** NOT ** the built in `random` function.
// #### Examples:
// ```
// Input: None
// Outpu... | true |
f68521594029b4089c11585ea954037cd8cecde0 | JavaScript | luziehtan/rickandmorty-app | /src/RandomCharacterCard/RandomCharacterCard.js | UTF-8 | 896 | 2.53125 | 3 | [] | no_license | import './RandomCharacterCard.css'
export default function RandomCharacterCard({name, species, image, status, gender, origin, location}) {
return (
<section className="Card"
style={{backgroundImage: 'url("' + image +'")', backgroundSize: '200px 200px'}}>
<h2 className="Card__name">... | true |
1ec44dae4105b845a425b32c7ec51b0af4161260 | JavaScript | MakiniMakini/simple_web_server | /main.js | UTF-8 | 1,441 | 3.546875 | 4 | [] | no_license | //creating a basic server
const port = 3000,
http = require("http") //This module is saved as a constant because you don’t plan on reassigning the variable.
httpStatus = require("http-status-codes"),
//you use the http variable as a reference to the HTTP module to create a server,
//using that ... | true |
ac13c4502e3d6ff359e5ebca52c3505f3d9cbad8 | JavaScript | kellyschrock/solex-cc | /app/server/udpserver.js | UTF-8 | 4,260 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | "use strict";
const dgram = require("dgram");
const logger = require("../util/logger");
var mOptions = {};
const mRInfo = {};
var mServerSocket = null;
var mCallback = null;
function log(str) {
logger.v("udpserver", str);
}
function bool(val) {
if(val === true) return true;
if(val === "true") return tru... | true |
4dc61026a814112a977a1b86f18916b9c2079049 | JavaScript | Kry-dev/Google-Maps-Autocompite | /src/js/app.js | UTF-8 | 6,443 | 2.734375 | 3 | [
"MIT"
] | permissive | // This example displays an address form, using the autocomplete feature
// of the Google Places API to help users fill in the information.
let placeSearch;
let autocomplete;
const componentForm = {
street_number: 'short_name',
route: 'long_name',
locality: 'long_name',
administrative_area_level_1: 'long_name'... | true |
c8267378f86b3b2c4efc3f0278a527f750968237 | JavaScript | klxu03/TeaPartyHeroku | /commands/inzult.js | UTF-8 | 741 | 2.6875 | 3 | [] | no_license | "use strict";
const { CommandHandler } = require('djs-commands');
const Discord = require('discord.js');
module.exports = class inzult {
constructor() {
this.name = "inzult",
this.alias = ['i'],
this.usage = '!inzult'
}
async run(bot, msg, args) {
console.log("I... | true |
ce208b2e85e6af50f1bdcce48791ebe875b20bd5 | JavaScript | HRNYC32-BlueOcean/Gotham-311-Router | /index.js | UTF-8 | 5,282 | 2.875 | 3 | [] | no_license | const net = require('net');
console.log('File read')
net
.createServer(function (data) {
console.log('Server Created')
data.setEncoding('utf8');
})
.on("connection", (req) => {
req.on("data", (data) => {
// Var that holds our subdomain
let hostLine = null;
... | true |
5ad59c85e3d8998588b6335dfa02a1dacbb94ed6 | JavaScript | DylanMacalast/webpack-boiler | /src/app/utils/test.class.js | UTF-8 | 228 | 2.890625 | 3 | [] | no_license | export class TestClass {
constructor() {
// constructor method stuff
}
//testing method
// making sure babel is working
sayHello(name) {
console.log(`hello ${name} from TestClass`);
}
}
| true |
9a1af74a47356367989ea891f12d04a300668c81 | JavaScript | codedevbrad/client_food_app | /web/dev/services/admin_analytics/util_misc_helpers/dateFormats.js | UTF-8 | 1,813 | 3.5625 | 4 | [] | no_license |
function returnDateChosen ( chosen , value ) {
let dateValues = new buildDate();
switch ( chosen ) {
case 'day':
return dateValues.dayDate();
break;
case 'month':
return dateValues.dateBetweenMonth( value );
break;
case 'year':
retu... | true |
4a9fc2e5029a66375ec621ca89c3852237962666 | JavaScript | ashokkumarsand/sidebar-html-css | /main.js | UTF-8 | 1,084 | 2.921875 | 3 | [] | no_license | const initialize = function (window) {
const classes = {
collapsed: "collapsed",
selected: "selected",
};
const sidebar = document.getElementById("sidebar");
const toggleButton = document.querySelector(
"#sidebar > ul > li.toggle > button"
);
toggleButton.onclick = function () {
if (sidebar.... | true |
d07793b5902b1f2c13a7d4784dacfd1ea4de8c9b | JavaScript | Chanelle-Rupp/pug-o-mizer | /app.js | UTF-8 | 379 | 2.65625 | 3 | [] | no_license | $(document).ready(function () {
randomImage();
function randomImage() {
var url = "https://dog.ceo/api/breed/pug/images/random";
$.getJSON(url, function (data) {
$(".picture").html(`<img src="${data.message}">`).fadeout;
});
};
$("#btn").o... | true |
b47f88961c700a394d30586fbbf60f3c78eea3be | JavaScript | mistermoe/chrome-extension-message-passing | /require_libs.js | UTF-8 | 559 | 2.640625 | 3 | [] | no_license | function requireLibs(callback) {
var count = 0
var libs = [
"a.js",
"b.js"
];
console.log("(background.js) requiring libs...");
for (var i = 0; i < libs.length; i += 1) {
console.log("requiring: " + libs[i]);
chrome.tabs.executeScript({
file: libs[i]
}, function(){
count += 1;... | true |
2ed9a8160bf3f6987cd60a40581e2de490da5d3a | JavaScript | rileyburns345/product_manager | /client/src/components/ProductForm.js | UTF-8 | 1,134 | 2.875 | 3 | [] | no_license | import React, {useState} from 'react'
import axios from 'axios'
const ProductForm = () => {
const [title, setTitle] = useState("")
const [price, setPrice] = useState("")
const [description, setDescription] = useState("")
const FormHandler = (e) => {
e.preventDefault()
console.log('form... | true |
08e63712d858228462472d6171193c21c21d8e41 | JavaScript | SlothfulSheep/bangazon-api-sprint1 | /controllers/computerCtrl.js | UTF-8 | 1,630 | 2.84375 | 3 | [] | no_license | 'use strict';
const { getAll, getOne, postOne, putOne } = require('../models/Computer');
// GET
module.exports.getAllComputers = (req, res, next) => {
getAll()
.then(computers => {
res.status(200).json(computers);
})
.catch(err => next(err));
};
module.exports.getOneComputer = ({ params: { id... | true |
39d16cd97705800b0683ee8567f7a1a74f2986ff | JavaScript | chuhui1/qixi | /JavaScript/Qixi.js | UTF-8 | 14,547 | 2.59375 | 3 | [] | no_license | //页面滑动
function Swipe(container) {
//获取第一个子节点
var element=container.find(":first");
//滑动对象
var swipe = {};
//li页面数量
var slides=element.find("li");
//获取容器尺寸
var width=container.width();
var height=container.height();
//设置li页面总宽度
element.css({
width:(slides.length*width)+"px",
... | true |
61dc7fdbecef9fc49585a3d29b5dfb6190e07342 | JavaScript | WoodsOfOrchardLakeSub/woodsoforchardlake.github.io | /assets/js/login.js | UTF-8 | 1,677 | 2.5625 | 3 | [] | no_license | $(document).ready(function() {
const button = $("#submit");
const pw = $('#inputPassword')
const origText = button.text();
let failcount = 0;
button.click(function(e){
if (!$('.form-signin')[0].checkValidity()) {
return;
}
button.text("Loading...");
... | true |
3b4b4c8707b7e3ca1958e5e27558a83e3666fc30 | JavaScript | cesario23/grocery-list-frontend | /src/App.js | UTF-8 | 1,568 | 2.5625 | 3 | [] | no_license | import React, {useState} from 'react'
import Axios from './components/Utils/Axios'
import {Header, Lists, Inputs, Buttons } from './components'
import {HeaderContext, InputContext, ListContext} from './context/context'
import './App.css';
function App() {
const [grocery, setGrocery] = useState("")
const [grocer... | true |
04d8d34c452a93babc00b47283dccf3fd443e564 | JavaScript | wencakisa/react-the-complete-guide-udemy | /src/utils.js | UTF-8 | 902 | 2.84375 | 3 | [
"MIT"
] | permissive | import _ from 'lodash';
export const transformObjectToQueryParams = obj => {
const transformedQueryParams = _.map(
obj,
(value, key) => `${key}=${JSON.stringify(value)}`
);
const queryParamsString = _.join(transformedQueryParams, '&');
return queryParamsString;
};
export const checkInputValidity = (v... | true |
e3a848c509a6d5edbf59b1a02cfe7d45efa41c97 | JavaScript | siono/EjeciciosNode | /nodeapi/routes/index.js | UTF-8 | 1,179 | 2.796875 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
const { check, validationResult } =require('express-validator/check');
/* GET home page. */
router.get('/', function(req, res, next) {
const segundo = new Date().getSeconds();
res.render('index', {
title: 'Express',
valor: '<script>al... | true |
e2d0d12a8dea089f1c92221a4bae6dc2bc827a9b | JavaScript | Emamatcyber90/dr-js | /source/browser/net.js | UTF-8 | 2,014 | 2.578125 | 3 | [
"MIT"
] | permissive | import { global } from 'source/env'
const DEFAULT_TIMEOUT = 20 * 1000 // 20sec, in millisecond
// TODO: later replace with fetch + AbortController
// fetch-like XMLHttpRequest() with timeout
// timeout in msec, result in error with status: -1, message: TIMEOUT_ERROR
const fetchLikeRequest = (url, option = {}) => new ... | true |
60983e52d75874b7bc9461318015a607129aab17 | JavaScript | zb1788/portal | /WebRoot/script/index.js | UTF-8 | 2,492 | 2.578125 | 3 | [] | no_license | //处理登录背景效果
function clearUserNameInput(obj){
if(obj==1){
if(''==$("#username").val()){
$("#username").attr("className","logininputbg");
}
}if(obj==2){
if(''==$("#password").val()){
$("#password").attr("className","logininputpass");
}
}if(obj==3){
if(''==$("... | true |
fdba55e096433560f37ac276eb7ed597ce86ac3b | JavaScript | Pgsalbuquerque/apiempire | /src/app/controllers/PurchaseController.js | UTF-8 | 2,349 | 2.53125 | 3 | [] | no_license | const Client = require("../models/Client");
const Off = require("../models/Off");
const Product = require("../models/Product");
const Purchase = require("../models/Purchase");
class PurchaseController {
async store(req, res) {
const {value,client_cpf, off_id, product_id} = req.body;
if (!client_cp... | true |
297b70c6acde81b696775260a2ffd38b31ae5b06 | JavaScript | eternita9210/reactStudy | /210201/tictacto/Td.jsx | UTF-8 | 1,312 | 2.546875 | 3 | [] | no_license | import React, { useCallback, useEffect, useRef, memo } from 'react';
import { CLICK_CELL } from './TicTacToe';
const Td = memo(({ rowIndex, cellIndex, dispatch, cellData }) => {
console.log('td rendered');
const ref = useRef([]);
useEffect(() => {
// console.log(rowIndex === ref.current[0], cellInd... | true |
993d3ec449f50320632ec7e243052a189619a77d | JavaScript | Zetsuban/wt-4 | /exo4/dist/main.js | UTF-8 | 1,392 | 3.328125 | 3 | [] | no_license | function delay(ms) {
var promise = new Promise(function (resolve, reject) {
setTimeout(function () {
console.log("Async is done!");
reject('Rejected!');
}, 1000);
});
return promise;
}
function timeout(ms, prommise) {
}
function testNum(x) {
return new Promise(fun... | true |
236572ee08b25b62e0004706a3cab9b7636eaa26 | JavaScript | VictorAndres20/socket-chat-server | /src/server/config/Socket.js | UTF-8 | 3,630 | 2.5625 | 3 | [] | no_license | const SocketIO = require('socket.io');
/** socket.io Message IDs */
const CONN_MESSAGE_ID = 'connection';
const DISCONNECT_MESSAGE_ID = 'disconnect';
/** Custom Message IDs */
const USERS_MESSAGE_ID = 'connUsers';
const PRIVATE_MESSAGE_ID = 'privateMessage';
class Socket{
constructor(httpServer){
this.soc... | true |
a6a8fa8b262a909f3ed02feb0eea5dfcbae1803c | JavaScript | logikaljay/mudjs | /commands/cmd_loop.js | UTF-8 | 1,283 | 2.671875 | 3 | [] | no_license | var cmd_loop = (function() {
'use strict';
var cmd_loop = {
name: 'loop',
description: 'loop from a to b, executing a command at each step',
args: [
{
name: 'start',
description: 'The starting number',
optional: false
},
{
... | true |
2634085f9918fd3930fb447f59dba7357e2b3d37 | JavaScript | FerjomagraTest/react-project-crud | /src/components/show-lastname.component.js | UTF-8 | 851 | 2.59375 | 3 | [] | no_license | import React, { Component } from 'react';
//import { Link } from 'react-router-dom';
import axios from 'axios';
const Users = props=> (
<tr>
<td>{props.users.lastname}</td>
</tr>
)
export default class Lastname extends Component{
constructor(props) {
super(props);
this.state = {user: []};
}
... | true |
4c19d37e89348f73e1e98e1dfc9b99485ee38474 | JavaScript | mwhitmore1/03-MortgageCalculator | /Origin/mortgage_calculator/index.js | UTF-8 | 2,053 | 3.40625 | 3 | [] | no_license | var periods = {
monthly: 12,
bimonthly: 6
}
// populate select box.
$(document).ready(function(){
var $select = $("#period")
var periodNames = Object.keys(periods);
periodNames.map(function(i){
var $option = $('<option></option>');
$option.text(i);
$option.val(periods[i]);
$select.append($option);
})
... | true |
040ad81f69c9ae652b66cf5523f747a2ab510b67 | JavaScript | korgy-dot/dot | /backend/index.js | UTF-8 | 1,616 | 2.65625 | 3 | [
"MIT"
] | permissive |
const express = require('express');
const cors = require('cors');
const Discord = require("discord.js");
const client = new Discord.Client();
const app = express();
const PORT = 8080;
app.use(cors());
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}`)
})
app.get('/', (req, res) => {... | true |
02c2a4d831c703aaada672e468c2d685a17a37d7 | JavaScript | vladimirdd96/softuniJsAdvanced | /Arrays/array theory ex/lab8.js | UTF-8 | 282 | 3.34375 | 3 | [] | no_license | function diagonalSum(arr) {
let first = 0;
let second = 0;
for (let row = 0; row < arr.length; row++) {
first += arr[row][row];
second += arr[row][arr.length - 1 - row];
}
return [first, second];
}
console.log(diagonalSum([[20, 40],
[10, 60]]));
| true |
71184aec074d625ca35349dfc5752b334789467b | JavaScript | iliangogov/JavaScriptApplications | /Topics/01. Promises and asynchronous programming/demos/3. function-generators/3.2. advanced-function-generators.js | UTF-8 | 908 | 3.3125 | 3 | [
"MIT"
] | permissive | (function(){
function* fibonacci(){
var fn1 = 1, fn2 = 1, currnet, reset;
while (true){
current = fn2;
fn2 = fn1;
fn1 = fn1 + current;
reset = yield current;
if (reset){
fn1 = 1;
fn2 = 1;
}
... | true |
f1171b520ebcbaf4b5a32ec5d4c1fbbe2bb865b0 | JavaScript | prurph/playetry | /app/assets/javascripts/playetry/tagControl.js | UTF-8 | 2,193 | 2.734375 | 3 | [] | no_license | Playetry.tagControl = {
onTagGenerated: function(event, ui) {
var $tag = Playetry.tagControl.textToTag(ui.item.value),
$tagList = $("#tag-list");
$("#tag-list").append($tag);
Playetry.tagControl.adjustIndent($tagList);
$("#new-tags").val("").attr("placeholder", "");
Playetry.tagControl.bin... | true |
a789581415d6ff57b2744dbb40a4a809d6af60d6 | JavaScript | adziashvili/micropulse | /src/common/quickreport/modeler.js | UTF-8 | 9,433 | 2.5625 | 3 | [
"MIT"
] | permissive | import { JSONHelper } from 'ika-helpers'
import { Analyzer } from 'ika-datamart'
export default class Modeler {
constructor(table) {
this.table = table
this.model = {}
this.rows = []
this.cols = []
this.stats = []
this.custom = []
}
build() {
const model = {}
this.construct(model... | true |
d20e5d68caa2245734569ca1445330554586b0bc | JavaScript | leyifu233/backstage-management-system | /backstage management system/backend/controllers/cate.controller.js | UTF-8 | 1,347 | 2.921875 | 3 | [] | no_license | /*
逻辑控制,增、删、改、查
*/
const mongoose = require('mongoose');
const Cate = require('../models/cate.model');
/* 增 */
exports.create = function(req,res,next){
const cate = new Cate(req.body);
cate.save()
.then(data=>{
res.json(data);
})
}
/* 修 */
// 参数:设参 传参 接参
exports.update = function(req,res,n... | true |
6517839ba28f52dd29e03b70ce5414c52c6261ec | JavaScript | HonduranCoder/Backend1 | /server.js | UTF-8 | 827 | 3.015625 | 3 | [
"MIT"
] | permissive | require('dotenv').config();
//import the express library
const express = require('express');
const { halloweenCharacters } = require('./data.js')
//because the docs say so, we call express to get a thing called app
const app = express();
const cors = require('cors');
//we need cors always, it makes it so other sites ... | true |
4d7f5b4da69a4f50ee7ffba418f459ae76a268fd | JavaScript | arafatnsu/Bootcamp | /Practice/practice.js | UTF-8 | 463 | 2.984375 | 3 | [] | no_license | function showValue() {
const value = document.querySelector("#add-todo").value
const p = document.createElement('p')
p.textContent = value
p.style.backgroundColor = value
document.getElementById('todo').style.color = value
document.querySelector('#new-add').appendChild(p)
}
const users = [
... | true |
19ecb8ef0fd5fcdb3f90ec852304a7604a39c8dc | JavaScript | Crd39/frontend | /src/login.js | UTF-8 | 2,037 | 2.640625 | 3 | [] | no_license | import React from 'react';
import { url } from './app.js';
export class Login extends React.Component {
constructor(props) {
super(props);
this.state = {username: '',
password: ''};
}
handleUsernameChange(event) {
this.setState({username: event.target.value,
... | true |
149cca3f79d3416d9526a960f9a6de8b532ea3ad | JavaScript | qbzjs/niuniu | /assets/Script/UI/PromptBox.js | UTF-8 | 1,711 | 2.625 | 3 | [] | no_license | //文本提示框
cc.Class({
extends: cc.Component,
properties: {
promptInfo: { //文本内容
default: null,
type: cc.Label
},
confirmCallback: null, //确定按钮回调函数
cancelCallback: null, //取消按钮回调函数
},
// 初始化
onLoad: function () {
this.disabledUnderTouch();
... | true |
bd9579db9c7650a751a575f0fee47bcad3b2895c | JavaScript | jiangshanmeta/lintcode | /src/1243/solution.js | UTF-8 | 474 | 3.484375 | 3 | [
"MIT"
] | permissive | /**
* @param s: a string
* @return: the number of segments in a string
*/
const countSegments = function (s) {
let count = 0;
let index = 0;
while (index < s.length && s[index] === ' ') {
index++;
}
while (index < s.length) {
while (index < s.length && s[index] !== ' ') {
... | true |
f1ca274d78cc6b7928a48ae55b3dc90f6ad26701 | JavaScript | CoderFemi/AlgorithmsDataStructures | /data_structures/dynamic_programming.js | UTF-8 | 469 | 3.796875 | 4 | [] | no_license | // Implemented recursively with memoization
const fib = (n, memo = []) => {
if (memo[n] !== undefined) return memo[n]
if (n <= 2) return 1
const result = fib(n - 1, memo) + fib(n - 2, memo)
memo[n] = result
return result
}
// Implemented with tabulation
const fib = (n) => {
if (n <= 2) return ... | true |
5cd6453afdc36ed681d0e40349260c460d5cece8 | JavaScript | rogeriobispo/javascriptbases | /src/0181-IteratingOverAjavascriptObject.js | UTF-8 | 603 | 3.71875 | 4 | [] | no_license | 'use strict'
let student1 = {
firstName: 'John',
lastName: 'Doe',
student: true,
quiz1: 90,
q2: 70,
q3: '85',
quiz4: 100,
quiz5: 0
}
// for(let key in student1){
// console.log(key)
// console.log(student1[key])
// }
const keys = Object.keys(student1)
const values = Object.values(student1)
co... | true |
0852f7f8163f93719e2019e7da360c059051ca30 | JavaScript | VelociraptorCZE/ve-paintJS | /src/js/Core/TextMode.js | UTF-8 | 620 | 2.734375 | 3 | [
"MIT"
] | permissive | /**
* VE-paintJS
* Copyright (c) Simon Raichl 2018 - 2019
* MIT License
*/
export default function TextMode(drawInstance) {
this.currentText = "";
const menuText = document.getElementById("menu-new-text"),
setFont = document.getElementById("menu-set-font");
menuText.addEventListener("click"... | true |
f7d1111ac3f48a8d88d640de19cd312ddd1c9a7b | JavaScript | eiriklv/software-development-talks | /lib/model.js | UTF-8 | 1,018 | 2.765625 | 3 | [] | no_license | 'use strict'
const T = require('union-type')
const Maybe = require('data.maybe')
const Duration = T({
Just: [Number, Number, Number],
Nothing: []
})
const Line = T({
Empty: [],
Header: [Number, String],
Video: { title: String, url: String, speaker: String, duration: Duration },
Text: [String]
})
// toDu... | true |
197d66e188951aae7d123bc386f3ba781811b445 | JavaScript | skeezus/skeezus-kart-api-express | /api/app.js | UTF-8 | 732 | 2.5625 | 3 | [] | no_license | /*
* https://nodejs.org/en/docs/guides/getting-started-guide/
* https://stackoverflow.com/questions/28305120/differences-between-express-router-and-app-get
* https://stackoverflow.com/questions/5778245/expressjs-how-to-structure-an-application
* https://www.coreycleary.me/avoid-manually-prepending-api-to-every-exp... | true |
36bf061d0ddfdf880f5afbb7bce29c8666446511 | JavaScript | pedritobata/node-complete-apps | /enhaced_mongoose/routes/auth.js | UTF-8 | 3,034 | 2.640625 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
//este paquete nos permite hacer validaciones
//hay varios validadores, por ejemplo check es el mas general y valida todo el request
//pero tambien puedo usar por ejemplo body , el cual solo buscará validar el body del request
const { check, body } =... | true |
3b80d25b700aa081d418a2e9d692b8497d211bda | JavaScript | ProyectoFinalUtn/proyecto_plataforma | /src/CodeIgniter/assets/js/graficoSolicitudes.js | UTF-8 | 32,967 | 2.515625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | $(document).ready(function(){
$.ajax({
url: "Grafico_solicitudes",
method: "GET",
success: function(data) {
var datos = JSON.parse(data);
var estado = [];
var cantidad = [];
var maxValue = 0;
for(var i in datos) {
estado.push(datos[i].descripcion);
cantidad.push(datos[i].cantidad);
if ... | true |
58d8cf8a304324ee8439a0176dc0211256c1e161 | JavaScript | IceDragon200/es-moon-js | /public/js/utils/Vec3.js | UTF-8 | 1,765 | 2.5625 | 3 | [] | no_license | define(["require", "exports"], function (require, exports) {
"use strict";
var Vec3 = (function () {
function Vec3(x, y, z) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
if (z === void 0) { z = 0; }
this.x = x;
this.y = y;
... | true |
07b73c5d90e00398ca54fb2deff4c7b2a3101524 | JavaScript | fosemberg/eslint-plugin-lodash-to-native | /src/lib/rules/map.js | UTF-8 | 2,950 | 2.71875 | 3 | [] | no_license | /**
* @fileoverview convert lodash map to native
* @author fosemberg
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const {MAP, TYPE} = require('../../utils/constants'... | true |
f42d789d0cd1ab47404224f384832ca0834bec6c | JavaScript | SebTalbot/Sirius | /js/user.js | UTF-8 | 1,476 | 3.09375 | 3 | [] | no_license | window.onload = function() {
setTimeout(updateInfo,2000);
};
function updateInfo() {
$.ajax({
type : "POST",
url : "ajax_user_info.php",
data : {
}
}).done(function(reponse){
var result = JSON.parse(reponse);
var liste = document.getElementById("listeInfos");
liste.innerHTML = "";
liste.a... | true |
53581c028dff43a13b55c5f30ff37131a2418655 | JavaScript | skalashynski/HTML | /лаба6чб/js/script.js | UTF-8 | 2,273 | 2.875 | 3 | [
"MIT"
] | permissive |
function showContent(link, jsonlink, txtlink, name) {
$("#text").load(txtlink);
$(".btn").bind( "click", function() {
var txt = document.getElementById("text");
if(txt.innerHTML==""){
alert("Предупреждение! Пустой txt-файл!");
}
});
//очищаем div и ul
document... | true |
40627179ba0870f29309956fe07b77e29c5f0e7e | JavaScript | Manatho/Youtublers | /html-preprocessor.js | UTF-8 | 4,817 | 2.890625 | 3 | [] | no_license | var http = require('http');
var fs = require('fs');
var cheerio = require('cheerio');
class HtmlPreprocessor {
/*
@html: html page as a string
@replaceTagWith: Associative array
key: tag
value: replacement text
@return string containing the changed html
In ... | true |
8603b6be4eed1e0a905e965afce1eeb45d5e1312 | JavaScript | nich-mctishe/express-framework | /src/helpers/Schema.js | UTF-8 | 2,600 | 2.59375 | 3 | [] | no_license | const global = require('../config/options')
const { composeWithMongoose } = require('graphql-compose-mongoose')
const Mongoose = require('mongoose')
const Schema = Mongoose.Schema
const _ = require('lodash')
const findOrCreate = require('mongoose-find-or-create')
/**
* schema
* interprets the data peice of the confi... | true |
5a5ab672705dfb64a062948849f01f1eb107980f | JavaScript | gustavodomenico/web-worker-sorting | /src/common/Configuration.js | UTF-8 | 1,004 | 2.75 | 3 | [] | no_license | import SplitArray from "../algorithms/SplitArray";
export default class Configuration {
static ARRAY_SIZE = 100000;
static CHUNK_SIZE = 5000;
static POLLING_INTERVAL = 500;
static createWorkers(workersCount, splitArray) {
const array = this.createArray();
const arrays = splitArray ?
... | true |
9eae7c136e15c77a9870c1fa83dd081c1df8c725 | JavaScript | sintanial/repello | /public/js/repello/event.js | UTF-8 | 2,067 | 2.84375 | 3 | [] | no_license | var EventEmitter = (function () {
function EventEmitter() {
this._events = {};
}
function on(evt, cb, context, once) {
var p = evt.split('.');
var name = p[0];
var namespace = p[1];
if (this._events[name] === undefined) {
this._events[name] = {};
}
if (namespace === undefined)... | true |
6916948e37c4524c98613de97871bed25727b552 | JavaScript | dethertech/dether.shop | /src/reducers/user/user.test.js | UTF-8 | 2,245 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | /* global describe it expect */
import deepFreeze from 'deep-freeze';
import
userReducer,
{
hasBalance,
hasEnoughMoneyToAddShop,
hasEnougthMoneyToRemoveShop
}
from './user';
describe('reducer::user', () => {
let defaultAction;
beforeEach(() => {
defaultAction = {
balance: {
et... | true |
195394caf09bce01f5b290a8e6194be9ad3827a0 | JavaScript | foozzi/Loki | /static/js/home.js | UTF-8 | 1,630 | 2.875 | 3 | [
"MIT"
] | permissive | "use strict";
$(document).ready(function() {
onlineBotsSource();
for(let n=0; n<3; n++) {
fetchBots();
}
setInterval(fetchBots, 10 * 1000);
});
function onlineBotsSource() {
$.ajax({
type: "POST",
url: "/online_bots_source"
}).done(function(data) {
... | true |
bc9c93a696a54be60fb0794075375cae5984512b | JavaScript | randor12/VTHacks8 | /static/js/load.js | UTF-8 | 485 | 2.8125 | 3 | [] | no_license | /**
* Send the data to be loaded
* @param {string} company company being checked
*/
function load_data(company) {
data = {
'company': company
}
$.ajax({
dataType: "json",
url: '/load',
type: "POST",
data: data,
success: function() {
console.lo... | true |
14e906610a427b6c686552ce4055286a66cf746a | JavaScript | sburbidg/sea-c16-javascript | /students/scottBurbidge/tabs/tabs.js | UTF-8 | 919 | 2.90625 | 3 | [] | no_license | function clickHandler() {
$(this).next().addClass("image").removeClass("noImage")
$(this).removeClass("image").addClass("noImage")
}
function lastImage(){
$(".first").addClass("image").removeClass("noImage")
$(this).removeClass("image").addClass("noImage")
}
function ageList(){
var lowEnd = 0;
var hi... | true |
6d862e9f70ea0b999d3577764d7a56b5bc4904d4 | JavaScript | Albert-MinJie-cloud/WX-Todolist | /pages/clock/clock.js | UTF-8 | 839 | 2.71875 | 3 | [] | no_license | Page({
data: {
active: 0,
hourDeg: '',
minDeg: '',
dayDeg: '',
hour: '',
min: '',
second: '',
image:'/tabbarImage/clock.png'
},
onLoad() {
const deg = 6;
setInterval(() => {
let day = new Date();
let hh = day.getHours() * 30;
let mm = day.getMinutes() * de... | true |
bd28ca1d77e1dee5b3aa2cb181bfd3c7dcf92d27 | JavaScript | bestyn/BestynCoin | /test/BaniContractTest.js | UTF-8 | 6,411 | 2.6875 | 3 | [] | no_license | const {accounts, contract} = require('@openzeppelin/test-environment');
const {expect} = require('chai');
const {
BN, // Big Number support
constants, // Common constants, like the zero address and largest integers
expectEvent, // Assertions for emitted events
expectRevert, // Assertions f... | true |
bb46fde3eadbeb924e177272fcb408e9cb58e1b9 | JavaScript | PamelaPaprasz/hackreactorPrep | /computeCompoundInterest.js | UTF-8 | 356 | 2.8125 | 3 | [] | no_license | function computeCompoundInterest(principal, interestRate, compoundingFrequency, timeInYears) {
var base = 1+ interestRate/compoundingFrequency;
var pow = compoundingFrequency * timeInYears;
var powBase = Math.pow(base, pow);
var amount = principal * powBase - principal;
return amount;
}
console.log(compute... | true |
06dc10da5d416ea2a31a7438a01de31e67366439 | JavaScript | Gibran98/TotallyNotMunchkins | /munchkinonline/src/game/classes/selection.js | UTF-8 | 4,805 | 2.921875 | 3 | [] | no_license | import SelectionButton from './selectionButton'
export default class Selection {
constructor(scene, dimensions) {
this.dimensions = {x: dimensions.x, y: dimensions.y, width: dimensions.width, height: dimensions.width*0.5}
this.tokenYellow = new SelectionButton(scene, 'token', 'tokenYellow'... | true |
649f23784d46034104d1af1903151c1d010262ec | JavaScript | Nivekul/breakout | /game.js | UTF-8 | 13,256 | 2.609375 | 3 | [
"MIT"
] | permissive | var WIDTH = 1260, HEIGHT = 900,
ZONE_HEIGHT = 800,
BLOCK_WIDTH = 90, BLOCK_HEIGHT = 40,
ROWS = 8, COLUMES = 14;
var LeftArrow = 37, RightArrow = 39;
var mouse_x = 0;
var mouse_y = 0;
var god_mode = false;
var canvas, ctx, keystate;
var player = new player(),
ball = new ball(),
wall = new wall(),
life = ... | true |
6a0b6c8c5a33a5ac1820679c092c080950bf5d1b | JavaScript | Simon2591990/Clicker-Game | /src/App.js | UTF-8 | 3,462 | 3.234375 | 3 | [] | no_license |
import { AppBar, Button, Grid, Toolbar, Typography } from '@material-ui/core';
import { useState, useEffect } from 'react';
import './App.css';
import AutoClickerTile from './AutoClickerTile';
function App() {
const [cash, setCash] = useState(0)
const [clicksPerSecond, setClicksPerSecond] = useState(0)
cl... | true |
b6b1ce596ddd005de96e5eb5295decc54ac362da | JavaScript | organizize/itakademija-2016-exam-final | /react-exam/src/main/resources/static/js/containers/BookListContainer.jsx | UTF-8 | 581 | 2.59375 | 3 | [] | no_license | var Link = ReactRouter.Link;
var BookListContainer = React.createClass({
getInitialState() {
return {
"books": []
}
},
componentDidMount: function() {
axios.get('http://localhost:8080/api/books')
.then(function (response) {
this.setState({"books": resp... | true |
956a92a788dc746e68c495175be92e7bc0c8453c | JavaScript | ignamiguel/protractor-demo | /src/highlight-position.js | UTF-8 | 2,208 | 2.71875 | 3 | [] | no_license | module.exports = function() {
this.started = false;
this.init = () => {
if (!this.started) {
const createKeyFrameScript = `
var style = document.createElement('style');\
style.type = 'text/css';\
var keyFrames = '\
@keyframes animateBorderOne {\
to {\
outlin... | true |
ea241cb5d018191596919c2dbb8777c009ba206e | JavaScript | windldream/leetcode | /string/longestPalindromeSubseq.js | UTF-8 | 1,377 | 3.421875 | 3 | [] | no_license | /**
* @param {string} s
* @return {number}
*/
const longestPalindromeSubseq = function (s) {
const len = s.length
const dp = Array(len)
.fill(0)
.map(() =>
Array(len)
.fill(0)
.map(() => Array(26).fill(0))
)
for (let n = 2; n <= len; n++) {
for (let i = 0; i + n - 1 < len;... | true |
11eb48d3c6b6e63a142fae11fb0431b5282c3832 | JavaScript | beblueblue/learnNode | /file_server.js | UTF-8 | 2,398 | 2.640625 | 3 | [] | no_license | 'use strict'
var
fs = require('fs'),
url = require('url'),
path = require('path'),
http = require('http');
//从命令行参数获取root目录,默认是当前目录
//process.argv是一个数组包含命令行的所有参数
//比如node http abc
//数组为['node.exe的位置','http.js的位置','adc']
var root = path.resolve(process.argv[2] || '.');
console.log('Static root dir:'... | true |
50084b386ac7828d431cb25f17238313c4a5e088 | JavaScript | fabianrios/express-crud-portfolio | /public/js/hourSelector.js | UTF-8 | 2,208 | 2.78125 | 3 | [] | no_license | (function ( $ ) {
$.fn.hourSelector = function( options ) {
if(options == "destroy"){
//console.log(options);
this.html("");
return this
}
var that = this;
// This is the easiest way to have default options.
var settings = $.extend({
... | true |
90fbccd887b92d44da6bca2251bf929a7ae722b2 | JavaScript | Enzo88/weatherstation-ui | /WeatherDataDAO.js | UTF-8 | 2,635 | 2.703125 | 3 | [] | no_license | const WeatherData = require('./WeatherData.js')
class WeatherDataDAO {
constructor(pool) {
this.pool = pool;
}
saveData(currentWeather, device_id) {
let data = new Date();
let currentDate = data.toDateString()+" "+data.toLocaleTimeString();
return new Promise((resol... | true |
211dc07c55f562b157f59182f2693070b2946826 | JavaScript | ImfreeDeveloper/proshop_mern | /backend/controllers/productController.js | UTF-8 | 753 | 2.53125 | 3 | [] | no_license | const asyncHandler = require('express-async-handler')
const Product = require('../models/productModel')
// @desc Fetch all products
// @route Get /api/products
// @access Public
const getProducts = asyncHandler(async (req, res) => {
try {
const products = await Product.find({})
res.json(products)
} c... | true |
9ace3fcc17e5b441475c8fbdcd66240e2c6c1381 | JavaScript | Pavlo-Tymoshchuk/Ajax-in-jQuery | /js/main.js | UTF-8 | 1,186 | 3.15625 | 3 | [] | no_license | var button = $("#button");
var list = $("#list");
var input = $("#input")
$(list).on("click", function(event){
if(event.target.tagName === "LI") {
$(event.target).toggleClass("checked");
}
if(event.target.tagName === "SPAN") {
var liElement = $(event.target).parent();
liElement.hide(1000);
setTimeout(funct... | true |
b19a970d4ae433aefaa1e99ed45dfedccb5c052e | JavaScript | samocr7/MatchingNumbers | /script.js | UTF-8 | 11,264 | 2.90625 | 3 | [] | no_license | var numbersArray=[];
var score=0+0;
window.onload=music();
window.onload= getNumbers();
function music(){
var audio = new Audio('music/music.mp3');
audio.play();
}
function getNumbers(){
numbersArray=[];
var p1 = Promise.resolve($.getJSON("http://www.pppaul.blunus.com/process.php").then(
... | true |
2a7e344745704359f93f443a2ef567a4bcabbc3e | JavaScript | DrzwiPercepcji/Nodeo | /app/modules/encryption.js | UTF-8 | 1,009 | 3.015625 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
const crypto = require('crypto');
const DIRECTION_INCREASE = 1;
const DIRECTION_DECREASE = -1;
function calculateByte(byte, direction) {
let result = byte;
while (result % 32 !== 0) {
result += direction;
}
return result;
}
exports.encryptFile = function (filePath,... | true |
c060c379dd7718b9167a6254fc175910412e09af | JavaScript | frittinger/nodejs-katas | /addTwoNumbers.js | UTF-8 | 518 | 3.671875 | 4 | [
"MIT"
] | permissive | function addTwoNumbers(x, y) {
return x + y;
}
function addNumberAndString(n, s) {
return n + parseInt(s);
}
/*
takes 0 to 2 numbers and return their sum with 0 for the empty string
*/
function add(s) {
if (s !== null && s !== '') {
splitValues = s.split(/,|\n/);
return splitValues.reduce... | true |
d52e9b35745fc7b026c0a5143c00af96e6f18c06 | JavaScript | daykinandstorey/silverstripe-shop-search | /javascript/search.facets.range.js | UTF-8 | 1,983 | 2.625 | 3 | [
"MIT"
] | permissive | /**
* Javascript for range type facets specifically. This is in it's own
* file because I would expect some users would want to replace the
* jquery ui component with their own.
*
* @author Mark Guinn <mark@adaircreative.com>
* @date 10.18.13
* @package shop_search
* @subpackage javascript
*/
(function ($, win... | true |
89c4b1c3fb8ed7834e5f2ea49b59daaac360440d | JavaScript | mvcds/hubi | /docs/hubi.js | UTF-8 | 446 | 2.625 | 3 | [
"MIT"
] | permissive | // eslint-disable-next-line
const j = $
function open (details) {
if (!details || !details.length) return
details.prop('open', true)
}
j(document).ready(function () {
var hash = window.location.hash.substr(1).toLowerCase()
if (!hash.length) return
if (hash === 'all') return open(j('details'))
const t... | true |
26e568ac6f7a0dde3d08aca3522415c15b4ad247 | JavaScript | nagyist/sacredboard | /sacredboard/static/scripts/plot/plotlyplot/convertDataPoints.js | UTF-8 | 619 | 3.140625 | 3 | [
"MIT"
] | permissive | define(["./formatDate"], function (formatDate) {
"use strict";
/**
* Convert given data points for PlotlyPlot.
*
* Return number as is or dates as a formatted string that is accepted by Plotly.
*
* @param {Date[]|number[]} dataPoints - Array of numbers or dates to be used as values.
... | true |
e64813773185a9380b22c020b14ce502a7b5371b | JavaScript | flameleo11p/temp | /test/t1 create_user_tips.js | UTF-8 | 477 | 2.671875 | 3 | [
"MIT"
] | permissive |
function create_user_tips() {
var history = document.querySelector('.history');
var tabs_layout = document.createElement('div');
tabs_layout.classList.add('tabs-layout')
var tips = document.createElement('div');
tips.classList.add('tips')
var text = "Refresh in 5 seconds. click here or type F5 refresh no... | true |
27c666b621c7a9991db5c7a02b9bcff15bcf7aa1 | JavaScript | newzpanuwat/NodeJS-Basic | /global.js | UTF-8 | 253 | 2.8125 | 3 | [] | no_license | //console.log(__dirname);
//console.log(__filename);
function printHello(){
console.log('Hello world!!');
}
function printBoat2(){
console.log('Boat2');
}
var t = setTimeout(printHello,2000);
clearTimeout(t);
setInterval(printBoat2, 2000); | true |
cab38956570402382569c845d97148e8ee4e34e6 | JavaScript | ikramhasib007/react-indecision-app | /src/playground/toggler.js | UTF-8 | 624 | 3.125 | 3 | [] | no_license | const toggler = {
toggle: false,
text: 'This is the toggler text. we can see this now!'
};
const onToggler = () => {
toggler.toggle = !toggler.toggle;
renderApp();
};
const appRoot = document.getElementById("app");
const renderApp = () => {
const template = (
<div>
<h2>Visibil... | true |
7d9247dce306fd72ff76fa7acb82241b01424c6c | JavaScript | javascript-toolbox/LetsLearnJS | /js/check6.js | UTF-8 | 455 | 3.296875 | 3 | [
"MIT"
] | permissive | function d(){
checkarr=[];
for(i=0;i<3;i++){
var num=checkarr.push(prompt("Enter a number"));
}
var check =0;
for(j=0;j<checkarr.length;j++){
if(checkarr[j]>6){
check++;
}
}
if(check>=1){
alert("Found a number greater than 6");
}
else{
... | true |
93bb9089e2cfe1329452bc17fe8e9de471527c48 | JavaScript | patrickp89/proteus-platform | /well-admin-dashboard/src/utils/utils.js | UTF-8 | 266 | 2.765625 | 3 | [
"MIT"
] | permissive | export const getDisplayNameForSensorTypeValue = (sensorTypeValue) => {
switch (sensorTypeValue) {
case "ph": return "pH"
case "temp": return "Temperature"
case "level": return "Water Level"
default: return "unknown sensor"
}
} | true |
f8218bf6841181f544be932b38a07aafdd6842e1 | JavaScript | muradn1/react-apolloClient-seed | /src/components/forms/form_wrapper/parserService.js | UTF-8 | 88 | 3.015625 | 3 | [] | no_license | export const numberParse = (value) => (isNaN(parseInt(value)) ? null : parseInt(value)); | true |
7f531a494080af023b681ed5c3d60145f2d0e82c | JavaScript | lucianotimo/javascript | /js/app.js | UTF-8 | 10,322 | 2.71875 | 3 | [] | no_license | //Reduccion de tamaño de teclas BOTON1
var boton1 = document.getElementById("1");
boton1.addEventListener("mousedown",function()
{
boton1.setAttribute("style","transform:scale(0.85,0.85)")
})
boton1.addEventListener("mouseup",function()
{
boton1.setAttribute("style","transform:scale(1,1)")
})
//Reduccion de ... | true |
d0fe7c2b53853547fd4e444fb7d8eadd1540cb96 | JavaScript | elco45/bowlingKata | /src/game.js | UTF-8 | 1,702 | 2.984375 | 3 | [] | no_license | var Game = (function () {
// If you define an attribute with private
// the value is automatically assigned
function Game() {
this.isStrike = function (firstInFrame) {
return rolls[firstInFrame] == 10;
};
this.isSpare = function (firstInFrame) {
return rolls[f... | true |
2635d2476723fe1ed6d71f2dc52d767c8c83157c | JavaScript | Red13aron/wordguess-node-app | /index.js | UTF-8 | 3,717 | 3.671875 | 4 | [
"MIT"
] | permissive | const inquirer = require("inquirer");
const Word = require("./Word");
const figlet = require("figlet");
const colors = require("colors");
const libraryWords = [`Fishhook`,
`Rhythmic`, `Numbskull`, `Wildebeest`,
`Phlegm`, `Dwarves`, `Sphinx`];
let lettersGuessed = [];
let isGuessed = false;
let currWord;
let ra... | true |
c4492f91cb243c090f797e6de3c68934e334b3d5 | JavaScript | xujun10110/threatdetectionservice | /gui/static/userviewmodel.js | UTF-8 | 1,651 | 2.8125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | function userViewModel() {
var self = this;
self.firstName = ko.observable("");
self.lastName = ko.observable("");
self.email = ko.observable("");
$.getJSON("http://10.10.10.97:7777/api/user/mack@goflyball.com",
function(data) {
console.log(data);
//var parsed... | true |
6a3b0844d03349fbaf954dfd3b9f461a23ce77a3 | JavaScript | kirstein/drex | /lib/module.js | UTF-8 | 1,752 | 2.78125 | 3 | [] | no_license | var fs = require('fs');
var path = require('path');
var _ = require('lodash');
/**
* Load modules. And sort them according to their initiation priorities.
* It will require the modules.
*
* The ordering will happen according to module priority setting.
* If the priority is not set then it will mark those mod... | true |
888e3fc18a15dd4609245e50025bcae7259cc88e | JavaScript | kckracker/public-api_employees | /js/scripts.js | UTF-8 | 11,163 | 3.3125 | 3 | [] | no_license | //***** GLOBAL VARIABLES *****/
const searchContainer = document.querySelector('.search-container');
// Sourced syntax and functionality of Request object from https://developer.mozilla.org/en-US/docs/Web/API/Request/Request
// CORS added as mode value due to initial fetch issues with missing Allow-Control-Allow-Origin... | true |
dd595a6b4b2d7f9a341b4fc7a2a42fb1d4594155 | JavaScript | Band69/goit-js-hw-07 | /js/task-6.js | UTF-8 | 716 | 3.390625 | 3 | [] | no_license | // посилання на input
const inputRef = document.querySelector("#validation-input");
// посилання на дата-атрибут довжини, приведений в число
const correctLength = Number(inputRef.dataset.length);
// слухає втрачений фокус
inputRef.addEventListener("blur", onInputInsertData);
// коллбек перевіряє та додає класи
functi... | true |
fdceeac0b45aa7a3835cce6f7420d25cf7658734 | JavaScript | MahmudH/nodejs-practice | /password-manager/example-encyption.js | UTF-8 | 490 | 2.890625 | 3 | [] | no_license | var crypto = require('crypto-js');
var secretMessage = {
name: 'Mahmud',
secretName: '007'
}
var secretKey = '123abc';
//Encrypt
var encryptedMessage = crypto.AES.encrypt(JSON.stringify(secretMessage), secretKey);
console.log('Encryped message is : ' + encryptedMessage);
//Decrypt
var byte = crypto.AES.decrypt(... | true |
d8c98f55b5f48ef6bcf766d055c23fc3ee14ac64 | JavaScript | CGWTQ/reactAdmin | /src/pages/login/store/actionCreators.js | UTF-8 | 972 | 2.640625 | 3 | [] | no_license |
// 一、常量
import * as constants from './actionTypes';
// 二、UI组件
import { message } from 'antd';
// 三、接口
import {
postLogin
} from '../../../api/index';
// 四、定义actionCreators
// 语法 export const set/add/getReducer键名Creator = () => dispatch => {}
// 代码
// 登录
export const setUserinfoCreator = params => dispatc... | true |
3ebd0325154214f71b34b86d58841bf4cec31c34 | JavaScript | josvelema/portfolio-website | /assets/js/app.js | UTF-8 | 339 | 2.9375 | 3 | [] | no_license | // portfolio Jos Velema 2021
const source = document.getElementsByTagName('html')[0].innerHTML
const clickPrint = document.getElementById('clickPrint')
const domContainer = document.getElementById('domContainer')
clickPrint.addEventListener("click",function printDOM() {
domContainer.innerText = source
})
domConta... | true |
d236a65380708f9c89b1011d5d5654a4dd1570cc | JavaScript | JDBS/DEWTiendaProductos | /js/components/ProductComponent.js | UTF-8 | 1,937 | 2.734375 | 3 | [
"MIT"
] | permissive | class ProductComponent extends React.Component {
getCart(){
return load(CART_SAVE_ID)||[];
}
findInCart(product){
const cart=this.getCart();
return cart.findIndex(
(element)=>element.id===product.id
);
}
addToCart(){
//CART_SAVE_ID
const... | true |
1f5c2248dcaa7e67ede3191f6e439ec5c2c784d3 | JavaScript | MrWalshyType2/fetch-exercise-spa | /scripts/app.js | UTF-8 | 3,897 | 3.171875 | 3 | [] | no_license | (() => {
let fetchOneBtn = document.querySelector("#fetchOne");
let fetchAllBtn = document.querySelector("#fetchAll");
let createBtn = document.querySelector("#createOne");
let cardContainer = document.querySelector("#cardContainer");
cardCreator = (data, i) => {
let card = document.createElement("div");... | true |
a9180991e70c76b8c9ec34ec9b2b6071d2aa7b31 | JavaScript | vldmrgrbv/training_10macket_1 | /training/CSS_Grid/tr_1/training_1.js | UTF-8 | 820 | 2.921875 | 3 | [] | no_license | // var elem = document.querySelector('.header');
// elem.style.width = document.documentElement.scrollWidth +'px'; //window.innerWidth document.documentElement.clientWidth
// elem.style.height = (window.innerHeight)+'px';
// var elem = document.querySelectorAll('.header__button');
// elem[0].addEventListener('mouse... | true |
96a542b1d960af245ea9fee1e1e5730d154c46f9 | JavaScript | spiroan2012/TransformationsApp | /js/draw/polygon_utility_functions.js | UTF-8 | 3,513 | 3.328125 | 3 | [] | no_license | function addPoint(){//Function called when the user clicks the add point button on polygon frame
number_of_polygon_points++;//The number of polygon points is increased
document.getElementById("dynamic_polygon_points").appendChild(createPolygonPoint(number_of_polygon_points));//Adds the point to the polygon poin... | true |