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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
443c491e62a366115899b9da04d1a8226436a995 | JavaScript | zyhmaple/infiniteMind1.0 | /infiniteMind1.0/WebRoot/js/native/dropdown.js | UTF-8 | 1,486 | 2.609375 | 3 | [] | no_license | //onload
$(function(){
//代理下拉菜单
if($('#agentList').length>0)
adrDropdown($('#agentList'),1);
//广告主下拉菜单
if($('#advertList').length>0)
adrDropdown($('#advertList'),0);
//平台类型
if($('#platTypeList').length>0)
platTypeDropdown($('#platTypeList'));
})
//agent Or advertiser 下... | true |
c1e83888c19968862dc9a95859d4cecef993a8e8 | JavaScript | ukarpenkov/JS | /react-simple — копия/projects/01-first-project/myreactapp/src/redux/profile-reducer.js | UTF-8 | 1,270 | 2.734375 | 3 | [] | no_license | import store from "./redux-store"
const ADD_POST = 'ADD-POST'
const UPDATE_NEW_POST_TEXT = 'UPDATE-NEW-POST-TEXT'
let initialState = {
posts: [
{ id: 1, message: 'Hi! How are you???', likesCount: 12 },
{ id: 2, message: 'You looking good!!!', likesCount: 386 },
{ id: 3, message: 'You look... | true |
a59831b6649aa6380ad21ab97c7a63ef04efc03b | JavaScript | sxiee/CS3200FinalProject | /src/main/webapp/react/product/product-list.js | UTF-8 | 1,525 | 2.515625 | 3 | [] | no_license | import productsService from "./products-service"
const {useState, useEffect} =React;
const {Link} = window.ReactRouterDOM;
const ProductList =() => {
const [products, setProducts]=useState([])
useEffect(()=>{
findAllProducts()
},[])
const findAllProducts = () => {
productsService.... | true |
09434c69e4dc55840229e074260810cd075e871f | JavaScript | alinacode17/mtw-postman | /js/script.js | UTF-8 | 1,471 | 2.75 | 3 | [] | no_license | fetch('https://29d89bd8-6bd3-4d00-a8f4-138eb4a1ef99.mock.pstmn.io/manifestoTest')
.then((resp) => resp.json())
.then((data) => {
// extract data from response
const {
header,
menu,
title,
footer,
body
} = data;
// remov... | true |
f190f0f4cecaee60d1373e7a47eb16142bbfb0df | JavaScript | Developerayo/relay | /packages/react-relay/classic/tools/__tests__/dedent-test.js | UTF-8 | 3,241 | 2.78125 | 3 | [
"MIT"
] | permissive | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @emails oncall+relay
* @format
*/
'use strict';
const dedent = require('../dedent');
describe('dedent()', () => {
describe... | true |
584f3094b6e9c52e7e168bf1b18bc06b18fa53d8 | JavaScript | dashakrolik/multiplayer-game | /client/src/components/games/ReadOnlyBoard.js | UTF-8 | 2,282 | 2.71875 | 3 | [] | no_license | import React from 'react'
import './Board.css'
import hitImg from '../../assets/miss-hit-splat.png'
import missImg from '../../assets/red-cross.png'
// import missImg from '../../assets/miss-hit-splat.png'
const renderCel = (makeMove, rowIndex, cellIndex, symbol, hasTurn, virusImage) => {
// console.log(rowIndex, cel... | true |
9d3ae7f5cca96c7afe62b9b6b128edea2b76691a | JavaScript | phatnguyenuit/FrontEnd-Masters | /from_fundamentals_to_functional_JS-V2/_.js | UTF-8 | 1,522 | 3.109375 | 3 | [
"MIT"
] | permissive | export const _ = Object.create(null);
_.each = (list, callback) => {
if (Array.isArray(list)) {
for (let [index, item] of list.entries()) {
callback(item, index, list);
}
} else {
for (let key in list) {
callback(list[key], key, list);
}
}
};
_.map = (list, callback) => {
const res ... | true |
0cd2925e57776ae74948a7b302f94dea43165ce3 | JavaScript | MelindaHasselbring/Assignment2 | /js/06-odd-or-even.js | UTF-8 | 398 | 4.65625 | 5 | [] | no_license | /*eslint-env browser*/
/*
Write a loop that will iterate from 0 to 15. For each iteration it will check if the current number is odd or even, and display a message in the console window.
Sample Output:
"0 is even"
"1 is odd"
"2 is even"
*/
for (i=1; i <= 15; i++) {
if (i % 2 === 0){
console.log(i + "... | true |
bd138047ffce494944d0a45b92eeca925033f2b5 | JavaScript | WilfridoPG/creadormemes | /platforms/android/assets/www/js/index.js | UTF-8 | 27,796 | 2.546875 | 3 | [] | no_license |
var app = {
// Application Constructor
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},
// deviceready Event Handler
//
// Bind any cordova events here. Common events are:
// 'pause', 'resume', etc.
onDeviceReady: funct... | true |
5def325c4fd7bdc4b829c05aca49f13391f04d3f | JavaScript | princebaretto99/Inertia_ByteCamp_2020 | /chatApp/www/capture.js | UTF-8 | 3,400 | 3.09375 | 3 | [
"MIT"
] | permissive | (function () {
// The width and height of the captured photo. We will set the
// width to the value defined here, but the height will be
// calculated based on the aspect ratio of the input stream.
// |streaming| indicates whether or not we're currently streaming
// video from the camera. Obviously, we start... | true |
a4461d67db88827088ac5ef64f7775a4181961f3 | JavaScript | Johansen512/terminredo | /src/Components/Search.js | UTF-8 | 986 | 2.75 | 3 | [
"MIT"
] | permissive | import { useState, useEffect } from "react";
import { useForm } from "react-hook-form";
const Search = () => {
const {register, watch} = useForm ();
const [users, setUsers] = useState(null);
const searchTerm = watch("search");
useEffect(() => {
fetch("https://jsonplaceholder.typicode.... | true |
2ca0fdda43d50c88ef0a48461c050332dda88162 | JavaScript | nkrowicki/intro-reactjs | /src/App.js | UTF-8 | 1,788 | 3.015625 | 3 | [] | no_license | import React from "react";
import Pagination from "./Pagination";
import Todos from "./Todos";
import Search from "./Search";
class App extends React.Component {
state = {
allTodos: [],
currentPage: 0,
itemsPerPage: 20,
filtered: [],
hasFiltered: false,
};
componentDidMount() {
fetch("... | true |
b293312c62baecd8e05c191edec871dacf9fbfb3 | JavaScript | quigleypage/quigleypage.github.io | /po/gptapi.js | UTF-8 | 4,514 | 2.671875 | 3 | [] | no_license | messageArray = [];
outputText = "";
featureDescriptionForDesignURL = "";
async function generateText(prompt, section) {
if(section == "userstory"){
document.getElementById("userInput").style.display = "none";
document.getElementById("sendButton").style.display = "none";
document.getElementB... | true |
231be091aca5b528ac127d752d38daaca0907784 | JavaScript | tbare598/rss_parser | /script-injector/download-form.js | UTF-8 | 4,610 | 2.546875 | 3 | [] | no_license | const HOST = window.localStorage.getItem('feed-matcher-host');
//TODO: ADD ABILITY TO DELETE FEED MATCHERS
//TODO: SAVE ALL EPISODE TORRENT LINKS
//TODO: ADD CHECKBOX TO LOAD PAST SHOWS
var currId = -1;
var divDownloadForm = document.createElement('div')
function addHTML() {
$(divDownloadForm).load(HOST + '/feed-... | true |
829dc4b48f4b8f42d86f4084a4f816b98d01ecae | JavaScript | Smashkat12/camagru | /rsc/js/index.js | UTF-8 | 951 | 2.8125 | 3 | [] | no_license | /* Check if a string is in lowercase */
function isLowerCase($str) {
return $str === $str.toLowerCase();
}
/* End Check if a string is in lowercase */
/* User Logout */
function userLogout() {
function functionResults(xmlhttp) {
window.location.assign("index.php");
}
globalPhpAjax("GET... | true |
0b116ab5d5dadeab4df9de40d1d3de237933e9b0 | JavaScript | isaza00/lahaus | /lahaus_api/public/scripts/admin.js | UTF-8 | 1,780 | 2.5625 | 3 | [] | no_license | const $ = window.$;
$(function () {
const searchParams = new URLSearchParams(window.location.search);
const token = searchParams.get('token');
const userId = searchParams.get('userId');
const url = 'http://localhost:3000/api/v1/users/' + userId + '/properties';
$('.title').text('Panel de Administración');
... | true |
a031a40efd472339dafaa0df92208cd0ac16b528 | JavaScript | shivabalasani/javascript-complete-reference | /assets/scripts/oop/oop-basics.js | UTF-8 | 2,823 | 4.34375 | 4 | [] | no_license | /*Classes & Instances
Objects Classes
----------------------------------------------------------------------------------------------------------------------------
1) “The things you work with in code” “Blueprints for ob... | true |
69a4e7acbbbc92d147d1305b2952afad35bbf56b | JavaScript | chintumathew/javascripting | /smartGarbage.js | UTF-8 | 350 | 3.21875 | 3 | [] | no_license | /*
program to increasing the garbage count for waste, recycling, or compost
depending on what trash is submitted.
*/
const smartGarbage = function (trash, bins = { waste : 0 ,recycling : 0,compost : 0 }) {
bins[trash]++;
return bins;
}
const result = smartGarbage('recycling', { waste: 4, recycling: 2, compos... | true |
fb514a629b27c66bc5a1f2f69899a990d17dbe58 | JavaScript | bgoonz/web-dev-notes-resource-site | /2-content/live-examples/js-examples/_all/math-atan.js | UTF-8 | 292 | 3.84375 | 4 | [
"MIT"
] | permissive | // Calculates angle of a right-angle triangle in radians
function calcAngle(opposite, adjacent) {
return Math.atan(opposite / adjacent);
}
console.log(calcAngle(8, 10));
// expected output: 0.6747409422235527
console.log(calcAngle(5, 3));
// expected output: 1.0303768265243125
| true |
2ca6dffae06956286a865922ebb7f2bc70967300 | JavaScript | sylnp0201/algorithm | /src/data-structure/priority-queue.js | UTF-8 | 1,629 | 3.484375 | 3 | [] | no_license | 'use strict';
const exch = require('utils/exch');
function Node(key, value) {
this.key = key;
this.value = value;
}
// MinPQ
function PQ() {
this.s = [null];
this.n = 0; // the length of the queue
this.keys = {};
}
PQ.prototype.isEmpty = function() {
return this.n === 0;
}
PQ.prototype.add = function(k... | true |
c45d0561f39dbf879b40d50bd36eb414d67c2375 | JavaScript | benforshey/FSU-WDD | /WIA/activities/9 CreateJS/1-Starting/js/Ellipse.js | UTF-8 | 285 | 2.5625 | 3 | [] | no_license | window.onload = function() {
// setup canvas, stage, and shape
var canvas= document.getElementById("canvas1");
var stage = new createjs.Stage(canvas);
var shape = new createjs.Shape();
// add to stage and update
stage.addChild(shape);
stage.update();
};
| true |
5a8d226c57bb3bacf2eec91997eaf9917b39375e | JavaScript | LinZap/node-g-search | /lib/node-pg-promise.js | UTF-8 | 1,603 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | 'use strict';
var pg = require('pg'),
util = require('util');
module.exports = {
connect: function(opt){
//postgres://user:password@host:port/database
var connStr = "postgres://"+opt.user+":"+opt.password+"@"+opt.host;
connStr+= ":"+(opt.port||5432)+"/"+opt.dbname;
if(this.client) pg.end();
return new... | true |
5244a7b7fb84787391287da9b3d2468fdb04c0f7 | JavaScript | 0-based/oudBackEnd | /src/services/album.service.js | UTF-8 | 14,857 | 2.546875 | 3 | [
"MIT"
] | permissive | const { Album } = require('../models/album.model');
const mongoose = require('mongoose');
const fs = require('fs').promises;
const AppError = require('../utils/AppError');
const _ = require('lodash');
/**
* A method that gets an album by it's ID
*
* @function
* @author Mohamed Abo-Bakr
* @summary gets an album
*... | true |
de64be446d370a05eca1963c934300c29a862288 | JavaScript | karevn/wp-media-selector-wrapper | /index.js | UTF-8 | 1,256 | 2.546875 | 3 | [] | no_license | /* global wp */
export default function(options) {
return new Promise((resolve) => {
options = Object.assign({
title: 'Select an image',
buttonText: 'Select',
multiple: false
}, options)
const state = wp.media({
title: options.title,
... | true |
e63508134d2550ce6f9eb1e8c1d63695c09b791c | JavaScript | omarvegaabreu/jsbootcamp | /basics/scope2.js | UTF-8 | 181 | 3.265625 | 3 | [] | no_license | // let name = "omar";
if (true) {
// console.log(name);
// let name = "other";
if (true) {
name = "jen";
console.log(name);
}
}
if (true) {
console.log(name);
}
| true |
d5c1563be6d93bb356d7031e2ec11cefbcf1d138 | JavaScript | xiaobxia/xiaobxia-js | /knowledgePoint/引用类型的问题/引用类型做参数.js | UTF-8 | 528 | 4.0625 | 4 | [] | no_license | function sayName(obj) {
obj.name="a";
}
var person={};
sayName(person);
alert(person);//"a"
//person仍被改变,但是这并不能说明参数是按引用传递的,其实它仍是按值传递的,但是obj对按引用来访问同一个对象
function setName(obj) {
obj.name="a";
obj={};
obj.name="b";
}
var person1={};
setName(person1);
alert(person1);//"a"
//原来的引用保持不变
//其实当obj重写时,这个变量引用就变成局部... | true |
aaebd3b6f270fcd4b0c7a8f155a77aba333375e9 | JavaScript | Tibzie/30DayChallenge-JavaScript-Vol1 | /Day 20/day20.js | UTF-8 | 525 | 3.90625 | 4 | [] | no_license | // In semantic versioning a piece of software can be represented in a format like this example: 6.1.12.
// Write three separate functions, one to retrieve each element in the semantic versioning specification.
function retrieveMajor(semver) {
return semver.split('.')[0]
}
function retrieveMinor(semver) {
return se... | true |
9daf201165f94628e8b990659d4d3336d2de9bad | JavaScript | glendis20/pokeApi | /assets/js/poke.js | UTF-8 | 1,463 | 3.328125 | 3 | [] | no_license | const API = " https://pokeapi.co/api/v2/pokemon";
const getData = (api) => {
return fetch(api)
.then((response) => response.json())
.then((json) => {
pintar(json);
})
.catch((error) => {
console.log("Error :", error)
})
}
const pintar = ... | true |
c788427326aab4eabf147de0c4d95fbc2138ce63 | JavaScript | lilian-wong/laptop_customizer | /src/App.js | UTF-8 | 2,678 | 2.703125 | 3 | [] | no_license | import React, { Component } from 'react';
// Normalizes string as a slug - a string that is safe to use
// in both URLs and html attributes
import slugify from 'slugify';
import './App.css';
//Feature
import Feature from './Feature';
import FeatureItem from './FeatureItem';
import {USCurrencyFormat} from './USCurrencyF... | true |
c65d96de5803606a86467f894af6eaaa771d683b | JavaScript | GauravChoudhay/DEV_PP | /Frontend/Module2_DOM/Lec5_pepCap/script.js | UTF-8 | 2,047 | 3.078125 | 3 | [] | no_license | let videoPlayer = document.querySelector("video");
let recordButton = document.querySelector("#record-video");
let photoButton = document.querySelector("#capture-photo");
let recordingState = false;
let constraints = {video:true};
let recordedData;
let mediaRecorder;
(async function(){
let mediaStream = await ... | true |
b53d19465f32bde692ab220336d8e1d1f881a335 | JavaScript | xiaolianwei/exercise | /utils.js | UTF-8 | 706 | 3.265625 | 3 | [] | no_license | const util = require('util');
// function foo(d) {
// return new Promise((resolve,rejects) => {
// setTimeout(() => {
// resolve(true)
// }, d);
// })
// }
// const bar = util.callbackify(foo);
// bar(3000,function(err,result){
// console.log(result);
// })
// function foo(del... | true |
e39911bb534eb6ccd2cadb3895f7d209f2b079a5 | JavaScript | abaturova/z2 | /z2_8.js | UTF-8 | 795 | 3.578125 | 4 | [] | no_license | let weekday = ['Понедельник','Вторник','Среда','Четверг','Пятница','Суббота','Воскресенье']
let nums = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]
let d = 0
let tab , a
document.write("<table border='1'>")
document.write("<tr>")
for(let w=0;w<weekday.length;w++){
doc... | true |
353b012444304306c0078e94db578655d8a1168b | JavaScript | ToughTiger/crm-front | /src/components/auth/signupForm.js | UTF-8 | 3,135 | 2.625 | 3 | [] | no_license | import React, {Component} from 'react';
import PropTypes from 'prop-types';
import './login.css';
class SignupForm extends Component {
constructor(props){
super(props);
this.state = {
name: "",
email: "",
password: "",
role: "",
... | true |
fb5d334d246b1811f1005c80f9c39c8fcd2e7ac5 | JavaScript | raymondchuu/To-Do-List | /App.js | UTF-8 | 1,914 | 3.234375 | 3 | [] | no_license | import React, { useState, useRef, useEffect } from 'react';
import ToDoList from './ToDoList';
import uuidv4 from 'uuid/v4'
function App() {
const [todos, setTodos] = useState([])
const todoNameRef = useRef()
const LOCAL_STORAGE_KEY = 'todoApp.todos'
useEffect(() => { // Function to load the Todos
const ... | true |
5cb0d3678ff7ec0d137bf534c0b5203903b07300 | JavaScript | jlcurty/photodump | /photodump.js | UTF-8 | 7,405 | 2.578125 | 3 | [] | no_license | /*
photodump.js -- A Firebase-backed photo sharing app.
By Alex Ose, alex@alexose.com
*/
$(document).ready(function(){
var hash = window.location.hash;
hash = hash.substr(1,hash.length);
var first = false;
if (hash === ""){
// Generate a new hash
// TODO: security
hash = window.... | true |
d1d9f673a045565486bfa7e8eca312ddd5f0b746 | JavaScript | zachlloyd01/DialogFlowBot | /server/routes/bot.js | UTF-8 | 1,297 | 2.546875 | 3 | [] | no_license | const dialogflow = require('@google-cloud/dialogflow');
const uuid = require('uuid');
const router = require('express').Router();
const projectId = 'dialogflow-test-306401'
const sessionId = uuid.v4();
// Create a new session
const sessionClient = new dialogflow.SessionsClient({
keyFilename: './key.json'
});
con... | true |
2ad8d5a916e88566e028d3cb8e1f2ccec1e079f3 | JavaScript | Daniel-Makram/restaurant | /shop/app.js | UTF-8 | 8,935 | 2.984375 | 3 | [] | no_license | //TODO
//add red colors when time is wrong
function SetTime() {
let date = new Date();
let time = (date.getHours()+1) + ':' + (date.getMinutes() < 10 ? '0' : '') + (date.getMinutes());
document.querySelector('.order--timer').textContent = time;
// console.log('updated at',time)
... | true |
c613d3cf5c685ce52ddbea5e6567b68e4bcd4e91 | JavaScript | MiZe1502/Leetcode | /42.counting_bits.js | UTF-8 | 529 | 4.03125 | 4 | [] | no_license | // Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1's in the binary representation of i.
/**
* @param {number} n
* @return {number[]}
*/
var countBits = function(n) {
let res = [];
for (let i = 0; i <= n; i++) {
let str = i.toStri... | true |
62adc6d342caa0074517f6df8e24b8cb9d776410 | JavaScript | robbykraft/Origami | /src/graph/splitEdge/update.js | UTF-8 | 11,455 | 2.984375 | 3 | [
"MIT"
] | permissive | /**
* Rabbit Ear (c) Kraft
*/
import math from "../../math";
import { makeVerticesToEdgeBidirectional } from "../make";
/**
* @description an edge was just split into two by the addition of a vertex.
* update new vertex's vertices_vertices, as well as the split edge's
* endpoint's vertices_vertices to include the ... | true |
e0e4def1d7622cd874c6c5a0a86daacaec7fa852 | JavaScript | damolew19/home-page | /src/components/quotes/Quotes.js | UTF-8 | 1,046 | 2.609375 | 3 | [] | no_license | import React from 'react';
import './Quotes.css';
import wikiIcon from './wikiIcon.png'
const quoteList = {
'Salvador Dali': '"Those who do not want to imitate anything, produce nothing."',
'Hal Boyle': '"What makes a river so restful to people is that it doesn\'t have any doubt - it is sure sure to get where it is ... | true |
68e2b04b3619a9f82fd2e6650736a375020c3412 | JavaScript | NataliiaHrymud/module-01-repeta | /src/index.js | UTF-8 | 2,824 | 2.71875 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
// import './index.css';
import App from './components/App';
// import * as serviceWorker from './serviceWorker';
// ReactDOM.render(
// <React.StrictMode>
// <App />
// </React.StrictMode>,
// document.getElementById('root')
// );
// const link =... | true |
261cfe7e41cd991c2584af497fb40e9574c16314 | JavaScript | MarchosiasM/CTCI-practice-problems | /chapter04/4.01 - Route Between Nodes/routeBetweenNodes.test.js | UTF-8 | 935 | 2.71875 | 3 | [] | no_license | const Graph = require('../util/Graph');
const checkRoute = require('./routeBetweenNodes.prac.5');
// const Queue = require('../util/Queue');
/* TEST */
const graph = new Graph();
graph.addNode('A');
graph.addNode('B');
graph.addNode('C');
graph.addNode('D');
graph.addNode('E');
graph.addEdge('A', 'B');
graph.addEdge('... | true |
bcb70b6d53173cbb74e5629fc9dd12711171b9a7 | JavaScript | Sybile/Spore | /src/game.js | GB18030 | 3,692 | 2.65625 | 3 | [] | no_license |
var GameLayer = cc.Layer.extend({
player: null,
ctor:function () {
this._super();
cc.audioEngine.playMusic(res.Music_bg, true);
this.init();
//Ӵ
cc.eventManager.addListener({
event: cc.EventListener.TOUCH_ONE_BY_ONE,
swallowTouches: true,
... | true |
354744e9669939f1d2c1d9ab081bec48ceafed8e | JavaScript | GaneshSrambikal/warmup_node | /utility_modules/os_modules.js | UTF-8 | 979 | 2.890625 | 3 | [] | no_license | /** Nodejs OS Modules
* os module provides some the operating system related functions.
* to import os module use syntax
* let os = require('os');
*/
let os = require('os');
let hostname = os.hostname();//return the hostname
let temp = os.tmpdir();//returns temporary folder of the system
let platform = os.platfor... | true |
916fc5356d21a3df2d33ae002f588f36d7cbb83e | JavaScript | luizcouto1/Assessoria | /src/main/webapp/js/usuario.js | UTF-8 | 2,086 | 3 | 3 | [] | no_license | var usuarios = [];
var perfils = [];
function buscarTodos() {
$.get("/usuarios", function(resposta){
usuarios = resposta;
atualizarTabela();
});
}
function atualizarTabela() {
for (i = 0; i < usuarios.length; i++){
var linha = $("#tabelaUsuario").append("<tr></tr>");
linha.append("<td>" + usuarios[i].nome ... | true |
dde79cc520e27009448e389915f7568f743d99aa | JavaScript | ABoklogov/JS-DZ | /DZ-6.js | UTF-8 | 13,134 | 4.375 | 4 | [] | no_license | // 2 - 6
// function filterArray(numbers, value) {
// const filteredNumbers = [];
// // Пиши код ниже этой строки
// numbers.forEach(num => {
// if (num > value) {
// filteredNumbers.push(num)
// }
// })
// // Пиши код выше этой строки
// return filteredNumbers;
//... | true |
57d1ce73a96b86768bb13e2753a7ba054caf4cb1 | JavaScript | jramos19-dev/intro-Vue3 | /main.js | UTF-8 | 1,127 | 2.96875 | 3 | [] | no_license | const app = {
// this is the hardcoded data that the application starts with
data() {
return {
title: "Jorge's Store Inventory App",
newProduct: "",
products: [
{
id: 0,
name: "PLaystation 5",
qty: 3,
},
{
... | true |
ec102e9c90e2b9181b97db9aef7848ab810957f6 | JavaScript | hamidurme09/s-calender | /src/CalendarDmo/CalendarLeft/Date/index.js | UTF-8 | 4,026 | 2.921875 | 3 | [] | no_license | import React from "react";
import moment from "moment";
import styles from "./WeekDay.module.css";
const WeekDate = ({
value,
calendar,
setSelectedDate,
setSelectedPrice,
}) => {
function isSelected(day) {
return value.isSame(day, "day");
}
function beforeToday(day) {
return moment(day).isBefor... | true |
047209cfadc4c0f8555c75c4fa4e8d456d483600 | JavaScript | soumiya98/Practice_MEAN | /Typescript_Basics/typescriptdemo/output/using.js | UTF-8 | 664 | 3 | 3 | [] | no_license | "use strict";
//export class frm myfirst
//import here
//so when executing this using.ts, first myfirst executes and then can use definitions present in that file
/*
import {Person} from './myfirst'
var p=new Person("sou");
console.log("Using import");*/
//tsc filename.ts --watch (For compiling like nodemon)
... | true |
512fb6a383a25e5912eb2a7d1a47cd605e6c7e45 | JavaScript | jycpark95/FullStack_Info_HW04 | /startercode_HW4_skeleton.js | UTF-8 | 3,729 | 2.796875 | 3 | [] | no_license | // changeTrack("https://soundcloud.com/hpstylez/50-cent-eminem-dr-dre-tupac");
// Event hander for calling the SoundCloud API using the user's search query
function callAPI(query) {
$.get("https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb",
{'q': query,
'limit': '200'},
functio... | true |
347edbfa5b0717d63a7d2661f531280f48a9716a | JavaScript | mohammed-io/jekyll-minifier | /test2.js | UTF-8 | 386 | 3 | 3 | [
"MIT"
] | permissive | ---
layout: js_minifier
---
'use strict';
const sdf = 5;
console.log(asd(3, sdf, 7));
let jgf = 'function(as, df, gf)';
if (jgf === 'function dwd (as, df, gh)')
{
console.log('Ура!');
}
function asd(ff, bg, ch)
{
return ff * bg + ch;
}
function hlk(hj, er)
{
return hj(er);
}
function wer(er)
{
return hlk(uio =... | true |
e2ea3dc663b1b0666b7ed5295121bc8e2f62d05b | JavaScript | lavishjain36/Lavishpfolio | /script1.js | UTF-8 | 1,816 | 2.90625 | 3 | [] | no_license | var modalInfo = {
1: {
title: "Project 1",
info: "...",
link: "#",
github: "#",
},
2: {
title: "Project 2",
info: "...",
link: "#",
github: "#",
},
3: {
title: "Project 3",
info: "...",
link: "#",
github: "#",
},
4: {
title: "Project 4",
info: "...."... | true |
b8ea67a582e0ed8b3e187ac891374cfbfcd22259 | JavaScript | core97/node-send-client | /services/file.js | UTF-8 | 837 | 2.671875 | 3 | [] | no_license | import { API_URL_BASE } from './settings';
const fromApiResponse = (apiResponse) => {
return apiResponse;
};
export function uploadFileAPI(data, token) {
const apiURL = `${API_URL_BASE}/files`;
return fetch(apiURL, {
method: 'POST',
headers: {
Authorization: token ? `Bearer ${token}` : '',
},... | true |
a82fd38322f25e2a95d3cc2e60f214e1c5503605 | JavaScript | sergimarquez/react-calendar | /src/components/Modal.js | UTF-8 | 1,720 | 2.515625 | 3 | [] | no_license | import React from "react";
import { format } from "date-fns";
class Modal extends React.Component {
render() {
var currentDate = format(this.props.date, "DD/MM/YYYY");
if (this.props.showModalReservation) {
return (
<div id="myModal" className="modal" onClick={this.props.closeModal}>
... | true |
1014c395fe019a0dd1a13b74f20902dfc3daf645 | JavaScript | koziscool/EJS_VirtualWorld_7 | /Ch7.js | UTF-8 | 4,654 | 3.203125 | 3 | [] | no_license | var plan = ["############################",
"# # # o ##",
"# #",
"# ##### #",
"## # # ## #",
"### ## # #",
"# ### # #",
... | true |
9a30317401161b07ae82fd5a1668c4db86fa17a0 | JavaScript | khayyamsaleem/quiplash-clone | /client/src/pages/games/TImer.js | UTF-8 | 755 | 2.828125 | 3 | [] | no_license | import React from "react";
const timer = () => {
return(
<div className="timer">
<p> Time Left: </p>
<Row>
<Col>
<button onclick="setTimeout(myFunction, 90000)">timer</button>
<script>
function myFunction() {
alert("time over");
}
</script>
</Col>
</R... | true |
850236ddfe32661137d183c74ad53aeaf5234187 | JavaScript | bry-an/data-structures-algorithms | /javascript/algorithms/hitCounter/hitCounter.js | UTF-8 | 695 | 3.125 | 3 | [] | no_license | class HitCounter {
constructor() {
this.hits = [];
}
record(timestamp) {
this.hits.push(timestamp);
}
total() {
return this.hits.length;
}
range(lower, upper) {
const inTheWindow = [];
this.hits.forEach(hit => {
if (lower < hit && upper ... | true |
1948e72f9139046a8899cd986a11b476ba1bf6cc | JavaScript | hlhielkema/flowchart | /updatedemo.js | UTF-8 | 319 | 2.625 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
function copyFile(from, to) {
fs.copyFile(from, to, (err) => {
if (err) {
throw err;
}
console.log(from + ' was copied to ' + to);
});
}
copyFile('dist/flowchart.js', 'docs/flowchart.js');
copyFile('dist/flowchart.css', 'docs/flowchart.css'); | true |
423cba0742e0c1fab4d83148259120c3d098c6f5 | JavaScript | viktoriachernykh/game-project-client | /src/hooks/usePlayer.js | UTF-8 | 2,172 | 2.875 | 3 | [] | no_license | import { useState, useCallback } from "react";
import { BOARD_WIDTH } from "../components/tetris/game-helper-files/createBoard";
import { checkCollision } from "../components/tetris/game-helper-files/collision";
import {
randomTetromino,
TetrominosTemplate
} from "../components/tetris/game-helper-files/tetrominos... | true |
a1edab32a90f71c50880a28b2fb485ebb11d4f9e | JavaScript | joansvich/vegetables-party | /js/block.js | UTF-8 | 744 | 3.265625 | 3 | [] | no_license | 'use strict';
class Block {
constructor(xInicio,xFinal,color,posY,canvas){
this.xInicio = xInicio;
this.xFinal = xFinal;
this.y = 10;
this.color = color;
this.posY = posY;
this.canvas = canvas;
this.ctx = this.canvas.getContext('2d');
this.blockBg = document.getElementById('block-bg')... | true |
09e245eb3f67d1cb5cc27c48040e89c9a5a69d21 | JavaScript | ichanol/smart-warehouse-backend | /server/src/services/readCSV.js | UTF-8 | 408 | 2.609375 | 3 | [] | no_license | const fs = require("fs");
const csv = require("fast-csv");
const readCSV = async (filePath) => {
const stream = fs.createReadStream(filePath);
const csvData = [];
const csvStream = csv
.parse()
.on("data", (result) => {
csvData.push(result);
})
.on("end", async () => {
csvData.shift()... | true |
a34255fdfb8b458bdfe0fe2ca0d9163f170269ed | JavaScript | leticiamayni/App-Lista | /app.js | UTF-8 | 1,759 | 3.296875 | 3 | [] | no_license | var listElement = document.querySelector('#app ol');
var inputElement = document.querySelector('#app input');
var buttonElement = document.querySelector('#app button');
var itens = JSON.parse(localStorage.getItem('list_itens')) || [];
function renderItens() {
listElement.innerHTML = '';
for (i of itens) { //F... | true |
8bbb06073dd8b7ab7abb298a64034737bbcfe6d0 | JavaScript | lendle1028/kdpadparser | /tools/BaseCommandParser.js | UTF-8 | 5,460 | 3.265625 | 3 | [
"Apache-2.0"
] | permissive | class BaseCommandParser extends AbstractCommandParser{
accepts(commandString){
return "設定"==commandString || "假如"==commandString ||
"又假如"==commandString ||
"否則"==commandString ||
"印出"==commandString ||
"主程式"==commandString ||
"重複"==commandString ||... | true |
3c3b128a9ddf833a38c2bdd19a774736c72554ae | JavaScript | anna-biruk/intro | /rect.js | UTF-8 | 2,723 | 2.953125 | 3 | [] | no_license | //const canvas = document.getElementById('canvas');
const RECT_CENTER_X = 610;
const RECT_CENTER_Y = 300;
let drawRect = (rect, color, thickness, H, W) => {
const y = RECT_CENTER_Y - (H / Math.sqrt(2));
const x = RECT_CENTER_X;
rect.y = y;
rect.x = x;
rect.grap... | true |
864d3f9fa1889c4925e60fae116ec1ca617e9f8b | JavaScript | DanyAdhiPrabowo/Simple-Notes-with-Rect-Native-Redux | /src/public/Redux/Reducer/notes.js | UTF-8 | 3,152 | 2.671875 | 3 | [] | no_license | const initialState = {
data : [],
// resultSearch : [],
isLoading : false,
isError : false,
totalPage : 0,
}
// create a reducer for getting network from Restfull API
export default notes = (state = initialState, action) => {
switch(action.type){
case 'GET_NOTES_PENDING': //in case when loading get d... | true |
2f0504844fffe91e5321425587be5fcf30f0b39b | JavaScript | JustinIsTheDamnMan/billboard_analysis | /test/Measure.js | UTF-8 | 7,206 | 2.6875 | 3 | [] | no_license | import _ from 'lodash'
import Measure from '../src/Measure'
import Note from '../src/Note'
const chai = require('chai')
chai.use( require('chai-subset') )
chai.should()
describe('The Measure', function() {
describe('parser', function() {
it('should retain raw input', function() {
let measureText = 'D:maj ... | true |
9a481714e111a4d3c31d9ade6a1943aef51091a8 | JavaScript | jekalazeykin/jsModule1 | /js/index.js | UTF-8 | 490 | 3.25 | 3 | [] | no_license | const a = 'qwertyuiop[]' ;
const b = 'asdfghjkl;\'' ;
const c = 'zxcvbnm,./' ;
const d = (a.length);
const e = (b.length);
const f = (c.length);
const l = (a.charAt(0));
const m = (a.charAt(11));
const n = (b.charAt(0));
const o = (b.charAt(10));
const p = (c.charAt(0));
const r = (c.charAt(9));
const j = (a.indexOf('[... | true |
23f197d506aa26661ea21b197dcf54b367257af1 | JavaScript | henrymg14/henry-minope | /src/app/hooks/useFetch.js | UTF-8 | 667 | 2.578125 | 3 | [] | no_license | import { useState, useEffect } from 'react';
import { getAll } from 'services/api';
const useFetch = (url) => {
const [ data, setData ] = useState([]);
const [ loading, setLoading ] = useState(true);
const [ error, setError ] = useState(null);
useEffect(() => {
const dofetch = async () => {
... | true |
de024b18dac39e8128c91011b373288ce3f9c8ef | JavaScript | ThaiSonP/finalAssesment | /Earworm_Report/backend/queries/favorites.js | UTF-8 | 2,191 | 2.515625 | 3 | [] | no_license | const db = require ('../database/index')
const getAllFavorites = (req,res)=>{
db.any(
'SELECT * '+
'FROM favorites '
).then(response=>{
res.status(200)
.json({
message: 'these are ALL THE favorites',
favorites:response
})
}).catch(err=>{
console.log(err)
})
}
const getFavor... | true |
0d4f880ab899a5100fe525a6c2ba3c3708a4933a | JavaScript | Datura35422/study | /react-demos/react-demo/src/components/transition/UseTransition.js | UTF-8 | 2,229 | 2.546875 | 3 | [] | no_license | import React, { PureComponent } from 'react'
import { CSSTransition, SwitchTransition, TransitionGroup } from 'react-transition-group';
import './style.css'
export default class UseTransition extends PureComponent {
constructor(props) {
super(props)
this.state = {
show: true,
... | true |
bf972c47a53683738422fefcbf8c683dd65f2f9c | JavaScript | IscoCuesta/casaCcuesta-tablet | /src/components/Opcion.js | UTF-8 | 1,994 | 2.546875 | 3 | [] | no_license | import React, {useState, useEffect} from 'react';
const Opciones = (props) => {
const [ opcion, guardaropcion ] = useState([]);
const {opcio , index, Selec, guardarSelec, guardarSelecion, guardaropciones} = props
useEffect(() => {
if(props == null){
return
}
guardaropci... | true |
ce4417f24bc22575d081f231806b6fe5743ad0a7 | JavaScript | HelloWorld017/museli | /app/src/utils/Vector2.js | UTF-8 | 815 | 3.203125 | 3 | [] | no_license | class Vector2 {
constructor(x = 0, y = 0) {
this.x = x;
this.y = y;
}
clone() {
return new Vector2(this.x, this.y);
}
add(vec2) {
this.x += vec2.x;
this.y += vec2.y;
return this;
}
subtract(vec2) {
this.x -= vec2.x;
this.y -= vec2.y;
return this;
}
multiply(scala) {
this.x *= scala;
t... | true |
417846291a675d51bec6362b11c1ce56272d2197 | JavaScript | Dirionz/nlpm | /src/store/read.js | UTF-8 | 1,425 | 2.765625 | 3 | [] | no_license | 'use strict'
var storage = require('../tools/storage')
exports.packages = (managers, callback) => {
if (!isArrayOfStrings(managers)) {
callback(new Error("Illegal Arguments"))
} else {
storage.get((err, json) => {
if (err) {
callback(err)
} else {
... | true |
4955ce1eff96a1700c1165d5e57a85915feee426 | JavaScript | taerikor/movie-review-app | /client/src/components/views/Commons/Like.js | UTF-8 | 3,881 | 2.59375 | 3 | [] | no_license | import React, { useEffect, useState } from 'react'
import { LikeOutlined,LikeFilled,DislikeFilled,DislikeOutlined} from '@ant-design/icons';
import axios from 'axios';
function Like({movie,movieId,commentId,userId}) {
const [likeAction,setLikeAction] = useState(false)
const [dislikeAction,setDislikeAction] = u... | true |
24f368f68e1a4e2ee9dcef8f70f2a7d0f864e9b7 | JavaScript | micromata/tec-talk-spa-coding-samples | /.postinstall.js | UTF-8 | 2,811 | 2.703125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env node
var exec = require('child_process').exec;
var fs = require('fs');
var versionNumber = getVersionNumber();
(function () {
console.log('Starting postinstall script.');
console.log('Needed to set up things to make sure the release tasks run properly:\n');
versionNumber = getVersionNumber();
cons... | true |
f5300bafb131b220277b55362b74dbc47f3be219 | JavaScript | MaxineSS/testing-react-redux-applications | /src/user/components/user_form.test.js | UTF-8 | 2,837 | 2.546875 | 3 | [] | no_license | import React from 'react';
import { shallow, mount } from 'enzyme';
import UserForm from './user_form';
describe('User form component', () => {
/**
* This is just a function that does nothing.
*/
const noop = () => {};
const baseProps = {
createUser: noop,
isCreatingUser: false,... | true |
d742733c6fba11c5f3d510bea908fc9e07a6a8c4 | JavaScript | tdrv90/softuni-courses | /05. JS for Front-End - March 2020/02. JavaScript Syntax - exercise/08. set values to indexes.js | UTF-8 | 333 | 3.734375 | 4 | [
"MIT"
] | permissive | function setValues(arr) {
let arrLength = Number(arr.shift());
let output = Array(arrLength).fill(0);
arr.forEach(line => {
let [index, number] = line.split(' - ');
output[Number(index)] = Number(number);
});
return output.join('\n');
}
console.log(setValues(['3', '0 - 5', '1 - 6'... | true |
80f84a7291dd6df6bd0965b651464d298829b591 | JavaScript | Markliebs/groupproject1 | /assets/js/app.js | UTF-8 | 1,823 | 2.703125 | 3 | [] | no_license | var countData = new Firebase("https://hangglider1.firebaseio.com/");
// Button to grab information
$("#submitSearch").on("click", function () {
// Grabs user input
var newOrigin = $("#orgCount").val().trim();
var newOrigin2 = $("#orgCount option:selected").text();
var newDest = $("#destCount").val().trim();
v... | true |
d66bb4995d495cd0b88a0b9e33578cf0b1a3f700 | JavaScript | Dubby20/iReporter | /api/controllers/userController.js | UTF-8 | 4,041 | 2.78125 | 3 | [
"MIT"
] | permissive | /* eslint-disable prefer-const */
import pool from '../models/database';
import {
generateToken,
hashPassword,
checkPasswordMatch
} from '../utils';
import {
errors
} from '../utils/errorHandler';
export default class UserController {
/**
* @description creates new user
* @static signup a user
* @... | true |
59468ea0648e4623601ba9b3b4ab6dbfd657bce3 | JavaScript | gamero1995/CS-213-Web-Engineering | /public_html/loanCalculator.js | UTF-8 | 1,884 | 3.453125 | 3 | [] | no_license | function calculatePayment(){
var apr1 = parseFloat(document.getElementById("apr").value);
var term1 = parseFloat(document.getElementById("term").value);
var amount1 = parseFloat(document.getElementById('amount').value);
if((apr1 >= 0 && apr1 <= 25) && (term1 >= 0 && term1 <= 40) && !isNaN(amount1))... | true |
5597c714c6db627faf75d89c2d22ca2027b5a790 | JavaScript | xiaolozhang/node_training | /day1/tcp/05_server_close.js | UTF-8 | 615 | 2.703125 | 3 | [
"MIT"
] | permissive | var server = require('net').createServer(function(socket) {
socket.pipe(socket);
});
server.listen(8000, function() {
console.log('server is listening');
});
server.once('close', function() {
console.log('server is closed');
clearInterval(interval);
});
/// Track connections
var count = 10;
var interval = set... | true |
47c56b18b487fe063d38c86fd480654d0d76a50e | JavaScript | petrikjan/adminlte-2-react | /src/components/Utilities.js | UTF-8 | 992 | 3.21875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license |
const splitIcon = icon => (icon ? icon.match(/^([fab|fas|far]*)-?(.+)/).splice(1, 2).filter(p => p.length > 0) : null);
const arrayEquals = (a, b) => {
if (a === undefined && b === undefined) {
return true;
}
if (a === null && b === null) {
return true;
}
// if the other array is a falsy value, r... | true |
b7a002a21d391135913ab5b08c884d78e2efe6f4 | JavaScript | 8pointers/tdd-in-javascript-exercises | /src/ex-2/3-exceptions.test.js | UTF-8 | 360 | 3.015625 | 3 | [] | no_license | const getName = playerJson => {
const player = JSON.parse(playerJson);
return player.name;
};
describe('Matching exceptions', function() {
it('should understand toThrowError', function() {
expect(getName('{"name": "Myamoto"}')).toBe('Myamoto');
expect(() => getName('{')).toThrowError(new SyntaxError('Une... | true |
d2f2d1bfd5c82aee860bff8226c404f27935354b | JavaScript | hh534602224/albx-project | /01app.js | UTF-8 | 1,821 | 2.5625 | 3 | [] | no_license | // 引入模块
const express=require('express');
const router=require('./02router.js')
const bodyParser = require('body-parser');
const session = require('express-session')//登录状态保持需要的
// 创建服务器
const app=express();
app.listen(8808,()=>{
console.log('http://127.0.0.1:8808');
})
// 把静态资源托管去服务器
app.use('/assets',express.stati... | true |
d252df1557cc7c35ac14182373bad917171843c3 | JavaScript | oniproject/proton | /src/behaviour/Force.js | UTF-8 | 527 | 2.515625 | 3 | [] | no_license | import Behaviour from '../Behaviour'
export default class Force extends Behaviour {
constructor(fx, fy, life, easing) {
super(life, easing)
this.force = this.normalizeForce(new Proton.Vector2D(fx, fy))
}
/**
* @override
*/
reset(fx, fy, life, easing) {
this.force = this.normalizeForce(new Proton.Vector2... | true |
2ecad9734ccc03e7b762a6d17387bcbed0bd5d81 | JavaScript | okashakhan4141/JavaScript-React-UseCases | /MAP.js | UTF-8 | 1,056 | 4.125 | 4 | [] | no_license | // Maps: Fundamentals
const rest = new Map();
rest.set('name', 'Classico Italiano');
rest.set(1, 'Firenze, Italy');
console.log(rest.set(2, 'Lisbon, Portugal'));
rest
.set('categories', ['Italian', 'Pizzeria', 'Vegetarian', 'Organic'])
.set('open', 11)
.set('close', 23)
.set(true, 'We are open :D... | true |
a14f30599422b936a153af7f8381f017b11761c4 | JavaScript | NateCham/OneSubAway | /static/application.js | UTF-8 | 3,814 | 2.515625 | 3 | [] | no_license | GeoLocation = Backbone.Model.extend({
getGeo: function() {
var promise = $.Deferred();
navigator.geolocation.getCurrentPosition(function() {
var p = arguments[0];
promise.resolve([p.coords.latitude, p.coords.longitude]);
});
return promise;
}
});
StopModel = Backbone.Model.extend({});
... | true |
3f8ba352f848e1ef900b3b89fbb8de9147825a1b | JavaScript | jodyisaguirre/g-reads-frontend | /src/components/Authors.js | UTF-8 | 644 | 2.546875 | 3 | [] | no_license | import React from 'react'
const Authors = ({authorsData}) => {
console.log({authorsData},'this is the one');
const authorsComponents = authorsData.map(author => {
return (
<div className="pageContainer">
<img className="authorImage" src={author.Portrait_URL} />
<div className="content">
... | true |
2eaef9d59faba8bd9eb383982120a842e594d900 | JavaScript | Holonium01/projectM | /helpers/responseHandler.js | UTF-8 | 425 | 2.53125 | 3 | [
"MIT"
] | permissive | exports.internalError = (res) => {
return res.status(500).send({
status: 'error',
message: 'Internal server error. Something went wrong.'
})
}
exports.send = (res, data) => {
const statusCode = data.statusCode || (data.status ? 200 : 400)
return res.status(statusCode).send({
statu... | true |
6dac502f9f9bc12709c13a6f1363f6cc66f91798 | JavaScript | AndradaDevelopers/andrada-js | /src/core/networking/netState.js | UTF-8 | 2,089 | 2.5625 | 3 | [] | no_license | /*
* Basic websocket wrapper
* Andrada.Core.Networking.NetState
*/
gamecore.Base.extend("Andrada.Core.Networking.NetState",
{
CONNECTING: 0,
OPEN: 0,
CLOSING: 2,
CLOSED: 3,
HEARTBEAT_DELAY: 20000,
},
{
websocket: null,
isClosed: true,
readyState: 3,
hearbeat: null,
delay: 80,
delayMax: 10000,... | true |
6a52bfb4638cc98feecda79c3396742d01e4146a | JavaScript | game7/secrets-out | /scripts/encrypt.js | UTF-8 | 1,173 | 2.515625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env node
const shell = require('../lib/shell');
const gitignore = require('../lib/gitignore');
const crypto = require('../lib/crypto');
const glob = require('glob');
const fs = require('fs');
shell(function() {
const settings = require('../lib/settings');
const password = set... | true |
99a8092fd87493b2ec7aa9ff69720243cd7bf23a | JavaScript | sebastiangr10/laboratorio1 | /ejercicio1/ejercicio1.js | UTF-8 | 676 | 3.21875 | 3 | [] | no_license | let calParcial;
let nota1;
let nota2;
let nota3;
let examen;
let trabajoFinal;
let calFinal;
nota1=Number (prompt("ingresa nota parcial 1"));
nota2=Number(prompt("ingresa nota parcial 2"));
nota3=Number(prompt("ingresa nota parcial 3"));
calParcial=parseInt((nota1+nota2+nota3)/3);
alert("lu calificación parcial es "+ c... | true |
07ed2f57de420a9c42e1a724a2c1d3c7fd839cfe | JavaScript | Pietrzi/kurs-node | /tydzien3/04_Middleware_i_routing/01_routing i middleware/calc.js | UTF-8 | 1,036 | 3.03125 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const operations = ['add', 'subtract', 'divide', 'multiply', 'modulo'];
router.get('/:num1/:operation/:num2', (req, res, next) => {
const num1 = parseInt(req.params.num1);
const num2 = parseInt(req.params.num2);
if (isNaN(num1) || isNaN(num2)... | true |
60893011ec26b0c784f437847dd9c0dc048673d0 | JavaScript | Cyph09/timestamp-api | /routes/api/timestamp.js | UTF-8 | 879 | 2.875 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
router.get("/api/timestamp/:date_string?", (req, res) => {
const dateString = req.params.date_string;
const utcDate = new Date(dateString);
const unixTimestamp = utcDate.getTime();
const timestapmInt = parseInt(dateString);
let timestamp =... | true |
a4b4ffc5f45d8aa1a8932410444967e0dd69990e | JavaScript | Jacquesmichelhache/travailpratique2 | /app/javascript/custom/customers/UI/edit_customer_form.js | UTF-8 | 2,682 | 2.71875 | 3 | [] | no_license | //Jacques 06-11-2020
import {showSnackBar} from '../../utility/snackbar'
import {sendAjax} from '../../ajax/ajax_calls'
export let editCustomerFormFactory = (function(){
//context static
return function(userParams = {}){
//private context
let defaultParams = {customer_id:-1, onCustomerChange:null}... | true |
6dff6ed86024d9f85b22a95ebf0f5e734d897e21 | JavaScript | bilalCatic/DRAOS2-osciloskop | /src/components/Oscilloscope/index.js | UTF-8 | 7,861 | 2.828125 | 3 | [] | no_license | import React, { PureComponent } from 'react';
import {Grid} from 'semantic-ui-react';
import Screen from "./components/Screen";
import VerticalControls from "./components/VerticalControls";
import HorizontalControls from "./components/HorizontalControls";
const W = 2*Math.PI;
const DELTA_T = 0.01; // 10ms
const REFR... | true |
d21231442316d7e7013ed7275d7e8679e9ff1c39 | JavaScript | GiuliaM/performance-matters | /week2/tmdb-api/sw.js | UTF-8 | 3,130 | 3.078125 | 3 | [] | no_license | var cacheName = 'v2';
var cacheFiles = [ //files that need to be cached
'/static/bundle.js',
'/static/style.css',
'https://fonts.googleapis.com/css?family=Alegreya+Sans:300,400,700'
]
self.addEventListener('install', function(event) {
console.log("[SW] Installed")
// the install event has to wait ... | true |
d8e2426f30fa2a4ddf84af143a5edfcbdfb7aace | JavaScript | m3ryck/AdonisJS | /todolist/app/Controllers/Http/TaskController.js | UTF-8 | 1,318 | 2.609375 | 3 | [] | no_license | 'use strict'
const Task = use('App/Models/Task')
const {validateAll} = use('Validator')
class TaskController {
async index({view}){
const tasks = await Task.all()
return view.render('tasks',{
title:'Latest tasks',
tasks: tasks.toJSON()
})
}
async store(... | true |
32ee1c818f28d2ae7831d7e2dacfbf55060320e2 | JavaScript | beliir/simple-fetch | /middleware.js | UTF-8 | 1,136 | 2.75 | 3 | [] | no_license | const querystring = require('querystring')
module.exports = (req, res, next) => {
req.url = querystring.unescape(req.url)
if (req.url.includes('задачи')) {
req.url = req.url.replace('задачи', 'todos')
}
switch (req.url) {
case '/todos/private-request':
const authToken = req.headers.authorizatio... | true |
b0c90561898000eca1a41b2262d1003618d777e4 | JavaScript | ginarm1/Parabrace | /public/js/articles-page.js | UTF-8 | 1,578 | 2.65625 | 3 | [] | no_license |
$(document).ready(function(){
let card = $(".card-article");
let cardEven = $(".card-article:even");
let cardEvenImg = $(".card-article:even img");
let cardEvenP = $(".card-article:even p");
let cardEvenBtn = $(".card-article:even a");
let cardOdd= $(".card-article:odd");
let cardOddImg=... | true |