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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4db54b89944ea62aa6e3f35134f3961bc0a046cb | JavaScript | miilacg/scadae | /Tecnico/conhecimentotec.js | UTF-8 | 1,717 | 2.609375 | 3 | [] | no_license | function abre9(){
var q8 = document.getElementsByName('perg8');
if (q8[0].checked){
var q9 = document.getElementById('nove');
q9.classList.remove("esconde");
var p9 = document.getElementById('perg9');
p9.setAttribute("required", "required");
}else if (q8[1].checked){
... | true |
c8e2dbfa2a080ea78f9e40fb070ff41af3bacc37 | JavaScript | StringManolo/typescript-stuff | /example/compare.js | UTF-8 | 108 | 3 | 3 | [] | no_license | var compare = function (a, b) { return a === b ? 0 : a > b ? 1 : -1; };
console.log(compare("abc", "def"));
| true |
951e3ceb2a1d5f5c5d60f739803d9f59c79904ea | JavaScript | joanmarch/Barcelona_code_academy | /02_javascript/block8/exercise5.js | UTF-8 | 829 | 3.46875 | 3 | [] | no_license | function sorter(myArr, order='ascending'){
let result;
if (order === "ascending"){
result = ascending(myArr);
}else if (order === 'descending'){
result = descending(myArr);
}else{
return console.log("wrong order provided " + order + " please provide us with ascending or desce... | true |
d4148a7ab130af30fe5b4f6f1a6a7eb2047ebaba | JavaScript | Alex-CG/full-stack-js-cookbook-project | /src/components/menu-item/index.jsx | UTF-8 | 436 | 2.53125 | 3 | [] | no_license | import React from 'react'
class MenuItem extends React.Component {
constructor(props) {
super(props);
this.onClickRecipe = this.onClickRecipe.bind(this);
}
onClickRecipe(e) {
console.log(e.target.text);
e.preventDefault();
this.props.getRecipes(e.target.text);
}
render() {
return (
... | true |
8f54e1daf8590c2cc9daba9a3c6ecf274ea86b9c | JavaScript | radhe-shyam/react-search | /src/SearchBox/SearchBox.js | UTF-8 | 1,168 | 2.703125 | 3 | [] | no_license |
import React, { Component } from 'react';
class SearchBox extends Component {
constructor(props) {
super(props);
this.state = { keyword: '' };
}
submit(event) {
if (this.state.keyword) {
this.props.addSearch({
keyword: this.state.keyword,
... | true |
bb6e80c055efba5ce0a89d54e7dc24a05aee20bb | JavaScript | mcrocks999/nodecat | /catgenerator.js | UTF-8 | 1,607 | 2.8125 | 3 | [] | no_license | var assets = {
top: '',
middle: '',
bottom: ''
};
function repeatCat(image,repeat,x,source,callback) {
image.paste(62+(x*15), 0, source, function(err, image){
if (repeat>0) {
repeat--;x++;
repeatCat(image,repeat,x,source,callback);
} else {
callback(image);
}
});
}
function prepar... | true |
debdbadaf1e675d87f99ab424fa3159cbda947c2 | JavaScript | DualPlay/polcompballvalues-pl.github.io | /scripts/results.js | UTF-8 | 7,013 | 2.8125 | 3 | [
"MIT"
] | permissive | // Generated by CoffeeScript 2.5.1
//Gets variables from url query and parses them into individual variables
var active, annoying, antihorny, artist, behaving, boring, community, discriminatory, disliked, dist, edgy, funny, getQueryVariable, horny, i, inclusive, irony, jannyphile, jannyphobe, len, length, liked, lurker... | true |
4da941e3080519656c651688a5617866594ecea5 | JavaScript | mariogarciat/TriangulodePascal | /TrianguloPascal.js | UTF-8 | 752 | 3.265625 | 3 | [] | no_license | function pascal(n) {
salida = [];
for (var i = 0; i < n; i++) {
salida[i] = [];
}
for (var i = 0; i < n; i++) {
for (var j = 0; j < n; j++) {
if (i === 0 || j === 0) {
salida[i][j] = 1;
} else {
salida[i][j] = 0;
}
... | true |
7e2ef260c9f35b00ac3f64afb25921dd1ffa04ed | JavaScript | dok/databases | /client/scripts/simpleEngine.js | UTF-8 | 581 | 3.109375 | 3 | [] | no_license | var engine = {};
engine.regex = /{{\s*[\w.]+\s*}}/g;
// E.g. templateSelector = messageTemplate
// data = { username: '<script>alert("turtles");</script>', description: 'i like turtles' }
engine.generateRegex = function(keyword) {
return new RegExp('{{ ' + keyword + ' }}', 'g');
};
engine.render = function(templat... | true |
2e5f04a48c87594a292a88240f0f820f5ec8bf65 | JavaScript | GHCat-dev/RentalAPI | /models/movie.js | UTF-8 | 893 | 2.578125 | 3 | [] | no_license | const {genreSchema, genreInputSchema} = require('./genre');
const Joi = require('joi');
const mongoose = require('mongoose');
// SCHEMAS
// Input Schema:
const movieInputSchema = Joi.object({
title: Joi.string().required(),
genre: genreInputSchema.required(),
numberInStock: Joi.number().required(),
dai... | true |
3a29576adb3a46efb1fa3da43b17856e38e4c0fb | JavaScript | tokyosheep/illustratorPractice | /gradient/writeGradient.jsx | UTF-8 | 3,356 | 3.28125 | 3 | [] | no_license | /*
This is exmaple how to get gradient data from selected item on Illustrator
get gradient property and then write it down on Illustraotr document
extrelmly dificult to understand object model on Illustrator
even you can't get some certain object or property through the for in method
I hope It'll help someone's study
... | true |
e817b09388caf519361b5508b564c9e08754fc86 | JavaScript | dongyuekai/part5-01_NodeJs_base_core_net | /11TCP/client.js | UTF-8 | 765 | 2.625 | 3 | [] | no_license | const net = require('net')
const MyTransform = require('./MyTransform')
let overageBuffer = null
let ts = new MyTransform()
const client = net.createConnection({
host: 'localhost',
port: 1234
})
client.write(ts.encode('拉勾教育1'))
client.write(ts.encode('拉勾教育2'))
client.write(ts.encode('拉勾教育3'))
client.write(ts.en... | true |
9e6b4d38e033200a3c325b7ca504ab9d1244e02c | JavaScript | liyaSileshi/few21-final | /goldenRatio.js | UTF-8 | 355 | 3.984375 | 4 | [] | no_license | /*
Challenge 1: Golden Ratio
The Golden Ratio is a value used in art and design. It also appears in nature. We need a function to calculate the value.
Your function should take any number as a parameter and return that number times 1.61803398875
*/
function goldenRatio(num) {
return num * 1.61803398875;
}
module.... | true |
71876afd4973dd00140797faa264b11197a59fd7 | JavaScript | ppflower/totalProject | /ServerClasses/NPC.js | UTF-8 | 10,336 | 2.625 | 3 | [
"MIT"
] | permissive | var MovableObject = require('./MovableObject');
var THREE = require('three');
var Bullet = require('./Bullet');
class NPC extends MovableObject {
constructor(NPCID) {
super(NPCID);
this.playerID = NPCID;
this.level = 1;
this.damage = 1;
this.maxHealth = 999999;
thi... | true |
ed899c866fee0a8dafe851c258ba4bfb2dbfb5b3 | JavaScript | pmatsinopoulos/react-07-working-with-forms-in-react | /js/Content.js | UTF-8 | 4,689 | 2.515625 | 3 | [] | no_license | class Content extends React.Component {
constructor(props) {
super(props);
this.state = {
programmingLanguage: {
angular: false,
react: false,
polymer: false
},
favouriteColor: {},
selectExample: "",
accountNumber: ""
};
this.handleProgrammingLangu... | true |
9eb9e10ff35eb1c3c4875a260093f1b5300ac0fb | JavaScript | puru101/microservice-demo | /postbookdemo/src/main/webapp/main.js | UTF-8 | 468 | 2.859375 | 3 | [] | no_license | var posts;
function mapPosts() {
var list = '';
for (var i = 0; i < posts.length; i++) {
list += "<li class='list-group-item'>"
+ posts[i].title
+ "</li>"
}
document.getElementById('list').innerHTML = list;
}
function getPosts() {
fetch('http://localhost:8080/postbo... | true |
880f9ae16b94ec2cc2d08f0bcb1cb02882c0a054 | JavaScript | ZJM1999/vue-music | /src/common/js/jsonp.js | UTF-8 | 635 | 2.6875 | 3 | [] | no_license | import originJsonp from 'jsonp'
export default function jsonp(url,data,options){
//处理带参数的url
url+=url.indexOf('?')<0?'?':'&'+handle(data)
//所有异步请求数据一般都封装成promise
return new Promise((resolve,reject)=>{
originJsonp(url,options,(err,data)=>{
if(!err){
resolve(data)
}else{
reject(er... | true |
b83139d2f9057b4806cd723467452037b252149c | JavaScript | Buzzinoffbond/shri-api | /js/shri.js | UTF-8 | 5,460 | 3.328125 | 3 | [] | no_license | /**
* Реализация API, не изменяйте ее
* @param {string} url
* @param {function} callback
*/
function getData(url, callback) {
var RESPONSES = {
'/countries': [
{name: 'Cameroon', continent: 'Africa'},
{name :'Fiji Islands', continent: 'Oceania'},
{name: 'Guatemala', c... | true |
de85fb7cf1c368d3c99f1a8667b658f76072cebf | JavaScript | AntonSmyrnoff/smirnov_js_21-22__es6 | /js/dist/script.js | UTF-8 | 3,608 | 2.921875 | 3 | [] | no_license | 'use strict';
var test = {
testHeader: 'Тест по программированию',
questionList: [{
question: 'Вопрос №1',
answerVariants: ['Вариант ответа №1', 'Вариант ответа №2', 'Вариант ответа №3'],
rightAnswer: 1
}, {
question: 'Вопрос №2',
answerVariants: ['Вариант ответа №1', 'Вариант ответа №2', 'В... | true |
82ed037a71440bf51641f9164791eb92942b8792 | JavaScript | Jucara/js-web | /ex1-5bis/script.js | UTF-8 | 948 | 2.53125 | 3 | [] | no_license |
// import some polyfill to ensure everything works OK
import "babel-polyfill"
// import bootstrap's javascript part
import 'bootstrap';
// import the style
import "./style.scss";
/*
Put the JavaScript code you want below.
*/
import img1 from './980x.jpg';
import img2 from './38588p.jpg';
import img3 from './cat1.... | true |
fad51090589fb7bbc707cc0bd09c412d697f7e03 | JavaScript | micromark/micromark | /packages/micromark-core-commonmark/dev/lib/code-fenced.js | UTF-8 | 10,393 | 2.609375 | 3 | [
"MIT"
] | permissive | /**
* @typedef {import('micromark-util-types').Code} Code
* @typedef {import('micromark-util-types').Construct} Construct
* @typedef {import('micromark-util-types').State} State
* @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
* @typedef {import('micromark-util-types').Tokenizer} Tokeniz... | true |
32282afc9dcfadbab2b506ecf9afd1be51ce527e | JavaScript | dcolley/camunda-client-subscribe-multi | /workers/task-two.js | UTF-8 | 368 | 2.53125 | 3 | [
"MIT"
] | permissive |
const taskTwoWorker = async function({ task, taskService }) {
// Put your business logic here
// Get a process variable
// const amount = task.variables.get('amount');
// const item = task.variables.get('item');
console.log(`Task two running...`);
// Complete the task
await taskService.comp... | true |
7f811c60c4b83043990e771296d769deb8a17066 | JavaScript | Ryan-yang125/WebTools | /JS/utils/px2rpx.js | UTF-8 | 875 | 2.609375 | 3 | [] | no_license | const fs = require("fs");
const path = require("path");
const folder = "/Users/apple/MiniProjects/serverless/client/pages/";
const pxTorpx = sub => {
const rate = 750 / 414;
const toInt = x => ~~x;
const isAcss = str => str.split(".")[1] === "acss";
const reg = /([0-9]+)px/g;
const pathToSub = path.... | true |
ce780ba3c9b10d05c13ed6ca1d734a919ecffb7b | JavaScript | Strovala/letsfuk-frontend | /src/store/reducer.js | UTF-8 | 1,569 | 2.53125 | 3 | [] | no_license | import {ActionTypes, Screens} from "../globals/constants";
const initialState = {
authenticated: false,
screen: Screens.LOGIN,
user: null,
receiver: null,
webSocket: null,
chats: null,
stationChat: null,
activeChat: null,
};
const reducer = (state = initialState, action) => {
swit... | true |
e67f75aaea83468fd30fb3fb07f4cab6711a5950 | JavaScript | FredericJacobs/Fragile_Oasis | /view/scripts/popup.js | UTF-8 | 5,990 | 2.640625 | 3 | [
"MIT"
] | permissive | // Scollbar
var scrollbarVisible = false;
var animation = !isMobile;
$().ready(function() {
$(".wrapper").bind("scroll", function() {updateScrollbar()});
$(window).bind("resize", function() {updateScrollbar()});
});
function updateScrollbar() {
contentHeight = $("#popup .content").outerHeight(true);
wrapperHeight... | true |
39bc5739adc0e5e07d7ace0aced394567a461590 | JavaScript | vanmax75/RestaurantApp | /app/routes/html-routes.js | UTF-8 | 1,808 | 2.75 | 3 | [] | no_license | // *********************************************************************************
// html-routes.js - this file offers a set of routes for sending users to the various html pages
// *********************************************************************************
// Dependencies
// =================================... | true |
5095084b7ffa400c393fb428ffeb41c20dcb44da | JavaScript | vyaskhushboo26/Calculator | /index.js | UTF-8 | 2,978 | 3.625 | 4 | [] | no_license | var firstOperand = "";
var secondOperand = "";
var operator = "";
function updateDisplayWithValue(digit) {
//Get the existing value in 'cname' element
var existingValue = document.getElementById("cname").innerText;
var upperValue = document.getElementById("pname").innerText;
console.log("existingValue:", exis... | true |
def79e56d49e216965f8cc6b9e8ebb4112ce5b83 | JavaScript | 2944927590/sample-library | /gen.js | UTF-8 | 934 | 2.546875 | 3 | [] | no_license | require('dotenv').config();
const config = require('./config.json');
const fsEx = require('fs-extra');
const path = require('path');
console.log(process.env.project);
async function copyFolder(sourcePath, targetPath) {
try {
await fsEx.copy(sourcePath, targetPath);
console.log(`复制成功:${sourcePath} => ${targe... | true |
05a4217e16b091a044752425de277473c1519877 | JavaScript | pushu0/url-shortner | /api/test/url.test.js | UTF-8 | 1,937 | 2.625 | 3 | [
"MIT"
] | permissive | const app = require("../src/server/index"); // Link to your server file
const supertest = require("supertest");
const request = supertest(app);
import { connectDb, disconnectDb } from "../src/db/connection";
import UrlModel from "../src/db/models/Url.model";
describe("api", () => {
let db;
const mockUrl = {
id... | true |
c0239db224fb1246ed74a343aaf8a3140baad57e | JavaScript | LaetitiaCorre/game | /js/classAnswer.js | UTF-8 | 311 | 2.640625 | 3 | [
"MIT"
] | permissive | class Answer {
/**
*
* @param {*} message Texte de la réponse
* @param {*} question Question liée à la réponse
*/
constructor (message, question, repercussion) {
this.message = message;
this.question = question;
this.repercussion = repercussion;
}
} | true |
f0a5750e10d6d294ecd22f33c1464dd3c459a77b | JavaScript | ankitagrawal7/react-flux-todo | /react-flux/src/stores/Store.js | UTF-8 | 2,897 | 2.65625 | 3 | [] | no_license | import { EventEmitter } from 'events';
import AppDispatcher from '../dispatchers/Dispatcher';
const API_URL = 'http://localhost:5000/';
class Store extends EventEmitter {
constructor(){
super();
this.todos = [];
this.analytics = []
this.fetchTodos();
this.fetchCount();
}... | true |
2374f280c2d42333ce966cc95c939436b253fb2e | JavaScript | axelrinaldiwanadoofr/stageALL | /app/cms/cmsnodesizer.js | ISO-8859-1 | 3,092 | 2.546875 | 3 | [] | no_license |
function CmsNodeSizer( modele, xfieldname, yfieldname, widthfieldname, heightfieldname, x, y, imagesrc, imgwidth, imgheight, xmin, xmax, ymin, ymax )
{
herite( CmsNodeSizer, Bougeur, true ) ;
herite( CmsNodeSizer, MvcView ) ;
this.initCmsNodeSizer( modele, xfieldname, yfieldname, widthfieldname, heightfieldname... | true |
3402de8710577cca23bef3b3e89cb39074024857 | JavaScript | sebseb7/rtmp-fallback-loop | /rtmp-fallback.js | UTF-8 | 1,792 | 2.578125 | 3 | [] | no_license | #!/usr/bin/env node
const spawn = require("child_process").spawn;
const input_rtmp = 'rtmp://127.0.0.1/feed/1';
const loop_file = 'loop.mp4';
const out_rtmp = 'rtmp://127.0.0.1/feed/3';
const timeout = 10; // in 1/10th of a second
function log(data){
console.log('['+(new Date(Date.now())).toISOString()+'] '+dat... | true |
08092c444d704e07cce5bb246ff1d88137543be8 | JavaScript | Almsrr/react-meals | /src/store/CartProvider.js | UTF-8 | 2,653 | 2.609375 | 3 | [] | no_license | import React, { useReducer } from "react";
import CartContext from "./cart-context";
const defaultCartState = {
items: [],
totalAmount: 0,
};
const cartReducer = (state, action) => {
if (action.type === "ADD_ITEM") {
// Calculate total price
const updatedTotalAmount =
state.totalAmount + action.i... | true |
b90c67c1f5d947898210cb2c26c801c0e6c3ff2e | JavaScript | WebToStep/Herows | /js/counters/filteredLenght.js | UTF-8 | 1,015 | 2.703125 | 3 | [] | no_license | import { getData } from '../scrypts/data.js';
export const filteredLenght = () => {
const small = document.querySelectorAll('small');
getData()
.then(data => {
small.forEach(e => {
const key = e.parentNode.getAttribute('for').split('-')[0].toLowerCase();
let ... | true |
9696a00a98cf6467633ff7a423d1eeaf99bd3998 | JavaScript | Estorozh/FSD-Toxin | /src/pug/blocks/__elements/header/header.js | UTF-8 | 202 | 3.09375 | 3 | [] | no_license | let burger = document.querySelectorAll('.burger');
for(i=0; i<burger.length; i++) {
burger[i].addEventListener('click', function(e) {
e.target.parentNode.classList.toggle('show');
});
} | true |
6a58436037d1b8b6267b8b0840ee695b25f55c32 | JavaScript | machale/adventofcode | /adventofcode2020/day04/part2.js | UTF-8 | 3,983 | 3.125 | 3 | [] | no_license | let fs = require('fs')
// Read one entire passport, including embedded newlines,
// spaces and colons, into each element of arr
let arr = fs.readFileSync('input.txt').toString().split('\n\n')
// Drop any trailing newline/whitespace at end of file
arr[arr.length-1] = arr[arr.length-1].trim()
// console.log(arr)
// conso... | true |
037fbf394ba08e68d7d96de3b6ae02f17c7c4a89 | JavaScript | oliviagardiner/green-fox-projects-oliviaisarobot | /week-08/day-01/04.js | UTF-8 | 3,440 | 3.640625 | 4 | [] | no_license | // Create a constructor for creating Aircrafts,
// and one for creating Carriers,
// based on the specification in the python exam: https://github.com/greenfox-academy/zerda-exam-python-retake
'use strict';
function Aircraft(type) {
this.type = type;
this.ammo = 0;
this.alldmg = 0;
if (type === 'F16') {
t... | true |
e2e09f427bd8031794af15efa8f3d7ab333f70eb | JavaScript | Andreagaviria/DWFS_Guifos | /js/giphyAPI.js | UTF-8 | 1,470 | 2.8125 | 3 | [] | no_license | class gifosAPI {
async getGif(amount) {
const apiRespuesta = await fetch(
`https://api.giphy.com/v1/gifs/trending?api_key=7107gIYllETNXLPM3ARVtGMcISbn6dCy&limit=${amount}&rating=G`
);
const gif = await apiRespuesta.json();
console.log(gif);
return {
gif,
};
}
async busquedaGi... | true |
098126d4736b01e4e5e3cef26ada726c2eee09b8 | JavaScript | teddylopez/tedSurf | /assets/scripts/app.js | UTF-8 | 11,156 | 2.703125 | 3 | [] | no_license | function renderReportPage(id) {
const loadingContainer = document.querySelector("#loading-container");
loadingContainer.classList.add("display");
const map = document.getElementById("map");
const report = document.getElementById("report");
map.classList.toggle("hide");
report.classList.toggle("hide");
co... | true |
f7fc358f636792966f6e9445d65430e36d59ee97 | JavaScript | ml242/nysb | /index.js | UTF-8 | 2,040 | 2.75 | 3 | [] | no_license | "use strict"
var request = require("request"),
cheerio = require("cheerio"),
mysql = require('mysql'),
fs = require('fs');
var connection = mysql.createConnection({
host: 'localhost',
user: 'root',
port: 3306,
password: 'password',
database: 'nyskiblog',
multipleStatements: true
});
... | true |
fb4633caa0d0067b2a32c0de07a596aad83cbc35 | JavaScript | i4han/incredibles | /spec/incredibles_spec.js | UTF-8 | 5,105 | 2.8125 | 3 | [] | no_license |
let in$ = require('../src/incredibles.js')
describe( "Bin$", () => {
let a = in$({a:1, b:3, c:3, d:4})
let b = in$({})
let c = in$({a: o => o.name})
let d = in$({a:{b: v => v.name}})
it("in$.from",
() => expect(in$.from({a: 1}).value).toEqual({a:1}) )
it("set",
() => expect(b... | true |
920efe4c1fc27465dffe23b32fad5a6cb7a797b3 | JavaScript | Kreins/UFind | /app/src/actions/users.js | UTF-8 | 1,313 | 2.6875 | 3 | [] | no_license | // Send a request to check if a user is logged in through the session cookie
import bkimg from "../img/home-books.jpg";
export const checkSession = (app) => {
const url = "/users/check-session";
fetch(url)
.then(res => {
if (res.status === 200) {
return res.json();
... | true |
2cf4ec5665334e30e0248b6883ada0a514c1f144 | JavaScript | fourtap/Team1 | /public/js/userprofilehelper.js | UTF-8 | 2,078 | 2.9375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | 'use strict';
var data;
// Call this function when the page loads (the "ready" event)
$(document).ready(function() {
initializePage();
})
/*
* Function that is called when the document is ready.
*/
function initializePage() {
$('#addsource').click(chooseSource);
$('#submittedusername').click(addSource);... | true |
92d3d504cfb3c805cf3abb6f8a3935306b5b3bcd | JavaScript | adriancorcoran/leveluptuts-react-testing-for-beginners | /src/movies/__tests__/MoviesList.test.js | UTF-8 | 2,450 | 2.640625 | 3 | [] | no_license | import React from "react";
// waitForElement - waits for a little bit for an element to be on the screen
// but fails the test eventually
import {
render,
cleanup,
waitForElement,
getByText,
getAllByTestId
} from "react-testing-library";
import { MemoryRouter } from "react-router-dom";
import MoviesList from ... | true |
dfaca40c1d1d3ad032741e914b059dbd34a48311 | JavaScript | wangeastsea/basic-knowledge | /前端基础/练习/js基础知识/eventEmitter/event.js | UTF-8 | 1,305 | 3.46875 | 3 | [] | no_license |
// 实现一个简单的eventEmitter, 所有操作都是同步的。
class EventEmitter {
constructor(options = {}) {
this.events = {}
this.maxListeners = options.maxListeners || Infinity
}
// 触发事件
emit(eName, ...args) {
if (this.events[eName]) {
this.events[eName].forEach(fn => fn.apply(this, args))... | true |
0322a903e17a7a2574ebdc361dee19ab573b160d | JavaScript | m0nzderr/clearest | /test/tool/expression.js | UTF-8 | 2,450 | 2.640625 | 3 | [
"MIT"
] | permissive | /*
* Clearest Framework
* Provided under MIT License.
* Copyright (c) 2012-2015 Illya Kokshenev <sou@illya.com.br>
*/
"use strict";
var
chai = require("chai"),
expect = chai.expect,
ex = require("../../tool/expression");
describe("tool / expression syntax",function(){
it("should tokenize valid ... | true |
0c929967dfe07b828bbf14a50a852bbff9ed1e8e | JavaScript | jmcgill/p5-preview | /hpgl/rendering.js | UTF-8 | 3,688 | 2.65625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"CC0-1.0"
] | permissive | var constants = require('./constants');
module.exports = function(p5) {
// Patch p5.Graphics for allow a HPGL renderer to be constructed, wrapping the default 2D renderer.
var _graphics = p5.Graphics;
p5.Graphics = function(w, h, renderer, pInst) {
var args = arguments;
_graphics.apply(this... | true |
fed15c0ebb5d885e0cdcc5012a1db8e7e6055f8b | JavaScript | phattanotai/standard-next-admin-lte | /pages/index.js | UTF-8 | 1,819 | 2.515625 | 3 | [] | no_license | import React, { useState } from "react";
import AdminLayoutHoc from "../components/Layout/AdminLayoutHoc";
export default function Home() {
const [auth, setAuth] = useState({ email: "", password: "", remember: "" });
const handleChange = (evt) => {
const { id, value } = evt.target;
setAuth((prevState) => ... | true |
9bd889b7debe4af868c06211494ed2394579e092 | JavaScript | amygeis/Simon | /js/script.js | UTF-8 | 6,828 | 3.375 | 3 | [] | no_license |
//need button class and 4 buttons
const startButton = document.querySelector(`#start`);
const startClick = startButton.addEventListener("click", startGame);
const levelButton = document.querySelector(`#level`);
const selectedLevelList = document.querySelector(`#difficulty`);
const selectedLevel = selectedLevelList.opt... | true |
7f5905a2686b7798e8057462d6c72a0ba62a2c39 | JavaScript | RodrigoRosa7/FoodfyDesafios | /3_AdministracaoFoodfy/controllers/site.js | UTF-8 | 779 | 2.75 | 3 | [] | no_license | const data = require('../data.json')
exports.index = function(req, res){
const recipesFiltered = []
for(let i = 0; i < 6; i++){
const obj = data.recipes[i]
obj.index = i
recipesFiltered.push(obj)
}
return res.render('site/home', {items: recipesFiltered})
}
exports.show = function (req, res... | true |
f04d589cb4db48a12c07984947983f2d1929bb94 | JavaScript | dallenpyrah/latewinter2021-gregslist | /app/Services/JobsService.js | UTF-8 | 3,694 | 2.625 | 3 | [] | no_license | import { ProxyState } from "../AppState.js"
import Job from "../Models/Jobs.js"
import Jobs from "../Models/Jobs.js"
import { api } from "./AxiosService.js"
class JobsService{
// constructor(){
// console.log("Hello from jobs service controller!")
// this.getJobs()
// }
// async getJobs()... | true |
95e88ded76ebd70dd20dbf1186f4803d5853491a | JavaScript | rocksolidwebdesign/mandle.js | /src/ui.js | UTF-8 | 4,094 | 2.640625 | 3 | [
"BSD-2-Clause"
] | permissive | var Throbber = require('./spinner');
var App = require('./app');
var Mandle = require('./mandle');
function onRender(m) {
if (m.is_rendering) {
return false;
}
var throbEl = document.getElementById('render_spinner');
var throb = new Throbber(throbEl);
throb.show();
m.is_rendering = true;
App.genera... | true |
39f8890d6a01eecd91c1868c587101a951795c3d | JavaScript | dtn75570/fixIt7JulieNg.appstudio | /forms/strings/strings.js | UTF-8 | 2,086 | 5 | 5 | [] | no_license | //Create a variable named quoteString and put this string in it: "Failure is simply the opportunity to begin again this time more intelligently."
let quoteString = "Failure is simply the opportunity to begin again this time more intelligently."
//Using a string method, change the text in quoteString to all upper case ... | true |
6501a831fee22538db6dd6a45c21f746537d112a | JavaScript | benbahrenburg/Ti.Safari.ReadingList | /example/app.js | UTF-8 | 2,146 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive |
var readinglist = require('bencoding.reading.list');
Ti.API.info("module is => " + readinglist);
var win = Ti.UI.createWindow({
backgroundColor:'#fff', layout:'vertical'
});
var lazyHelpers = {
getLabel : function(title){
return Ti.UI.createLabel({
text:title,top:25,left:7,backgroundColor:'#999', color:'#fff'... | true |
c0e252bbb323cd5d197930232981595d30709b50 | JavaScript | amendiolar/data-structures | /ejercicio5.js | UTF-8 | 1,479 | 4.40625 | 4 | [] | no_license |
/*
5.- Se tiene una cola de colores y se tiene que dividir en dos colas, respetando el orden y alternando a partir de su índice. los pares en una y los nones en otra
Cola 1: [ amarillo, rosa, rojo, verde, azul, negro, morado, blanco]
Cola 2: [ amarillo, rojo, azul, morado]
Cola 3: [rosa, verde, negro, blanco]
*/
// L... | true |
011368e2ec27a9ebb3d885b80dc52805630694bc | JavaScript | BobbyPotatoBob/Index.js | /commands/economy/sports.js | UTF-8 | 3,652 | 2.59375 | 3 | [
"MIT"
] | permissive | const Discord = require("discord.js")
const db = require("quick.db")
const ms = require("parse-ms")
const eco = require("discord-economy")
const color = require("../../colors.json")
const { logo, emojiID } = require("../../config.json")
module.exports = {
name: 'sports',
description: 'Play any sport to (try an... | true |
2eb6dfd89e1b5f3c32761cc436d04c6f2b11bb93 | JavaScript | Khodesaeed/todo-server | /controllers/userController.js | UTF-8 | 1,563 | 2.546875 | 3 | [] | no_license | const { User } = require('../models');
async function createUser(req, res) {
try {
const user = await User.create(req.body);
return res.send(user);
} catch (err) {
console.log(err);
return res.status(500).json(err)
};
};
async function indexUser(req, res) {
try {
... | true |
b79222003ad1564d01e2409d6cdcaf63c14c41f1 | JavaScript | RossKostenko/ssa_jsbasics_homeworks | /homework_08_RegExp.js | UTF-8 | 2,065 | 3.21875 | 3 | [] | no_license | // Task 1 works
function upperCase(str) {
return /^[A-Z]/.test(str);
}
upperCase("a");
upperCase("Aa");
upperCase("aA");
// Task 2 works
function checkMail(str) {
let mailPattern = /^[\w-\.]+@[\w-]+\.\w{2,4}/;
return mailPattern.test(str);
}
checkMail("iamhere@gmail.com");
// Task 3 works
function findD(str... | true |
1eee59a642d0d603b799a7db85cc3c0ab19938e8 | JavaScript | Georgge/pagatodo-challenge | /app/redux/ducks/bankDuck.js | UTF-8 | 2,978 | 2.8125 | 3 | [] | no_license | import { AsyncStorage } from 'react-native'; // * For futere from community package
import { getBanksList } from '../../services/bankServices';
// INITIAL STATE
const bankState = {
array: [],
fetching: false,
status: null,
message: '',
local: false,
}
// CONSTANTS
const PREFIX = 'BANK/';
const FETCHING = `... | true |
38449184b541952eeae7472af3d88e200a4d6c6e | JavaScript | Sivaprasathh/speed_tester | /script.js | UTF-8 | 1,410 | 3.5625 | 4 | [] | no_license | const testWrapper = document.querySelector(".test-wrapper");
const testArea = document.querySelector("#test-area");
const originText = document.querySelector("#origin-text p").innerHTML;
const resetButton = document.querySelector("#reset");
const theTimer = document.querySelector(".timer");
let timer = 0 ;
let interval... | true |
f61af30d26b139b37de752b92c71c736e819f3a9 | JavaScript | bavdhankarar/bavdhankarar | /minskole-4/objectThis.js | UTF-8 | 9,172 | 4.5625 | 5 | [] | no_license |
// // let objectA = {
// // 'age':10,
// // 'rollNum':30
// // }
// // // Bracket notation
// // // console.log(objectA['age'])
// // // console.log(objectA['rollNum'])
// // // // Dot notation
// // // console.log(objectA.age)
// // // console.log(objectA.rollNum)
// // // // properties and method
// // ... | true |
c910fa3f501d04e2719452b7ff017cc67c3d777b | JavaScript | thanhn51/LT_mang_01 | /bai2/my.js | UTF-8 | 317 | 3.234375 | 3 | [] | no_license |
let nums = []
let n = +prompt("nhap so luong so muon test")
let max = 0
for (let i = 0; i < n; i++) {
num = +prompt("nhap gia tri")
nums.push(num)
}
for (let i = 1; i < nums.length; i++) {
if (max < nums[i]) {
max = nums[i]
}
}
document.write("value: " + max + " position: "+ nums.indexOf(max)) | true |
f18891d1e31b0859bbb40b2edb4a76e9cb009ae8 | JavaScript | mattyc246/ProjectAlgo | /src/stores/userStore.js | UTF-8 | 3,132 | 2.546875 | 3 | [] | no_license | import { decorate, observable, action } from "mobx";
import axios from "axios";
import url from "../constants/urls";
class UserStore {
login = {
email: "",
password: "",
};
userToken = localStorage.getItem("authToken");
userData = JSON.parse(
localStorage.getItem("userData")
? atob(localStora... | true |
71f1114f6c9e76630ebc7f37f831a0fd51e78050 | JavaScript | HamishMcDougall/ff-bitb | /public/MyScriptJS-1.1.0/test/unit/common/generic/quadraticPoint.js | UTF-8 | 3,435 | 2.875 | 3 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"MIT"
] | permissive | 'use strict';
describe('QuadraticPoint: common/generic/quadraticPoint.js', function () {
describe('Default construction', function () {
var quadraticPoint;
before(function (done) {
quadraticPoint = new MyScript.QuadraticPoint();
done();
});
it('Check initi... | true |
160b73478607c5f692467b8d85adbd19a08d120c | JavaScript | dmamaril/algorithms-js | /046. Permutations.js | UTF-8 | 971 | 3.75 | 4 | [] | no_license | /**
* 46. Permutations
* https://leetcode.com/problems/permutations/
*
* Given a collection of distinct numbers, return all possible permutations.
*
* For example,
*
* [1,2,3] have the following permutations:
*
* [
* [1,2,3],
* [1,3,2],
* [2,1,3],
* [2,3,1],
* [3,1,2],
* [3,2,1]
* ]
*/... | true |
5e4caba7ee9c87a0bb41d29ee2d859c2ff6160a3 | JavaScript | Baek2back/Programmers-with-JS | /Level-2/폰켓몬.js | UTF-8 | 201 | 2.921875 | 3 | [] | no_license | function solution(nums) {
const map = nums.reduce((obj, num) => {
obj[num] = obj[num] ? obj[num] + 1 : 1;
return obj;
}, {});
return Math.min(nums.length / 2, Object.keys(map).length);
}
| true |
a19f981414df485e6acef32031064b3cb7efd2d7 | JavaScript | wenber/test | /efcstudy/dep/fc-core/0.0.1-alpha.7/src/browser.js | UTF-8 | 8,270 | 2.6875 | 3 | [
"MIT"
] | permissive | /**
* @file Provide the basic browser enviroment information, such as
* - user agent
* - browser shell
* - OS system
* - flash
* - user screen dimension
*
* @author Zhifen Lin(linzhifen@baidu.com)
* @author Lijie Chen(chenlijie@baidu.com)
* @author Leo Wang(wangkemiao@baidu.com)
*/
define(fun... | true |
f1e93e3a27fad61213fadd14252b64b2755a71ff | JavaScript | yjjnls/awesome-blockchain | /src/ERC20/test/erc20.js | UTF-8 | 10,601 | 2.796875 | 3 | [
"MIT"
] | permissive | "use strict";
let assertRevert = async (promise) => {
try {
await promise;
} catch (error) {
const revertFound = error.message.search('revert') >= 0;
assert(revertFound, `Expected "revert", got ${error} instead`);
return;
}
assert.fail('Expected revert not received');
};... | true |
ab0df3a9af14028fc24c87b0b2a3c0592f140ee6 | JavaScript | wowpanda/fivem-fxadmin | /src/config-tester.js | UTF-8 | 4,863 | 2.640625 | 3 | [
"MIT",
"CC-BY-3.0"
] | permissive | //Requires
const fs = require('fs');
const { spawnSync } = require('child_process');
const { dir, log, logOk, logWarn, logError, cleanTerminal } = require('./extras/console');
cleanTerminal()
function fatalRequired(varName){
logError(`The following variable was not set and is required: '${varName}'`);
process.... | true |
0d7fdfd5be169a9cd3d78dd1384f6520a9487fb6 | JavaScript | alisondorr/Oregon_Trail2 | /assets/script/Wagon.js | UTF-8 | 1,798 | 3.859375 | 4 | [] | no_license | //Oregon Trail Project
//Wagon class has these properties: capacity, and passengers (initialized to an empty array)
class Wagon {
constructor(capacity, passengers = []) {
this.capacity = capacity
this.passengers = passengers
} //Wagon has these methods: getAvailableSeatCount, join, shouldQuarant... | true |
452de6b2bd667ba600725127991d0890bf11e4a3 | JavaScript | wcafricanus/redblacktreeJS | /src/index.js | UTF-8 | 2,260 | 3.03125 | 3 | [] | no_license | const RBTreeNode = require('../model/rbtreenode');
const RedBlackTree = require('../model/redblacktree');
const PositionArranger = require('../positionarranger');
const RBTreeVM = require('../src/rbtreevm');
let canvas = document.getElementById("myCanvas");
let ctx = canvas.getContext("2d");
let drawer = new RbTr... | true |
ebea4c1ac1f5482848c73b706d3471f3eb6fc08a | JavaScript | lukescheer/CodeBreakers-Project | /frontend/src/pages/Home.js | UTF-8 | 3,481 | 2.703125 | 3 | [] | no_license | import React, {Component} from 'react';
import {Col, Row, Nav} from 'react-bootstrap'
import Route from 'react-router-dom/Route';
import NavLink from 'react-bootstrap/NavLink';
import '../css/home.css'
// Stuff relating to the home page
class Home extends Component {
// Run when this is loaded.
componentDidMou... | true |
d8562c6bb0f3e1abc19013b7ad46d48409050395 | JavaScript | aasheesh333/pwddriveapi | /app/controllers/book.controller.js | UTF-8 | 3,492 | 2.96875 | 3 | [] | no_license |
const Book= require('../models/book.model.js');
// Create and Save a new Book
exports.create = (req, res) => {
// Validate request because in model we required the title
if(!req.body.title) {
return res.status(400).send({
message: "Please enter book title."
});
}
// Get all and ret... | true |
43dc0d4f446b5a40f3d7d01defb3d3a6ba829182 | JavaScript | matheusjkl1/trybe-exercises | /exercises/7/7.2/exemples/Part V.js | UTF-8 | 2,476 | 4.40625 | 4 | [] | no_license | // A função recebe um número qualquer de parâmetros. Todos são agregados como valores para adicionar ao objeto de destino!
// Object.assign(destino, objeto1);
// Object.assign(destino, objeto1, objeto2);
// Object.assign(destino, objeto1, objeto2, objeto3, objeto4);
//Como você pode ver, ele recebe pelo menos dois pa... | true |
2cf083f221dea93f8c93af53fce1cf03c944d5ca | JavaScript | pravinjit/parkingSlotAPI | /src/getCarInfo.js | UTF-8 | 396 | 2.59375 | 3 | [] | no_license | export default function getCarInfo(parkingList, body, res) {
console.log("****************8", parkingList, { body });
const parkingSlot = parkingList.filter(
(data) =>
data.carNumber === body.carNumber || data.sloatNumber === body.sloatNumber
);
const message = {
message: "Enter Valid Information... | true |
4c75b2045d8f3ab3cee7c0a9e214c3c181433cf3 | JavaScript | michaelrhodes/bobs | /encode.js | UTF-8 | 1,319 | 2.625 | 3 | [
"CC0-1.0"
] | permissive | module.exports = encode
var encoder = new TextEncoder
var c = s2b(':')
var d = s2b('d')
var e = s2b('e')
var i = s2b('i')
var l = s2b('l')
var b = s2b('b')
function s2b (str) {
return encoder.encode(str)
}
function encode (val, $, i, s, l, e, b, o, n) {
i = s = 0, l = next($ = [], val), e = []
for (; i < l; i... | true |
9a4049911103497289a1ae5ef9fde58abbe0eb9e | JavaScript | parondeau/skywardGamingWebsite | /public/js/common.js | UTF-8 | 2,272 | 2.53125 | 3 | [] | no_license | $(function() {
var urlHash;
window.onpopstate = function() {
checkNav();
checkURL();
};
function navigateHome(){
navExtras();
$("#mainSection").addClass("show");
window.location.href = '#home';
}
function navigateRules(){
navExtras();
$("#rulesSection").addClass("show");
window.location.href = '#... | true |
63660bdf1f6609df1616736717bdffbc51918350 | JavaScript | narayanants/complete-nodejs-dev-course | /Chap4/3 Call Stack & Event Loop/weather-app/eventloop.js | UTF-8 | 1,218 | 4.3125 | 4 | [
"MIT"
] | permissive |
/*
Call Stack:
---------
* THis is where some items are addedand removed
* Last added can be the first removed.
* First Node runs the main() wrapper function
*/
var x = 1; // added and removed
var y = x +9; // added and removed
console.log(`y is ${y}`);
var add = (a,b)=>{
... | true |
2efb1e55f7f473a8ed0cd24bd84994381477eff9 | JavaScript | JeremyFaith/coderbytes | /med16permutation_step.js | UTF-8 | 744 | 3 | 3 | [] | no_license | function PermutationStep(num) {
real = num.toString().split("");
final = [[real[0]]];
for(var k = 1; k < real.length; k++) {
arr = final;
final = [];
for(var j =0; j < arr.length; j++) {
for(var i = 0; i < arr[0].length+1; i++) {
temp = arr[j].slice(0,i).concat(real[arr... | true |
e7ed21dced6cc9e6309473aa7f6542e6c44661e4 | JavaScript | xiaoyuze88/test-promise | /src/lib/methods/then.js | UTF-8 | 408 | 2.609375 | 3 | [
"MIT"
] | permissive | import constant from '../constant';
import core from '../core';
function then(onFulfill, onRejected) {
const promise = this;
switch (promise.state) {
case constant.STATE_PENDING:
break;
case constant.STATE_FULFILLED:
break;
case constant.STATE_REJECTED:
break;
default:
thro... | true |
c837835a33473b0eb1e8babad42901b664f367b1 | JavaScript | DinailsonSilva/testesIGTI | /manipulacaoArrays.js | UTF-8 | 2,675 | 4.59375 | 5 | [] | no_license | // pop - serve para remover o ultimo elemento do array.
// push - serve para inserir um elemento na última posição do array
// shift - serve para tirar o primeiro elemento do array e atualizar (puxar) os outros índices
// unshift - serve para adicionar um elemento no inicio do array e atualizar (empurrar) os outros ín... | true |
a07405016fcaedea7ba43e168e7f7e4f94b1c746 | JavaScript | micro-focus-idol-archive/netpromoter | /webapp/src/test/nps-calculator.js | UTF-8 | 3,077 | 3.09375 | 3 | [
"MIT"
] | permissive | describe("NPS calculator", function() {
var calc = require('../lib/utils/nps-calculator');
var enums = require('../lib/enums');
describe("calculate", function() {
it ("should return a number", function() {
calc.calculate([0, 10], function(err, res) {
res.should.be.Number... | true |
437cc26cdf115eccd27303ca0510ef41cd04a46d | JavaScript | gharam37/EEG-recording-platform | /platform-api/src/Controllers/ValenceController.js | UTF-8 | 1,386 | 2.65625 | 3 | [] | no_license | const boom = require('boom')
// Get Data Models
const Valence = require('../models/Valence')
// Get all Valences
exports.getValences = async (req, reply) => {
try {
const Valences = await Valence.find()
console.log('Hello'+Valences)
return Valences
} catch (err) {
throw boom.boomify(err)
}
}
//... | true |
5c3af92166e4899f4e667cc030390e8b1bf08ffd | JavaScript | DorotaPawlowska/programming-practice | /JustForFun/librarys/three.js/ThanosPortalEffectJSTut/index.js | UTF-8 | 3,241 | 2.890625 | 3 | [] | no_license | let scene, sceneLight, portalLight, cam, renderer, clock, portalParticles = [], smokeParticles = [];
function initScene(){
scene = new THREE.Scene();
sceneLight = new THREE.DirectionalLight(0xffffff, 0.5);
sceneLight.position.set(0,0,1);
scene.add(sceneLight);
... | true |
363a25d6107dab88872876525e14e2113b79a1cf | JavaScript | andrewpickett/advent-of-code | /2015/javascript/day14/puzzle.js | UTF-8 | 1,579 | 3.015625 | 3 | [] | no_license | let utils = require('../aoc_utils')
let data = require('./input')
function run(part) {
const d = parseData(data);
return (part === 1) ? utils.runWithTimer(partOne, d) : utils.runWithTimer(partTwo, d);
}
function parseData(data) {
let reindeer = {}
data.trim().split('\n').forEach(s => {
let parts = s.split(' ');... | true |
324961b237f9fceab59098d67b3ab6885dae1134 | JavaScript | zingesCodingDojo/MEAN_Stack | /Express/SocketiO/SurveyFormRevisited/static/JS/mySocketLogic.js | UTF-8 | 1,498 | 3.21875 | 3 | [] | no_license | $(document).ready(function(){
var formData = {};
var socket = io.connect();
$("#SurveyForm").submit(function(){
event.preventDefault();
var myForm = document.getElementById("SurveyForm");
var newObject = {
Name: myForm.Name.value,
DojoLocation: myForm.DojoLoca... | true |
4abaa2a90ec5a6c1f7381f56fee8272022324cc6 | JavaScript | Ryuhei7/RPG | /www/js/enemy_attack.js | UTF-8 | 496 | 2.9375 | 3 | [] | no_license | var php=100;
function damage(){
var rand = Math.floor( Math.random() * 11 ) ;
php = php-rand;
if(php<=0){
myNavigator.pushPage('gameover.html');
}
var s = "あなたは"+ rand +"のダメージを受けた!!"
alert(s);
document.getElementById( "php1" ).innerHTML = php;
document.getElementById( "php2" ).innerHTML = php;
document.g... | true |
c84541721125634a6f3369e98cf8dc8dfc17da8b | JavaScript | swamivisal/Tasky | /index.js | UTF-8 | 6,884 | 3.015625 | 3 | [] | no_license | const taskContainer=document.querySelector(".task_container");
let globalStore=[];
//generate new card
const generateNewCard=(taskData)=>`
<div class="col-lg-4 col-md-6" >
<div class="card">
<div class="card-header d-flex justify-content-end gap-2">
<button type="bu... | true |
002a572cd011ea6875248489955a5bb6cc0318cf | JavaScript | Hannah437/virtual-pet1 | /sketch.js | UTF-8 | 829 | 3.265625 | 3 | [] | no_license | //Create variables here
var dog;
var happydog;
var database;
var foodS;
var foodStock;
var x = 0;
function preload(){
dogimg = loadImage("images/dogImg.png");
dogimg1 = loadImage("images/dogImg1.png")
}
function setup() {
createCanvas(500, 500);
dog = createSprite(300,300);
dog.addImage(dogimg);
dog.sca... | true |
474d32b2c9b492d77dc200a152680b87f1c188a4 | JavaScript | sofyp/javascript | /teht11/main.js | UTF-8 | 882 | 3.859375 | 4 | [] | no_license | const pickn =()=>{
const n = [];
const arrayLength =10;
for (let i = 0; i<arrayLength; i++){
const random= Math.floor(Math.random()*30)+1;
n.push(random);
console.log(random);
}
checkIfUnique(n);
};
/*const insertionSort = (a) => {
let i = 0;
while (i < a.length) {
let j = i;
while ((j >= 0... | true |
fb911d32b4d2fa013ba7870541caa1e2f8bf69fe | JavaScript | rjyo/homebridge-tesla-remote | /src/createTesla.js | UTF-8 | 9,845 | 2.578125 | 3 | [] | no_license | import tesla from 'teslams'
import util from 'util'
export default function createTesla({ Service, Characteristic }) {
const CurrentTemperature = Characteristic.CurrentTemperature
const LockCurrentState = Characteristic.LockCurrentState
const LockTargetState = Characteristic.LockTargetState
const SwitchOn = Ch... | true |
4a1d99cfb773cc7ec62a8f6b077c889256dda385 | JavaScript | na7esan/rps | /public/assets/js/script.js | UTF-8 | 5,661 | 3.78125 | 4 | [
"MIT"
] | permissive | //じゃんけん用のSCRIPTを書いてください
let yourChoice;
let pcChoice;
let pcChoiceTxt;
let resultMsg;
let resultNum;
let battleTotal = 0;
let drawCounter = 0;
let winCounter = 0;
let loseCounter = 0;
$('#gu_btn').on('click', function () {
// 総対戦数に1を足す
battleTotal += 1;
console.log('battleTotalは' + battleTotal);
// 背景色初期化処理
... | true |
4b017abbdaa4b2bd5c4d30e7e0f3e8a12d84b489 | JavaScript | Sfrank01/p3 | /js/t-shirt-builder.js | WINDOWS-1252 | 3,089 | 2.6875 | 3 | [] | no_license | $('.colors').click(function() {
var color_that_was_clicked = $(this).css('background-color');
$('#canvas').css('background-color', color_that_was_clicked);
});
$('.style').click(function() {
var style_that_was_clicked = $(this).css('background-image');
console.log(style_that_was_clicked);
$('#canv... | true |
5813d643a2da3f78d847440e1219c5e446c3b1b2 | JavaScript | johannpino/api-marve-v2 | /js/interfaz.js | UTF-8 | 2,113 | 2.796875 | 3 | [] | no_license | class Interfaz{
constructor(){
this.insertamosApi();
}
insertamosApi(){
marvel.obtenerApiMarvel()
.then(res => {
document.querySelector('.bg-marvel').classList.add('disable');
const resultados = res.data.results;
... | true |
66e0ec3f9982377fdee7bb1d1994f9f8f9a56d09 | JavaScript | vinuzkar/IF3038-2013 | /TubesProgin3/web/Raymond.js | UTF-8 | 6,780 | 2.71875 | 3 | [] | no_license | function getXmlHttpRequestObject() {
if (window.XMLHttpRequest) {// Mozilla/Safari
return new XMLHttpRequest();
} else if(window.ActiveXObject) {// IE
return new ActiveXObject("Microsoft.XMLHTTP");
} else {
alert("Your Browser Sucks!");
}
}
var xmlHttpReq = getXmlHttpRequestObjec... | true |
c3f9225eedb9023393441d300fbe16547a17c794 | JavaScript | mothcar/seed | /json import from orientdb/luigi.js | UTF-8 | 2,432 | 2.765625 | 3 | [] | no_license | var fs = require("fs");
var csv = require("fast-csv");
var ODatabase = require('orientjs').ODatabase;
// ------- check CLI input -------
if(process.argv.length < 4){
console.log("Please use the following syntax");
console.log("");
console.log("node csvimport.js <className> <csvFilePath> [<OrientDbURL> <OrientDbPort... | true |
1b90c92163cc5707b624d81cf3fe65587ef1570d | JavaScript | kangaroo/echojs | /lib/map-es6.js | UTF-8 | 2,860 | 2.734375 | 3 | [
"MIT"
] | permissive | /* -*- Mode: js2; tab-width: 4; indent-tabs-mode: nil; -*-
* vim: set ts=4 sw=4 et tw=99 ft=js:
*/
import { foldl } from './echo-util';
function isNode() {
return typeof __ejs == 'undefined';
}
function getMapNode() {
let hasOwn = Object.prototype.hasOwnProperty;
return class Map {
constructor... | true |
f49dbf37225f0cb878dcc8695dd9cf41bc956f00 | JavaScript | Justin-Hastings/DIS-2020-Project2 | /js/selectracescombo.js | UTF-8 | 1,591 | 2.90625 | 3 | [] | no_license |
if (typeof xhr === 'undefined' || xhr === null) var xhr = new XMLHttpRequest();
async function selectracescombo() {
clearMessages();
var url = "http://localhost/yachtracing/api/selectraces.php";
url += "?club=" + document.getElementById('clubs').value;
if(xhr.readyState==0 || xhr.readyState==4){
x... | true |
93dc0db030699f20b8870b2eda505214fbe26e14 | JavaScript | myawilliams11/kenziegramPoll | /public/time.js | UTF-8 | 1,014 | 3 | 3 | [] | no_license | // server side
let now = Date.now();
let interval = 5000;
let dest = document.getElementById("place");
function fetchImages() {
const postOptions = {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ after: now })
}
fetch("... | true |