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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c52799acdece6b90699458129a231abbbb6dda84 | JavaScript | Michael2004-ukpeh/React-expense-tracker | /controllers/transactionController.js | UTF-8 | 1,950 | 2.5625 | 3 | [] | no_license | const Transaction = require('../models/Transaction')
const asyncWrapper = require('../middleware/asyncWrapper')
const {createCustomError} = require('../errors/customError')
//get all task
const getAllTransactions = asyncWrapper(async(req, res) =>{
const transactions = await Transaction.find({})
res.status(200).json... | true |
714226739420c19be8ffccfc426e77ee24cf4f8f | JavaScript | JulesTexier/Projet-Javascript | /script_5.js | UTF-8 | 2,320 | 3.09375 | 3 | [] | no_license | const books = [
{ title: 'Gatsby le magnifique', id: 133712, rented: 39 },
{ title: 'A la recherche du temps,perdu', id: 237634, rented: 28 },
{ title: 'Orgueil & Préjugés', id: 873495, rented: 67 },
{ title: 'Les frères Karamazov', id: 450911, rented: 55 },
{ title: 'Dans les forêts de Sibérie', id: 8376365,... | true |
5efb633a339be541b104e9762c018e4f749c5e90 | JavaScript | Escobita/selenium | /tags/selenium-2.0-alpha-6/firefox/src/js/evaluate.js | UTF-8 | 1,681 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | /*
Copyright 2010 WebDriver committers
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law ... | true |
f59e369955d43f2263990b4d7399c7c9d40f2e71 | JavaScript | raz346/chattyapp | /src/ChatBar.jsx | UTF-8 | 862 | 2.65625 | 3 | [
"MIT"
] | permissive | import React, {Component} from 'react';
class ChatBar extends Component {
constructor(){
super();
this.state = {
content: ''
}
this.handleKeyPress = this.handleKeyPress.bind(this);
this.userKeyPress = this.userKeyPress.bind(this)
}
userKeyPress(event){
this.props.addUserName(event... | true |
4c013f8dc50258c7a119b83c77c313aa1df493c0 | JavaScript | AnimeshRy/eragram | /src/services/firebase.js | UTF-8 | 4,498 | 2.625 | 3 | [
"MIT"
] | permissive | import { firebase, FieldValue } from '../lib/firebase';
export async function doesUsernameExist(username) {
const result = await firebase
.firestore()
.collection('users')
.where('username', '==', username)
.get();
return result.docs.length > 0;
}
export async function getUserByUsername(username)... | true |
c142ebe3b53502a7e6d4f4ff9e84dd64790e2d69 | JavaScript | teixeiragabrielusp/best-route-api | /src/cli/cli.js | UTF-8 | 981 | 2.9375 | 3 | [] | no_license | const inquirer = require('inquirer');
//Função que define a interface de linha de comando
const cliArgs = () => {
var questions = [{
type: 'input',
name: 'route',
message: "Please enter the route (FROM-TO): ",
filter: input => {
return input;
}
}, {
... | true |
cf697f066b1d5c3569fd107e8c09cd8cc17c45d6 | JavaScript | khujay15/OS_real-time-scehduling | /calcNUM.js | UTF-8 | 3,525 | 3.09375 | 3 | [] | no_license | /**
*
* @param {*} periodicTask 주기적 Task배열. 주기, 수행시간, pid, 컬러값을 가지는 객체배열.
* @param {*} numAperiodicTask 숫자값
* @detail periodicTask배열에 Server의 {주기,수행시간}객체를 추가하고, 이에 맞는 비주기적 Task배열을 랜덤하게 생성
* @return periodicTask의 원소들에 따라 랜덤하게 결정된 비주기적 Task의 배열
*/
function calc_AperiodicTask(periodicTask, numAperiodicTask) {
//Se... | true |
9c8e21c2b037bdb93f1473567f51036bae541fed | JavaScript | CodeGorgeous/LeetCode | /35.搜索插入位置.js | UTF-8 | 818 | 3.546875 | 4 | [] | no_license | /*
* @lc app=leetcode.cn id=35 lang=javascript
*
* [35] 搜索插入位置
*/
// @lc code=start
/**
* @param {number[]} nums
* @param {number} target
* @return {number}
*/
var searchInsert = function(n, t) {
// 二分法
// let s = 0
// let e = n.length - 1
// while (s <= e) {
// const c = Math.floor(s +... | true |
f714efa2320d3d1382c1e727623a9e04515f8407 | JavaScript | ptajanen/speedGame | /src/App.js | UTF-8 | 2,137 | 2.953125 | 3 | [] | no_license | import React, {Component} from 'react';
import './App.css';
import './index.css';
import Circle from './counter/Circle.js';
import GameOver from './gameOver/GameOver.js';
const getRndInteger = (min, max) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
class App extends Component {
state= {
current... | true |
0a93f0a82111e6aa5a03bc20a6eefbaa4be06ebe | JavaScript | PailletJuanPablo/mmCurso | /4 - MongoDB/controladores/usuario.js | UTF-8 | 1,919 | 3.1875 | 3 | [] | no_license | // El controlador se conectará a la base de datos para poder consultar y manipular información
"use strict";
//Importamos los modelos Mongoose para poder acceder a sus metodos
var Usuario = require("../modelos/usuario");
// Creamos una función para obtener todos los usuarios
let obtenerUsuarios = (req, res) => {
... | true |
311ab5458dcd422a3a920d96b5d812897ea66224 | JavaScript | bearjin/react-restaurantList-create | /src/component/LunchMap.js | UTF-8 | 2,841 | 2.609375 | 3 | [] | no_license | /*global kakao*/
import React, { Component } from "react";
class LunchMap extends Component {
componentDidMount() {
this.loadApi();
}
componentDidUpdate() {
this.renderMap();
}
loadApi() {
var _script = document.createElement('script');
_script.async = true;
... | true |
c737eac135012417c92a5323c29d045fe90c629f | JavaScript | paradigm1984/analog-clock | /public/app.js | UTF-8 | 1,215 | 4.40625 | 4 | [] | no_license | // create a setinterval function that will updsate the date variable every second so that it
// increases one second every second.
setInterval(() => {
const date = new Date();
updateTime(date);
updateClock(date)
}, 1000);
// function to make the clock tick
function updateClock(date) {
// grab each time hand di... | true |
5a68be051c35671c6ad845457f6f6aa16f124c73 | JavaScript | bwduck/use-state-list | /src/use-state-list.js | UTF-8 | 410 | 2.8125 | 3 | [
"ISC"
] | permissive | import { useState } from 'react';
const update = (idx, value, state) => [
...state.slice(0, idx),
value,
...state.slice(idx + 1),
];
const useStateList = (length, defaultValue) => {
const [state, setState] = useState([...Array(length).fill(defaultValue)]);
const setListState = (idx, value) => setState(upda... | true |
5d4f3d8bf17d506190cf486cded40aac0d2ac631 | JavaScript | lyyh/FELearningNotes | /part 15/各种实现/分片处理/index.js | UTF-8 | 495 | 3.25 | 3 | [] | no_license | var sliceTasks = function (tasks, args, callback) {
var run = function () {
var task = tasks.shift()
if (task) {
task.apply(null, args || [])
}
if (tasks.length) {
setTimeout(run, 16);
} else {
callback()
}
}
setTimeo... | true |
4eb10a654f8c1a6a254e6e139807decc4d3b010d | JavaScript | huanliooooo/shop_mobile_backend | /middlewares/authenticate.js | UTF-8 | 1,021 | 2.515625 | 3 | [] | no_license | const statusCodes = require('../errors/statusCode');
const { verifyAccessToken } = require('../utils/auth');
const camelCase = require('./camelCaseRequest');
// Trước khi đi vào controllers request sẽ đi qua một trong các hàm dưới đây
// tùy vào việc được khai báo ở route
async function authenticate(req, res, next) {
... | true |
4f6e942b7b3253d12d96c62c230c4885605a77fe | JavaScript | sausage-sandwich/ruby_sandwich | /apps/web/assets/javascripts/application.js | UTF-8 | 3,742 | 2.9375 | 3 | [] | no_license | // .js-repeatable - container that must include n
// .js-repeatable-block-add-button - a control to add a block
// and .js-rebeatable-block - the block that must be duplicated and appended into the container
// example:
// .js-repeatable
// .js-repeatable-block-add-button.btn.btn-danger Add
// .js-rebeatable-block ... | true |
66a67e760937e3eb9aeb93f3c0e36f42dcbb7f27 | JavaScript | luiscazzullo/second-class | /src/components/Lifecycle/Lifecycle.js | UTF-8 | 1,244 | 3.4375 | 3 | [] | no_license | import { useEffect, useState } from 'react';
//Ciclo de vida
// 1 - Inicialización. Se cargan y se leen las props y sus estados
// 2 - Montado. Cuando el componentes está listo, pasa a mostrarse en el DOM.
// 3 - Actualización. Cuando el cambia el valor de una prop o un estado
// 4 - Desmontado. El componente desapare... | true |
9d21559719c47b7d03de6d16e4a17d980517bad8 | JavaScript | Seimah/blog-backend-assignment | /controllers/post.js | UTF-8 | 2,572 | 2.9375 | 3 | [] | no_license | const Post = require('../models/post')
//create a new blog post = POST
const createPost = async (req, res) => {
const {title, author, content} = req.body
const post = Post({title, author, content})
try{
const newPost = await post.save()
res.send({
message: 'Post Added Success... | true |
4b9fb165d58da4db81f52227d9b54b88e75dd485 | JavaScript | keven-lee/Practice-JavaScript-problems | /count vowels.js | UTF-8 | 1,052 | 4.5 | 4 | [] | no_license | //Write a method that takes a string and returns the number of vowels
//in the string. You may assume that all the letters are lower cased.
//You can treat "y" as a consonant.
//
//Difficulty: easy.
function count_vowels(string) {
var vowels = 'aeiouAEIOU';
var vcount = 0;
for (var i = 0; i < st... | true |
22fa8e5622c83734621483703fbef23a26d921a9 | JavaScript | alfonzm/stock-journal | /utils/trade-calc.js | UTF-8 | 5,718 | 2.609375 | 3 | [] | no_license | import _ from 'lodash'
import Utils from '@/utils/utils'
const PSE_TAX = 0.006 // percent
export default {
// Commission thingies -----------------------------------------------
getBuyFees(price, quantity) {
if(price <= 0) {
return 0
}
const gross = price * quantity
const commission = (0.0025 * gross) ... | true |
6a035e23442b61e39a1a7cb6731e600489708274 | JavaScript | tyagishilpi4all/hooks-React | /hooks-concept/src/component/useEffect.js | UTF-8 | 770 | 2.703125 | 3 | [] | no_license | import React,{useState,useEffect} from 'react';
import CustomHook from '../component/customHook'
function Hook1(){
const [count,setCount]=useState(0);
const [down , setdown]=useState(50);
const data = CustomHook();
// const handleCount=()=>{
// setCount(count + 1);
// }
const handleDo... | true |
bc73b590fcbf21cfc73b103f92d3b437071a61a4 | JavaScript | pfRoyWang/tutorial6-8 | /index.js | UTF-8 | 4,719 | 3.046875 | 3 | [] | no_license | var prev = document.getElementById("previewBox"),
redRange = document.getElementById("redRange"),
greenRange = document.getElementById("greenRange"),
blueRange = document.getElementById("blueRange"),
disp = document.getElementById("display"),
//redArr =[],
//greenArr = [],
//blueArr = [],
... | true |
509980b8ed153b47ba3641ba7422e03ce461c5c6 | JavaScript | LavizaFalakNaz/QuizApp | /src/api/dataSet.js | UTF-8 | 547 | 2.515625 | 3 | [] | no_license | const dataSet = [
{
question: "What is the Capital city of Pakistan?",
options: ["Karachi", "Islamabad", "Lahore"],
correct: 0
},
{
question: "What is the Capital city of Iran?",
options: ["Kabul", "Damashq", "Tehran"],
correct: 2
},
{
question: "What is the Capital city of Hungary... | true |
bc64ac4bb8304a2891913fec47e4cb0d345c9ee9 | JavaScript | imeneses1989/p5-react-imeneses | /src/components/_actions/Scaler/Scaler.js | UTF-8 | 570 | 2.65625 | 3 | [
"MIT"
] | permissive | const Scaler = ({object, startPoint, mouse}) => {
let {objectX, objectY, clientX, clientY} = startPoint;
let width = startPoint.width + mouse.x - clientX;
let height = startPoint.height ? (startPoint.height + mouse.y - clientY) : 0;
let newObj = {
...object,
x: width > 0 ? objectX: obje... | true |
d53641861607cb7a54dcbde54908cd868cb04620 | JavaScript | PacktPublishing/Learn-WebAssembly | /chapter-10-advanced-tools/parallel-wasm/src/index.js | UTF-8 | 2,244 | 3.3125 | 3 | [
"MIT"
] | permissive | import WasmWorker from './WasmWorker.js';
/**
* If you add ?blob=true to the end of the URL (e.g.
* http://localhost:8080/index.html?blob=true), the worker will be
* created from a Blob rather than a URL. This returns the
* URL to use for the Worker either as a string or created from a Blob.
*/
const getWorkerUrl... | true |
dcff5ae1578983586f4c94994caf772b51b9345c | JavaScript | matthewhaotran/vault-injury-forms | /client/app/core/user.factory.js | UTF-8 | 913 | 2.515625 | 3 | [
"MIT"
] | permissive | (function () {
'use strict';
angular
.module('app.core')
.factory('userFactory', userFactory)
userFactory.$inject = ['$http'];
function userFactory($http) {
var service = {
getUsers: getUsers,
getUser: getUser,
getUserByEmployeeId: getUserBy... | true |
bdb701eab0bc45555ccffeac10e5d61a4d458300 | JavaScript | yikkin/aspnet_tutorial | /aspnet_tutorial/Assets/js/main.js | UTF-8 | 977 | 2.796875 | 3 | [
"MIT"
] | permissive | $(function () {
$('#cat_id').on('change', function () {
var id = $(this).val();
//alert(id);
$.get('/Orders/getProducts', { id: id }, function (data) {
$('#product_id').empty();
$.each(data, function (index, row) {
$('#product_id').append("<option val... | true |
f42eaa630ba3e9015442bb5fdc4c27ad641fa0d3 | JavaScript | goenitz3/node-tabla | /helpers/multiplicar.js | UTF-8 | 1,086 | 3.046875 | 3 | [] | no_license | const fs = require( 'fs' );
const colors = require( 'colors' );
const crearArchivo = async ( num = 5, l = false , h = 10 ) => {
try{
let salida = '';
let consola = '';
for( let i = 1; i <= h; i++) {
consola += num + colors.bold.red(' x ') + i + colors.bold... | true |
e4b9de800c7b329185fb3caa29816616ff71e790 | JavaScript | kateberryd/HRS | /src/redux/reducers/campus/campusReducer.js | UTF-8 | 2,051 | 2.53125 | 3 | [] | no_license | import {
CREATE_CAMPUS,
CREATE_CAMPUS_SUCCESS,
CREATE_CAMPUS_FAILED,
GET_CAMPUS_LIST,
GET_CAMPUS_LIST_SUCCESS,
GET_CAMPUS_LIST_FAILED,
GET_SINGLE_CAMPUS,
GET_SINGLE_CAMPUS_SUCCESS,
GET_SINGLE_CAMPUS_FAILED,
EDIT_CAMPUS,
EDIT_CAMPUS_SUCCESS,
EDIT_CAMPUS_FAILED,
DELETE_... | true |
64a47256f2cfe6184d3cf8e18d9a7cb9c0f69d25 | JavaScript | carloshenrique051994/Uri | /JavaScript/1065 - Pares.js | UTF-8 | 534 | 3.953125 | 4 | [
"MIT"
] | permissive | var input = require('fs').readFileSync('stdin', 'utf8');
var lines = input.split('\n')
var pares = 0
for(i=0;i<5;i++){
valor = Number(lines.shift())
if(valor%2===0){
pares += 1
}
}
console.log(`${pares} valores pares`)
// O for faz um loop para coletar todos os valores, no caso do exercicio, são p... | true |
5441acccd446e2de4765e733f72d193c042ad1fe | JavaScript | saitonakamura/freediving-into-typescript | /duInference.js | UTF-8 | 539 | 2.546875 | 3 | [] | no_license | export const createFetch = () => ({
type: "TASK_FETCH"
})
export const createSuccess = task => ({
type: "TASK_SUCCESS",
payload: task
})
export const createFail = error => ({
type: "TASK_FAIL",
payload: error
})
export const taskReducer = (state, action) => {
switch (action.type) {
case "TASK_FETCH":... | true |
557c639eaa4273c7d66742ff23ac822772661ff5 | JavaScript | StanislavStefanovPetrov/Software-University-SoftUni | /JavaScript Fundamentals/Introduction to JavaScript/6.FigureArea.js | UTF-8 | 307 | 2.8125 | 3 | [
"MIT"
] | permissive | function test2(firstWidth, firstHeight, secondWidth, secondHeight) {
let firstArea = firstWidth * firstHeight;
let secondArea = secondWidth * secondHeight;
let excessArea = Math.min(firstWidth, secondWidth) * Math.min(firstHeight, secondHeight);
return firstArea + secondArea - excessArea;
} | true |
eaab800c67eeba383478dc045901ed2b55a77223 | JavaScript | OlegSirbu/redux-courses | /src/reducers/courseReducer.js | UTF-8 | 636 | 2.609375 | 3 | [] | no_license | import * as types from "../actions/actionsTypes";
import initialSate from './initialState';
export default function courseReducer(state = initialSate.courses, actions){
switch(actions.type) {
case types.LOAD_COURSES_SUCCESS:
return actions.courses;
case types.CREATE_COURSE_SUCCESS:
ret... | true |
b3a85a76796e839f2730ab7947bb933b2df35f30 | JavaScript | kbenedetti9/Ejercicios-JavaScript-1 | /Ejercicio10.js | UTF-8 | 586 | 3.171875 | 3 | [] | no_license | function calcularDescuento() {
let marca = document.getElementById("marca").value;
let modelo = document.getElementById("modelo").value;
let consultaDescuento = document.getElementById("descuento");
let descuento;
if (marca == "ford" && modelo == "fiesta") {
descuento = "5%";
} else if (... | true |
565df92f4722be2ae66aa2ef5e10410ec2996e99 | JavaScript | arcosta/sci-synergy | /code/web/scisynergy_flask/static/quiz.js | UTF-8 | 1,527 | 2.78125 | 3 | [
"MIT"
] | permissive | /**
*
*/
var count = 11;
function addInputText()
{
var div = document.getElementsByName("extQuestion")[0];
var inputRate = document.createElement("input");
inputRate.type="text";
inputRate.name="ps5text"+String(count);
inputRate.size="2";
inputRate.setAttribute("maxlength", "2");
count +=1;
var inpu... | true |
519ab51f00d97fa79f50bc0fa488df19eecc9430 | JavaScript | jchristman/homebridge-timer | /src/trigger-accessory.js | UTF-8 | 3,953 | 2.84375 | 3 | [
"MIT"
] | permissive | import {version} from '../package.json';
import wait from './wait.js';
let Accessory, Characteristic, Service;
class TriggerSensor {
static START = 1;
static END = 2;
constructor(HOMEBRIDGE, log, timer_config, start, end) {
({ Accessory, Characteristic, Service } = HOMEBRIDGE);
this.log =... | true |
59b11e59d53bbfa12327ef5cd0a8f71d7f2103f1 | JavaScript | faiisll/todoapp-react-tailwind | /src/App.js | UTF-8 | 2,372 | 2.828125 | 3 | [] | no_license |
import React, {Component} from 'react';
import Todos from './components/Todos';
import FormAdd from './components/FormAdd';
class App extends Component{
state = {
todos: []
}
updateLocal = (data) => {
localStorage.setItem('todos', JSON.stringify(data));
}
checkTodo = todo => {
let todos = this... | true |
9c9bc4572f431b66a077e955dcf33ace906b44f7 | JavaScript | colincove/covertstudios.ca | /blog/admin/js/forms.js | UTF-8 | 3,347 | 2.671875 | 3 | [] | no_license | var thumbnail;
function init() {
document.getElementById('file_upload_form').onsubmit=function() {
document.getElementById("upload_target").onload = uploadDone;
}
}
window.onload=init;
function uploadImage(){
sendRequest('upload-file.php',uploadImageCallback);
//xmlhttp.open("POST","ajax_test.asp",true);
//xmlhttp.... | true |
c8d2c6ae4a16726153ffe5db26225c7ce614c6d8 | JavaScript | Zombik007/goit-js-hw-10-food-service | /src/js/switch-theme.js | UTF-8 | 820 | 3.171875 | 3 | [
"MIT"
] | permissive | const Theme = {
LIGHT: 'light-theme',
DARK: 'dark-theme',
};
const pageTheme = document.querySelector('body');
const themeSwitchCheckbox = document.querySelector('#theme-switch-toggle');
themeSwitchCheckbox.addEventListener('change', e => {
if (e.target.checked) {
replaceTheme(Theme.LIGHT, Theme.DARK);
} ... | true |
1367dd20295738a95bc2d6f9ba16c0549c56ae1a | JavaScript | Hay00/kryptos | /src/utils/morseCode.js | UTF-8 | 1,941 | 3.046875 | 3 | [
"MIT"
] | permissive | export default class MorseCode {
alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789.,?\'!/()&:;=+-_"$@';
morseCode = [
'.-',
'-...',
'-.-.',
'-..',
'.',
'..-.',
'--.',
'....',
'..',
'.---',
'-.-',
'.-..',
'--',
'-.',
'---',
'.--.',
'--.-',
'.-.',... | true |
d9ad40bbe11831ce08162812a2920039650821f3 | JavaScript | kevinnguyen805/Technical-interviews | /weekseven/middleLinkedList.js | UTF-8 | 1,988 | 4.40625 | 4 | [] | no_license |
// Given a non-empty, singly linked list with head node head, return a middle node of linked list.
// If there are two middle nodes, return the second middle node.
// Example 1:
// Input: [1,2,3,4,5]
// Output: Node 3 from this list (Serialization: [3,4,5])
// The returned node has value 3. (The judge's seriali... | true |
46cddb81d1e81e1e1553c86704f0f84e4d4adfd0 | JavaScript | XavierUniversity/v5-playground | /src/js/base.video.js | UTF-8 | 2,076 | 2.65625 | 3 | [] | no_license | // Need to see if we are on a mobile device. If we aren't, let's post the video!
var vid = document.querySelector(".hero video");
if ( !detectmob() && vid !== null ) {
var button = document.createElement("button");
button.innerHTML = '<span class="sr-only">Pause Video</span><svg height="32" width="32" fill="white"... | true |
a97e22ed8b2375ac6818beb55aea9623a43af2bb | JavaScript | mogwuy/mesto | /src/components/UserInfo.js | UTF-8 | 696 | 2.796875 | 3 | [] | no_license | export default class UserInfo {
constructor(nameProfile, subnameProfile, profileAvatarImage) {
this._nameProfile = nameProfile;
this._subnameProfile = subnameProfile;
this._profileAvatarImage = profileAvatarImage;
}
getUserInfo(){
this._userData = {};
this._userData.name = thi... | true |
68b5614d147e533d0d41c05ee73742cde02494bc | JavaScript | Wyzardsleeves/hyper-forum | /app/javascript/packs/redux/reducers/topicReducer.js | UTF-8 | 830 | 2.59375 | 3 | [] | no_license | import axios from 'axios'
let initialState = {
topics: []
}
let fakeData = [
{id: 1, name: "Justin", description: "This is Justin's description"},
{id: 2, name: "Tabernackle", description: "This is Tabernackle's description"},
{id: 3, name: "Lyrica", description: "This is Lyrica's description"},
]
let altDat... | true |
9162f0a84359cd287699f9c023239f8f89547f92 | JavaScript | c0deSheep/Vue-Lesson3 | /02-learnvuex/src/store/actions.js | UTF-8 | 1,559 | 2.765625 | 3 | [] | no_license | export default {
// 不要用mutations进行异步操作,但确实需要进行异步操作,比如:网络请求,就需要用到actions来代替
// action里得方法有个默认参数:context,并且使用commit来提交mutations中的相关方法
// context:上下文
// 第二个参数可为payload,调用它的组件中传入的内容
// aUpdateInfo (context,payload) {
// setTimeout( () => {
// //这里固定用context.commit来将组件里的执行的修改状态方法提交,并且需要使用muta... | true |
f2f177f8f520fee5e69048590a08b3312bcd1dfc | JavaScript | ewgenius/catalog | /js/catalog.js | UTF-8 | 5,016 | 2.6875 | 3 | [
"MIT"
] | permissive | var data = [{
"name": "Браслет Power Balance",
"cost": 990,
"amount": 590
}, {
"name": "Часы Samurai",
"cost": 890,
"amount": 590
}, {
"name": "Часы Ice Watch",
"cost": 890,
"amount": 590
}, {
"name": "Часы Casio G-Shock",
"cost": 1290,
"amount": 890
}];
(function() {
... | true |
666c467e9a37bb2de8c05e0afd332ddf4750a411 | JavaScript | alexandru0408/COVID-19_Tracker-REACT | /components/CountryPicker/CountryPicker.js | UTF-8 | 937 | 2.578125 | 3 | [] | no_license | import { useEffect, useState } from "react";
import { fetchCountries } from "../util/fetchData";
import { useStateContext } from "../GlobalStateProvider";
const CountryPicker = () => {
const [fetchdCountries, setFetchedCountries] = useState([]);
const globalState = useStateContext();
useEffect(() => {
const ... | true |
b6a515746d4d9d85abfad354528e999876677f63 | JavaScript | pSnehanshu/ocpp-task-manager | /src/builder/callError.js | UTF-8 | 688 | 2.515625 | 3 | [
"MIT"
] | permissive | const _ = require('lodash');
const transportLanguage = require('../utils/transportLanguage');
function callError(
version,
uniqueId,
errorCode,
errorDescription = '',
errorDetails = {},
) {
const language = transportLanguage(version);
switch (language) {
case 'JSON':
return {
id: uniqu... | true |
48386a219ad7feeefa87ff4edd94e68a661e78b4 | JavaScript | wwwboy93/Web410 | /www/js/list_activities.js | UTF-8 | 3,049 | 3.3125 | 3 | [
"MIT"
] | permissive | /*
* This script fetches activities from database and list
* them both by categories and by post data (or by popularity)
* */
$(document).ready(function() {
console.log("list activities");
list_activities_by_category();
list_all_activities();
});
var list_activities_by_category = function() {
/* ... | true |
73c471f747f7979c36ca738cc2a47d1aa1055025 | JavaScript | akazakou/node-gyazo-server | /services/ServiceLocator.js | UTF-8 | 3,799 | 2.78125 | 3 | [] | no_license | var events = require('events');
/**
* Конструктор класса
* @todo добавить возможность цепочек инициализации сервисов друг за другом
* @todo добавить таймауты на ыремя инициализации
* @param {object} config
* @returns {ServiceLocator}
*/
var ServiceLocator = function(config) {
this.config = config;
this.s... | true |
0488864c0b9f2c45c7340d958c1faa106e8079be | JavaScript | himanirajput/devopsworkspace | /nodejsdemo/scriptarraydemo2moduleimports.js | UTF-8 | 475 | 2.734375 | 3 | [] | no_license | const products = require('./products')
//console.log(products.sort(function(product1,product2){return product1.price-product2.price}));
//console.log(products.sort((product1,product2)=> product1.price-product2.price))
//console.log(products.sort((product1,product2)=>product1.productName.localeCompare(product2.productNa... | true |
b358a91793d336f76927964236bb6149168f8c3c | JavaScript | merdwed/itmo-web-lab2 | /src/main/webapp/canvas.js | UTF-8 | 4,228 | 3.09375 | 3 | [] | no_license | var canvas = document.getElementById('canvas');
ctx = canvas.getContext('2d');
function CanvasToCenterCoord(x,y){
var width=canvas.scrollWidth;
var height=canvas.scrollHeight;
x=x/width*2-1;
y=-y/height*2+1;
return {x:x,y:y};
}
function CenterToCanvasCoord(x, y){
var width=canvas.scrollWidth;
... | true |
9564f50d00f0e48f78e43f364b602d9c45f71aad | JavaScript | retrohacker/objectify | /index.js | UTF-8 | 1,391 | 3.640625 | 4 | [] | no_license | 'use strict'
const hasObj = (arr) => arr.reduce(
(acc, cur) => acc || (typeof cur === 'object'),
false)
module.exports =
// This makes it possible to index arrays in elasticsearch.
function objectify (input, key = '') {
// Leave arrays of non-objects alone
if (Array.isArray(input) && !hasObj(input)) {
ret... | true |
2c605e8ba759e7ff91e25ee176b46903ba1feb6b | JavaScript | arinda12489/Bubble-Plugin-Feather-Icons | /elements/AAC-850m6/preview.js | UTF-8 | 1,915 | 2.8125 | 3 | [
"MIT"
] | permissive | function(instance, properties) {
// Define properties
var width = properties.bubble.width;
var height = properties.bubble.height;
var type = properties.type;
var color = properties.color;
var strokeWidth = properties.strokeWidth;
var fill = properties.fillColor;
var includeFi... | true |
ce500866f467d8929ec91d7df438411821831ea6 | JavaScript | rchaser53/TD4-cpu-emulater | /src/index.js | UTF-8 | 3,907 | 2.71875 | 3 | [
"MIT"
] | permissive | let MemoryA = 0b00000000
let MemoryB = 0b00100111
let MemoryC = 0b11000000
// registers
let RegisterA = 0b00000
let RegisterB = 0b00000
// for JNC order, true => ignore and false => jump to imidiate data
let CarryFlag = 0b0
// pointer
let programCounter = 0
const createMemoryData = (order, imidiateData) => {
cons... | true |
30d3b343031a6ea9f1951c39336391ca5ad796eb | JavaScript | liviupreda/node-reference | /server.js | UTF-8 | 382 | 2.5625 | 3 | [] | no_license | const http = require('http');
const port = 8080;
const server = http.createServer((req, res) => {
// console.log('headers', req.headers);
console.log('method', req.method);
console.log('url', req.url);
const user = {
name: 'Liviu',
hobby: 'Eating'
};
res.setHeader('Content-Type', 'application/json'... | true |
abdbc2fa5ca84a246c9f37e56f3e367da62b390d | JavaScript | francocz1991/CursoIngresoJS | /5-InstruccionWhile/jsIteraciones (9).js | UTF-8 | 602 | 3.46875 | 3 | [] | no_license | function Mostrar()
{
var contador=0;
// declarar variables
var maximo;
var minimo;
var numero;
var respuesta='si';
while(respuesta!='no')
{
contador++;
numero = prompt("Ingrese numero");
numero = parseInt(numero);
if (contador==1)
{
minimo=numero;
maximo=numero;
}
else
{
if (numero>... | true |
5bee78cc746f61eea70de4341f844755153b716b | JavaScript | puneetvashisht/fsdbatch_java | /01UILAYER/Html5/15-sse/app.js | UTF-8 | 1,123 | 2.6875 | 3 | [] | no_license | var express = require('express');
var app = express();
var port = 8080;
app.use(express.static(__dirname + '/public'));
var clientId = 0;
var clients = {}; // <- Keep a map of attached clients
// Called once for each new client. Note, this response is left open!
app.get('/events/', function(req, res) {
req.socket.... | true |
c13600bc9ebc00aa94dd4d4f64476b0a38490fd6 | JavaScript | gitkavi/WordGuess | /Word.js | UTF-8 | 1,053 | 3.734375 | 4 | [] | no_license | var Letter = require("./Letter.js")
var Word = function (currentWord) {
this.letterArray = [];
for (var i = 0; i < currentWord.length; i++) {
var char = new Letter(currentWord.charAt(i));
this.letterArray.push(char);
}
this.originalWord = function () {
var wordToGuess = ""... | true |
36d9302e2b7167ce5520efe46ab5d7f4f6d8e92e | JavaScript | tomergev/mongodb_mongoose_express_server | /src/models/index.js | UTF-8 | 629 | 2.59375 | 3 | [] | no_license | const fs = require('fs');
const path = require('path');
const allFileNames = fs.readdirSync(path.join(__dirname));
const collections = [];
allFileNames.forEach((file) => {
const last3Chars = file.substring(file.length - 3, file.length);
if (last3Chars === '.js' && file !== 'index.js') {
const model = file.s... | true |
7a54dfdfb1ebd953a856f076c481d5813deb3e65 | JavaScript | dominicprescod/stuff-repo | /public/js/app.js | UTF-8 | 175 | 2.5625 | 3 | [
"MIT"
] | permissive | $(()=>{
var socket = io();
socket.on("log",(data)=>{
var $list = $('#list');
var $item = $("<li>").text(JSON.stringify(data));
$list.prepend($item);
})
})
| true |
6162039ee8ab47f1297c1d4e266eca2ee6ceea3d | JavaScript | cherry-pynya/netology_ajs_homework_6_1 | /src/forIn.js | UTF-8 | 579 | 2.921875 | 3 | [] | no_license | export default function orderByProps(obj, array) {
let arrayOne = [];
let arrayTwo = [];
for (let i = 0; i < array.length; i++) {
if(array[i] in obj) {
arrayOne.push({key: array[i], value: obj[array[i]]});
delete obj[array[i]];
}
}
for (let item in obj) {
arrayTwo.push({key: item... | true |
fd38ff8b9612f06fede33d15b670ff496d07c0cd | JavaScript | luisdesig/aip-web | /src/redux/MantPolizaEstrategica/reducers.js | UTF-8 | 2,024 | 2.625 | 3 | [] | no_license | const initState = {
polizasestrategicas: [],
polizaestrategica: {},
reload: false,
loading: true
}
const reducer = (state = initState, action) => {
switch (action.type) {
case 'CARGANDOPOLIZAESTRATEGICA':
return {
...state,
loading: true
... | true |
f615f9dec6ca9d559d6f26f4931547516bdb716e | JavaScript | WilberTian/LeetCode | /problems/0167.Two Sum II - Input array is sorted.js | UTF-8 | 371 | 3.375 | 3 | [] | no_license | /**
* @param {number[]} numbers
* @param {number} target
* @return {number[]}
*/
var twoSum = function(numbers, target) {
var len = numbers.length;
lo = 0,
hi = len - 1;
while ((numbers[lo] + numbers[hi]) !== target) {
if ((numbers[lo] + numbers[hi]) < target) {
lo++;
} else {
... | true |
9cd2c2e69010d65fafb16d6e0731c7cb894192c6 | JavaScript | axa-group/nlp.js | /examples/07-nlpjs-on-aws-lambda/nlpjs-lambda-with-DynamoDB/nlpjs/engine.js | UTF-8 | 5,265 | 2.53125 | 3 | [
"MIT"
] | permissive | /* eslint-disable func-names */
/* eslint-disable no-console */
/* eslint-disable prettier/prettier */
// eslint-disable-next-line import/no-extraneous-dependencies
const aws = require('aws-sdk');
const NOT_PROD_ENV = process.env.AWS_SAM_LOCAL === 'true';
const dynamoDB = NOT_PROD_ENV ? new aws.DynamoDB({ endpoint :... | true |
dd42abc8450e7cff42bfb68aa5e40902b098538a | JavaScript | dshovchko/practice-5 | /src/task-4/api/index.js | UTF-8 | 658 | 2.78125 | 3 | [
"MIT"
] | permissive | import { days, daysShort } from './data-generator';
const timeout = function(ms) {
return new Promise(function(resolve) {
setTimeout(resolve, ms);
});
};
const rand = () => Math.random() < .8;
const getWeekForecast = () =>
timeout(1000).then(() =>
rand()
? Promise.resolve(daysShort)
: Promi... | true |
5e1d670e19edd0b95fe7d94a4c50026f1a55f300 | JavaScript | tom-deman/agency | /assets/js/main.js | UTF-8 | 2,814 | 2.796875 | 3 | [] | no_license | const burger = document.querySelector('.burger')
const modal = document.querySelector('#modal')
const linksPortfolio = document.querySelectorAll('.linksPortfolio')
const imgsDiv = document.querySelectorAll('.imgsDiv')
const imgAnimate = document.querySelectorAll('.imgAnimate')
burger.addEv... | true |
b20632a3bb73de6d1024598b67914de2f9df676d | JavaScript | longhike/dayplanner4u | /script.js | UTF-8 | 2,480 | 3.5625 | 4 | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | // need the following: look at forEach method (allows you to assign ids and values);
// need button event listener that saves the value of the textbox to local storage;
// IDs object with IDs for the full row (for color change w/ time of day), form IDs (for the actual text of the to-do item), and button IDs (to assig... | true |
3a6ecc3fc955c9e70f4045e3bdceefcd3c86c176 | JavaScript | mathieufontaine/card-3D-effect | /public/js/main.js | UTF-8 | 1,447 | 3.09375 | 3 | [] | no_license | // Moveming elements
const card = document.querySelector(".card");
const container = document.querySelector(".container");
// items
const title = document.querySelector(".title");
const shoe = document.querySelector(".shoe img");
const purshase = document.querySelector(".purshase button");
const description = document... | true |
5aa850712566322e41846b74cae2b757ae92f49e | JavaScript | ArchitVerma1812/C-32 | /sketch.js | UTF-8 | 1,706 | 2.609375 | 3 | [] | no_license | const Engine = Matter.Engine;
const World= Matter.World;
const Bodies = Matter.Bodies;
const Constraint = Matter.Constraint;
var engine, world;
var backgroundImg;
var bg ;
function preload() {
getbgimg();
}
function setup(){
var canvas = createCanvas(1200,700);
engine = Engine.create();
... | true |
0b8c928a29228079b3e12f3cb9da5e1f996c9503 | JavaScript | digital-land/local-plans-prototype | /application/static/javascripts/mhclg-maps.js | UTF-8 | 2,377 | 2.5625 | 3 | [
"MIT"
] | permissive | /*global L */
(function(L){
const MHCLGMaps = L.Class.extend({
// this is the constructor
initialize: function (options) {
if (!options.mapbox_token) {
console.warn("Must provide Mapbox token"); // eslint-disable-line
return false;
}
L.Util.setOptions(this, options);
r... | true |
d3f37078121fb8b936641e0435d2afea500b87bf | JavaScript | alanrf/bruxaHipsta | /scripts/jogo/movimento/movimentoDelay.js | UTF-8 | 643 | 2.828125 | 3 | [] | no_license | class MovimentoDelay {
constructor({
imagem,
velocidade,
delay,
y,
largura,
altura
}) {
this.imagem = imagem;
this.velocidade = velocidade;
this.origem = width + delay * 1000
this.x = this.origem
this.y = y
this.largura = largura
this.altura = altura
}
exibe(... | true |
6992089e1b953162e22d25bdd1dd74a42cfe7c96 | JavaScript | jo-arroyo/data-structures-and-algorithms | /code-challenges/arrayMajority/array-majority.js | UTF-8 | 488 | 3.265625 | 3 | [
"MIT"
] | permissive | 'use strict';
const majorityElement = (nums) => {
if(nums.length === 1){
return nums[0];
}
const stored = new Map();
for (let i = 0; i < nums.length; i++){
let value = nums[i];
if(stored.has(value)){
let current = stored.get(value);
current++;
if(current > nums.length / 2){
... | true |
bad83af048892820a6e82bfec2ae8641d98a01c5 | JavaScript | dshahaf/snap-sentiment | /sentiment/static/javascript/showSpinner1.js | UTF-8 | 2,555 | 2.671875 | 3 | [] | no_license | function optsSmall() {
var ret = {
lines: 13, // The number of lines to draw
length: 4, // The length of each line
width: 2, // The line thickness
radius: 4, // The radius of the inner circle
// length: 20, // The length of each line
//width: 10, // The line thickness
//radius: 30, // The radius o... | true |
ee954311fbb1527b79796f5a6ee2119dd8ff5aa5 | JavaScript | leepolla/blackjack | /blackjack.js | UTF-8 | 13,661 | 2.9375 | 3 | [] | no_license | var deck = [];
var values = {'a':1,'2':2,'3':3,'4':4,'5':5,'6':6,'7':7,'8':8,'9':9,'10':10,'j':10,'q':10,'k':10};
var cardCounts = [{'name':'-1', 'value':0}, {'name': '0', 'value':0}, {'name':'1', 'value':0}]
var bustProb = [{'name':'bust', 'value':0}, {'name':'safe', 'value':1}]
function shuffle(decks){
//new d... | true |
0940c48c99e8b9c3de0e514490154f31392cb7b9 | JavaScript | delilaxd/Recepti-za-zdrav-zivot | /ZADACA/projekat/javaGalerija.js | UTF-8 | 1,456 | 2.671875 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive |
var modal = document.getElementById("myModal");
var img = document.getElementById("s1");
var modalImg = document.getElementById("img01");
img.onclick = function(){
modal.style.display = "block";
modalImg.src = "love.jpg";
}
var img2 = document.getElementById("s2");
img2.onclick = function(){
modal.styl... | true |
9d55b1168155582162878ab26219beeb1ebd07f2 | JavaScript | honkit/honkit | /packages/@honkit/honkit-plugin-highlight/scripts/build-less.js | UTF-8 | 1,459 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | const fs = require("fs");
const path = require("path");
const highlightJs = require("highlight.js");
const SOLARIZED_LIGHT_CSS = readCss("base16/solarized-light.css");
const TOMORROW_CSS = readCss("base16/tomorrow.css");
const TOMORROW_NIGHT_BRIGHT_CSS = readCss("tomorrow-night-bright.css");
writeLess(
"ebook.le... | true |
fbe0ec1af3a39ea987715fc3214c3ae88fe3ab9b | JavaScript | dojo/dijit | /form/_DateTimeTextBox.js | UTF-8 | 12,206 | 2.546875 | 3 | [
"BSD-3-Clause",
"AFL-2.1"
] | permissive | define([
"dojo/date", // date date.compare
"dojo/date/locale", // locale.regexp
"dojo/date/stamp", // stamp.fromISOString stamp.toISOString
"dojo/_base/declare", // declare
"dojo/_base/lang", // lang.getObject
"./RangeBoundTextBox",
"../_HasDropDown",
"dojo/text!./templates/DropDownBox.html"
], function(date, l... | true |
aacfff5b071b03e05e8a310fcb4c4ebcb29853ad | JavaScript | anna-taway/data-structure-algos | /src/data-structures/array-strings/rotateLeft.js | UTF-8 | 1,270 | 4.0625 | 4 | [] | no_license | /**
* @function : rotateLeft
* @description : it performs d left rotations on the array.
* @param {Array} a
* @param {Number} d
* @return {Array}
*/
// Execution time 177665.9149999614 milliseconds
function rotateLeft(a, d) {
var n = a.length;
var result = a.map(function (value, index) {
let pos = parseIn... | true |
01cb333fe8c7bbc88e5949a40146bfb7ad24271b | JavaScript | brandielmalli/attendance-list | /js/main.js | UTF-8 | 774 | 3.109375 | 3 | [] | no_license |
//**
//attendance sheet //
//
// st name //
// student name store //
//*click button to see names//
var studentList = [];
//enter student name
$('#add').on("click",function(e){
console.log('running')
//prev def brow
e.preventDefault()
//get vavlue
var studentName = $("#input").val()
$("#input").val('')... | true |
65ea99483ee1b3087bb2c325de6d6c5f43d24875 | JavaScript | zmrram/TwitterBot-NodeJS | /bot.js | UTF-8 | 3,299 | 2.515625 | 3 | [] | no_license | var Twit = require('twit');
var accesskeys = require('./accesskeys');
var T = new Twit(accesskeys.tweetterKey);
// function searchTweet() {
// var param = {
// q: 'donald trump',
// count: 10
// };
// T.get('search/tweets', param, function(err, data, response) {
// var statuses = da... | true |
bb7bdf846e9a5ff2ada377abd7ead3e32444afa3 | JavaScript | jackz314/joma-thumb | /server.js | UTF-8 | 11,010 | 2.78125 | 3 | [] | no_license | // server.js
// BASE SETUP
// =============================================================================
// call the packages we need
var express = require('express'); // call express
var app = express(); // define our app using express
var bodyParser = require('body-parser');
var morgan = require('morgan');
var i... | true |
557e7a16588655530b0efe0c895b9c5aa2a8400e | JavaScript | kmjones13/Canvas-Drawing-Tool | /src/util.js | UTF-8 | 2,169 | 3.21875 | 3 | [
"MIT"
] | permissive | /**
* Utility function to determine if a 'touch:drag' event is the last in a series,
* corresponding to 'mouse:up'.
* @param {Object} evt - touch event from fabric.Canvas
*
* @returns {Boolean} true if it is the last in a series, false otherwise
*/
const isLastInDragSeries = (evt) => {
// a bit hacky and ad-hoc... | true |
a1a29a142682093f68ea2affa239435d64af077a | JavaScript | ChartreuseK/Much-Assembly-Required-Frontend | /mar/old/GameClient.js | UTF-8 | 6,948 | 2.828125 | 3 | [] | no_license | /**
* Listens for authentications responses from the server
*/
function authListener(message){
if(message.t === "auth"){
if(message.m === "ok"){
console.log("Auth successful");
client.requestUserInfo();
} else {
console.log("Auth failed");
}
}
}
... | true |
11ff3d5e400a32badc01587823e8871e7f71ba7d | JavaScript | BertrandLaot/test-front-end-lm | /assets/modules/forms/_validation.js | UTF-8 | 5,696 | 2.84375 | 3 | [] | no_license | export let formValidation = form => {
submitFormEvent__Form(form);
invalidFormEvent__Form(form);
clickButtonEvent__SubmitButton(form);
focusInputEvent__Field(form);
blurInputEvent__Field(form);
changeCheckableEvent__Field(form);
changeInputEvent__Criterion(form);
}
// --------------------- CORE FUNCTIONS --... | true |
9d9978833afdbfd3b50e9ae3977bdf9a72a2fbf7 | JavaScript | hhbbww/jszuopin | /wuziqi/index.js | UTF-8 | 4,195 | 2.546875 | 3 | [] | no_license | $(function(){
let start =$('.start');
let chong =$('.chong');
let renji =$('.renji');
let wanjia =$('.wanjia');
let hei={};
let bai={};
let baiqi =$('.baipi');
let heiqi =$('.heipi');
let kongbai ={};
let isAi ;
for(let i=0;i<15;i++){
$('<div>').... | true |
c5d8b21a2220793a76562b4b8b3468b72a32be1f | JavaScript | loociano/js-questions | /01-strings/01.js | UTF-8 | 2,265 | 4.5625 | 5 | [] | no_license | /**
* Problem 1.1
* Implement an algorithm to determine if a string has all unique
* characters. What if you cannot use additional data structures?
*
* Question I'd ask:
* - What is the character encoding? ASCII? Unicode?
* - Can the string be null? Empty? What if it's a number?
*
* Assumptions:
* - String... | true |
0b8d3af60f5106967fbf0d1d0ac1f3de90e0f40e | JavaScript | Steven-M-Carpenter/TrainTime | /assets/javascript/app.js | UTF-8 | 4,834 | 2.6875 | 3 | [] | no_license | //*********************************************************************************************/
// Set the Firebase project config
//*********************************************************************************************/
var config = {
apiKey: "AIzaSyCJtxuAtYnkRNcJZZbJkeCgZASVVTW6GgU",
authDomain: "home... | true |
8fa51a5f2fab0e41ccfcc7e222ba7cffdd7bfab2 | JavaScript | RXstoinkboy/bomberman | /src/js/Characters.mjs | UTF-8 | 11,294 | 2.953125 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | import {
Game
} from './index.mjs'
import {
VAR
} from './VAR.mjs'
Character.count = 0
export function Character (inheritance) {
Character.count++ // controlling how many characters have been generated
this.id = `char_${Character.count}` // setting specific id to each character
if (!inheritance) { // allow... | true |
4c27d86444467f218ec2cc5142cd8a969c2c3bf4 | JavaScript | thomas-chaigneau/country_game_server | /server/utils/utils.js | UTF-8 | 409 | 2.703125 | 3 | [] | no_license | exports.isGoodFormatNumber = (nb) => {
if (typeof nb === 'number') {
return nb;
}
if (typeof nb !== 'string') {
return false;
}
const withOutSpace = nb.split(' ').join('');
const isStringNumber = /^\d+$/.test(withOutSpace);
if (!isStringNumber) {
return false;
}
... | true |
1523f50572bfbe8eabfa53c942fa9865bb6ba6b1 | JavaScript | Manu974/projet6 | /web/js/printer/AlertTabPagePrinter.js | UTF-8 | 222 | 2.6875 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | $(function() {
$('td').each(function(){
var quantite = $(this).attr("data-remplacement");
if( quantite >= 3){
$(this).css('background-color', '#FAB861');
}
});
}); | true |
9caf3dffedeb73682cf604f9e7f2585abf148235 | JavaScript | Nez5557/goit-react-hw-03-phonebook | /src/App.js | UTF-8 | 2,399 | 2.6875 | 3 | [
"MIT"
] | permissive | import { Component } from "react";
import shortid from "shortid";
import ContactsList from "./Components/ContactsList/ContactsList";
import Form from "./Components/Form";
import Filter from "./Components/Filter";
import ListItem from "./Components/ContactsList/ListItem";
class App extends Component {
state = {
... | true |
6c962e437076bd811227f7a7adedcd7d4e2d6abb | JavaScript | ogabek96/ds-algo | /prime-numbers.js | UTF-8 | 420 | 4.09375 | 4 | [] | no_license | /**
* Prints prime numbers below n number.
* This program uses a sieve of Eratosthenes algorithm.
* This algorihm is fast and efficient.
*/
function primeNumbers(n) {
const a = [];
for(let p = 2; p*p <= n; p++) {
if(!a[p]) {
for(let i = p*p; i <= n; i+=p) {
a[i] = 1;
}
... | true |
6453840d2315186fbe0d35134d1932f5068ec889 | JavaScript | B-Tarik/fcc-projects_Technical-Documentation-Page | /mainContent.js | UTF-8 | 24,635 | 2.953125 | 3 | [] | no_license | import React from "react";
const Main = () => {
return (
<main role="main" id="main-doc">
<section role="region" className="main-section" id="Introduction">
<header role="banners"><h2 tabIndex="0">Introduction</h2></header>
<article role="article">
<p><strong>JavaScript</strong... | true |
1da1a34e58e4ad71ba0b8d81475468d78b7b5fdf | JavaScript | bt4R9/react-bubbles | /src/Bubbles.js | UTF-8 | 7,317 | 2.546875 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
import { List, fromJS } from 'immutable';
import { moveCaretToTheEnd, startBubbleEditing, endBubbleEditing, isBubbleEditing } from './selection';
import { isUniqueBubble, getNodeIndexOf, prepareContent } from './utils';
import BubbleRecord from './bubbleRecord';
import KEYCODES... | true |
60951d54e7e151d725b00cda8f27d65e1a075c5e | JavaScript | juancachangas/tic-tac-toe | /src/store/actions/board.js | UTF-8 | 1,110 | 2.546875 | 3 | [] | no_license | import store from '../index';
export const SET_MOVE = 'SET_MOVE';
export const SET_NEW_GAME = 'SET_NEW_GAME';
export const SET_STATUS = 'SET_STATUS';
export const WIN_CONDITIONS = [
[0, 1, 2],
[0, 4, 8],
[0, 3, 6],
[2, 5, 8],
[2, 4, 6],
[1, 4, 7],
[3, 4, 5],
[6, 7, 8],
];
export const setMove = posit... | true |
67bc359efff0b85739880ae8fe98ca2a8e29d578 | JavaScript | FireNeslo/fn-jade | /runtime.js | UTF-8 | 5,810 | 2.546875 | 3 | [] | no_license | (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('virtual-dom')) :
typeof define === 'function' && define.amd ? define(['virtual-dom'], factory) :
(global.vJade = factory(global.virtualDom));
}(this, (function (virtualDom) { 'use strict';
... | true |
716abf7cc744df0bea22ebd841a25a5c57fb8f75 | JavaScript | sidneyroberto/CPW4_2019_2 | /lista-compras/src/services/ListaService.js | UTF-8 | 1,209 | 3.109375 | 3 | [] | no_license | import axios from 'axios';
import itens from './itens';
const LIMITE_DE_ITENS_RETORNADOS = 5;
export default class ListaService {
constructor() {
this.listas = [];
this.api = axios.create({
baseURL: 'http://localhost:3001/listas'
});
}
async recuperarListas() {
... | true |
7746037e48017161572a25aad7fe4476a53121d2 | JavaScript | akrantz01/project-store | /frontend/src/components/Project.js | UTF-8 | 1,052 | 2.796875 | 3 | [
"MIT"
] | permissive | import React from 'react';
export const filterProject = (query, project) => {
return `${project.title.toLowerCase()} ${project.author}`.indexOf(query.toLowerCase()) >= 0;
};
export const highlightText = (text, query) => {
let lastIndex = 0;
const words = query.split(/\s+/).filter(word => word.length > 0).... | true |
7fd5b59ac93da1b4f04ba52e8c2c8902a86bfefd | JavaScript | hypertornado/svatba_fotky | /static/script.js | UTF-8 | 719 | 2.703125 | 3 | [] | no_license | $( document ).ready(function() {
if ($("#slideshow")) {
startSlideshow();
}
});
window.interval = 5000;
window.lastRequest = 0;
window.slideType = 0;
function startSlideshow() {
window.getImage();
window.setInterval("window.intervalCheck()", 1 * 100);
}
function intervalCheck() {
var now = Date.now();
... | true |