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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6aa30d3e94337734e48bc42f12f1838af3215c62 | JavaScript | cyberne7work/FCalculator | /script.js | UTF-8 | 1,059 | 3.875 | 4 | [] | no_license |
function getvalue(){
var firstInput=(document.getElementById("first").value).toLowerCase();
var secondInput=(document.getElementById("second").value).toLowerCase();
var newArrayFirst=firstInput.split("");
var newArraySecond=secondInput.split("");
var totalLength=firstInput.length+secondInput.length;
var countValue=get... | true |
a3fb76945a9158033b08212f70c3dd0b83ef00ee | JavaScript | Roman-Bobrovskiy/js_hw_01 | /js/task-05.js | UTF-8 | 1,443 | 3.3125 | 3 | [] | no_license | let chinaPrice = 150;
let chilePrice = 250;
let australiaPrice = 165;
let indiaPrice = 90;
let jamaicaPrice = 130;
let delivery = prompt("Choose a country");
let deliveryText =
delivery.charAt(0).toUpperCase() + delivery.slice(1).toLowerCase();
switch (delivery.toLowerCase()) {
case "china":
alert(
"Deliv... | true |
fee4275f7ecbcf2ab51e1b408a2f9e595d5bedd2 | JavaScript | GopalGgk-7/SchoolManagement | /js/adminPage.js | UTF-8 | 269 | 2.609375 | 3 | [] | no_license |
function submitAdminForm() {
var userName = $('#userName').val();
var password = $('#password').val();
if (userName.toUpperCase() == "ADMIN" && password.toUpperCase() == "ADMIN") {
window.location.href = 'dashboard.html';
}
}
| true |
1524b7993a74431dcee4ecbc25d71ef192099324 | JavaScript | Product-Live/Singularity | /engine/core/lib/model/map.js | UTF-8 | 1,736 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | "use strict";
$.require([
'lib!model/type.js'
], function(
type
) {
var obj = function(core) {
this._core = core;
this._struct = {};
this._id = {
name: 'default',
config: {}
};
this._name = null;
this._collection = $.config.get('env.collection');
};
obj.prototype = {
/**
... | true |
e170c92e4fb85cf34361d01d3302bad6d0fe97a7 | JavaScript | schang729/Steve-Mern-Assignments | /OOP/Ninja/Ninja.js | UTF-8 | 803 | 3.703125 | 4 | [] | no_license | class Ninja {
constructor(name, health) {
this.name = name;
this.health = health;
this.speed = 3;
this.strength = 0;
}
sayName() {
console.log("Ninja Name is " + this.name)
}
showStats() {
console.log("name: " + this.name, "health: "... | true |
fad96bc9e0df7684493ea99cd8ecfae24ec5085d | JavaScript | pxai/redux-samples | /src/Home.js | UTF-8 | 918 | 2.515625 | 3 | [] | no_license | import React from 'react'
class Home extends React.Component {
addTask = (e) => {
e.preventDefault();
console.log("Value in component: ", this.refs.task.value);
this.props.addTodo({"id":666, "task":this.refs.task.value});
}
render () {
return (
<div id="home... | true |
3a0f3f5a260764d12c4d2e9bbf696aec20936108 | JavaScript | cottoknoah/codeup-web-exercises | /js/curriculum_exercise.js | UTF-8 | 5,684 | 3.953125 | 4 | [
"MIT"
] | permissive | // Write some JavaScript code, that is, variables and operators, to describe the following scenarios.
// Do not worry about the real operations to get the values, the goal of these exercises is to understand how
// real world conditions can be represented with code.
//
// You have rented some movies for your kids: ... | true |
ae830235da5ff05fbaea2231d83f689cad5cb700 | JavaScript | Aya-Akrabawi/cookie-stand | /app.js | UTF-8 | 6,157 | 2.96875 | 3 | [
"MIT"
] | permissive | 'use restrict'
var hour = 6
var hour2 = 1
var hourarray = []
var AllLocations = []
for (let index = 0; index < 14; index++) {
if (index < 6) {
var array = (hour + 'am')
hour++
} else if (index > 6) {
var array = (hour2 + 'pm')
hour2++
} else {
var array = (hour + 'p... | true |
15e51a1f5e663ab06f117f5de296166e4a47b5c0 | JavaScript | alexandrelucas/javascript2020 | /fundamentos/opAritmetico.js | UTF-8 | 269 | 3.375 | 3 | [] | no_license | const [a, b, c, d] = [3, 5, 1, 15];
const soma = (a + b + c + d);
const subtracao = (a - b - c - d);
const divisao = (a / b / c / d);
const multiplicacao = (a * b * c * d);
const modulo = a % 2;
console.log(soma, subtracao, -divisao, multiplicacao, modulo); | true |
faa05d30be634ae06da4a9b8e04b12e26b3038fb | JavaScript | 1194964459/react-demo | /src/test/Hoc/hoc1.js | UTF-8 | 1,026 | 2.765625 | 3 | [] | no_license | // 封装一个高阶组件,统计组件渲染时间
import React from 'react'
class Hello extends React.Component{
// start = null
// UNSAFE_componentWillMount(){
// this.start = Date.now()
// }
// componentDidMount(){
// console.log('组件渲染耗时: ', Date.now() - this.start)
// }
render(){
return (
... | true |
d86979ed61ae0bbbe58f29445f1a36f35d0cc5cb | JavaScript | kurokikaze/locam-bot | /bot.js | UTF-8 | 20,525 | 2.9375 | 3 | [] | no_license | /* Evaluation code */
function pad(n, width, z) {
z = z || '0';
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
const alive = c => c.defense > 0;
const EMPTY_ABILITY_SLOT = '-';
const hpPointWeight = 1.8;
const defensePointWeight = 0.5;
const bake = state => (
{
... | true |
2b9617c44e5d6489dd304cc8d27f816e923c8f26 | JavaScript | ImYourHuckleberry/XenomorphAttack | /src/features/pierce/invaderPierce.js | UTF-8 | 4,557 | 2.6875 | 3 | [] | no_license | import store from "../../config/store";
import { SPRITE_SIZE, MAP_WIDTH, MAP_HEIGHT } from "../../config/constants";
import ripley from "../ripley";
import player from "../player";
import abed from "../abed";
export default function handleMovement(pierce) {
function getNewPosition(oldPos, direction) {
switch (di... | true |
fea66651e3b78c1799334dc719b8366886014510 | JavaScript | kysan1014/increpas_web | /web/WebContent/js/js06/Test02.js | UTF-8 | 581 | 3.171875 | 3 | [] | no_license |
function func01(){
var el = document.getElementById('dv1');
var node1 = el.childNodes;
alert(node1.length);
alert(node1[6].nodeValue);
var el2 = document.createElement('p');
el2.style.backgroundColor = 'green';
el2.innerHTML = '여기는 p태그';
document.getElementById('dv2').append(el2);
document.getElemen... | true |
34db8c9a039c7e0c733ab7acc60f9ce0985b20d3 | JavaScript | miladVisionCollege/dynamic-app | /router.js | UTF-8 | 2,157 | 2.703125 | 3 | [] | no_license | var profile = require("./profile.js");
var renderer = require("./renderer.js");
var querystring = require("querystring");
var fs = require("fs");
function css(request, response) {
if (request.url.indexOf(".css") !== -1){
var file = fs.readFileSync('./styles/main.css', {'encoding' : 'utf8'});
response.writeHea... | true |
4697b2c3c8dc598a5f5e4fc72cfb89c04443d42f | JavaScript | data-ductus/smart-package | /test/sale.js | UTF-8 | 1,255 | 2.953125 | 3 | [
"CC-BY-4.0",
"Apache-2.0"
] | permissive | let Sale = artifacts.require("./Sale.sol");
let Token = artifacts.require("./Token.sol");
contract('sale', function (accounts) {
let token;
let sale;
before(async function () {
token = await Token.deployed();
sale = await Sale.deployed();
});
it("should sell tokens", async function () {
let valu... | true |
5cbcc11848b2fc8dbb04ac4e9b0b6c330fbe8b95 | JavaScript | sanair96/rembit-ui | /src/reducers/loginReducer.js | UTF-8 | 450 | 2.65625 | 3 | [] | no_license | import { stat } from "fs";
const intialState = {
loginStatus:false
}
export default function(state=intialState,action){
switch(action.type){
case "LOGIN":
return {...state,loginStatus:state.loginStatus?false:true};
case "FIELD_UPDATE":
return {...state,[action.fieldName... | true |
98d4212ca8e706a1075ed72ac7aad931252b828c | JavaScript | ttaylortechnimove/technimove | /server/app/models/user.server.model.js | UTF-8 | 2,914 | 2.5625 | 3 | [] | no_license | const mongoose = require( 'mongoose' );
const crypto = require('crypto');
const Schema = mongoose.Schema;
const UserSchema = new Schema({
firstName: {
type:String,
trim :true,
required: 'First name is required'
},
lastName: {
type:String,
trim :true,
requi... | true |
0a86b64ae809fcc7155721178b95f937dcabdcd2 | JavaScript | Compaurum/ui-quest2020 | /src/utils/time.js | UTF-8 | 885 | 3.625 | 4 | [] | no_license | // const exampleTime = "00:23:11.000";
export const timeToSec = (time) => {
const hours = parseInt(time.substring(0, 2))
const minutes = parseInt(time.substring(3, 5))
const seconds = parseInt(time.substring(6, 8))
return seconds + minutes * 60 + hours * 3600;
}
export const secToTime = (sec) => {
... | true |
3a3373da60447efbfff4c10ead3dc063eddd812c | JavaScript | erichsueh/SchoolWork | /Projects2016/UVInAtmosphere/JS/menuBar.js | UTF-8 | 1,712 | 2.796875 | 3 | [] | no_license | $(document).ready(function() {
//sets hover for original menu bar
$('.menu > li').bind('mouseover', openMenu);
$('.menu > li').bind('mouseout', closeMenu);
//sets hover for submenu if any deeper need to make another to keep look
$('.submenu > li').bind('mouseover', openSubMenu);
$('.submenu > li').bind('mou... | true |
377be5516b3bb83c41ffbbda70d9eb8d9d535293 | JavaScript | pkc189/react-grocery | /src/App.js | UTF-8 | 2,718 | 2.78125 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import List from "./List";
import Alert from "./Alert";
function App() {
const [name, setName] = useState("");
const [list, setList] = useState([]);
const [isEditing, setIsEditing] = useState(false);
const [editId, setEditId] = useState(null);
const [alert,... | true |
c98d112e5a8c0c7c00814e0a2ed1dc887df820ea | JavaScript | CBUmikes930/EGR424-AJAXPractice | /script.js | UTF-8 | 3,994 | 3.4375 | 3 | [] | no_license | // Populates the keys dropdown with the key values for the selected data set
function getKeysFromSet(type) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var obj = JSON.parse(this.responseText);
var ke... | true |
d2556cd78e5cc8a8f58458b8464709240f09f307 | JavaScript | Herkom/cs-code-challenge | /exercise-2/src/components/CompletedTasks.js | UTF-8 | 608 | 2.53125 | 3 | [] | no_license | import { TaskItem } from "./TaskItem";
import { tasks } from "./Context";
const CompletedTasks = () => {
let completedTasks = "";
for (const item of tasks){
item.status ?
completedTasks = completedTasks + TaskItem(item):
completedTasks = completedTasks;
}
const view = `
... | true |
72e2af5d423455a0ef3a83ee8bfc12ec5e6666c5 | JavaScript | NinaSad/BigPandaExercise | /index.js | UTF-8 | 3,428 | 2.578125 | 3 | [] | no_license | var path = require('path');
var bodyParser = require('body-parser');
var validator = require('validator');
var md5 = require('md5');
var express = require('express');
var app = express();
var MongoClient = require('mongodb').MongoClient;
var assert = require('assert');
app.use(expres... | true |
9b93c9de0a9dac2b1764d198078fbb45cceec299 | JavaScript | accetone/meta-pagination | /index.js | UTF-8 | 4,433 | 2.53125 | 3 | [] | no_license | // TODO:
// - add method applyClasses(meta, classes) - current, disabled, separator
// - write tests
// - write docs
// - write comments to build bounds
// - write demo
// - upload to npm
(function () {
'use strict';
var defaultOptions = {
arrows: true,
maxSize: 11,
take: 10,
... | true |
37f4fd832fde7d0a98185942394e96e8256d1c01 | JavaScript | anyTV/anytv-node-boilerplate | /test/faker.js | UTF-8 | 1,811 | 3 | 3 | [
"MIT"
] | permissive | 'use strict';
const _ = require('lodash');
const faker = require('faker');
// https://github.com/Marak/faker.js#setting-a-randomness-seed
const seed = 322;
const float_option = { min: 0, max: 1, precision: 0.01 };
class FreedomFaker {
constructor() {
faker.seed(seed);
this.faker = faker;
}... | true |
317f9c6087cf495e7d8df16badea307f554a897b | JavaScript | 13298185590/crm | /js/axios.defaults.js | UTF-8 | 1,265 | 2.828125 | 3 | [] | no_license | //对axios进行封装
// axios.defaults.baseURL='http://localhost:8888'
axios.defaults.baseURL='http://127.0.0.1:8888'
axios.defaults.withCredentials=true //配置为true,后台的请i去都会带上cookie
//数据以表单的形式扔给服务器
axios.defaults.headers['Content-Type']='application/x-www-form-urlencoded'
//还是以表单的形式扔给服务器,数据格式是这样的name=z3&age=4
axios.defaults.... | true |
4ea172a1f9936990d121b6d694d349275cd77078 | JavaScript | cerebralio/parsr | /parsr.js | UTF-8 | 952 | 2.765625 | 3 | [] | no_license | function parsr(pattern) {
return (str) => {
const parsed = {};
let match;
while (match = pattern.match(/\{(.*?)\}/)) { // eslint-disable-line no-cond-assign
const prefixStr = str.substr(0, match.index);
const prefixPattern = pattern.substr(0, match.index);
if (prefixStr !== prefixPatte... | true |
bb133074bb747ba71b1cd72ed6853186f4b6523d | JavaScript | segaChe/onlineTablo | /src/actions/FetchAction.js | UTF-8 | 4,266 | 2.59375 | 3 | [] | no_license | 'use strict';
import { GET_FLIGHTS_REQUEST, GET_FLIGHTS_SUCCESS,
GET_DEPARTURE_FLIGHTS,
GET_ARRIVAL_FLIGHTS,
EDIT_FLIGHT,
DELETE_FLIGHT } from '../constants/constants';
//данные для имитации асинхронного запроса
// const flights = {
// DepartureFlights: [
// {
// flightNumber: "AF-213",
// city:... | true |
456100371f4906ffde0d3f3ba7583da6b10f09ab | JavaScript | EricJohnson101106/InternetProgramming | /assign3.js | UTF-8 | 3,213 | 4.21875 | 4 | [] | no_license | // Thinking I will make a global array that will be initialized to an empty string
// When the cell is created, it should pull the value from the array. The initial
// creation of a cell will then be an empty string.
// However, if a row is deleted, it will first copy the elements in the textbox
// into the array for s... | true |
b3ad9bf79198748759ddf7f809b4c4992808cf8e | JavaScript | charles-owen/cirsim | /src/Cirsim/Component/SevenSeg.js | UTF-8 | 7,158 | 2.65625 | 3 | [
"MIT"
] | permissive | import {Component} from '../Component';
import {ComponentPropertiesDlg} from '../Dlg/ComponentPropertiesDlg';
import {Vector} from '../Utility/Vector';
/**
* Component: SevenSeg Seven Segment display
*/
export const SevenSeg = function() {
Component.call(this);
this.height = 150;
this.width = 90;
th... | true |
a78a4c0845b0e678c14c8d3f1d889ea2a918e233 | JavaScript | vitamarkesh/test02 | /js/server.js | UTF-8 | 1,375 | 2.71875 | 3 | [] | no_license | const express = require('express');
const app = express();
const http = require('http').createServer(app);
const io = require('socket.io')(http);
const axios = require('axios');
const periodSec = 15;
const url = 'http://phisix-api3.appspot.com/stocks.json';
const refreshEventName = 'refresh';
const port = 50750;
const... | true |
3603cc3b62d1b46ac2a2e0fb180ef0294502e25a | JavaScript | Oconnord89/oconnorLab7 | /Javascript/oconnorlab7.js | UTF-8 | 952 | 3.4375 | 3 | [] | no_license | var pizza = {
name: 'pizza',
price: 9.20
}
var gophers = {
name:'gophers',
price: 14.50
}
var grahamcrackers ={
name: 'graham crackers',
price: 3.40
}
var applesauce = {
name: 'applesauce',
price: 3.75
}
var macaroons = {
name: 'macaroons',
price: 12.50
}
var yogurt = {
name: 'yogurt',
pric... | true |
d5aeeb577294f80cb2573a4749274b47de64d7b0 | JavaScript | gpanah/lernen | /leetcode/algorithms/add-two-numbers.js | UTF-8 | 1,486 | 3.8125 | 4 | [] | no_license | const test = require('tape')
/**
* Definition for singly-linked list.
* function ListNode(val) {
* this.val = val;
* this.next = null;
* }
*/
/**
* @param {ListNode} l1
* @param {ListNode} l2
* @return {ListNode}
*/
const addTwoNumbers = function(l1, l2) {
return recurse(l1, l2, 0)
}
const recurse... | true |
03556de4cd04c502ae1826ad057f6c12b5a8e344 | JavaScript | nagyist/phaser3-examples | /public/src/bugs/5501 bitmap text.js | UTF-8 | 729 | 2.671875 | 3 | [
"MIT"
] | permissive | class Example extends Phaser.Scene
{
constructor ()
{
super();
}
preload ()
{
this.load.bitmapFont('desyrel', 'assets/fonts/bitmap/desyrel.png', 'assets/fonts/bitmap/desyrel.xml');
this.load.bitmapFont('lato', 'assets/fonts/bitmap/lato_0.png', 'assets/fonts/bitmap/lato.xml')... | true |
9167b4d398ba1d143b8ae00a0efb9551667b17a7 | JavaScript | WarmAirBlowing/lzp_fullstack | /interview/base/index2.js | UTF-8 | 807 | 3.96875 | 4 | [] | no_license | // 1 == '1' // true
// 1. 两者类型是否相同,相同的话就比大小
// 2. 类型不同,那么就进行类型转换
// 3. 会先判断是否在对比null和undefined,是的话就返回true
// 4. 判断两者是否是string和number,是的话就将string转为number
// 5. 判断其中一方是否为boolean,是的话就把boolean转为number
// 6. 判断其中一方是否为object,且另一方为string,number,Symbol,是的话就把object转为原始类型再进行判断
console.log('1' == true); //true
console.log('1' =... | true |
9165ddb225f32ab98c8f2b8796d46fee20dc6f69 | JavaScript | avairain/studyTypescript | /main/05-function.js | UTF-8 | 2,835 | 3.65625 | 4 | [] | no_license | "use strict";
// common
{
function exm() { }
console.log(exm);
}
// 函数类型
{
// 定义类型
{ // 简
function exm(a, b) {
return a + b;
}
exm(1, 2);
}
{ // 完整
let exm = function (x, y) {
return x + y;
};
exm(1, 2);
}
// 推断类型
... | true |
412467c353ea59eb910fb244e06af20ac69aee4c | JavaScript | FCE-Schneiders/Origin | /WincAcademy/Week1/W1D3/W1D3-2/W1D3-2b/index.js | UTF-8 | 349 | 3.25 | 3 | [] | no_license | /* recept Hollands broodje kaas
makeSandwich ______
Get a slice of Bread
Add ______ on top
function makeSandwich(filling) {
Get a slice of Bread;
Add filling on top;
}
makeSandwich();
*/
function makeSandwich(topping) {
console.log('There you go, a sandwich with'+ ' ' + topping )... | true |
fab6a797bab5aa06054a17cea550428720227b0e | JavaScript | tonzmy/ChitChat | /server/reference.js | UTF-8 | 1,532 | 3.03125 | 3 | [] | no_license | //sending to sender-client only
socket.emit('message', "this is a test");
//sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
//sending to all clients in 'game' room(channel) except sender
socket.broadcast.to('game').emit('message', 'nice game');
//sending to sender client, ... | true |
cc1a9dfe76556f358e4f48f003aa5864033ec969 | JavaScript | jarekpavlov/react-course | /src/hooks/useFetching.js | UTF-8 | 478 | 2.5625 | 3 | [] | no_license | import {useState} from "react";
export const useFetching = (callback) =>{
const [isPostLoading, setIsPostLoading] = useState(false)
const [error, setError] = useState('')
const fetching = async (...args)=> {
try {
setIsPostLoading(true)
await callback(...args)
}catc... | true |
49db1a9577d65bfc1ab411fdce56f74838e8562c | JavaScript | Krolmir/js101 | /small_problems/easy_5/array_average.js | UTF-8 | 509 | 4.59375 | 5 | [] | no_license | // Write a funciton that takes the average off all elements in an array.
// Rules: Rounded down
// The array will never be empty and always have positive integers
// input: array
// output: number rounded down
// Steps:
// Use reduce to find the product then divice by length and round down
function average(a... | true |
cd1298f253e7f0b10648203c79eadf1e7563c5da | JavaScript | lianlin2121241/study | /nodejs/promise/js/testPromise.js | UTF-8 | 849 | 3.234375 | 3 | [] | no_license | var Promise=require("bluebird");
function red(){
console.log("red");
}
function green(){
console.log("green");
}
function yellow(){
console.log("yellow")
}
function showColor(timeouts,cb){
return new Promise(function(resolve,reject){
setTimeout(function(){
cb();
resolve();
},timeouts);
})
}
/*functio... | true |
5a96292fb040241aa74621c573c4b2be4776bb7c | JavaScript | maugithuber/git_node_api | /controllers/user.js | UTF-8 | 12,325 | 2.640625 | 3 | [] | no_license | 'use strict'
var User = require('../models/user');
var Follow = require('../models/follow');
var Publication = require('../models/publication');
var bcrypt = require('bcrypt-nodejs'); //encriptador
var jwt = require('../services/jwt'); //token
var mongoosePaginate = require('mongoose-pagination'); //paginador
var ... | true |
4cce924af43c01df31de22b544c6275e080f0dd1 | JavaScript | barbarapascon/projeto-flores | /apiexpressjs-master/apiexpressjs-master/plantaService.js | UTF-8 | 1,492 | 2.65625 | 3 | [] | no_license | const express = require('express')
const router = express.Router();
// Planta Model
const Planta = require('./planta')
// @route GET api/plantas
// @desc Get All plantas
// @access Public
router.get('/', (req, res) => {
Planta.find()
.then(plantas => res.json(plantas));
});
// @route GET api/plantas
// @de... | true |
2944b376080738cfc17902bc2a3e8173f28a9351 | JavaScript | AnthonyLedesma/JS-Todo-List | /src/DisplayController.js | UTF-8 | 8,988 | 2.90625 | 3 | [] | no_license | /* global localStorage */
/*
|Whole-script strict mode syntax
|Require jQuery dependency for proper functionality.
|DomPurify is used to sanitize user inputs.
|format is used for date and time manipulation.
|UIkit methods allow us to access JS methods to work with CSS framework.
*/
import DOMPurify from 'dompurify';
... | true |
85a1e4bbc6da98f363cc8e7b185f1a959a9f0c75 | JavaScript | BalioFVFX/Software-Technologies-March-2018 | /JAVASCRIPT SYNTAX AND BASIC WEB/08. Capital-Case Words/08. Capital-Case Words.js | UTF-8 | 305 | 3.421875 | 3 | [] | no_license | function solve(arr){
let input = arr.join(', ');
input = input.split(/\W+/);
input = input.filter(w => w.length > 0);
let output = [];
for (let word of input) {
if(word == word.toUpperCase()){
output.push(word);
}
}
console.log(output.join(', '));
} | true |
55b0768318ee2494c785398f8c1cbc60e7a5766f | JavaScript | runi95/SotE-III | /init.js | UTF-8 | 1,579 | 2.671875 | 3 | [
"MIT"
] | permissive | const fs = require("fs-extra");
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
const filename = "settings.json";
async function run() {
let wc3Path = undefined;
while (wc3Path === undefined) {
await new Promise((reso... | true |
42ec340a06fbd4cd00fa612426e4e5c128ba218a | JavaScript | jensl/critic | /src/library/js/v8/critic-text.js | UTF-8 | 4,301 | 2.6875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | /* -*- mode: js; indent-tabs-mode: nil -*-
Copyright 2013 Jens Lindström, Opera Software ASA
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
Un... | true |
fb59833358db7a91512807b6d77790f3759c9ef9 | JavaScript | agistrilink/playground | /public/scripts/mod/backbone/user.js | UTF-8 | 559 | 2.515625 | 3 | [] | no_license | define([
'backbone',
'jquery'
],
function(Backbone, $) {
var User = Backbone.Model.extend({
urlRoot: '/api/foo',
initialize: function () {
this.urlRoot = User.getBaseUrl() + this.urlRoot;
this.set('id', ++User.id);
},
toString: function() {
return 'Name: ' + this.get('na... | true |
be50f042e2a1cae6b8638ba093352714d6b70b1d | JavaScript | ackleymi/fantasynotify | /leagues.js | UTF-8 | 879 | 2.59375 | 3 | [
"MIT"
] | permissive | const axios = require('axios');
async function updateForUser(user, httpLib = axios) {
const usersRes = await httpLib.get(
'https://fantasysports.yahooapis.com/fantasy/v2/users;use_login=1/games;game_codes=nfl;is_available=1/leagues?format=json',
{ headers: { Authorization: `Bearer ${user.accessToken}` } },
... | true |
1431956d00c84794b87e54ca9054b136a0e5abfc | JavaScript | LuckyWasTaken/native-array-methods-exercises | /filter/core.js | UTF-8 | 759 | 2.875 | 3 | [] | no_license | function onlyEven (array) {
return array.filter((x) => !(x%2));
};
function onlyOneWord (array) {
return array.filter((x) => !x.match(/\W/g));
};
function positiveRowsOnly (array) {
return array.filter((row) => row.every((elem) => elem > 0));
};
function allSameVowels (array) {
return array.filter(sameVowels... | true |
0f9cc48a451ea8acde7b84a1c7a96a7c5cd0df41 | JavaScript | sksingh2546-pro/bop_dop | /src/main/resources/static/js/geolocation.js | UTF-8 | 1,013 | 3 | 3 | [] | no_license | if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(getCity);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
// Step 2: Get city name
function getCity(coordinates) {
var xhr = new XMLHttpRequest();
// Paste your LocationIQ token below.
xhr.o... | true |
e59400c93530be813d0bd4cb62a84f8f8fc3a973 | JavaScript | xie926/Daily | /leetCode/461. 汉明距离/3-位运算.js | UTF-8 | 168 | 3.265625 | 3 | [] | no_license | var hammingDistance = function(x, y) {
let flag = x ^ y, num = 0
while(flag){
if(flag & 1){
num++
}
flag = flag >> 1
}
return num
}; | true |
5007367072cf72c3376dbad1f2698ac702f10488 | JavaScript | akeymo/rentalInfoSearch | /app/public/javascripts/register.js | UTF-8 | 654 | 2.53125 | 3 | [
"MIT"
] | permissive | $(function(){
var register = {
init: function(){
this.bindEvent();
},
bindEvent: function(){
$('#register').on('click',function(){
var username = $('#username').val();
var password = $('#password').val();
if(!!!username){
alert("请输入用户名!");
return;
}
if(!!!password){
aler... | true |
5530c47db8962f6148c44e1052c09cae4b2d5b30 | JavaScript | GiuseppeJoeT/Udemy-javascript-course-2018 | /3-how-JS-works/starter/hoisting.js | UTF-8 | 1,161 | 4.90625 | 5 | [] | no_license | ///////////////////////////////////////
// Lecture: Hoisting
// functions
// So this is Hoisting.
// So in the creation phase of the execution context,
// which is, in this case, the global execution context.
// The function declaration calculateAge is stored
// in the variable object and even before the code is exec... | true |
118bbba15bd1c1d61c1609bb6c6a3be65ee8cdc6 | JavaScript | noahschnur/employee-info | /__tests__/Manager.test.js | UTF-8 | 314 | 2.90625 | 3 | [
"ISC"
] | permissive | const Manager = require("../lib/Manager");
test("creates new manager object", () => {
const manager = new Manager("");
expect(manager.office).toEqual(expect.any(Number));
})
test("get role as 'manager'", () => {
const engineer = new Engineer("");
expect(engineer.getRole()).toBe("Manager");
}); | true |
641b64042945cb1a89232805d2ef44bcea7cded3 | JavaScript | jomigofe/firebasetest | /pages/index.js | UTF-8 | 3,583 | 2.640625 | 3 | [] | no_license | import React, { useState, useEffect} from "react";
import useKey from '@accessible/use-key'
import Link from 'next/link'
import { useUser } from '../utils/auth/useUser'
import initFirebase from '../utils/auth/initFirebase'
import { throttle } from 'throttle-debounce';
import {
Character
} from '../components'
con... | true |
be453df1ebc1671e0db4a96feff446c85d584cf8 | JavaScript | MarwanElkhoudary/BounceBack | /src/client/src/helpers/index.js | UTF-8 | 310 | 2.5625 | 3 | [] | no_license | import { decode } from 'jsonwebtoken';
export function checkUser() {
const token = getCookie('jwt');
return decode(token);
}
function getCookie(name) {
var value = "; " + document.cookie;
var parts = value.split("; " + name + "=");
if (parts.length === 2) return parts.pop().split(";").shift();
} | true |
4af5d34756c85892c79e579d32c141cd6e1eee42 | JavaScript | Victy0/sem_barreiras | /src/main/resources/static/scripts/logout.js | UTF-8 | 1,246 | 2.546875 | 3 | [] | no_license | $(document).ready( function(){
var loged= localStorage.getItem("on");
if(loged == null || loged == undefined){
document.getElementById("recrutar").style.display = "none";
document.getElementById("sair").style.display = "none";
document.getElementById("empresaEdit").style.display = "none"... | true |
fa3312e4e6c6e7c8acd09a5eb18037540ee8f23b | JavaScript | bgoonz/UsefulResourceRepo2.0 | /MY_REPOS/Lambda-Resource-Static-Assets/2-resources/BLOG/Javascript/Design-Patterns/Bridge/scripts/Car.js | UTF-8 | 420 | 3.09375 | 3 | [
"MIT"
] | permissive | class Car {
constructor(name, description, price, places = 2, color, brand = 'Cartisfaction') {
this.brand = brand;
this.name = name;
this.description = description;
this.price = price;
this.places = places;
this.color = color;
}
applyColor() {
console... | true |
feb3d7756bcf05fa63feed8e720da735920eb464 | JavaScript | ftconan/javascript-notes | /js_notes/js_func/generator_demo.js | UTF-8 | 1,944 | 3.453125 | 3 | [
"MIT"
] | permissive | /*
@author: magician
@file: generator_demo.js
@date: 2020/1/20
*/
'use strict';
function foo(x) {
return x + x;
}
let r = foo(1);
function* foo1(x) {
yield x + 1;
yield x + 2;
return x + 3;
}
function fib(max) {
let
a = 0,
b = 1,
arr = [0, 1];
while (arr.length < ... | true |
15c1528742e239106e0d0ab4e5f0f0aad26dc437 | JavaScript | memorvin/h8-p0-w4 | /exercise7.js | UTF-8 | 628 | 4.21875 | 4 | [] | no_license | //Logic Challenge - Mengurutkan Abjad
function urutkanAbjad(str) {
var charcode = [];
for (var i = 0; i < str.length; i++) {
charcode.push(str.charCodeAt(i));
}
charcode.sort(function(a, b){return a-b});
var result = '';
for (var i = 0; i < charcode.length; i++) {
result += String.fromCharCod... | true |
85d5f897f35768131755d598918e32a4fcdd42fb | JavaScript | mh-habib/advanced-javascript | /1-true-false.js | UTF-8 | 1,063 | 4.5625 | 5 | [] | no_license | //23-2 Truthy and Falsy values
//Falsy Value: 0/""/undefined/null/NaN/false
//Truthy Value: "0"/" "/[]/{}/'false'
//Any Number +ve or -ve condition will be true
//Condition will be false when it is only = 0
const age = 0; // May be +ve, -ve or 0
if (age){
console.log('Condition is True');
}else{
console.log(... | true |
ccf8bb4436e29f6f2b0b6cd301d9393cf21c7104 | JavaScript | kronosat/projetomaster | /js/main.js | UTF-8 | 980 | 3.15625 | 3 | [] | no_license | const inputs = document.querySelectorAll(".input");
function addcl(){
let parent = this.parentNode.parentNode;
parent.classList.add("focus");
}
function remcl(){
let parent = this.parentNode.parentNode;
if(this.value == ""){
parent.classList.remove("focus");
}
}
inputs.forEach(input => {
input.addEventList... | true |
0d47cfc90f3e1f7ae734a8d8654049583fdbd48b | JavaScript | tusharjain0022/cehg | /client/Android-App/screens/manage.js | UTF-8 | 2,764 | 2.515625 | 3 | [
"MIT"
] | permissive | import React from "react";
import { Text, View, Button, ImageBackground} from 'react-native';
import styles from "../screens/styles/manage.js";
function changeState(i,ref)
{
if(i == 1)
{
if(ref.state.x1 === 0)ref.setState({x1: 1});
else ref.setState({x1: 0});
if(ref.state.y1 === 0)ref.setState({y1: 1})... | true |
945ae8bdaed4ccb053d75911b462c1ae882e8499 | JavaScript | YPZ-24/Curso_FundamentosJS | /Teoria/funciones/arrowFunctions.js | UTF-8 | 1,130 | 4.40625 | 4 | [] | no_license | //ARROW FUNCTIONS
//DEFINICION
const arrowFunction = (para1, para2) => {
console.log("Estoy dentro")
console.log("Soy Abril")
}
//DE UNA LINEA
//---No necesita las llaves
const arrowFunction1l = (para1, para2) => console.log("Soy una arroyFunction de una linea")
//CON UN PARAMETRO
//---No necesita parentesi... | true |
1ca041fc7635ee5d61e86520b4a90466aa5f16c6 | JavaScript | nourbalaha/practice | /Intermidiate/spinalCase.js | UTF-8 | 767 | 3.203125 | 3 | [] | no_license | function spinalCase(str) {
// "It's such a fine line between stupid, and clever."
// --David St. Hubbins
str=str.replace(/_/g,'');
str=str.replace(/\s[a-z]/g,function(match){
return '-' + match;
});
str=str.replace(/\s?[A-Z]/g,function(match){
return '-' + match.toLowerCase();
});
str=str.... | true |
2ba5fa3f0e12699159ac01f6e3c9addfb1eb6c88 | JavaScript | hbt/tab-plus | /menu.js | UTF-8 | 737 | 2.765625 | 3 | [] | no_license | var menu = document.getElementById('menu');
for (var actionName in menuActions)
{
// create li element
var li = document.createElement('li');
li.id = actionName;
li.innerText = menuActions[actionName];
// loop and check if this action has a hotkey
for (var hotkey in mappingActions)
{
... | true |
9175f79f19341a381d8590606df938ba25eb4462 | JavaScript | SupratikRulz/star-wars-gallaria | /src/actions/people.action.js | UTF-8 | 801 | 2.5625 | 3 | [] | no_license | import { service } from './../services/api';
import config from '../config.json';
import { ADD_PEOPLE, UPDATE_SEARCH_KEY } from './../constants';
const addCharacters = (characters = []) => ({
type: ADD_PEOPLE,
characters
});
export const fetchCharactersAndDispatch = () => dispatch => {
service
.get(config.... | true |
bb5b2c8cf4451fac14bb456209a4230ddc01a599 | JavaScript | ratnamala95/calculator | /quandl/js/quandl.js | UTF-8 | 1,044 | 2.546875 | 3 | [] | no_license | $(document).ready(() => {
quandlData();
});
function quandlData(){
$.ajax({
type:'GET',
url:"https://www.quandl.com/api/v3/datasets/NASDAQOMX/NQUSB8775LMN.xml?api_key=ksxyQgkKkcpYRiKkXVKZ",
dataType:'xml',
cache:'false',
error:function(e){
console.log('could not read xml document!',e);
... | true |
f75f0e7bd25ec6f1d1985234afea08c17536b012 | JavaScript | alextello/JS-RelaxApp | /script.js | UTF-8 | 611 | 3.296875 | 3 | [] | no_license | const container = document.getElementById('container');
const text = document.getElementById('text');
const tiempoTotal = 7500;
const respirarTiempo = (tiempoTotal / 5) * 2;
const sostener = tiempoTotal / 5;
respirarAnimacion();
function respirarAnimacion() {
text.innerText = 'Inhala';
container.className = ... | true |
e3967ce55c3c6fcf1b405775d5dfc0b6d161e536 | JavaScript | tedhaha/sensor-graph | /test/tcp_socket/tcp_client.js | UTF-8 | 372 | 2.734375 | 3 | [
"MIT"
] | permissive | //****************************
// tcp socket client
//****************************
var net = require("net");
var socket = net.connect(21000, '127.0.0.1', function(){
console.log('Client Start!!');
});
socket.on("data", function(data){
console.log(">>>>"+data.toString());
});
process.stdin.resume();
process.stdin.o... | true |
6df0c42f54bda6a9c565cbb9b537ee0be611c882 | JavaScript | elotero20/CintaRoja-Batch01 | /Dia4(ArrowFunctions)/ejerciciosExplicadosAF.js | UTF-8 | 860 | 4.21875 | 4 | [] | no_license | //Funciones Normales
//Funcion no anonima
function suma(a,b){
return a+b;
}
//Funcion anonima asignada en una variable suma1
var suma1 = function(a,b){
return a+b;
}
//Arrows Functions
//Funcion anonima asignada en una variable suma2 con parametros
var suma2 = (a,b) => a + b;
//Funcion anonima asignada en... | true |
28e2da92f26d0a25c2d9134d3fdbdc18bfd2e519 | JavaScript | PeaceUCR/ExpressWebForm | /routes/users.js | UTF-8 | 2,116 | 2.578125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
//DB related
var mongoose= require('mongoose');
mongoose.connect('mongodb://peace:123@localhost/myDB', { useMongoClient: true });
var schema= mongoose.Schema({
name: String,
password: String,
email: String
});
var account = mongoose.model('ac... | true |
749fe2dc19f0be55bd78cb81bf32a06ccc03c789 | JavaScript | frederikdammeier/RUADataScientist | /js/test.js | UTF-8 | 4,013 | 3.109375 | 3 | [] | no_license |
var i = 0;
var progress = document.getElementById("progress");
Next1.onclick = function () {
Form1.style.left = "-450px";
Form2.style.left = "40px";
progress.style.width = "45px";
}
Back1.onclick = function () {
Form1.style.left = "40px";
Form2.style.left = "450px";
progress.style.width = "... | true |
f7b5f48c175085e1c7debf77ca0e2b900d57235d | JavaScript | YamShadow/Rendu-NodeJS | /routes/chat/chat.controller.js | UTF-8 | 1,411 | 2.546875 | 3 | [] | no_license | /*
Import
*/
const UserModel = require("../../models/user.model");
const ChatModel = require("../../models/chat.model");
/*
Functions
*/
const getMessage = body => {
return new Promise((resolve, reject) => {
ChatModel.find((error, messages) => {
if (error) reject(error);
else if (!messages) reject("m... | true |
fd5071a84d491272148e616c5c2fd4e4eb427de1 | JavaScript | onadeem1/cars-site | /server/api/tests/cars.spec.js | UTF-8 | 2,101 | 2.546875 | 3 | [] | no_license | /* global describe beforeEach it */
const { expect } = require('chai')
const request = require('supertest')
const db = require('../../../database')
const app = require('../../index')
const Car = db.model('car')
const User = db.model('user')
const omer = {
email: 'omer@aol.com',
phoneNumber: '516 555 5555',
zip: ... | true |
6412428d90c380bead28a7631481bd83a943a410 | JavaScript | awsfzl/exercise | /java.js | UTF-8 | 355 | 3.078125 | 3 | [] | no_license | var clr1 = document.getElementById('color1');
var clr2 = document.getElementById('color2');
var body = document.querySelector('body');
var button = document.getElementById("helo");
function changeclr()
{
body.style.background =
"linear-gradient(to right,"
+ clr1.value
+","
+ clr2.value
+")";
}
button.ad... | true |
0d08842dccf4459438fb1423fce1f657dc005344 | JavaScript | mmcs-wadv/d3-examples | /src/index.js | UTF-8 | 961 | 2.75 | 3 | [] | no_license | import * as d3 from 'd3'
import _ from 'lodash'
import Quotes from './quotes.json'
import Goals from "./components/Goals";
document.addEventListener('DOMContentLoaded', function (){
const mainSection = document.getElementById("main-section");
mainSection.innerHTML = `<h1>${_.sample(Quotes.quotes)}</h1>`
... | true |
89660273e7da631761e06d15d953737743659e34 | JavaScript | hampelm/osm-poi-search | /js/app.js | UTF-8 | 2,586 | 2.703125 | 3 | [] | no_license | $(function(){
var app = {
BASEURL: 'http://www.overpass-api.de/api/xapi?',
BASELAYER: 'http://a.tiles.mapbox.com/v3/matth.map-n9bps30s/{z}/{x}/{y}.png',
TAGS: {
'trees': {
key: 'natural',
value: 'tree'
},
'churches': {
key: 'amenity',
value: 'place_of_worship',
name: 'name'
},
... | true |
364ae16696c03e0be7d366085463a2053a4dedf6 | JavaScript | ZorinArsenij/s1-units | /src/utils/getDate.test.js | UTF-8 | 441 | 2.671875 | 3 | [] | no_license |
import {getDate} from './getDate';
describe('getDate function', () => {
it('correct data', () => {
const timestamp = 886464000000;
const expected = '3 февраля, вт, 1998 год';
const result = getDate(timestamp);
expect(result).toEqual(expected);
});
it('incorrect data', () => {
... | true |
c72ea1d2db8322e849cddc6426404ee89cda378b | JavaScript | romanrangel/ReadMeGeneratorr | /utils/generateMarkdown.js | UTF-8 | 1,349 | 2.96875 | 3 | [] | no_license | // TODO: Create a function that returns the license link
// If there is no license, return an empty string
function renderLicenseLink(license) {
return "https//license.com";
}
// TODO: Create a function to generate markdown for README
function generateMarkdown(data) {
return `## ${
data.title
}
<su... | true |
ff950414d48e96a042774b00a1dfc8a0f57a8dee | JavaScript | darinchakalov/JavaScript-Fundamentals-2021 | /Arrays/04. Reverse an Array of Strings.js | UTF-8 | 344 | 3.40625 | 3 | [] | no_license | function solve(arr) {
//console.log(arr.reverse().join(' '));
for (let i = 0; i < arr.length / 2; i++) {
let oldElement = arr[i];
let previoisIndex = arr.length - 1 - i;
arr[i] = arr[previoisIndex];
arr[previoisIndex] = oldElement;
}
console.log(arr.join(' '));
}
solve(['... | true |
47fabac2e42fc2e7c009c57994e4a0a1e4ebe60d | JavaScript | Phoboes/WDi23-Homework | /amanda_sam/week_01/day_04/js/ex2.js | UTF-8 | 1,103 | 4.78125 | 5 | [] | no_license | /*
Given the following a triangle object like the one below, write the following functions:
isEquilateral - Returns whether the triangle is equilateral or not
isIsosceles - Returns whether the triangle is isosceles or not
area - Returns the area of the Triangle
*/
////// isEquilateral
let triangle = {
sid... | true |
084d205cd4dc5725a5a78fa022f78afb66ed8922 | JavaScript | Wacky-Wozniaks/WW-Games | /WW-Games-2/src/main/webapp/resources/js/war.js | UTF-8 | 1,818 | 3.234375 | 3 | [] | no_license | var cardTagFront = "<img class=\"playing-card\" src=\"/resources/images/cards/";
var cardTagBack = ".svg\"></img>";
var player1Cards = null;
var player2Cards = null;
$(window).load(function() {
$("#loading-screen").addClass("hidden");
$("#game").removeClass("hidden");
});
$(document).ready(function() {
$("#draw")... | true |
bf01a8f21f24150c8e42cb78ef602dcc435213f0 | JavaScript | pepinho24/TelerikAcademyHomeworks2015 | /JavaScript Fundamentals/07.Arrays/scripts/most-frequent-number.js | UTF-8 | 768 | 3.640625 | 4 | [] | no_license | function findMostFrequentNumber(arr) {
var i,
maxCount = 0,
num,
number,
freq = [];
for (i = 0; i < arr.length; i += 1) {
if (isNaN(freq[arr[i]])) {
freq[arr[i]] = 1;
}
else {
freq[arr[i]] += 1;
}
}
for (number in ... | true |
24ec93b364529f11a4684213215ce75019344f21 | JavaScript | soujanyaoruganti/Ecommerce-client | /server/services/AuthService.js | UTF-8 | 2,107 | 2.546875 | 3 | [] | no_license | const createError = require('http-errors');
const UserModel = require('../models/user');
const UserModelInstance = new UserModel();
module.exports = class AuthService {
async register(data) {
const { email } = data;
try {
// Check if user already exists
const user = await UserModelInstance.fin... | true |
61c496bd662f62a6b7650d7fe412d576b4127f36 | JavaScript | DanielFMurillo/FriendFinder | /app/routing/apiRoutes.js | UTF-8 | 613 | 2.59375 | 3 | [] | no_license | module.exports = function(app) {
var friendsData = require("../data/friends");
app.get("/api/friends", function(req, res) {
res.json(friendsData);
});
app.post("/api/friends", function(req, res) {
//friendsData.push(req.body);
res.json(req.body);
console.log("ajax post");
var scoreCheck... | true |
9d5b89956d682ecf2ac19b05332989155220deb5 | JavaScript | fserapian/Breaking-Algorithms | /houseNumbersSum.js | UTF-8 | 1,273 | 4.4375 | 4 | [] | no_license | /****************** HOUSE NUMBERS SUM **********************/
/*
A boy is walking a long way from school to his home. To make the walk
more fun he decides to add up all the numbers of the house that he passes by
during his walk. Unfortunatley, not all of the houses have numbers written
on them, and on ... | true |
494e7a03518247095cb0f127ce5e31170c73b292 | JavaScript | dusanmitrovic98/cities-rjxs-version1 | /src/draw-html-elements.js | UTF-8 | 3,235 | 3.078125 | 3 | [] | no_license | import { fromEvent } from 'rxjs';
import { map, debounceTime } from 'rxjs/operators';
import { filterText } from './filter-text.js';
import
{
subscribeFetchCities,
subscribeFetchCityByName
}
from './cities-services.js';
export function drawHtmlElements()
{
drawDivHtmlElement(document.body, "List of ... | true |
af803f29ba7f1c97f5a514b0f875f6b9e7fa849e | JavaScript | manuelstofer/pflock | /test/test.js | UTF-8 | 6,269 | 2.625 | 3 | [] | no_license | /*global describe, it, $, beforeEach*/
var pflock = require('pflock');
pflock($('.document').get(0), {
users: [
{name: 'example 1'},
{name: 'example 2'}
]
});
describe('pflock', function () {
var el, bindings,
data;
beforeEach(function () {
data = {
user:... | true |
5d3c047bfaa5f9e9a0ec1b5dea027a3455f1fce0 | JavaScript | fayaz55/Covid-19-Tracker-App | /src/Components/vaccineCard.jsx | UTF-8 | 1,474 | 2.703125 | 3 | [] | no_license | import React, { Component,useState } from 'react';
let today = new Date();
let date=today.getDate() + "-"+ parseInt(today.getMonth()+1) +"-"+today.getFullYear();
class VaccineCard extends Component {
state={};
componentDidMount(){
fetch('https://api.opencovid.ca/summary?loc=' + this.... | true |
216dac6d70c65f6db4f5d9430c552c5dc145835f | JavaScript | SergioPortilla/reactrest | /src/actions/actionOfEmployee.js | UTF-8 | 1,340 | 2.609375 | 3 | [] | no_license |
export function updateCoinsEmployee() {
return fetch('http://localhost:8081/ceibacoins', {
method: 'PATCH'
})
.then(response => response.text())
.then(text => {return text})
.catch(error => console.log(error));
}
export function editEmployee(employee, isDelete) {
return fetch('http... | true |
d0e733b05e06b5278f2fe72c05e66bf737c477fd | JavaScript | DianaVashti/wcw-oss-practice | /algorithms/test/fibonacci_test.js | UTF-8 | 533 | 3.03125 | 3 | [
"MIT"
] | permissive | // import { expect } from 'chai'
// import fibonacci from '../src/fibonacci'
//
// describe('fibonacci()', function(){
//
// it('should be a function', function(){
// expect(fibonacci).to.be.a('function')
// })
//
// it('returns an array with the fibonacci numbers to the nth position', function(){
// expe... | true |
1c9320003254481738fa7076f5645d7791f0f2fa | JavaScript | tiantian010110/bootui | /js/plugin/boot.prompt.js | UTF-8 | 4,495 | 2.578125 | 3 | [] | no_license | /**
* 田鑫龙
*/
boot.Prompt = function(type){
this.type = type;
this._uuid = boot.newId();
this.init();
this.render();
this.bindEvents();
};
boot.Prompt.prototype = {
init: function(){
var style = "position: fixed;z-index: 100000;top: -300px;left: 50%;";
var footHeight = "44px", topHeight = "40px";
if(t... | true |
132259adb8c8fecd144d4755d265d0cdbfb617f5 | JavaScript | WISVCH/florriebot | /scripts/gaben.js | UTF-8 | 1,583 | 2.75 | 3 | [] | no_license | // Description:
// All praise GabeN
//
// Commands:
// hubot gaben me <query> - Returns gentleman gaben on top of <query>
// hubot cage me <query> - Returns a caged version of <query>
// hubot putin me <query> - Returns your glorious leader on top of <query>
module.exports = robot =>
robot.respond(/(gaben|ca... | true |
e170beb87c950f75943d724b3b318cd6c2d227e2 | JavaScript | urimaj/CP2 | /script.js | UTF-8 | 2,766 | 2.5625 | 3 | [] | no_license |
$(document).ready(function() {
var submitButton2 = $("#searchSubmit");
});
$("#searchSubmit").click(function(e) {
e.preventDefault();
var value = $("#searchInput").val();
console.log(value);
var myurl = "https://itunes.apple.com/search?term=" + value;
$.ajax({
url : myurl,
dataType : "json",
... | true |
f8849d568b134fb724872a4cec6cf4ca142de566 | JavaScript | Enjoybonze/WebCV | /Part3/javascript.js | UTF-8 | 1,147 | 2.703125 | 3 | [] | no_license | function select (button) {
document.getElementById("Frame").src ="./" + button.id + ".html";
let buttons = document.getElementsByClassName("buttonnav");
for (let index = 0; index < buttons.length; index++) {
const element = buttons[index];
element.classList.remove("selectedbutton");
}
button.classList... | true |
ecdea2e9437df984a1637ee0401b2fe6f082a588 | JavaScript | malevolentninja/Codeacademy | /Javascript/NewSummer2017Course/IntroductionToJavascript/1.2Variables.js | UTF-8 | 943 | 4.8125 | 5 | [] | no_license | // 1. Variables
// No code to write.
// 2. Create a Variable
var strength = '50,000 pounds';
console.log('How much stuff can a variable hold?', strength);
// 3. Create a Variable II
var strength = '50,000 pounds';
console.log('How much stuff can a variable hold?', strength);
// added age and pet
var age = 22; ... | true |
53ea164450efb7fb00c7b0028a4c060ed6e97a97 | JavaScript | Capstone-Projects-2020-Spring/PlannerAssistant | /build/web/js/speech.js | UTF-8 | 1,406 | 2.703125 | 3 | [] | no_license | window.addEventListener("DOMContentLoaded", () => {
console.log("speech");
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
if (typeof SpeechRecognition === "undefined") {
console.log("UND");
} else {
console.log("Not UND");
let listening = ... | true |
e1f01cba9c07fa00423fb2fff8e65bd21d78926c | JavaScript | ObjetosInteractivosCENTRO/MD0537-CinemaExpandidoWEB | /clase_3/tarea/tarea_videoPixel/sketch.js | UTF-8 | 3,911 | 3.359375 | 3 | [] | no_license | /*
*
* cinema_Expandido_Web
* PIXEL_ARRAY (MAR-20-18)
* DANIELA LEVY ESSES
* Tarea II
*
*
* URL: https://esdanylevy.github.io/CEW_pixel_array2/
*/
/*
*****************************************
*****************************************
* VARIABLES
*****************************************
***************... | true |