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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c1870669dc2d4efe11c77dcd427b0943d43d0ab2 | JavaScript | luketpena/elevator-saga | /solution.js | UTF-8 | 8,611 | 3.21875 | 3 | [] | no_license | {
init: function(elevators, floors) {
console.log(elevators);
/*--------< Define Functions >--------*/
//#region Direction Controls
function setDirection(e,direction) {
e.goingUpIndicator( (direction==="up") );
e.goingDownIndicator( (direction==="down") );
... | true |
313548e081b1267ba7d931af39a1ea3493dde3bf | JavaScript | AmritPalSingh1/3d-snake-AI | /js/Queue.js | UTF-8 | 1,477 | 3.671875 | 4 | [] | no_license | class Queue {
constructor() {
this.items = [];
}
enqueue(element) {
this.items.push(element);
}
dequeue() {
if (this.isEmpty()) {
return "Underflow";
}
return this.items.shift();
}
tail() {
if (this.isEmpty()) {
return "No element in Queue";
}
return this.ite... | true |
6d35f8f5ca3b3bc7143368e8d73b244a18118762 | JavaScript | madannaik/animeflixclone | /src/API/api.js | UTF-8 | 437 | 2.5625 | 3 | [] | no_license | import axios from "axios";
export const fetchDetails = async (url)=>{
let datast = [];
await axios.get(url)
.then(function (response) {
datast = response.data["top"];
})
.catch(function (error) {
// handle error
console.log(e... | true |
8db050bb841aa0d145b2f015a8e9a58f9e61f3ed | JavaScript | NikTheGeek1/blackJack | /client/src/models/canvas/CanvasManager.js | UTF-8 | 15,544 | 2.609375 | 3 | [] | no_license | import CanvasImgNames from '../../constants/canvas/ImgNames';
import CanvasDynamicSizesManager from '../../utils/canvas/coordinates_sizes/DynamicManager';
import RevealedCardUtils from '../../utils/canvas/RevealedCardUtils';
import TokenUtils from '../../utils/canvas/TokenUtils';
import HoverOverType from '../../utils/... | true |
7e081b8dbbd10bc8c1aa2d9bde94e1fadae1c02a | JavaScript | kozaktar/Algorithms-Datastructures | /JS/strings/LongestSubstring.js | UTF-8 | 494 | 3.6875 | 4 | [] | no_license | const longestSubstring=(string)=>{
let startingIndex=0;
let endingIndex=0;
let tempStartingIndex=0;
for(let i=0; i<string.length;i++){
if(string[tempStartingIndex]===string[i]){
if(i-tempStartingIndex>endingIndex-startingIndex){
startingIndex=tempStartingIndex;
... | true |
4050cb72e941de4f9538e5b70b0b190a35e6675d | JavaScript | JhojannRodriguez/web-components | /ECS6/script-parallax-demo.js | UTF-8 | 669 | 2.953125 | 3 | [] | no_license | class Parallax{
constructor(elements){
this.elements = [...document.querySelectorAll(elements)];
this.start();
}
start(){
window.addEventListener('unload', () => { this.gettingValues() } )
window.addEventListener('scroll', () => { this.gettingValues() } )
}
gettingValues(){
let valueEnd;... | true |
f0e9043c100ebffc9f52578008f65a53adba32c2 | JavaScript | JonathanDAmours/m2-4-js--thedom-P2 | /__workshop/_fundamentals/__tests__/exercise-2.test.js | UTF-8 | 609 | 3.296875 | 3 | [] | no_license | // We import (require) the function that we want to test.
const redacted = require("../exercise-2");
// Write 3 more expect functions to test the function you just wrote.
test("Exercise 2", () => {
expect(redacted(["bacon", false, 42])).toStrictEqual(["redacted", false, 42]);
// add more tests here...
expect(red... | true |
b60d6546f9fad48bdd7c5af06dd0624f2bd22732 | JavaScript | henrycity/message-board | /server.js | UTF-8 | 1,006 | 2.734375 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser')
const app = express();
let database = {
channels: {
1: { description: 'Announcement', messages: [] },
2: { description: 'General', messages: [] },
3: { description: 'Random', messages: [] },
}
};
app.use(bodyP... | true |
44e87a02bf0f2b5afeed04da8836e4ba9a510490 | JavaScript | slowyangyang/copyMall | /src/network/request.js | UTF-8 | 623 | 2.546875 | 3 | [] | no_license | //封装axios作为中间件
//引入axios
import axios from 'axios'
export function request1(config){
//1。创建axios实例
const instance = axios.create({
//基本参数
baseURL:'http://152.136.185.210:8000/api/z8',
timeout:5000
})
//2.设置拦截器
//请求拦截
//可以在拦截时对请求信息进行设置
axios.interceptors.request.use(
config => {
return config//必须返回
},er... | true |
74ba62b77d3be096641fe88408a060b7ddaf713a | JavaScript | kelvearagao/react-hooks-examples | /src/examples/ExRef/index.js | UTF-8 | 2,452 | 2.875 | 3 | [] | no_license | /* eslint-disable consistent-return */
/* eslint-disable no-param-reassign */
import React, { useRef, useEffect, useState } from 'react';
import './styles.css';
import quotes from './ws';
const updateStatus = (prev, data) => Object.keys(data).reduce((acc, key) => {
if (prev[key] && data[key]) {
if (data[key].val... | true |
e39b6cb9c8018aa4af1d6bd10bb10fbc98c3fd59 | JavaScript | sidthekid134/coda-algo-club | /First Meeting - Recursion - 08-30-2017/Code/RecursionInJS.js | UTF-8 | 911 | 2.90625 | 3 | [] | no_license | var generateSearchImage = function() {
var query = $("#search-box").val();
var queryUrl = `https://api.giphy.com/v1/gifs/search?api_key=${apiKey}&q=${query}&limit=20&offset=0&rating=G&lang=en`
$.ajax({
url: queryUrl,
type: "GET",
dataType: "json"
}).done(function(response) {
for(let i = 0, x = response... | true |
9e1f11b4543dca00d75eff92316a9d5ec8ef17f9 | JavaScript | treilly6/calorie_counter | /tools/groupingTools.js | UTF-8 | 922 | 3.0625 | 3 | [] | no_license | module.exports = {
// function that will group the meals by the date they were entered
// used to find the total calories for specific dates
groupByDate : (mealArray) => {
return mealArray.reduce((map, mealItem) => {
console.log(mealItem.date);
console.log(map);
c... | true |
7057f4714edde09d6d266dc2ab8f7d5b5511aa2f | JavaScript | ashmichheda/javaScript-mini-projects | /changeColor/script.js | UTF-8 | 457 | 3.640625 | 4 | [] | no_license | // Selecting button
const colorBtn = document.querySelector('.colorButton');
const bodyBcg = document.querySelector('body');
// Declare an array of colors
const colors = ['yellow', 'red', 'blue', 'green', '#5b6698'];
// Use event listner to change color on select button
colorBtn.addEventListener('click', changeColor)... | true |
1cb0258f8f65e5b8b17040b24f12a9ae9f9e91f6 | JavaScript | melihkocaadam/realtime_data_process | /static/js/report.js | UTF-8 | 2,362 | 3.125 | 3 | [] | no_license | var started = true;
var endPoints = ["getAgentsData", "getCallsData"];
var hostName = window.location.hostname;
function CreateTableFromJSON() {
var int_str = document.getElementById("interval").value;
var interval = 1000 * parseInt(int_str);
if (started) {
setTimeout(function(){ CreateTableFromJSO... | true |
ad1ca7581d2aaa1aa17acbe35d09d8813e28ba5a | JavaScript | wtbrown10/Node_JS | /fourthNpm/public/login.js | UTF-8 | 2,206 | 3.09375 | 3 | [] | no_license | window.onload = function () {
// 1.
const heading = document.createElement('h1')
const div = document.createElement('div')
const loginForm = document.createElement('form')
const emailInput = document.createElement('input')
const passwordInput = document.createElement('input')
const submitBu... | true |
9fb1e1a09e5510784a5545c8702b8ddd9c48bf7a | JavaScript | mntjones/javascript-hide-and-seek-bootcamp-prep-000 | /index.js | UTF-8 | 630 | 3.15625 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | function getFirstSelector(selector) {
return document.querySelector(selector)
}
function nestedTarget() {
return document.getElementById("nested").querySelector(".target")
}
function increaseRankBy(n) {
const rankNum = document.getElementById("app").querySelectorAll("ul.ranked-list li")
for (let i=0; i < r... | true |
52d6aea9c7bb970f47070c96d02354e5339f0aba | JavaScript | cmiscm/kute.js | /demo/assets/js/easing.js | UTF-8 | 3,968 | 2.640625 | 3 | [
"MIT"
] | permissive | // some regular checking
var isIE = (new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null) ? parseFloat( RegExp.$1 ) : false,
isIE8 = isIE === 8,
isIE9 = isIE === 9;
/* EASINGS EXAMPLES */
var featurettes = document.querySelectorAll('.featurettes'), l=featurettes.length,
esProp1 = i... | true |
5a94306f4c0b9e6f7c4450210025b344e3a1fca3 | JavaScript | giants415/grider_algorithim | /exercises/vowels/index.js | UTF-8 | 1,326 | 4.09375 | 4 | [] | no_license | // --- Directions
// Write a function that returns the number of vowels
// used in a string. Vowels are the characters 'a', 'e'
// 'i', 'o', and 'u'.
// --- Examples
// vowels('Hi There!') --> 3
// vowels('Why do you ask?') --> 4
// vowels('Why?') --> 0
//Grider's condensed soln
function vowels(str) {
//rege... | true |
29cd23be480f2f564154980d92ae4a777e95478e | JavaScript | lypinghhh/- | /笔经/baidu.js | UTF-8 | 3,910 | 3.25 | 3 | [
"Apache-2.0"
] | permissive | var Calculator = {
init: function () {
var that = this;
if (!that.isInited) {
that.isInited = true;
// 保存操作信息
// total: Number, 总的结果
// next: String, 下一个和 total 进行运算的数据
// action: String, 操作符号
that.data = {total: 0, next: '', ac... | true |
396cd08fc47610d56838effe91ceda9c15a8af52 | JavaScript | vormc2005/Project3 | /client/src/pages/PostPage.js | UTF-8 | 5,006 | 2.578125 | 3 | [] | no_license | import API from "../utils/API";
import React, { useState, useEffect } from "react"; //, useReducer taken out since not using
import Footer from "../components/Footer";
import FileUpload from "../components/utils/FileUpload";
function PostPage() {
// Setting our component's initial state
const [Items, setItems] = ... | true |
6b90984105729ce85c8c054530e8affeb29618e7 | JavaScript | gabrielsimek/code-challenges | /src/array-methods.js | UTF-8 | 1,557 | 3.625 | 4 | [] | no_license | export function howMuchPencil(str) {
let returnArr = [];
for (let i = 0; i < str.length + 1; i++){
returnArr.push(str.slice((i)));
}
return returnArr;
}
export function wordsToCharList(arr) {
return [...arr];
}
export function listFoods(recipe){
let list = Object.values(recipe.ingredients);
const an... | true |
9517aa252799b9f2089a57c354ab8fe7f53582b4 | JavaScript | MRSA-J/Foodie-WebVersion | /src/components/Order/Order.js | UTF-8 | 8,548 | 2.578125 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react'
import {
OrderContext
} from "../Context/OrderContext";
import './Order.css'
class Order extends Component {
constructor(props) {
super(props);
/*this.state = {
orderList: [
{ id: 1, name: "Caesar Salad", num: 1, price: 6.99... | true |
a137888d9fb642a1b738cdd7b01d532ee03e3fa1 | JavaScript | rhuan-sampaio/api-react-consumption | /src/pages/Aluno/index copy.js | UTF-8 | 5,973 | 2.53125 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import { useDispatch } from 'react-redux';
import PropType from 'prop-types';
import { get } from 'lodash';
import { isEmail, isInt, isFloat } from 'validator';
import { toast } from 'react-toastify';
import { FaEdit, FaUserCircle } from 'react-icons/fa';
import { Li... | true |
2826d603d227719985d5dd44d985cb92351df17d | JavaScript | vanni11/boiler-plate-ko | /models/User.js | UTF-8 | 2,952 | 2.84375 | 3 | [] | no_license | const mongoose = require('mongoose')
const bcrypt = require('bcrypt')
const saltRounds = 10 //비밀번호 길이
const jwt = require('jsonwebtoken')
const userSchema = mongoose.Schema({
name: {
type: String,
maxlength: 50
},
email: {
type: String,
trim: true, //공백을 없애줌
unique:... | true |
4c67fa98bb75dc407438a8380c6d5ddc9d00426c | JavaScript | Shadeslayer234/DailyCodingChallenges | /Day_3/main.js | UTF-8 | 82 | 2.984375 | 3 | [] | no_license | function sumOfFirstAndLastValue(arr){
console.log(arr[0] + arr[arr.length-1])
}
| true |
c9fcb3eec38d15253f4633dcb663bcc0854482c1 | JavaScript | sandipan100roy/setprototypeof-eg | /index.js | UTF-8 | 275 | 3.515625 | 4 | [] | no_license |
let toyota = {
drive : function(){
return 'Driving toyota!!';
}
}
let camri = {
wifi : () => {
return 'Using wifi!!';
}
}
Object.setPrototypeOf(camri,toyota); //Function of toyota copied to camri.
console.log(camri.wifi());
console.log(camri.drive());
| true |
b9958ff6fad4f6f04039d380fec61d6a8196b78b | JavaScript | KimrLong/Nov2020Cohort | /week08/3-Wednesday/labs/class.js/routes/contact.js | UTF-8 | 408 | 2.5625 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
router.get('/contact', (req, res) =>{
let userName = req.param('name')
console.log(userName);
res.send('<h1>hello here ${userName}</h1>')
})
router.get('/contact/:name', (req, res) =>{
let userName = req.params.name
console.log(us... | true |
ec36d282472069f251f0e1c82800ae7bcdb3db35 | JavaScript | natpoveda/calculadora | /src/operaciones.js | UTF-8 | 766 | 3.265625 | 3 | [] | no_license | function operando(options) {
const val1 = Number(options[0]);
const val2 = Number(options[1]);
const operacion = options[2];
let result = null;
console.log('entro a operando ', options);
console.log('V1 ', val1);
console.log('V2', val2);
console.log('OPER', operacion);
switch (oper... | true |
892e11b53e516814a128e540e9bea5dd9ab429e9 | JavaScript | mit-gfx/pentimento | /src/visuals/pointer_event_manager.js | UTF-8 | 1,869 | 2.609375 | 3 | [] | no_license | "use strict";
var PointerEventManager = function(container_id, coords_comparator_id) {
var self = EventManager().initializeEvents({
pointer_down: "pointer_down",
pointer_drag: "pointer_drag",
pointer_up: "pointer_up"
});
var $container = $("#" + container_id);
if (coords_comparator_id == null) {
c... | true |
30fa9f548eac5a5fc68aa9f46dde06f732086400 | JavaScript | GladysAssistant/Gladys | /server/services/xiaomi/lib/event/xiaomi.newValueMagnetSensor.js | UTF-8 | 2,474 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | const logger = require('../../../../utils/logger');
const {
EVENTS,
DEVICE_FEATURE_CATEGORIES,
DEVICE_FEATURE_TYPES,
DEVICE_FEATURE_UNITS,
} = require('../../../../utils/constants');
const { MAGNET_STATUS } = require('../utils/deviceStatus');
const { getBatteryPercent } = require('../utils/getBatteryPercent');... | true |
cea199cf66d7f45892f4ae707a2ee8cb985b6d79 | JavaScript | viirtus/tanks-api | /src/bots/vishnya-bot.js | UTF-8 | 6,917 | 2.75 | 3 | [] | no_license | import {Bot} from "../playground/bot";
import {ACTIONS} from "../playground/config/actions";
import {CELL_TYPES} from "../playground/config/cell-types";
/**
* Тестовый бот.
*/
export class VishnyaBot extends Bot {
constructor() {
super();
this.name = 'SUPER THRASHER 4000 '
}
doStep() {... | true |
f9f3c031cca85e7b1a2801dbebfe24b9e76f13b0 | JavaScript | moonformeli/sw_academy | /수박수박수박수박수/index.js | UTF-8 | 205 | 2.875 | 3 | [] | no_license | function solution(n) {
const pattern = {true: '수', false: '박'};
let bool = false;
return [...new Array(n)].map(_ => {
bool = !bool;
return pattern[bool];
}).join('');
}
| true |
5dce3c3c9e82a853ae9344ec860c9d25a2f3da48 | JavaScript | Kashslesh/exoAvecKim | /main.js | UTF-8 | 1,831 | 3.03125 | 3 | [] | no_license | const alreadyRegisteredUsernames = ["kim", "emmanuel", "nicolas"];
// initiliation des variables
const username = document.querySelector("#username");
let password = document.querySelector("#password");
const comfirmPassword = document.querySelector("#comfirm-password");
const parag = document.querySelector("p");
... | true |
8ec7bc92535413f65bb7711884b1af3b8f3fe128 | JavaScript | AngelicMob/boat-assignment | /server/database.js | UTF-8 | 3,132 | 2.546875 | 3 | [] | no_license | const { MongoClient, ObjectID } = require("mongodb");
const url = "mongodb://localhost:27017";
const dbName = "boatDataBase";
const collectionName = "boats";
function getAll(callback) {
getAllBoats({}, callback)
}
function add(boat, callback) {
addBoats(boat, callback)
}
function getAllBoats(filter, callba... | true |
7769fe889e98d731f0c695b828b6e3cde9fe1a3f | JavaScript | MikeDulik/do_something_express_part1 | /application.js | UTF-8 | 1,482 | 2.828125 | 3 | [] | no_license |
//used some of solution branch code to learn/fix broken code in routes
//js express
var express = require("express");
var app = express();
//connects tasksController
var tasksController = require("./app/controllers/tasksController");
//configure app to use body parser
var bodyParser = require("body-parser")
app.use... | true |
b84da37cd260b7b3256349161f5f76e5bbe3b65e | JavaScript | petechern/CPSC473-Assignment-7 | /app.js | UTF-8 | 1,655 | 2.859375 | 3 | [] | no_license | var express = require('express');
var app = express();
var redis = require('redis');
var client = redis.createClient();
client.on('connect', function() {
console.log('connected');
});
app.set('view engine', 'jade');
var randValue = function(){
//will return a random base 36 string
var x = Math.floor((Math.ra... | true |
a47364f8e4b0f96976e266a5aacf6bd43e965788 | JavaScript | onedox/selenium | /third_party/js/wgxpath/literal.js | UTF-8 | 827 | 3.046875 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | // Copyright 2012 Google Inc. All Rights Reserved.
/**
* @fileoverview A class representing the string literals.
*/
goog.provide('wgxpath.Literal');
goog.require('wgxpath.Expr');
/**
* Constructs a string literal expression.
*
* @param {string} text The text value of the literal.
* @constructor
* @extends ... | true |
230f47344cd4bbfbd1915fe7e0616bb332292b65 | JavaScript | 0surface/dremit | /frontend/src/components/Deposit.js | UTF-8 | 7,037 | 2.515625 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import "bootstrap/dist/css/bootstrap.css";
import EtherInput from "./EtherInput";
const emptyDeposit = {
senderError: "",
remitterError: "",
passwordError: "",
lockDurationError: "",
amountError: "",
sender: "",
remitter: "",
password: "",
lockDurat... | true |
7efe9c00a24bdaf6445473e7f866b3ec6007ca84 | JavaScript | debojyotichatterjee9/js30 | /es6Snippets/01 scoping-Refresher/script.js | UTF-8 | 3,238 | 4.96875 | 5 | [] | no_license | /* Let's declare a variable named 'randomNumber' and assign a value (999) to it. */
var randomNumber = 999;
console.log(randomNumber); // here we can log the variable value and check
randomNumber = 888; // now we can also reassign the variable with a new value to it (888)
console.log(randomNumber); // we log the va... | true |
56db705b1c2abde2d1e2a8c70acfdd283663aef3 | JavaScript | LN-Zap/node-lnd-grpc | /src/utils/promisifiedCall.js | UTF-8 | 321 | 2.65625 | 3 | [
"MIT"
] | permissive | import { promisify } from 'util'
/**
* Promisifies specified method and calls it with @thisArg as this and passes @args as an object
* @param {*} thisArg
* @param {*} method
* @param {*} args
*/
export default function promisifiedCall(thisArg, method, ...args) {
return promisify(method).call(thisArg, ...args)
}... | true |
bdc4c364123204ac74a0d0ee3ef2b5714e857b5d | JavaScript | chancellorPro/stockworker | /resources/assets/app/modules/dye/handlers/addNewRow.js | UTF-8 | 494 | 2.5625 | 3 | [] | no_license | /**
* Add next rows to the dye config grid
*
* @returns {boolean}
*/
export function addNewRow() {
const add_counter = $('.add-counter').val();
const tbody = $('#dye > tbody');
const trLast = $('#dye_template').html();
for (let i = 0; i < add_counter; i++) {
tbody.append(trLast);
l... | true |
9da283f0346b6271624d0fac37d061358fbdc727 | JavaScript | arunbillava/irun-node-api-poll | /server/controllers/api.controller.js | UTF-8 | 3,397 | 2.703125 | 3 | [] | no_license | const config = require('../config/config');
const request = require('request');
const comment = require('../models/comment.model');
const start = async () => {
console.log("alive and listening..");
try {
let apiResult = await callApi();
if (apiResult) {
let results = JSON.parse(apiR... | true |
58801d2ac286f8a612d1d112b955fd0e0d7bf90c | JavaScript | Menhaj01/lab-express-cinema | /routes/index.js | UTF-8 | 698 | 2.53125 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const Movie = require("../models/Movie.model");
/* GET home page */
router.get("/", (req, res, next) => res.render("index"));
router.get("/movies", (req, res, next) => {
Movie.find()
.then((allMovies) => {
console.log(allMovies);
r... | true |
9836b33e99440e43ef1cc5e343a7f3f2cff2a92d | JavaScript | hanamj/pebble-misfitmc-chat | /src/players.js | UTF-8 | 902 | 2.578125 | 3 | [] | no_license | var ajax = require('ajax');
var exports;
exports.refreshPlayers = refreshPlayers;
var fetchingPlayers = false;
function refreshPlayers(card) {
if (fetchingPlayers) return;
fetchingPlayers = true;
setTimeout(function () {
card.icon("images/pb_wait.png");
}, 1);
setTimeout(function () {
getPlayers(fu... | true |
342c848183b324791eef02dea72dc3a28952bd38 | JavaScript | captainpainway/icosplode | /js/scene.js | UTF-8 | 3,214 | 2.84375 | 3 | [] | no_license | let camera,
scene,
renderer,
icos = [],
tick = 0,
startPoint = -20;
function init() {
camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.01, 50);
camera.position.set(10, 5, 1);
scene = new THREE.Scene();
const light = new THREE.PointLight(0xffffff, ... | true |
3037536ec37ac3941082145a7b82892a937c7f0e | JavaScript | lycodestore/node-im | /public/main/main.js | UTF-8 | 471 | 2.6875 | 3 | [] | no_license | //切换tab
function changeTab(pageIndex) {
var main = getElement('.content-wrapper')
switch (pageIndex) {
case 1:
main.style.transform = 'translateX(0)'
break
case 2:
main.style.transform = 'translateX(-25%)'
break
case 3:
main.sty... | true |
8935c99ee4a8c8240bb29a9a75abd3ea9fb98f90 | JavaScript | 4m1g0/ServerWoW-Web | /webroot/static/local-common/js/overlay.js | UTF-8 | 3,763 | 2.78125 | 3 | [] | no_license | var Overlay = {
/**
* Cached results from the AJAX responses.
*/
cache: {},
/**
* Default configuration.
*/
config: {
ajax: false,
bindClose: true,
className: "",
fadeSpeed: 250,
blackout: true
},
/**
* Has the class been initialized?
*/
loaded: null,
/**
* DOM object for th... | true |
2a440ab13fa49348a3bd3fd4680768f54512eea4 | JavaScript | Kadurid/TrabalhoSistemasMult | /createWorld.js | UTF-8 | 2,467 | 2.6875 | 3 | [] | no_license | function preload() {
//fundos
this.load.image('backgroundmap','assets/Mapas/MapaGrama.png');
//elementos
this.load.image('tree','assets/tree01.png');
this.load.spritesheet('elements',"assets/itens/resources_basic.png",{ frameWidth:24, frameHeight:24 });
//personagem
//TODO arrumar tama... | true |
a68c75293ff1eb836cb92b3be550e51f7ed6d5cd | JavaScript | alumnica/studio | /studio/static/studio/js/ambit.js | UTF-8 | 7,662 | 2.578125 | 3 | [] | no_license | /**
* Adds color radio buttons click functionality and retrieves assigned subjects list
*/
$(document).ready(function () {
$(":submit").on('click', function () {
let texts = [];
$('#sortable li').each(function () {
let currentLi = $(this);
texts.push(currentLi.text());
... | true |
73a346c01f98d8c312fa685e4d38a2032b659ecf | JavaScript | michaelshmichael/noughts-and-crosses | /script.js | UTF-8 | 7,437 | 3.1875 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Object with the board functionality
const gameBoard = ( () => {
let board = ["","","","","","","","","",];
let hasWon = false;
const boardSquares = Array.from(document.querySel... | true |
a1be7aa39f8e54b3a2bf78a9d5a8dd9f8597de2d | JavaScript | tawebbcn/wdft-en-jan-2021 | /m1/w1/d4/00-js-scope/scripts/02-var-in-for-loop.js | UTF-8 | 291 | 3.671875 | 4 | [] | no_license |
var i = 'something important';
console.log(i);
for (var i = 0; i <= 10; i++){ // Solution => use `let`
console.log(i)
}
// `var` variables created outside of functions are always global
// this can cause issues with for loops, and overwrite global values
console.log('After => i ', i) | true |
ffbba071daaf09bde0d23a9ec84954d40a110a27 | JavaScript | Desj0251/ReactMidterm | /src/format.js | UTF-8 | 440 | 3.171875 | 3 | [] | no_license | export function getAge(birthday){
let d = new Date(Date.now() - new Date(birthday).getTime());
return Math.abs(d.getUTCFullYear() - 1970);
}
export function dob(dob){
return dob.substring(0,10)
}
export function titleCase(str){
str = str.toLowerCase();
str = str.split(" ");
for (var i = 0; i <... | true |
fafbf3ac85b07263955658efd57786641b862c5e | JavaScript | ErickJManuel/myAngularApp2 | /Challenge 12/js/directives/title.js | UTF-8 | 1,471 | 3.046875 | 3 | [] | no_license | <!--
/*
1. Inside a $timeout(), make a Bootstrap popover, to replace the default tooltip on hover, by passing the popover() method
{ trigger: 'hover' }. Refer to the Bootstrap API docs for the popover() method and parameters. Don't forget to rename our directive to 'popover'.
First, rename our directive to 'popove... | true |
a968060edcb8698af642aca0ee1bcaff40e97022 | JavaScript | davidsu/leetcodeFavorites | /test/1202.smallest-string-with-swaps.test.js | UTF-8 | 559 | 2.90625 | 3 | [] | no_license | // const testFuncs = require('../src/1202.smallest-string-with-swaps.js')
const testFuncs = []
xdescribe.each(
Object.entries(testFuncs)
)('%s', (_, testFunc) => {
it('case 1', () => {
const s = 'dcab'; const pairs = [[0, 3], [1, 2]]
expect(testFunc(s, pairs)).toEqual('bacd')
})
it('case 2', () => {
... | true |
f1f74003325272844f67fed487f3cff3e165d794 | JavaScript | se8un/JS_1 | /src/js/index.js | UTF-8 | 32,639 | 4.125 | 4 | [] | no_license | 'use strict'
// document.write('<h1>в JS document.write с тегами h1</h1>');
// alert("Javacript подключен");
// console.log("Учим")
// console.log("JS")
// let mathFloor = Math.floor(Math.random() * 50);
// console.log(mathFloor); // Prints a random number
// console.log(Math.ceil(Math.random() * 10));
// c... | true |
feff106269283cfb48a2569daa2c7182c5902ac4 | JavaScript | lduhaut/gas-compta | /gas/pro/fichier-travail.gs | UTF-8 | 9,049 | 2.640625 | 3 | [
"MIT"
] | permissive | // Id fichier listing facture 2016-2017
var ID_FEUILLE_LISTING_FACTURE = '15b7mrxzgZlBQtgfegTFLOGX58gHsI7G6KTtL-H5dDhU';
function onOpen() {
// Création du menu perso
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var entries = [
{
name : "01 - Réinitialiser le fichier",
functionName : ... | true |
5ba48eba26816c52dc617dbccac9a9bd1c9b0b79 | JavaScript | saurabhkuhikar/ospm | /web/js/get_total_amount.js | UTF-8 | 875 | 2.703125 | 3 | [] | no_license | $(document).ready(function(){
$("#cylinderbooking-cylinder_type").change(function(){
calculateTotalAmount();
});
$("#cylinderbooking-cylinder_quantity").bind('keyup mouseup',function(){
calculateTotalAmount();
});
});
function calculateTotalAmount(){
var cylinderQuantity = $("#cylinderbooking-cylinder_qua... | true |
9d1afb0d22d72ce067c44b01875227d71ea10c81 | JavaScript | Shevchuk-Ren/goit-react-hw-07-phonebook | /src/redux/phoneBook/phonebook-operations.js | UTF-8 | 1,427 | 2.578125 | 3 | [] | no_license | import axios from 'axios';
import { v4 as uuidv4 } from 'uuid';
import { addPhonebookError, addPhonebookRequest, addPhonebookSuccess, deletePhonebookError, deletePhonebookRequest, deletePhonebookSuccess, fetchPhonebookError, fetchPhonebookRequest, fetchPhonebookSuccess } from './phonebook-actions';
axios.default... | true |
7e023710a3b755ad746777c376bb58da1c211d03 | JavaScript | meetyouapp/meetyou-client | /client/stores/actions/videoCallAction.js | UTF-8 | 2,393 | 2.53125 | 3 | [] | no_license | import { SET_VIDEO_CALL, SET_LOADING_VIDEO_CALL, GET_VIDEO_CALL, SET_ERROR_VIDEO_CALL } from '../actionType'
import { instance } from "../../apis/api"
import AsyncStorage from "@react-native-async-storage/async-storage"
export function setVideoCall(videoCall) {
return {
type: SET_VIDEO_CALL,
payloa... | true |
6ae98b50bb9f765e37efed2c28ab9e6933f7e37d | JavaScript | stefi23/mars-rover | /mars-rover.js | UTF-8 | 4,881 | 3.640625 | 4 | [] | no_license | const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
const getUserInput = (question) => {
return new Promise((resolve, reject) => {
rl.question(question, (answer) => {
resolve(answer);
});
});
};
const main = async () => {... | true |
ca290890aa9eb54b461801df429b09b95fc8fc01 | JavaScript | MrFangR/SwedenProject | /klubb/src/main/webapp/back-ui/local-ui/map.js | UTF-8 | 2,462 | 2.6875 | 3 | [] | no_license | var map = null;
/**
* 地图相关
*/
// 初始化地图
function initMap() {
var map = new google.maps.Map(document.getElementById('allmap'), {
center : {
lat : 60.178909,
lng : 18.571950
},
zoom : 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var input = document.getElementById('pac-input');
... | true |
49003bb5f8f89457c0e8987b867db987834a2421 | JavaScript | panyeung/System-Management | /src/api/ajax.js | UTF-8 | 826 | 2.734375 | 3 | [] | no_license | import axios from "axios";
import { message } from "antd";
/*
This function will encapsulate axios. The function
will return a promise
Encapsulate a new promise outside of axios, allow handle
exception in 1 place.
*/
export default function ajax(url, data = {}, type = "GET") {
//executer
return new ... | true |
d5841527a27855f4cedcff4136cdde5b78fc674a | JavaScript | jenniferjeon/jenniferjeon.github.com | /des157/studio1/script.js | UTF-8 | 1,665 | 3.09375 | 3 | [] | no_license | (function(){
'use strict';
const myForm = document.querySelector('#myForm');
const madlib = document.querySelector('#madlib');
myForm.addEventListener('submit', function(event) {
event.preventDefault();
const name = document.querySelector('#name').value;
const job = documen... | true |
57d9009ba96cffce811b2ad99761a9c4118e3b14 | JavaScript | zhangcai93/practice | /Sublime Text 3/练习/js/move.js | UTF-8 | 838 | 2.796875 | 3 | [] | no_license | // JavaScript Document
function startMove(obj, attr, iTarget){
clearInterval(obj.timer);
obj.timer = setInterval(function(){
var iCstyle = 0;
if( attr == "opacity"){
iCstyle =parseInt(parseFloat(getStyle(obj, attr))*100);
}else{
iCstyle =parseInt(getStyle(obj, attr));
}
var iSpeed = (... | true |
df4d4459efd3ed265e7a91a0718a37f2b409be2c | JavaScript | jeromsky11/eduline | /usuarios/Usuarios.js | UTF-8 | 1,046 | 2.640625 | 3 | [
"MIT"
] | permissive | var Usuarios=function(){
this.cargarObjetos();
this.cargarEventos();
}
Usuarios.prototype.cargarEventos=function(){
this.botonIniciarSesion.on("click",$.proxy(this.loguear,this));
}
Usuarios.prototype.cargarObjetos=function(){
this.campoUsuario=$("#campoUsuario");
this.campoPassword=$("#campoPassword");... | true |
b1f2c068f02384720223143c7de22b29270d4ead | JavaScript | Kerjox/LenDeMar_1h | /Eva1/GM/02_Parte-JavaScript/09-Recaptcha/09-Recaptcha_base64+SHA256/java.js | UTF-8 | 2,146 | 2.625 | 3 | [] | no_license | imagen = new Array ();
imagen[0]="./imagenes/0.jpg";
imagen[1]="./imagenes/1.jpg";
imagen[2]="./imagenes/2.jpg";
imagen[3]="./imagenes/3.jpg";
imagen[4]="./imagenes/4.jpg";
imagen[5]="./imagenes/5.jpg";
imagen[6]="./imagenes/6.jpg";
imagen[7]="./imagenes/7.jpg";
imagen[8]="./imagenes... | true |
4275df07cc21cc8076ca6b6fb12427b8c12d2bf1 | JavaScript | emmanuelJd/rockfallTools | /functions/addAllPieceToIndex.js | UTF-8 | 636 | 2.828125 | 3 | [] | no_license | "use strict";
/**
* @param boardGame object with game information
*
* function to apply add piece to a index
*/
function addAllPieceToIndex(boardGame, indexPiece) {
//verify input variable
if (!boardGame.length) throw new Error("Undefined boardGameOne!");
if (!boardGame[0].length) throw new Error("Und... | true |
24ed98febbf104736a6341eabfe7efb39665b27d | JavaScript | nmhieu9779/GBDS | /src/screen/Notification/redux/reducers.js | UTF-8 | 839 | 2.515625 | 3 | [] | no_license | import * as actions from "@src/redux/actions"
initStateNotification = {
notification: {loading: false, response: null, success: false, error: null}
}
const notification = (state = initStateNotification, action) => {
switch (action.type) {
case actions.ACTION_GET_NOTIFICATION:
return {...state, notificat... | true |
9b13dd9a9565f87e1b19b9b03d405d5c888ab591 | JavaScript | meir2017/CarePet | /cor1/www/scripts/AnimalDetails.js | UTF-8 | 5,959 | 2.734375 | 3 | [] | no_license |
$(document).ready(function () {
var dog = ["בולדוג", "רוטווליר", "לורדור", "האסקי סיבירי", "פודל", "פיקינז", "רועה גרמני", "פיטבול", "דוברמן", "פינציר", "צ'יוואווה ", "בוקסר", "בורדר קולי", "שיצו", "אחר",];
var cat = ["ברטי", "סיאמי", "פרסי ", "רגדול", "מיין קון ", "ספינקס", "אביסיני", "רוסי כחול", "ברומזי"... | true |
3fa03ccdf179396b4231732464ea304261825cbc | JavaScript | montagao/gardensentry-jush | /gs-agent/simple-agent.js | UTF-8 | 1,636 | 2.90625 | 3 | [] | no_license | // Use Defaults
// Pass Options - the example below actually uses the default values from the environment
var account = process.env.AZURE_STORAGE_ACCOUNT;
//var key = process.env.AZURE_STORAGE_ACCESS_KEY;
const key = "7V+S9ZazM7Y5r9JzylWsSR8Y2y/sSCwN2U5AutoSqcj7ojJdv504j9KcBIiXKf4lCLcySQlK1zhIGskHZAglYw==";
// var cs =... | true |
27c774a60f59aec85b47f9bc81bacd7b3ca420ee | JavaScript | SlavkoPar/rick-and-morty | /src/components/useHover.js | UTF-8 | 774 | 2.78125 | 3 | [] | no_license | import { useRef, useState, useEffect } from 'react';
// Hook
export function useHover() {
const [hoverProps, setValue] = useState({ isHovered: false });
const divRef = useRef(null);
const handleMouseOver = () => setValue({ isHovered: true });
const handleMouseOut = () => setValue({ isHovered: false });
us... | true |
3da5b03a7dd8251c746ead7785a55eb74789c6b3 | JavaScript | eltondornelas/tw-js | /curso-avancado/cap04_requisicoes_fetch/01_fazendo_requisicoes_com_fetch/scripts.js | UTF-8 | 327 | 3 | 3 | [] | no_license | (async function () {
var response = await fetch('https://api.github.com/search/repositories?q=javascript');
var myData = await response.json()
console.log(myData);
})()
// sincrono
fetch('https://api.github.com/search/repositories?q=javascript')
.then(response => response.json())
.then(myData => console.log(myDa... | true |
a49b96fb1e88dc6f78fa4d631479d4c67b4a621a | JavaScript | ajit-spec/proj_2 | /backend/controller/apod.js | UTF-8 | 1,406 | 2.53125 | 3 | [] | no_license | require('dotenv').config()
const Apod = require('../model/apod')
const utils = require('../utils')
//get_data
const get_data = async (req, res) => {
let date = req.query.date;
if (!date) {
date = utils.get_curr_date()
}
const data = await utils.fetch_image(date)
const filename = data.ur... | true |
93497ec707300e6a4807d5c7833e33897a15b7ce | JavaScript | Eyuel16/alx-higher_level_programming-1 | /0x13-javascript_objects_scopes_closures/6-square.js | UTF-8 | 294 | 2.703125 | 3 | [] | no_license | #!/usr/bin/node
const Squares = require('./5-square');
module.exports = class Square extends Squares {
charPrint (c) {
if (c === undefined) {
return this.print();
} else {
for (let x = 0; x < this.width; x += 1) {
console.log(c.repeat(this.height));
}
}
}
};
| true |
1c1e645766f432c2849c67b93080c17f2e0ff534 | JavaScript | Trentdjorgensen/assignments | /backend/original-bounty-hunter/server/routes/bounty.js | UTF-8 | 1,197 | 2.703125 | 3 | [] | no_license | const express = require('express');
const bountyRouter = express.Router()
const Bounty = require('../models/bounty');
bountyRouter.get('/',(req, res) => {
Bounty.find((err, bounties) => {
if(err) return res.status(500).send(err);
return res.send(bounties);
})
})
bountyRouter.get('/:id', (re... | true |
83b522e8f376724242be38eb3a7495bed1826615 | JavaScript | aramadsanar/belajarnodejs | /firstapp/npm-demo/index.js | UTF-8 | 2,922 | 2.515625 | 3 | [] | no_license | var _ = require('underscore');
var result = _.contains([1, 2, 3], 2);
console.log(result);
const express = require('express');
const bodyParser = require('body-parser');
const connect = require('body-parser');
const app = express();
const Joi = require('joi');
const helmet = require('helmet');
const morgan = require('... | true |
de230cb950d9928f48f6ad9653fe9511a63a3ecb | JavaScript | Adom7/cb-myFtp | /myFtpClient.js | UTF-8 | 585 | 2.734375 | 3 | [] | no_license | const fs = require('fs');
const net = require('net')
const readline = require ('readline')
const client = new net.Socket()
//NOTE Permet de poser une question au client avec rl.question(......)
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
client.connect(5000, '1... | true |
7239091999a02f284cb5565b96be7eb01d29072c | JavaScript | toddmo/webpagereader | /app/src/js/regex.js | UTF-8 | 809 | 2.796875 | 3 | [] | no_license | class Regex {
/* public properties */
#REGEX_SENTENCE_TERMINATOR = /[.?!]\s+/g;
get SentenceTerminator() {
return this.#REGEX_SENTENCE_TERMINATOR
}
#REGEX_NON_WHITESPACE = /\S/g;
get NonWhitespace() {
return this.#REGEX_NON_WHITESPACE
}
}
/* extension methods */
String.prototype.ma... | true |
1fcbbdbaf7f2f84f53c7a7734e805fa720db226c | JavaScript | ep222ht/Scrum | /Medlemsregister/jscript/member.js | UTF-8 | 1,445 | 3.21875 | 3 | [] | no_license | "use strict";
function Member(firstName, lastName, phoneNumber, id, date){
this.getFirstName = function(){
return firstName;
};
this.setFirstName = function(_firstName){
firstName = _firstName;
};
this.getLastName = function(){
return lastName;
};
this.setLastName = function(_lastName){
lastName =... | true |
d482ad701a3b9a6caa0cf9fc9bc5246be46bc011 | JavaScript | tlcrow/Algorithms | /Arrays/ArrayRemoveRange.js | UTF-8 | 1,300 | 4.5 | 4 | [] | no_license | //Given array, and indices start and end, remove vals in that index range, working in-place (hence shortening the array). Given ([20,30,40,50,60,70], 2, 4), change to [20,30,70] and return it.
//Without built in methods
function ArrayRemoveRange(arr, start, end){
var difference = end + 1;
if(start > arr.length... | true |
87f681616d14f7d206b99a7c18ab3ad720f47b1d | JavaScript | joonasmkauppinen/pat-project-backend | /modules/createthumbnail.js | UTF-8 | 695 | 2.828125 | 3 | [] | no_license | 'use strict';
const sharp = require('sharp');
const createThumb = (sourceFile, width, destinationFile, next) => {
sharp(sourceFile)
.resize(width)
.toFile(destinationFile)
.then(() => {
console.log(`--- INFO --- Resize OK`);
next();
}).catch(err => {
console.log(err)
next()... | true |
46615c1e89257dc549853109ee0a15b52c300a28 | JavaScript | developma/tinymce-caret-detector | /tinymce-config.js | UTF-8 | 4,993 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | class TinyMCEConfig {
setup() {
const caretDetector = new CaretDetector()
tinymce.init({
selector: '#mytextarea',
menubar: false,
branding: false,
plugins: 'textcolor',
toolbar: 'fontsizeselect bold italic underline forecolor',
setup: editor => {
editor.on('KeyUp', ... | true |
2a5cfe6cf1849d5680d5d23743fdff45efd18540 | JavaScript | PicardRaphael/Reactor | /src/components/GlobalMap/index.js | UTF-8 | 1,815 | 2.71875 | 3 | [] | no_license | /**
* Import
*/
import React from 'react';
import PropTypes from 'prop-types';
/**
* Local import
*/
// Components
import RoomStart from 'src/containers/Rooms/RoomStart';
import RoomHostile1 from 'src/containers/Rooms/RoomHostile1';
import RoomChest from 'src/containers/Rooms/RoomChest';
import RoomHostile2 from 's... | true |
234b5b6a2880197bec32716b1c457842df116d36 | JavaScript | meilar/credit-union | /js/scripts.js | UTF-8 | 2,857 | 3.125 | 3 | [] | no_license | function Bank() {
this.accounts = [],
this.accountNumber = 0
};
Bank.prototype.addAccount = function(account) {
account.accountNumber = this.addAccountNumber();
this.accounts.push(account);
};
Bank.prototype.addAccountNumber = function(account) {
this.currentId += 1;
return this.currentId;
};
Bank.prot... | true |
8cec4b2cf2ca223d397f768cf004743ba4eac0b7 | JavaScript | Chileus/D3.js-data-visualisation | /js/piechart.js | UTF-8 | 2,739 | 2.765625 | 3 | [] | no_license | var svg = d3.select(".piechart"),
width = +svg.attr("width"),
height = +svg.attr("height"),
radius = Math.min(width, height) / 2,
g = svg.append("g").attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
var color = d3.scaleOrdinal(["#086788", "#F7B32B"]);
var div = d3.select("... | true |
dda807347f106d9cf773ba18cbaf18610f7c6b0b | JavaScript | cdsalty/20JSProjects | /cocktails/src/searchForm.js | UTF-8 | 731 | 3.140625 | 3 | [] | no_license | // just checking for the value in the form; depending on that value, will run presentDrinks; console.log("Hello World from searchForm")
// console.log("daisy");
import get from './getElement.js';
import presentDrinks from './presentDrinks.js';
const baseUrl = 'https://www.thecocktaildb.com/api/json/v1/1/search.php?s=... | true |
62ec4d37892939965667f0732a8ff0b7853079c6 | JavaScript | Gary-Shurgin/faire | /server/src/build.js | UTF-8 | 2,591 | 2.546875 | 3 | [] | no_license | import connection from './db'
export default class Build {
constructor() {
this.conn = new connection();
}
create(db, name) {
if ( ! name ) name = db.name;
return this.conn.execute("SHOW DATABASES")
.then(result => {
return result.map(item => Object.values(item)... | true |
ad0e2e03d709a3a92fce58f6e7634a45b177dce7 | JavaScript | Kyle-Koivukangas/StockTraderProject | /src/store/modules/portfolio.js | UTF-8 | 2,710 | 2.796875 | 3 | [] | no_license | //portfolio state store
const state = {
showTransactions: false,
funds: 10000,
ownedStocks: [],
transactions: [{ "orderType": "BUY", "stockTicker": "IBM", "quantity": 5, "stockPrice": 83.04, "date": "2017/09/09" }],
date: '2017/09/09',
userId: 0,
}
const getters = {
ownedStocks: state => {
... | true |
c32a41fb67f6271d77324ec5939d4b30f47e9ce3 | JavaScript | FrankGee/World_of_Tank_Test_01 | /Assets/WWII TankPack B/Demo Scene/MoveGun.js | UTF-8 | 451 | 2.8125 | 3 | [] | no_license | #pragma strict
var speed : float = 15;
var curRotation : float = 0;
function Update () {
// Gun Down
if(Input.GetKey(KeyCode.W)) {
if(curRotation > -5) {
transform.Rotate(Vector3(speed * Time.deltaTime, 0, 0));
curRotation -= speed * Time.deltaTime;
}
}
// Gun Up
if(Input.GetKey(KeyCode.S)) {
if(... | true |
497185d092a75c54a5c7fd15b09c0e4829fab95d | JavaScript | saisai/tutorial | /javascript/javascripttutorial_net/JAVASCRIPT_ARRAY/javascript-array-indexof.js | UTF-8 | 863 | 3.9375 | 4 | [] | no_license | var scores = [10, 20, 30, 10, 40, 20];
console.log(scores.indexOf(10)); // 0
console.log(scores.indexOf(30)); // 2
console.log(scores.indexOf(50)); // -1
console.log(scores.indexOf(20)); // 1
console.log(scores.indexOf(20,-1)); // 5 (fromIndex = 6+ (-1) = 5)
console.log(scores.indexOf(20,-5)); // 1 (fromIndex = 6+ (-... | true |
dceae7c34b1426553abf2e03f4055840db706168 | JavaScript | abr011/_invoice | /default (kopie).js | UTF-8 | 3,077 | 2.71875 | 3 | [] | no_license | function fillClient(client_id) {
var client = data.client[client_id];
var name = client.name;
var street = client.address_street;
var town = client.address_zip + ("\u00A0") + ("\u00A0") + client.address_town;
var legal_id = client.legal_id;
$('#client .name').html(name);
$('#client .ad... | true |
a963961ef1584914d777c83344e38a13edcd1fb9 | JavaScript | learn-co-students/web-060517 | /17-js-objects/oo.js | UTF-8 | 1,707 | 4.5 | 4 | [] | no_license | function myFunction(){
}
let dog = {function bark(){ console.log('bark')}}
// constructor functions
function Dog(name, breed) {
this["name"] = name
this["breed"] = breed
};
// var foo;
// if(x < 3){
//
// }else {
//
// };
new Dog({name: 'fido', breed: 'samoyd'})
// {height: 100, weight: 200, name: 'ed'}
fun... | true |
ab37fdea433bcdcedc41b01525823d97bbab768c | JavaScript | Otumian-empire/complete-web-app | /3-javascript/reactiontimegame/index.js | UTF-8 | 1,640 | 3.5 | 4 | [] | no_license | var start = new Date().getTime()
function getBackgroundColor() {
var bgColor = "#"
var chars = '51a8c9b06e73d24f'
for (var i = 0; i < 6; i++) {
bgColor += chars[Math.floor(Math.random() * 16)]
}
return bgColor
}
function makeShape() {
start = new Date().getTime()
var width = Mat... | true |
ee23bb5d9440ee80581e6bc3d59570433b0950a9 | JavaScript | Kclaster/backgroundweddings.com | /src/reducers/SetHeight.js | UTF-8 | 300 | 2.515625 | 3 | [] | no_license | import { SET_HEIGHT } from '../actions/types';
const INITIAL_STATE = {
height: 0
};
export default (state = INITIAL_STATE, action) => {
switch (action.type) {
case SET_HEIGHT:
return {...state, height: action.payload}
default:
return state;
}
} | true |
f82285df54e9d0b327fd2d455854e9d7eeb03e1b | JavaScript | HussainAlhadab/Full-Stack-28-03-21 | /wk2/d3/algo.js | UTF-8 | 1,655 | 4.46875 | 4 | [] | no_license | /*
Given an array, reverse it's items in place
return the array after reversing it
Do it in place without using any built in methods
*/
// const arr1 = [1, 2, 3]
// const expected1 = [3, 2, 1]
// const arr2 = ["a", "b"]
// const expected2 = ["b", "a"]
// const arr3 = ["a"]
// const expected3 = ["a"]
// const... | true |
3333ebaf622b69ba0825ce9269a68cd09a8b004d | JavaScript | kaoscript/kaoscript | /test/fixtures/compile/class/class.proxy.imth.uniq.1t3.default.js | UTF-8 | 1,980 | 2.875 | 3 | [
"MIT"
] | permissive | const {Helper, Type} = require("@kaoscript/runtime");
module.exports = function() {
class Hello {
static __ks_new_0() {
const o = Object.create(Hello.prototype);
o.__ks_init();
return o;
}
constructor() {
this.__ks_init();
this.__ks_cons_rt.call(null, this, arguments);
}
__ks_init() {
}
__... | true |
0d64f530cd2972c898ed89a113d9797a4656911a | JavaScript | ObiFenix/MEAN | /Express/cars_and_cats/server.js | UTF-8 | 302 | 2.53125 | 3 | [] | no_license | // Load the express module and store it in the variable express (Where do you think this comes from?)copy
var express = require("express");
// invoke express and store the result in the variable app
var app = express();
app.use(express.static(__dirname + "/static"));
app.listen(8000, function() {
}) | true |
902d201ac50c766c219a15b187ee4eba6163f854 | JavaScript | JustinBradley9/bank-of-react-1 | /src/components/UserProfile.js | UTF-8 | 1,339 | 2.765625 | 3 | [] | no_license | import React, { Component } from 'react'
import { Link } from 'react-router-dom'
class UserProfile extends Component {
state={
balance:NaN
}
handleChange = (e)=>{
let updatedBalance = this.state.balance
const name = e.target.name
const value = e.target.value
console.... | true |
951ecd153d877d926b8d4a48f00ad8586ee566dd | JavaScript | dmanueljr/calculator | /js/app.js | UTF-8 | 3,216 | 3.015625 | 3 | [] | no_license | function startup() {
document.getElementById('one').addEventListener("click", function() { send(this.id); });
document.getElementById('two').addEventListener("click", function() { send(this.id); });
document.getElementById('three').addEventListener("click", function() { send(this.id); });
document.getElementById('f... | true |
f6ac546547ed92f963be58805a886ce8696a8fa9 | JavaScript | J0hn5mith/ggj18 | /js/core/img.js | UTF-8 | 1,832 | 3.109375 | 3 | [] | no_license | function Img() {}
Img.assets = {};
Img.add = function(name, image) {
Img.assets[name] = image;
};
Img.isLoaded = function(name) {
return Img.assets.hasOwnProperty(name);
};
Img.get = function(name) {
var img = Img.assets[name];
if(img === undefined) {
alert("There is no image named '" + ... | true |