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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b0131782a35a034d1fb9dd896a30f7354362931f | JavaScript | keremkaradenzz/lotr-app | /src/components/detail/CharacterDetail.jsx | UTF-8 | 1,579 | 2.53125 | 3 | [] | no_license | import React from 'react';
import {Link} from 'react-router-dom'
const CharacterDetail = ({character,search}) => {
return (
<>
<h3 className="mt-2 mb-2">Character Details</h3>
<div className="row mb-5">
{
character && character.map(item => item.race ===... | true |
aab9176d277ac216fa8e482ed42c0701c88c9b1f | JavaScript | hp-techbucket/designhill | /models/user.model.js | UTF-8 | 1,249 | 2.9375 | 3 | [] | no_license | const sql = require('./db.js');
const d = new Date();
const User = function(user){
this.id = null;
this.name = user.name,
this.email = user.email,
this.password = user.password,
this.created_on = d.getTimestamp();
}
module.exports = User;
User.create = (newUser, result) => {
sql.query("INSER... | true |
0591c56bbd0ca1547b6a1ab0e38ccf30c68457f7 | JavaScript | SoftwareEngineeringDaily/software-engineering-daily-api | /server/controllers/listened.controller.js | UTF-8 | 2,692 | 2.578125 | 3 | [
"MIT"
] | permissive | import Bluebird from 'bluebird';
import Listened from '../models/listened.model';
/**
* @swagger
* tags:
* - name: listened
* description: Tracking and Retrieving Episode Listening Data
*/
/**
* @swagger
* /posts/{postId}/listened:
* get:
* summary: Flag episode as listened
* description: Flag episode... | true |
03386d71ec1ab00f67e9758f2fa03fefc961d84c | JavaScript | lipgen/ros_atom_server | /index.js | UTF-8 | 463 | 2.515625 | 3 | [] | no_license | const express = require("express");
const app = express();
const port = 8000;
var allowCrossDomain = function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE");
res.header("Access-Control-Allow-Headers", "*");
next();
};
app.u... | true |
40bcb8f29e7eb6762aebb51adc15b60e4ccca790 | JavaScript | aug-bug/suning | /js/index.js | UTF-8 | 3,180 | 2.65625 | 3 | [] | no_license | window.onload=function(){
let dhhz1=document.getElementsByClassName("dhhz1");
let la=document.getElementsByClassName("la")[0];
dhhz1[0].onmouseenter=function(){
la.style.height="230px";
dhhz1[0].style.background="#fff";
}
dhhz1[0].onmouseleave=function(){
la.style.height="0";
dhhz1[0].... | true |
603246368b7300819aaec47d5b44b9f0e53830b9 | JavaScript | fahmialfareza/glints-x-binar-batch-13 | /Morning Class/Week 1/day5/functionWithArguments.js | UTF-8 | 312 | 3.453125 | 3 | [] | no_license | function calculateRectangle(width, length) {
// console.log(width * length);
return width * length;
}
let rectangle1 = calculateRectangle(10, 5);
let rectangle2 = calculateRectangle(7, 5);
console.log('rectangle1', rectangle1);
console.log('rectangle2', rectangle2);
console.log(rectangle1 + rectangle2);
| true |
739f10602dc4fb5401e73b8fa52c4075c37225a8 | JavaScript | ICC3103-202110/laboratorio-06-CristianConcha | /proyect/view.js | UTF-8 | 1,821 | 2.734375 | 3 | [] | no_license | const figlet = require('figlet')
const chalk = require('chalk')
const inquirer = require('inquirer')
function getTitle(){
return chalk.magenta(
figlet.textSync(
'Unit Converter App',{horizontalLayout: 'full'}
)
)
}
function getTable(model) {
return [
{
"Lef... | true |
ded71ada932bbf43cff7e46c8339984906508e46 | JavaScript | jeysonrgxd/cursoReactUdemy | /counter-app/src/tests/PrimeraApp.test.js | UTF-8 | 1,748 | 2.90625 | 3 | [] | no_license | // imr y le das tab
import React from 'react'
import '@testing-library/jest-dom'
// import {render} from '@testing-library/react'
import PrimeraApp from '../PrimeraApp'
import { shallow } from 'enzyme'
describe('Pruebas en <PrimeraApp />', () => {
// test('debe de mostrar el mensaje "Hola soy goku"', () => {
... | true |
a7949d8b9fece5dd8271da0c224d7323ecf4650c | JavaScript | Atavachron/JavaScriptProjects | /HttpLibraryFetch/httplib.js | UTF-8 | 925 | 2.75 | 3 | [] | no_license | class easyHTTP {
handleErrors(res) {
if (!res.ok) {
throw new Error(res.error);
}
return res;
}
get(url) {
return fetch(url)
.then(this.handleErrors)
.then(res => res.json())
.catch(err => err);
}
post(url, data) {
return fetch(url, {
method: 'POST',
h... | true |
ded31f371de83b4d771841a6c75239eb24a6aef3 | JavaScript | hirenkumarpatel/node_js_practice_app | /person_object.js | UTF-8 | 201 | 3.046875 | 3 | [] | no_license | //creating object (in js objects are created as json type)
const person={
"name":"Hiren Patel",
"age":29
}
//export this class(object) so that it can be used in other js file
module.exports=person; | true |
af6f8bcadca2e34f9234c36dd57924ba34aa9172 | JavaScript | h26k2/ebook-app | /src/components/Form.js | UTF-8 | 1,208 | 2.875 | 3 | [] | no_license |
import React from 'react'
class Form extends React.Component{
constructor(props){
super(props);
this.state = {
currentBook : ''
}
this.handleChange = this.handleChange.bind(this);
}
render(){
return(
<div>
<h2 className="ce... | true |
28c2c3bf82eb5bf66a9029d81729addbf9e8356c | JavaScript | pjfoley23/backbone-youtube | /views/AppView.js | UTF-8 | 3,963 | 2.546875 | 3 | [] | no_license | // AppView
// events: submit search (select sidebar video in sidebar videos)
// initialize: fill with default content listen for video model click
// renderApp: fill .main-stage and trigger sidebarView
var AppView = Backbone.View.extend({
el: $("body"),
events: {
"click .video-listing": "setOnStage",
"k... | true |
a863fe5ccd10894085b7d8e2932f7c27999027d5 | JavaScript | liangshangyu/node | /9.express/express第一天/3.timer.js | UTF-8 | 1,295 | 2.859375 | 3 | [] | no_license | var express = require('./express');
var app = express();
//中间件
// 1.中间件就是起过渡作用 检查权限 检查是否合法 最后在进入我们的真正的路由
// 2.中间件有next方法,可以决定是否继续执行 如果调用next方法表示继续执行
// 3.中间件也可以匹配路径 只要路径开头匹配即可,默认是/等同于不写
// 4.中间件中的req和res 和路由中的是一个
// 5.一个页面中可以有多个中间件
// 6.中间件一般写在路由前面
//当匹配成功后执行函数
//用途:扩展req和res上的属性,还可以扩展公用的方法
/*[{
method:'middlewar... | true |
52e84cea866e751fdd7a6485d40cc6228927b94f | JavaScript | lorenwe/ball100 | /js/player/StartBtn.js | UTF-8 | 1,849 | 2.875 | 3 | [] | no_license | import {Sprite} from "../base/Sprite.js";
import {DataStore} from "../base/DataStore.js";
export class StartBtn extends Sprite {
constructor() {
const image = Sprite.getImage('startButton');
// 初始化从右边移入开始按钮
super(image,
0, 0,
image.width,image.height,
D... | true |
c5a33fc2ab054ba2e618eb10095f0ca43b544b13 | JavaScript | CISL-blockchain/derby-dapp | /src/js/app.js | UTF-8 | 4,468 | 2.59375 | 3 | [
"MIT"
] | permissive | App = {
web3Provider: null,
contracts: {},
order: {},
account: "",
init: async function () {
// 初始化时间选择器
Util.date.initDatepicker();
$(".alert").hide();
// Load hotel.
let hotelData = await $.getJSON('../hotel.json');
let hotel = hotelData[0];
// 设置酒店名字和信息
$('#hotel_name').t... | true |
aaa522955307300ce173d1886c84e676cf668159 | JavaScript | Wayne-Bai/AST-normalize | /data/unknown/37296.js | UTF-8 | 525 | 2.90625 | 3 | [] | no_license | ! ✖ / env;
node;
var log = console.log, print = function(ms, n) {
var avg = 1000 * n / ms;
log("- total elements: %d.", n);
log("- elapsed: %d secs.", ms / 1000.toFixed(4));
log("- average: %d Mel/sec.", avg / 1000 / 1000.toFixed(2));
}
, Train = require("../"), t = new Train(), p = 24, k = Math.pow(2, p),... | true |
cdfa20f224d91ab8bc2ee97d203de6749ae64762 | JavaScript | AlexandreGagnon-Lalonde/m2-4-js--events | /workshop/exercise-1.2/app.js | UTF-8 | 3,085 | 3.8125 | 4 | [] | no_license | // Exercise 1.2
// ------------
// DON'T COPY/PASTE THE LAST EXERCISE. REWRITE IT FROM SCRATCH!
// Similar to the last exercise, write an app that gives the user
// a random amount of time (between 3 and 5 seconds) to click anywhere on the
// screen.
//
// But this time, let's let the user know how much time they have ... | true |
3d47123391d4943e3b197eaa3c847fe61c7108d8 | JavaScript | aiai5251/learningNode | /koa/server/app.js | UTF-8 | 2,323 | 2.796875 | 3 | [] | no_license | 'use strict';
const controller = require('./config/controller');
// // 导入koa,和koa 1.x不同,在koa2中,我们导入的是一个class,因此用大写的Koa表示:
const Koa = require('koa');
// 创建一个Koa对象表示web app本身:
const app = new Koa();
const bodyParser = require('koa-bodyparser');
//
const api = require('./config/api');
// 绑定 .rest() for ctx: 设置接口
app.... | true |
66f21f2229a62b79ecf6616a04bffb84b282041d | JavaScript | CalumCannon/websockets | /src/Renderer/Renderer.js | UTF-8 | 1,078 | 2.5625 | 3 | [] | no_license | import React, {Component} from 'react';
import RenderHelper from '../helpers/RenderHelper'
export default class Renderer extends Component{
constructor(props){
super(props);
this.state = {
renderer: null
}
}
componentDidMount() {
const canvas = this.refs.canvas
const ctx = canvas... | true |
66361a2c947245c1a4066898e4a2157ef65b8006 | JavaScript | thereAnana/leetcode | /238_Product_of_Array_Except_Self.js | UTF-8 | 551 | 2.96875 | 3 | [] | no_license | /**
* @param {number[]} nums
* @return {number[]}
*/
var productExceptSelf = function(nums) {
var res =[];
var max = 1;
var zeroCount = 0;
for(var i = 0;i<nums.length;++i){
if(nums[i]!==0){
max *= nums[i];
}else{
zeroCount++;
}
}
for(var j ... | true |
e1762cc6d04508530262dbeeaf1be2f197abaf41 | JavaScript | dtrode59/idle-game | /game.js | UTF-8 | 781 | 3.484375 | 3 | [] | no_license | var score = 1; // Create a variable to store the score in
var button2;
var title = new Title('Welcome to my Game'); // Create a title element
var button = new Button('hello', btnPress); // Create a button element
var scr = new Text(score); // Create a text element
setInterval(btnPress, 1000);
let text = new Text('... | true |
e56ade13f89f531b0fa12ba80745fb88da0176c2 | JavaScript | Darktangent/Algorithm-N-Datastructure | /Algorithms/isPrime.js | UTF-8 | 576 | 3.84375 | 4 | [] | no_license | function isPrime(value) {
//A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself.
for(var i = 2; i < value; i++) {
// We then loop from two all the way up until our number minus one because we know that our number will be divisible by itself an... | true |
2ab0ffc339e3430bea3a187d7f6b188284a9cc27 | JavaScript | eliasrosales88/BeerFlix | /src/js/beers.js | UTF-8 | 4,187 | 2.625 | 3 | [
"MIT"
] | permissive | "use strict";
import api from "./api.js";
import { toggle, loadChekedLikes, toggleLoader, addBeerLike } from "./ui.js";
const { getBeers } = api();
const mainSection = document.querySelector("#main-beers");
const cardTemplate = ({ beerId, name, description, image, likes, firstBrewed, price}) => `
<div class="col ... | true |
34783e4c8292592cf742e12ac964a33580cb2ed0 | JavaScript | kargeb/Udemy | /MATERIAŁy/113 EVENT propagacja - rozmnazanie sie eventow/js/script.js | UTF-8 | 1,197 | 3.609375 | 4 | [] | no_license | /*
PROPAGACJA (rozmnażanie się) - bąbelkowanie
var e = e || window.event;
if (e.stopPropagation)
e.stopPropagation();
else
e.cancelBubble = true;
*/
function wykonaj(event, eventObj)
{
var e = event || window.event;
var srcElement = e.target || e.src... | true |
aead88949c017ee42fb62f6c37d554136a9e789e | JavaScript | jc328/CodeWars-1 | /7kyu_TailsOfTheHighSeas.js | UTF-8 | 3,293 | 3.4375 | 3 | [] | no_license | // 7kyu - Tails of the High Seas
// It is a little past midnight in your cool developer crib, and you have just received a shaky text from your most faithful client. Somewhere in your client's hushed emojis, you make out a plea for an emergency favor. Your client is adrift, stuck in the Caribbean on his "modestly-size... | true |
9c0feb1aa4e8e9eaaf79f1d4b398250b2097f6fb | JavaScript | gnikoloff/messenger-bot-vaporwavify-me | /app/renderer/particles.js | UTF-8 | 756 | 2.625 | 3 | [] | no_license | 'use strict';
const THREE = require('three');
const spheresCount = 16;
let group;
let geometry;
let material;
const init = (scene) => {
group = new THREE.Group();
geometry = new THREE.SphereGeometry(0.5, 18);
material = new THREE.MeshBasicMaterial({ color: 0x5c45a0 });
let offset = 150;
for (let... | true |
b06133f47ec6ff3304063a25211201d89e9d3e4f | JavaScript | Mert1980/Task-Manager-Application | /src/index.js | UTF-8 | 3,010 | 3.09375 | 3 | [] | no_license | const app = require("./app")
const port = process.env.PORT
app.listen(port, () => {
console.log(`Server is up on port ${port}`);
});
// const express = require("express");
// require("./db/mongoose");
// const userRouter = require("./routers/user");
// const taskRouter = require("./routers/task");
// const app =... | true |
c208c5a19d10e198bc2abd798369e7a3572b20fe | JavaScript | tiagorccabral/startErxpress | /models/user.js | UTF-8 | 2,552 | 2.5625 | 3 | [] | no_license | import bcrypt from 'bcrypt';
import Promise from 'bluebird';
import mongoose from 'mongoose';
import httpStatus from 'http-status';
import APIError from '../helpers/APIError';
/**
* User Schema
*/
const UserSchema = new mongoose.Schema({
userType: { type: String, default: 'regular' },
first_name: { type: String,... | true |
355fc44ddd9e24bfc5cbad478f9f1c158fc76453 | JavaScript | perrylo/advent2018 | /day10/part1.js | UTF-8 | 1,583 | 3.265625 | 3 | [] | no_license | const fs = require('fs')
const reg =/position=<(.+?),(.+?)> velocity=<(.+?),(.+?)>/
let data = fs.readFileSync('data.txt', { encoding:'utf8' }).split('\n').map(e => {
const [_, x, y, dx, dy] = e.match(reg)
return { x:parseInt(x), y:parseInt(y), dx:parseInt(dx), dy:parseInt(dy) }
})
// posit: message appears when ... | true |
c1a8da69f5e8918f039eeec0c38a3bd5734100c4 | JavaScript | DeanSpooner/vending-machine | /index.js | UTF-8 | 2,358 | 3.140625 | 3 | [] | no_license | (function exportAll() {
getChange = (totalPayable, cashPaid) => {
let totalChange = cashPaid - totalPayable;
let change = [];
let coinTypes = [200, 100, 50, 20, 10, 5, 2, 1];
for (let i = 0; i < coinTypes.length; i++) {
if (totalChange >= coinTypes[i]) {
... | true |
1b9f040f0969a15d8dada6d057d320eea8f17250 | JavaScript | niening821919/MyDjango-project | /static/js/register.js | UTF-8 | 5,061 | 2.515625 | 3 | [
"MIT"
] | permissive | $(function () {
//用户名
$('.signupbox .form-act').eq(0).children('input').blur(function () {
var reg = /.{5,}/;
if (reg.test($(this).val())) {
$.get('/checkuser/', {'username': $(this).val()}, function (response) {
console.log(response)
if (re... | true |
49c7d9557e24e33d301b2f83cacadfd86c49dfdd | JavaScript | pandiarajans5/Nodejs-Training-task | /Node Day-2 Task/fws-rf.js | UTF-8 | 188 | 2.5625 | 3 | [] | no_license | fs=require('fs');
fs.writeFileSync('fws-rf.txt', 'Hello World! I am in fws-rf.txt');
fs.readFile('fws-rf.txt','utf8', function (err, data) {
if (err) throw err;
console.log(data);
}); | true |
b048914d007c41fbbc37f4b936c648b166df9a2a | JavaScript | Yohnny17/trabajos-freecodecamp | /plantilla pagina web full basic/diseño para pagina web.js | UTF-8 | 377 | 2.828125 | 3 | [] | no_license | alert("Bienvenido");
let Nombre;
Nombre = prompt("Ingresa Tu Nombre");
let Contraseña;
Contraseña = prompt("Ingresa Tu Contraseña");
if(Nombre == "Yohnny Ospina" && Contraseña == "1033772576"){
alert("Ok" + (" ") + Nombre);
}
else if(Nombre == "Tania Ospina" && Contraseña == "1033785630"){
alert("OK" + (" ") + N... | true |
58b03889f6d770aee71afeb8b537e41e5f4edd50 | JavaScript | tomhalley/ride-plan-angular | /src/js/Services/FacebookAuthService.js | UTF-8 | 2,458 | 2.59375 | 3 | [] | no_license | "use strict";
/**
* Facebook Auth Service
*
* Used to authenticate a user through Facebook and the API
*/
angular.module("RidePlan.Services")
.service("FacebookAuthService", function($q, AuthService, Facebook, ErrorService) {
/**
* Generic function for handling connecting to facebook
... | true |
5754ebc8e61d4c8ad1a5c2b6a2b07958fbefe8bb | JavaScript | anthonygood/minesweeper | /src/util/between.js | UTF-8 | 147 | 2.578125 | 3 | [] | no_license | const between = (x, y) => {
const upper = y - x + 1
const rand = x + Math.random() * upper
return Math.floor(rand)
}
export default between
| true |
87c85d012a088aefbedc7abecb6d9570a33a524b | JavaScript | mohamed1abdelbaset/todo-app | /src/components/TodoItem.js | UTF-8 | 695 | 2.515625 | 3 | [] | no_license | import React from 'react'
import './TodoItem.css'
const TodoItem = (props) => {
const {items, deleteItem} = props
let length = items.length
const listItems = length ? (
items.map(item => {
return(
<div className="listitems" key={item.id}>
... | true |
c13187dc14dde9f6810aa20f6764191fe4db98a9 | JavaScript | vaishnave-s/Coding-in-JS | /directed-graph.js | UTF-8 | 5,735 | 3.65625 | 4 | [] | no_license | //Directed graphs are graphs that do have a direction between vertices.
function DirectedGraph() {
this.edges = {};
}
DirectedGraph.prototype.addVertex = function(vertex) {
this.edges[vertex] = {};
}
DirectedGraph.prototype.addEdge = function(origVertex, destVertex, weight) {
if (weight === undefined) {
... | true |
db2c8f02bb6939e4d4cccfb2cdfb15baf3f7a3a9 | JavaScript | teanocrata/jsFundamentals | /dataAndfunctions/generatedFibonacci.js | UTF-8 | 1,105 | 3.75 | 4 | [
"MIT"
] | permissive | function * fibonacci () {
let a = 0
let b = 1
while (true) {
const f = a
a = b
b = f + a
const reset = yield f
if (reset) a = 0, b = 1
}
}
const fibo = fibonacci()
console.log(fibo.next().value)
console.log(fibo.next().value)
console.log(fibo.next().value)
console.log(fibo.next().value)
co... | true |
0068b939f6e921d33ddadc00d2841ef6aa06d460 | JavaScript | reimon/chatwoot-mobile-app | /src/helpers/TimeHelper.js | UTF-8 | 969 | 2.53125 | 3 | [
"MIT"
] | permissive | import moment from 'moment';
import i18n from '../i18n';
export const messageStamp = ({ time }) => {
const createdAt = time * 1000;
return moment(createdAt).format('h:mm A');
};
export const wootTime = ({ time }) => {
const createdAt = time * 1000;
return moment(createdAt);
};
export const dynamicTime = ({ t... | true |
f76faaaacd06d620724e86ff0a92d5939a9d5319 | JavaScript | jv-pinheiro/challenges_JS | /desafio4_Q3.js | UTF-8 | 2,116 | 3.5 | 4 | [] | no_license | var button = document.querySelector('button');
var body = document.querySelector('body');
body.appendChild(document.createElement('ul'));
var users = [];
var acessaRepo = function(u){
return new Promise(function(sucesso,erro){
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.github.com/users/' + u + ... | true |
5124651178ee8ba3e3cb15e2879ec77500c6278c | JavaScript | monicelica/cdmx-2018-06-bc-core-am-social-network | /src/js/app.js | UTF-8 | 4,553 | 2.8125 | 3 | [] | no_license | const registrar = () => {
let email = document.getElementById('email').value;
let password = document.getElementById('password').value;
// si el usuario se regsitro de manera correcta se ejecutara la funcion verificar
firebase.auth().createUserWithEmailAndPassword(email, password)
.then(() => verificar())
... | true |
1e1bb7d609c9183cb670ca5b7a516a8113e0257e | JavaScript | elena-ageeva/js-basics-functions-lab-v-000 | /index.js | UTF-8 | 710 | 3.4375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | // Code your solution in this file!
function distanceFromHqInBlocks(location){
if (location>=42){
return location-42;}
else{
return 42-location;
}
}
function distanceFromHqInFeet(location){
return distanceFromHqInBlocks(location)*264;
}
function distanceTravelledInFeet(start,end){
let d... | true |
a3744ca65b140c59c0ba2d14891b86bd7a690fe7 | JavaScript | karlo0319/personal-project | /src/Components/Main.js | UTF-8 | 2,460 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
import { connect } from 'react-redux';
import { updateUser } from '../redux/reducer';
class Main extends Component {
constructor(props) {
super(props);
this.state = {
username: '',
email: '',
p... | true |
59fcc942347da8476ccd5148ad1ca7168c31d3a4 | JavaScript | khadija1604/NodeJsExpressProject | /routes/aliens.js | UTF-8 | 1,180 | 2.640625 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
const Alien= require('../models/alien')
router.get('/', async(req, res, next)=> {
try {
const aliens = await Alien.find()
res.json(aliens)
res.sendStatus(200)
} catch (error) {
res.send("Error fetching data")
}... | true |
1d1ce06932932ee353db806d690424e20a435313 | JavaScript | NordGus/js-basics | /03_operators/08_logical_operators_w_no_booleans/index.js | UTF-8 | 890 | 4 | 4 | [] | no_license | // Logical Operators with Non-Booleans
console.log('Falsy (false) values:');
console.log(undefined, 'null', 0, false, '', NaN);
console.log('Anything that is not Falsy -> Truthy');
console.log('Examples:');
console.log('false || true:', false || true);
console.log('false || "Gustavo":', false || 'Gustavo');
console.l... | true |
c993179fc09d8869c1092c5d8218b3805540d2a4 | JavaScript | trophyhusban/flower-forest | /src/prefabs/NoteManager.js | UTF-8 | 5,558 | 3.703125 | 4 | [] | no_license | // opens previously seen notes on screen with the number keys
// if another note is already open, it moves to the next one smoothly
// if a note is open and you press the button again, esc, space, or the arrow keys, it closes the note
class NoteManager {
constructor(scene) {
this.scene = scene;
/... | true |
a26e4341c8672e3393cf16895d3d948756890b73 | JavaScript | NicoKam/zteui-icon | /bin/getFileList.js | UTF-8 | 776 | 2.71875 | 3 | [] | no_license | /* eslint-disable no-console,no-unused-vars */
const fs = require("fs");
const path = require("path");
module.exports = (root = "src") => {
const fileList = [];
const queue = [path.join(root)];
while (queue.length > 0) {
const p = queue.shift();
try {
const pa = fs.readdirSync(p);
pa.forEac... | true |
6b4ffd0fc7a1844a767f5277f664f0a72beac2e0 | JavaScript | vicgp/jovitec | /dev_jovitec/js/func_alta_user.js | UTF-8 | 824 | 2.671875 | 3 | [
"MIT"
] | permissive |
var xhttp = new XMLHttpRequest();
function user(){
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("newUser").innerHTML = this.responseText;
document.getElementById('formUser').style.display="block";
}
};
xhttp.open("GET", "../b... | true |
13e1bb0be0da1d649613863def5cfa96c2622218 | JavaScript | accountos/playground | /javascript/prototype/extends.js | UTF-8 | 289 | 3.078125 | 3 | [] | no_license | function Parent() {
this.value = 'parent';
}
Parent.prototype.sayHi = function() {
console.log('hi');
};
function Child() {
Parent.call(this);
}
Child.prototype = Object.create(Parent.prototype);
Child.prototype.constructor = Child;
var child = new Child();
console.log(child);
| true |
30dbd03a407849ad4a73914a8ca5c8bc97b36cc9 | JavaScript | chengheai/inter-web-front | /object/delete.js | UTF-8 | 544 | 4.40625 | 4 | [] | no_license | obj = { a: 1, b: 2, c: 3 };
delete obj.a;
console.log(obj); //Object {b: 2, c: 3}
var obj1 = (obj = { a: 1, b: 2, c: 3 });
delete obj1.a;
console.log(obj1); //Object1 {b: 2, c: 3}
name = 'lily';
delete name;
console.log(name); //lily
varname = 'lily';
deletename;
console.log(name); //lily
function fun() {
this.nam... | true |
a3e668c360762b3b3680398a475328423134f18a | JavaScript | onegodless/cars | /scripts/cars_script.js | UTF-8 | 6,443 | 3.46875 | 3 | [] | no_license | /**
* Script for index.html
*/
class Manufacturer{
//each manufacturer object is created through this class. Contains an array holding the models of that manufacturer and the methods to work with that array.
constructor(manufacturer_name){ //The class needs the manufacturer's name to be initialized.
... | true |
179de4d9047c51f705c9dc8717492cee0761156e | JavaScript | coche745/creating-lodash-library | /_.js | UTF-8 | 6,051 | 3.765625 | 4 | [] | no_license | const _ = {
/* .clamp() takes in a number, an upper, and a lower bound. Returns lower if number less than lower. Returns upper
if number greater than upper. Returns number as is if number between upper and lower. */
clamp (num, lower, upper) {
let value = Math.max(num, lower);
value = Math.min(value... | true |
805666d097630110fc1c5be9777a64dce935ec01 | JavaScript | mmehr1988/super-octo-bassoon | /src/generate-template.js | UTF-8 | 6,965 | 2.84375 | 3 | [
"MIT"
] | permissive | 'use strict';
// ----------------------------------------------------------------------------------
// MANAGER
// ----------------------------------------------------------------------------------
const generateManager = (teamManager) => {
return `
<!-- SECTION: MANAGER -->
<section class="column is-... | true |
6dca3a5990e45a34964ee307b64b5115a35b0800 | JavaScript | ilonny/veg-delivery | /backend/react-app/src/lib/store/reducer.js | UTF-8 | 324 | 2.546875 | 3 | [] | permissive | const initialState = {
user: undefined,
};
export const mainReducer = (state = initialState, action) => {
switch (action.type) {
case "SET_USER":
console.log("SET_USER", action);
return {
...state,
user: action.user,
};
default:
return {
...state,
};
}... | true |
4aecd7a50567cf582b8be72b4a71e113dc5857ef | JavaScript | yoellagos07/51-programacion1 | /ejercicio1/index.js | UTF-8 | 294 | 3.234375 | 3 | [] | no_license | const calcular = () => {
const co= document.getElementById("inp_co").value;
const ca= document.getElementById("inp_ca").value;
const resultado = co*ca;
console.log(resultado);
}
const boton = document.getElementById("btn_calcular")
boton.addEventListener("click", calcular)
| true |
3c4b740eff97e4f49bcc83376f106e587902263e | JavaScript | clabby/PandaCLI | /lib/logger.js | UTF-8 | 580 | 2.609375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | const chalk = require('chalk');
const log = (prefix, msg) => {
console.log(prefix + chalk.grey(': ') + chalk.reset(msg));
};
const info = msg => {
log(chalk.cyan('INFO'), msg);
};
const success = msg => {
log(chalk.green('SUCCESS'), msg);
};
const warning = msg => {
log(chalk.yellow('WARNING'), msg);
};
co... | true |
5a27325f9d1b4f365ae6b9989f19ddb296898eee | JavaScript | tylerhou/kmeans | /dist/js/main.c08918d5500c71da492b.js | UTF-8 | 8,554 | 2.671875 | 3 | [] | no_license | /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModu... | true |
77203dfa210fcc2fa0c7833b7614f52c04f1a4a8 | JavaScript | tlyau62/leetcode | /alg/graph/search/dfs/79_exist.js | UTF-8 | 1,542 | 3.828125 | 4 | [] | no_license | /**
* dfs with recovery
* no. of node = mn
* no. of edge = mn * 4
* time: O(mn + 4*mn) = O(5mn) = O(mn), total: O((mn)^2)
*
* revision: why dfs's time O(V + E)
* => at least V; E includes the visting a visted node
* => so total O(V + E)
*
* @param {character[][]} board
* @param {string} word
*... | true |
3e3b5ee1201f7301277ff2c74718b63729a9790f | JavaScript | DiSantoz/bluesky | /assets/js/script.js | UTF-8 | 6,691 | 3.484375 | 3 | [
"MIT"
] | permissive | var lat;
var lat1;
var lon;
var lon1;
// display current date
var currentDate = moment().format("MM/DD/YYYY");
var newCityArr = localStorage.getItem("city") ? JSON.parse(localStorage.getItem("city")) : []
// empty out container
var hist = document.getElementById('history')
hist.innerHTML = "";
// for loop to display... | true |
f20778bcd2771d4ff8cf84954a061fc497d19074 | JavaScript | ayoo/aws-recommender-system | /lambdas/UserAfterSave/index.js | UTF-8 | 1,916 | 2.5625 | 3 | [] | no_license | "use strict"
var Q = require('q');
var _ = require('lodash');
var request = require('request');
var AwsRec = require('lib-awsrec');
var accessToken = '71d5c7a925c5d6cf240f4abb4ce08f7b1a976032180d71e27803aea202885d8c';
var apiUrl = "https://api.contentful.com/spaces/f3y661pzn9i1/entries";
var getAllEntries = function(... | true |
48d6e5811d55ba5ea1ea95163792373da4b921c2 | JavaScript | Anubhav311/webapi-iii-challenge | /react-client/src/components/user.js | UTF-8 | 3,406 | 2.6875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | import React from 'react';
import axios from 'axios';
import { Link } from 'react-router-dom';
class User extends React.Component {
state = {
posts: [],
user: '',
text: '',
}
componentDidMount() {
console.log(this.props.match)
const id = this.props.match.params.id
... | true |
dc34a5ae6d24d98bc8c713fdccfbfd958253e9ab | JavaScript | KenBonny/kenbonny.github.io | /js/sunburst.js | UTF-8 | 3,094 | 2.65625 | 3 | [] | no_license | $(document).ready(function () {
var width = 800,
height = 900,
radius = Math.min(width, height) / 2;
var x = d3.scale.linear()
.range([0, 2 * Math.PI]);
var y = d3.scale.sqrt()
.range([0, radius]);
var color = d3.scale.category20c();
var svg = d3.select("#sunburs... | true |
b80cfc08c9e23838b79c9cde18ef1faffa190c65 | JavaScript | xuser86/webcam-and-1bit-dithering | /js/worker.js | UTF-8 | 1,307 | 3.234375 | 3 | [] | no_license | onmessage = msg => {
if (msg.data && msg.data.image) {
postMessage(
binarize(
grayscale({image: msg.data.image})
)
);
}
};
function grayscale({image}) {
for (let i = 0; i < image.data.length; i += 4) {
const r = image.data[i];
const g = image.data[i + 1];
c... | true |
738cefede4a126c98d2d8f93e69024737b7ec92f | JavaScript | Andrevfcb/Movie_App | /src/App.js | UTF-8 | 1,371 | 2.765625 | 3 | [] | no_license | import React, {useEffect, useState} from 'react';
import Movie from './Components/Movie';
const API_FEATURED = "https://api.themoviedb.org/3/discover/movie?sort_by=popularity.desc&api_key=04c35731a5ee918f014970082a0088b1&page=1"
const API_SEARCH = "https://api.themoviedb.org/3/search/movie?&api_key=04c35731a5ee918f014... | true |
945066b5f472ca8031325f40b9f410dd2211b8d1 | JavaScript | Tr1nks-0/EmailBase | /src/main/resources/static/js/student.js | UTF-8 | 4,700 | 2.75 | 3 | [
"MIT"
] | permissive | ;
function sendAjax(url, method, data, handler) {
$.ajax({
url: url,
type: method,
data: JSON.stringify(data),
contentType: "application/json",
dataType: 'json',
success: handler
});
}
$.fn.extend({
serializeFormJSON: function () {
var jsonObj = {}... | true |
9dffc246217ec78a63792bacb739c75a74fe4b7a | JavaScript | hsevket/bringMore | /src/services/ItemService.js | UTF-8 | 522 | 3.078125 | 3 | [] | no_license | function generateId(size = 10) {
let ret = '';
while (size --) {
ret += String.fromCharCode(Math.round(Math.random() * 25 + 97));
}
return ret;
}
export class ListItemType {
name = '';
qty = 1;
completed = false;
id = '';
constructor(name, qty = 1, completed = false, id = null... | true |
1c77dc32219ffc9d6ce049d29c91e7166d5e7264 | JavaScript | suvadillo/lab-intro-node | /starter-code/index.js | UTF-8 | 663 | 3.3125 | 3 | [] | no_license | class SortedList {
constructor () {
this.items = [];
this.length = 0;
}
get (pos){
if (this.items[pos-1] == '') {return;}
return this.items[pos-1];
}
add (x) {
this.items.push(x);
this.length++;
this.items.sort((a,b) => a - b);
}
max () {
let OrderedList = this.items.sor... | true |
5f04c159c7760e3fe4bbe30684c28eaea0e49fb8 | JavaScript | dvizh/yii2-tree | /src/web/js/scripts.js | UTF-8 | 3,034 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | if (typeof dvizh == "undefined" || !dvizh) {
var dvizh = {};
}
dvizh.tree = {
tree: '[data-role=tree]',
expand: '[data-role=expand-tree]',
curtial: '[data-role=curtial-tree]',
deleteBtn: '[data-role=delete-tree]',
child: '[data-role=child]',
init: function () {
$(document).on('clic... | true |
eb0208795cfcba564e5b5904a9cedb5b9cc7fdf0 | JavaScript | YaponEran/testGuru | /app/javascript/utilities/timeLeft.js | UTF-8 | 475 | 3.25 | 3 | [] | no_license | document.addEventListener('turbolinks:load', function () {
const timer = document.querySelector('.timer')
if (timer) {
let timeLeft = timer.dataset.timer
setInterval(function () {
timeLeft ? timeLeft-- : document.querySelector('form').submit()
changeTimer(timeLeft, time... | true |
4a9760bf57f4ad9f228fa68aa31b93a4c11ec00f | JavaScript | GarrettAnderson/WesBosJS30HoldShiftChkBoxes | /main.js | UTF-8 | 1,378 | 3.40625 | 3 | [] | no_license | // MY SOLUTION
const chkBox = document.querySelector('input[type="checkbox"]')
const chkBoxes = document.querySelector('figure')
// console.log(chkBoxes.children)
let boxIsChecked = chkBoxes.children
// console.log(boxIsChecked)
for (let i = 0; i <= boxIsChecked.length; i++) {
// console.log(boxIsChecked[i].ch... | true |
384ac9d248c2132af8cdebb574d243ebd8521b82 | JavaScript | agatumm420/restaurant | /src/page.js | UTF-8 | 925 | 2.640625 | 3 | [] | no_license | const CreateAboutUs = () => {
const container = document.querySelector("#content");
const h1 = document.createElement("h1");
h1.innerText = "About Us ...";
container.appendChild(h1);
};
const CreateText = (message) => {
const container = document.querySelector("#content");
const h2 = document.createElement(... | true |
f090791226c1769f26793e724e9902c1d4297955 | JavaScript | jessiepao14/todoTracker | /app/controllers/tasks/new.js | UTF-8 | 756 | 2.59375 | 3 | [] | no_license | /* eslint-disable ember/no-classic-classes */
import Controller from '@ember/controller';
import { action } from '@ember/object';
export default class TasksNewController extends Controller {
@action
addTask() {
let title = this.title;
let description = this.description;
let date = this.date;
//Cre... | true |
8459981d85c0d94bf92b6e7ba2cac0a7725aefa1 | JavaScript | mrk8/angularCMS | /777/app.js | UTF-8 | 441 | 2.90625 | 3 | [] | no_license | function initCanvas(){
var ctx = document.getElementById('777').getContext('2d');
var cW = ctx.canvas.width;
var cH = ctx.canvas.height;
var y = 0;
function animate() {
ctx.save();
ctx.clearRect(0, 0, cW, cH);
// Draw here
ctx.fillStyle = 'magenta';
ctx.fillRect(0,y,50,50);
//y++;
ctx.restore();
... | true |
e1b64a55df91e6ef26290091279f1784dc75479b | JavaScript | lzvn/misc | /js/eloquent-js/ch3/is-even.js | UTF-8 | 390 | 3.859375 | 4 | [] | no_license | const isEven = (number) => {
if(number < 0) number = -number;
let isEvenOutput = false;
switch(number) {
case 0:
isEvenOutput = true;
break;
case 1:
isEvenOutput = false;
break;
default:
isEvenOutput = isEven(number-2);
}
return isEvenOutput;
}
console.log(isEven(6));
console... | true |
b3254881d5ac92fab122815c64019b0e190b5818 | JavaScript | popcoondev/nya-vader-rel | /main.js | UTF-8 | 6,998 | 2.796875 | 3 | [
"MIT"
] | permissive | var DBG = false;
var MOBILE = true;
enchant(); //enchant.jsの有効化
window.onload = function() {
log('window.onload() - start');
var missiles = [];
var enemys = [];
var enemys2 = [];
var enemys3 = [];
//プレイヤークラス定義
var Player = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y, width, height){
... | true |
edfc3ba8759a16eca803179d4578b1698db4c969 | JavaScript | vincentservio/ChoreKeeper | /frontend_ChoreKeeper/clicks_clear.js | UTF-8 | 1,310 | 2.6875 | 3 | [] | no_license | function attachClickLinks() {
document.getElementById("tableBtn").addEventListener("click", displayTable);
document.getElementById("daytableBtn").addEventListener("click", getDays);
document.getElementById("names").addEventListener("click", getNames);
document
.getElementById("nameForm")
.addEventListen... | true |
751d8ec16f3bba8b6f76f7baecb86f7a67255fe0 | JavaScript | prollings/audio_nodes | /scripts/canvas.js | UTF-8 | 1,751 | 3.140625 | 3 | [] | no_license | "use strict";
export let canvas;
let ctx;
export function setCanvas(new_canvas) {
canvas = new_canvas;
ctx = canvas.getContext("2d");
}
export function setCanvasSize(size) {
canvas.width = size.w;
canvas.height = size.h;
}
export function fillRect(pos, size, col) {
ctx.fillStyle = col;
ctx.f... | true |
9934d00bd992f57f57679a225ef3d3c3da648f2f | JavaScript | aqa365/JSGame | /main/brick.js | UTF-8 | 972 | 3.046875 | 3 | [] | no_license | ( function( window , undefined ){
var Brick = function( params ){
return this.init( params );
}
Brick.fn = Brick.prototype = {
consturctor: Brick,
init:function( params ){
this.x = 0;
this.... | true |
49db6f5c91906ead900a84aa46e44ad99de537ec | JavaScript | momor666/tbox | /client/src/reducers/sportReducer.js | UTF-8 | 1,031 | 2.59375 | 3 | [] | no_license | import { addUser } from "../utils/addUser";
const SELECT_TEAM = "SELECT_TEAM";
export const selectTeamAction = team => {
return function(dispatch) {
addUser("./winners", team).then(response => {
console.log("response", response);
if (response.result !== "failure") {
let games = response.resul... | true |
c19de42cd38db1dcc0cceaad5d1abc46520d000b | JavaScript | fanfank/aap | /backend/src/libs/file.js | UTF-8 | 2,468 | 2.890625 | 3 | [
"MIT"
] | permissive | /**
* @author reetsee.com
* @date 20160624
*/
var fs = require('fs');
function Watcher() {
this.fileExists = false;
this.fileExistsAction = function(onceTimeout) {
var thisWatcher = this;
thisWatcher.fileExists = true;
if (onceTimeout != 0 && !onceTimeout) {
onceTim... | true |
c7ae34b7b44e8719bd924c0922f5af8b095abb15 | JavaScript | Semigradsky/simple-number-formatter | /index.js | UTF-8 | 2,106 | 3.109375 | 3 | [
"MIT"
] | permissive | // Based on this code: https://github.com/adamwdraper/Numeral-js/blob/master/numeral.js
'use strict';
var merge = require('merge');
var defaultOptions = {
thousandsDelimeter: '',
decimalDelimeter: '.',
roundingFunction: Math.round
};
module.exports = function (number, format, options) {
return formatNumber(numb... | true |
6f22a57f5d38d133f61587594a302aced8e69f62 | JavaScript | AAI-USZ/FixJS | /input/50-100/after/1ffa787eabc88a09d4dd0fb48d6e96883d1e7c64_2_2.js | UTF-8 | 228 | 2.859375 | 3 | [
"MIT"
] | permissive | function() {
// add force to target
if (this.targetX != null)
this.ax += (this.targetX - this.x) * this.targetForce;
if (this.targetY != null)
this.ay += (this.targetY - this.y) * this.targetForce;
} | true |
06199992f11fbbf2fc64ddd5ae5825004b67a7bd | JavaScript | MikeAlexMartinez/react-weather-app | /app/utils/api.js | UTF-8 | 1,980 | 3.03125 | 3 | [
"MIT"
] | permissive | 'use strict';
var axios = require('axios');
const { OPEN_WEATHER_API_KEY } = require('../config.js');
var openWeatherCodes = require('./openWeatherCodes');
// hits api end point
function getForecastData(city, country) {
var target = 'https://api.openweathermap.org/data/2.5/forecast?q=' +
city + ',' + country + ... | true |
0c4373b492af2974fbd9556fc4d67146e5ea4d07 | JavaScript | Interface0625/playground3d | /js/utils.js | UTF-8 | 1,214 | 2.953125 | 3 | [] | no_license |
function create(parent) {
var F = function() {};
F.prototype = parent;
return new F();
}
function degToRad(degrees) {
return degrees * Math.PI / 180;
}
function include(url){
var element;
switch(url.split(".").pop()){
case "css":{
element=document.createElement("link");
element.setAttribu... | true |
263a80209665e5440475df5be3710a4e1c253f1a | JavaScript | BlackKnightZERO/Road-to-React | /src/ReactForm/Textarea.js | UTF-8 | 811 | 2.796875 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
class Textarea extends Component {
constructor(){
super();
this.state = {
description : 'Write..',
}
}
onChangeHandler = (event) => {
var descVal = event.target.value;
var description = event.target.name... | true |
47707866e28c94e33215d10324a36a0796246da4 | JavaScript | tubake/kodluyoruz-react-projects | /day4/1-fetching/src/components/UserList.js | UTF-8 | 289 | 2.796875 | 3 | [
"MIT"
] | permissive | import { useState, useEffect } from 'react';
function UserList() {
const [users, setUsers] = useState([]);
useEffect(() => {
axios('https://jsonplaceholder.typicode.com/users').then((res) => console.log(res.data));
}, []);
return <div>user list</div>;
}
export default UserList;
| true |
3c6da244dccaaa06e2efd479cc0ec2953e72e1c0 | JavaScript | eva19950630/sentence_SCL | /sentence/static/js/UserMap.js | UTF-8 | 18,672 | 2.53125 | 3 | [] | no_license | var c = document.getElementById("UserMap");
c.width = document.body.clientWidth;
c.height = document.body.clientHeight;
var ctx = c.getContext("2d");
ctx.font = "17px Raleway";
// Create gradient
var xEnd = 0;
var yEnd = 400;
var grd = ctx.createLinearGradient(0, 0, xEnd, yEnd);
grd.addColorStop(0, "white")... | true |
180c63010aa8dd63857150df36b169f784fe7e36 | JavaScript | DmitriyKurto/Tesla | /app/js/directives/d3DirectiveToday.js | UTF-8 | 2,355 | 2.53125 | 3 | [] | no_license | /**
* Created by Dima on 02.11.2015.
*/
;(function(){
'use strict';
function d3GraphToday(){
var margin = {top: 20, right: 20, bottom: 30, left: 20},
height = 200 - margin.top - margin.bottom,
width = 390 - margin.left - margin.right;
var dataToday = [{time:0, power: ... | true |
84ab1ddc0ae34d07f8c4ec9a9d40418679b6a0b4 | JavaScript | Antonio256/Intro-to-javascript | /date.js | UTF-8 | 131 | 3.328125 | 3 | [] | no_license | var date = "01 05 1990";
var currentYear = 2019;
var age = currentYear - date.split(" ") [2];
console.log(age + " years old");
| true |
c55d0c1c6ac1e74d8d9480902a4485c0899d5da9 | JavaScript | valentindotxyz/jobs-algolia-dashboard | /models/Movie.js | UTF-8 | 5,786 | 2.625 | 3 | [] | no_license | const mysqlDb = require('../database');
const algoliaClient = require('../algolia');
const Actor = require('./Actor');
const Genre = require('./Genre');
const moviesIndex = algoliaClient.initIndex('movies');
const Movie = {
getAll: () => {
return new Promise((resolve, reject) => {
mysqlDb.que... | true |
654d2e36421af22ccd7cf0dc32a2ffdf8a17824a | JavaScript | rosiegrant/jwt | /server.js | UTF-8 | 1,532 | 2.71875 | 3 | [] | no_license | var http = require('http'); // Import Node.js core module
var fs = require('fs');
const token = require('./request.js');
var server = http.createServer(function (req, res) { //create web server
let path = req.url.split("?")[0]
if (path === '/') { //check the URL of the current request
res.writeHead(200, {'... | true |
57ae470252a4bc41cc5fbac7a50bcbb6404aa9ff | JavaScript | julianne03/2019-1-4-project | /js/picture.js | UTF-8 | 7,315 | 3.421875 | 3 | [] | no_license | var num = 0;
function answer() {
var answera = prompt("첫 번째 학생의 이름 입력: ", "");
var answerb = prompt("두 번째 학생의 이름 입력: ", "");
if (answera == "박서빈" && answerb != "맹수연") {
alert("안타까워요ㅠㅠㅠㅠ한 명만 맞추면...!");
num++;
}
else if (answera == "맹수연" && answerb != "박서빈") {
alert("안타까워요ㅜㅜㅜ... | true |
6afa7675305d71d7106636cdce15e56eb17a8e10 | JavaScript | Mutusva/javascript-datastructures | /dynamicProgramming/dynamic_programming/tabulation/gridTraveler.js | UTF-8 | 800 | 4.25 | 4 | [] | no_license | /*
gridTraveler using Tabulation: this gives us the number of ways to travel a grid from top left corner to bottom corner where you can only move right or down.
The Ideas is to seed the table with zeros but we know that for a 1*1 grid there is one way. we then start at 0,0 and add the current value to the neighbou... | true |
604c72d8d3670f1c5291e053393c576faf11919f | JavaScript | giseleml/js-studies | /operators/operators1.js | UTF-8 | 139 | 3.4375 | 3 | [] | no_license | // Converting to numbers with + operator (only works to string with numbers only)
console.log(+"123456")
console.log(+"ABC") //returns NaN | true |
dfc364b45aa56d891a39396aa9eb0458003b7dfb | JavaScript | jsdelivrbot/altondillon.github.io | /websites/thugify/main.js | UTF-8 | 330 | 3.296875 | 3 | [] | no_license | document.getElementById('go').onclick = function() {
var inputText = $('#text-input').val();
var sayings = ["yo", "dawg", "my nigga", "mofo", "bitch", "ho"];
var thugifiedText = inputText + ", " + sayings[Math.floor(Math.random() * sayings.length)];
document.getElementById('output').innerHTML = thugifie... | true |
adb87bfba8bca084db5b86e8ef0a601309160687 | JavaScript | bpho/JavascriptWeirdParts | /D1_ObjectsAndTheDot/Starter/app.js | UTF-8 | 321 | 3.4375 | 3 | [] | no_license | var person = {
firstname: 'Benny',
lastname: 'Ho',
address: {
streetname: '4097 Ancestry Circle',
city: 'Matthews',
state: 'NC'
}
};
function greet(person) {
console.log("hello " + person.firstname + " " + person.lastname);
}
greet(person);
console.log(person);... | true |
ecc58326a2e2bf4f6fa60a0250fa0cfba20ee3be | JavaScript | VladislavTsoy/VSchoolAssignments | /exercises/problem-solving-practice/prob-sol-1/app.js | UTF-8 | 574 | 3.546875 | 4 | [] | no_license | function myMax(arr) {
var max = -Infinity
for(var i = 0; i < arr.length; i++){
if(arr[i] > max){
max = arr[i]
}
}
return max;
}
function findWord(arr, letter) {
var words = []
for(var i = 0; i < arr.length; i++){
var current = arr[i];
for(var j = 0... | true |
ef0a4cf6ab675ea470bf737fd2a450b3f918cf68 | JavaScript | ISINth/Labs-HW | /index.js | UTF-8 | 533 | 2.84375 | 3 | [] | no_license | var myvar;
$('.plot').click(function(e) {
clearInterval(myvar)
console.log(myvar)
var x=parseFloat($('.from').val())
const x1=x
const xn=parseFloat($('.to').val())
const fun=$('.fun').val()
var points=[x,eval(fun)]
console.log(points)
console.log(fun);
myvar=setInterval(function(){
... | true |
5fdf1ccc5a16ffb6f627f6ce5faf0a467f1f0a23 | JavaScript | mimeindustries/mime-app-libs | /src/app-framework/menus/AppsMenu.js | UTF-8 | 678 | 2.59375 | 3 | [
"BSD-2-Clause"
] | permissive | AppsMenu = function(el, config){
var self = this;
var addMenuItem
this.init = function(){
var container = document.querySelector(el);
container.insertAdjacentHTML('beforeend', '<div id="apps" class="menuItem"><i class="icon icon-apps"></i><div class="wrapper"><ul class="subMenu"></ul></div></div>');
... | true |
1a6e7179a0fd38f9cdd4112f14f4dd970d6ed9c9 | JavaScript | maheshramaiah/Interview-kit | /Utils/Redux_helpers.js | UTF-8 | 2,537 | 2.96875 | 3 | [] | no_license | const combineReducers = (reducers) => {
return function(store, action) {
return Object.keys(reducers).reduce((newState, key) => {
newState[key] = reducers[key](store[key], action);
return newState;
}, {});
};
};
const thunk = (store) => (next) => (action) => {
if (typeof action === 'function... | true |