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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
e5318c2a2711e9a4b6b4482ad05a51a375293b5a | JavaScript | connuh/cat | /example.js | UTF-8 | 728 | 3.4375 | 3 | [
"WTFPL"
] | permissive | /**
* @author Conner
* @since 01/03/2021
* @version 1.0.0
*
* API wrapper for TheCatAPI.com written in Deno
* - https://github.com/connuh
*/
import Cat from "./mod.js";
/* Fetch all of the cat breeds */
let breeds = await Cat.getBreeds(); // returns an array of breeds
console.log(breeds); //> [ "item", "here"... | true |
e4dbf0f02b2a8c797475505095473dc3ffdcb29f | JavaScript | jrichmond4/gametracker | /platforms/android/assets/www/js/app.js | UTF-8 | 3,281 | 2.65625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | var app = (function () {
var auth;
var map;
var showAlert = function () {
var fn,
args = arguments;
if (navigator && navigator.notification && navigator.notification.alert) {
fn = navigator.notification.alert(msg);
} else if (typeof alert === "function") {
fn = alert;
} else {
fn = console.log... | true |
b7574b7eaa1d496c97d99eb03f581e7bc8fc4541 | JavaScript | danhee1012/danhee1012.github.io | /youtube-playlist-organizer/playlist_updates.js | UTF-8 | 5,307 | 2.921875 | 3 | [] | no_license | // Define some variables used to remember state.
var currPlaylistId, channelId, destPlaylistId;
var playlistItemIds = [];
// After the API loads, call a function to enable the playlist creation form.
function handleAPILoaded() {
$('#submit').click(function () {
currPlaylistId = $('#curr-playlist-id').val()... | true |
5dd9c3c2833b3ffdff9b64ce5ea03a0a9ea92910 | JavaScript | tkoar/react-forms-lab-web-042417 | /src/components/PoemWriter.js | UTF-8 | 1,195 | 3.125 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import React from 'react';
class PoemWriter extends React.Component {
constructor() {
super();
this.state = {
poem: '',
isValid: true
}
}
savePoem(event) {
let poem = event.target.value
this.setState({
poem: poem,
isValid: this.isValidPoem(poem)
})
}
isValid... | true |
7c004af19a4bcaa95b19a935bf07e35f7c2d4383 | JavaScript | fs821031547/jsdemo | /new-features/MutationObserver.js | UTF-8 | 714 | 3.21875 | 3 | [] | no_license | // 定义要监听的元素
var targetNode = document.getElementById('some-id');
// 监听的配置项
var config = {
attributes: true,
childList: true,
subtree: true
};
// 当监听到变化时执行的回调函数
var callback = function (mutationsList) {
for (var mutation of mutationsList) {
if (mutation.type == 'childList') {
console.log('A child nod... | true |
1d5bb2e7a7c38ef7af7c30805073532b3b22e025 | JavaScript | bflores88/pre-immersive-challenges | /cookie-problem/test/cookieProblem.test.js | UTF-8 | 419 | 2.609375 | 3 | [] | no_license | const assert = require('assert');
const cookieProblem = require('../cookieProblem');
describe('Cookie Problem Test', () => {
it('should return 9 for [3,8,7,5]', () => {
const giveCookies = cookieProblem([5, 8, 6, 4]);
assert.deepEqual(giveCookies, 9);
});
it('should return 19 for [1, 3, 4, 9]', () => {
... | true |
3b35c4d1e0d17bf9b6746412fc576959217ad71c | JavaScript | joshuajhun/movie-fun | /src/helpers/index.js | UTF-8 | 486 | 2.671875 | 3 | [] | no_license | import key from '../api-key.js';
export const fetchMovies = async url => {
const initialJSON = await fetch(`https://api.themoviedb.org/3/movie/${url}?api_key=${key}`);
console.log(`https://api.themoviedb.org/3/movie/${url}?api_key=${key}`);
return await initialJSON.json();
};
export const searchMovies = async q... | true |
171e16a981cc2fa5dbfca2e34f9aad89855eb5e6 | JavaScript | amnyrrd/woof-woof-js-practice-sfo-web-012720 | /src/index.js | UTF-8 | 6,327 | 3.0625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | const DOGGOS_URL = 'http://localhost:3000/pups'
// fetching
const getPups = () => {
return fetch(DOGGOS_URL)
.then(resp => resp.json())
},
getOneDoggo = id => {
return fetch(DOGGOS_URL + `/${id}`)
.then(resp => resp.json())
},
toggleGoodPup = (id,newVal) => {
const options = {
method: 'PA... | true |
532b68885242886bb1bc714c7825cfc9f58a743b | JavaScript | aalsheikh74/mvp-starter | /react-client/src/index.jsx | UTF-8 | 3,159 | 2.6875 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import $ from 'jquery';
// import MainMenu from './components/MainMenu.jsx';
import Home from './components/Home.jsx';
import About from './components/About.jsx';
import List from './components/List.jsx';
import Add from './components/Add.jsx';
import Search ... | true |
a3388ac16a07b7b1e57006059565ef9a026eb97f | JavaScript | Arogancki/nodeJS_repo | /stock/src/components/CompaniesManager/helpers.js | UTF-8 | 3,125 | 2.796875 | 3 | [] | no_license | import { fetchGet } from 'helpers/fetchGet';
const localStorageKey = 'companies';
export function addCompany(newCompany) {
const companies = getCompanies();
if (companies.find(company => company.symbol === newCompany.symbol)) {
return false;
}
companies.push(newCompany);
localStorage.setItem(localStorage... | true |
a89000f95b21175dc790a7ba9fdb8c558df6baf7 | JavaScript | SharpAuctionEngine/AuctioneerSignUp | /lib/debug/dumpPromise.js | UTF-8 | 355 | 2.78125 | 3 | [] | no_license | var dumpPromise = function(name, promise) {
promise.then(function(result) {
console.log(name + ':resolve');
console.log(result);
}, function(result) {
console.log(name + ':reject');
console.warn(result);
}).catch(function(result) {
console.log(name + ':catch');
console.error(result);
});... | true |
d320f7ae3dc70396c7694ae8e90969925ac40d78 | JavaScript | dgbailey/algo_reps | /inOrderBST.js | UTF-8 | 1,208 | 3.75 | 4 | [] | no_license | /**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @param {number} k
* @return {number}
*/
var kthSmallest = function(root, k) {
//dfs to collect values O(n)
//sort array and access [... | true |
b359201f2b69369f10d0b88697af552fdccd0ada | JavaScript | asolace/CryptocurrencyScore | /client/src/components/Faq/index.js | UTF-8 | 1,746 | 2.53125 | 3 | [] | no_license | import React from 'react'
const Faq = () =>
<div className="faq">
<div className="faq-header-container">
<div className="faq-header">
<h2>FAQ</h2>
<h5>Community based cryptocurrency ranking to help others make better investment choices.</h5>
</div>
</div>
<div className="faq-... | true |
16170aa17989a746b8003e15741a8e872549ae4d | JavaScript | qmetivier/MegaProductionLeger | /megaCasting/services/connexion.js | UTF-8 | 1,008 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive |
// si le bouton de connexion existe
if (document.getElementById("btn-panel-login") != undefined) {
// Si on click sur le bouton de connexion, on ouvre le formulaire de connexion
document.getElementById("btn-panel-login").parentElement.addEventListener("click", function(){
var backpanel = document.getElementBy... | true |
d51f2f7e247a2e012c106510d1a0c156027fc6ba | JavaScript | piotrbaranowski/domodiodiodi | /src/VisitPeriodPicker/VisitPeriodPicker.js | UTF-8 | 6,380 | 2.578125 | 3 | [] | no_license | import React from 'react';
import DatePicker from './DatePicker';
import StarRating from './StarRating';
import './VisitPeriodPicker.css';
class VisitPeriodPicker extends React.Component {
static MESSAGE_PAST = 'Choose date not in the past';
static MESSAGE_SOME_RESERVED = 'Some dates reserved. Choose continous pe... | true |
74c653d80a089f36d4b22fbed104fab606019c45 | JavaScript | romualdo97/opengl_studies | /web/02. Models/app.js | UTF-8 | 3,314 | 2.84375 | 3 | [] | no_license | // Find the latest version by visiting https://unpkg.com/three. The URL will
// redirect to the newest stable release.
import * as THREE from 'https://unpkg.com/three@0.123.0/build/three.module.js';
// Only a few loaders (e.g. ObjectLoader) are included by default with three.js — others should be added to your app indi... | true |
b975b2594f5667f774131cf3a1f26d69a20b4a79 | JavaScript | Jamogck/challenge-theme | /js/jquery.hamburger.js | UTF-8 | 1,058 | 2.515625 | 3 | [] | no_license | jQuery(document).ready(function($) {
// media query event handler
if (matchMedia) {
var mq = window.matchMedia("(min-width: 960px)");
mq.addListener(WidthChange);
WidthChange(mq);
}
// media query change
function WidthChange(mq) {
if (mq.matches) {
// window width is at least 960px
// $('.sl... | true |
0cf01521dedeec4015f779f69166ecb941379cfb | JavaScript | benfarrow/space-invaders | /script.js | UTF-8 | 1,550 | 3.671875 | 4 | [] | no_license | var player={
top: 550,
left: 500
};
var laser=[];
// variables defining attributes for objects eg co-ordinates
alert ("Defeat All Enemies!");
document.onkeydown=function(e){
// function for a key press
if (e.keyCode===37){
console.log("Left")
player.left=player.left-10;
movePlay... | true |
b7dcccc5fb43c3b7366ac908f1d5fdef4231ca6d | JavaScript | PluseClan/dc-pluse | /server/avatar.js | UTF-8 | 539 | 2.578125 | 3 | [] | no_license | module.exports = {
name: 'pfp',
description: 'Display your pfp or someone pfp.',
execute(message) {
if (!message.mentions.users.size) {
return message.channel.send(`You profile picture is : ${message.author.displayAvatarURL({ format : 'png'})}`);
}
const avatarL... | true |
bf3a7948464f9a7e75694d5127f190f1bb9d20e3 | JavaScript | pxtnpxtn/react-sandbox | /src/Another.js | UTF-8 | 696 | 2.90625 | 3 | [] | no_license | import './Another.css';
import React, { useState } from 'react';
function Another({yay}) {
const [count, setCount] = useState(0);
const increaseByOne = () => setCount(currentCount => currentCount + 1);
console.log('-->', yay);
const heyYou = () => {
console.log('Oh hi');
}
return (
... | true |
97f14a31071d25a61980ba0b5cbcd68563aa2600 | JavaScript | duxingyu/LearnRecord | /src/js/task2_18.js | UTF-8 | 2,328 | 3.078125 | 3 | [
"MIT"
] | permissive | const aInp = document.querySelectorAll('#form1 input');
const aP = document.querySelectorAll('#form1 p');
aInp[0].addEventListener('focus', function() {
let valid = new Validate('username', aP[0]);
valid.focusFn();
}, false);
aInp[0].addEventListener('blur', function() {
let valid = new Validate('username', aP[0]);... | true |
09fb5864dc080aa55382f9f62ca0e56bb755bb3f | JavaScript | jeffxanthus/isometric | /js/generate.js | UTF-8 | 24,489 | 2.65625 | 3 | [] | no_license | function strlen(str){
return str.length;
}
function ord(str){
if (str.length > 1){
return null;
}else{
return str.charCodeAt(0);
}
}
function echo(str){
console.log(str);
}
function s(){
}
s.prototype = {
arraycopy: function(src, srcPos, dest, destPos, len... | true |
af6d0751387c1a95b2ea2250c172ff252db2b410 | JavaScript | morena/js-test | /property-manager/scripts/utilities/randomNumber.js | UTF-8 | 305 | 2.515625 | 3 | [] | no_license | 'use strict';
define([], function(){
var idCount = 0;
var randomNumber = {
generateRandomN: function(){
var min = 1,
max = 1000,
random = Math.floor(Math.random()* (max-min+1)) + min;
return random;
},
uniqueId: function(){
return idCount++;
}
}
return randomNumber;
}); | true |
692643a48d37a21b710fb88477b314b1390191fb | JavaScript | patelankitk/Homestudy | /MiniProject2JS.js | UTF-8 | 726 | 2.984375 | 3 | [] | no_license |
function interestcal()
{
var amount =parseInt(document.getElementById("amount").value);
var interest_rate =parseInt(document.getElementById("interest").value);
var interest = interest_rate / 100;
var months =parseInt(document.getElementById("month").value);
var ye... | true |
782a18aac873cc80cf96048e489b6696afa2697b | JavaScript | parnitaagrawal/test-repository | /Javascript/cararrayobject.js | UTF-8 | 1,768 | 3.4375 | 3 | [] | no_license | var tbl= document.getElementById("tbl");
var Cars=[];
var i=0;
var j=0;
while(i<30)
{
Car= new Object();
Car.name="i10" + i;
Car.speed=20 +i;
Car.modelyear="201"+i;
Car.type="Hashback";
Car.colors=[];
Car.colors.push({name:"red",code:"rgb(255, 0 ,0)",isSelected:false},{name:"green", code:"rgb(0, 255 ,... | true |
e989939f1f143c5fe53609dd25a6a9f478072e2e | JavaScript | henriquegavabarreto/twitterbot | /set/set-active-channels.js | UTF-8 | 3,165 | 2.53125 | 3 | [] | no_license | var validate = require('../check/validate')
var doc = require('../config/doc')
const creds = require('../config/creds')
var youtube = require('../config/youtube')
const { promisify } = require('util')
// removes all data from active spreadsheet and add all active channels names and id
function setActiveChannels () {
... | true |
9ead1079fe5fe8bee4388447166b46f9e05d6bb6 | JavaScript | spialelo/codewars | /functionsAndClosures.js | UTF-8 | 345 | 4.25 | 4 | [] | no_license | /* Nested Functions and Closures
*/
var say = function firstWord(string1) {
function secWord(string2){
return (string1+" "+string2);
};
return secWord;
};
var ans = say("Hello")("World");
console.log(ans);
var ans1 = say("Peanut")("Butter");
console.log(ans1);
var ans2 = say("Harry")("Pot... | true |
1a661378345c64f7fcd9db0921568b4c9bfed212 | JavaScript | daimawanyi/201905js | /formal/week10/vue-book/src/main.js | UTF-8 | 1,551 | 2.53125 | 3 | [] | no_license | // main.js 是 Vue 应用的主入口,这个文件就是创建 Vue 的实例,在创建实例的时候把该配置的属性都要配置,如router,store,el
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import VueAwesomeSwiper from 'vue-awesome-swiper' // 导入第三方的插件不需要写路径
import 'swiper/dist/css/swiper.css' // 导入swiper需要的样式
// 使用vue-a... | true |
4a0ea772a685d6852316969d4d08196ee155d3f1 | JavaScript | mitch1106/Flashcard-app | /src/Layout/Cards/EditCard.js | UTF-8 | 1,947 | 2.625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { Link, useParams, useHistory } from "react-router-dom";
import CardForm from "./CardForm";
import BreadCrumb from "../Home/BreadCrumb";
import { readDeck, readCard, updateCard } from "../../utils/api/index";
function EditCard() {
const { deckId, cardId }=... | true |
1351af5a8e8e3090d5086f4fc2f3beb8bb00411a | JavaScript | eDrieen/holidayjs | /projects/primeNumbers/script.js | UTF-8 | 1,296 | 3.671875 | 4 | [] | no_license | let inputNumber = null;
let result = null;
let resultHidden = null
let primeArr = [];
function isPrime(num) {
if (num < 2) return false;
for (let i = 2; i < num; i++) {
if (num % i == 0) {
return false;
}
}
return true;
}
document.addEventListener("DOMContentLoaded", fu... | true |
8486e40ee6ae0a00d03818c76b987e432510f058 | JavaScript | biglotteryfund/blf-alpha | /controllers/apply/under10k/fields/project-total-costs.js | UTF-8 | 2,964 | 2.53125 | 3 | [] | no_license | 'use strict';
const get = require('lodash/fp/get');
const getOr = require('lodash/fp/getOr');
const sumBy = require('lodash/sumBy');
const { oneLine } = require('common-tags');
const { CurrencyField } = require('../../lib/field-types');
module.exports = function (locale, data) {
const localise = get(locale);
... | true |
01b420ce388b63125dd1dd7df6c6dd58932281ff | JavaScript | mitji/challenge-todo-app | /src/services/todoService.js | UTF-8 | 929 | 2.625 | 3 | [] | no_license | import axios from 'axios';
class Todos {
constructor() {
this.todos = axios.create({
baseURL: 'http://localhost:4000/api/v1/todos',
withCredentials: true,
});
}
getAll() {
return this.todos
.get('/')
.then(({ data }) => data);
}
getOne(id) {
return th... | true |
cac9706708e009fdf6bdfe74172b1524f10e625c | JavaScript | bloodspasm/nodejs-openshift | /prototypeJs/datePrototype.js | UTF-8 | 1,460 | 3.109375 | 3 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | /**
* Created by bloodspasm on 2017/8/14.
*/
//获得北京时间
Date.prototype.getBJDate = function () {
//获得当前运行环境时间
var d = new Date(), currentDate = new Date(), tmpHours = currentDate.getHours();
//算得时区
var time_zone = -d.getTimezoneOffset() / 60;
//少于0的是西区 西区应该用时区绝对值加京八区 重新设置时间(西区时间比东区时间早 所以加时区间隔)
i... | true |
70e785aeb0787a7815ff66241e7c6275b19afbb6 | JavaScript | maheshsabnis/blazejan2021 | /es6/proxy/handlermethods.js | UTF-8 | 1,404 | 4.375 | 4 | [] | no_license | // actual array object
const numbersArray = [1,2,3,4];
// handler
const numberHandler = {
get:function(target,property){
// the value at the index present in the array
if(property in target){
return target[property]; // if the target object has the property/entry then return index
... | true |
afbe4175be7f105de8b957f9b205d478375ff6b7 | JavaScript | victor1162/sistema-parana | /js/recem-adicionados.js | UTF-8 | 1,913 | 2.703125 | 3 | [] | no_license | function abrirModal(acao, id){
let valorModal = document.querySelector('.value-modal').value
valorModal = id
if(acao == 'abrir' && id == valorModal ){
document.querySelector('.id-' + id).style.display = 'flex'
}
}
function fecharModal(acao, id){
let valorModal = document.querySelector('... | true |
4bfdf9d940db654bdf593c24babcf666a2cf02c3 | JavaScript | c4rtel/c4rtel.github.io | /JS/js/8-klasy.js | UTF-8 | 1,188 | 3.359375 | 3 | [] | no_license | let kolekcjaAut = [];
class samochod {
constructor(marka, model, przebieg, silnik, rok, kolor){
this.marka = marka;
this.model = model;
this.przebieg = przebieg;
this.silnik = silnik;
this.rok = rok;
this.kolor = kolor;
}
wyswietlInfo(){
document.bo... | true |
4c36a837361a747f17cf90c4b64ed1c9b991d784 | JavaScript | PaulaScharf/GeoSoftware1-FinalProject | /public/javascript/singleEncounter.js | UTF-8 | 5,975 | 2.671875 | 3 | [] | no_license | // jshint esversion: 6
// jshint maxerr: 1000
"use strict"; // JavaScript code is executed in "strict mode"
/**
* @desc final project, Geosoftware1, SoSe2019
* @author name: Katharina Poppinga, matr.: 450 146; name: Paula Scharf, matr.: 450 334
*/
// please put in your own tokens at 'token.js'
// ****************... | true |
106255cdcfae371a91bf8f894646b878a842f9c8 | JavaScript | amuhammadbdimshealth/React_tic-tac-toe | /src/Game.js | UTF-8 | 4,762 | 3.09375 | 3 | [] | no_license | import React from 'react'
// import ReactDOM from 'react-dom'
import Board from './Board'
import { calculateWinner, findMoveLocation } from './utility'
import './index.css'
class Game extends React.Component {
state = {
history: [
{
squares: Array(9).fill(null),
... | true |
13377a6fb4d54673a2eaf735f4bdf970e4e375ba | JavaScript | erickoledadevrel/feed-plus | /backend/Interface.gs | UTF-8 | 2,126 | 2.953125 | 3 | [] | no_license | /**
* Adds a feed to the server.
* @param {string} userId The ID of the user that this feed belongs to.
* @param {string} type The type of feed.
* @param {string} intput The feed input.
* @param {string} name The name of the feed.
* @returns {string} The new feed's ID.
*/
function addFeed(userId, type, input, na... | true |
c3a969d497e730c0145541df9b21577cb916b2a4 | JavaScript | RanaMara/Orinoco | /assets/js/category.js | UTF-8 | 2,466 | 3.28125 | 3 | [] | no_license | class Category {
constructor(category, wrapper){
this.category = category
this.wrapper = document.querySelector(wrapper)
this.url = '/api/'+this.category
this.fetchProducts()
}
fetchProducts() {
fetch(this.url)
.then(response => response.json())
.then(data ... | true |
618cc1bcdc048ad4f654e3b1b757fefc1dcaebc7 | JavaScript | i1oy/Frontend-05-Template | /Week 15/Carousel/carousel.js | UTF-8 | 2,550 | 2.765625 | 3 | [] | no_license | import { Component, createElement } from "./framework";
export class Carousel extends Component {
constructor() {
super();
this.attributes = Object.create(null);
}
render() {
this.root = document.createElement("div");
this.root.classList.add("carousel");
for (let pic... | true |
1b081f3f8645482b2ed2aeb1acfee814c0123867 | JavaScript | knieszj/mock-gmail | /src/App.js | UTF-8 | 2,969 | 2.546875 | 3 | [] | no_license | import React, {Component} from 'react'
import {BrowserRouter as Router, Link, Switch, Route} from "react-router-dom";
import HomePage from "./Components/HomePage";
import SendEmails from "./Components/SendEmails";
import './App.css'
import SearchEmails from "./Components/SearchEmails";
class App extends Component {
... | true |
9b857468a551c79efbf148179b979360fb8e2a76 | JavaScript | annakuchina/aquablog | /index.js | UTF-8 | 323 | 2.53125 | 3 | [] | no_license | $(document).ready(function() {
console.log("ready!");
$("#menu a ili").on("click", function(e) {
function toggleCheckbox() {
let checkbox = $("#menu-checkbox")[0];
console.log("toggleCheckbox", checkbox);
checkbox.checked = false;
}
toggleCheckbox();
});
});
... | true |
c96103a4de199b33625d4b350a39683940960bfc | JavaScript | imamamamai21/GAS_FixedAssetSheet | /Main.gs | UTF-8 | 2,950 | 2.765625 | 3 | [] | no_license | /* =============================================================
固定資産台帳のデータをもとに、
kintoneの固定資産データアプリに登録するためのコードです。
============================================================= */
/**
* メニューを設定する
*/
function createMenu() {
var ui = SpreadsheetApp.getUi(); // Uiクラスを取得する
var menu = ui.createMenu('▼スクリプト... | true |
42eb0956aa9cad8afb846f13e4085f7c9215e359 | JavaScript | oldscienceguy/AppSuiteExtensions | /Extension Selector/popup.js | UTF-8 | 2,866 | 2.890625 | 3 | [] | no_license | //If we're called from popup.html, we can set up event handlers for html object
//Inline script is not allowed in Chrome extension .html. So everything must be done in .js
//console.log() and debugger; only work when you open the context menu on the Chrome Ext Icon
// and select 'Inspect Popup'. console.log data wil... | true |
ea999af90035c09bc28095eff5f8d6583d824850 | JavaScript | villani/pem | /2020.01/Elaborados em aula/semana12/03-definir-retorno.js | UTF-8 | 381 | 4 | 4 | [] | no_license | function gerarVetor(qtd, min, max) {
var vetor = [];
for (var i = 0; i < qtd; i++) {
var num = parseInt(Math.random() * (max - min)) + min;
vetor.push(num);
}
// Definindo o retorno de uma função
return vetor;
}
var vetor = gerarVetor(5, 5, 10);
alert(vetor.join(' - '));
// ... | true |
3ae3c2852d8ced4d11ced74af035677bd7f7e16b | JavaScript | prostonastya/game_with_city | /js/script.js | UTF-8 | 4,509 | 3.46875 | 3 | [] | no_license | var container = document.getElementsByClassName('container')[0];
var yourCity = document.getElementsByClassName('text-1')[0];
var compCity = document.getElementsByClassName('text-2')[0];
var okBtn = document.getElementsByClassName('ok-btn')[0];
var giveUpBtn = document.getElementsByClassName('give-up-btn')[0];
var city... | true |
c5b1e26bf5401831f6edc3af4bc961226b706e62 | JavaScript | LeeBG/javascriptwork | /scripy.js | UTF-8 | 1,895 | 4.15625 | 4 | [] | no_license | // ECMA 5버전 2015버전(ES5) 바닐라 자바스크립트 - 너무나 자유분방함
// 마이크로소프트에서 구현한 자바스크립트기반의 "타입스크립트"
//
var num = 10;
console.log(num);
//자료형(X) - 원시자료형이 없음
//크기가 정해져 있는 타입이 없음
//모든 변수는 레퍼런스변수
//C언어에서 포인터쓰는이유는 데이터의 크기를 모르기 때문임
//미리 공간을 확보할 수 없는 언어 = 동적언어(python,javascript)
//미리 공간을 확보하는 언어 = 정적언어 (java)
//컴파일 시점에 메모리 확보가 되지 않기 때문에 인... | true |
b7a0bee2f83de2a9ea8df0cb8fb1495221ea1056 | JavaScript | L3NNYN/PROYECTO-PROGR4 | /api/static/js/direcciones_envio.js | UTF-8 | 4,060 | 2.6875 | 3 | [] | no_license | var BaseApiUrl = "http://localhost:5000/"; //ruta base a la API
function apiURL(service) { //Función para formar la ruta completa a la API
return BaseApiUrl + service;
}
//Mantenimiento de las direcciones de envio
window.onload = function () {
var vm = new Vue({
el: '#app',
data: {
... | true |
972c4a5f1fe3ad29d94f26c3450ad2dd7602b858 | JavaScript | gaze-abyss/hsm-web | /js/archive/heatmap.js | UTF-8 | 5,850 | 2.75 | 3 | [
"MIT"
] | permissive | function d3ifyData(data, rowNames, colNames) {
var dataD3 = [];
for (var i=0; i < rowNames.length; i++) {
var domainProt = rowNames[i];
for (var j=0; j < colNames.length; j++) {
var newDataPoint = {};
newDataPoint.domain = domainProt;
newDataPoint.peptide = colNames[j];
newDataPoint.... | true |
ba8c04400fc18ce55b8b7874affa07be736f9280 | JavaScript | GiftForGood/admin-portal | /api/npoOrganizations.js | UTF-8 | 13,672 | 2.515625 | 3 | [] | no_license | import { db } from '@utils/firebase';
import { NPO_ORGANIZATION_BATCH_SIZE } from '@constants/batchSize';
import { TYPE_FILTER_TYPE, SECTOR_FILTER_TYPE, ORDER_BY, TYPE, SECTOR } from '@constants/npoOrganization';
import {
isValidTypeFilterType,
isValidSectorFilterType,
isValidOrderBy,
isValidType,
isValidSect... | true |
44c602d7a5e2904b0d4f190ec33cc1377a082e55 | JavaScript | fe6/cli | /packages/tpl-ali-mini/template/utils/request.js | UTF-8 | 2,030 | 2.5625 | 3 | [
"MIT"
] | permissive | /** @format */
import Api from '../api';
import { TOKEN_NAME } from '../constant';
// import Auth from './auth';
const errorFn = (content) => {
Api.alert({ content: content || '请求失败,请检查网络' });
};
/**
* request 小程序方法的封装
* arg 说明
* @param url String 目标服务器 URL
* @param requiredLogin boolean 是否需要登录
* @param metho... | true |
882fb679ea29491e2265bf7f7140e60b57af6c20 | JavaScript | LaurentP/php-blog | /public/assets/js/app.js | UTF-8 | 2,509 | 2.90625 | 3 | [] | no_license | "use strict"
// NavBar
const navBarButton = document.querySelector('.navbar-button')
const navBarMenu = document.querySelector('.navbar-menu')
if (navBarButton && navBarMenu) {
navBarButton.addEventListener('click', () => {
navBarMenu.classList.toggle('show')
})
document.querySelector('.contain... | true |
04710b449cdf338420ef86e622c3afb3d97937bf | JavaScript | ehlee9317/DogPedia | /src/components/DogImage/index.js | UTF-8 | 1,001 | 2.6875 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { useParams } from "react-router-dom";
import { API_BASE_URL } from "../../constants";
import './style.css';
const DogImage = () => {
const { breedName } = useParams();
const [imgUrls, setImgUrls] = useState([]);
const breedNameUpper = breedName.toUpperC... | true |
17aab025772a2672e6a7f2c6492c97fbd0150411 | JavaScript | anna-mihaylova/JS | /loops/assets/js/task2.js | UTF-8 | 965 | 4.03125 | 4 | [] | no_license |
(function () {
let task = "Task 2";
let problem = `Да се състави скрипт, който да изведе (console.log) в конзолата квадратите на
всички естествени числа в интервала 1-100 по-малки или равни на числото 12.`;
const numberFrom = 1;
const numberTo = 100;
const maxSqare = 12;
le... | true |
fe116cdf2b48b48f32b389c8ebdb828310f40bb4 | JavaScript | thinkful-ei19/ray-megan-knex | /drills.js | UTF-8 | 2,957 | 2.640625 | 3 | [] | no_license | 'use strict';
const { DATABASE } = require('./config');
const knex = require('knex')({
client: 'pg',
connection: '<database link here>'
});
// clear the console before each run
process.stdout.write('\x1Bc');
// Sample select
// knex
// .select()
// .from('restaurants')
// .limit(2)
// .debug(true)
// ... | true |
fd09e10199f7b1cf4fc4a2800a3fa9b4d8e51f4e | JavaScript | Yo-Manba/node.js-learn | /day7/01-promise/03-promise.js | UTF-8 | 616 | 2.890625 | 3 | [] | no_license |
const fs = require('fs');
const path = require('path');
let readFile = (...args) => {
return new Promise((resolve, reject) => {
fs.readFile(...args, (err, data) => {
if(err) reject(err);
resolve(data);
})
})
}
readFile(path.join(__dirname, 'data/a.txt')).then((data)=>{... | true |
1370eb54dc96c0d0318ff557d2bb3055f7ba6997 | JavaScript | JCesarAB/2100ProtractorIssueExample | /features/steps/steps.js | UTF-8 | 1,281 | 2.8125 | 3 | [] | no_license | var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
expect = chai.expect;
var steps = function() {
var firstNumber = element(by.model('first'));
var secondNumber = element(by.model('second'));
var operador = element(by.model('operator'));
var goButton = elem... | true |
067b2ff1af589fba28b6243bebc53453e76dfb0e | JavaScript | samthor/viz-observer | /test/test.js | UTF-8 | 1,183 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive |
import vizObserver from './index.js';
// @ts-ignore
const suite = window.suite;
// @ts-ignore
const test = window.test;
// @ts-ignore
const assert = window.assert;
// called before any tests are run
const e = window.onerror;
window.onerror = function(err) {
console.warn('err', err);
if(err === 'ResizeO... | true |
8cbb8752ead769477ac3598fbb9ab8b128746138 | JavaScript | Shakib-ewu/Javascript-Project | /script.js | UTF-8 | 4,807 | 2.984375 | 3 | [] | no_license | function ageIndays()
{
var year=prompt("Enter year:");
var ageIndayss=(2021-year)*365;
var h1=document.createElement('h1');
var textAnswer=document.createTextNode('You are'+ ageIndayss + 'days old');
h1.setAttribute('id','ageIndays');
h1.appendChild(textAnswer);
document.getElementById('flex-box-result').appendChild(h1... | true |
ccd95f9f2c8393d6256f2e9db8dd6db64f8f0fc7 | JavaScript | EmpireJS/2018.empirejs.org | /empire.js | UTF-8 | 21,226 | 2.765625 | 3 | [] | no_license | import deburr from 'lodash.deburr';
import shuffle from 'lodash.shuffle';
(function () {
const scribbleMap = [];
let headerWidth = window.innerWidth;
const headerHeight = document.querySelector('.scribble-playpen').offsetHeight;
const scribbles = document.querySelectorAll('.scribble');
scribbles.forEach((s... | true |
23367dad7003170f8026bcd862b2ba6c30bdc4a8 | JavaScript | hellogan/apodz | /fellowship/fellowshipHostingForm.js | UTF-8 | 3,849 | 3.40625 | 3 | [] | no_license | //TODO: These indices may have to change based on the form you create
var namePosition = 1;
var startDatePosition = 2;
var endDatePosition = 3;
var startTimePosition = 4;
var endTimePosition = 5;
var descriptionPosition = 6;
var contactInformationPosition = 7;
var hostNamesPosition = 8;
var repeatsPosition = 9;
var loc... | true |
4eb02b2a3efc564b357c16179817e7ee014498ab | JavaScript | janevsky/React.js | /cas13/src/redux/ducks/cakes.js | UTF-8 | 1,605 | 3.1875 | 3 | [] | no_license | // initial state
const init = {
cakes: 15,
buyCakesMessage: null,
buyCakesError: null,
restoreCakesMessage: null
};
// constants
const BUY_CAKES = 'BUY_CAKES';
const RESTORE_CAKES = 'RESTORE_CAKES';
// actions
export const buyCakes = (numCakes) => {
return {
type: BUY_CAKES,
payloa... | true |
857b24fa6389ebd232d8bb8ae6761e604f477f91 | JavaScript | Tavo17s/adivinaElNumero | /js/function.js | UTF-8 | 2,694 | 3.578125 | 4 | [] | no_license | let msg1 = document.getElementById("message1");
let msg2 = document.getElementById("message2");
let msg3 = document.getElementById("message3");
let textField = document.getElementById("answer");
let randomNumber = Number(Math.floor(Math.random() * 1000)) + 1;
let lives = 10;
var l = localStorage;
var msg = document.ge... | true |
b73cec7bfc7c9a8a0031128914f55c0ab31c1def | JavaScript | junhui/hubot-scripts | /dist/46elks.js | UTF-8 | 3,971 | 3 | 3 | [
"MIT"
] | permissive | // Description:
// Allows Hubot to send text messages using 46elks.com API.
// Dependencies:
// None
// Configuration:
// HUBOT_46ELKS_USERNAME
// HUBOT_46ELKS_PASSWORD
// Commands:
// hubot sms <user> <message> - Sends <message> to the number <to>
// hubot <user> has phone number <phone> - Sets the phon... | true |
0b3270b152975d365d3d5cd319ad008b1dbfb36a | JavaScript | Jhowardschimmel/kata-exercises | /katas/SumTwoLowestNumbers.js | UTF-8 | 246 | 3.40625 | 3 | [] | no_license | function sumTwoSmallestNumbers(numbers) {
numbers.sort(function (a,b) {
return a - b;
});
const lowestSum = numbers[1] + numbers[0];
return lowestSum;
};
console.log(sumTwoSmallestNumbers([100,3000,1,2,62,3,4,5])) | true |
b122a1f65453942a3d7c90e13282e87dd0673dc6 | JavaScript | saiakrisna/recursion-1 | /style.js | UTF-8 | 810 | 4.625 | 5 | [] | no_license | //Buatlah rekursive function untuk menghitung angka faktorial
function faktorial(n){
let angka=1;
let faktor=1;
while(angka<=n){
faktor=faktor*angka;
angka=angka+1;
}
console.log(faktor)
}
faktorial(10)
//Buatlah rekursive function yang dapat menampilkan deret angka genap sampai N i... | true |
2265b5d2a1b9855da964fbe9fa21ac2870b3ae06 | JavaScript | r3nya/next-minesweeper | /src/utils/request.js | UTF-8 | 507 | 2.75 | 3 | [] | no_license | export const request = async (httpMethod = 'GET', resource, data = {}) => {
try {
const fetchOptions = {
method: httpMethod,
headers: {
'Content-Type': 'application/json',
},
}
if (httpMethod === 'POST') {
fetchOptions.body = JSON.stringify(data);
}
const result =... | true |
5eda7763d944ce9b0f53c113f341b900589d34aa | JavaScript | felipecandidodasilva/be-the-hero-backend | /src/controller/IncidentController.js | UTF-8 | 2,800 | 2.8125 | 3 | [] | no_license | const conn = require('../database/connection');
module.exports = {
async index(request, response) {
//pegar o total de registros
//usando colchetes pega o primeiro resultado
const [count] = await conn('incidents').count();
//Enviamos o total pelo cabeçalho
response.... | true |
9badbb49397a08e2302df96247de56ba3e161704 | JavaScript | ericchen15/js-synth | /script.js | UTF-8 | 2,294 | 2.609375 | 3 | [] | no_license | const context = new window.AudioContext();
const shouldDraw = true;
const scale = sevenScale;
const baseFrequency = 65;
const baseIndex = 2;
const waveType = "sawtooth";
const filter = createFilter(context, "lowpass", 6000);
console.log(scale);
console.log(scale.map(ratioToCents));
const canvas = document.getElemen... | true |
fa685830cf63e31745f37b41acbee1e1d86d1ac7 | JavaScript | fiasiqbal/jsExercise | /question2.js | UTF-8 | 1,119 | 4.34375 | 4 | [] | no_license | // Find the most frequent item of an array
function question2() {
var n = prompt("Enter the number of elements in the array: "); // Length of the array
var ans = document.getElementById("ans");
var arr = [];
var numb = [];
for (let index = 0; index < n; index++) {
arr[index] = prompt("Ent... | true |
a14c24d326347197331607087526cecff3f4b9e5 | JavaScript | zeppelin/ember-validations-braindump | /app/packages/validations/service.js | UTF-8 | 844 | 2.515625 | 3 | [] | no_license | var RSVP = Ember.RSVP;
export default Ember.Object.extend({
/*
Example fields are:
{
propertyName: 'firstName',
propertyValue: 'value of firstName',
validations: {
presence: true,
length: { minimum: 5 }
}
}
*/
validate: function(fields) {
var promises = fields.map(function... | true |
5067f2495a6e5c5987f8c311705f506d52398f9e | JavaScript | anboi1225/liaoyuan-url-shortener | /models/url.js | UTF-8 | 1,549 | 2.71875 | 3 | [] | no_license | /**
* Created by Boyang on 2016/8/5.
*/
// 数据库模型定义
/* 使用'node-restful'库建立可从外部query的功能,
例如: https://liaoyuan-url-shortener.herokuapp.com/api/url/6000001
可以通过浏览器返回id为:6000001的url表中的条目信息,支持POST, PUT, DELETE, GET操作
*/
var restful = require('node-restful');
var mongoose = restful.mongoose;
var Schema = mongoose.Schema;
... | true |
c73a8d6b95a5cb2a07b0c138c4e41eb5c1347743 | JavaScript | theguptaji/web | /mern/backend/routes/questions.js | UTF-8 | 1,486 | 2.796875 | 3 | [] | no_license | const router = require('express').Router();
let Question = require('../models/question.model');
router.route('/').get((req, res) => {
Question.find()
.then(questions => res.json(questions))
.catch(err => res.status(400).json('Error: ' + err));
});
router.route('/add').post((req, res) => {
const question =... | true |
fb5a53d817b7f7fb2a6cd6fd3b9c78b2f5e446ca | JavaScript | Veilios/nasa-photo-of-the-day | /src/components/Vote.js | UTF-8 | 1,692 | 2.609375 | 3 | [] | no_license | import React, { useState } from 'react';
const Vote = () => {
const [upvote, setUpvote] = useState(0);
const [downvote, setDownvote] = useState(0);
const upVoting = () => {
setUpvote((upvote) => upvote + 1);
};
const downVoting = () => {
setDownvote((downvote) => downvote - 1);... | true |
b2eb0ed6e84411a4439a5a0919165399e138e9b6 | JavaScript | eerick903/scb | /src/data/todos/reducer.js | UTF-8 | 641 | 2.734375 | 3 | [] | no_license | import { FETCH_TODOS_SUCCESS, TOGGLE_TODO } from './actions'
import R from 'ramda'
export const reducer = (state = {}, action) => {
switch (action.type) {
case FETCH_TODOS_SUCCESS: {
const { userId, todos } = action.payload
const todoObject = R.compose(
R.reduce((a, b) => {
a[b.id] = b
... | true |
3a75b78dd2e922dbc2e084800f6fa3ba3abb2233 | JavaScript | tonyfrenzy/stutern-milestone-project | /assets/js/scripts.js | UTF-8 | 4,064 | 3.109375 | 3 | [] | no_license | let memberForm = document.getElementById('memberForm');
let addBtn = document.getElementById('addBtn');
let membersList = document.getElementById('membersList');
let membersTable = document.getElementById('membersTable');
let membersJson = document.getElementById('membersJson');
let delMemberBtn = document.getElem... | true |
5c5b642f2254dc9a4f1dab5680e6028ec5051be1 | JavaScript | PinkyJie/generator-aio-angular | /app/templates/client/source/app/helper/ajax-error-handler.service.js | UTF-8 | 989 | 2.5625 | 3 | [
"MIT"
] | permissive | // Provide a unify handler to handle $http request failure
(function () {
'use strict';
angular
.module('app.helper')
.factory('ajaxErrorHandler', ajaxErrorHandlerService);
ajaxErrorHandlerService.$inject = ['ErrorMessage', '$q'];
/* @ngInject */
function ajaxErrorHandlerService (... | true |
699427e07df46f1f2ddde79ed6c639ed45c7c0c1 | JavaScript | keirbowden/Spring19TouchEvents | /src/aura/TouchTest/TouchTestHelper.js | UTF-8 | 3,839 | 2.71875 | 3 | [] | no_license | ({
canvas : null,
ctx : null,
empty: true,
mouse : {x: 0, y: 0},
empty: true,
setupCanvas : function(component)
{
try
{
if (!component.get('v.initialised')) {
this.log(component, 'Setting up canvas');
this.canvas = document.querySe... | true |
a4faedc16a7af407e5a4d90118e302e0ebd43642 | JavaScript | jjvein/mynode | /promise.js | UTF-8 | 548 | 3.359375 | 3 | [] | no_license | var fs = require('fs')
var file = 'file.txt'
function asyncFunction() {
return new Promise(function(resolve, reject){
/* var content = fs.readFile(file, "utf-8", function(err, ret){
if(err)
console.log(err)
resolve(ret)
})
*/
... | true |
27295b05d70acd4529530b00b014d25d67a2fd26 | JavaScript | LauraOberwetter/noteTaker | /Develop/routes/apiRoutes.js | UTF-8 | 860 | 2.78125 | 3 | [] | no_license | const fs = require("fs"); //required here and in storedNote....not sure if both are needed
const router = require('express').Router();
const storedNote = require('../db/storedNote'); //class from storedNote.js
//get /notes
router.get("/notes", (req, res) => { // making the endpoint
storedNote
.getStoredNote()
... | true |
24977a4e086aef72ba11f19d57aaa8b49dade362 | JavaScript | Naama271/REACT | /ex2.2/my-app/src/index.js | UTF-8 | 976 | 2.859375 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
// import './index.css';
// import App from './App';
// import reportWebVitals from './reportWebVitals';
// ReactDOM.render(
// <React.StrictMode>
// <App />
// </React.StrictMode>,
// document.getElementById('root')
//
function print(){
const ... | true |
6088571929b46391bdbcd793935d55afc72b3a8f | JavaScript | YatharthLakhera/Computer-Allocation-Web-App | /sign_up.js | UTF-8 | 1,384 | 2.578125 | 3 | [
"MIT"
] | permissive | function sign_up() {
var xhr = new XMLHttpRequest();
var url = "sign_up.php";
var name = document.getElementById("user_name").value;
var id = document.getElementById("user_id").value;
var email = document.getElementById("user_email").value;
var pass = document.getElementById("user_pass").value;
var dob = docu... | true |
a16b74e1874d934459539432145edc19353c36ee | JavaScript | kmorgan8588/movie-list-boilerplate | /client/src/components/SearchBar.jsx | UTF-8 | 854 | 2.5625 | 3 | [] | no_license | import React from 'react';
class SearchBar extends React.Component {
constructor(props) {
super(props);
this.state = {
query: ""
}
this.handleChange = this.handleChange.bind(this);
}
handleChange(event) {
let { value } = event.target;
this.setSt... | true |
684253a6e8d9d09428befbd5a06ec2cf3d9f3581 | JavaScript | tobbe-stalesjo/Chat_App | /src/main/resources/static/components/registerComponent.js | UTF-8 | 4,138 | 2.546875 | 3 | [] | no_license | import { router } from "../router.js"
export default {
template: `
<section class="registerSection">
<h1 class="registerPage">Welcome!</h1>
<nav>
<form name="regForm" class="registerForm" @submit.prevent="registerNewMember">
<h3 class="h3Register">Sign up:</h3>
... | true |
31af58ce8dd0dd12598aecd42812eb05744bcf14 | JavaScript | yyc-13/remote-assignments | /Week-3/Week3-Assignments/app.js | UTF-8 | 1,639 | 2.9375 | 3 | [] | no_license | const express = require('express');//express 套件載入到程式中
const cookieParser = require('cookie-parser');
const { render } = require('pug');
const app = express();//產生 Express Application 物件
app.use(cookieParser());
app.set('view engine', 'pug');
//<Assignment 1>
app.get('/', (req, res) => {
res.render("index")
});
... | true |
2068b62be6e366cb6220ca3293eac1d38098b416 | JavaScript | sarahmurraydev/playlist-cover-photo-geneator-ui | /src/reducers/rootReducer.js | UTF-8 | 4,683 | 2.546875 | 3 | [] | no_license | import * as types from '../actions/actionTypes';
import { initialState } from '../initialState';
// UI ACTIONS:
const toggleLoader = (state) => {
return {
...state,
...{
mainInlineLoader: !state.mainInlineLoader
}
}
}
const toggleLoadingModal = (state) => {
return {
... | true |
82bab547cc5b43e10921c8135787138dc291a44f | JavaScript | CharlyMannion/Thermostat | /interface.js | UTF-8 | 1,858 | 3.03125 | 3 | [
"MIT"
] | permissive | function UpdateUi(thermostat){
$('#temperature').text(thermostat.temperature);
$('#energy-usage').text(thermostat.energyUsage());
var usage = thermostat.energyUsage();
var cssUsage;
if(usage === 'low-usage') {
cssUsage = 'low-usage';
} else if (usage === 'medium-usage') {
cssUsage = 'medium-usage... | true |
f643d7a768596d1577c380903e8ee360ed552d82 | JavaScript | gaiaml/mindar-bot | /Utils/parsing.js | UTF-8 | 906 | 2.53125 | 3 | [] | no_license | var Search = require('./search.js');
var parsing = function() {
this.parseMovie = function (elements){
var result = array();
elements.movie.forEach(movie => {
var movieRes = {
title: {
originalTitle : movie.originalTitle,
usualTitle : movie.title,
code ... | true |
16a33abde555262f32a929d84a734eea2e85d6c0 | JavaScript | sterzhakov/dataql | /lib/__tests/createDataByQuery.spec.js | UTF-8 | 11,369 | 2.71875 | 3 | [] | no_license | /*eslint no-console: "off"*/
const B = require('berries');
const createDataByQuery = require('../createDataByQuery');
const entities = {
post: {
_id: 1,
name: 'Igor',
hello: 'world',
comments: [
{
_id: 1,
description: 'Hello world!',
authorId: 1,
},
{
... | true |
8b3044a098fea8c0f4eaf3936404f7fa9107a2be | JavaScript | wiesingerjonas/traumfaenger | /script/scripts.js | UTF-8 | 969 | 2.828125 | 3 | [] | no_license | let active = 0;
window.addEventListener('load', () => {
const arrowLeft = document.getElementById('arrowLeft');
const arrowRight = document.getElementById('arrowRight');
const imageBox = document.getElementById('overflowWrapper');
const howmany = 28;
const images = [];
const src = [];
for (let... | true |
de6dad5641db4c76c5fd98a850226076dede8afa | JavaScript | jpb18/brokenmirror | /Assets/Scripts/station/Station.js | UTF-8 | 3,434 | 2.515625 | 3 | [] | no_license | #pragma strict
class Station extends MonoBehaviour implements IFactionable, IPlayable, IBoardeable {
var health : Health;
var weapon : StationWeapons;
var factionInfo : FactionInfo;
var faction : int = -1;
var rotation : Vector3;
var strenght : int;
private var general : GeneralInfo;
private var message :... | true |
84e6d5c7656194a144d30e8de429d2fa0e85e17c | JavaScript | nikolajjuuel/spinner | /spinner2.js | UTF-8 | 258 | 2.953125 | 3 | [] | no_license | const spinner = ['\r|','\r/','\r-','\r\\','\r|','\r/','\r-','\r\\']
const spinner2 = function() {
let timer = 0;
for (const spin of spinner) {
timer += 100;
setTimeout(() => {
process.stdout.write(spin);
}, timer);
}
};
spinner2();
| true |
7b385631e121c79e8154c769d8ea71ea0ed6ec0a | JavaScript | bearylogical/capstone_ga | /deploy/static/js/graphv2.js | UTF-8 | 2,836 | 3 | 3 | [] | no_license | //Set margins and sizes
var margin = {
top: 20,
bottom: 50,
right: 30,
left: 50
};
var width = 960 - margin.left - margin.right;
var height = 700 - margin.top - margin.bottom;
//Load Color Scale
var c10 = d3.scale.category10();
//Create an SVG element and append it to the DOM
var svgElement = d3.select(... | true |
b4cce4d962a2850b7665b639800e8da642a00a5d | JavaScript | KioriSun/Canvas_BunnyMarks | /BunnyMark/Worker_RAF/game.js | UTF-8 | 3,247 | 2.875 | 3 | [
"MIT"
] | permissive | const Thread = new Worker('worker.js')
const canvas = document.createElement("canvas");
let cWidth = canvas.width = 800;
let cHeight = canvas.height = 600;
document.body.appendChild(canvas);
const ctx = canvas.getContext("2d");
const Bunny = new Image()
Bunny.src = "bunny.png"
let bWidth, bHeight
let... | true |
9244538bf12aad741cd72c0ed0c23239f28f8ce5 | JavaScript | rbeltranmontijo/apuntesJavascript | /js/app2.js | UTF-8 | 904 | 3.921875 | 4 | [] | no_license | // Creando funciones
//function declaretion
//se puede llamar antes que declararla
function saludar(nombre) {
console.log("Bienvenido ", nombre);
}
saludar("Juan");
//function expression
//En esta forma de declarar siempre hay que llamar la funcion despues de declararla
const cliente = function(nombreCliente) {
c... | true |
e60abf1a0792d2596e9876536403d3f6c41fddf1 | JavaScript | binaryjohn/quickNdirty | /assets/js/app/watermark.js | UTF-8 | 643 | 3.03125 | 3 | [] | no_license | var testString = "";
(function (){
$("#inputBx").bind("keyup",function (e){
var box =$("#inputBx");
var tempString = '';
var sourceString = box.val();
testString = sourceString;
console.log("Pressed"+testString);
for (characterOrDigit in sourceString){
te... | true |
550e06fa5b3f3677a0e715a63d589d47ab86af0f | JavaScript | Killiana/react-app | /src/Temperature.js | UTF-8 | 1,003 | 3.140625 | 3 | [] | no_license | import React, { useState } from "react";
import "./Temperature.css";
export default function Temperature(props) {
const [unit, setUnit] = useState("cels");
function getFahr(event) {
event.preventDefault();
setUnit("fahr");
}
function getCels(event) {
event.preventDefault();
setUnit("cels");
... | true |
e0426c2fd8b3ee6fba66ca396b0a2da8e9d8aa67 | JavaScript | rafii2000/Auction-Reminder-Website | /scripts/shop.js | UTF-8 | 2,550 | 2.78125 | 3 | [] | no_license |
var licences = {
"1_month": 1,
"6_months": 5,
"12_months": 10
};
var currencies = {
"usd": "$",
"euro": "€",
"zloty": "zł"
};
var payment_methods = {
"PayPal": "link",
"CreditCard": "link",
"BankTransfer": "link"
};
var sessions = 1;
var licence_price = 0;
var choosen_licence = undefined... | true |
bd261d196d430afb6ba8c643a52effe763de5eb2 | JavaScript | ana393/Reto3SimpleTrello | /src/components/NewInput/NewInput.jsx | UTF-8 | 2,032 | 2.71875 | 3 | [] | no_license | import React, { useState } from 'react';
import { connect } from 'react-redux';
import { addColumn, addCard } from '../../actions/AddingActions';
import './NewInput.scss';
const NewInput = (props) => {
const [formOpen, setOpenForm] = useState(false);
const [newItem, setNewItem] = useState('');
//Open and ... | true |