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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
bcbfc394245f39e69c6c8667246b761e9bc9b750 | JavaScript | jha-vineet69/EduAssets-3.0 | /js/newsletter.js | UTF-8 | 462 | 2.65625 | 3 | [] | no_license | //--------------Newsletter------------//
var nlemail = document.getElementById("form-control");
document
.getElementById("newsletterForm")
.addEventListener("submit", submitClick);
function submitClick(e) {
e.preventDefault();
//to stop refreshing
var firebaseRef = firebase
.database()
.ref()
.ch... | true |
f8174b9cdff7f8ed3d9076d3b541bbca90a112b8 | JavaScript | carstenjlund/thingsDone_react | /src/components/redux/thingsReducer.js | UTF-8 | 681 | 2.859375 | 3 | [] | no_license | import uuidv4 from 'uuid/v4'
const initState = {
thingsDone: [
{
id: uuidv4(),
thing: "A thing I did today"
},
{
id: uuidv4(),
thing: "Another thing I did"
}
]
}
export const thingsReducer = (state = initState, action) => {
if... | true |
bc48d941ab0b4e948d44281b778d7db0ba2dd3bb | JavaScript | jaz303/unwise | /lib/env.js | UTF-8 | 807 | 2.65625 | 3 | [] | no_license | module.exports = function() {
return new Env();
}
function Env(parent) {
this.parent = parent || null;
this.env = {};
}
Env.prototype.beget = function() {
return new Env(this);
}
Env.prototype.find = function(key) {
if (key in this.env) {
return this;
} else if (this.parent) {
... | true |
0858140dfd15452b0cc9fff5a0d2019ae805eb73 | JavaScript | circuitousNerd/screeps | /src/role.harvester.js | UTF-8 | 3,200 | 2.65625 | 3 | [] | no_license | let roleHarvester = {
BODY_TYPE: {
'small': {
'components': [WORK, CARRY, MOVE, MOVE],
'price': 250
},
'medium': {
'components': [WORK, WORK, CARRY, CARRY, MOVE, MOVE, MOVE],
'price': 450
},
'large': {
'components': ... | true |
6d540ddda6f53d13af2a0b988f56befb5738648d | JavaScript | bitdivine/numper | /index.js | UTF-8 | 1,624 | 2.828125 | 3 | [] | no_license | /**
* Count events over time intervals.
*/
var util = require('util'),
events = require('events');
function Numper(options) {
// Get Options:
if (typeof(options) === 'undefined') {
options = {};
}
var emitter;
if (typeof(options.emitter) === 'undefined') {
emitter = th... | true |
fa07ec139ac0e5f49afd5e447162023c94dfd599 | JavaScript | FbW-48-2/lessons | /PB/PB-livecoding/PB_24_03_2021/1-functionDeclaration.js | UTF-8 | 611 | 4.75 | 5 | [] | no_license | // Functions are the main “building blocks” of the program. They allow the code to be called many times without repetition.
// To create a function we can use a function declaration.
// Syntax:
// function name() {
// body of the function
// }
function firstFunction() {
// function body
console.log("welcome t... | true |
f1999610d3cac81261555058ebcbc9f1b8d10970 | JavaScript | VickBe/project-business-site | /code/script.js | UTF-8 | 891 | 4.03125 | 4 | [] | no_license | // A function that adds and remove the class "active" on the section you click on.
// We haven't really talked about ´this´ yet, but we will... ;)
// console.log(this) to see how it works
//function toggle() {
//this.classList.toggle("active")
//}
// Selects an HTML element, and calls a function which will be executed... | true |
ceba30aa1d05fa12b15179616a0f5bc4e14af1ed | JavaScript | Nelson112/greetings-webapp | /index.js | UTF-8 | 894 | 3.234375 | 3 | [] | no_license | var express = require('express');
var app = express();
var greetedNames = [];
var server = app.listen(3001);
app.get('/greetings/:name', function(req, res) {
res.send("Hello, " + req.params.name);
greetedNames.push(req.params.name);
console.log(req.params.name);
});
app.get('/greeted', function(req, res) {
res... | true |
b3ced5bdc43cb7a9c8e0dd40acd8b79d41d5a8b3 | JavaScript | InnovationExploited/08.SoftUni-SmartContractDevelopmentOpenCourse | /07. Working With Contracts From Applications - WEB3/examples/ethersjs/api.js | UTF-8 | 1,516 | 2.625 | 3 | [
"MIT"
] | permissive | const ethers = require('ethers');
const provider = require('./provider')
const address = '0xB4c9e32f9573C671D77dC4040aDB8CB60434de59';
// provider.getBalance(address).then((balance) => {
// // balance is a BigNumber (in wei); format is as a sting (in ether)
// let etherString = ethers.utils.formatEther(balanc... | true |
8fbb575221f38731d6b06afa0a25bfb3a8ae0dc8 | JavaScript | alejoultimate/InstrumentLink | /jasmine-standalone-2.4.1/spec/SpecsOfDriverForAnalyzer.js | UTF-8 | 889 | 2.765625 | 3 | [
"MIT"
] | permissive | describe("DriverForAnalyzer", function() {
var driverForAnalyzer;
beforeEach(function() {
driverForAnalyzer = new DriverForAnalyzer();
});
it("Limpiar un string CON caracteres especiales ", function() {
var initialData = String.fromCharCode(2) + "H|\\^&|||EPOC^Blood Analysis^EDM^Data Manag... | true |
94d6068cf1acdf07d0743ed3645a080d27ccb90f | JavaScript | vitkarpov/grunt-nunjucks-2-html | /tasks/nunjucks.js | UTF-8 | 4,233 | 2.703125 | 3 | [
"MIT"
] | permissive | /**
* grunt-nunjucks-2-html
* https://github.com/vitkarpov/grunt-nunjucks-2-html
*
* Copyright (c) 2014 Vit Karpov
* Licensed under the MIT license.
*/
'use strict'
const nunjucks = require('nunjucks')
const chalk = require('chalk')
const path = require('path')
module.exports = function (grunt) {
grunt.regis... | true |
de2674f621868bc7d86f400dae087b11a59d8ed3 | JavaScript | aslan92/crass | /src/nodes/CounterStyle.js | UTF-8 | 1,182 | 2.59375 | 3 | [
"MIT"
] | permissive | var optimization = require('../optimization');
var utils = require('../utils');
/**
* @constructor
* @param {string} name
* @param {array} content
*/
function CounterStyle(name, content) {
this.name = name;
this.content = content;
}
/**
* @return {string}
*/
CounterStyle.prototype.toString = function t... | true |
cf32e0a0d0a71cf0d29ecb0a53c008afa3911766 | JavaScript | liuru123/big-class-test-2 | /spec/app-spec.js | UTF-8 | 6,031 | 2.515625 | 3 | [] | no_license | const app=require('../src/app.js');
describe("divideItems",function () {
it("should return the divided items",function () {
let inputs=[
'ITEM000001',
'ITEM000001',
'ITEM000001',
'ITEM000001',
'ITEM000001',
'ITEM000003-2.5',
... | true |
36e2a0eff78789d40d99f09f5214f3aeb139c004 | JavaScript | nikolayjgmail/X-O | /src/App.js | UTF-8 | 1,308 | 3.171875 | 3 | [] | no_license | //2
import React, {Component} from 'react';
import Cell from './cell';
import './App.css';
class App extends Component{
state={
data:[1,2,3,4,5,6,7,8,9],
game: new Array(9),
player:"x",
count:0
};
changePlayer =()=>{
this.setState({player: (this.state.player=="x") ? "o" : "x" })
};
... | true |
355d76fd36ccda16da14255286fb9111af247fa6 | JavaScript | wilmveel/cmacc-pdf | /bin/run.js | UTF-8 | 769 | 2.53125 | 3 | [] | no_license | #! /usr/bin/env node
var fs = require('fs');
var path = require('path');
var input = process.argv[2] || './index.cmacc';
var output = process.argv[3] || path.basename(input, path.extname(input));
var cmacc = require('cmacc-compiler');
var compile = cmacc.compile;
var resolve = cmacc.resolve;
console.log('Hello Worl... | true |
6d509fe857cf768489c5faca675261c9f4c9a7fc | JavaScript | Jsingapuri/Code-Quiz-HW4 | /scripts.js | UTF-8 | 4,259 | 3.28125 | 3 | [] | no_license | var time = 60;
var questIndex = 0;
var score =0;
var timer;
//borrowed randomizer
function randomize(array) {
var currentIndex = array.length, randomIndex;
while (0 !== currentIndex) {
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex--;
[array[currentIndex], array[rand... | true |
d59fde3c09d2669a7238164fd7583ae08f6ed010 | JavaScript | Segura/telegram-contests-js-2019 | /src/main/drawable.js | UTF-8 | 3,403 | 2.8125 | 3 | [] | no_license | import { EventAware } from '../common/event-aware'
export class Drawable extends EventAware {
constructor(container, className, config = {}) {
super(container)
this.canvas = document.createElement('canvas')
this.canvas.classList.add(className)
this.context = this.canvas.getContext(... | true |
05e9fb424e7abd327c3427367770d960a45edb33 | JavaScript | endojs/endo | /packages/test262-runner/test262/test/built-ins/TypedArray/prototype/sort/sorted-values.js | UTF-8 | 2,010 | 2.75 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-ecma-no-patent"
] | permissive | // Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-%typedarray%.prototype.sort
description: Sort values to numeric ascending order
info: |
22.2.3.26 %TypedArray%.prototype.sort ( comparefn )
When the TypedArray S... | true |
35dfd147e537bdfd092aa0e31082f7949903d253 | JavaScript | ShravyaHub/User-Registration-JavaScript | /main.js | UTF-8 | 975 | 2.765625 | 3 | [] | no_license | const NAME_REGEX = /^[A-Z][a-z]{2,}$/;
const EMAIL_REGEX = /^([a-z0-9]+[-._+]?[a-z0-9]+)+@[a-z0-9-]+.[a-z]{2,3}.[a-z]{2,3}$/;
const PHONE_NUMBER_REGEX = /^[9][1][ ][6-9][0-9]{9}$/;
const PASSWORD_REGEX = /^(?=.*[@#$%^&+=])(?=.*[0-9])(?=.*[A-Z]).{8,}$/;
var readlineSync = require('readline-sync');
var utility = require... | true |
e9bb98eb5c6b205f0b4155c3da576a33c19f38b9 | JavaScript | tradakeolac/lostmyname | /scripts/app.js | UTF-8 | 3,238 | 2.59375 | 3 | [] | no_license | (function(){
var ToggleMenu = function () {
var leadershipHeader = $(".lost-my-name__header");
var menuWrapper = leadershipHeader.find(".lost-my-name__header__right-nav-wrapper");
var toggleBtn = leadershipHeader.find(".lost-my-name__header__toggle-button");
var animatedMenu = function () {
$(windo... | true |
96552a56e0a05bd40bbb730a15e7b0b966cc6b22 | JavaScript | dkxltks25/Algo | /Level1/체육복V1.js | UTF-8 | 857 | 3.46875 | 3 | [] | no_license | function solution(n, lost, reserve) {
var answer = 0;
RemoveSameElement(lost, reserve);
}
function RemoveSameElement(lost, reserve) {
var RemoveElementCase = [];
lost.map((index, number) => {
for (let i = 0; i < reserve.length; i++) {
if (reserve[i] === index) {
RemoveElementCase.push([number... | true |
571cb0344b79f9e1dcaf8fe1d0fb9890d33ef657 | JavaScript | tfouts17/ED_1 | /FoutsFolder_1/sketch.js | UTF-8 | 3,305 | 3.203125 | 3 | [] | no_license | var numBalls = 7; //Set Number of balls
var damper = 0.03; //Constant to reduce exit velocity
var gravity = 0.07; //Y acceleration
var friction = -0.9; //Slow the balls over time
var xVelocity = 0; //Temporary variables to set xVel and yVel of balls
var yVelocity = 0;
let balls = [];
function setup() {
createCanvas... | true |
510b8d551fff640b19621a29e158e3769c1d0c12 | JavaScript | jastakhova/WeFarmDashboard | /assets/js/logic/FbAuth.js | UTF-8 | 1,814 | 3.03125 | 3 | [] | no_license | (function() {
//#########################
// FIREBASE AUTH Page
//#########################
// FireBase Authentication
const txtEmail = document.getElementById('email_input');
const txtPass = document.getElementById('pass_input');
const signUpButton = document.getElementById('sign_up_button');
const ... | true |
efc34f1667304209d27cb1cbbbfec705800e51d8 | JavaScript | roy343/StarWarsApp-REACT | /src/App.js | UTF-8 | 888 | 2.890625 | 3 | [] | no_license | import './App.css';
import React from 'react'
export default
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
characters:[]
}
}
async componentDidMount() {
this.starwarspeople();
}
async starwarspeople(){
const resp = await fetch("https://swapi.dev/api/peopl... | true |
c7086fd56b921dd9bc0681eb0c2494bfb6dfa299 | JavaScript | scarpel/ada | /gui/linkers/modules/utils/utils.js | UTF-8 | 5,827 | 2.890625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"CC0-1.0"
] | permissive | import { ArticleItems } from '../utils/dataTypes.js';
const ltrimRE = /^\s+/g;
const rTrimRE = /\s+$/g;
const isDigits = /^\d+$/;
Array.prototype.last = function (negativeIndex) {
return this[this.length + negativeIndex];
};
function count(text, substring) {
let length = text.length,
count = 0,
index = t... | true |
c006a5343a50c1ffc42efa0da27b5a88ddc45691 | JavaScript | annaleee/SI539-portfolio | /js/navigation.js | UTF-8 | 285 | 2.78125 | 3 | [] | no_license | var time =0;
function navigate(){
time++;
var a1=document.getElementsByClassName('nav_links');
for(var i=0;i<a1.length;i++){
if(time%2==1){
a1[i].style.left="0px";
}else{
a1[i].style.left="-140px";
}
}
}
| true |
8dc092438d16a87ae5fa147f471fd57bf1fc3b27 | JavaScript | violet-g/e-health | /Project/static/js/dashboard.js | UTF-8 | 1,416 | 2.75 | 3 | [] | no_license | $(document).ready(function(){
$("input[name=search_bar]").val(''); //clear the input field in case it wasnt sanitised before that
// Dropdown button for search category
$(".category_option").click(function(){
$("#category").text($(this).text());
});
$("#all_filter").click(fun... | true |
a291deed09ab4e032790e4de06af8cf8273b81e6 | JavaScript | kimtaekyung/reactProject | /08-class-component/src/components/MyStateSub2.js | UTF-8 | 1,423 | 3.28125 | 3 | [] | no_license | import React, { Component } from 'react';
class MyStateSub2 extends Component {
// 생성자가 없는 경우 state값 직접 정의
state = {
my_number: 0,
my_time: new Date().toString()
};
/** 이벤트 핸들러 함수 -> 생성자가 없는 경우 반드시 화살표 함수 형태로 정의 */
onButtonClick = (e) => {
let {my_number, my_time} = this.st... | true |
e218970621f748dad85cf06f99bf148297eaf5f4 | JavaScript | Vladi96/JS-Core | /Fundamentals/JS Fundamentals Retake Exam - 24 April 2018/04. Arena Tier.js | UTF-8 | 2,886 | 3.078125 | 3 | [] | no_license | function area(input) {
let result = {}
for (let row of input) {
if (row.includes(' -> ')) {
let [hero, type, power] = row.split(' -> ')
if (!result.hasOwnProperty(hero)) {
result[hero] = {}
result[hero][type] = Number(power)
result[... | true |
172188473c98a5d42d001197fd6d061e30255fd2 | JavaScript | bradley-wong/webapp-final | /darksky.js | UTF-8 | 818 | 2.640625 | 3 | [] | no_license | const request = require('request');
const dotenv = require('dotenv');
dotenv.load();
var getWeather = (lat, lng) => {
return new Promise((resolve, reject) => {
request({
url: `https://api.darksky.net/forecast/${process.env.DARKSKY_API_KEY}/` + encodeURIComponent(lat) + ',' + encodeURIComponent... | true |
de16cf66e4aa9f450bd7cddb9f394a8db5bf6b0a | JavaScript | tanhung3101/learn-nodejs | /C6_LetsRunSomeJavascript/Finished/app.js | UTF-8 | 56 | 2.671875 | 3 | [] | no_license | var a =1;
var b =2 ;
var c = a + b;
console.log(c); | true |
7db23d41480d2279758e8c5f2f8d430cde45c19c | JavaScript | nactran/bench-warc-indexing | /front-end/src/SearchBox.js | UTF-8 | 1,813 | 2.875 | 3 | [] | no_license | import React from "react";
import Form from "react-bootstrap/Form";
import Col from "react-bootstrap/Col";
import Row from "react-bootstrap/Row";
/** SearchBox class: takes a query from the user. */
export default class SearchBox extends React.Component {
/**
* Constructor.
* @param {Function} onSearch a callb... | true |
00f8a8e770a1e047a76601fdd7fde002715e749b | JavaScript | Oscarchoi/LearningJavaScript | /JavaScript_Examples/PromiseAll/main.js | UTF-8 | 682 | 3.171875 | 3 | [] | no_license | new Promise(function(resolve, reject){
setTimeout(function(){
resolve(1);
}, 2000);
})
.then(function(result){
console.log(result);
return result + 10;
})
.then(function(result){
console.log(result);
return result + 100;
})
.then(function(result){
console.log(result);
});
new Promise(function(resolv... | true |
7525f370ff791ffb7a56888c01cb5095dfb9e5cd | JavaScript | viictoraguilar/factorial | /index.js | UTF-8 | 692 | 4.375 | 4 | [] | no_license | /*
5! = 1x2x3x4x5 =120
*/
function cargarFunciones(entrada) {
let numero = entrada.value
if(numero >= 0 && numero <= 100) {
let resultado = factorial(numero)
limpiar()
imprimir(resultado)
} else {
limpiar()
imprimir("Valor incorrecto. Se aceptan valores entre 0 y 100")
}
}
function facto... | true |
36648169e26b3eba57d58a5ce5e6a0a2ed2de61e | JavaScript | antonioallan/SodicasVue | /src/domain/comentario/ComentarioService.js | UTF-8 | 427 | 2.546875 | 3 | [] | no_license | export default class ComentarioService{
constructor(http){
this._path = 'comentario'
this._http = http
}
cadastrar(comentario){
console.log(comentario)
return this._http.post(`${this._path}/${comentario.dica.id}`,comentario)
.then(res => res.json())
}
buscar... | true |
de049cc83bab741df1f5d16cb58ab29bffd770d2 | JavaScript | psbanka/dad-runs-the-internet | /media/js/drimobile/_ViewMixin.js | UTF-8 | 864 | 2.609375 | 3 | [] | no_license | // Provide the class
dojo.provide("drimobile._ViewMixin");
// Declare the class
dojo.declare("drimobile._ViewMixin", null, {
// Returns this pane's list
getListNode: function() {
//return dojo.query(".drimobileList",this.domNode)[0];
//return this.domNode.getElementsByClassName()[0];
return this.getElements("d... | true |
de54ff391fa21130a50213c6ecfbce630ed04b61 | JavaScript | Bashkir15/Wheelhouse | /server/transforms/timeDifference.js | UTF-8 | 278 | 2.859375 | 3 | [] | no_license | 'use strict';
const moment = require('moment');
module.exports = (date) => {
if (!moment.isMoment(date)) {
return '';
}
const days = date.diff(moment(), 'days');
if (days > 1) {
return date.fromNow();
}
if (days < -1) {
return date.toNow();
}
return 'Today';
};
| true |
a6e38aafee6babc7e128774fd7080c3b93f28d85 | JavaScript | BeardOfDan/epollo | /epollo/javascript/sign-in.js | UTF-8 | 762 | 2.546875 | 3 | [] | no_license | $(document).ready(function() {
$('#submit-registration').on('click', function() {
if($('#terms-button').is(':checked')) {
// Sending requiest to the server
$.post('/sign', {
fullName: $('#full-name-field').val(),
email: $('#email-field').val(),
username: $('#username-field').va... | true |
a78e13bde3114e24e5edb490aa10db7da5a80161 | JavaScript | MarcoF1/URL-Shortener | /routes/index.js | UTF-8 | 1,394 | 2.671875 | 3 | [
"MIT"
] | permissive | const express = require('express');
const Shorts = require('../models/Shorts');
const v = require('./validators');
const router = express.Router();
/**
* Serves homepage.
* @name GET /
*/
router.get(
'/',
[],
async (req, res) => {
res.render('index');
});
/**
* Access short URL.
*
* Note that the ? ... | true |
ce58a9b3fea7e1061e9b61df573e863f86a4a56d | JavaScript | ALegos/JMP | /src/main/webapp/resources/js/person.js | UTF-8 | 249 | 2.65625 | 3 | [
"MIT"
] | permissive | /**
*
*/
function deletePerson(el, uid){
var xhr = new XMLHttpRequest();
xhr.open("DELETE", "api/persons/"+uid, false);
xhr.send();
if (xhr.status == 204) {
var tr = el.closest('tr');
tr.parentElement.removeChild(tr);
}
} | true |
fabf08b4bc5052ef1a68853fdf29f67960a42d7f | JavaScript | tied/DevArtifacts | /animation-master/animation20/js/script.js | UTF-8 | 2,094 | 3.15625 | 3 | [
"MIT"
] | permissive | var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var width, height;
var mouseX = targetX = window.innerWidth * 0.5;
var mouseY = targetY = window.innerHeight * 0.5;
var trails = [];
resize();
function Trail(xRad, yRad, colorOffset, rotation) {
this.trailArray = [];
this.x = 0;
t... | true |
bb7f5085dc1c8cab07649c643692e010f8e2dff8 | JavaScript | radrex/SoftuniCourses | /JS Web Developer/JS Advanced/JS Advanced/04.DOM/Exercise/09. Shopping-Cart/solution.js | UTF-8 | 3,278 | 3.609375 | 4 | [
"MIT"
] | permissive | function solve() {
let boughtProducts = new Map();
//----------- GET DATA -----------
let buttons = document.getElementsByTagName('button');
let checkoutBtn = document.getElementsByClassName('checkout')[0];
let addBtnElements = document.getElementsByClassName('add-product');
let textAreaElement = document.... | true |
be6d866993d8ec6a03e72fedc74004c22fc24208 | JavaScript | 90umut/extensions | /extensions/portableLatex/MiKTeX/texmf-local/TeXworks/scripts/latexErrors.js | UTF-8 | 2,210 | 2.65625 | 3 | [] | no_license | // TeXworksScript
// Title: LaTeX errors
// Description: Looks for errors in the LaTeX terminal output
// Author: Jonathan Kew
// Version: 0.1
// Date: 2009-06-14
// Script-Type: hook
// Hook: AfterTypeset
// This is just a simple proof-of-concept; it will often get filenames wrong, for example.
// Switching the engin... | true |
9c407da0c49c0df06f683c7cf9745446fb278ba5 | JavaScript | yayoec/misc | /js/ShareData.js | UTF-8 | 6,458 | 2.875 | 3 | [] | no_license | /**
*持久性数据 状态保持 cookie替代
*/
function PObject(name, defaults, onload) {
if (!name) {
//if no name was specified, use the last component of the URL
name = window.location.pathname;
var pos = name.lastIndexOf("/");
if (pos != -1) {
name = name.substring(pos+1);
}
}
this.$name = name;
//jus... | true |
f6703b56f0c2e51b3d5363b8a4908442881602bd | JavaScript | beibeinevergiveup/beibei_news | /Public/js/admin/user.js | UTF-8 | 2,557 | 2.53125 | 3 | [
"MIT"
] | permissive | var reg = {
check : function() {
// 获取登录页面中的用户名 和 密码
var username = $('input[name="username"]').val();
var password = $('input[name="password"]').val();
var repassword = $('input[name="repassword"]').val();
var verify = $('input[name="verify"]').val();
if(!us... | true |
a05b25aa4df7cb2e4a3ec6e0f706f7c78c3ae2e4 | JavaScript | t2nerb/Knome | /docs/static/map.js | UTF-8 | 3,533 | 2.515625 | 3 | [] | no_license | $(function () {
function initMap() {
var location = new google.maps.LatLng(40.0150, -105.2705);
var mapCanvas = document.getElementById('map');
var mapOptions = {
center: location,
zoom: 16,
panControl: true,
streetViewControl: false,
scrollwheel: true,
mapTypeControl: false,
mapTypeId: goo... | true |
381e177802e634f23c09dfbb079f363c9b849ae3 | JavaScript | andrewuscf/OurHealth | /app/components/SelectInput.js | UTF-8 | 3,617 | 2.578125 | 3 | [] | no_license | 'use strict';
import React, { Component } from 'react';
import { BackAndroid, Modal, ScrollView, View, Text, StyleSheet, TouchableOpacity } from 'react-native';
const SelectInput = React.createClass({
getInitialState: function () {
return {
showOverlay: false, // show overlay for selecting va... | true |
26b501339ee6cc4a7a5dc2282c3c30c48a99b4a4 | JavaScript | Dmancuso1/lighthouse-js-fundamentals | /x marks the spot.js | UTF-8 | 1,263 | 4.8125 | 5 | [] | no_license | /*
For this challenge you'll have to implement a function called finalPosition(moves), which will calculate the position of the parade based on an array of directional moves. The parade will move on an X-Y grid like the following.
Your function will receive an array of moves, which are strings that say either north, s... | true |
6dc54c8335d89ad5e80ac565df29a659997561f7 | JavaScript | ajsaule/The-Happy-Path | /public/javascripts/deleteAccount.js | UTF-8 | 717 | 2.6875 | 3 | [] | no_license | function deleteAccount(event) {
let target = event.target
target.classList.add('active')
axios
.delete('/user/delete', {
data: { id: target.dataset.id }
})
.then(res => {
confirmLogout()
})
}
function confirmLogout() {
resetContent()
let t... | true |
a8d008809d8033b9a8e0a8f1a6180d8774f41b8a | JavaScript | jonathanhculver/NYU-Info-9053-MEAN | /class4/node_fizz_buzz/src/fizz_buzz.js | UTF-8 | 526 | 3.171875 | 3 | [] | no_license | var title = 'blah';
//module.exports.title= title;
/*
module.exports = {
title: title
};*/
/*
module.exports = (function() {
var self= {};
self.title = title;
return self;
})();
*/
var generate = function(count){
var arr = [];
for(var i = 1; i<=count; i++) {
if(i%3 === 0 && i% 5 === 0) {
arr.push... | true |
86fd428565da6e29cc1da94f3db388238bca27b0 | JavaScript | SephReed/SephReed.github.io | /Inktober/INKY.js | UTF-8 | 3,277 | 2.625 | 3 | [] | no_license | window.INKY = {};
INKY.setPainter = function(painter) {
this.painter = painter;
}
INKY.setColor = function(rOrRgb, g, b, a) {
INKY.setColorForPainter(this.painter, rOrRgb, g, b, a);
}
INKY.setColorForPainter = function(painter, rOrRgb, g, b, a) {
var r;
if(typeof rOrRgb == "object"){
r = rOrRgb[0];
g = rOrR... | true |
b5a6d2d5ad197391f63120a76715905d394ba55f | JavaScript | shaybyrne/shaybyrne.github.io | /z/js/myscripts.js | UTF-8 | 13,646 | 3.15625 | 3 | [
"MIT"
] | permissive | // Email: Check if the email address is valid, if not, tell user onchange
function validateEmailForm()
{
var x=document.forms["myForm"]["email"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || ... | true |
0ac3d4da29e4fff8a5aeb10852080362b10f6545 | JavaScript | instance-oom/leetcode | /Easy/409_LongestPalindrome.js | UTF-8 | 712 | 3.765625 | 4 | [
"MIT"
] | permissive | // https://leetcode.com/problems/longest-palindrome/#/description
/**
* @param {string} s
* @return {number}
*/
var longestPalindrome = function (s) {
var length = s.length;
if (length <= 1) return length;
var obj = {};
for (var i = 0; i < length; i++) {
if (!obj[s[i]]) obj[s[i]] = 0;
obj[s[i]]++;
... | true |
36cc8c2fb6a2b2027f3652d22c2436f90d713d3c | JavaScript | jlengstorf/netlify-social-image-generator | /src/_data/github.js | UTF-8 | 339 | 2.53125 | 3 | [] | no_license | const fetch = require('node-fetch');
module.exports = async () => {
const user = await fetch(
`https://api.github.com/users/${process.env.GITHUB_USERNAME}`,
)
.then((res) => res.json())
.catch((err) => console.error(err));
return {
username: user.login,
avatar: user.avatar_url,
url: user... | true |
9bda987647a4d3956e7dd5b748ab82b69fd9bd7a | JavaScript | sonufrienko/demo-appsync | /amplify/backend/function/listCitiesDemo/src/index.js | UTF-8 | 1,015 | 2.703125 | 3 | [
"MIT"
] | permissive | const AWS = require('aws-sdk');
const db = new AWS.DynamoDB.DocumentClient({ region: 'us-west-2' });
const DYNAMODB_TABLE = 'Countries';
const prepareProperties = item => ({
cityID: item.cityID,
cityName: item.cityName
});
async function listCities(countries) {
const filterInKeys = countries.map((v, i) => `:${i... | true |
f182cb27c8fe9b849d0aa9ee81c614948618c446 | JavaScript | justinjungkorea/instaclone | /js/app.js | UTF-8 | 2,073 | 2.921875 | 3 | [] | no_license | // var weaponsList = ["AK-47", "Gun", "Machete", "Knife"];
// var countries = ["Korea", "Japan", "Greece", "Colombia"];
//
// var soldier = {
// name: "Nicolas",
// weapon: weaponsList[2],
// country: countries[3],
// isDead: false,
// shoot: function() {
// console.log("Pew Pew");
// },
// Hello: fun... | true |
ef6da8f5cfe1fddfaa021698b655855b85e768f7 | JavaScript | ksun78/slackcomms | /util/monthly-influence.js | UTF-8 | 3,629 | 2.640625 | 3 | [] | no_license | const UNIQUE = true;
const rootPath = require('./path');
const path = require('path');
var userConvosByMonth = require('../util/user-convos-by-month');
if (UNIQUE) {
userConvosByMonth = require('../util/user-convos-by-month-unique');
}
const userConvosByMonthData = userConvosByMonth.data;
const USER_IDS_TO_NAME =... | true |
fcdc5d432a323db1260511ba7f0fdb3e9c7012d9 | JavaScript | andyescapes/cipher-backend | /caesar.js | UTF-8 | 1,598 | 3.96875 | 4 | [] | no_license | //using this library to check if the unscrambled word is actually a word
var checkWord = require("check-word"),
words = checkWord("en");
//recreating mod function so that modulus of a negative remains positive
function mod(n, m) {
return ((n % m) + m) % m;
}
//caesar solver
let caesar = (cipher) => {
//because j... | true |
c452cf66037c8ce807da408ec55e0d47dd4f7dc1 | JavaScript | arsiag/MEAN-Anonymous-Notes | /server/controllers/notes.js | UTF-8 | 895 | 2.5625 | 3 | [] | no_license | var mongoose = require('mongoose');
var Note = mongoose.model('Note');
module.exports = {
index: function(req, res) {
Note.find().sort({ createdAt: -1 }).exec(function(err, notes) {
if(err) {
console.log('something went wrong when retrieving');
} else {
... | true |
4c6e518da1f5f71e2fb89dd2be169510914efeb7 | JavaScript | i5raev/market | /src/helpers/calc.js | UTF-8 | 310 | 2.78125 | 3 | [] | no_license | export function calcSubPrice(item) {
let subPrice = item.product.count * item.product.price;
return subPrice;
}
export function calcTotalPrice(cart) {
let totalPrice = 0;
cart.products.forEach((element) => {
totalPrice += element.subPrice;
});
return totalPrice;
}
| true |
fcbf1d4e5335d1dc3c59c1b6e89f4ee0543208ca | JavaScript | maurya971/movieandchill | /src/actions/movie-browser.actions.js | UTF-8 | 2,052 | 2.65625 | 3 | [] | no_license | import {
GET_TOP_MOVIES,
GET_TOP_MOVIES_ERROR,
SEARCH_MOVIES,
SEARCH_MOVIES_ERROR,
MOVIE_DETAIL,
MOVIE_DETAIL_ERROR
} from "./types";
import axios from "axios";
const MOVIE_DB_API_KEY = "b622a2864924accfac837f5b60b97b4e";
const MOVIE_DB_BASE_URL = "https://api.themoviedb.org/3";
const _createMovieDbUrl = ... | true |
e3e865f47d2340dd2d58008c2cf3896cc3436d09 | JavaScript | adrmille/kuzzle | /lib/api/dsl/transform/canonical.js | UTF-8 | 4,376 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | 'use strict';
var
_ = require('lodash'),
combinatorics = require('js-combinatorics'),
espresso = require('espresso-logic-minimizer'),
strcmp = require('../util/stringCompare');
/**
* Converts filters in canonical form
*
* @constructor
*/
function Canonical () {
/**
* Entry point of the normalizer: ta... | true |
29331dcb2e2febf345110a4e9be30eaae302307c | JavaScript | sctravel/Ami_Html5 | /public/js/itemProcessor/retellStoryProcessor.js | UTF-8 | 3,005 | 2.546875 | 3 | [] | no_license | /**
* Created by xitu on 2/23/2017.
*/
function processRetellStory(stream, item){
JL("client").info("Entering processRetellStory for " +item.type+"."+item.item );
var audioList = item.audio.split(':');
var rsindex = 0;
playAudioGlobalAndSetOnEndFunction(audioFolder+audioList[rsindex],function(... | true |
e184f2c72cf5fdd0551f161a462cc662d0ed52e6 | JavaScript | yialo/guessmelody | /source/js/views/_common/artist-view.js | UTF-8 | 1,552 | 2.71875 | 3 | [] | no_license | import View from './_view';
export default class ArtistView extends View {
_imageSrc = String();
_artist = String();
_number = Number();
_$container = null;
_$ = null;
_$radio = null;
_onSelect = () => {
throw new Error('Callback need to be redefined for every instance');
};
constructor(track,... | true |
347171e59477e4097faf76539427b4ca50ef39a4 | JavaScript | oryono/beer | /src/pages/beers.jsx | UTF-8 | 1,174 | 2.609375 | 3 | [] | no_license | import React, {useState} from "react";
import {Beers as BeerList} from "../component/beers";
const Beers = () => {
const [beers, setBeers] = useState([{name: "Tusker", alcohol: 4}, {name: "Guiness", alcohol: 6}])
const [form, setForm] = useState({})
function handleChange(event) {
const {name, va... | true |
6ca54668f56e3a772adc615f16bd3714d5c34120 | JavaScript | DekayHaHa/StarWars-api | /src/__test__/Api.test.js | UTF-8 | 5,001 | 2.984375 | 3 | [] | no_license | import React from 'react';
import Api, { fetchByKey, peoplePull, planetsPull, vehiclesPull, fetchValues } from '../utilities/Api';
import testUtililty, { mockPeopleValues, mockPeopleFinal, mockPlanetValues, mockVehicleValues, mockVehicleFinal, mockFinalPlanets } from './testUtililty'
describe('Api', () => {
let mockD... | true |
5c1966c43b97c29225299fc5e3017cffb97d0d1b | JavaScript | Nandini-72/Javascript-Project | /ExpandingCards/script.js | UTF-8 | 517 | 3.3125 | 3 | [] | no_license | // selecting all panels with class of panel
const panels = document.querySelectorAll('.panel')
// Foreach panel when clicked
panels.forEach((panel)=>{
panel.addEventListener('click',()=>{
// remove active class from all another panel and add it to the selected panel
removeActiveClasses()
pan... | true |
23e66a8dd710ad5a90ea32ef210c8a0fb148bf85 | JavaScript | shamimhaque-mpi/vendhouse | /private/js/wishList.js | UTF-8 | 1,875 | 2.59375 | 3 | [
"MIT"
] | permissive | var site_url = url.replace('frontend/ajax/', '');
var user_id = null;
class wishList {
constructor(id=null){
user_id = id;
this.xml(url+'wishListids', {
user_id : user_id
});
}
// Add To Wish List
addToWishList(product_id){
window.event.preventDefault();
... | true |
e76e6a562ef6d253f36c00f2f757544a388fce53 | JavaScript | NoaShnitzer/FullStack-Projects | /Final Project 1/BackEnd/CinemaWS/Controllers/PermissionsJsonController.js | UTF-8 | 1,101 | 2.546875 | 3 | [] | no_license | const express = require('express')
const router = express.Router()
const PermissionsBL = require('../Models/BL/PermissionsJsonBL')
//GetAll
router.route('/').get(async(req, resp) => {
let permissions = await PermissionsBL.GetAllPermissions()
return resp.json(permissions)
})
//GetByID
router.route('/:id').get... | true |
bb8b1a6f5131079867eeb1efd53fa79d5add4ce3 | JavaScript | CarolineRezendeBarroso/tcc2-codes | /exemplo/js/coletor_dados.js | UTF-8 | 7,875 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | /*Coletor de dados*/
var scripts = ['https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js',
'https://www.gstatic.com/firebasejs/4.11.0/firebase.js'];
function loadScripts(scripts, callBack){
//Para cada script do array "scripts"...
scripts.forEach(function(script){
var s = document.createEl... | true |
2eb1de439830e06442373457d02b93bd6cc571ec | JavaScript | arnihl/hopverk1 | /db.js | UTF-8 | 2,367 | 3 | 3 | [] | no_license | const { Client } = require('pg');
const Converter = require("csvtojson").Converter;
const converter = new Converter({});
const connectionString = process.env.DATABASE_URL;
converter.fromFile("./data/books.csv",async function(err,result){
// if an error has occured then handle it
if(err){
console.log... | true |
9b680a4d02ab3ff6c7fb6835570110621e881f15 | JavaScript | JenniferStarboard/Scion2edDiceRoller | /DTenDiceRoller/javascript/dice_roller.js | UTF-8 | 4,745 | 3.15625 | 3 | [] | no_license | function createCircle(center, shade){
let out = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
out.setAttribute('cx', center);
out.setAttribute('cy', '50');
out.setAttribute('r', '20');
out.setAttribute('stroke', shade);
out.setAttribute('stroke-width', '... | true |
0f44d7b649df74eb4722a224ddd1188fd200475d | JavaScript | Kieras997/Memory-Game | /script.js | UTF-8 | 1,552 | 2.890625 | 3 | [] | no_license | const ext = '.png';
const folder = 'img';
const images = new Array('memory1', 'memory2', 'memory3', 'memory4', 'memory5', 'memory6', 'memory7', 'memory8', 'memory9', 'memory10', 'memory1', 'memory2', 'memory3', 'memory4', 'memory5', 'memory6', 'memory7', 'memory8', 'memory9', 'memory10');
const back = 'ba... | true |
2b97a4ab88d10db778c4125472caed39ac725fb9 | JavaScript | xingmi/chat-demo | /static/js/socket_index.js | UTF-8 | 1,515 | 3.03125 | 3 | [] | no_license | /*
* 初始化事件注册和监听
*/
(function(){
var socket = io();
var name;
//用户接入
socket.emit('userVistor')
socket.on('userVistor',function(initData){
$("#allUser h2 em").text(initData.count);
$("#allUser div").remove();
initData.userArray.forEach(function(i){
$("#allUser").... | true |
fb43d71691cf433c6bdc8fcd41dd29c45ebee3fd | JavaScript | alpagor/m1-pulse-check | /starter-code/src/assessment1.js | UTF-8 | 2,184 | 4.46875 | 4 | [] | no_license | // Write a function that returns the product of 2 numbers
function product(x, y) {
return x * y;
}
// Write a function that returns whether a given number is even
function isEven(num) {
return num % 2 === 0;
}
// Return the largest of 2 numbers
function maxOfTwoNumbers(a, b) {
return Math.max(a, b);
}
// Retur... | true |
cdbcf5283006dbfbe2c2a622bbe3c983ccb0654b | JavaScript | jefframos/growapp | /sources/scripts/application/game/enemies/behaviour/DefaultBehaviuor.js | UTF-8 | 1,433 | 2.625 | 3 | [] | no_license | /*jshint undef:false */
var DefaultBehaviour = Class.extend({
init: function (entity, player){
this.player = player;
this.entity = entity;
this.life = 8;
this.entity.setVelocity(-2,(Math.random()-0.5)*3);
this.sideAcum = 0;
this.sideMaxAcum = 200;
this.fireFreq = 25;
this.fireAcum = 0;
this.fireSp... | true |
39feae9d165363d687afea01cc127cd91d4fc49d | JavaScript | eliudjgomezg/smashMedia_test | /src/components/error.jsx | UTF-8 | 459 | 2.71875 | 3 | [] | no_license | import React from 'react'
function Error() {
const error = `
{
status: "error",
message: Descripción del error
}
`
return (
<div className='container py-5' >
<h1>Error</h1>
<h3>
Cada vez que ocurra un error en el request, la estructura de la respuesta sera la siguiente:
</h3>
... | true |
f662572269fb1d4aadbc93f7534df7b1ac0a66d7 | JavaScript | rfathy/AndalusiaTask | /employee/employee.ctrl.js | UTF-8 | 4,136 | 2.515625 | 3 | [] | no_license | var app = angular.module("ngTask");
app
.factory('dataFactory', function($http) { //get data from json file
return {
getEmpolyees: function() {
return $http.get('data/data.json').then(function(result) {
return result.data;
});
}
}
})
.controller("gridCtrl... | true |
233b70d0124e320104383118ed4094d6028d3310 | JavaScript | shalkam/react-viewerbase | /src/components/viewer/Viewport.js | UTF-8 | 20,763 | 2.515625 | 3 | [
"MIT"
] | permissive | var allCornerstoneEvents = 'CornerstoneToolsMouseDown CornerstoneToolsMouseDownActivate ' +
'CornerstoneToolsMouseClick CornerstoneToolsMouseDrag CornerstoneToolsMouseUp ' +
'CornerstoneToolsMouseWheel CornerstoneToolsTap CornerstoneToolsTouchPress ' +
'CornerstoneToolsTouchStart CornerstoneToolsTouchStartA... | true |
c7e3b6d8ee554e3dbe9c9db549e78186ca4667c0 | JavaScript | JustsoSoftware/questionnaire | /src/RadarChart.js | UTF-8 | 3,394 | 2.625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | /*
Copyright 2018-2021 Justso GmbH, Frankfurt, Germany
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... | true |
44256ca8a8c13143734ec642586a7811854b19aa | JavaScript | MinottaDeveloper/Nexura_LandingPage | /js/index.js | UTF-8 | 414 | 2.65625 | 3 | [] | no_license |
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 80 || document.documentElement.scrollTop > 80) {
document.getElementById("main_navigation").style.background = "#241F21";
} else {
document.getElementById("main_navigation").style.ba... | true |
62f92e52a5b1b9d1249647c9c2d867829f2d1882 | JavaScript | Tentyris/AENprojet | /connexion/ajax.js | UTF-8 | 771 | 2.765625 | 3 | [] | no_license | function ajax() {
const date = document.getElementById("date");
const h = document.getElementById("horaire");
const horaire = h.options[h.selectedIndex].value;
/*const m = document.getElementById("monitor");
const monitor = m.options[m.selectedIndex].value;*/
console.log(date.value);
console.log(horaire);
const xhr... | true |
9cfd6eab1bcc43c76ae6e8e0adad5b56877a6a80 | JavaScript | kirch7/shaat | /static/color.js | UTF-8 | 818 | 2.921875 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | (() => {
const stringfy = color => `<div style="color:${color.code}"><input type="radio" name="usercolor" value="${color.code}" >${color.name}</input></div>`;
const colors = [
{ name: "black", code: "#000000" },
{ name: "white", code: "#ffffff" },
{ name: "red", code: "#ff0000" },
... | true |
e39485bf029f509e1699cdce18fa4890095c8141 | JavaScript | idustar/os-storage | /js/main.js | UTF-8 | 3,148 | 2.640625 | 3 | [] | no_license | /**
* Created by dustar on 2017/5/17.
*/
// 全局变量
var g = {
capacity: 640,
blocksCount: 30,
maxProcess: 320,
blocks: [],
color: ['#0099ff', '#3300ff', '#f200ff', '#00e1ff', '#b30740', '#00ff66', '#525252', '#7bbd00', '#674ea7', '#4a86e8',
'#ff6f00', '#c4ff00', '#fa89d6', '#24700b', '#01547a... | true |
54d64f4fb27baae8df327d0f5d423d90daf623e2 | JavaScript | sinisterkyle/ClickEvents | /clickevents.js | UTF-8 | 781 | 3.375 | 3 | [] | no_license | const fooButton = document.getElementById("fooButton");
const barButton = document.getElementById("barButton");
const fooBarButton = document.getElementById("fooBarButton");
const body = document.querySelector("body");
fooButton.addEventListener("click", function(event) {
const h3 = document.createEl... | true |
d96f7724f632fdbfb5da1a946490881bda775ccf | JavaScript | arifur-ra/My_WebDev | /React/spread_rest_op/thisKeyword.js | UTF-8 | 1,054 | 4.59375 | 5 | [] | no_license | // Normal Function
// function sayMyName(name){
// console.log('This is My',name)
// }
// sayMyName('Arif');
// arrow function
const sayMyName=name=>{
console.log('This is My',name)
}
let person={
name:'Arif',
age:30,
me:{
sureName:'Rahman',
whoIsMe: ()=>{
console.log(this)
... | true |
678bce4eb8348fe0d972f98af4cf74ade05f2666 | JavaScript | IONDO/Game-project | /js/blocks.js | UTF-8 | 1,570 | 3.40625 | 3 | [] | no_license | class Block extends BouncingBox {
constructor(x, y, width, height) {
super();
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this._img = document.getElementById("block")
}
draw(context) {
context.beginPath();
context.drawIma... | true |
d8ab12c5298fefc032f8425a206a9a500497234f | JavaScript | jackyho112/react-components | /components/ChallengeCard/Tooltips/UserAvatarTooltip/UserAvatarTooltip.jsx | UTF-8 | 2,463 | 2.71875 | 3 | [
"MIT"
] | permissive | /**
* User Avatar Tooltip Component.
*
* USAGE:
* Wrap with <UserAvatarTooltip></UserAvatarTooltip> tags the element(s) which
* should show the tooltip when hovered. Pass in the user profile object via
* the 'user' prop.
*/
import React, { PropTypes as PT } from 'react';
import moment from 'moment';
import Tool... | true |
dd44908f599eb797a78d8bd0d6d1e338f020b553 | JavaScript | shevh/cupom_desconto | /app/controllers/fornecedor.controller.js | UTF-8 | 3,673 | 2.671875 | 3 | [] | no_license | const db = require("../models");
const Fornecedor = db.fornecedores;
const Op = db.Sequelize.Op;
// Create and Save a new Fornecedor
exports.create = (req, res) => {
// Validate request
if (!req.body.cnpj) {
res.status(400).send({
message: "Content can not be empty!"
});
return;
}... | true |
e1c95fff967ffeb347d8b1172c97727ea1234c7c | JavaScript | umergta/Pethaven | /PetHaven/pet-haven1/src/components/HomeViews/CreateBaseDailyPrice.js | UTF-8 | 1,639 | 2.59375 | 3 | [] | no_license | import React, { Fragment, useState } from "react";
import { Grid, TextField, Button } from "@material-ui/core";
export default function CreateBaseDailyPrice() {
const [newBaseDailyPrice, setBaseDailyPrice] = useState({
pet_category: "",
base_daily_price: "",
});
const { pet_category, base_daily_price } = newBa... | true |
5f95f9055fa4ba8ecdfaccdb797780e64d6e260b | JavaScript | Planctor/LearningJs | /script.js | UTF-8 | 367 | 2.953125 | 3 | [] | no_license | const menu = document.querySelectorAll('.link')
function scr(evento){
evento.preventDefault()
const linkar = evento.currentTarget.getAttribute('href')
const link = document.querySelector(linkar)
link.scrollIntoView({
behavior: "smooth",
block: "center"
})
}
menu.forEach((evento)=... | true |
871e13213d4b7daf0c40bdd5f49ec4b5379ccef4 | JavaScript | anabarasan/coursera_angularjs | /assignment2/app.js | UTF-8 | 1,340 | 2.5625 | 3 | [] | no_license | (function(){
'use strict';
angular.module('ShoppingListCheckOff', [])
.controller('ToBuyController', ToBuyController)
.controller('AlreadyBoughtController', AlreadyBoughtController)
.service('ShoppingListCheckOffService', ShoppingListCheckOffService)
ToBuyController.$inject = ['ShoppingListChec... | true |
163c8f1dfbae86c1c71bcc2290fa8d97e03346c6 | JavaScript | GugaDavi/Notes | /home/NotesReact.js | UTF-8 | 15,096 | 3.703125 | 4 | [] | no_license | /*
React:
Com as Configurações "Okay" podemos utilizar as ferramentas da biblioteca:
<script>
const h1 = React.createElement( 'h1', null, 'Hello World' );
</script>
Basicamente utilizamos um dos metodos do React, createElemente, para criar um novo elemento. Para tal, passamos:
1 - Colocamos em uma ... | true |
bb483feef6cd408e46a2d153b485877832d15b65 | JavaScript | 2nd47/CSC309-A4 | /public/js/modal.js | UTF-8 | 5,594 | 2.703125 | 3 | [
"MIT"
] | permissive | // Get the modal
var modal = document.getElementById('myModal');
// Get the button that opens the modal
var btn = document.getElementById("login_nav");
//get the landing page signup button
var landingSignup = document.getElementById("brief_signup_button");
var signupSwitch = document.getElementById("signup_switch");... | true |
abdf1a173b1a898d626492cf0ca4bec8999ad0fa | JavaScript | DonoZhang/my-weather-api | /repositories/cities.js | UTF-8 | 1,593 | 2.78125 | 3 | [] | no_license | var ObjectId = require('mongodb').ObjectID;
const citySchema = require('../models/city');
const weatherSchema = require('../models/weathers');
class CityRepository{
constructor(CityModel, WeatherModel){
this.CityModel = CityModel;
this.WeatherModel = WeatherModel;
}
getAll(query){
... | true |
95b4be548c24b710bb208ea5e7c3492cdb5efe7d | JavaScript | acidtone/wbdv-winter-2020 | /materials/cpnt262/assignments/assignment-3/import/import.js | UTF-8 | 1,217 | 2.796875 | 3 | [] | no_license | // This file imports gallery.js into your Mongo database. Change your db and collection names as needed.
// Setup Mongo Client
const MongoClient = require('mongodb').MongoClient;
require('dotenv').config();
// Import source data for insert
const images = require('./gallery.js');
// Setup server credentials securely
... | true |
d0e81cced91f2d2114704cdb944b424e414bc5d1 | JavaScript | Kitesur7/password-generation | /script.js | UTF-8 | 2,460 | 4.0625 | 4 | [] | no_license | // Assignment Code
let generateBtn = document.querySelector("#generate");
// Write password to the #password input
function writePassword() {
let password = generatePassword();
let passwordText = document.querySelector("#password");
passwordText.value = password;
}
// Add event listener to generate button
gen... | true |
4b00e9abe969f59d48d89502902455b124e3c221 | JavaScript | QueirozMirella/omnistack | /backend/src/index.js | UTF-8 | 1,249 | 2.640625 | 3 | [] | no_license | const express = require('express'); //agora eu tenho o expressa na variavel express
const mongoose = require('mongoose'); //conecta com a base de dados do mongodb
const routes = require('./routes');
const app = express(); //crio uma variavel que recebe a função express e agora a aplicação ta criada;
mongoose.connect(... | true |
ea5de3423696a33704b138234c884d7788ca2db7 | JavaScript | maskcoin/html_css_js | /zhufeng/21_process/8_exec.js | UTF-8 | 412 | 2.609375 | 3 | [] | no_license | //exec同步执行一个shell命令
let {exec} = require('child_process')
let path = require('path')
//用于使用shell执行命令, 同步
let p1 = exec('node test1.js a b c', {
cwd: path.join(__dirname, 'test2')
}, (err, stdout, stderr) => {
if (err) {
console.log(err)
} else {
console.log(stdout)
}
// console.log(a... | true |
1ca36ca207e1653dcde59d869d9ab1360636e685 | JavaScript | hammour/etsy | /scripts/main.js | UTF-8 | 2,952 | 2.609375 | 3 | [] | no_license |
var etsyObjects = {
url: 'https://api.etsy.com/v2/listings/active.js?api_key=6l5s7td5n29eqxjxza7h0yxn&keywords={whiskey}&includes=Images,Shop',
dataType: 'jsonp',
type: 'GET',
success: function(data){
console.log(data);
console.log(data.results[3].Images[0].url_170x135);
data.results.forEach(funct... | true |