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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
64c75aae2740c0b4f09641a0f47e2e34c01d0a9c | JavaScript | zengkan0703/review-fragment | /debounce-throttle/index.js | UTF-8 | 982 | 3.21875 | 3 | [] | no_license | // 防抖
function debounce(func, time, immediate) {
let timer;
let firstDone = false;
function debounced(...args) {
const context = this;
clearTimeout(timer);
if (immediate && !firstDone) {
func.call(context, ...args)
firstDone = true;
setTimeout(() => {
firstDone = false;
... | true |
cd1625e93121a2686c0718663eaa9ec2397d69b5 | JavaScript | qzw881130/study01 | /demo/props_03.js | UTF-8 | 810 | 2.65625 | 3 | [] | no_license | import React, {Component} from 'react';
import {Text, View} from 'react-native';
class Blink extends Component{
constructor(props){
super(props);
this.state = {showText: true};
setInterval(()=>{
this.setState(previousState => { showText: !previousState.showText})
}, 1000... | true |
0bf81b791782dbbdefd675f19aa2ccec58d6ba27 | JavaScript | lechcirmirakis/JS-workshop-and-exercises-from-CodersLab-bootcamp | /JS - Exercises/Day 4 - ex/6_DOM_create_elements/js/zadanie03.js | UTF-8 | 221 | 2.609375 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', function() {
var button = document.querySelector('a');
button.addEventListener('click', function(e) {
button.parentElement.removeChild(button);
});
});
| true |
cbfa1c64ac3e6ba67e5e48ad0b2cb70b08a6c8c3 | JavaScript | nimeshkumar90/yougrow | /sketch.js | UTF-8 | 2,065 | 3.546875 | 4 | [] | no_license | // Copyright (c) 2019 ml5
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
/* ===
ml5 Example
Webcam Image Classification using a pre-trained customized model and p5.js
This example uses p5 preload function to create the classifier
=== */
// Classifier Variable
let classif... | true |
5e75479b1fd23ab7b86c544510fd762a5b358f4c | JavaScript | viendong194/liquid-distortion | /src/blob.js | UTF-8 | 3,228 | 3.046875 | 3 | [] | no_license | export default class Blob{
constructor(){
this.container = document.getElementsByClassName('canvas-container')[0];
this.canvas = document.createElement('canvas');
this.canvas.width = window.innerWidth;
this.canvas.height = window.innerHeight;
this.container.appendChild(this.canvas);
this.ctx =... | true |
a8bf01e911d2d0bc1049018f70cd22ea1de2f13b | JavaScript | wofockham/sei-43 | /11-comp-sci/divide-and-conquer-sort-exercises/QuickSort.js | UTF-8 | 599 | 3.484375 | 3 | [] | no_license | function quickSort(arr){
if (arr.length <= 1) {
return arr;
}
const pivot = arr.pop();
// O(2N)
const lessThan = arr.filter(element => element < pivot);
const greaterThan = arr.filter(element => element >= pivot);
// TODO: use .reduce() O(N)
// O(N)
// const lessThan = [];
// const greaterTha... | true |
617c62370eed890df04aa3af99520a3827e36f70 | JavaScript | ingvardm/sleepy-tabs | /src/js/popup/style-utils.js | UTF-8 | 219 | 2.75 | 3 | [
"MIT"
] | permissive | export function buildClassName(classNames = []) {
const sanitized = classNames.reduce((all, className) => {
if (!!className) all.push(className)
return all
}, [])
return sanitized.join(' ')
} | true |
66dbbab86614929753abf294418e00531f740c37 | JavaScript | pashunechka/spinners | /front/e2e/steps/add-spinner.js | UTF-8 | 2,386 | 2.546875 | 3 | [] | no_license | const {Given, When, Then, AfterAll, BeforeAll} = require('cucumber');
const { expect, driver, By, until, host} = require('../../e2e.conf');
BeforeAll(async function () {
driver.get(host);
});
Given('I on the home page', async function () {
});
When('I enter {string} in name field', async function (name) {
return... | true |
13453333ff67c7557a0986ce8071ea5f5bec5071 | JavaScript | ronaldm003/proyectojavascript | /resources/js/PostRequest.js | UTF-8 | 5,488 | 2.609375 | 3 | [
"MIT"
] | permissive | function cargarPost(root) {
$.ajax({
url: root + '/posts',
method: 'GET'
}).then(function (data) {
let localStorage = window.localStorage;
let favPost = [];
let dbFavPost = localStorage.getItem('favPost');
if (dbFavPost != null) {
favPost = JSON.parse... | true |
ace3820f1e2e67117318ad6baddf9cf9f7a6e2b8 | JavaScript | beebee26/mars-rover-starter | /spec/command.spec.js | UTF-8 | 816 | 3 | 3 | [] | no_license | const assert = require('assert');
const Command = require('../command.js');
describe("Command class", function() {
//Test 1
it("throws error if command type is NOT passed into constructor as the first parameter", function() {
assert.throws(
function() {
new Command();
},
{
messa... | true |
dfad010df778a5b562256f6ce336b2d5d8dfc8ae | JavaScript | PaulBGD/Plein | /modules/shared/constants.js | UTF-8 | 300 | 2.796875 | 3 | [] | no_license | export const pointSize = /* 1 / */ 72.27; // point size compared to inch
export const pixelSize = /* 1 / */ 96; // pixel size compared to inch
export function pixelToPoint(px) {
return (px / pixelSize) * pointSize;
}
export function pointToPixel(pt) {
return (pt / pointSize) * pixelSize;
} | true |
471ce597fcf0522ef75afa4a9a2a739a9d515ba9 | JavaScript | FreelancerHridey/Pin-Master | /script/main.js | UTF-8 | 1,421 | 3.265625 | 3 | [] | no_license | document.getElementById('RandomBtn').addEventListener('click',function(){
var RandomNumber = Math.floor(1000 + Math.random() * 9000);
document.getElementById('RandomInput').value = RandomNumber;
})
function calculateDigitClickHandler(id){
const digit = id;
const oldDigit = document.getElementById('digi... | true |
08d3dc7863ba1d6d87853b7718ba965869cae551 | JavaScript | adarsh45/adarsh45.github.io | /js/script.js | UTF-8 | 1,201 | 2.65625 | 3 | [] | no_license | $(document).ready(function(){
// jQuery for onscroll change active class
let scrollTop, activeSection;
let sectionHomeOffsetTop = $('#home').offset().top;
let sectionAboutOffsetTop = $('#aboutMe').offset().top;
let sectionProjectsOffsetTop = $('#projects').offset().top;
let sectionEducationOffs... | true |
c5611f1fa0b60fe369469545a9e2f9d1619e0e3d | JavaScript | Piotr-Szyszkowski/fun_solo_katas | /__tests__/veg-counter.test.js | UTF-8 | 3,055 | 3.296875 | 3 | [] | no_license | const countVeg = require("../katas/veg-counter");
describe("countVeg", () => {
it ("Test 1 - returns error if invalid input", () => {
let actualOutput = countVeg(2, 3);
let expectedOutput = "Accepting only an array and a string!";
expect(actualOutput).toEqual(expectedOutput);
actua... | true |
21822262742a48dd2d4143a60b2f75807a8c485f | JavaScript | popok75/Espruinuity | /EspCode/project/modules/Add.js | UTF-8 | 1,328 | 3.15625 | 3 | [] | no_license | /* Copyright (c) 2016 MyName See the file LICENSE for copying permission. */
/*Playing with modules
Comments: Demo of a simple local module.
Dependencies: no other modules are required
Example of use code
var r = new (require("Add"))(1,2);
console.log(r.read());
*/
function Add(a,b) {
print(process.memory())... | true |
0be746215b7be613decb51a75897d441e1440072 | JavaScript | sp0ng3Bob/upsquareapp | /src/Recommended/Recommended.js | UTF-8 | 3,145 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
import './Recommended.css';
import $ from 'jquery';
class recommended extends Component {
constructor(props) {
super(props);
this.state = {};
}
componentDidMount() {
var auth = {headers: {'Authorization': '1234567890'}};
window.fetch('https://ap... | true |
1a2f5360758d34ee0224cc3f8b21f3e25bb151d7 | JavaScript | agermenos/questionnaire | /src/main/webapp/js/questionnaire_admin.js | UTF-8 | 6,441 | 2.59375 | 3 | [] | no_license | /**
* Questionnaire Administrator Form
* Adds, removes and updates questionnaires
* Developed by Alejandro Germenos
* Dublin, CA. Mar 21, 2015
*/
function QuestionnaireViewModel() {
var self = this;
self.id = 0;
self.nextId = function() {
if (!self.id) {
self.id = 0;
}
... | true |
dcde56c054fe5c4da19961f06ece7b3588334ce8 | JavaScript | SameerAlHarbi/maktabati-api | /src/controllers/maps.controller.js | UTF-8 | 1,591 | 2.546875 | 3 | [] | no_license | const mapsManager = require('../managers/maps.manager');
const modelMapper = require('../models/model-mapper');
exports.getAllMaps = async (req, res, next) => {
try {
const { names , author, size, mapId, mapType, fromYear, toYear} = req.query;
const results = await mapsManager.getAllMaps(names, a... | true |
6c6455f226d0f4da86ef5c2c6f21e0a23adf92b4 | JavaScript | spwhittaker/material-ui-practice | /src/Components/App.js | UTF-8 | 1,349 | 2.53125 | 3 | [] | no_license | import React, { Component } from "react";
import { Button } from "@material-ui/core";
import { Header, Footer } from "./Layouts";
import Exercises from "./Exercises";
import { muscles, exercises } from "../store";
class App extends Component {
state = { exercises, exercise: {} };
getExercisesByMuscles() {
re... | true |
63bbc164fb5e716167050f287bdb2cb23b1e9e87 | JavaScript | ccalvomartinez/nodepop | /lib/middlewareUtils.js | UTF-8 | 2,939 | 2.609375 | 3 | [] | no_license | // Util
module.exports.getFilter = function getFilter (req) {
// Consultamos la query string para obtener los fitros
const tag = req.query.tag;
const sale = req.query.sale;
const name = req.query.name;
const price = req.query.price;
const fields = req.query.fields;
let filter = {};
if ... | true |
3f6ab08b9a83d6a42c3c4c6412384d1d87535a4c | JavaScript | harismh/color-picker | /client/background.js | UTF-8 | 774 | 2.65625 | 3 | [] | no_license | // console.log('chrome extension is running')
// function injectedMethod (tab, method, callback) {
// chrome.tabs.executeScript(tab.id, { file: 'inject.js' }, function(){
// chrome.tabs.sendMessage(tab.id, { method: method }, callback);
// });
// }
// function getBgColors (tab) {
// // When we get a result ... | true |
c67580036c9221cc10029c813f794055a290ed30 | JavaScript | raurir/socket-maze | /client/view_overlay.js | UTF-8 | 1,841 | 2.6875 | 3 | [] | no_license | var overlay = function() {
function loadJSON(callback) {
var xobj = new XMLHttpRequest();
xobj.overrideMimeType("application/json");
xobj.open('GET', '/status/games', true);
xobj.onreadystatechange = function () {
if (xobj.readyState == 4 && xobj.status == "200") {
callback(xobj.res... | true |
dbdf86bee0d746de32eeebcda758f5745442a250 | JavaScript | yangxin1994/js-practice | /tree/practice.js | UTF-8 | 1,776 | 3.515625 | 4 | [] | no_license |
/**
* 练习题
*/
const BinaryTree = require('./tree.js')
const Stack = require('../stack/stack')
let bt = new BinaryTree()
bt.init_tree("A(B(C,D),E(F(G,),H(I,J)))")
//使用非递归的方式实现树的遍历方法
function in_order(node){
if(!node) return
let stack_ins1 = new Stack()
let cur_node = node
while(true){
while(cur_node){
stac... | true |
7877028a5f30bb4508b6c92351e155cb11318f2d | JavaScript | giancarlo88/js-calculator | /index.js | UTF-8 | 1,351 | 3.03125 | 3 | [] | no_license | var storage = 0;
var input = 0;
var lastOp = "";
var lastButton = "";
$(".operator").on("click", function () {
input = parseFloat($(".nums").val(), 10);
switch (true) {
case (lastOp === "+"):
storage += input;
break;
case (lastOp === "-"):
storage -= input;
break;
ca... | true |
4afdbf1ba4f0694e00b1199f7860e79bf1732fb6 | JavaScript | ngmsoftware/JSiDynamic | /help.js | UTF-8 | 2,441 | 2.6875 | 3 | [] | no_license | function help() {
showHelp($('#tableSystemParameters'), '\
In this block you can change all the parameters of the system. Use the sliders to change stuff like mass, friction, gravity, etc.\
',()=>{
showHelp($('#inputSelect'), ' \
Here you can select the input you want to use in the system.<br><br> Leave... | true |
3c3891af1e017f57ca532ba5395c1e4e8ca64731 | JavaScript | famedzeus/Uridium | /frameJS/frame-utils.js | UTF-8 | 16,033 | 2.59375 | 3 | [] | no_license | /* frameJS utils */
/**
*
* @type {{animationManager: {animationQueue: Array, animationInterval: null, animationCount: number, currentAnimation: number, ctx: null, start: frameUtils.animationManager.start, stop: frameUtils.animationManager.stop, killAnimation: frameUtils.animationManager.killAnimation, addAnimation:... | true |
0184c2b83453568ce4bb5ae025233647c1e03bee | JavaScript | maxim75/geospatialjs | /src/GpxTrack.js | UTF-8 | 2,648 | 2.5625 | 3 | [
"MIT"
] | permissive | /*
* Copyright (C) 2015 Maksym Kozlenko <max@kozlenko.info>
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
var GeospatialJS;
GeospatialJS = GeospatialJS || {};
(function (mod) {
"use strict";
mod.GpxTrack = function(trackXml... | true |
551f0f8cbcdaab432d51a01e970584acf0c46576 | JavaScript | CMahon92/js-deli-counter-js-intro-000 | /index.js | UTF-8 | 721 | 3.640625 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | function takeANumber(line,name) {
line.push(name);
return 'Welcome, '+ name+ '. You are number ' + line.length +' in line.'
}
function nowServing (katzDeliLine) {
var nobody;
if (katzDeliLine.length === 0) {
nobody = "There is nobody waiting to be served!"
}else{
nobody = "Currently serving "+ katzDeliLine[0... | true |
af8a063952a0180f63bc26758cd05184dba0404a | JavaScript | MattyMc/team-learning-typist | /matt/js-algos-data-structures/frequency_counter_pattern_2.js | UTF-8 | 1,342 | 4.375 | 4 | [] | no_license | "use strict"
// Pattern is excellent for comparing two arrays.
//
// Example
//
// Given two strings, write a function to determine if the second string is an anagram of the first.
function isAnagram(str1, str2) {
if (str1.length !== str2.length) return false;
// create a frequence hash
let frequencyHash... | true |
09724d5540a7b0e0df0ebf939090e907bbd66204 | JavaScript | namkiwook/WinterCoding | /server/controllers/todo.js | UTF-8 | 4,687 | 2.546875 | 3 | [] | no_license | let todoSchema = require('../models/todo')
let load = async (req, res) => {
try {
let todoList = await todoSchema.find({delete: false}).sort({priority: 1})
res.status(200).send(todoList)
} catch(err) {
if (err.name === 'MongoError') res.status(503).send({errorMessage: err.message})
else res.status(... | true |
a4b24b271aee4d7dfd97c5d3f98a9f05dbb786a4 | JavaScript | crappy-coder/astrid-inspector | /src/js/ui/Splitter.js | UTF-8 | 2,864 | 2.953125 | 3 | [] | no_license | import Control from "./Control"
import SplitterDirection from "./SplitterDirection"
class Splitter extends Control {
constructor(parent, direction, minValue, maxValue) {
super(parent);
this.direction = direction;
this.minValue = minValue;
this.maxValue = maxValue;
this.scre... | true |
b078f020fd7d741bdd6ab2e6db46f2ce870bfb1a | JavaScript | cleomarwebthomaz/novomonka | /app/Models/Hooks/CartProductHook.js | UTF-8 | 926 | 2.765625 | 3 | [] | no_license | 'use strict'
const CartProductHook = exports = module.exports = {}
CartProductHook.method = async (modelInstance) => {
}
CartProductHook.getTotalPrice = async (cartProduct) => {
cartProduct.total_price = getPrice(cart.toJSON())
}
CartProductHook.getAllTotalPrice = async (cartProducts) => {
cartProducts.map(... | true |
98eed82b5771ca6dc136ad64284f1a3754e560e6 | JavaScript | iBelando/gdgbot-back | /src/index.js | UTF-8 | 1,025 | 2.546875 | 3 | [] | no_license | // SECRETS
require("dotenv").config();
// Packages
const Discord = require("discord.js");
const client = new Discord.Client();
// FS
const { readdirSync } = require("fs");
// Commands collection
client.commands = new Discord.Collection();
// Commands
for (const file of readdirSync("./src/commands/")) {
if (file.en... | true |
7769fc5c1c869077b297efd8c623abb66425102a | JavaScript | spradh/freeCodeCamp | /Intermediate Algorithm Scripting/Diff Two Arrays.js | UTF-8 | 414 | 3.796875 | 4 | [] | no_license |
function diffArray(arr1, arr2) {
var newArr = [];
// Same, same; but different.
for(var i=0;i<arr1.length;i++){
if(arr2.includes(arr1[i])){
continue;
}else{
newArr.push(arr1[i]);
}
}
for(var j=0;j<arr2.length;j++){
if(arr1.includes(arr2[j])){
continue;
}else{
newAr... | true |
79048fc5b7334abc07cbc55d2b6e4a1151ce2107 | JavaScript | nagabhushanamn/react-in-cap | /7-eat-it-v4 ( http )/src/components/ItemList.js | UTF-8 | 748 | 2.6875 | 3 | [] | no_license |
import React, { Component } from 'react';
import Item from './Item';
import ItemApi from '../api/Item'
class ItemList extends Component {
state = {
items: [],
}
componentDidMount() {
ItemApi.get()
.then(response => response.data)
.then(items => {
... | true |
4816c9d2afb860f6d6c55d28aa42b043d61a615e | JavaScript | Dobby86/js-jq-ajax-grigliaquad | /bonus/my.js | UTF-8 | 2,966 | 2.84375 | 3 | [] | no_license |
// DESCRIZIONE:
// Griglia 6x6,
// ad ogni click (su ogni rettangolino) parte una richiesta AJAX che prende un numero random da 1 a 9 (primo end-point della API in slide).
// Se il num ritornato è <= 5 il quadrato diventa giallo,
// se è > di 5 il quadrato diventa verde.
// Il numero ottenuto appare al centro de... | true |
21f5bc23a102d38874b576937c0dd0f468a43ed2 | JavaScript | nashae/apiplatformreact | /assets/js/services/authAPI.js | UTF-8 | 1,348 | 2.703125 | 3 | [] | no_license | import axios from "axios";
import jwtDecode from "jwt-decode";
//suppression du token du local storage et d'axios
function logout() {
window.localStorage.removeItem("authToken");
delete axios.defaults.headers['Authorization'];
}
function setAxiosToken(token) {
axios.defaults.headers["Authorization"] = "Be... | true |
f352937685987ec688e7a09bcb94e0d5ce6596ea | JavaScript | JuliaShumeyko/18-JS30-adding-up-times-with-reduce | /script.js | UTF-8 | 908 | 3.640625 | 4 | [] | no_license | const timeNodes = [...document.querySelectorAll('[data-time]')]; // need to turn it into an array from nodelist in order to use map
const seconds = timeNodes
.map(node => node.dataset.time) // turning an array of items into an array of strings that we need
.map(timeCode => {
// console.log(timeCode.spl... | true |
04c32a8c6916046db1e4a2139a6f09f4492e5fe4 | JavaScript | samy-sah/DWD-portfolio-SamySah | /les03-04/js/scripts.js | UTF-8 | 1,491 | 2.90625 | 3 | [] | no_license | /**
* General script
*
*@author Samy Sah samy.sah@student.odisee.be>
*
*/
'use strict'
let van;
let filters;
let reset = function(){
van.classList.remove('gray', 'sepia', 'hue', 'blur' );
for (let filter of filters){
filter.classList.remove('active');
}
}
window.addEventListener('load', function(){
van = docu... | true |
9dc8cd8b4a2cfa702c2b05fa22ea13553cb59892 | JavaScript | pdhapke/SpringBootJPA | /target/classes/static/mainApp_controllers.js | UTF-8 | 2,664 | 2.546875 | 3 | [] | no_license | mainApp.controller('mainCtrl', function($scope, $http, anUpdateService) {
$scope.firstName= "John";
$scope.lastName= "Doe";
$scope.personAddress = "";
$scope.personCity = "";
$scope.personState = "";
$scope.personZip = "";
$scope.people = "/people";
$scope.name = function(){
retu... | true |
927faa6f2121de24e70aecfe85f3e4985793db30 | JavaScript | towc/aoc | /2019/day-3/sol.js | UTF-8 | 2,540 | 2.984375 | 3 | [] | no_license | // setup {{{
let aocInput;
{
const fs = require('fs');
aocInput = fs.readFileSync('input', 'utf-8');
}
const test = (fn, samples) => {
for (const i in samples) {
const [arg, expectedResult] = samples[i];
const actualResult = fn(arg, false);
const strExpected = JSON.stringify(expectedResult);
cons... | true |
b7100304d7be044653822cb0bc7902ef0909fbd5 | JavaScript | FernandoAltamirano/Amazon-clone | /src/components/Subtotal.js | UTF-8 | 983 | 2.578125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import "../styles/Subtotal.css";
import { useStateValue } from "./StateProvider";
const Subtotal = () => {
const [{ basket }] = useStateValue();
const [total, setTotal] = useState("");
const formatter = new Intl.NumberFormat("en-US", {
style: "currency",
... | true |
3d2b00a71557e936294b3bf7682b076079bd9812 | JavaScript | josephtawil/API-Image-Search-Bar | /app.js | UTF-8 | 1,516 | 2.953125 | 3 | [] | no_license | $(document).ready(function () {
var api_key = "5XFDXRG4rTtPCpIW60ETmDoiVZ3LP6CG";
var userInput = "";
$("#button").on("click", function (e) {
e.preventDefault();
userInput = $("#text").val();
console.log(userInput);
$("#userInput").val("");
$.ajax({
t... | true |
3b77f7b5f93d54503be19596da6ffce21c7a2590 | JavaScript | BhanuSaiKumarSV/DynamicFormBuilder | /base.js | UTF-8 | 7,964 | 3.125 | 3 | [] | no_license | var optionCount = 0;
var formData = []
validateData = (formData) => {
let options={};
const {name, type, required, order} = formData;
if (name=="" || order=="") {
return false;
}
switch(type) {
case 'number':
let minRange = document.getElementById("min-range").value;
... | true |
080bf8d2bd8c41d088be5f3cddd4e500aec2c9d5 | JavaScript | madarasz/keystroke | /main.js | UTF-8 | 2,502 | 3.328125 | 3 | [] | no_license | var startTime = Date.now(),
beingPressed = [], // contains keys currently being pressed: keycode, keyDownTimestamp
keystrokeLog = [], // contains keystrokes logged: keycode, keyDownTimestamp, keyUpTimestamp
mouseLog = []; // contains mouse movements logged: type (movement, buttonDown, buttonUp), x, y, t... | true |
20628c8a3d8262e6bedc7dce3312cddd097c8b04 | JavaScript | yilmazalp/Kodens | /staticfiles/compiler.js | UTF-8 | 1,252 | 2.546875 | 3 | [] | no_license | var spawn = require('child_process').spawn;
var compile = spawn('gcc', ['static/temp_files/temp.c']);
var fs = require('fs');
var inputFilePath = "C:\\Users\\User\\Desktop\\input.txt";
var filePath = "C:\\Users\\User\\Desktop\\output.txt";
var readStream = fs.createReadStream(inputFilePath, 'utf-8');
compile.stdout... | true |
b3cd31de89d3cb90a814d755bfca43e9ec1607f1 | JavaScript | YousefAliQ/MWA | /learningNG/Lecture3CreatingServer/patterns/pattern3.js | UTF-8 | 163 | 2.53125 | 3 | [] | no_license | function Course(){
this.courseName = 'CS572';
this.getCourseName = function(){
console.log(this.courseName);
}
}
module.exports = new Course(); | true |
5c0f18860bd24681e49002cba5ae828a34a360c4 | JavaScript | munxtwo/comp1911 | /week01/tay-kattie-lab-1a/lab01a.js | UTF-8 | 372 | 2.6875 | 3 | [] | no_license | document.images[0].src="cat.jpg";
var browserInUse = navigator.userAgent;
if (browserInUse.indexOf("Firefox") != -1) {
alert("What does the fox say?");
} else if (browserInUse.indexOf("Chrome") != -1) {
alert("Does Google really do any evil?");
} else if (browserInUse.indexOf("MSIE") != -1) {
alert("What is Bill Ga... | true |
d1e033a80c65ac1124837219e73f1bc4bb607edc | JavaScript | shehrozeasghar/js_completeAssignment | /Chapter 31-34 solution/app.js | UTF-8 | 4,664 | 3.28125 | 3 | [] | no_license | // //Task-1
// document.write("<br>Task-1<br><br>")
// var dateDay = new Date()
// document.write(dateDay)
// //Task-2
// document.write("<br>Task-2<br><br>")
// var monthy = dateDay.toLocaleString('default', { month: 'long' })
// document.write("Current Month: " + monthy + "<br>")
// //Task-3
// document.write("<br>... | true |
a450decaba5996731f953a50949d2157657becac | JavaScript | asifhjahid/Ecommerce-website-v2 | /js/script.js | UTF-8 | 2,144 | 2.578125 | 3 | [] | no_license |
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
let navBar = document.getElementById("navbar");
let navItem = document.querySelectorAll(".nav-link");
for(let i =0; i<navItem.length ; i++){
... | true |
d7a544a5ee7301d910c0b6bc042b3bb0ec562560 | JavaScript | logiclogue/knockout-tournament | /src/TournamentFacade.js | UTF-8 | 1,281 | 2.578125 | 3 | [
"MIT"
] | permissive | const RandomScheduler = require("../src/RandomScheduler");
const Tournament = require("../src/Tournament");
const Round = require("../src/Round");
const SortScheduler = require("../src/SortScheduler");
const SeedScheduler = require("../src/SeedScheduler");
const PairScheduler = require("../src/PairScheduler");
class T... | true |
358336ab473637a4a54e36efe886a453b584bb7f | JavaScript | acidtone/evolveu-c6-in-class | /w02d02-arrays-objects/5-fighter-object/guild.js | UTF-8 | 529 | 2.734375 | 3 | [] | no_license | const fighterName = 'Gus';
const fighterStrength = 8;
const fighterMoney = 'lots';
const bardName = 'Abdu';
const bardStrength = 4;
const bardMoney = 'not a lot';
const rogueName = 'Nikita';
const rogueStrength = 5;
const rogueMoney = 'a few coins';
const guild = [
{
class: 'fighter',
name: 'Gus',
stre... | true |
1b47ae16d6c429c210bcb701333c2b15a2e2fc2c | JavaScript | aron-ar/rick-morty-vanilla | /static/js/character.js | UTF-8 | 1,518 | 3.5625 | 4 | [] | no_license | export default class Character{
constructor({name, image, gender, species, status}){
this.name=name
this.image=image
this.gender=gender
this.species=species
this.status=status
this.$characterImageContainer=document.querySelector('#character-image-container')
t... | true |
02c8ffdfe71d71fb813e981ee68ad5418a877385 | JavaScript | cju5025/Family-Time-Website-Frontend | /cart.js | UTF-8 | 2,955 | 2.953125 | 3 | [] | no_license |
fetch('http://localhost:3000/cart_items')
.then(response => response.json())
.then(items => items.forEach(item => getItem(item)))
function getItem (item) {
fetch(`http://localhost:3000/items/${item.item_id}`)
.then(response => response.json())
.then(item => showItem (item))
}
const ... | true |
54a11816bfffe574f888604aaccc87a7fb56ba48 | JavaScript | PraKumSuk/Study_NodeJs | /node3_express_api_intro/demo1_get_api.js | UTF-8 | 1,538 | 3 | 3 | [] | no_license | const express = require('express');
const app = express();
// Setting up some courses data
const courses = [
{ id: 1, name: "aaa", cost: 100 },
{ id: 2, name: "bbb", cost: 200 },
{ id: 3, name: "ccc", cost: 300 },
{ id: 4, name: "ddd", cost: 400 },
];
// Health Check or a test Service
app.get('/', (re... | true |
250524ecce39ffb29c7c331e34c498edfb19f8c2 | JavaScript | ildaribragimov/Design_Patterns | /HTML5/landframe-v-1-0.ru/www/template/js/scripts.js | UTF-8 | 4,365 | 2.65625 | 3 | [] | no_license | "use strict"; document.addEventListener("DOMContentLoaded", function() {
/**
* Функция "getIndex" проверяет присутствует ли значение "needle" в массиве (коллекции) "haystack". Если присутствует, фугкция возвращает в качестве результата ключ найденноо элемента в искомом массиве (коллекции)
*/
function getIndex(c,b){fo... | true |
871f09225ba4fb18c0602800d1a067082f0f5e56 | JavaScript | audibailey/cab230-stocksserver | /routes/stocks/stock.js | UTF-8 | 966 | 2.53125 | 3 | [] | no_license | module.exports = function (req, res) {
// Ensure there are no parameters
if (Object.keys(req.query).length > 0) {
res.status(400).json({ error: "true", message: "Date parameters only available on authenticated route /stocks/authed"})
} else {
// Fetch stocks
req.db.from('stocks')
.select('*')... | true |
c49c989234cc71a11173fe08000af15f84483fc2 | JavaScript | cs-education/sugarcub3d-backend | /routes/index.js | UTF-8 | 1,970 | 2.765625 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var mongoose = require('mongoose');
var Problem = mongoose.model('Problem');
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
/* get request for list of all problems */
router.get('/problem... | true |
47f23e9da6d2f085edc51a68331db4d4a1053b77 | JavaScript | GreenPomelo/pstorage | /src/index.js | UTF-8 | 7,311 | 2.515625 | 3 | [
"MIT"
] | permissive | import mpMap from './mpMap';
export default class Storage {
_nativeMethods = {};
_runTimeCaches = {};
_keys = [];
constructor(props) {
const { target, keys, adapters = {} } = props;
if (!(target && typeof target === 'object')) {
throw new Error('Storage target is invaild!');
} else {
... | true |
66ae7308c66312f4c8176b4c937b325483cf4510 | JavaScript | Mary302/Angularr | /server/controllers/cartItems-controller.js | UTF-8 | 3,243 | 2.578125 | 3 | [] | no_license | const cartItemsLogic = require("../logic/cartItems-logic")
const express = require("express");
let usersCache = require("../dao/cache-module");
const router = express.Router();
router.post("/", async (request, response, next) => {
//extracting the token from the req.headers so we cann access usersCache for detail... | true |
5cafdd43a84edd571c315b176329bad1cf3c9144 | JavaScript | Grozy/node.js-sng | /lesson-4/js-obj.js | UTF-8 | 1,458 | 3.859375 | 4 | [] | no_license | function Animal(name) {
this.name = name;
this.type = "animal";
this.printName = function() {
console.log(name);
}
}
function Human(name) {
this.name = name;
this.type = "human";
this.printName = function() {
console.log(name);
}
}
// Human.prototype.kind = "human";
Human.prototype = Animal;
A... | true |
01687907eacdbe47008680a865f0bd0703ada829 | JavaScript | fanta12138/sstk | /client/js/lib/ui/LabelsPreviewPanel.js | UTF-8 | 7,459 | 2.546875 | 3 | [
"MIT"
] | permissive | const AssetLabelMods = require('annotate/AssetLabelMods');
class LabelsPreviewPanel {
constructor(params) {
this.container = $(params.container);
this.gridWidth = params.gridWidth || 100;
this.componentId = params.componentId || 'preview';
this.groupByLabels = params.groupByLabels; // Whether to grou... | true |
c0863d70e353ea36b6a85be293109142f983769a | JavaScript | mrbazzik/SmallProjects | /WebServer/ReadStream.js | UTF-8 | 365 | 2.609375 | 3 | [] | no_license | var fs= require ('fs');
var stream = new fs.ReadStream('server.js', {encoding: 'utf-8'});
stream.on('open',function(){
console.log('open');
});
console.log('test');
stream.on('readable', function(){
console.log('redable');
console.log(stream.read());
});
console.log('test1');
stream.on('end', function(){
co... | true |
a3ed40ecad81d25ee935619ad6ddbf848b77ca0b | JavaScript | srragha/projecteuler | /problem-7-10001st-prime.js | UTF-8 | 743 | 4.03125 | 4 | [] | no_license | function nthPrime(n) {
// Good luck!
var index = 0;
var nthPrime1 = 2;
var nextNum = 2;
var isPrime = true;
while (index <= n) {
isPrime = checkPrime (nextNum);
if (isPrime) {
index ++;
nthPrime1 = nextNum;
}
nextNum = nextNum + 1;
// console.log ("Index =>"+index, "Next num ... | true |
78a0837f8c2a2861ccc0d90a80139afaefee85a5 | JavaScript | rperez2021/bitchin-kitchen | /api/yummly.js | UTF-8 | 1,614 | 2.609375 | 3 | [] | no_license | const axios = require("axios")
module.exports = {
pagination: ( query = '', page = '', cb) => {
const APP_ID = '24c4796b';
const APP_KEY = 'd781e3e92499c596ed81d523cb4ff29f';
pageNum = (page-1)*10+1;
let queryParams = {
_app_id: APP_ID,
_app_key: APP_KE... | true |
96b3cfd50ba20736e581dee03e440a5a15c58364 | JavaScript | laetitiaphimmasane/api-rest-justify-text | /index.js | UTF-8 | 2,153 | 2.890625 | 3 | [] | no_license | // Instanciation de l'objet qui va contenir notre serveur
var express = require('express');
var app = express();
//Gestion du token
var jwt = require('jsonwebtoken');
var privateKey = "foJIJDSO\nIofjeoieG14FHHFy\n";
//Gérer de la lecture des body
const bodyParser = require('body-parser');
app.use(bodyParser.urlencod... | true |
dceb9937ddcfadeb71f81221dd9c0040ad9d1953 | JavaScript | bMedarski/Telerik | /Javascript/Basic/04. Operators and Expressions/01. Odd or Even.js | UTF-8 | 179 | 3.390625 | 3 | [] | no_license |
function Solve(args){
let input = args[0]*1;
if(input%2===0)
{
console.log('even '+input);
}
else
{
console.log('odd '+ input);
}
}
| true |
d9374f4bbc90ddb6cccf5da8cc894e05bd208972 | JavaScript | denakrz/landingPage | /LUG3WebApi/wwwroot/script/script_postulant_view.js | UTF-8 | 6,593 | 2.8125 | 3 | [] | no_license | window.onload = getjson();
window.onload = getState();
window.onload = getMet();
function getQuery() {
//A = Query completa
//B = Lo que queres eliminar
//getDiff Diferencia
//C = Se queda con el numero
const query = window.location.search;
const A = String(query);
const B = "?postId=";
... | true |
c872c7a0dff90b021937c291a1b668da8c6ae349 | JavaScript | int-ressant/int-blog | /client/int-blog/contexts/authContext.js | UTF-8 | 1,818 | 2.640625 | 3 | [] | no_license | import { createContext, useContext, useEffect, useState } from "react";
import Cookies from 'js-cookie'
export const AuthContext= createContext([]);
export function AuthProvider({children}){
//dados e funcoes
let guest={id:'',type:'Guest',username:''}
const [isLogged,setIsLogged]=useState(null);
co... | true |
4d7239e80621490024792c716bbbef8bfd6220db | JavaScript | fjames003/Computer_Graphics | /nanoshop-filters/nanoshop-neighborhood.js | UTF-8 | 7,549 | 3.203125 | 3 | [] | no_license | /*
* This is a very simple module that demonstrates rudimentary,
* pixel-level image processing using a pixel's "neighborhood."
*/
var neighborTotals = function (includeMiddle, rgbaNeighborhood) {
var neighborTotal = {
"r": 0,
"g": 0,
"b": 0,
"a": 0
};
... | true |
5e46555c0ee7cbbe235eb7a39ef4eadc2c763472 | JavaScript | yuzheng38/cs6083 | /web_server/client/src/UserPlaylist/UserPlaylist.js | UTF-8 | 4,379 | 2.71875 | 3 | [] | no_license | import React from 'react';
import { Link } from 'react-router';
import './UserPlaylist.css';
import Auth from '../Auth/Auth';
/*
UserPlaylist maintains all the playlists belong to a particular user
*/
class UserPlaylist extends React.Component {
constructor(){
super();
this.state = {
userName: '', // t... | true |
55787b7c36b8ac31c5fb1e1b3159bb703590fcfd | JavaScript | richcompute/bitgirlcoin | /src/EmotionImage.js | UTF-8 | 1,428 | 2.796875 | 3 | [] | no_license | import React, { Component } from 'react';
import moment from 'moment';
import './EmotionImage.css';
class EmotionImage extends Component {
constructor(props) {
super(props);
this.state = {
image: null
}
}
/**
* Returns a random integer between min (inclusive) and max (inclusive)
... | true |
fabee5d867b5e2e76f98ec01f0a4ba88c5b103a0 | JavaScript | alaminsahed/cart-page | /main.js | UTF-8 | 2,250 | 3.3125 | 3 | [] | no_license | const cardElement = document.querySelector(".card-container");
const cartElement = document.querySelector(".cart-products");
const priceElement = document.querySelector(".total-price");
//fetch data to show in UI
const fetchData =()=>{
data.forEach((product)=>{
cardElement.innerHTML += `
<div class... | true |
80eadbf2dbb81719d490765f72de9484876c7893 | JavaScript | kirkstrobeck/pusher | /pusher.js | UTF-8 | 1,150 | 2.53125 | 3 | [] | no_license | /* global $, make_glif */
(function (window, $, make_glif) {
'use strict';
window.pusher = window.pusher || {};
window.pusher.render = render;
return;
function render (next) {
var i = 0;
$('[data-pusher]').each(function () {
i++;
var $this = $(this);
$this.attr('src', createGif(
... | true |
ed9e5bc1b88384201ee3e3a676cea8060af010f5 | JavaScript | Qux/2007_DIYMUSIC | /Hub/main.js | UTF-8 | 704 | 2.53125 | 3 | [] | no_license | 'use strict';
const Listen_Port = "SET PORT";
const io = require("socket.io").listen(Listen_Port);
//const server = io.listen(Listen_Port);
const broadcastInfo = () => {
const data = {
"connections": io.engine.clientsCount
};
io.emit("info", data);
}
io.on("connection", (socket) => {
consol... | true |
f7280d03fa40b4ab56f2e44f5d0102874c19f050 | JavaScript | 707Plushka707/trading-test | /funds.js | UTF-8 | 2,472 | 2.703125 | 3 | [] | no_license | const { getPrettyDatetime } = require('./utils/date');
const { exportData, removeFile } = require('./utils/file');
const BASEASSET = 100;
class Funds {
#outputFileName = "";
currentLong = null;
currentShort = null;
totalWin = 0;
constructor(outputFileName) {
this.outputFileName = o... | true |
7bacd934f4213c5d0ce8cbce76aa7888fc60c7b8 | JavaScript | ligengwasd/node-test | /helloword.js | UTF-8 | 237 | 2.609375 | 3 | [] | no_license | var http = require('http');
http.createServer(function(req,res){
res.writeHead(200,{'Content-Type': 'text/html'});
res.write('<h1>Node.js</h1>');
res.write('<p>Hello word</p>');
}).listen(3000);
console.log("dcdlkf nvfb");
| true |
29e3857cdafcdd420438257c39975a94b432d949 | JavaScript | jennyjean8675309/rps_frontend | /src/Components/RoundTwo.js | UTF-8 | 5,041 | 2.578125 | 3 | [] | no_license | import React, {Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { Button, Grid } from 'semantic-ui-react';
import { setCombinedDeck, roundTwoComputerDeal, roundTwoPlayerDeal, addSoldierOrUpgradeToPlayersHand, removeSoldierFromPlayersSecondDeal, computerSel... | true |
d89fcb0f1532226da2fab302b6fb8df5ea3c4026 | JavaScript | Vxee/leetcode | /566_Reshape_the_Matrix.js | UTF-8 | 472 | 2.796875 | 3 | [] | no_license | var matrixReshape = function(nums, r, c) {
var x = nums.length,
y = nums[0].length,
list = [],
arr = [],
count = 0;
if(x*y != r*c) return nums;
for(var i = 0; i < x; i++){
for(var j = 0; j < y; j++){
arr.push(nums[i][j]);
}
}
for(var i = 0;... | true |
42a6c06774a2568bb60a93abe576ce3838702fcc | JavaScript | MasterGroupBox/tictactoe | /index.js | UTF-8 | 5,804 | 3.34375 | 3 | [] | no_license | // Au click lancer fonction selon le mode sélectionné parmi 3 modes
// Uncomment de mode that you'd like to run
for(let i=1; i<=9; i++){
//Mode 1 : 2 joueurs
// document.getElementById("p"+i).addEventListener("click",function(){xo(i-1)});
//Mode 2 : AI imbattable | Pas encore au point
docum... | true |
b44b065b166c580dc1d6afe1692e675ec565aab2 | JavaScript | llf-553/react-note | /src/components/layout/Main.js | UTF-8 | 1,477 | 2.609375 | 3 | [] | no_license | import React from 'react'
import routes from '@/views'
import {
Route,
Switch,
Redirect
} from 'react-router-dom'
export default props=>{
//Route是那把椅子
// 生成路由匹配规则,当url和Route.path匹配成功,显示当前配对成功的Route.component
// 凡是被 Route 组件直接包裹的React组件中,其props上都有路由相关的 API
const createRoutes = ()=>{
let ... | true |
6c5a5c2600a7f56eee866c3618a06341a77dd05a | JavaScript | Eseoghene/protractor-POM | /helpers/actions.js | UTF-8 | 6,655 | 2.625 | 3 | [] | no_license | var val = require('./validations');
module.exports = {
clickelement: function (element, label) {
elempresent(element, label);
element.click().then(function () {
console.log(label + " is clicked")
});
},
sendkeys: function (element, label, text) {
elempresent(eleme... | true |
2b58cae0aacc79a1a3a84ce869608d07830a1e1a | JavaScript | maryamMmohamed/java-script-project | /js/form.js | UTF-8 | 5,470 | 2.796875 | 3 | [] | no_license | var signUp = document.querySelector('.sign-up');
var reg = document.querySelector('.reg');
var login1 = document.querySelector('.login1');
signUp.addEventListener("click", function(){
reg.classList.toggle("regopen");
});
login1.addEventListener("click", function(){
reg.classList.remove("regopen");
});
////////////... | true |
1a714f0eedfc48555b7481e32ed8f518a96b7102 | JavaScript | DarrenPaulWright/hord | /src/utility/searchers/scanSearchRight.js | UTF-8 | 305 | 2.609375 | 3 | [
"MIT",
"JSON"
] | permissive | export default (array, item, comparer, isInsert = false, high = array.length - 1) => {
let diff = 0;
for (let index = high; index > -1; index--) {
diff = comparer(array[index], item);
if (diff === 0) {
return index;
}
if (diff < 0) {
return isInsert ? index : -1;
}
}
return -1;
};
| true |
0fd6079f16a4021ae770c084d3aee8ee2c1a9cee | JavaScript | RaulAbreu/NodeASDx | /BackOffice/users.js | UTF-8 | 3,907 | 2.59375 | 3 | [] | no_license | ///////////////////////////////////////////////////////
//
// Paulo Gandra de Sousa, Alexandre Bragança
// PSIDI / MEI / ISEP
// (c) 2014
//
///////////////////////////////////////////////////////
//
// a node module to handle the /user/ resource and the /photo/ subresource
//
/************/
// data
/************/
/... | true |
b4fb949fde390862a79a89a07fbccd8314d88f47 | JavaScript | pepdbm7/skylab-bootcamp-201809 | /stuff/es6/lexical-this.js | UTF-8 | 538 | 3.421875 | 3 | [] | no_license | const logic = {
extractNames(persons, callback) {
const names = persons.map(person => person.name)
callback(names)
}
}
const view = {
drawNames(names) {
names.forEach(name => console.log(name))
},
drawPersons(persons) {
// logic.extractNames(persons, function (name... | true |
260a828422d02b41b4384bd01b72f0923b097f0b | JavaScript | tornadory/tornadory.github.io | /webar/js/app.js | UTF-8 | 4,364 | 2.65625 | 3 | [] | no_license | const webAR = new WebAR(1000, 'recognize.php');
const threeHelper = new ThreeHelper();
var rotX = 0;
var rotY = 0;
var rotZ = 0;
var initFunc = function () {
const videoSetting = {
width: 480,
height: 360
};
const video = document.querySelector('#video');
const videoDevice = document.... | true |
ad9c10e7ca2f6679bb0040cd3442d6e6f7d168f3 | JavaScript | hankolsen/advent-of-code | /2020/03/solve.js | UTF-8 | 449 | 2.890625 | 3 | [] | no_license | #!/usr/bin/env node
const { getRows } = require('../../utils');
const { findTrees, findMultipleTrees } = require('./findTrees');
const solve1 = () => {
getRows()
.then((rows) => {
console.log(`Part 1: ${findTrees(rows)}`);
})
.catch((err) => console.log(`There was an error\n${err}`));
};
const so... | true |
fc469bd64cbe324bf449967bf4d24a5dc9293a9e | JavaScript | richigro/Cyberpunk2077Quiz | /index.js | UTF-8 | 3,033 | 3.59375 | 4 | [] | no_license | //refactor code to make more readable
// adds a view to the app
function addView(view){
$(".js-app-container").append(view);
}
// renders the start page to app
function renderStartPage() {
addView(startPage());
}
// remove elements from current view
function removeLastView(){
$(".js-app-container").children()... | true |
e2756910953e11e34b8532fb991e26bd1399323f | JavaScript | bencalabrese/ajax_twitter | /frontend/tweet_compose.js | UTF-8 | 750 | 2.765625 | 3 | [] | no_license | function TweetCompose(form) {
this.$form = $(form);
this.$form.on("submit", this.submit.bind(this));
}
TweetCompose.prototype.submit = function (event) {
event.preventDefault();
var formData = this.$form.serializeJSON();
this.$form.find(":input").prop("disabled", true);
$.ajax({
url: "/tweets",
... | true |
f7012646646c8117971c2a3296daeaed2477bac4 | JavaScript | DaZZZle228/basic-js | /src/hanoi-tower.js | UTF-8 | 293 | 2.546875 | 3 | [
"MIT"
] | permissive | const CustomError = require("../extensions/custom-error");
module.exports = function calculateHanoi(diskNumber, turnsSpeed) {
const turns = Math.pow(2, diskNumber) - 1;
const turnsPerSec = turnsSpeed / 3600;
const seconds = Math.floor(turns / turnsPerSec);
return {turns,seconds,}
};
| true |
981d8af7309b5c61e6c12b636a749d634077f195 | JavaScript | MyNameDeXian/new-journey | /src/pages/LearnPages/JsType/attrs/stringAttr.js | UTF-8 | 10,068 | 3.796875 | 4 | [] | no_license | export const stringObj = {}
stringObj.EscapeCharacter = `
title 转义字符
# 特殊字符转义
---code---
\\0 空字符
\\' 单引号
\\" 双引号
\\\\ 反斜杠
\\n 换行
\\r 回车
\\v 垂直制表符
\\t 水平制表符
\\b 退格
\\f 换页
\\uXXXX unicode码
\\u{X} ... \\u{XXXXXX} unicode codepoint
\\xXX Latin-1 字符(x小写)
---code---
`
stringObj.length... | true |
776dac34b5ae680680372ddb564aa06005b5083b | JavaScript | Aayushadh/News-app | /src/news.js | UTF-8 | 628 | 2.625 | 3 | [] | no_license | const request = require('request');
const dotenv = require("dotenv");
function getNews(callback) {
const url = 'http://newsapi.org/v2/top-headlines?' + 'country=us&' + 'apiKey='+process.env.yourAPIKey;
request({
url,
json: true
},
(error, response) => {
i... | true |
1c6c19d3cc4e11aaea7923f1f3627e6026798ab8 | JavaScript | JvJub/JvJub.github.io | /#Project Source Files/JavaScript/BudgetKeeper/js/index.js | UTF-8 | 5,227 | 3.203125 | 3 | [] | no_license | // Strict Mode
'use strict';
// Node Elements
const $startBtn = document.getElementById('start'),
$budgetValue = document.querySelector('.budget-value'),
$daybudgetValue = document.querySelector('.daybudget-value'),
$levelValue = document.querySelector('.level-value'),
$expensesValue = document.querySelector(... | true |
07a66cc8770895651ec50b3e7cf617971465807b | JavaScript | reedamchoudhary/blog-page-template | /react-clock/reactclock/src/Clock.jsx | UTF-8 | 534 | 2.71875 | 3 | [] | no_license | import React, {useState} from 'react'
const Clock = () => {
let time = new Date().toLocaleTimeString();
const [ctime, setTime] = useState(time)
const updateTime = () => {
time = new Date().toLocaleTimeString();
setTime(time)
}
setInterval(updateTime, 1000)
return(
<di... | true |
2031d82a0f458d2dac138f7ab8f9d0c0f825c645 | JavaScript | eric2turbo/GifTastic | /assets/javascript/logic.js | UTF-8 | 2,411 | 3.046875 | 3 | [] | no_license |
//Topics for buttons on top of page
var topics = ["alison brie", "lemur", "cruise", "manatee", "poochie", "heman",
"simpsons", "turtle", "shia", "nope", "guile", "psy", "kanye",
"antonio banderas", "both"];
//function to add buttons based on topics array
function renderButtons() {
$("#topicButtons").empty... | true |
edd397cdea25b0f9ca57c502fde9a28f90fc9bea | JavaScript | GustavoJava/ws_portal | /modulos/web/js/.svn/text-base/cad_operadora_gerencial.js.svn-base | UTF-8 | 3,448 | 2.625 | 3 | [] | no_license | jQuery(document).ready(function(){
var cadOperadoraGerencial = new CadOperadoraGerencial();
cadOperadoraGerencial.atualizarBotoes();
$("#selecionar_um").click(function(){
cadOperadoraGerencial.selecionarUm();
});
$("#selecionar_todos").click(function(){
cadOperadoraGerencial.selecionarTodos();
... | true |
8534a4042068c5052f98324a35b9860a69273781 | JavaScript | kldscpcdev/weather-app | /src/script.js | UTF-8 | 2,982 | 3.328125 | 3 | [] | no_license | // display current time
let now = new Date();
function displayTime(event) {
//set variables for current time
let currentHours = now.getHours();
let currentMinutes = now.getMinutes();
if (currentMinutes < 10) {
currentMinutes = `0${currentMinutes}`;
}
let amPM = "AM";
// change to 12-hour clock and se... | true |
7a05b517cb9cc68101d9ef38a5ac077019f00d4a | JavaScript | Michaelleojacob/peopleadder | /v4.js | UTF-8 | 2,910 | 3.234375 | 3 | [] | no_license | //sub models
const domwrapper = (() => {
const domManager = {
createElement({
type = 'div',
text = null,
classes = null,
attributes = null,
events = null,
children = null,
}) {
const el = document.createElement(type);
if (classes !== null) {
el.classList.add(...classes);
}
if (... | true |
ce13d554e959ad416cf9e6de38c2589c06ac2282 | JavaScript | lksngy/55-plus-js-projects | /16-snake-not-udemy/script.js | UTF-8 | 2,612 | 3.0625 | 3 | [] | no_license | // this is not a part of udemy course, here is the link to the article about this snake
// https://medium.com/@fahad.haidari/build-a-snake-game-with-javascript-c7a7f33437eb
/*
I DIDN'T FINISHED AS THIS DOESN'T HAVE MUCH EXPLANATION AND THIS CODE IS QUITE DIFFICULT. WILL GET BACK TO IT ONE DAY.
*/
console.log('test'... | true |