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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
78306a1f14c04f2fbd8384af7d0bd1c886e45d02 | JavaScript | nik-el/shri18-home-work-4 | /server.js | UTF-8 | 2,980 | 2.765625 | 3 | [
"MIT"
] | permissive | const express = require('express');
const app = express();
const fs = require('fs');
const AVAILABLE_TYPES = ['info', 'critical'];
const port = process.env.PORT || 8000;
const formatValue = (value) => {
return (value < 10 ? '0' : '') + value;
};
const formatTime = (seconds) => {
const hours = Math.floor(seconds... | true |
2e782d7f088a40f2e6028bb3aacf63c48af63b57 | JavaScript | CrucifixArnaud/rapworldmap | /app/assets/js/components/shared/modal.js | UTF-8 | 2,031 | 2.546875 | 3 | [
"MIT"
] | permissive | import React from 'react';
import FocusTrap from 'focus-trap-react';
export default class Modal extends React.Component {
constructor(props) {
super(props);
// State
this.state = {
open: false,
modalOpener: null,
};
this.toggleModal = this.toggleModal.bind(this);
}
toggleModal... | true |
b2c60f21a0031eca0c53757fcbe0cc60f9bff6e4 | JavaScript | lcantillo00/node-files | /lions/client/app.js | UTF-8 | 3,010 | 2.875 | 3 | [] | no_license | // $('#submit').click(function() {
// $.ajax({
// url: "http://localhost:7070/lions",
// method: 'POST',
// success: function() {
// console.log("yous data is been post")
// },
// data: {
// ... | true |
24d4cdcb5abcfb2b23bd54311ec58e03ae29f126 | JavaScript | gideonakilas/LeetCode | /LeetCodeEasy/HappyNumber.js | UTF-8 | 425 | 3.890625 | 4 | [] | no_license | /**
* @param {number} n
* @return {boolean}
*/
const isHappy = function(n) {
const set = new Set();
while (n !== 1 && !set.has(n)) {
set.add(n);
n = toSquareSum(n);
}
return n === 1;
};
const toSquareSum = n => {
let result = 0;
while (n) {
result += (n... | true |
b18879da20c6fa8b8629700cf1e77c365d31819a | JavaScript | pradeep-git135/demo1 | /test/pageobjects/loginPage.js | UTF-8 | 1,212 | 2.515625 | 3 | [] | no_license | var basepage = require("./basePage")
class login extends basepage {
get username(){
return $("#ctl00_CPHContainer_txtUserLogin")
}
// async enterUsername(value){
// await (await this.username).clearValue()
// await (await this.username).setValue(value)
// await browser.pau... | true |
b5f880eb60dabf41d7df23fe2b9f4415eecaf537 | JavaScript | geovanisucci/todo-api | /src/controllers/todoController.js | UTF-8 | 1,842 | 2.828125 | 3 | [] | no_license | const service = require("../services/TodoService");
exports.get = async (req, res) => {
try {
const todo = await service.getTodoById(req.params.id);
if (!todo) {
return res.status(404).json("There are no todo published with current id.");
}
res.json(todo);
} catch ... | true |
a3206b035f42b972493876e39a4c78d96240b9f5 | JavaScript | Mueenullah/cvmaker | /app.js | UTF-8 | 2,144 | 3.0625 | 3 | [] | no_license | // let n=0;
// while (n<3){
// console.log(n)
// n++;
// }
// let i=8;
// while(i>5){
// console.log(--i)
// }
// let i=8;
// while(i>5){
// console.log(i--)
// }
// let a=0;
// while(a<15) {
// console.log(a);
// a++;
// }
// let b=null;
// while(b<4){
// console.log(b);
// b++;
// }
// let b=null;... | true |
0e6425d47737f26ef10b7602292a1b926b29d142 | JavaScript | mellhime/meetups-project | /src/data.js | UTF-8 | 4,117 | 2.578125 | 3 | [] | no_license | /** URL адрес API */
export const API_URL = process.env.VUE_APP_API_URL;
/**
* Возвращает ссылку на изображение митапа для митапа
* @param meetup - объект с описанием митапа (и параметром meetupId)
* @return {string} - ссылка на изображение митапа
*/
export function getMeetupCoverLink(meetup) {
return `${API_URL... | true |
19c3a13cff86d713ee88abd758991535d4f9e333 | JavaScript | dbbrandt/memory-maestro | /src/components/goal/GoalForm.js | UTF-8 | 3,605 | 2.53125 | 3 | [] | no_license | import React, { Component } from "react";
import PropTypes from "prop-types";
import ImageInput from "../shared/ImageInput";
import "./goal.css";
const initState = () => ({
id: 0,
title: "",
description: "",
instructions: "",
image_url: "",
image_data_url: "",
image_filename: ""
});
class GoalForm exten... | true |
bd9adfa3dfaceb8d9bc101de47f93879eb76862b | JavaScript | 1415rr/js-prog-a-bordo | /aula14 - objetos2.js | UTF-8 | 6,663 | 4.0625 | 4 | [] | no_license | // exercicio.js
////////////////////////////////////////////////////
// tirei o dw ( document.write ) - nunca foi usado ate agora
function cl (...texto) {console.log (...texto)};
function c2 (texto) {console.log (texto, ' = ', this[texto])};
////////////////////////////////////////////////////
/* primei... | true |
20072f5d93e4a5b86ef17799580f0434ef6711a7 | JavaScript | twerschmann/Absolution-TFC-Guild-Info | /public/js/ElementUtility.js | UTF-8 | 1,527 | 3.109375 | 3 | [] | no_license | const hide = (elem) => {
elem.style.display = 'none';
}
// show an element
const show = (elem) => {
elem.style.display = 'flex';
}
// toggle the element visibility
const toggle = (elem) => {
// if the element is visible, hide it
if(window.getComputedStyle(elem).display !== 'none') {
hide(elem... | true |
e8326966492f3e7d9ecaa53d32ec7c5b4edfb70a | JavaScript | vikrant9031/facerecogserver.github.io | /server.js | UTF-8 | 2,373 | 2.53125 | 3 | [] | no_license | const express=require('express');
const bodyParser=require('body-parser');
const bcrypt =require('bcrypt-nodejs');
const app= express();
const cors=require('cors');
const knex=require('knex');
const postgres=knex ({
client: 'pg',
connection: {
host : '127.0.0.1',
user : 'postgres',
password : 'vikran... | true |
a964277db11ad8195b6064c2a0761cfdb350093e | JavaScript | sosavis/fundamentosjs | /fundamentos/05-numbers.js | UTF-8 | 493 | 3.5 | 4 | [] | no_license | let edad = 36;
// edad = edad + 1;
edad -= 1;
let peso = 78;
let sandwich = 1;
// peso += sandwich;
let futbol = 3;
let vino = 256.3;
let carrito = Math.round(vino * 100 * 3) / 100;
let carritoStr = carrito.toFixed(2);
let carrito2 = parseFloat(carritoStr);
parseInt();
let n = 16;
Math.pow(n, 2);
Math.sqrt(... | true |
60f2d3ed2f1420bb5190490265387a1324e0f6a4 | JavaScript | panargirakis/WebGL_Raytracer_Showcase | /WebGL.js | UTF-8 | 3,157 | 2.828125 | 3 | [] | no_license | // EXTRA CREDIT:
// refractions are supported. See the rayTracing.html file and README.md file.
// The arrow keys are used for changing the x,y coordinates of the camera.
// Soft reflections. Reflections are affected by the angle of intersection.
let program;
let rayX = 0.0;
let rayY = 0.5;
let incChangeEye = 0.02... | true |
e857c989b4e0ed63b962fa30d66c03c61b7b8c61 | JavaScript | alaindave/staff-manager | /services/sendEmail.js | UTF-8 | 942 | 2.515625 | 3 | [] | no_license | const nodeMailer = require('nodemailer');
sendEmail = (req, res) => {
const { firstName, lastName, startDate, endDate, adminEmail, adminName } = req.body;
const transporter = nodeMailer.createTransport({
host: 'smtp.gmail.com',
port: 465,
secure: true,
auth: {
user: process.env.email,
pass: process.en... | true |
4d0997d6b4cd18bcdf1cba049bac431bbd0a8462 | JavaScript | nenadstojkovic/pharmacy-app | /src/components/pages/Products.js | UTF-8 | 5,117 | 2.515625 | 3 | [] | no_license | import React, { useState, Fragment } from 'react';
import ProductRow from '../products/ProductRow';
import ProductRowEdit from '../products/ProductRowEdit';
const Products = () => {
const productsData = JSON.parse(localStorage.getItem('data'));
const [products, setProducts] = useState(productsData);
c... | true |
ffbb112e49a7466718f31cc70c2cb404cbf587f1 | JavaScript | zhangming123456/mmtc-client-master | /utils/date/getDate.js | UTF-8 | 230 | 2.703125 | 3 | [] | no_license | "use strict";
module.exports = function (dateStr) {
let dateArr = dateStr.split(/[- : \/]/);
return new Date(+dateArr[0], +dateArr[1] - 1, dateArr[2] || '01', dateArr[3] || '00', dateArr[4] || '00', dateArr[5] || '00');
} | true |
416f1c554f5929695cfe11b64d5c476284ffcd79 | JavaScript | cjchan93/weather-app | /assets/components/forecast-7days/datetime.js | UTF-8 | 4,333 | 2.703125 | 3 | [
"MIT"
] | permissive | import React, {useEffect, useState} from 'react';
import { View, Text, StyleSheet } from 'react-native';
import moment from 'moment-timezone';
const WeatherItem = ({title, value, unit}) => {
return (
<View style={styles.weatherItems}>
<Text style={styles.weatherItems__title}>{title}</Tex... | true |
3d19a0f77e5441699cb7ec37d2379e119c2cd292 | JavaScript | li-mao/Json2GrayMatter | /Json2GrayMatter.js | UTF-8 | 1,731 | 3.40625 | 3 | [] | no_license | function json2md(obj,tt = ""){
if( isString(obj) ){
return [tt + obj]
}else if( isNumber(obj) ){
return [tt + obj]
}
else if(isArray(obj)){
let arr = [];
for(const item of obj){
if( isString(item) ){
arr = arr.concat([ tt + "-\t" + item]);
... | true |
ba611c9de1cf00f9a5972d5b59320fce481f0bab | JavaScript | uccser/cs-field-guide | /csfieldguide/static/interactives/viola-jones-face-detector/js/viola-jones.js | UTF-8 | 12,825 | 2.953125 | 3 | [
"CC-BY-NC-SA-4.0",
"BSD-3-Clause",
"CC0-1.0",
"ISC",
"Unlicense",
"LicenseRef-scancode-secret-labs-2011",
"WTFPL",
"Apache-2.0",
"LGPL-3.0-only",
"MIT",
"CC-BY-SA-4.0",
"LicenseRef-scancode-public-domain",
"CC-BY-NC-2.5",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-unknown... | permissive | const interact = require("interactjs");
require("tracking");
// listen for HTML5 native drag and drop API dragstart event and ignore them.
document.addEventListener('dragstart', function(event) {
// use interact.js' matchesSelector polyfil to
// check for match with your draggable target
if (interact.matchesSele... | true |
8ec4afd7035a6b8cf770f27a3dbddca90b028029 | JavaScript | ortexx/load-alias | /load-alias.js | UTF-8 | 1,692 | 2.578125 | 3 | [
"MIT"
] | permissive | "use strict";
let path = require('path');
class LoadAlias {
constructor(rootPath, config) {
if(!config) {
config = rootPath;
rootPath = undefined;
}
this.rootPath = rootPath || process.cwd();
this.config = config || {};
}
load(link) {
return require(this.getFul... | true |
6ace424df552432b74991365312a24e32057675a | JavaScript | somsekhardash/JS | /array.js | UTF-8 | 1,076 | 4.5 | 4 | [] | no_license | // How to create Array
var number = [1, 2, 3, 4, 5];
var numbers = new Array(1, 2, 3, 4, 5);
console.log(number, numbers);
console.log(Array.from("som"));
console.log("--------------------");
/* Example - every*/
const isEven = (num) => num % 2 == 0;
const res = [2, 4].every(isEven);
console.log(res);
console.log("-... | true |
e4be474fa40fb7d0b5795ac8c68a9c478409e903 | JavaScript | codeparl/Codeparl-Vanillajs-photo-gallery | /PhotoGallery.js | UTF-8 | 9,142 | 2.859375 | 3 | [
"MIT"
] | permissive | // PhotoGallery.js - version 1.0 1
//
// Copyright (c) 2020. CodeParl for code examples.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain th... | true |
981878b18c8513b7c3d114483189c96863b41f84 | JavaScript | Bloody-Face/work1 | /js/Registration.js | UTF-8 | 6,246 | 2.671875 | 3 | [] | no_license | document.getElementById("CheckBox").addEventListener('click', hidden);
function start() {
hidden();
checkVar();
disabledButton();
}
function checkVar() {
var way = getUrlParameter("Type");
var objSel = document.getElementById("price");
document.getElementById("Type").value = way;
if(way =... | true |
81fe27310b3d65ae24164a557c332444b2447c19 | JavaScript | YoniEnder/Magit-WebApp | /MagitWeb/web/Pages/UserPage/UploadFile.js | UTF-8 | 1,136 | 2.59375 | 3 | [] | no_license | //
// $(function () {
// var btnPressed=$("#pressed");
// btnPressed.bind("click",function () {
// $.ajax({
// data:this.val(),
// url: 'selectUser',
// success:function () {
// window.location.replace("../../Pages/UserPage/UserPage.jsp");
// ... | true |
4aa78ae9903efca1a9e041412101abcbbafc212e | JavaScript | chanwoo00106/login-server | /app/src/public/js/login.js | UTF-8 | 685 | 2.859375 | 3 | [] | no_license | "use strict";
const id = document.querySelector('#id');
const pw = document.querySelector('#pw');
const form = document.querySelector('.sign-in-form');
form.addEventListener('submit', e => {
const req = {
id: id.value,
pw: pw.value
};
fetch("/login", {
method: 'POST',
hea... | true |
61952b3f7a08effe0629d9c25844310009709d31 | JavaScript | Tonire/RRHH-Analytics | /iManagerGen/MVCApp/Scripts/instalacion.js | UTF-8 | 1,114 | 2.640625 | 3 | [] | no_license | function iniciar() {
document.getElementById('apariencia').style.display = "none";
}
function cambiar()
{
if (document.getElementById('apariencia').style.display == "none")
{
document.getElementById('datos').className = "register-box-body animated fadeOutRightBig";
document.getE... | true |
d51be19d16838b8685daa30d24d7f99dc1c22c1b | JavaScript | thisisquitealongname/tojam | /util.js | UTF-8 | 578 | 2.640625 | 3 | [] | no_license | Util = {
randint: function(l, u) {
if(!u) {
u = l;
l = 0;
}
return Math.floor(Math.random()*(u-l) + l);
},
sum: function(l) {
var o = 0;
for(i = 0; i < l.length; i++)
o += l[i];
return o;
},
/* for debugging, mostly. todo: removeeeeeeee */
sleep: function(mill... | true |
c9ef3e3b23567af021eb8cdc065c8074378a597a | JavaScript | Mahalakshmi-24/sample-code | /backend/express/animals/1-animals-static/public/js/client.js | UTF-8 | 1,509 | 3.546875 | 4 | [] | no_license | console.log("Hello world!");
// Our animal data structure: An array of objects.
const imgList = [
{
id: 237,
title: 'Puppy'
},
{
id: 433,
title: 'Bear'
},
{
id: 577,
title: 'Moose'
},
{
id: 582,
title: 'Co... | true |
60a12acfbb14decf11bc08998d8b861b4ecd8709 | JavaScript | jcbrown14/ITEC225 | /Project3/Code/proj3_covid1/covid1.js | UTF-8 | 922 | 2.59375 | 3 | [
"MIT"
] | permissive | // https://rawgraphs.io
// DATA SET
// Covid cases in Germany being pulled from my Github repo----------------------------------------------------------------
var ger = "https://raw.githubusercontent.com/jcbrown14/ITEC225/main/Project3/covid_World_Data/germany/deu_case_data_rev.csv"
Plotly.d3.csv(ger, functi... | true |
c2e0f5654a52772f98d40e13e999c9f99f9df38d | JavaScript | Regigigas/backStageOA | /public/javascripts/pages/common/register.js | UTF-8 | 3,134 | 2.59375 | 3 | [] | no_license | function Register(container, modelContainer) {
this.container = container;
this.modelContainer = modelContainer;
this.init();
}
var registerBtnTem = `
<li>
<a href="javascript:;" data-toggle="modal" data-target=".js-registerModal">
注册
</a>
</li>
`;
Register.modelTem = `
<div class="modal fad... | true |
d3078dfd94106d0c28ad9f7113a5d61072655208 | JavaScript | ydzsobj/mall | /public/js/admin/product/sku_check.js | UTF-8 | 1,549 | 2.6875 | 3 | [] | no_license | function submit_check(){
var check_target_attr = model_id ? $("#editModal_" + model_id).find('.sku_name:checked') : $('.sku_name:checked');
var check_target_attr_name = model_id ? $("#editModal_" + model_id).find('.sku_value:checked') : $('.sku_value:checked');
if(check_target_attr.length == 0){
a... | true |
2ef6a01b113668056782192a799d932d2d93f5bd | JavaScript | Ade32000/Exercices_JavaScript | /exercicesjavascript.js | UTF-8 | 1,271 | 3.78125 | 4 | [] | no_license | // Exercice01
// var toto = 'Bonjour';
// alert(toto);
// Exercice02
// var nom = "Doe";
// var prenom = "John";
// var ville = "New York";
// alert('Nom : '+nom+'\nPrénom : '+prenom+'\nVille : '+ville);
// Exercice03
// var rep = prompt('Quel est votre prénom?','Votre réponse ici');
// if (rep == null) {
// alert(... | true |
d1ae68964ce257e996b807b1d1b134b5d8a47fbc | JavaScript | Nashoba-Robotics/MotionProfilingGUI | /ClientAndData/javaScript.js | UTF-8 | 16,699 | 2.828125 | 3 | [
"MIT"
] | permissive | var cols = 2;
var keys = [];
var chosenGraph = 0;
$(document).keypress(function(e) {
keys[e.which] = true;
});
$(document).keyup(function(e) {
keys[e.which] = false;
});
var Graph = function() {
this.aliveness = .1;//for keyboard shortcuts
//Button to name graph
var self = this;
self.graphName = "";
self.xaxis... | true |
23b4ecaa82f608e022be5ea64ef0d9be57622236 | JavaScript | huypham2106/JSBuoi1 | /JS/main-js5.js | UTF-8 | 845 | 3.75 | 4 | [] | no_license | /**
* Khối 1:
* + Số nguyên dương có 2 chữ số (n)
* + Số hàng chục
* + Số hàng đơn vị
*
* Khối 2:
* +B1: Gán giá trị cho số nguyên dương nhập vào
*
* +B2: Lập cộng thức để lấy được hàng chục ten
*
* +B3: Lập cộng thức để lấy được hàng đơn vị unit
*
* +B4: Tính tổng và hiển thị kết quả
*
* ... | true |
aafd2e63bca2633bcb0e5b02744f40a1bd0da952 | JavaScript | orisailes/Bootcamp | /javascript_course/2.2/index.js | UTF-8 | 323 | 3.171875 | 3 | [] | no_license | function tellFortune(jobTitle, location, partnerName, numberOfChildren) {
return `You will be ${jobTitle} at ${location}, your partner name will be ${partnerName} and youve got ${numberOfChildren} kids!`
}
let a = `Farmer`;
let b = `Golan Heights`;
let c = `Lusy`;
let d = `7`;
console.log(tellFortune(a, ... | true |
ab037049ce95197a325d87c1620f14e5eaab3d6d | JavaScript | guckstift/garden-chamber | /bar.js | UTF-8 | 546 | 2.828125 | 3 | [] | no_license |
function Bar(val, x, y, offs, col)
{
this.val = val;
this.offs = offs;
this.col = col;
PIXI.Graphics.call(this);
this.position.set(x, y);
}
subclass(Bar, PIXI.Graphics)
Bar.prototype.onRender = function ()
{
if (this.alpha > 0)
this.alpha -= 0.002;
this.clear();
this.beginFill(this.col);
this.lineStyl... | true |
6ca1f6caf1170742ad7557127e3c6a75fc8fd8d3 | JavaScript | ecolip/ES6-ES11 | /ES9/31-正则扩展-反向断言.js | UTF-8 | 276 | 3.203125 | 3 | [] | no_license | // 正则扩展-反向断言
const str = 'es666啊啊啊555啦啦啦'
// 正向断言 -- 提取出555
const reg1 = /\d+(?=啦)/
const result1 = reg1.exec(str)
console.log(result1)
// 反向断言
const reg2 = /(?<=啊)\d+/
const result2 = reg2.exec(str)
console.log(result2)
| true |
4caf1a1293063355115eeb6a2a78188a5a9c35fd | JavaScript | sugarcrm/sucrose | /src/transform.js | UTF-8 | 18,702 | 2.765625 | 3 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | import d3 from 'd3';
import utility from './utility.js';
import language from './language.js';
var transform = (function() {
function getArrayX(d) {
return d[0];
}
function getArrayY(d) {
return d[1];
}
function getObjectX(d) {
return d.x;
}
function getObjectY(d) {
return d.y;
}
fun... | true |
ba7ab10563300af18738c6bfcd3072a9852825c9 | JavaScript | georgematos/javascript_funcional_e_reativo_C0d3r | /js_funcional/funcoes/4_funcao_de_callback.js | UTF-8 | 502 | 3.71875 | 4 | [] | no_license | const somarNoTerminal = (a, b) => console.log(a + b)
const subtrairNoTerminal = (a, b) => console.log(a - b)
const somar = (a, b) => a + b
const subtrair = (a, b) => a - b
const exec = (a, b, callback) => callback(a, b)
exec(56, 38, somarNoTerminal)
exec(182, 27, subtrairNoTerminal)
console.log(exec(200, 30, subtr... | true |
f7f0301418aedc657e358bcdd04dad50ffe89922 | JavaScript | TonyBCodes/finalmnm | /client/src/pages/cust_info.js | UTF-8 | 11,526 | 2.734375 | 3 | [] | no_license | // JavaScript source code
import React, { Component } from "react";
import { Redirect, withRouter } from 'react-router-dom';
import axios from "axios";
class CustInfo extends Component {
state = {
email: this.props.match.params.email,
password: "",
conf_pw: "",
firstname: "",
... | true |
6adbe05f7b186b5c03c5220598fc50e4aefafdd0 | JavaScript | GreanTech/easyid-signing-demo | /easyid-signing-demo/Scripts/postMessageListener.js | UTF-8 | 1,872 | 2.828125 | 3 | [
"MIT"
] | permissive | var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
var eventer = window[eventMethod];
var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
var loadEvent = eventMethod == "attachEvent" ? "onload" : "load";
var ensureSlashTerminated = function (s) {
if (s.endsWith(... | true |
d0daafca62b5496313acaea678a247da2921ae9c | JavaScript | VoxT/graphql-chatbox | /src/components/NotifyMe.js | UTF-8 | 1,313 | 2.828125 | 3 | [] | no_license | const notifyMe = (title, body, data, callback) => {
let notification;
var options = {
body: body,
icon: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png ',
data: data
};
// Let's check if the browser supports notifications
if (!("Notification" in window)) {
alert("This browser... | true |
f10865bc0340f54ea5ac222bb6df45befa06494f | JavaScript | espaciomore/budgeting | /e2e/definitions/nav-reports.definition.js | UTF-8 | 2,542 | 2.53125 | 3 | [
"MIT"
] | permissive | const assert = require('assert');
const { Given, When, Then } = require('cucumber');
Given('I go on the Reports website {string}', url => {
browser.url(url);
});
When('I select Reports by clicking on link {string}', selector => {
browser.click(selector);
});
Then('the page url should contain {string}', expected_... | true |
627a3e0c598823a2bc628f21956cb6e0658005b6 | JavaScript | gauravtiwari5050/rihandjs | /test/lib/routing/route.js | UTF-8 | 2,411 | 2.546875 | 3 | [] | no_license | const assert = require('assert');
const { expect } = require('chai'); // eslint-disable-line
const { Route } = require('../../../lib/routing/routes');
describe('class: Route', function() { // eslint-disable-line
describe('method: constructor', function() { // eslint-disable-line
it('should throw exception if pat... | true |
d396517540e72b4d6c144b5d4acfa9ad68a61aa6 | JavaScript | bradlys/monochromatic-panda | /src/bradlys-ytd-injector.js | UTF-8 | 6,932 | 3.390625 | 3 | [
"MIT"
] | permissive | let URLToDecryptionFunction = {};
/**
* Takes in a URL to a text type file and returns the content once the promise resolves.
* @param {string} url
* @returns {Promise}
*/
function getContent(url) {
return new Promise(function(resolve, reject) {
let request = new XMLHttpRequest();
request.onreadystatechange =... | true |
663919f8e65e49b8442c244f5cca813fb03b5ce3 | JavaScript | dromanchuck/tms-js-basic | /lesson06/homeWork.js | UTF-8 | 5,545 | 4 | 4 | [] | no_license | /**
* Домашнее задание к занятию 6
* Каждому нужно создать новую ветку от ветки master. Название ветки должно содержать имя + первая буква фамилии + /lesson05.
* Например: dmitryR/lesson06. Выполнение задания производится в свое ветке и в этом файле.
* После выполнения задания делаете пулл реквест и сообщаете о том... | true |
208c7da91737abe03cee55bcbb75440243294958 | JavaScript | R74nCom/sandboxels | /mods/fire_mod.js | UTF-8 | 19,395 | 2.875 | 3 | [] | no_license | var modName = "mods/fire_mod.js";
var libraryMod = "mods/code_library.js";
if(enabledMods.includes(libraryMod)) {
/* elements.iron.reactions.radiation =
{elem1: 'dirty_water', elem2: null}
when radiation touches iron,
the iron turns into dirty_water (elem1)
and the radiation deletes itself (elem2)
... | true |
d1da4f522fef87b5390fab990710d137bb8042d7 | JavaScript | RidgeA/ita-playtika-course | /001-js-fundamentals-part-1/001-primitive-types.js | UTF-8 | 1,045 | 3.796875 | 4 | [] | no_license | 'use strict'
// |var|let|const
// variable name - $_a-z0-9
//
// n0 = 0; // legacy
// var n1 = 1; // legacy
let n2 = 2;
const n3 = 3;
// number
// special cases: NaN, +-Infinity
let nubmer1 = 1;
let nubmer2 = 0b01111;
let nubmer3 = 0x1fffff;
let number4 = 1.000001;
let number5 = 1 + 2; // - / *
let number6 = 2 ** 10... | true |
77f384430f71cc10820a63f7a75f9e974eec139f | JavaScript | twiglau/Know-JS | /你不知道JS_上_Prototype/03-prototype.js | UTF-8 | 984 | 3.8125 | 4 | [] | no_license | /**
* [[Prototype]]机制的意义? 为什么JS开发者
* 非这么大力气(模拟类)在代码中创建这些关联呢?
*/
var foo = {
something: function(){
console.log( "Tell me something good ...")
}
}
var bar = Object.create(foo);
bar.something();
/**
* 对于以上的解释:
* Object.create(...)会创建一个新对象(bar)并把它关联到我们指定的对象(foo),这样
* 我们就可以充分发挥[[Prototype]]机制的威力(委托)... | true |
75bcb35c792f837cdcc72df94733fedc34456516 | JavaScript | manmeet-kaur18/EdcHackthon | /Portal/Medi+/public/js/appointment.js | UTF-8 | 5,952 | 2.640625 | 3 | [] | no_license | $(document).ready(function () {
var element = function (id) {
return document.getElementById(id);
}
var status = element('status');
var contains = element('contains2');
var contains1 = element('contains1');
//set default status
var statusDefault = status.textCount;
var setStatu... | true |
11b917f90d19ce070b14f5c36d615a9f881730f1 | JavaScript | daroOkpeku/all-html-css-js-and-php-code | /3awater/won.js | UTF-8 | 621 | 2.625 | 3 | [] | no_license | let road = document.querySelector('.road');
let speech = document.querySelector('.speech');
road.addEventListener('click', function go(){
speech.classList.toggle('speech-active');
road.classList.toggle('toggle');
});
let sec = document.querySelector('.sec');
let lod = document.querySelector('.lod')... | true |
b96bb15a8c2d63f8470c5598af225cd1a10ea657 | JavaScript | dicoderr/928893-buy-and-sell-3 | /src/service/cli/generate.js | UTF-8 | 2,960 | 2.859375 | 3 | [] | no_license | 'use strict';
const fs = require(`fs`).promises;
const chalk = require(`chalk`);
const {nanoid} = require(`nanoid`);
const {ExitCode} = require(`../../constants`);
const {getRandomInt, shuffle, getRandomRange} = require(`../../utils`);
const MAX_ID_LENGTH = 6;
const DEFAULT_COUNT = 1;
const MAX_COUNT = 1000;
const MA... | true |
5c705124b67efafa4d85cc76ceb3a12a6f9f17e8 | JavaScript | jatinseth2007/countries-app-backend | /src/models/user/index.js | UTF-8 | 3,439 | 2.84375 | 3 | [
"MIT"
] | permissive | const bcrypt = require('bcrypt');
const jwt = require('jsonwebtoken');
class User {
/**
* Function to add new user into system
* Jatin Seth
*/
async createNew({ name, email, password }) {
try {
const newUser = {
name,
email
};
... | true |
aa5c6783b32be1c46a425f596b4477d45db5adc9 | JavaScript | AstridaDan/this-is-my-project_front-end | /assets/js/theme.js | UTF-8 | 3,739 | 2.78125 | 3 | [] | no_license |
//CHANGING DISPLAY FOR MAP
//Riga
function showOtherRiga(){
document.getElementById('rigaEdiens').style.display = 'block';
document.getElementById('rigaFood').style.display = 'block';
document.getElementById('JelgavaFood').style.display = 'none';
document.getElementById('ogreEdiens').style.display = 'none';
... | true |
8d844566f7a6efb1a8b800932983faf65faac9d4 | JavaScript | manojreddy1877/Trading-UI | /src/Components/StockHistory/StockHistory.js | UTF-8 | 2,645 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react'
import url from '../../config.json'
import axios from 'axios'
import './StockHistory.css'
export class StockHistory extends Component {
constructor(props){
super(props)
this.state={
allStocksList:[]
}
}
componentDidMount() {
... | true |
45c61c6b9c616b355c1b9b4c19ef14f627bbef6e | JavaScript | AndresHMosqueda/smashCar | /main.js | UTF-8 | 8,093 | 2.578125 | 3 | [] | no_license | let canvas = document.getElementById("canvas");
let ctx = canvas.getContext("2d");
//Variables Globales
let c_i = 0;
let height = canvas.height;
let width = canvas.width;
let anglep1;
let anglep2;
let keys = [];
let speed = 3;
let speedShoot = 9
let friction = 0.98;
let lastCalledTime;
let fps;
let frames = 0;
let ga... | true |
86ea1595caa79db1f1ed336d79a43d83f0a2d67e | JavaScript | anamontiaga/Adalab-M2-ejercicios | /2.2. Intro a la programación 2/Ejercicio 4/main.js | UTF-8 | 190 | 3.0625 | 3 | [] | no_license | "use strict";
const numberPerson = 9;
const totalPaid = 128;
const sakeShot = 2;
const pricePerson = (`Each person pays ${(totalPaid-sakeShot)/numberPerson}€`);
console.log(pricePerson); | true |
cce95e95fd32f676fe7a7231c1e6566428d05dba | JavaScript | igorlaur/Javascript | /relacionais.js | UTF-8 | 877 | 3.90625 | 4 | [] | no_license | console.log('01)', '1' == 1)
console.log('02)', '1' === 1) // Deu falso porque um é string e outro number. Portanto os dois deveriam ser do mesmo tipo
console.log('03)', '3' != 3) // Diferente
console.log('04)', '3' !== 3) // Diferente de tipos. String e Number
console.log('05)', 3 < 2)
console.log('06)', 3 > 2)
cons... | true |
6e6088a6abcd5f319e8b03d92ca03ff2ec3b0c0c | JavaScript | mathias/madjs_talk_2013_04_08 | /slide_03.js | UTF-8 | 178 | 3.140625 | 3 | [] | no_license | /*
* 3. Basic Functions
*/
// Function syntax:
// function () {}
(function () {})
//=> [Function]
// Functions and identity
(function () {}) === (function () {})
//=> false
| true |
e54124abd6e0dc1cf21e66df3b73276c9a497536 | JavaScript | parevalo/gee-ccdc-tools | /ccdcUtilities/ccdc.js | UTF-8 | 21,795 | 3.125 | 3 | [
"MIT"
] | permissive | /** ///////////////////////////////////////////////////////////////////
*
* Utility functions for filtering and modifying CCD output
*
** /////////////////////////////////////////////////////////////////*/
/**
* Create sequence of segment strings
* @param {Integer} nSegments Number of segments to create labels... | true |
ae117f696a09c3f3124918385ec91920d5eeee0f | JavaScript | ana-kadagishvili/homework4 | /nicholasjohnson3/script.js | UTF-8 | 1,630 | 3.90625 | 4 | [] | no_license | /* Closure */
// 1
let outer = function() {
let a = "A Local variable"
let inner = function() {
alert(a)
}
window.fnc = inner;
}
outer();
fnc();
// 2
// let a = 12;
// (function() {
// alert(a);
// })(); // the result is 12
// var a = 5;
// (function() {
// var a = 12;
// alert(a);... | true |
86d7ab1b979382d73597fad5471d9bd7c8f11300 | JavaScript | redDragonLH/ldle | /leetcode/algorithm/3-longest-substring-without-repeating-characters.js | UTF-8 | 2,199 | 4.34375 | 4 | [] | no_license | /**
* 3. 无重复字符的最长子串
*
* 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。
*/
/**
* 最直观的方案,轮询,用对象把轮询到的元素保存起来,轮询时判断是否有相应的元素在对象上,
* 但是有个问题,在对象上有数据时必须把重复的字符之前的字符全都删掉,比较麻烦,要不要考虑再来个数组保存位置~~
* @param {string} s
* @return {number}
*/
var lengthOfLongestSubstring = function(s) {
if(!s)return 0;
let map = new Map();
let co... | true |
b81695ab2e4c1c1d4927239c78f5222e2299c5dd | JavaScript | guialera/Module-3 | /Assignments/vacation-spots/src/Spot.js | UTF-8 | 1,343 | 2.765625 | 3 | [] | no_license | import React from "react"
function Spot(props) {
if (props.time === "Fall") {
var styles = {
backgroundColor: "#FA8F04"
}
} else if (props.time === "Winter") {
var styles = {
backgroundColor: "white"
}
} else if (props.time === "Spring") {
var... | true |
e51434ea79415374aba33cdb7a2923747a05ad9f | JavaScript | duongnv05/calculator-reactjs | /src/components/Calculator.js | UTF-8 | 3,467 | 2.859375 | 3 | [] | no_license | import React, { useState, useEffect, useRef } from 'react';
import ListButton from './ListButton';
import './Calculator.css';
//- listen the 'keyboard' event
function useEventListener(eventName, handler, element = window) {
const savedHandler = useRef();
useEffect(() => {
savedHandler.current = handler;
}... | true |
cc7a207bcdec6d6e9a8c758f00bb17d23e9ae2b2 | JavaScript | Rogueshade/w9 | /js/app2.js | UTF-8 | 310 | 3.765625 | 4 | [] | no_license | var age = [16 , 17 , 19, 22] ;
var isSubscribed = [true,false,true,false]; //string(just collecton of characters wrapped in quotes)
var counter = 0;
while(counter < 10) {
console.log(counter);
counter++;}
for(var i = 0; i < 3; i++){
console.log(age[i], isSubscribed[i]);
}var counter = 0;
| true |
7fd3299751c1e83782eea350557abb547b09ebed | JavaScript | boterosalas/udemy-javascript | /01-fundamentos/clases/class.js | UTF-8 | 1,305 | 3.625 | 4 | [] | no_license | class Persona {
static _conteo = 0;
static get getConteo(){
return `${Persona._conteo} instancias`
}
static nombre = 'David'
static mensaje(){
console.log(`${this.nombre}`);
}
nombre = '';
codigo = '';
frase = '';
comida = '';
constructor(
nombre = ... | true |
126bd77a923eea45695f58351d702d8737261783 | JavaScript | hevin-lee/vant | /packages/utils/index.js | UTF-8 | 616 | 2.625 | 3 | [
"MIT"
] | permissive | import Vue from 'vue';
export const isServer = Vue.prototype.$isServer;
export function isDef(value) {
return value !== undefined && value !== null;
}
export function get(object, path) {
const keys = path.split('.');
let result = object;
keys.forEach(key => {
result = isDef(result[key]) ? result[key] : ... | true |
f17269442bc94503a7ba650146e71eea7ba31fc6 | JavaScript | lukeroc/atom-c | /src/lib/components/atoms/button/index.js | UTF-8 | 1,415 | 2.5625 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
class Button extends Component {
// Prop type checking
static propTypes = {
className: PropTypes.string.isRequired,
disabled: PropTypes.bool,
loading: PropTypes.bool,
onClick: PropTypes.... | true |
33bf83babef6cd9e31b06e8fd09bc060d27c4575 | JavaScript | ikim0106/tk69 | /utils/printList.js | UTF-8 | 3,559 | 3.203125 | 3 | [] | no_license | exports.printList = function (message, inputArray) {
function sleep(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms)
})
}
let list = inputArray.splice(1,inputArray.length)
console.log('list length', list.length)
let totalPages = Math.ceil(list.length / 10)
let pageNumber = 1
le... | true |
2c791ce56cda64c679d3cffb84b72fa809841d18 | JavaScript | AngelBWD/SoftUni-Technology-Fundamentals-with-JavaScript | /Arrays/04.Array Rotation .js | UTF-8 | 237 | 3.28125 | 3 | [] | no_license | function solve(arr1, n) {
let newArr = [];
for (let i = 1; i <= n; i++) {
let currentNum = arr1.shift();
arr1.push(currentNum)
}
console.log(arr1.join(" "));
}
solve([51, 47, 32, 61, 21], 2); | true |
2d770d2064a8fd713e507e2bdde35282a75011b5 | JavaScript | AntonDogadailo/HomeWorks | /hw4/substring.js | UTF-8 | 452 | 3.3125 | 3 | [] | no_license | function substring(str, a, b) {
str = "";
let answ = str.split('');
//let answ = [];
//answ.push(str);
// if (a > b) {
for (let i = b; i <= a; i++) {
answ.push(str[i]);
console.log(answ);
}
// }
// else {
// for (let i... | true |
63264d979f56b045fa849680e3498d02c7ca7772 | JavaScript | chr0nu5/core | /fusion/static/fusion/inputs/icon/icon.js | UTF-8 | 2,054 | 2.65625 | 3 | [
"MIT"
] | permissive | /* =============================================
* Add Icon Input
*
* addInput(id, getValue, setValue, initInput);
* ============================================= */
webrock.addInput(
'icon',
function($field) {
// getValue
var value = $(':text', $field).val();
re... | true |
6ae74c69ad7aaf032577891ee1654279aa129a58 | JavaScript | gopihimanshu/Student | /src/containers/Student.js | UTF-8 | 912 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
import Navigation from './Navigation';
class Student extends Component {
state = {
data :[]
}
componentDidMount () {
axios.get('http://localhost:8080/name/2')
.then(response => {
var dbData = resp... | true |
b5cc6a1c6955e74722d7199919c4b5171db00c6a | JavaScript | mdrbohlav/advent_of_code_2020_solutions | /03/1.js | UTF-8 | 800 | 3.140625 | 3 | [] | no_license | const readInput = require('../read_input');
const INPUT = readInput('03/input.txt');
const MOVE = {
horizontal: 3,
vertical: 1,
};
function countTrees(positions) {
return positions.filter(p => p === 'X').length;
}
function getNextPosition(map, move, horizontal, vertical) {
const vIndex = vertical + move.vert... | true |
d421c27f248da27f3137b754f788cd91220dcc50 | JavaScript | akinuri/akinuri.github.io | /2d-breakout-js/spikes.js | UTF-8 | 1,029 | 3.234375 | 3 | [
"MIT"
] | permissive | class Spikes {
constructor(x, y, width, height, spikePathEnd, fillStyle) {
this.init(...arguments);
}
init(x, y, width, height, spikePathEnd, fillStyle) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.spikePathEnd = spikePath... | true |
9bdf8daa06e4df1db6d79e7c27539c4628fe0dec | JavaScript | kenny0412/Tuiter | /Controller/login.js | UTF-8 | 826 | 2.71875 | 3 | [] | no_license | function login() {
console.log("estatus");
var div = document.getElementById("divErrorLogin");
var email = document.getElementById('email').value;
var pass = document.getElementById('pass').value;
var request = new XMLHttpRequest();
request.open('GET', '../Model/login.php', true);
request.se... | true |
6765875aeae6f3c14dc0dd457c937aa6f1006712 | JavaScript | greenspeed/WiproProgressbar | /app/view2/view2.js | UTF-8 | 2,578 | 2.578125 | 3 | [
"MIT"
] | permissive | 'use strict';
angular.module('myApp.view2', ['ngRoute','ui.bootstrap'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/view2', {
templateUrl: 'view2/view2.html',
controller: 'View2Ctrl'
});
}])
.controller('View2Ctrl', ['$scope',function($scope) {
var value = Math.floor((Mat... | true |
ab4d2bbde6ee7d46f2ae3135bcfefb6da2e89af4 | JavaScript | christinecha/can-i-go-there | /client/src/render.js | UTF-8 | 3,039 | 2.546875 | 3 | [] | no_license | function render () {
const isAvailablePassport = $option => {
const { countryCode } = $option.dataset
return this.AVAILABLE_PASSPORTS.indexOf(countryCode) > -1
}
const isAvailableDestination = $option => {
if (!this.state.passport) return false
const requirements = this.REQUIREMENTS_CACHE[this.st... | true |
d0c4101587ff2491ad090792e1d7a240537ec9f9 | JavaScript | AlgoProjectH1/application | /app_dev/services/Game/Controllers/Intersections.js | UTF-8 | 2,805 | 3.6875 | 4 | [] | no_license | class Intersections {
/**
*
* Constructor
* @param int gobanSize
* @param bool autocomplete (optional)
*/
constructor(gobanSize, autocomplete) {
this.interCount = gobanSize;
this.intersections = this.initIntersections(autocomplete);
this.elements = $('#elements'... | true |
74881e28143d5eae66d8badf6510478bafadf7d3 | JavaScript | vertalik/vertalik.github.io | /form/common.js | UTF-8 | 747 | 2.5625 | 3 | [] | no_license | // $(document).ready(function() {
// $("#form").submit(function() {
// $.ajax({
// type: "POST",
// url: "mail.php",
// data: $(this).serialize()
// }).done(function() {
// $(this).find("input").val("");
// alert("Спасибо за заявку! Скоро мы с вами свяжемся.");
// $("#form").trigger("reset");
//... | true |
96c3499419dd846f58a1557b31e178322aab7357 | JavaScript | terrimwoods/test | /Session 1/script7.js | UTF-8 | 362 | 4.03125 | 4 | [] | no_license | let numbers =[10,8,7,9,8,9,7];
var average=0;
//sum the values (**high level use the 'for' loop)
function findAverage(array){
var sum =0;
for(var i =0 ; i <array.length; i++){
sum+= array[i];
}
console.log(sum);
}
//calculate the average(** high level is the length function)
//disp... | true |
97532835f584aeba8a6e38e64908758436ceb1fe | JavaScript | alvareznahuel/aws-workshop | /edge.js | UTF-8 | 1,583 | 2.5625 | 3 | [] | no_license | 'use strict';
function parseCookies(headers) {
const parsedCookie = {};
if (headers.cookie) {
headers.cookie[0].value.split(';').forEach((cookie) => {
if (cookie) {
const parts = cookie.split('=');
parsedCookie[parts[0].trim()] = parts[1].trim();
... | true |
85f1be98ba0f83f32f4666345a64d68c35d36596 | JavaScript | EvanCampbellWeiner/BCWBooks | /scripts/splitchar.js | UTF-8 | 704 | 2.8125 | 3 | [] | no_license | /**
* Splitchar.js
* @author emisfera - Razvan B.
Email: balosinrazvan@yahoo.com
GitHub: https://github.com/razvanbalosin
Work: FrontEnd Developer
https://github.com/razvanbalosin/Splitchar.js
Description on BCW Books: styles the BCW Books title on the homepage to be half grey, half black.
*/
$.fn.splitchar = f... | true |
bb57597df639fd6d67e8a74a770c003b53b47000 | JavaScript | antiooftah/Web-Programming-Fundamentals | /Week 3/conditionals_business/js/script.js | UTF-8 | 517 | 3.640625 | 4 | [] | no_license | //Should I order more ink for my printer??
var inkLevel = .10; //this is a percentage
var inkCartridgeLeft = 1; //this is how many ink cartridges you have left
if(inkLevel < .10 || inkCartridgeLeft <= 1){ //this is the condition for the if statement
console.log("Go get some more ink quick!"); // this prints out if t... | true |
9b68a4bf2cc3957c3c0e80f88733b4dff666a634 | JavaScript | bevinhex/platin-slot | /client/ui/Spinner.jsx | UTF-8 | 2,642 | 2.75 | 3 | [] | no_license | import React,{Component} from 'react';
export default class Spinner extends Component{
constructor(x,y,w,h){
super();
this.spriteNames = [
'9','10','A','J','K','Odo','Q','SeaHorse','Shark','Shell','StarFish','Turtle','Whale'
]
this.friction = 1;//0.98;
this.speed = 40;
this.stopped = true;
this.state... | true |
a0fb7b28cbd0427ade5ef761443f0c73b5d1ea3f | JavaScript | danimal141/breakout | /breakout.js | UTF-8 | 2,848 | 3.328125 | 3 | [] | no_license | (function() {
var canvas = document.getElementById('myCanvas'),
context = canvas.getContext('2d'),
bricks = [],
paddleWidth = 100,
paddleHeight = 12,
paddleX,
bricksNumX = 7,
bricksNumY = 5,
bricksWidth = canvas.width / bricksNumX,
bricksHeight = 20,
bricksM... | true |
4cb51d339cf0adfb2a77e81ccbbc6768d71d488c | JavaScript | franciszh/web-movies | /src/App.js | UTF-8 | 1,759 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react';
import { getMoviesFromApiAsync} from './Service';
import MovieCarousel from './Carousel';
import Poster from './Poster';
import Meta from './Meta';
import Title from './Title';
import Genre from './Genre'
import './App.css';
class App extends Component {
constructor(props){... | true |
84c48c3ccdafa599f934007c9a5e2b850013de32 | JavaScript | nss-day-cohort-47/ldcc-jrossgage | /scripts/nav/NavBar.js | UTF-8 | 2,472 | 2.734375 | 3 | [] | no_license | import { getLoggedInUser, getToppingsList } from "../data/apiManager.js"
export const NavBar = () => {
//only show navItems and addTypeButton if user is logged in
const navItems = getLoggedInUser().id ? `
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedConten... | true |
10d6d4f96eaf34a8ee8c714ca7f3f8ef603366eb | JavaScript | joppe/dev-challenge | /regex/src/model/Group.js | UTF-8 | 1,655 | 2.78125 | 3 | [] | no_license | import Backbone from 'backbone';
import {Words} from 'js/collection/Words.js';
export const PREFFIX = 1;
export const SUFFIX = 2;
export class Group extends Backbone.Model {
get defaults() {
return {
type: null,
str: '',
words: new Words(),
group: null
... | true |
bf82d7beaf81360c4580874a338628d8f392025c | JavaScript | ryanrestivo/ryanrestivo.github.io | /scripts/script.js | UTF-8 | 3,972 | 2.625 | 3 | [] | no_license | import Education from "./education.js";
import Job from "./resume.js";
import Link from "./link.js";
const director = new Job("Director, Product & Emerging Technology","Newsday","October 2021 - Present",["Led a cross functional team to improve SEO best practices","Streamline metrics reporting dashboards by automating ... | true |
5b307c50ab56c101a457e88b4a8584d85f9c9a2b | JavaScript | ewind72000/wanfang-wfx | /js/tabChange.js | UTF-8 | 1,877 | 2.53125 | 3 | [
"MIT"
] | permissive | //首页Banner轮换展示JS
$(function(){
var t = n = count = 0;
count = $("#imgContent ul").size();
$("#imgContent ul:not(:first-child)").hide();
$("#imgNum li").css({"background":"#3884b5",'color':'#FFF'});
$("#imgNum li:first-child").css({"background":"#b2a63a",'color':'#FFF'});
$("#imgNum li").hover(function() {
... | true |
1869525f796099fb67408fc33e089f915af573a6 | JavaScript | stefanMinch3v/SoftUni | /JSAdvancedJune2017/07.AdvancedFunctions-Lab/MaxElement.js | UTF-8 | 112 | 2.828125 | 3 | [] | no_license | function maxElement(nums) {
return Math.max.apply(null, nums);
}
console.log(maxElement([1, 44, 123, 33])); | true |
15f6b5d1df77ccc9e051d569528bc13afe08822c | JavaScript | JohnnyMcGee/MagicHat | /game.js | UTF-8 | 2,472 | 2.921875 | 3 | [] | no_license | const { Field } = require("./field");
// Import the text for the game.
const messages = require("./messages.js");
const gameMessage = messages.gameMessage;
const collisionMessage = messages.collisionMessage;
const promptSync = require("prompt-sync")({ sigint: true });
const prompt = (ask = "> ", value, opts) => promp... | true |
96133efefe988c7f3921117c56f8d4821a39ac54 | JavaScript | a-set/mean | /app/js/app.js | UTF-8 | 756 | 2.515625 | 3 | [] | no_license |
//the second parameter is used for dependencies
var app = angular.module('MyFirstApp',['ui.router']);
app.controller('MyController', function($scope,'posts'){
//bind the service to scope
$scope.posts = posts.posts;
$scope.posts = [{title:'post1',upvotes:4},
{title:'post2',upvotes:1},
{title:'pos... | true |
363b447f355f962a26fe6d50151a8f68fe759f2a | JavaScript | derek780/third-party-web | /lib/index.js | UTF-8 | 1,766 | 2.859375 | 3 | [
"MIT"
] | permissive | const entities = require('../data/entities.json')
const DOMAIN_IN_URL_REGEX = /:\/\/(.*?)(\/|$)/
const DOMAIN_CHARACTERS = /[a-z0-9.-]+\.[a-z0-9]+/i
const ROOT_DOMAIN_REGEX = /[^.]+\.([^.]+|(gov|com|co|ne)\.\w{2})$/i
const entityByDomain = new Map()
const entityByRootDomain = new Map()
for (const entity of entities)... | true |
34451cb65f1a629007ab321a7aaa5722071784b2 | JavaScript | elyasmotazedy/wideDictionary | /js/main.js | UTF-8 | 244 | 2.59375 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
$answer = $("#answer");
$("#submitSearch").on("click", function() {
$word = $("#search").val();
$.post("handler.php",{word:$word}, function(data) {
$answer.text(JSON.parse(data));
});
});
}); | true |
f0174bb1010e2f19279ce852ac0eb07cc0d34728 | JavaScript | victorguillen/arka | /frontend/components/forms/forms.jsx | UTF-8 | 7,835 | 2.625 | 3 | [] | no_license | import React from 'react';
import { Router, hashHistory, Route, IndexRoute } from 'react-router';
class Forms extends React.Component {
constructor(props) {
super(props);
this.state = {
order: {
"description": "",
"st1": "",
"st2": "",
"city": "",
"state": "",
... | true |
0ff3afd4a1b8304b4e57e4f9463fbdd5cb22e04b | JavaScript | leontomer/Users-Library | /src/reducers/mainReducer.js | UTF-8 | 423 | 2.78125 | 3 | [] | no_license | const initialState = {
users: JSON.parse(localStorage.getItem("users") || "[]"),
changed: false,
};
export default function (state = initialState, action) {
const { type, payload } = action;
switch (type) {
case "SAVE_USERS":
localStorage.setItem("users", JSON.stringify(payload));
return {
... | true |
10bf884fcc36e02f1b8b40a624cc365de1a84bff | JavaScript | jojo-tan/customForm | /src/page/interfaceElement/js/method.js | UTF-8 | 603 | 2.78125 | 3 | [] | no_license | import Moment from 'moment'// 导入日期处理插件
// 获取时间戳版本信息
export function getTimeStamp() {
return Moment().unix();
};
// 检测信息是否存在数组中
export function isExistence(item, arry) {
// console.log(item, arry);
if(!item) {
return {isExistence: false}
};
var frequency = 1;
for(var i=0;i<arry.length;i... | true |