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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ecc16a667ae454fb2fa93b841321b3a7a703c287 | JavaScript | jordanarcherdev/MovieInfo | /index.js | UTF-8 | 1,111 | 2.59375 | 3 | [] | no_license | const electron = require('electron');
const imdb = require('imdb-api');
const { app, BrowserWindow, ipcMain } = electron;
let mainWindow;
app.on('ready', () => {
mainWindow = new BrowserWindow({});
mainWindow.loadURL(`file://${__dirname}/index.html`);
});
ipcMain.on('movie:submit', (event, movieName) => {
co... | true |
625b5af7b161c86ac1d21b9acd9232e9edbecfa1 | JavaScript | aploftus/tidyup | /client/components/Signup.jsx | UTF-8 | 2,198 | 2.75 | 3 | [] | no_license | import React from 'react';
import axios from 'axios';
class Signup extends React.Component {
constructor(props) {
super(props);
this.state = {
username: '',
password: '',
};
this.onChangeUsername = this.onChangeUsername.bind(this);
this.onChangePassword = this.onChangePassword.bind(th... | true |
7581d5777a9ef0e6e332c691ef32a7c54b71ab27 | JavaScript | HQTrust/react-admin | /packages/ra-core/src/form/validate.js | UTF-8 | 2,968 | 2.75 | 3 | [
"MIT"
] | permissive | /* eslint-disable no-underscore-dangle */
/* @link http://stackoverflow.com/questions/46155/validate-email-address-in-javascript */
const EMAIL_REGEX = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; // eslint-disa... | true |
a5485e0c6bdfcf09bd55b8c32edf9d9959a071c5 | JavaScript | silviosoto/webBlackbox | /public/js/dashboard/Velocidad.js | UTF-8 | 1,006 | 2.765625 | 3 | [
"MIT"
] | permissive | window.onload = function () {
var dataLength = 0;
var data = [];
var updateInterval = 500;
updateChart();
function updateChart() {
$.getJSON("/bitacora/create", function (result) {
if (dataLength !== result.length) {
for (var i = dataLength; i < resu... | true |
6f82ff04d48bec6fe62b0a904c95e15827d36730 | JavaScript | varindersingh83/PigGame | /app.js | UTF-8 | 2,333 | 3.640625 | 4 | [] | no_license | /*
GAME RULES:
- The game has 2 players, playing in rounds
- In each turn, a player rolls a dice as many times as he whishes. Each result get added to his ROUND score
- BUT, if the player rolls a 1, all his ROUND score gets lost. After that, it's the next player's turn
- The player can choose to 'Hold', which means th... | true |
f0d53d1b0279ceedbedb2092d84185729b9d272c | JavaScript | dumbeldor555/6-REACT_PROJECTS | /react/FreeCodeCampReact-Projects-myCode/9-grocery-bud/src/Component/layout/inputfield.js | UTF-8 | 1,332 | 2.65625 | 3 | [] | no_license | import {Consumer} from '../../Context';
import {Component} from 'react';
class InputField extends Component {
handleSubmit = (dispatch) => {
const item = document.querySelector('.inputField');
let submitBtn = document.querySelector('.submitBtn').textContent;
// console.log(submitBtn.charCodeAt(), 'Subm... | true |
b4225d870329cf489821be8c78f04633afa3d4ad | JavaScript | vinayak41/memory-game | /src/App.js | UTF-8 | 1,072 | 2.671875 | 3 | [] | no_license | import React from 'react';
import GameBoard from './components/GameBoard'
import './App.css';
import Cards from './components/Cards';
import { useState } from 'react';
import ScoreBoard from './components/ScoreBoard'
function App() {
const [cards, setCards] = useState(Cards)
const [score, setScore] = useState(0)
... | true |
968329c7455924d5aab3190de037c014f1c49c02 | JavaScript | wvbe/luggage | /src/packages/core/src/classes/PlayerEntity.js | UTF-8 | 740 | 2.78125 | 3 | [] | no_license | define([
'Color',
'./Entity'
], function(Color, Entity) {
/**
* The character our gamer has control over. While the animations may be missing, the player can move through the
* world already.
* @param tile
* @constructor
*/
function PlayerEntity(tile, options) {
Entity.call(this, tile, options);
// ... | true |
da122920ec2f172ef9c225b67c4919cc463695c1 | JavaScript | praece/sails-bookshelf | /lib/load.js | UTF-8 | 2,752 | 2.546875 | 3 | [] | no_license | var _ = require('lodash');
var buildQuery = require('./buildQuery');
module.exports = {
collection(relations, options) {
const load = sails.db.coreCollection.prototype.load;
return load.call(this, loadRelations(relations, this), options);
},
model(relations, options) {
const load = sails.db.Model.pr... | true |
2896f5818cef0790134f1fc9eb249faf45dcc7bf | JavaScript | ricotritanto/tlab-backend | /src/controller/kategoriController.js | UTF-8 | 2,061 | 2.515625 | 3 | [] | no_license | 'use strict'
const kategoriServices = require('../services/kategoriServices')
const getAll = async(req, res, next) =>{
req.query.page = (req.query.page == undefined || isNaN(req.query.page))?1:req.query.page
req.query.per_page = (req.query.per_page == undefined || isNaN(req.query.per_page))?20:req.query.per_pag... | true |
012e7feb5b5e8c8624e396eb315c122eb08be445 | JavaScript | cool-yue/howjsworks | /bookTranslate/26_tokenize/demo.js | UTF-8 | 7,829 | 2.90625 | 3 | [] | no_license | let tokenizeGenerator = tokenize(
`def reduce reverse: ƒ array, callback function,initial value {
var element nr:length(array)
var reduction:initial value
if reduction = null
let element nr:element nr - 1
let reduction:array[element nr]
def exit:ƒ final value ... | true |
bbc7aa470af9471427b785b3e2834644e0c4e58c | JavaScript | yixuanwang/yixuanwang.github.io | /assets/js/minigame/pong.js | UTF-8 | 440 | 3.421875 | 3 | [
"MIT"
] | permissive | var dots = [];
var dSize = 10;
function setup() {
createCanvas(800, 500);
for(let y = dSize/2; y<height; y+=dSize*2){
dots.push(createVector(width/2-dSize/2,y));
}
}
function draw() {
background(0);
noStroke();
fill(255);
drawSquares();
}
function drawSquares() {
for(let i=0... | true |
58c57a0521a0312103acf87cab98d114c5821e07 | JavaScript | LoveBettygirl/LoveBettygirl.github.io | /js/darkmode.js | UTF-8 | 987 | 2.953125 | 3 | [] | no_license | (function () {
const enableDarkMode = function () {
document.body.classList.add('dark-mode');
document.body.classList.remove('light-mode');
localStorage.setItem('theme', 'dark');
};
const disableDarkMode = function () {
document.body.classList.add('light-mode');
docum... | true |
ffb2860bc930d9da49fbb547a32480221ccccb76 | JavaScript | daiguilin/todoList | /app.js | UTF-8 | 2,302 | 2.625 | 3 | [] | no_license |
var store = {
save(key,value){
localStorage.setItem(key,JSON.stringify(value));
},
fetch(key){
return JSON.parse(localStorage.getItem(key)) || [];
}
}
var filter = {
all:function(list){
return list;
},
unfinished:function(list){
return list.filter(function(item){
return !item.isChecked
})
},... | true |
960b16fa30c5c764c996712ffcfb2d627dde53d0 | JavaScript | liyonglu123/liyonglu123.github.io | /前端算法练习/03:哈希表、映射、集合/22-valid-anagram.js | UTF-8 | 878 | 3.953125 | 4 | [] | no_license | // https://leetcode-cn.com/problems/valid-anagram/description/
// 有效的字母异位词
/**
* @param {string} s
* @param {string} t
* @return {boolean}
*/
// 1. 排序比对, 时间复杂度:O(nlogn), 空间复杂度:O(logn)
var isAnagram = function (s, t) {
return (
s.length === t.length && [...s].sort().join("") === [...t].sort().join("")
);
};
... | true |
7d69265235b713b13589e77328f5e2df9aa76225 | JavaScript | shelleyclem/jsfundamentals | /functions/declarations.js | UTF-8 | 221 | 3.0625 | 3 | [] | no_license | /*
Functions:
functions are a chunk of code that per form a set action when called, or "invoked"
*/
//1 2
function hi() {
console.log('Hi');
}
//1: Keyword
//2: Name of the function, parens for parameter
| true |
dd14adcc0ee5fdbff010be6882aac07d39d70dcd | JavaScript | vetrivel-muthusamy/Tic-Tac-Toe-1 | /js/main.js | UTF-8 | 11,015 | 3.84375 | 4 | [] | no_license | var startScreen = document.getElementById('start');
var boardScreen = document.getElementById('board');
var finishScreen = document.getElementById('finish');
var player1 = document.getElementById('player1');
var player2 = document.getElementById('player2');
// *START SCREEN* //
// Hide the board and finish screen, sh... | true |
b9af89710fdfdfa4792d7b01d3cfda15b26fe378 | JavaScript | Duermael/OCR-P6 | /js/launchers.js | UTF-8 | 1,499 | 3.1875 | 3 | [] | no_license | // players and weapons arrays creation
let playersArr = [];
let weaponsArr = [];
// weapons and players instances creation
const weapon1 = new Weapon('weapon-ham', 'Jambon', 'weapon-ham.png', grid, 10, false);
const weapon2 = new Weapon('weapon-club', 'Gourdin', 'weapon-club.png', grid, 10, false);
const weapon3 = new... | true |
00eb2c50a658d0d708d29c68c931e34d2b2cf6c7 | JavaScript | Jaredk3nt/clickergame | /frontend/src/organisms/LandingPage/LandingPage.js | UTF-8 | 2,168 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import './styles.css';
import Button from '../../atoms/Button/Button';
/* <LandingPage />
* Props:
* -
*/
class LandingPage extends Component {
constructor(props) {
super(props);
this.state = {
cu... | true |
a5a34f2eb1677cf451d9244204f07effe21276b1 | JavaScript | CodingJoe89/Construction_PM | /server/controllers/projectController.js | UTF-8 | 1,098 | 2.578125 | 3 | [] | no_license |
function ProjectController(){
this.index= function(req,res){
process.connection.query('SELECT * from `projects`', function(error, results, fields){
if(error) res.json(error);
else {
res.json(results);
}
});
}
this.create = function(req,res){
console.log(... | true |
4330dbe275a2910e42944d031ab47efd29f41353 | JavaScript | 75lb/command-line-args | /lib/argv-parser.mjs | UTF-8 | 4,032 | 2.75 | 3 | [
"MIT"
] | permissive | import * as argvTools from './argv-tools.mjs'
import Definitions from './option-definitions.mjs'
import findReplace from '../node_modules/find-replace/dist/index.mjs'
import t from '../node_modules/typical/index.mjs'
/**
* @module argv-parser
*/
/**
* @alias module:argv-parser
*/
class ArgvParser {
/**
* @pa... | true |
cceeb0e4da78a6466e982965f7a2351ea56250f8 | JavaScript | NengGe/oa | /src/modules/calendar2/week2.js | UTF-8 | 3,407 | 3.359375 | 3 | [
"MIT"
] | permissive | // let d = {
// currDate: '', // 当前选择。默认为 startDate。加载数据根据此初始化
// startDate: '', // 一周的开始时间。可作为id
// endDate: '', // 一周的结束时间
// firstDays: [],
// secondDays: [],
// // 可快速判断选定天是否在当前星期
// daysKey: {4: 1, 5: 1}
// }
// function datefill (s) {
// return s.replace(/-(\d)(?=(-|$))/g, '-0$1')
// }
function ... | true |
847dd6c15ef221245c68495dee6713b76c3fb5ed | JavaScript | hexx-system/hexx-backup | /commands/fun/minesweeper.js | UTF-8 | 512 | 2.640625 | 3 | [] | no_license | // NOT MINE
const { Command } = require('discord.js-commando');
module.exports = class MinesweeperCommand extends Command {
constructor(client) {
super(client, {
name: 'minesweeper',
group: 'fun',
memberName: 'minesweeper',
description: 'Plays minesweeper.',
});
}
run(message) {
const Minesweeper =... | true |
484c4bd266590595d40204104f8406b32f621ea9 | JavaScript | thiru-eth/ReviewSystem | /review-app/src/auth/login.js | UTF-8 | 2,446 | 2.578125 | 3 | [
"MIT"
] | permissive | import React from 'react';
import '../review/App.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import axios from 'axios';
class Login extends React.Component
{
constructor() {
super();
this.state = {
Email: "",
Password:""
}
}
infoChange = event => {... | true |
f180aba68130a39a686ea41e561ea88723d6f145 | JavaScript | Kalter666/nodejs-geekbrains | /les3/yandex.js | UTF-8 | 957 | 2.9375 | 3 | [] | no_license | /**
* Created by kalter on 8/10/2016.
*/
const yourkey = require('./key');
var key = yourkey.key;
var url = 'https://translate.yandex.net/api/v1.5/tr/translate?';
var request = require('request');
const readline = require('readline');
const cheerio = require('cheerio');
const rl = readline.createInterface({
inpu... | true |
fb177a1db2f9e74ebab9a02fa052789a4bf47a3d | JavaScript | Steven-Moonen/RestUhasselt | /indienen/src/QueryBuilder.js | UTF-8 | 2,850 | 2.859375 | 3 | [] | no_license | module.exports = class QueryBuilder {
constructor(query){
this.setQuery(query);
this.prefixesHandled = false;
}
setQuery(query){
this.query = query;
this.prefixesHandled = false;
}
handleRDFPrefix(prefixShort, prefixLong){
let query = this.query;
if(prefixShort.substr(-1) !== ':'){
prefixShort = p... | true |
ebbb8d998a546f6bc98c339f3656ba0ae30682a6 | JavaScript | Akashics/Shiina | /commands/status.js | UTF-8 | 1,290 | 2.609375 | 3 | [] | no_license | exports.name = "status";
exports.run = (client, message, args, colors) => {
const config = require("../config.json");
if (message.author.id === config.ownerID || message.author.id === config.adminID) {
if (args[0] === 'reset') {
client.user.setGame('Shiina - ' + config.prefix + 'help');
console.... | true |
bea04a5f0da3a3970d24be1cc4ffcf68fbda08da | JavaScript | dkarolis/webpage | /src/components/Questions/Question.js | UTF-8 | 1,078 | 2.65625 | 3 | [] | no_license | import "./Question.css";
import React from "react";
function Question(props) {
const { defaultCollapsed } = props;
const [collapsed, setCollapsed] = React.useState(defaultCollapsed === false ? false : true);
return (
<div className="question-container">
<div className="question" onClick={() => (collaps... | true |
9c4a0cd234fe193f2c5e5933d30219f5dbd26ad3 | JavaScript | cubefreaker/webitx | /assets/js/flight-search-angular.js | UTF-8 | 8,944 | 2.546875 | 3 | [
"MIT"
] | permissive | var app = angular.module('App', ['ngCookies', 'ngRoute']);
app.run(function run( $http, $cookies ){
$http.defaults.headers.common["X-CSRF-TOKEN"] = $cookies.get('5f05193eee9e900380c12e6040e7dee9');
});
app.service('FlightSearch', function() {
this.SuccessResponse = function()
{
swal({
titl... | true |
d94aab0fa8752198bd23af8eaea97aee4b5e4063 | JavaScript | sonaliluthar/ttchallenge | /src/ListCritical.js | UTF-8 | 1,249 | 2.796875 | 3 | [] | no_license | import React, { Component } from "react";
import { Button, List } from "antd";
export default class ListCritical extends Component {
constructor(props) {
super(props);
// create state variable to hold list of critical assets
this.state = {
criticalAssets: [],
clicked: false
};
}
comp... | true |
f527761a7fdb5526472902bcd778d7e68dc89f42 | JavaScript | leohlgctzby/KennethHuang.github.io | /ITJiangren/JSPractice/function_test2.js | UTF-8 | 75 | 2.734375 | 3 | [] | no_license | var a;
a= function(s){return s+",I am Ken.";}
console.log(a("Hi"));
| true |
ad40f217354b96f654c29def4b724ff5e62d53c2 | JavaScript | AntoineTheb/train | /src/Background.js | UTF-8 | 1,439 | 3.078125 | 3 | [] | no_license | import { getRandomInt } from './utils';
import MountainLine from './MountainLine';
export default class {
constructor(ctx, width, height, color, isNight) {
this.ctx = ctx;
this.width = width;
this.height = height;
this.color = color;
this.isNight = isNight;
this.nbLayers = getRandomInt(2, 11... | true |
8214a13ae7b0b844371de340eeae69a1f3a3cb03 | JavaScript | BarreraR/gainz-client | /src/homePage/HomeMain.jsx | UTF-8 | 1,256 | 2.53125 | 3 | [] | no_license | import React, { useContext } from 'react';
import { useHistory } from 'react-router-dom';
import ApiContext from '../ApiContext';
import ProgressComponent from '../Components/ProgressComponent';
import './HomeMain.css';
export default function ExerciseMain(){
const history = useHistory();
const { user, routines} =... | true |
995bf0b13826895eeeb4683cba107ff9933339b7 | JavaScript | haoxiangsnr/Extremely-Low-SNR-Demo | /src/utils/randomNum.js | UTF-8 | 345 | 3.359375 | 3 | [] | no_license | /*
* 生成随机数
*
* */
function randomNum (len) {
let text = "";
const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for( var i=0; i < len; i++ )
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
export defau... | true |
ed4c46fa047facf94ba554e938c0de86c0f720f0 | JavaScript | OlehSmol/LinearAlgebra2 | /js/all.js | UTF-8 | 12,511 | 2.625 | 3 | [] | no_license | console.log("all.js is running");
//
// --------------------------------global variables ------------------------------
//
var selectedProjectTabId = "project-1";
//
// -------------------------------------------------------------------------------
//
function clearContent(id) {
"use strict";
document.getElem... | true |
a4d05063311f37cf1ed50fd9ea6d4d4f82bbacd1 | JavaScript | StevenYoung21/LeetCode_practice | /dynamicProgramming/198-rob/1.js | UTF-8 | 618 | 3.203125 | 3 | [] | no_license | /**
* @param {number[]} nums
* @return {number}
*/
var rob = function(nums) {
let len = nums.length;
if(len == 0) return 0;
let maxP = [];
maxP[0] = nums[0];
if( len > 1 ){
maxP[1] = Math.max(nums[0], nums[1]);
for( let i = 2; i < nums.length; i++ ){
if( nums[i] ... | true |
18ed980eaf4923127768e3af17eb5eb0488574a6 | JavaScript | mittalbhanderi/react-redux-js | /src/JsTest/MedianOfTwoSortedArrays/quiteDirtyCode.js | UTF-8 | 5,220 | 3.953125 | 4 | [] | no_license | /**
* There are two sorted arrays nums1 and nums2 of size m and n respectively.
Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).
You may assume nums1 and nums2 cannot be both empty.
Example 1:
nums1 = [1, 3]
nums2 = [2]
The median is 2.0
Example 2:
nums1 = [1, 2]
... | true |
b289f52b0657b4c60de4de32f9a48edd0a10b89e | JavaScript | mberja/dms_final | /public/emailapi.js | UTF-8 | 1,154 | 2.75 | 3 | [] | no_license | const emailresult = document.getElementById("emailresult");
function valEmail()
{
var email = document.getElementById("email").value;
console.log(email);
const request = new XMLHttpRequest();
request.withCredentials = true;
request.addEventListener("readystatechange", function () {
... | true |
7ea4e89b4873f17493bde516cf880f95c0b7e617 | JavaScript | Salishoma/My-Code-House | /Resources/codeHub/Fibonacci_Memoized.js | UTF-8 | 205 | 3.28125 | 3 | [] | no_license | //fibonacci sequence
function fib(n, memo = [undefined, 1, 1]){
if(memo[n] !== undefined) return memo[n];
var res = fib(n - 1, memo) + fib(n - 2, memo);
memo[n] = res;
return res;
}
fib(30) | true |
1ff445d79ba7ce362b6137ea57051644f9bd38f8 | JavaScript | mayurdange/IslandRedux | /app/redux-example.jsx | UTF-8 | 519 | 2.671875 | 3 | [] | no_license | var redux = require("redux");
console.log("Redux loaded successfully");
var defaultState = {
name: 'Anil'
}
var reducer = (state = defaultState, action) => {
console.log('Action is: ', action);
return state;
};
var store = redux.createStore(reducer, redux.compose(
window.devToolsExtension ? window.devTools... | true |
878111bfd78321d80432a4d4dd00b6120974f6a0 | JavaScript | Albredka/devall2 | /m6/uf1/javascript_ejercicios/ejercicios1/ejercicio2.js | UTF-8 | 405 | 3.515625 | 4 | [] | no_license |
/* Calcular els primers 20 números de la sèrie de Fibonacci, tenint present que a1=1, a2=1 y que an=an-1+an-2. */
var numero1 = 0;
var swap = 1;
for (let i = 0; i < 21; i++) {
console.log(numero1);
if(i == 0){
console.log(swap);
numero1 = numero1 + swap;
} else{
... | true |
88cf0b0e8b2ef07f6f7b30be422e515eef1c3941 | JavaScript | AstroKey/astrokey_web_client_next | /src/modules/workflow/store/mutations.js | UTF-8 | 6,024 | 2.59375 | 3 | [
"MIT"
] | permissive | import _ from 'lodash'
import store from '@/store'
import { KEYS } from './keys'
import { TEXT_WORKFLOW_STEP, MACRO_WORKFLOW_STEP, DELAY_WORKFLOW_STEP, KEY_WORKFLOW_STEP, KEYUP_WORKFLOW_STEP, KEY_DN_POSITION, KEY_UP_POSITION, KEY_PR_POSITION } from './constants'
// // // //
// Stops Keyboard recording after a predete... | true |
03689bafcb95fc214b657f4e0913546d13d10f21 | JavaScript | rivalku21/proyek-akhir-BE | /src/api/uploads.js | UTF-8 | 1,887 | 2.515625 | 3 | [] | no_license | const controller_object = {};
// const pdfToText = require('pdf-to-text');
const pdfParser = require('pdf2json');
controller_object.upload = async(req, res, next) => {
try {
if (!req.file) {
return res.status(500).send({
statusCode: 500,
msg: "file is not found"... | true |
f77a34fc375ec4e1467fa0f596486b59719f9c49 | JavaScript | AmanAzim/jotto-app-to-test--jest-enzyme- | /src/components/Congrats.test.js | UTF-8 | 2,910 | 2.859375 | 3 | [] | no_license | import React from 'react';
import Enzyme,{shallow, render, mount} from 'enzyme';
import EnzymeAdapter from 'enzyme-adapter-react-16';
import {findByTestAttr, checkProps} from '../testUtils/testUtils'
import checkPropTypes from 'check-prop-types'
import Congrats from './Congrats'
Enzyme.configure({adapter: new EnzymeAd... | true |
7255745405b1c44986571b3761c62f5a1cf02a23 | JavaScript | menesai/e-commerce | /src/redux/users/userReducer.js | UTF-8 | 490 | 2.71875 | 3 | [] | no_license | const initialState = {
currentUser: null
}
const GET_CURRENT_USER = 'GET_CURRENT_USER'
export const getCurrentUser = (user) => ({
type: GET_CURRENT_USER,
payload: user
})
const users = (state = initialState, action) =>{
switch(action.type){
case 'GET_CURRENT_USER':
r... | true |
bc2f3feb48cce1576317bcc00847c8f67f223c0b | JavaScript | DCueto/Courses | /Udemy/Javascript Moderno/Curso JS Moderno/03-Strings/js/02-app.js | UTF-8 | 524 | 3.46875 | 3 | [] | no_license | const producto = 'Monitor 20 Pulgadas';
console.log(producto);
// MÉTODOS DE LOS STRINGS
// Conocer la cantidad de letras de la cadena de texto
console.log(producto.length);
// Saber en que posición se encuentra la búsqueda en la cadena de texto
console.log(producto.indexOf('Pulgadas'));
console.log(producto.indexO... | true |
37b712fadd70e9949be141ce8f9c7528d60af010 | JavaScript | kabir4691/LeetCode | /javascript/66.js | UTF-8 | 359 | 3.265625 | 3 | [] | no_license | /**
* @param {number[]} digits
* @return {number[]}
*/
var plusOne = function(digits) {
let carry = 1;
for (let i = digits.length - 1; i >= 0; i--) {
const sum = digits[i] + carry;
if (sum <= 9) {
digits[i] = sum;
return digits;
}
digits[i] = 0;
carry = sum - 9;
... | true |
820da4dff70b5d7022301a2961ea1bcd816710f4 | JavaScript | mushy1693/coding-dojo-algorithm | /Advance Algorithm/21. Reverse hash/script.js | UTF-8 | 297 | 3.234375 | 3 | [] | no_license | function reverseHash(hash){
newHash = {};
for(var key in hash){
for(var i = 0 ; i < hash[key].length ; i++){
var getKey = hash[key][i];
newHash[getKey] = key;
}
}
return newHash;
}
var newHash = reverseHash({a : ['b', 'c'], d : ['e', 'f']});
console.log(newHash);
| true |
0ba590ecae8a5a3c7654cbeb652162211eaa1309 | JavaScript | shanxifenghongwei1/axios | /index.js | UTF-8 | 576 | 2.65625 | 3 | [] | no_license |
const express = require('express');
const path = require('path');
const sever = express();
sever.use(express.static('./www'));
sever.get('/',(req,res)=>{
res.sendFile(
path.resolve('./axios.html')
)
}
)
sever.listen(5060)
// function date2time(date) {
// let year = date.getFullYear... | true |
6a57ea098a3f62e6dd1285606e2ab220c5848a24 | JavaScript | lakimancic/Mreze | /main.js | UTF-8 | 10,344 | 2.796875 | 3 | [] | no_license | $(document).ready(function(){
$("#btn1").click(pretvoriBin);
$("#btn2").click(pretvoriDek);
$("#btn3").click(broadcast);
$("#btn4").click(brojRacunara);
$("#btn5").click(daLiJeRac);
$("#btn6").click(dali2adr);
$("#btn7").click(napraviTabelu);
$("#btn8").click(popuniTabelu);
});
function pret... | true |
d142af027580a6618092e59ce3f563603a628527 | JavaScript | NickDJM/accessible-menu | /src/validate.js | UTF-8 | 9,473 | 3.921875 | 4 | [
"ISC"
] | permissive | /**
* Check to see if the provided elements have a specific contructor.
*
* The values must be provided inside of an object
* so the variable name can be retrieved in case of errors.
*
* This is essentially just a wrapper function around checking instanceof with
* more descriptive error message to help debugging... | true |
f598dcbd1bb4e6b449c80cdb646be8e319940f9b | JavaScript | tijutthomas/refreshJS | /Calculator Console.js | UTF-8 | 4,574 | 3.9375 | 4 | [] | no_license | function Calculator() {}
/**
* @param {Number} x
* @param {Number} y
* @return {Number} The sum of x and y.
*/
Calculator.prototype.add = function (x, y) {
return (x + y);
};
/**
* @param {Number} x
* @param {Number} y
* @return {Number} The difference of x and y.
*/
Ca... | true |
23266d09d162620a93eb386c37f594e71859af97 | JavaScript | Amazeotron/CatapultRedesign | /site/_beforeWP/js/locations.js | UTF-8 | 2,150 | 2.703125 | 3 | [] | no_license | var locations = {
_locationData: null,
init: function(locationData) {
this._locationData = locationData;
var self = this;
$(window).resize(function() {
if ($("#locations").hasClass("show")) {
$(".locations").height(self._getHeight());
self._repositionLocations(self._locationData);
}
});
... | true |
8d25077cea6661d89f6283955015736e2bc3bb60 | JavaScript | Wayne-Bai/AST-normalize | /data/AVGP/Montagsmaler/game.js | UTF-8 | 5,948 | 2.703125 | 3 | [] | no_license | var context = null;
var sock = null;
var pathPoints = [];
var isPainting = false;
var myTurn = null;
var wordToDraw = "";
$(document).ready(function() {
convertTouchToMouse("canvas");
context = document.getElementById("canvas").getContext("2d");
$("#dialog").dialog({modal: true, autoOpen: false, width: "... | true |
561dc153fcbe9c311c4e21a47d06930983846c25 | JavaScript | crguezl/miriada-upm-dsnh5jsnode | /P2P/merge/merge.js | UTF-8 | 926 | 2.96875 | 3 | [] | no_license | #!/usr/bin/env node
/*
Realizar en JavaScript un programa, de nombre "merge", que integre
n ficheros en uno solo.
El programa se debe invocar de la siguiente forma
node merge.js <dest> <f1> <f2> .. <fn>
El programa debe crear un fichero <dest> concatenando los contenidos
de <f1> a <fn>, siendo... | true |
9de165b72ad48d21224f8212595502818cc07579 | JavaScript | jo-hooton/tic-tac-toe | /js/Player.js | UTF-8 | 101 | 2.53125 | 3 | [] | no_license | const Player = (squareState, name) => {
this.squareState = squareState;
this.name = name;
} | true |
e39aad7bf01a020d4e218a348ea83a1b3ce9b557 | JavaScript | mathieuhays/Todo-Redux | /app/scripts/stores/todoStore.js | UTF-8 | 911 | 2.515625 | 3 | [] | no_license | import { createStore, combineReducers } from 'redux'
import assign from 'object-assign'
const todos = ( state = [], action ) => {
switch( action.type ) {
case 'ADD_TODO':
return [
...state,
{
text: action.text,
id: ( state.... | true |
79261cef20fb5d469eb7e2ba32bf5443ab5996e1 | JavaScript | KeithBender/RESTPRAC | /routes/api/posts.js | UTF-8 | 763 | 2.578125 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const Posts = require("../../models/Posts");
// @routes POST api/posts
// @desc get a post
router.get("/", async (req, res) => {
try {
const posts = await Posts.find();
if (!posts) throw Error("No Items");
res.status(200).json(posts)... | true |
59b9719a55a4596cc1ea34a8ba1ba5d9ff9758f4 | JavaScript | johannTor/js-modules | /alertModule.js | UTF-8 | 2,778 | 2.921875 | 3 | [] | no_license | export { customAlert};
// Content for the style tag that gets appended to the body
const styleRules = `
.template {
position: absolute;
top: 30%;
left: 50%;
transform: translate(-50%, -30%);
width: 30%;
background-color: slateblue;
z-index: 10;
}
.template p {
padding: 1rem 1rem;
f... | true |
6c7a0347a78a0360900b7783742189a464be2b5d | JavaScript | iloveuav/leetcodeGo | /src/1.栈/03.[ 933 ] 最近的请求次数.js | UTF-8 | 1,160 | 3.234375 | 3 | [] | no_license | /**
* * 题目名称:最近的请求次数
* * 题目地址:https://leetcode-cn.com/problems/number-of-recent-calls
*/
// * 思路:写个栈每次放入后 根据条件拿出并计数 CTRL + ALT + N
class RecentCounter {
constructor(){
this.count = 0
this.stackTemp = []
}
ping(t){
// this.stack.push(t)
this.stackTemp.push(t)
le... | true |
5a14543748a7e659933947a13d0396a842cc25cd | JavaScript | Gizmmo/spaceInvaders | /scripts/player.js | UTF-8 | 2,012 | 3.1875 | 3 | [] | no_license | //Hide the Global Namespace
(function() {
//Check if the Cti namespace exists, if not, create it
window.game = window.game || {};
var Player = function(playerWidth) {
var _player = this;
var _SPACE_KEY_BUTTON = 32;
var _LEFT_KEY_BUTTON = 37;
var _RIGHT_KEY_BUTTON = 39;
var _isLeftKeyDown = false;
var _... | true |
060e71435d02fea62aa4665693873d355890bbe5 | JavaScript | OlehMarko/olehmarko.github.io | /hw8/js/task1.js | UTF-8 | 451 | 3.34375 | 3 | [] | no_license | var a = +prompt("Enter a");
var b = +prompt("Enter b");
var c = +prompt("Enter c");
var discriminant = b*b - 4*a*c;
var res1 = (discriminant >= 0) ? (-b + Math.sqrt(discriminant)) / (2 * a) : `розв'язку немає`;
var res2 = (discriminant >= 0) ? (-b - Math.sqrt(discriminant)) / (2 * a) : `розв'язку немає`;
co... | true |
ba48d51908e0a28c718186c51fd122e16a835265 | JavaScript | ZzxStormrage/liutao_h5 | /src/util/util.js | UTF-8 | 4,561 | 2.84375 | 3 | [] | no_license | // 用法 在组件中 this.$util.<FunctionName>
const util = {};
// 屏蔽鼠标右键,F12及其它审查元素功能
util.noViewing = () => {
// 屏蔽F12 审查元素
document.onkeydown = function () {
if (window.event && window.event.keyCode == 123) {
alert("F12被禁用");
event.keyCode = 0;
event.returnValue = false;
}
if (... | true |
caef011c7c341924ed4ac3793328566a79b9118a | JavaScript | tamaraaqs/agilizeiBootcamp | /cypress/integration/cadastro.spec.js | UTF-8 | 1,969 | 2.8125 | 3 | [] | no_license | ///<reference types="cypress"/>
//https://form-agilizei.netlify.app/index.html
var chance = require('chance');
var chance = new chance();
//estrutura do mocha ->test runner
describe('Cadastro ', () => {
it('Quando eu informar os dados e finalizar, então o cadastro deve ser realizado', () => {
cy.visit("h... | true |
60bbee7d7b4c596efa57d244feb5835d6798b644 | JavaScript | DennySchumann/SimpleoBackend | /build/router/userRouter.js | UTF-8 | 4,497 | 2.53125 | 3 | [
"MIT"
] | permissive | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const user_1 = require("../models/user");
const helper_1 = require("../helper/helper");
class UserRouter {
constructor() {
this.router = express_1.Router();
this.routes();
}
/**... | true |
4905d62b9650d075304d1bcd97ab2a96985b0aae | JavaScript | SomeEarth86/Triangle-quiz | /istriangle.js | UTF-8 | 804 | 3.4375 | 3 | [] | no_license | const angleInp = document.querySelectorAll(".angleinput");
const istrianglebtn = document.querySelector("#istriangle-btn");
const outputMsg = document.querySelector("#output-msg");
istrianglebtn.addEventListener("click", isTriangleorNot);
function isTriangleorNot() {
let a = angleInp[0].value;
let b = angle... | true |
72a53f27056625266ec70017e0731948b21a2c31 | JavaScript | MounikaAmbati21/POS-billing-application | /src/actions/billingActions.js | UTF-8 | 12,052 | 2.609375 | 3 | [] | no_license | import axios from 'axios'
import swal from 'sweetalert'
// to add customer
export const startAddCustomer = (data) => {
return (dispatch) => {
axios.post('https://dct-billing-app.herokuapp.com/api/customers', data, {
headers: {
Authorization: `Bearer ${localStorage.getItem('token... | true |
25bad14a4df4d15ae073dcef7aa3a1fc7e766836 | JavaScript | bongadub/JavaScript-NodeJs | /node.js/scope.js | UTF-8 | 317 | 3.65625 | 4 | [] | no_license | var messageOne = "Hello from global variable"
function mySixthFunction(){
var messageTwo = "Hello from local variable"
console.log(messageOne);
console.log(messageTwo);
}
function mySeventhFunction(){
console.log(messageOne);
console.log(messageTwo);
}
mySixthFunction();
mySeventhFunction(); | true |
7d90cc61b5159a53d5270e0194fa2512425c2a6b | JavaScript | tetsuyakanda/tetsuyakanda.github.io | /src/components/citation/author.js | UTF-8 | 1,085 | 3 | 3 | [
"MIT"
] | permissive | import React from "react";
const jStyle = (author) =>
author
.map((a) => {
if (a.family === `神田` && a.given === `哲也`) {
return (
<span key={a.family} className="itsme">
{a.family} {a.given}
</span>
);
} else {
return a.family + ` ` +... | true |
4d28e52c6fa259471f1dad3436edc13e55cda6eb | JavaScript | chemaxa/testTasks | /userList/app/collection.js | UTF-8 | 4,376 | 3.15625 | 3 | [] | no_license | import config from './config';
let {
appName,
storage
} = config;
export default class Collection {
/**
* Creates an instance of Collection.
*
*
* @memberOf Collection
*/
constructor() {
this._elems = this._getFromStorage();
let
obj = this,
prop = '_elems',
oldValue ... | true |
27dd1509563a7a62d2bbe05ff9281f7e4ec163c0 | JavaScript | william175pasta/frontend-grow | /day16/index.jsx | UTF-8 | 701 | 2.671875 | 3 | [] | no_license | import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { useState } from 'react';
//狀態開關器
const App = () => {
const [open, setopen] = useState(true)
const [openText, setopenText] = useState("")
const onClickCountEvent = () => {
if (open) {
setopenText("開啟")
... | true |
65306eca8be3784eacddec5904f97afddd7e50b3 | JavaScript | SimonaArsova/TelerikAcademy | /Frond-end track/JS Fundamentals/ExamPreparation/GameOfTrolls.js | UTF-8 | 6,815 | 3.078125 | 3 | [
"MIT"
] | permissive | 'use strict';
function solve(args) {
const dimensions = args[0].split(' ').map(Number),
rows = dimensions[0],
cols = dimensions[1],
coordinates = args[1].split(';'),
wboTrollCoordinates = coordinates[0].split(' ').map(Number),
nbsTrollCoordinates = coordinates[1].split(' ').m... | true |
82468feb9e6fdf27dcc04a55f2839b1843362752 | JavaScript | raffaellapagano/base-ES6-modulos | /src/destructurarObjectos.js | UTF-8 | 305 | 3.125 | 3 | [] | no_license | const usuario = {
nombre: "Carlos",
correo: "correos@correo.com",
edad: 22,
profesion: "desarrollador"
}
const {nombre, correo} = usuario; //extraemos estos dos atributos
const mostrarInfo = ( { nombre, profesion = "estudiante"} ) => console.log(`${nombre} es ${profesion}`);
mostrarInfo(usuario); | true |
6c55cb339018f6631b5f431c6c6916151c8b7edf | JavaScript | David-Jiang/lotoo | /index.js | UTF-8 | 1,919 | 2.8125 | 3 | [] | no_license | import express from "express"
import bodyParser from "body-parser"
const app = express()
app.use(express.static(__dirname + "/dist"))
app.use(bodyParser.json())
app.all("/*", (req, res, next) => {
if (req.path.indexOf("api") > -1) {
next()
} else {
res.sendFile(__dirname + "/dist/index.html")
}
})
con... | true |
b68af3d20e038133393b3aeca00fa4082f4494a8 | JavaScript | willwalker753/yahtzee | /src/components/Scorecard.js | UTF-8 | 8,231 | 2.671875 | 3 | [] | no_license | import { Component } from 'react';
import initScoreData from './Constants';
import './scorecard.css';
class Scorecard extends Component {
constructor(props) {
super(props)
this.state = {
dice: [],
score: initScoreData,
rollMessage: 'Roll',
lastPrevie... | true |
f982320a8ba44d1f932b17560bbe5c398a9747e5 | JavaScript | ArnobMahmud/ECMAScript | /ES6/OOP/constructor.js | UTF-8 | 357 | 4.1875 | 4 | [
"BSL-1.0"
] | permissive | class MyClass{
constructor(x , y){ // value gained by constructor
this.num1 = x;
this.num2 = y;
}
addNum(){
var result = this.num1 + this.num2;
console.log("Sum is : " + result);
}
}
var setNum = new MyClass(12, 38); // object declare + send value by parameter
setNu... | true |
dd6d52cb920538996bcc0daebf14a63e61fbc9ce | JavaScript | akurtovic3/Hotel-App | /frontend/src/components/RoomsList.js | UTF-8 | 1,135 | 2.53125 | 3 | [] | no_license | import React, { useState } from "react";
import Room from "./Room";
const RoomsList = ({ rooms, props, idovi, brGostiju }) => {
const [postoji, setPostoji] = useState(false);
const [imaSoba, setImaSoba] = useState(0);
console.log(props)
console.log(idovi)
console.log(rooms)
console.log(props);
... | true |
489b8cce6e33570d258a38e61c8f5d2cd30bc283 | JavaScript | javi-PR/react-gifexpertapp | /src/components/GifGrid.js | UTF-8 | 1,281 | 2.53125 | 3 | [] | no_license | import React from 'react';
import { useFetchGifs } from '../hooks/useFetchGifs';
import { GifGridItem } from './GifGridItem';
export const GifGrid = ({ category }) => {
// const [images, setImages] = useState([]);
const { data:images, loading } = useFetchGifs( category );
// useEffect( ()=> {//lo usa... | true |
341cefdf3362eab49dbe5d9e45c79e6229a3451a | JavaScript | Adyen/adyen-3ds2-js-utils | /config/index.js | UTF-8 | 1,219 | 2.65625 | 3 | [
"MIT"
] | permissive | export const THREEDS_METHOD_TIMEOUT = 10000;
export const CHALLENGE_TIMEOUT = 600000;
// Re. EMV 3-D Specification: EMVCo_3DS_Spec_210_1017.pdf
export const challengeWindowSizes = {
'01': ['250px', '400px'],
'02': ['390px', '400px'],
'03': ['500px', '600px'],
'04': ['600px', '400px'],
'05': ['100%'... | true |
952849be56ba35ce31bdfc0f6e434f9866b4a7db | JavaScript | palVikas/myProgrames | /javaScriptWorksapace/my programe wc/04_wc/play.js | UTF-8 | 647 | 3.21875 | 3 | [] | no_license | var fs = require('fs');
var fd = fs.readFileSync('two.txt','utf8')
//console.log(fd)
// var count = 0;
// var b=fd.split('\r\n')
// console.log(b);
// var c= b.forEach(function(x){
// // console.log(x.split(''));
// x.split(" ").forEach(function(y){
// if(y!="")
// count++
// })... | true |
31ab1a6ea04bebb4bfbe723c12f55b4680b5cc80 | JavaScript | yang1004/learningCode | /007-css-middle/js/rem.js | UTF-8 | 578 | 2.546875 | 3 | [] | no_license | /*
* @Author: mac
* @Date: 2019-07-15 16:16:37
* @Last Modified by: mac
* @Last Modified time: 2019-07-15 16:26:39
*/
(function(win,doc){
var html = document.getElementsByTagName('html')[0];
function refres(){
//获取视口宽度
var width = doc.body.clientWidth || doc.documentElement.clientWidth;
//设置根元素fantasize为宽度/... | true |
41d684b7da93d6a0d1cdcd5f2838590a73992850 | JavaScript | joaogamarra/job-board | /.history/client/src/App_20210217183435.js | UTF-8 | 547 | 2.546875 | 3 | [] | no_license | import { useState, useEffect } from 'react'
import fetch from 'node-fetch'
import './App.css'
import Jobs from './components/Jobs'
const JOB_API_URL = 'http://localhost:3001/jobs'
const fetchJobs = async (updateCb) => {
const res = await fetch(JOB_API_URL)
const json = await res.json()
console.log(json.length)
... | true |
6f6d5d0ddf28473d5c3e598d6fb7870c72fd377a | JavaScript | ethanolx/Hangman-js | /js/word.js | UTF-8 | 8,649 | 3.71875 | 4 | [] | no_license | "use strict";
// import statements
const Utilities = require("./utilities");
const HangmanUtils = require("./hangmanUtils");
// represents each word in the game
class Word {
constructor(text = "", category = "No Category", definition = "No Definition", lives = 0) {
this.text = text; // th... | true |
b3e6b204715a18f3feb3330a31c7f18751eb159f | JavaScript | RaisulislamRimon/calculator | /javascript/index.js | UTF-8 | 494 | 3.359375 | 3 | [] | no_license | function insertNumber(number) {
var existingNumber = $("#result").val();
$("#result").val(existingNumber + number);
}
function clearResult() {
$("#result").val('');
}
function calculate() {
var calculationResult = eval($("#result").val());
$("#result").val("Ans : " + calculationResul... | true |
fad728f534406ded874d8ac1e6d68f4aae4818e7 | JavaScript | mikesson/math-api | /src/server.js | UTF-8 | 1,928 | 3.453125 | 3 | [] | no_license | const cors = require('cors');
const express = require('express');
const apiServer = express();
apiServer.use(cors({ origin: true }));
apiServer.get('/ping', (request, response) => {
response.send(
{'response' : 'pong' }
);
});
apiServer.get('/prime/:num', (request, response) => {
try {
var num = reque... | true |
d5090787843653df53b2090ddc2b7e2d46f9fd11 | JavaScript | wiikwik/WinkAcademy | /js-basics-objects-opdracht/index.js | UTF-8 | 3,182 | 3.296875 | 3 | [] | no_license | // let name = 'Mosh';
// let age=30;
// let isApproved = false;
// let firstName = undefined;
// let selectedColor = null;
let person = {
name: 'Victoria',
surName: 'Gontarik',
age: 38
}
console.log(person);
document.write(person.name,person.surName,person.age);
console.log(person.name);
console.... | true |
d175b4a6a7739fb78f52b842dcf1e3a9c328f6c2 | JavaScript | vexleet/JS-Core | /JS-Applications/AsyncProgramming-Exercise/FisherGame-02/app.js | UTF-8 | 3,818 | 2.578125 | 3 | [] | no_license | function attachEvents() {
const host = "https://baas.kinvey.com/appdata/kid_ryFRDggJ4/biggestCatches";
const auth = {'Authorization': `Basic ${btoa("guest:guest")}`, "Content-type": "application/json"};
$(".load").click(getCatches);
$(".add").click(addNewCatch);
function getCatches() {
$.a... | true |
69c29f37e8756d43f431c9915c63e6dead560bf9 | JavaScript | jeremiedubuis/Scales | /scales/src/sprites/SpriteAnimated.js | UTF-8 | 2,037 | 2.65625 | 3 | [] | no_license | import Sprite from './Sprite.js';
export default class SpriteAnimated extends Sprite {
constructor(img, size: Array<number>, animations: Array<Object>) {
super(img, size);
this.animations = {};
this.currentFrame = 0;
this.lastRenderedFrame = 0;
animations.forEach(this.addAn... | true |
1e4185fda53015ae65a24fcfd104f4794185796c | JavaScript | dandan1232/LeadingEndStudy | /JSStudy/random.js | UTF-8 | 261 | 3.375 | 3 | [] | no_license | /**
* JS随机数时间戳
* @returns {string}
*/
function uniqueId() {
var a = Math.random, b = parseInt;
return Number(new
Date()).toString() + b(10 * a()) + b(10 * a()) + b(10 * a());
}
console.log(uniqueId()); // 例如:1525075670818519 | true |
6c0c6a2f0e0b3ab8de0d52cc9d64a31cb0a82cbc | JavaScript | CruelCrow/klarna | /react_app/models/SearchResult.js | UTF-8 | 260 | 2.65625 | 3 | [] | no_license | import Person from './Person';
class SearchResult {
constructor(r = []) {
this.persons = [];
this.add(r);
}
add(r = []) {
this.persons = this.persons.concat(r.map(p => new Person(p)));
}
}
export default SearchResult; | true |
67edb003b9061e91ac86145fc06970143ef5d936 | JavaScript | felixkan1/cryptoWatch-fullstack | /client/src/chartConfigs/chartConfigs.js | UTF-8 | 2,259 | 2.890625 | 3 | [] | no_license | /* eslint-disable */
export const formatData = (coin, time) => {
const xValues = [];
const yValues = [];
let yMax = Number.NEGATIVE_INFINITY;
time.map((ele) => {
xValues.push(ele[0]);
yValues.push(ele[1]);
if (ele[1] > yMax) yMax = ele[1];
});
return {
labels: xValues,
datasets: [
... | true |
c5272c2709c004c0be79e1b63ec1b4b27c5fe9d9 | JavaScript | Rrishik/Library-management | /myscript.js | UTF-8 | 2,494 | 3.0625 | 3 | [] | no_license | var books={"Books":[
{"name":"INFERNO","author":"Dan Brown","price":"20","isbn":"128431K37"},
{"name":"DA VINCI CODE","author":"Dan Brown","price":"20","isbn":"143431K78"},
{"name":"THE HUNGER GAMES","author":"Suzanne Collins","price":"50","isbn":"729401K97"},
{"name":"HALF GIRLFRIEND","author":"Chetan Bhagat","price":... | true |
020f324873d8caedf2632066df14f7548a805f39 | JavaScript | sim-ware/yamlViewer | /back-end/server.js | UTF-8 | 353 | 2.5625 | 3 | [] | no_license | // require http modules first
const http = require('http');
// import app.js file
const app = require('./app');
// define port to be used
const port = process.env.PORT || 3100;
const server = http.createServer(app);
server.listen(port, () => {
// print message when the server runs successfully
console.log("S... | true |
dbc444e79b0c84c54f96b96b9e5a958672c4b10d | JavaScript | obrienke/Applied-Digital-Media-1 | /week7/Question2.js | UTF-8 | 485 | 3.625 | 4 | [] | no_license | let furlong = 8;
let miles = 1;
document.write(miles + " mile is " + (miles * furlong) + " furlongs<br>");
miles++;
while(miles <= 8){
document.write(miles + " miles is " + (miles * furlong) + " furlongs<br>");
miles++;
}
miles = 1;
document.write("<br><br><br><br> For Loop:<br><br>");
document.write(miles + " mil... | true |
d747653dad34d4dcf3a31ae125aeb9e9ac51d1c2 | JavaScript | verzetem/wd-ajax-hero | /js/untitled.js | UTF-8 | 551 | 3.03125 | 3 | [] | no_license | let button = document.querySelector("button")
let search = document.querySelector("input")
button.addEventListener("click", function(event) {
let sValue = search.value
event. preventDefault()
fetch("https://omdb-api.now.sh/?s=" + sValue)
.then((response) => response.json())
.then((res... | true |
3cf4dfbfb4d1d7d6c272720774e0cd893eb23e04 | JavaScript | remijn/Node-Pusher | /public/javascripts/GraphlrSocketClient.js | UTF-8 | 2,617 | 2.609375 | 3 | [] | no_license | //GraphlrSocketClient Version 1.0 24-11-2016
var GraphlrSocketClient = function(){
this.socket = null;
this.subscribed = [];
this.state = "disconnected";
this.routes = {};
};
GraphlrSocketClient.prototype.init = function(sessionid, environment){
var initdata = {
session: sessionid,
... | true |
335d6eda0874a40cfa74da8b1f31867ce4ff0381 | JavaScript | lucIO-IT/esri | /src/components/viewComponent.js | UTF-8 | 158 | 2.75 | 3 | [] | no_license | export function view(target, template){
var elem = document.getElementById(target);
elem.classList.add('viewBody');
elem.innerHTML = template();
} | true |
e654344af55ffbe1f7c0e9e4c4c67cfc586e667b | JavaScript | hackerwust/mini-vue | /src/compile/compileTextNode.js | UTF-8 | 1,043 | 2.90625 | 3 | [] | no_license | import Watcher from '../watcher/index.js';
export default function (node, vm) {
const textContent = node.textContent || '';
let subExprs = [];
// for example
// convert 年龄 + {{ user.name }} to "年龄" + vm.user.name
const expr = textContent
.replace(/\{\{([^\}]+)\}\}/g, (...args) => {
... | true |
88f67ea8d3d5eb02b49271976dff44c9966b4858 | JavaScript | DuyTan1605/client-caro-frontend | /src/actions/actionGetHistoryDetail.js | UTF-8 | 1,079 | 2.578125 | 3 | [] | no_license | import fetch from 'cross-fetch';
import ActionType from '../constants/actionTypes';
import config from '../config';
export function actionGetHistoryDetail(status, historyDetail) {
return {
type: ActionType.GET_HISTORY_DETAIL,
status,
historyDetail
};
}
export default function fetchHis... | true |
b4620854868324e7a69c3d61d1855804c7f22f46 | JavaScript | sbotiroff/CsClub | /public/js/dashboard/modules/faq.js | UTF-8 | 5,021 | 3.015625 | 3 | [] | no_license | var faqModule = (function () {
//faq
const faqs = document.createElement("div");
faqs.setAttribute("class", "admin-faq");
const faqAPI = {
basePath: "https://chelan.highline.edu/~sbotiroff/csclub/api/faqs",
}
// fetch all faq
function render() {
fetch.get(faqAPI.basePath, f... | true |