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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b21868867bb62e836c89383516b744879c2f3a2f | JavaScript | MykhailoMatiiasevych/aoc2019 | /day23/p1.js | UTF-8 | 1,171 | 2.828125 | 3 | [] | no_license | console.time('Day 23 part 1')
const readToLines = require('../common/readToLines')
const intcode = require('../common/intcode')
const input = readToLines('./input.txt')
const program = input[0].split(',').map(Number)
const out = []
const temp = {}
const comps = []
for (let i = 0; i < 50; i++) {
const inst = intco... | true |
2034fc486de77503e717536e31d4f2173b80c4bc | JavaScript | soo777/Algorithm | /src/programmers/가장 큰 수.js | UTF-8 | 223 | 3.5625 | 4 | [] | no_license | // 프로그래머스
// 가장 큰 수
const solution = (numbers) => {
let answer = '';
answer = numbers.map((num) => String(num)).sort((a,b) => (b+a) - (a+b)).join('');
return answer[0] === '0' ? '0' : answer;
}
| true |
6c56b3e819e8ffe619bb4a8f5172762ce4a28acb | JavaScript | zaid-tariq/PfaffHack | /core/index.js | UTF-8 | 3,701 | 2.640625 | 3 | [] | no_license | const express = require('express')
const app = express()
const port = 3000
const eventBroker = require('./eventBrokerConnector')({
brokerHost: '194.94.239.125', // use correct data
brokerPort: '9000', // use correct data
appName: 'Smart Commute',
appHost: '194.94.239.22',
appPort: '8884',
})
eventBroker.li... | true |
335d81a7ba71e1437e6692f4b1f424c937d78b96 | JavaScript | habaumugisha1/cc-calculator | /app.js | UTF-8 | 3,472 | 3.71875 | 4 | [] | no_license | const numberButtons = document.querySelectorAll('[data-number]');
const operationButtons = document.querySelectorAll('[data-operation]');
const equalsButton = document.querySelector('[data-equals]');
const deleteButton = document.querySelector('[data-delete]');
const allClearButton = document.querySelector('[data-all-c... | true |
6635f849cf79a793c3c28305d141ff34d36c5949 | JavaScript | guopingzhao/eams | /src/libs/util/print.js | UTF-8 | 1,358 | 2.953125 | 3 | [] | no_license | export function printDoc (printContent={}, style=["link", "style"]) {
let iframe = document.createElement("iframe")
iframe.style="display: none"
document.body.appendChild(iframe)
let head = iframe.contentDocument.head
let body = iframe.contentDocument.body
let {type="string", content} = printCon... | true |
644ed283168b798819f843c5707b9f725022ad52 | JavaScript | anushaballal/NodeJS | /routes.js | UTF-8 | 1,247 | 2.78125 | 3 | [] | no_license |
const fs = require('fs');
const requestHandler = (request, response) => {
const url = request.url;
const method = request.method;
if(url === '/'){
response.write('<html>');
response.write('<body><form action="/message" method="POST"><input type="text" name="message"><button type="submit">S... | true |
f700ecf219ec71f2de86e99cf94f0e1421c66e41 | JavaScript | YellRes/html | /miniprogram/miniTest/utils/cityList.js | UTF-8 | 2,139 | 2.59375 | 3 | [] | no_license | const app = getApp();
const util = require('util.js');
const navigate = require('navigate')
/**
* @param {function} [callback] 选中回调
* @param {String} [storageKey] 历史选择存储key
* @param {function} [getData] 异步获取数据 必传
* @param {array} [data] 列表数据 必传
* */
func... | true |
5565fcc8c8e7f203f009547439dfe78044fd8b3f | JavaScript | abm94/laboratory5 | /Lab5.js | UTF-8 | 1,902 | 3.390625 | 3 | [] | no_license | //Lab5.js
let green =document;
let list = document.getElementById("list");
let addButton = document.getElementById("addButton");
let inputItem = document.getElementById("itemInput");
let itemNumber = 0;
itemNumber=Number(itemNumber);
let newListItems=[];
let newCheckButtons=[];
let newDeleteButtons=[];
let ne... | true |
65deddc20d8ef9252b581f3483e3a15397a6c7b4 | JavaScript | choi8686/prismagram-frontend | /src/Components/App.js | UTF-8 | 1,210 | 2.609375 | 3 | [] | no_license | //GlobalStyles와 Theme를 불러서 사용하는 곳이다.
//Theme는 ThemeProvider를 통해서 컴포넌트에게 전달된다.
//GlobalStyles는 import 후 tag 형태로 작성해놓으면 적용된다.
//App.js는 함수형으로 제작되었다.
import React from "react";
import { gql } from "apollo-boost";
import GlobalStyles from "../Styles/GlobalStyles";
import styled, { ThemeProvider } from "styled-components"... | true |
e828f3cfe244d8b0662a21f435b6b364c5f9b8e6 | JavaScript | Chloe-blue/Tutorials | /Creating Custom Fields/Display Custom Field contents.js | UTF-8 | 4,011 | 3.3125 | 3 | [] | no_license | /*This snippet uses APIs to fetch data saved in custom fields that have been created for users. When it gets the data that is needed,
it displays it in a table.
Assumptions:
1. Custom Fields have already been created & saved
2. Custom Fields were for merchants only
3. A table has been created on the page where t... | true |
fec2a8632267a02177cb57602d1ad74a513ab2e3 | JavaScript | GGGE99/CA3Personal | /frontend/src/components/Profile.js | UTF-8 | 2,946 | 2.515625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import FACADE from "../facades/userFacade";
import "./css/Profile.css";
import NotLogedin from "./NotLogedin";
function Profile({ userInfo, setUserInfo, loggedIn }) {
const [user, setUser] = useState({ isEmpty: true });
const [newUserInfo, setNewUserInfo] = useS... | true |
12c0eaaf5c81d2fde591e6184ef844969d5f1bf2 | JavaScript | agj/agj-js | /tests/spec/function/autoCurry.js | UTF-8 | 785 | 3.15625 | 3 | [] | no_license |
define( function (require) {
'use strict';
var autoCurry = require('agj/function/autoCurry');
describe("function/autoCurry", function () {
var fn3 = function (a, b, c) {
return a / b / c;
};
var fn2 = function (a, b) {
return a / b;
};
it("creates a function to which you can pass arguments on... | true |
6bf27dbbe5f947993187d90082a5e9ca14e3c97c | JavaScript | donor-management-bw-1902/BackEnd | /data/seeds/donors.js | UTF-8 | 772 | 2.734375 | 3 | [
"MIT"
] | permissive | const faker = require("faker");
function createFakeDonor() {
return {
name: faker.name.findName(),
userID: Math.floor(Math.random() * 3) + 1,
email: faker.internet.email(),
city: faker.address.city(),
address: faker.address.streetAddress(),
zip: faker.random.number(),
lastContacted: faker... | true |
d413c82258200492122a8f31ad9e679cb1d02251 | JavaScript | imbaqian/imbaqian.github.io | /js/scripts.js | UTF-8 | 23,407 | 3.203125 | 3 | [] | no_license | var anime = function() {
var t = {
linear: function(t, e, n, r) {
return e + t / r * n
},
easeInQuad: function(t, e, n, r) {
return n * (t /= r) * t + e
},
easeOutQuad: function(t, e, n, r) {
return - n * (t /= r) * (t - 2) + e
},
... | true |
4df68406fdd3ac8788684ddffdbd19b07e6cd2b6 | JavaScript | lizziegitsham/interactive_map | /src/components/MapView.js | UTF-8 | 4,261 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react'
import MapComponent from './MapComponent'
import axios from 'axios'
class MapView extends Component {
constructor(props) {
super(props)
this.state = {
currentLatLng: {
lat: 0,
lng: 0
},
mark... | true |
35d09fbc68a0f4d643ea13d75fa4469ae28fa8ea | JavaScript | spartanhero93/moviedb-client | /client/src/redux/actions/index.js | UTF-8 | 2,850 | 2.53125 | 3 | [] | no_license | import {
fetchMoviesFromDatabase,
fetchTVFromDatabase,
querySearch,
fetchDetailedResultsFromDatabase,
fetchToken,
createSession,
removeSession,
} from '../../API/server'
import { newGuestSession } from '../../API/MovieDB'
/** Thunk */
export const fetchMovies = (urlName, pageNum = 1, total_pages) => asyn... | true |
7da1d5b2297527f4eba6539c71e37591781cf383 | JavaScript | laplandalone/HealthMobie | /WebRoot/pub/js/date.js | UTF-8 | 8,101 | 3.09375 | 3 | [] | no_license | $(function(){
var date = new Date(); //鏃ユ湡瀵硅薄
var now = null;
var before = null;
now = date.getFullYear()+"-";
if((date.getMonth()+1) < 10)
{
if((date.getDate() < 10))
{
now = now + "0" + (date.getMonth()+1)+"-";
now = now + "0" + date.getDate();
before = date.getFullYear()+"-";
befo... | true |
e5a42b6a795187acfbd33fd1008718aaae74d4d9 | JavaScript | diligejy/nodejs | /golden/ch7/board/utils/paginator.js | UTF-8 | 1,332 | 2.90625 | 3 | [] | no_license | const lodash = require("lodash"); // ❶ lodash 임포트
const PAGE_LIST_SIZE = 10; // ❷ 최대 몇 개의 페이지를 보여줄지 설정
// ❸ 총갯수총개수, 페이지, 한 페이지에 표시하는 게시물 개수를 매개변수로 받음
module.exports = ({ totalCount, page, perPage = 10 }) => {
const PER_PAGE = perPage;
const totalPage = Math.ceil(totalCount / PER_PAGE); // ❹ 총페이지 수 계산
// 시작 ... | true |
d106e7d972e1e508cd32ab63bc5845d985da3b64 | JavaScript | MrHecka/korone | /commands/manga.js | UTF-8 | 1,715 | 2.671875 | 3 | [
"MIT"
] | permissive | require('dotenv').config();
const axios = require('axios')
const { MessageEmbed } = require('discord.js');
const formatNumber = require('../helpers/numbering');
module.exports = {
name: 'k!manga',
description: 'Menampilkan statistik manga',
execute(msg, args) {
if(args.length < 1){
msg.channel.send('Si... | true |
548a7d760bdef59a4ec89dffa28245a8ad6341b9 | JavaScript | Ashleyduffy/HVM | /code.js | UTF-8 | 3,659 | 2.625 | 3 | [] | no_license | //open nav
$(document).ready(function() {
$('.toggleNav').click(function() {
$('#flex-nav ul').toggleClass('open');
});
});
$(document).ready(function() {
var id = '#dialog';
var maskHeight = $(document).height();
var maskWidth = $(window).width();
$('#mask').css({'width':maskWidth,... | true |
190255c105abc0ee7dadcc4dafc61630c7b7320b | JavaScript | Iancrix/CI-CD | /routes/products.js | UTF-8 | 6,991 | 2.65625 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const Product = require("../models/Product");
// Filter Products by any category
router.get("/:productType/filter", async (req, res) => {
const query = {};
if (req.query.searchfor) {
let regex = new RegExp(req.query.searchfor, "i");
query["na... | true |
3de44d37fbd607aafab18b061bd3f82622dd901a | JavaScript | IanSpringer/node-express-authentication | /public/main.js | UTF-8 | 932 | 2.6875 | 3 | [] | no_license | $(document).ready(function(){
console.log("hmmmm")
$('#location-btn').on("click", function(){
var location = $('#location-input').val();
if(location != ''){
$.ajax({
url: "http://api.openweathermap.org/data/2.5/weather?q=" + location + "&units=imperial&APPID=8c051d7ffccf2ab96aef8e3b478267a2",
... | true |
c486ccfd32421ee71e347e395cb7dadd84267c02 | JavaScript | guiilan/psel | /esteganografia.js | UTF-8 | 738 | 2.921875 | 3 | [] | no_license | const fs = require('fs')
const file = 'Syngenta.bmp'
const readStream = fs.createReadStream(file)
readStream.on('data', data => {
if(size===0){
/* Chegando se é BMP */
console.log(String.fromCharCode(data[0], data[1]))
}
size+= data.length
})
/* A mensagem escondida da ... | true |
9567b77d196b27df40d7d944125217761927f8e4 | JavaScript | SteeveDroz/wheel-of-misfortune | /resources/js/util.js | UTF-8 | 4,039 | 2.796875 | 3 | [
"MIT"
] | permissive | "use strict";
const isDisabled = function(id) {
return $('#group-display table tbody tr').eq(id).find('input').prop('checked')
}
const isTwiceInARow = function(id) {
return $('#twice-in-a-row').not(':checked').length > 0 && group.last === group.choices[id].name
}
const calculateParts = function() {
const... | true |
9548f1be039243e8606941efa4180ea417ce66f4 | JavaScript | eevan7a9/playground-code-challenge | /javascript/capitalize_letters.js | UTF-8 | 1,223 | 4.71875 | 5 | [] | no_license | // capitalize letters
// return a string with the first letter of every word to capitalize
// ex. dog is fat = Dog Is Fat
// first solution
function toCapitalize_sol_1(str) {
let capitalizeWords = [];
for (let i = 0; i < str.toLowerCase().split(" ").length; i++) {
const words = str.toLowerCase().split(" ")[i];... | true |
45ee98b2e81bcd5149ebebace0517a53d22166fb | JavaScript | umeshmore45/Blog-Render | /src/helper/toggledark.js | UTF-8 | 1,211 | 2.859375 | 3 | [] | no_license | export const toggleDark = () => {
const div = document.createElement("div");
div.classList.add("Toggle");
const divLi = document.createElement("div");
divLi.classList.add("light");
const input = document.createElement("input");
input.type = "checkbox";
input.classList.add("checkbox");
input.id = "chk";
... | true |
e6f6ccfec79a35e260e85bed8d7509cd828ab4ea | JavaScript | xirdneh/script-chain | /src/Script.js | UTF-8 | 14,581 | 2.65625 | 3 | [
"MIT"
] | permissive | /**
* @file script that contains multiple flags
* @exports Script
*
* @requires flipchain/ChainedMapExtendable
* @requires fliplog
* @requires flipglob
* @requires ./Flag
* @requires ./deps
*/
const ChainedMap = require('flipchain/ChainedMapExtendable')
const Flag = require('./Flag')
const {flipglob, insertAt... | true |
147e5a4c303dff22563f1382dfb9d063091cc850 | JavaScript | chrisharrington/showveoservicenode | /remote/movieServiceMapper.js | UTF-8 | 3,805 | 3.140625 | 3 | [] | no_license | //
// Maps movie information retrieved from http://themoviedb.org into a local movie model.
//
(function() {
//------------------------------------------------------------------------------------------------------------------
/* Data Members */
// A container for genre information.
var _genreRepository;
//-----... | true |
6648ae3dc2a7d8b8fa86ff88aafb8f592e60d5fd | JavaScript | mikejunt/group-project-1 | /rps.js | UTF-8 | 2,583 | 4.03125 | 4 | [] | no_license | (function () {
// establishes variable
let gamecounter = 0
let wincounter = 0
// button selectors
document.getElementById("rock").addEventListener("click", function () { game(1, 2, 0) });
document.getElementById("paper").addEventListener("click", function () { game(0, 1, 2) });
document.ge... | true |
701467c02e8af93428f7de2dea9154ac441de731 | JavaScript | PJ81/Trapper | /src/menu.js | UTF-8 | 1,052 | 2.5625 | 3 | [] | no_license |
class Menu extends State {
constructor() {
super();
this.floor = R.image(FLOOR);
this.man = new Hero();
this.start();
}
input(i) {
window.dispatchEvent(new CustomEvent("stateChange", {
detail: GAME
}));
}
update(dt) {
this.man.... | true |
a34e82b61f6c81641c35844d9c1f99d4221a5f32 | JavaScript | deepanprabhu/plynx | /ui/src/components/Common/passwordUtils.js | UTF-8 | 503 | 3.265625 | 3 | [
"Apache-2.0"
] | permissive | export function validatePassword(password) {
const regex = [
"[A-Z]", // For Uppercase Alphabet
"[a-z]", // For Lowercase Alphabet
"[0-9]", // For Numeric Digits
];
let passed = 0;
// Validation for each Regular Expression
for (let i = 0; i < regex.length; i++) {
if ((new RegExp(regex[i]))... | true |
6fc1d38417b807caad875599d60c7bef7aba07bb | JavaScript | Mr-Rakshit/react_baseapp | /server/router/auth.js | UTF-8 | 4,873 | 2.640625 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const bcrypt = require("bcryptjs");
const jwt = require("jsonwebtoken");
const authenticate = require("../middleware/authenticate");
require("../db/conn");
const User = require("../model/userSchema");
router.get("/", (req, res) => {
res.send(`Hello ... | true |
7ed0400dbb2533a3b0d8b62bed3aab1264597ac1 | JavaScript | BenSheridanEdwards/Makers_Notes_JS | /spec/note-controller-spec.js | UTF-8 | 2,671 | 3.078125 | 3 | [] | no_license | describe('Note Controller', () => {
it('Instantates with a note list object', () => {
expect(changeHTML.noteList).isInstanceOf(NoteList)
})
it('Instantates with a empty note list object', () => {
list = changeHTML.noteList.list
expect(list).toBeEmpty(list)
})
describe('.insertNoteList', () ... | true |
6a75f30db20c86996a86cd84e8bb5c3c6f09dc1b | JavaScript | aphunk/highspot | /src/components/CardsList.js | UTF-8 | 3,243 | 2.609375 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import './CardsList.css';
import sortBy from 'lodash/sortBy';
const mtg = require('mtgsdk');
const CardsList = ({ error, loading, loadingComplete, searchTerm, sortCardsBy }) => {
const [page, setPage] = useState(0);
const [all... | true |
ee17b6a261b68c84aeadbd1fb1641e7c1be0c576 | JavaScript | sidinsomniac/fullstackopen | /part6/redux-anecdotes/src/reducers/filterReducer.js | UTF-8 | 324 | 2.59375 | 3 | [] | no_license | const filterReducer = (state = '', action) => {
switch (action.type) {
case 'FILTER_ANECDOTES':
return action.filterText;
default:
return state;
}
};
export const filterAnecdotes = val => ({
type: 'FILTER_ANECDOTES',
filterText: val
});
export default filterRedu... | true |
ceba58aaf2719f8fccb4662074f7e8f2ce4e3b52 | JavaScript | Tony001sa/Site | /javascript/main.js | UTF-8 | 960 | 2.671875 | 3 | [] | no_license | $(document).ready(function(){
"use strict"
$("input[name=email]").blur(function(){
if($(this).val() != ''){
var email_pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,6})+$/;
if(!email_pattern.test($(this).val())){
$('#error_email_message').text('Неправильный формат');
$('input[typ... | true |
db4a67a745b24bb33e27014521930a9cfc0aba34 | JavaScript | RobertUmanita/WebNowPlaying-BrowserExtension | /Websites/AmazonMusic.js | UTF-8 | 10,249 | 2.9375 | 3 | [] | no_license | //Adds support for Amazon Music
/*global init createNewMusicInfo createNewMusicEventHandler convertTimeToString capitalize*/
var lastVolume = null;
var lastBigCover = "";
var lastSmallCover = "";
var useBigCover = false;
//Amazon's new volume for some stupid reason only goes up to 93.75, They should be grateful I wa... | true |
69f9a3fa336a76c5da82759157ab012295a6cf3d | JavaScript | StevieReyJuan/parks-api | /index.js | UTF-8 | 2,666 | 3.09375 | 3 | [] | no_license | const apiKey = 'Oyr4VwOuUH1wIQTner8u3i8AxCXaz4L0UH41BCmd';
const baseUrl = 'https://developer.nps.gov/api/v1/parks';
//use header X-Api-Key OR parameter api_key=
function displayResults(responseJson) {
//if responseJson.total===0
for(let i = 0; i < responseJson.data.length; i++) {
$('#results-lis... | true |
5adfffb81dc1ee048a037abdaf8a27f86ad33cb4 | JavaScript | tedinGH/yqq | /otc2/src/tools/crypto.js | UTF-8 | 2,115 | 2.75 | 3 | [] | no_license | import CryptoJS from "crypto-js";
import { Config } from "@/common/config"
export const Crypto = {
/**
* 检查并补充加密串长度至少8位
* @param { string } str 需要操作的字符串
* @returns { string } 处理后的字符串
*/
checkKey(value) {
if (!value) {
value = Config.publicSecret;
}
value += "";
var str = ""... | true |
198d4cf4297ca829c0e81bdc890e3ee1fc292754 | JavaScript | KMarshland/video-to-serial | /main.js | UTF-8 | 3,975 | 2.703125 | 3 | [] | no_license | const fs = require('fs');
const Image = require('./image.js');
const Video = require('./video.js');
const sleep = require('./sleep.js');
const mockArduino = process.argv.includes('--test') || process.argv.includes('-t');
const printReturns = process.argv.includes('--print') || process.argv.includes('-p');
const quietM... | true |
028f184eab1d8ada134d9b78b9afc6e477681901 | JavaScript | ashwikakotian/virtual-pet-1 | /sketch.js | UTF-8 | 936 | 3.390625 | 3 | [] | no_license | //Create variables here
var dog ,happyDog,dogImg
var database
var foodS , foodStock
//var count=0
function preload()
{
//load images here
happyDog=loadImage("happydog.png")
dogImag=loadImage("Dog.png")
}
function setup() {
createCanvas(800, 700);
dog =createSprite(400,350,20,20)
dog.addImage(dogIm... | true |
fc6fe8db05d3ac9b57ea01b1a3db5d64ad014aa9 | JavaScript | aflupton/Euler.js | /src/js/fibonacci.js | UTF-8 | 328 | 3.59375 | 4 | [] | no_license | // export function Fibonacci(number1, number2) {
// this.number1 = number1;
// this.number2 = number2;
// }
//
// Fibonacci.prototype.checkType = function() {
// var sum;
// var number1 = 1;
// var number2;
// if(number1 < 2) {
// return 1;
// } else {
// return (number2 - 2) + (number1- 1);
// ... | true |
d083bfbbc9ad16adf0620ee4c5cda00db97a956b | JavaScript | brunofray/FlexBlog | /js/app.js | UTF-8 | 804 | 2.65625 | 3 | [] | no_license | const buttonBackToTop = document.getElementById('backToTop');
window.onscroll = () => { scrollFunction() };
function scrollFunction() {
if ( document.body.scrollTop > 100 || document.documentElement.scrollTop > 100 ){
buttonBackToTop.style.display = "flex";
}
else {
buttonBackToTop.style.d... | true |
22dde67ef0fdc5b922e7b803e2ea2e72ecf498b2 | JavaScript | ROCKY-SAM/react-movie-hub | /src/DataFetching.js | UTF-8 | 3,369 | 2.5625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import axios from 'axios';
function DataFetching() {
const [posts, setPosts] = useState([]);
const [page, setPage] = useState(1);
const [isFetching, setIsFetching] = useState(true);
useEffect(() => {
window.addEventListener('scroll', handleScro... | true |
947c23072abd86fbc84ab3ba682226144836d449 | JavaScript | soskgo/JavaScript | /objectDestructuring.js | UTF-8 | 386 | 3.734375 | 4 | [] | no_license | // Object Destructuring
const person = {
name:'sangMin',
age:26
}
// bad code
function displayPerson(person) {
displayName(person.name)
displayAge(person.age)
}
// good code
function displayPerson(person) {
const {name,age} = person // person.name , person.age 처럼 할 필요없이 변수에 할당하여 사용
displayNa... | true |
a62a082debfe4f2155c0e55f94008b93acf0758b | JavaScript | luyandamncube/Camagru | /js/forgot_pass.js | UTF-8 | 1,217 | 2.65625 | 3 | [] | no_license | window.addEventListener("DOMContentLoaded",function() {
document.getElementById("forgot_pass").addEventListener('click', function(){
var username = document.querySelector("textarea[name='loginname']");
if(username.value.length < 3)
{
username.style.border = "1px solid red... | true |
b28f1c3b54144b1cf0aac74522abf6f9c2ea3a97 | JavaScript | toshikurauchi/ep2-dessoft-2021-1 | /pages/index.js | UTF-8 | 4,022 | 2.6875 | 3 | [] | no_license | import React, { useState, useEffect, useRef } from "react";
import styled from "styled-components";
import Terminal from "../src/components/Terminal";
import Text from "../src/components/Terminal/Text";
import TextInput from "../src/components/Terminal/TextInput";
import { textoInicial, passoInicial } from "../src/game... | true |
359dcca5429ae7dc7f89b640fb9689cb6ed5e8b9 | JavaScript | FCastilloSorani/freeCodeCamp | /javascript-algorithms-datastructures/caesarsCipher.js | UTF-8 | 651 | 3.34375 | 3 | [] | no_license | function rot13(str) {
/*
A B C D E F G H I J K L M
| | | | | | | | | | | | |
N O P Q R S T U V W X Y Z
*/
const AM = "ABCDEFGHIJKLM".split('');
const NZ = "NOPQRSTUVWXYZ".split('');
let char = str.split('');
let res = [];
let regex = /\W/;
for (let i = 0; i < char.... | true |
74cc0a6741a04efeef7c5b416cb43daf37f194ce | JavaScript | Clem-ent17/Quiz-test | /script.js | UTF-8 | 4,793 | 3.46875 | 3 | [] | no_license | //Variables to access html elements
var startButton = document.getElementById('start')
var questionsEl = document.getElementById('questions')
var choicesEl = document.getElementById('choices')
var feedbackEl = document.getElementById('feedback')
var submitButton = document.getElementById('submit')
var initialsEl = docu... | true |
0f112cb29e2084beb1ef0d3220967abd92a1e58f | JavaScript | iTechJ/passport-js | /public/js/facebook.js | UTF-8 | 1,058 | 2.546875 | 3 | [] | no_license | (function (d, s, id) {
let js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.12&appId='
+ document.head.querySelector("[name=facebook-signin-client_id]").content
+ '... | true |
cc25215f8eafe86a4063f22730a6ba49e17ed1e3 | JavaScript | cullanshewfelt/Psychic-Game | /assets/javascript/game.js | UTF-8 | 1,478 | 3.421875 | 3 | [] | no_license |
var choices = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
var maxGuesses = 8;
var wins = 0;
var losses = 0;
var userInputs = [];
var ran = parseInt(Math.random() * 100) % 26;
var randomLetter = choices[ra... | true |
3c764febbc2058450055ffdca57866fe5db4df7e | JavaScript | TristanDongMaster/react-ui | /util/clearSpace.js | UTF-8 | 309 | 3.1875 | 3 | [] | no_license | //清除字符串内部的空格
export default function clearSpace(str){
var result = [], len = str.length;
for(var i = 0; i < len; i++){
if (str[i] == ' ') {
continue;
}
result.push(str[i]);
}
return result.join('');
} | true |
24d5b5a9c303a97b18ae329288ea55170f48482d | JavaScript | wjpjw/langui | /src/js/util/context.js | UTF-8 | 3,055 | 2.8125 | 3 | [] | no_license | //Some drawing basics
Langui.SetStrokeColor = function(color = "#000") {
Langui.ctx.strokeStyle = color;
};
Langui.SetStrokeWidth = function(width = 1) {
Langui.ctx.lineWidth = width;
};
Langui.ClearStrokes = function() {
Langui.ctx.clearRect(0, 0, $(window).width(), $(window).height());
};
Lang... | true |
14fbdcd48e2c26fed1df92e29da25655324f866e | JavaScript | saitheexplorer/literature | /src/actions/cpu.js | UTF-8 | 4,930 | 2.671875 | 3 | [] | no_license | import { shuffle } from 'lodash';
import { Map } from 'immutable';
import askPlayer from '../actions/question';
import tryToDeclareSet from '../actions/set';
import { passTurnToNextTeammate } from '../actions/turn';
import {
removePlayerFromPossibleOwners,
simplifyPossibleOwners,
} from '../utils/memory';
export... | true |
0c4009a8d5eb72021714d13b50baaa79098e137b | JavaScript | PrzemShien/AJAX | /js/ajax.js | UTF-8 | 3,081 | 3.1875 | 3 | [] | no_license | 'use strict';
var Namespace = {};
Namespace.AJAX = function(config){
if(!(this instanceof Namespace.AJAX)){
return new Namespace.AJAX(config);
}
this._options = {
type: config.type || 'GET',
url: config.url || window.location.href,
data: config.data |... | true |
4dc5a92c1c8bff679ed6142086dec7bbabd3449d | JavaScript | daanybarbosa/Tschool---UNASP | /backend/src/controllers/ClassController.js | UTF-8 | 2,265 | 2.515625 | 3 | [] | no_license | const connection = require('../database/connection');
module.exports = {
async index(req, res){
const id_school = req.headers.authorization;
const classes = await connection('class').where('id_school', id_school).select('*').orderBy('nameclass');
return res.json(classes);
},
async... | true |
deaea6583493d973284d31588d34cdab22657bd5 | JavaScript | rifatcholakov/JS-Core-Module | /{1} JS Fundamentals (Course)/[05] Exercise Syntax, Operators and Logic Flow/Data Expressions Statements - Exercises/p08_ImperialUnits/imperial-units.js | UTF-8 | 174 | 2.984375 | 3 | [
"MIT"
] | permissive | function unitConversion(inches) {
let feet = Math.floor(inches / 12);
let inchesRemaining = inches % 12;
return feet + "'" + "-" + inchesRemaining + "\"";
} | true |
68bccd399a61f8a05d45da380b1da62685483d6b | JavaScript | bren2102/Wizter_js | /src/modules/scenes/instructionsScene.js | UTF-8 | 1,893 | 2.53125 | 3 | [] | no_license | import instructionsBackground from '../../assets/instructionsBackground.png';
import homeButton from '../../assets/homeButton.png';
import Wizard from '../characters/wizard';
import Orc from '../characters/orc';
import Goblin from '../characters/goblin';
/* eslint-disable */
class InstructionsScene extends Phaser.Scen... | true |
7a7c88644d8d50dea562629ee1a61ac61913e8b0 | JavaScript | kaitlynmcgoldrick/aoc-2020 | /day6/part2.js | UTF-8 | 584 | 3.140625 | 3 | [] | no_license | const fs = require("fs");
const countIfYesInAllArrays = (nestedArray) => {
if (typeof nestedArray[0] === "string") return nestedArray.length;
return nestedArray.reduce((acc, curr) => {
return acc.filter((value) => curr.includes(value));
}).length;
};
const array = fs
.readFileSync("day6/data.txt", "utf8")... | true |
cce0bed91942c285e7364ec69d09da3f4ef2df50 | JavaScript | roman82direct/JS_level1 | /script.js | UTF-8 | 1,576 | 2.734375 | 3 | [] | no_license | <<<<<<< HEAD
// function replace(a, b) {
// var a, b;
// a += b;
// b = a - b;
// a -= b;
// document.write("<br>Теперь:<br> Переменная a = " +a +"<br>Переменная b = " +b);
// }
// replace(a, b);
function replace() {
var a = parseInt(document.myForm.varA.value);
var b = parseInt(docum... | true |
c72a96c23455333aabf81eaa5abef9ed16177510 | JavaScript | BrandonCookeDev/smashgg-api-cors-lambda | /server/lib/smash.js | UTF-8 | 2,081 | 2.84375 | 3 | [] | no_license | 'use strict';
const smashgg = require('smashgg.js');
class Smash{
static tournament(req, res){
// /name, expands
try{
let tournamentName = req.body.tournamentName;
let expands = req.body.expands;
let Tournament = new smashgg.Tournament(tournam... | true |
d38e861d09ccbd007c8d455ce45f75ff33549eea | JavaScript | tongchaimd/intranet | /public/sessions.js | UTF-8 | 621 | 2.75 | 3 | [] | no_license | function begin() {
const signOutElem = document.querySelector('#sign-out');
if (signOutElem) {
signOutElem.addEventListener('click', () => {
fetch(new URL(signOutElem.dataset.target, window.location.href), {
method: 'DELETE',
credentials: 'same-origin',
redirect: 'follow',
})
.then((res) => {
... | true |
7c6deda9a7a61f61da1e64776334deffda03ce6a | JavaScript | ingridclaire/data-structures-algorithms | /problemSolving-patterns/multiplePointers.js | UTF-8 | 1,062 | 4.3125 | 4 | [] | no_license | // writre a function called sumZero which acepts a sorted array of integers. The function should find the first pair where the sum is 0. Return an array that includes both values that sum to zero or undefined if a pair does not exist.
// set right and left start indices
// set result empty array
// loop the length of ... | true |
369b3aff56ec70ae1d0247ebc05dcac0aabcb5d7 | JavaScript | josue1497/tutorialTypeScript | /js/class1.js | UTF-8 | 388 | 3.359375 | 3 | [] | no_license | "use strict";
var Calculadora = /** @class */ (function () {
function Calculadora(value) {
console.log("Inciiando calculadora...");
this.numero = value;
console.log();
}
Calculadora.prototype.sumar = function () {
return this.numero + this.numero;
};
return Calculador... | true |
27792ff220710100106911124c4567944553b85a | JavaScript | luiz-gustavo0/countries-app | /src/pages/Home/index.jsx | UTF-8 | 2,000 | 2.59375 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import axios from 'axios';
import { ReactComponent as IconLupa } from '../../img/search.svg';
import * as S from './styles';
import { Card } from '../../components/Card';
export const Home = () => {
const [coutries, setCoutries] = useState([]);
const [loading, s... | true |
4e5128154bf631eeb1c20863c63823c738ffa950 | JavaScript | errnox/some-js-things | /reactive-programming-example/res/javascripts/reactive.js | UTF-8 | 418 | 3.03125 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
function setA(){ // A=X+Y as integers
var A = parseInt($('#X').text()) + parseInt($('#Y').text());
$('#A').text( A );
}
setA(); // for initial value of A
$('#X,#Y').css('cursor','pointer').click(function(){
// by reaction to a click at X or at Y...
var obj = $(th... | true |
4574ee36c0d69081e9c22b2d9fee078046c481d4 | JavaScript | AlexeyZvezdin/clever-house-frontend | /js/scripts.js | UTF-8 | 872 | 2.625 | 3 | [] | no_license | let btns = document.getElementsByClassName("wg_head");
// Тривиальное решение, конечно, но времени на раздумья нет.
for (let i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function() {
let current = document.getElementsByClassName("w_active");
current[0].className = current[0].className.replace(... | true |
399ca3d38dbe7990723a5255e8a4644e73792f5e | JavaScript | Samson971/castle | /chateauv2.js | UTF-8 | 2,409 | 2.8125 | 3 | [] | no_license | {
let Promise = require('promise');
let rp = require('request-promise');
var request = require('request');
var cheerio = require('cheerio');
const fs = require('fs');
var ListHotels = [];
function GetListHotels() {
var options = {
method: 'POST',
uri: 'https://www.relaischateaux.com/fr/site-map/etab... | true |
a4992eabb17a9ca7a8aaf1c0173750a2aa4036d3 | JavaScript | DEJENERUTA/next-portfolio-project | /script.js | UTF-8 | 611 | 2.984375 | 3 | [] | no_license | //Read more about page
const hobby = document.querySelector("#hobby");
const languages = document.querySelector("#languages");
const knap = document.querySelector("#moreButton");
knap.addEventListener("click", showHide);
function showHide() {
if (hobby.style.display != "block" && languages.style.display != "b... | true |
52c66d1e436d4686ae4ef705bf8014720b713ffc | JavaScript | hiden52/TIL | /JavaScript/async/async-await.js | UTF-8 | 1,991 | 4.375 | 4 | [] | no_license | // async & await
// Syntatic sugar
// clear style of using promise
// 1. async
// function fetchUser() {
// //do network request in 10 secs...
// return new Promise((resolve, reject) => {
// //return "hiden52"; // Be pending forever with out resolve
// resolve("hiden52");
// });
// }
// R... | true |
18188ae3dc4ed1e7964b3c4705e227258deda1d6 | JavaScript | MustafaRaad/Monser-Slayer-VueJS-Game | /js/app.js | UTF-8 | 2,181 | 3.078125 | 3 | [
"MIT"
] | permissive | new Vue({
el: "#app",
data: {
isRunning: false,
monsterHealth: 100,
playerHealth: 100,
turns: [],
},
methods: {
startGame() {
this.isRunning = true;
this.monsterHealth = 100;
this.playerHealth = 100;
this.turns=[];
... | true |
e6f53208a2ece06840ddb62f885f8a7a51fec785 | JavaScript | adsjkqhaoran/node-pri | /normal/http/getPost/getPost.js | UTF-8 | 1,007 | 2.71875 | 3 | [] | no_license | let http = require('http');
let url = require('url');
let superagent = require('superagent');
let qs = require('querystring');
//获取post 和 get 数据的方法
//这里使用superagent来模拟请求
var httpServer = http.createServer(function(request,response){
if(request.method == 'POST'){
var body = '';
request.on('data', fu... | true |
0ce361c25bf405977b3f0626504d1b5174191a09 | JavaScript | storywr/fantasy-stats | /src/ducks/redditNews.js | UTF-8 | 2,084 | 2.890625 | 3 | [] | no_license | // Action types
const BEGIN_NFL_NEWS = 'BEGIN_NFL_NEWS_FETCH'
const BEGIN_FF_NEWS = 'BEGIN_FF_NEWS_FETCH'
const BEGIN_DYNASTY_NEWS = 'BEGIN_DYNASTY_NEWS_FETCH'
const NFL_NEWS = 'FETCH_NFL_NEWS_SUCCESS'
const FF_NEWS = 'FETCH_FF_NEWS_SUCCESS'
const DYNASTY_NEWS = 'FETCH_DYNASTY_NEWS_SUCCESS'
// Reducer
const initialS... | true |
073cda67ec5055d7aa7bfd543b923332b3503041 | JavaScript | darianesquivel/6-Jarrones---Javascript | /js/main.js | UTF-8 | 8,608 | 3.421875 | 3 | [] | no_license | //para implementar api y traer el valor del dolar.
async function fetchImprimir() {
imprimirDolar(null);
const dato = await precioDolar();
imprimirDolar(dato);
}
async function precioDolar() {
const dolar = await fetch(
"https://www.dolarsi.com/api/api.php?type=valoresprincipales"
)
.then((res) => r... | true |
fe1183a403a90da56780a298c3a15de1f502af3b | JavaScript | giogalbuchi/nutritiva-website | /src/components/auth/signup.js | UTF-8 | 1,625 | 2.6875 | 3 | [
"MIT"
] | permissive | import React, { Component } from "react";
import { auth } from '../../firebase';
export default class Signup extends Component {
constructor(props) {
super(props);
this.state = {
email: "",
password: "",
errorText: ""
};
this.handleChange = thi... | true |
af0e0ed0787ee257239f7b44cd63730ac4914ca8 | JavaScript | CapuM/CloudProject | /frontend/src/reducers/CompanyReducer.js | UTF-8 | 500 | 2.609375 | 3 | [] | no_license | // const getCompanies = () => ({
// type: 'companies/getCompanies',
// payload:
// })
export const addCompany = company => ({
type: 'company/addCompany',
payload: company
});
export const defaultState = {
companies: []
};
export const reducer = (state = defaultState, action = {}) => {
switch (action.type... | true |
b861a2f20e49bed634a7114b6d971fa11db1baa6 | JavaScript | xiesj/expressway | /exceltool/index.js | UTF-8 | 1,088 | 2.5625 | 3 | [] | no_license | const fs = require('fs')
const xlsx = require('node-xlsx')
if (process.argv[2]) {
var filepath = process.argv[2]
console.log(filepath)
if (fs.existsSync(filepath)) {
var sheets = xlsx.parse(filepath)
if (sheets) {
for (var i in sheets) {
var sheet = sheets[i]
var data = sheet.data
... | true |
f639bf86d94a430c56045e52ba833640103f1dc9 | JavaScript | jbnv/firehash | /spec/extract-spec.js | UTF-8 | 954 | 3.0625 | 3 | [] | no_license | var Firehash = require("../index");
var collection = {
tic: {blah:"foo",yada:"qwerty"},
tac: {blah:"foo",hoot:"asdf"},
toe: {blah:"bar",burp:"zxcv"},
tug: {hoot:"12345"}
}
describe("extract()", function() {
var hash = new Firehash();
hash.extract("blah",collection);
it("pulls out an object with keys '... | true |
c213f1100f870fe659685d49c5595119214a9d66 | JavaScript | lennon-mawele/stateware | /src/createState.js | UTF-8 | 4,153 | 3.296875 | 3 | [
"MIT"
] | permissive | /**
* Set cache value of a given key on a given state
*
* @param state
* @param cacheKey
* @param value
*/
export function setCacheValue(state, cacheKey, value) {
Object.defineProperty(state, cacheKey, { enumerable: false, value })
// decrement computations left
state.__computationsLeft__--
// if there'... | true |
f616aa9ce34b5b3b2fa139a2753656421d66a86c | JavaScript | zerrin-gif/day8910Projects | /9.Day Projects/03-Staff Administration/script.js | UTF-8 | 1,122 | 3.21875 | 3 | [] | no_license | console.log(staff);
staff[2].lastName;
console.log(staff[2].lastName);
for(let i = 0; i < staff.length; i++) {
//console.log(staff[i].lastName);
staff[i].email = staff[i].lastName + '@google.com';
};
console.log(staff);
// function fullName (){
// for(let i = 0; i < staff.length; i++) {
// staff.fullName = staff[i]... | true |
8040dc66ba76ada270c4de7e5fc05210ae7902eb | JavaScript | AhmadAlYaaqba/Python-twitter | /static/js/App.jsx | UTF-8 | 2,674 | 2.671875 | 3 | [] | no_license | import React from 'react';
import $ from 'jquery';
import {Button, Panel, Grid, Col, Row} from 'react-bootstrap';
class App extends React.Component {
constructor(props) {
super(props);
this.state= {
data:[],
prev: false
}
this.changeTweetsPrev = this.changeTweetsPrev.bind(this);
this.... | true |
ca818c83bdbc0e37c3c2b3e9052cc8d74ce6e57e | JavaScript | devjaymoe/React-Redux-App | /app/src/store/actions/index.js | UTF-8 | 784 | 2.5625 | 3 | [] | no_license | import axios from 'axios';
export const FETCH_CHARACTERS_START = 'FETCH_CHARACTERS_START';
export const FETCH_CHARACTERS_SUCCESS = 'FETCH_CHARACTERS_SUCCESS';
export const FETCH_CHARACTERS_FAILURE = 'FETCH_CHARACTERS_FAILURE';
export const characterRequest = name => dispatch => {
// console.log(name)
dispatch... | true |
40284f4e70106280088385f837fa875b937cb8a8 | JavaScript | sigmeh/worms | /worms.js | UTF-8 | 8,985 | 2.59375 | 3 | [] | no_license | var followingMouse = false, mouseIsDown = false, r = 1, g = 0, b = 0, colorAscending = true;
var height = 0, width = 0, sizeAscending = true, wormDone = false;
var wormArray = [], singleWormDataArray = [], totalWormDataArray = [];
var wormId = 0, wormNumber = 0, doNotDraw = false, changingColor = false;
var segmentCou... | true |
c31c64704c7afbf165e3443601df75c912cea3a4 | JavaScript | mwanji/anniversaires.ezana.net | /index.js | UTF-8 | 11,410 | 2.640625 | 3 | [] | no_license | import {directive, html, render} from './web_modules/lit-html.js';
import {repeat} from './web_modules/lit-html/directives/repeat.js';
import {styleMap} from './web_modules/lit-html/directives/style-map.js';
import dayjs from './web_modules/dayjs/esm/index.js';
import './web_modules/dayjs/esm/locale/fr.js'
dayjs.local... | true |
a4f0482908a4e1b2f3a4b5eb5b1c41b84dabaaa3 | JavaScript | SooHwanIT/hanriver | /src/reducer.js | UTF-8 | 614 | 2.640625 | 3 | [] | no_license | const initalState = {
status:'SUCCESS',
data:{
temp : '',
time : ''
}
}
const reducer = (state = initalState, action)=>{
switch(action.type){
case 'REQUEST_PENDING':
return{
...state,
status: 'PENDING'
}
case 'REQUEST_SUCCESS' :
... | true |
80c8aaa610668f560a25f913320c2e0d9b7d94eb | JavaScript | ssslavev/Superauto | /data/users-data.js | UTF-8 | 2,058 | 2.640625 | 3 | [
"MIT"
] | permissive | const mongodb = require('mongodb');
const CryptoJs = require('crypto-js');
const sha1 = CryptoJs.SHA1;
module.exports = (data) => {
function create(user) {
const Validate = require('./data-validator');
const validatorInst = new Validate();
if (!validatorInst.validateUser(user)) {
... | true |
ac22a6d818d00784b6e5081aa40cd7cb861ed7a8 | JavaScript | storehubnet/postcodejs | /__tests__/index.test.js | UTF-8 | 7,063 | 2.8125 | 3 | [
"MIT"
] | permissive | /* eslint-env jest */
const postcode = require('../index');
describe('postcodejs:Errors:jest', () => {
test('postcodejs:cannotFindPostcode', () => {
const countryCode = 'MY';
const postcodeToSearch = 'LS29AU';
expect(() => {
postcode.postcode(countryCode, postcodeToSearch);
... | true |
ea51534f8d806426d8515646974189743e78ff63 | JavaScript | boazblake/DOM | /main.js | UTF-8 | 4,455 | 2.765625 | 3 | [] | no_license | document.querySelector("#thanks button").addEventListener('click', function() {
alert("yowch! don't click me so hard!")
})
document.querySelector("#double button").addEventListener('click', function() {
// alert("yowch! don't click me so hard!")
var doubleNum = document.querySelector("#compoundInvestment")... | true |
d557d68a60c13f040d0902c9963c059c9a163e13 | JavaScript | Serviz/-learning-to-write-in-js | /DOM/Dom.js | UTF-8 | 1,005 | 3.234375 | 3 | [] | no_license | /*alert('hello')
var newHeadingText = prompt("Введите новый заголовок:");
$("#main-heading").text(newHeadingText);
for (var i = 0; i < 3; i++) {
var hobby = prompt('Введите ваше хобби')
$("body").append("<p>" + hobby + "</p>")
}*/
/*for (var i = 0; i < 5; i++) {
$("h1").slideUp(1000).slideDown(1000)
}
$("p").sho... | true |
e6ca89cad31af5ffc45316fab8a4fac18142feff | JavaScript | siddharthkp/react-ui | /packages/docs/src/pages/core-concepts/motivation.js | UTF-8 | 17,566 | 2.515625 | 3 | [] | no_license | import React from 'react'
import { Stack, Element, Text, Link, Image, Button } from 'react-ui'
import { Page, Example, Section, Para, Code } from '../../components'
const Documentation = () => {
return (
<>
<Text
size={3}
color="yellows.700"
marginBottom={16}
css={{ fontStyl... | true |
7b0be33029013a8f945015792f5b0725a1699b14 | JavaScript | rdp-studio/ciphora | /src/main/lib/Server.js | UTF-8 | 1,574 | 2.59375 | 3 | [
"MIT"
] | permissive | 'use strict'
/**
* Signal class
* Sends and receives signals from peers and signal events from server
*/
const WebSocket = require('ws'),
EventEmitter = require('events'),
{ encode } = require('querystring'),
{ WS_URI } = require('../../config')
module.exports = class Server extends EventEmitter {
construc... | true |
ca2ac2d573b19b06a43c5469b84b92df160dd4ed | JavaScript | scottWhiteman/Color-Game-Capstone | /src/components/Results/Results.js | UTF-8 | 3,080 | 2.6875 | 3 | [] | no_license | import React from 'react';
import LoginForm from '../LoginForm/LoginForm'
import RegistrationForm from '../RegistrationForm/RegistrationForm'
import './Results.css';
import TokenService from '../../services/token-service';
import ScoreApiService from '../../services/score-api-service';
import UserContext from '../../co... | true |
1294c059572bfe516add5d36b09d28af539d576f | JavaScript | allengordon011/node-intro-unit-testing | /test/test-fizz-buzzer.js | UTF-8 | 1,179 | 2.90625 | 3 | [] | no_license | const should = require('chai').should();
const fizzBuzzer = require('../fizzBuzzer');
describe('fizzBuzzer', function() {
it('should return fizz for numbers divisible by 3 and not 5', () => {
const normalCases = [3,27,63];
normalCases.map(function(input) {
let result = fizzBuzzer(input... | true |
039e8714a84d7beb77de867caea039cc163e0afe | JavaScript | shrek-7/github-hack | /index.js | UTF-8 | 692 | 2.640625 | 3 | [] | no_license | const jsonfile = require('jsonfile');
const moment = require('moment');
const simpleGit = require('simple-git');
const FILE_PATH = './data.json';
const random = require('random');
const makeNCommits = (n) => {
if(n===0) return simpleGit().push();
const x = random.int(0, 54);
const y = random.int(0 ,6);
c... | true |
dd95548e30540eaabf55c652a01dcf461f9a3aa2 | JavaScript | evejweinberg/programming-design-systems-projects | /SKETCHES/Wk6_vectors/main.js | UTF-8 | 2,845 | 3.4375 | 3 | [] | no_license | //type a string here
//take out spaces in the string
//add commas
//
var r = new Rune({
container: "#canvas",
width: $(window).width(),
height: $(window).height(),
debug: false
});
function DrawLines(){
}
//// STAGE GRAPH is what you set to the stage
////▱▣ ▣ ▣ ▣ ▣ ▣ ▣ ▣ ▣ ▣ ▣ ▣ ◍ /// ◠ ◠ // ◠
/... | true |
a974aad77bc580314cdad2c198a5d68ff2a0073a | JavaScript | DarriusWrightGD/micro-scaffold | /commands/generate/index.js | UTF-8 | 2,614 | 2.515625 | 3 | [] | no_license | const shell = require("shelljs");
const fs = require("fs");
const path = require("path");
const { formatOutputDirectory } = require("./helpers");
const {TemplatePrompt, ConfirmPrompt, ProjectPrompt} = require('./prompts');
const localPath = process.cwd();
const templateDir = `${__dirname}/../../templates`;
// const ... | true |
72f6d7798df0a1d92c655e5149c305d4b6b6e4b2 | JavaScript | bal-singh-sde/jobs-bal | /index.js | UTF-8 | 877 | 2.859375 | 3 | [] | no_license | //packages
const express = require("express");
const { getJobs } = require("./services");
const cors = require('cors')
//internal code
const server = express();
server.use(cors())
let PORT = 3000;
if (process.env.PORT !== undefined){
PORT = process.env.PORT
}
// const PORT = process.env.PORT ? process.env.PORT :... | true |
7a4b8e2865c1e493eda1f1a7e1636ece9382b4f4 | JavaScript | NevenSubotic/happiness-rating | /Code.js | UTF-8 | 4,313 | 2.71875 | 3 | [] | no_license | /**
* Whenever a new Version needs to be deployed
* 1. Deploy > Manage Deployments > Click on the pen > Create new Version (of existing Deployment)
* 2. Add the descriptions for the new version and publish it
* 3. Users may need to refresh to see the Changes
*
* In other cases (not sure when), a total new deploy... | true |
cc102ebeaa12df62b6df926e8eb19d2c11f186b9 | JavaScript | zzlc/FileProcess | /ClientSetup/Web/src/js/main.js | UTF-8 | 945 | 2.515625 | 3 | [
"MIT"
] | permissive |
function getSelectFile() {
var fileName = document.getElementById("fileSelect").value;
document.getElementById("executFileName").value = fileName;
console.log("Select File:%s", fileName);
}
function getDestPath(){
var pathName = document.getElementById("pathId").value;
console.log(pathName)
alert(pathName... | true |
6e2aa1eaddf8959d9b73b4fa89eb8e56797b762b | JavaScript | par333k/javascript_deep_dive | /29_Math/Math_object.js | UTF-8 | 4,296 | 4.25 | 4 | [] | no_license | // 표준 빌트인 객체인 Math는 수학적인 상수와 함수를 위한 프로퍼티와 메서드를 제공
// 생성자 함수가 아니므로 정적 프로퍼티와 정적 메서드만 제공한다.
// Math 프로퍼티
// Math.PI
Math.PI; // -> 3.141592653589793
// Math 메서드
// 1. Math.abs
// 인수로 전달된 숫자의 절대값을 반환한다. 절대값은 반드시 0 또는 양수여야 한다.
Math.abs(-1); // -> 1
Math.abs('-1'); // -> 1
Math.abs(''); // -> 0
Math.abs(... | true |