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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
de036a2a173b92c65550ee855a962ef2fa543836 | JavaScript | dad72/CastorGUI | /src/GUISlider.js | UTF-8 | 3,108 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | class GUISlider extends GUIManager {
constructor(id, options, guimanager, callback, append = true) {
super();
this.id = id;
this.html = document.body || document.getElementsByTagName('body')[0];
this.sliderPosition = {x:options.x, y:options.y};
this.sliderSize = {width:options.w, height:options.h};
t... | true |
59220b35eb935bf45b5125a195908fa10e6f67cf | JavaScript | VR46KS34/the_excuse | /index.js | UTF-8 | 979 | 3.375 | 3 | [] | no_license | document.addEventListener("click", () => {
let element = document.getElementById("the-excuse");
element.innerHTML = generateExcuse();
console.log(generateExcuse());
});
let pronoun = ["A", "The", "My"];
let subject = ["jogger", "raccon", "dog", "driver", "comedian", "pincone"];
let action = ["took", "threw", "yell... | true |
4d5ce486f8cd4eb6642e46071cc3c1764f514e8b | JavaScript | fjlJENNY/gitLeaning | /Iterator/string_iterator.js | UTF-8 | 854 | 3.96875 | 4 | [] | no_license | // 字符串 部署了 iterator 接口
var somestring = "hi";
// for(var i of somestring){
// console.log(i);
// }
var iterator = somestring[Symbol.iterator]();
console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
// 遍历器对象 也可以部署 return() 和 throw() 可选部署
var obj = {
data:['Hello','World',"cai... | true |
fee2a9ce4d898ea3940301bc5871a043c33ff206 | JavaScript | liuFuNewbie/catering | /WebContent/js/background/addshoppinginfo.js | UTF-8 | 4,044 | 2.828125 | 3 | [
"MIT"
] | permissive |
var flag = false;
$(function(){
//菜名的焦点事件
$(".menuName").blur(function(){
var menuName = $(this).val();
if(menuName == null || menuName == ''){
$(this).attr("placeholder","菜名不能为空!");
flag = false;
}
});
$(".menuName").focus(function(){
$(this).removeAttr("placeholder");
flag = true;
... | true |
e7b96becb31325b9cc1be2d654ee14987939a9cb | JavaScript | vanessaearth/vue_project | /server/test/fs.js | UTF-8 | 1,009 | 2.84375 | 3 | [] | no_license | const fs = require('fs')
function get (key) {
fs.readFile('./db.json', (err, data) => {
const json = JSON.parse(data)
clog(json[key], 'get-err', err)
})
}
function set (key, value) {
fs.readFile('./db.json', (err, data) => {
clog('set-err:', err)
// 空文件
const json = data ? JSON.parse(data) : {... | true |
e72a42b250575971d044d2111b21913b53a7c4e5 | JavaScript | grigoriu-stefan-iulian/expensify-app | /src/components/ExpenseList.js | UTF-8 | 1,674 | 2.671875 | 3 | [] | no_license | import React from 'react'
import { connect } from 'react-redux'
import ExpenseListItem from './ExpenseListItem'
import selectExpenses from '../selectors/expenses'
export const ExpenseList = (props) => (
<div className="content-container">
<div className="expenses-list">
<div className="display... | true |
a952d93f9dc7b15c5384134569bb77382c0e5530 | JavaScript | Urthen/MaelstromPrototype2 | /static/js/authorize.js | UTF-8 | 712 | 2.625 | 3 | [] | no_license | (function($){
function applyPermissions() {
var scopes = []
$(".permissions .allowed").each(function() {
scopes.push($(this).attr('data-scope'));
})
$("#ScopeInput").val(scopes.join(','));
}
$(document).ready(function() {
applyPermissions();
$(".permissions li .button").each(function() {
var $th... | true |
c484f55bfb2b17b0f6f0ddb148f4ff8b99631082 | JavaScript | Tejinderpalsinghsiledar/crumpled-ball-1 | /sketch.js | UTF-8 | 777 | 2.6875 | 3 | [] | no_license |
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
var box ;
var ground1;
var ball ;
function preload()
{
}
function setup() {
createCanvas(800, 700);
engine = Engine.create();
world = engine.world;
//Create the Bodies Here.)
box1 = new Box(660,5... | true |
9f6efcb08a765fb955bf7bfaf461586b191e652b | JavaScript | noircir/js-bootcamp | /arrays/expenses-tracker.js | UTF-8 | 1,284 | 3.96875 | 4 | [] | no_license | const account = {
name: 'Nellie Ka',
income: [],
expenses: [],
addIncome: function (title, amount) {
this.income.push({ title, amount })
},
addExpense: function (title, amount) {
this.expenses.push({ title, amount })
},
getAccountSummary: function () {
let totalIn... | true |
f9b218f54a03679f61c4a448c87e00bbea59e89e | JavaScript | Prozaek/news-explorer-frontend | /src/utils/NewsAPI.js | UTF-8 | 1,119 | 2.8125 | 3 | [] | no_license | class Api {
constructor({ headers, baseUrl }) {
this._headers = headers;
this._baseUrl = baseUrl;
this._to = new Date();
// время за которое выполняется поиск (7) нужно вынести в константы в отдельный файл
let dateWeekBefore = new Date().setDate(new Date().getDate() - 7);
... | true |
5510a2add3e8621810938bd16e5b54919ab5df21 | JavaScript | SmolByte/Pokemon_app | /pokeDb.js | UTF-8 | 1,019 | 2.5625 | 3 | [] | no_license | /**
* Author: Nikhil Parikh
*/
const MongoClient = require('mongodb').MongoClient;
var getID = require('mongodb').ObjectID();
var url = "mongodb://localhost:27017/myapp";
let database = {};
let mongoClient = MongoClient(url,{ useUnifiedTopology: true});
let myDB;
const dbName = "pokemons";
var connect = async funct... | true |
8ae71354267cbece66e8d972fa44ff7f8a0ed002 | JavaScript | verybluebot/triangle | /app/input/input.controller.js | UTF-8 | 673 | 2.5625 | 3 | [] | no_license | (function (){
'use strict'
angular
.module('app')
.controller('InputCtl', InputCtl)
InputCtl.$inject = ['$state', 'TriangleService']
function InputCtl($state, TriangleService){
var vm = this;
// variables
vm.x1 = 40;
vm.y1 = 40;
vm.x2 = 40;
vm.y2 = 100;
vm.x3 = 100;
v... | true |
e0c37799679b33c5ebbf11a653b609816b43f6c2 | JavaScript | Xfirepc/xfirepc.github.io | /proyects/calculator/src/js/operations.js | UTF-8 | 581 | 3.1875 | 3 | [] | no_license | export function sum(num){
return function (anotherNum){
return Number(num) + Number(anotherNum)
}
}
export function subtract(num){
return function (anotherNum){
return Number(num) - Number(anotherNum)
}
}
export function division(num){
return function (anotherNum){
return Number(num) / Number(an... | true |
fc7e07d64e6a5b8c4cdb4d4ab0f846f4c77c3fdf | JavaScript | jbmusso/gremlin-core-js | /src/process/util/SingleIterator.js | UTF-8 | 363 | 2.890625 | 3 | [] | no_license | function SingleIterator(traverser) {
this.traverser = traverser;
this.alive = true;
}
SingleIterator.prototype.next = function() {
if (!this.alive) {
return {
value: undefined,
done: true
};
} else {
this.alive = false;
return {
value: this.traverser,
done: false
};... | true |
e026a0f4133371d0bcb3d5a0727cf6fe804d6289 | JavaScript | ajinsoopark/middleware_exercises | /random.js | UTF-8 | 684 | 3 | 3 | [] | no_license | let randomRes = {};
let numArr = [];
const generateSpread = (req, res, next) => {
let maxNum = parseInt(req.query.ceil);
let minNum = parseInt(req.query.floor);
for (let i = minNum + 1; i < maxNum; i++) {
numArr.push(i);
};
next();
}
const pickRandomNumber = (req, res, next) => {
let... | true |
252912963c7f2973e69607215f7fa0f7191484e3 | JavaScript | valentindotxyz/jobs-algolia-dashboard | /src/MoviesGrid/MoviesGridHit.js | UTF-8 | 2,039 | 2.578125 | 3 | [] | no_license | import React from 'react';
import { Highlight } from 'react-instantsearch-dom';
class MoviesGridHit extends React.Component {
constructor(props) {
super(props);
this.state = {
isHovered: false,
deleted: false
};
this.hover = this.hover.bind(this);
... | true |
b27547ba08b2b7fdbfe5524a0faa20a3cdb2b45f | JavaScript | SerkanGenc/WebGL | /2-Triangle/main.js | UTF-8 | 2,149 | 2.96875 | 3 | [] | no_license | let canvas = document.querySelector("#playground") ;
/** @type {WebGLRenderingContext} */
let gl = canvas.getContext("webgl2") ;
console.log(gl);
gl.clearColor(0.9, 0.4, 0.4, 1.0) ;
gl.clear(gl.COLOR_BUFFER_BIT) ;
// Geometry of the primitive we can draw (Triangle)
const coords = [ -0.8, 0, 0.8,0, 0, 0.8] ;
// Step ... | true |
bbcbe99ee878577521e5b4f3f886b6b9ccc2419b | JavaScript | elwyncrestha/LulworthCoveDramaClub | /build/js/customScripts.js | UTF-8 | 3,511 | 2.546875 | 3 | [
"MIT"
] | permissive | var color = ['orange','pink','violet','aquablue','#fdf584','#f44336','#e91e63','#e91e63','#03a9f4','#00bcd4','#009688','#ffeb3b','#795548'];
const getColor = () => {return color[parseInt(Math.random()*color.length)]}
setInterval(changeBrandColor,1000);
setInterval(changeContentColor,4000);
// .content
function change... | true |
65d17a82700ce6d86ff7794710f981d0a728eb6a | JavaScript | martytheparty/jpg2movie | /custom_modules/resizeFiles.js | UTF-8 | 2,228 | 3.109375 | 3 | [] | no_license | let fs = require('fs');
let fileList = [];
let gm = require('gm');
function resize(path, destination, prevPromise) {
let fileName = path.split('/').pop();
if (!prevPromise) {
prevPromise = new Promise(
function(resolve, reject) {
resolve();
}
);
}
destination = destination + '/' +... | true |
82be15ab434229aa7355a77189cf6b4c45816844 | JavaScript | m0liere/donationviz | /public/js/organization.js | UTF-8 | 5,989 | 2.65625 | 3 | [] | no_license | $(function() {
var data = JSON.parse($('#data-holder').html())[0]; // the database is flawed -- repeated senators
// right now this is post-processed, but it should be pre-processed, or done with a database call
var min, max;
for (var state in data.states) {
if (!min) { // base case
min = data.states... | true |
e81085a192578b498a1d61f8ea706e46edbb4aef | JavaScript | surma-dump/bwin-api | /bwinuser.js | UTF-8 | 1,756 | 2.71875 | 3 | [
"MIT"
] | permissive | window.bwin = window.bwin || {};
window.bwin.createUser = function(username, password) {
var LOGIN_URL = 'http://www.bwin.de';
return {
'username': username?username:'',
'password': password?password:'',
// Fills out the login form using the credentials stored
// in the object.
'fill_login': function(tab,... | true |
3e3f3bf43211d5376cc81b35fe52d2a59f6c1dbb | JavaScript | Ljupko-Kolak/randolph | /private/modules/JSONbaseManager.js | UTF-8 | 3,026 | 3.203125 | 3 | [] | no_license | let fs = require("fs");
class JSONbaseManager {
constructor() {
this.database = {};
}
makeNewBase() {
this.database = {
nextID: 0,
venues: []
};
};
load(path) {
let raw = fs.readFileSync(path);
this.database = JSON.parse(raw);
};
save(path) {
let raw = JSON.stringify... | true |
5b5d655f061d4e31d18908599c23ab20de244e89 | JavaScript | DeveloperAchu/TDS-task-1 | /src/utils/postman.js | UTF-8 | 889 | 2.984375 | 3 | [] | no_license | const request = require("request");
/*
This function returns a promise after invoking the endpoint. If there is an error,
the promise rejects with an error message. If the request is successful, the promise
resolve with the response body
*/
const postman = () => {
const url = "https://postman-echo.com/... | true |
2fc8b5bf867f5636c7eb962d86dd7f687cf2e52d | JavaScript | zohana/BMO_OpenTable | /src/App.js | UTF-8 | 2,365 | 2.6875 | 3 | [] | no_license | import React, { Component } from "react";
import openTable from "./api/api";
import "./styles/App.css";
import SearchBar from "./components/SearchBar";
import Card from "./components/Card";
class App extends Component {
state = {
restraunts: [],
data: [],
errorMessageServer: "",
};
onSearchSubmit =... | true |
207272d9cbbefdcff992d0327e32edd843ceaba1 | JavaScript | nss-day-cohort-44/holiday-road-craters-of-the-moon | /scripts/parks/Park.js | UTF-8 | 1,279 | 2.9375 | 3 | [] | no_license | export const Park = (parkObj) => {
return `
<p id="national-parks">
${parkObj.fullName}
${parkObj.latLong}
<button id="park-detail--${parkObj.id}">Details</button>
</p>
`
}
// console.log("Full Name", parkObj.fullName)
const eventHub = document.querySelector("#mainContainer")
eventHub.addE... | true |
5f2acecc807c83962de47407a7d6e9b0166f4bc8 | JavaScript | ericnshimiye/simple-user-server | /routes/api/users.js | UTF-8 | 4,595 | 2.75 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const validateRegisterInput = require("../../validation/users/register");
const validateEditInput = require("../../validation/users/edit");
var users = [
{
idUser: 1,
firstName: 'Umubuganda',
lastName: 'Tibulate',
... | true |
12b16963a028b7f8bc696e32f102b47c03441a8a | JavaScript | guava25/Portfolio | /js/personalize.js | UTF-8 | 440 | 2.75 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | function nameCheck(name){
if (name = null) {
return name = "Visitor";
}
/*else if (name = "Maybe your name") {
return name = "Visitor";
}*/
else {
}
document.getElementById("personalize").innerHTML = name;
}
var name;
name = window.prompt("To allow a more personalized visit, ... | true |
9689bd1191e7a35bb725fa62ec50b10d1e367377 | JavaScript | taisukef/fukunojigjp | /XML.js | UTF-8 | 760 | 2.84375 | 3 | [
"MIT"
] | permissive | const XML = {};
XML.toJSON = (xml) => { // xml: XML object on Web, attribute無視、名前重なったら配列化
const f = (xml) => {
const json = {};
const text = [];
let hasxml = false;
for (let i = 0; i < xml.childNodes.length; i++) {
const node = xml.childNodes[i];
const name = node.nodeName;
if (name... | true |
530eee28cb63a91af13850aac7f84a0ff20e6fb8 | JavaScript | mfloryan/event-show | /lib/guid-translation.js | UTF-8 | 2,137 | 2.59375 | 3 | [] | no_license | var mongodb = require('mongodb');
function SwapHexDigitsForCSharpGuids(hex) {
var a = hex.substr(6, 2) + hex.substr(4, 2) + hex.substr(2, 2) + hex.substr(0, 2);
var b = hex.substr(10, 2) + hex.substr(8, 2);
var c = hex.substr(14, 2) + hex.substr(12, 2);
var d = hex.substr(16, 16);
return a + b + c + d;
}
fu... | true |
ff0d46660a1d8872c9f7920c23ab148d1c0f235e | JavaScript | marcosmix/marcosmix.github.io | /controller/juegoAnimales.js | UTF-8 | 998 | 2.71875 | 3 | [] | no_license | var b1=document.getElementById('button1');
var b2=document.getElementById('button2');
var b3=document.getElementById('button3');
var b4=document.getElementById('button4');
function Toque(b)
{
let url_image;
let sonido;
switch (b.dataset.animal) {
case "gatito":
url_image='url(../images/gato.jpg)';
sonido=... | true |
f1cf80e20c50298bc656bb7880deb5a51a6013ad | JavaScript | Agreon/GlobalConfigManager | /dist/GlobalConfigManager.js | UTF-8 | 1,689 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | const path = require('path')
const fs = require('fs-extra')
class GlobalConfigManager {
/**
*
* @param {*} applicationId
* @param {*} fileName
* @param {*} content
* @param {*} cb
*/
static set (applicationId, fileName, content, cb) {
const path = this._createPath(applicationId, fileName... | true |
4393c4bdea98af95c8d2bf640ce62917dfb551d9 | JavaScript | gracehxh/assignment2shoppingcart | /src/components/cart/CartSummary.js | UTF-8 | 2,082 | 2.578125 | 3 | [] | no_license | import { useState } from 'react';
const CartSummary = ({ totalItems, totalPrice }) => {
const shippingOptions = [
{
id: 1,
option: 'Standard',
price: 10
},
{
id: 2,
option: 'Express',
price: 20
},
{
id: 3,
option: 'Priority',
price: 30
}
... | true |
874c9e7473b150b85e098bb4865671e2db62b5a5 | JavaScript | tvojnar/capstone_frontend | /src/components/HikeFeatures.js | UTF-8 | 2,178 | 2.96875 | 3 | [] | no_license | import React, { Component } from 'react';
export class HikeFeatures extends Component {
render() {
// NOTE: the way I am displaying which features are displayed is not DRY, but I can't off the bat think of a good way to clean this up since the name of the prop is not always what I want to appear on the page...
... | true |
776077d4c94b1e8c9968353195b350831190a17c | JavaScript | letItBezhumphries/mini-apps-1 | /challenge_4/junk.js | UTF-8 | 10,997 | 2.71875 | 3 | [] | no_license | // // import React, {Component} from 'react';
// // // import React from 'react';
// // // function Cell(props) {
// // // return (
// // // <td className="cell">
// // // <button style={boardStyles} data-x={props.x} data-y={props.y}></button>
// // // </td>
// // // )
// // // }
// // // export de... | true |
83a3db771177b0d13ae085150890729635576839 | JavaScript | WhileForDo/WhileForDo.github.io | /index_dz2.js | UTF-8 | 4,941 | 4.3125 | 4 | [] | no_license | /*
Задание 1:
Вывести в консоль с помощью цикла FOR все четные числа от 10 до 50
*/
console.log(" Задание 1:");
for (let i=10; i<50;i++){
if(i%2==0)
console.log( i);
}
console.log(" ------------------------ ");
/*
Задание 2:
Необходимо создать объект в котором вы опи... | true |
512437fd37d8c809fac3de954e8318c56bcaa14a | JavaScript | TongDaDa/fly-utils | /lib/Function/pingImg.js | UTF-8 | 337 | 2.703125 | 3 | [
"MIT"
] | permissive | /**
* @note
*
* @param url
* @return {Promise}
*/
export default url => {
const Img = new Image();
return new Promise((reslove,reject)=>{
Img.onload = ()=>{ reslove("success"); };
Img.onerror = ()=>{ reject("error"); };
setTimeout(()=>{reject("timeout")},2000);
Img.src ... | true |
f13e031c87de6a75e5dbb8e610e29c8fcf8c3eab | JavaScript | hoduche/allChords | /createChordsList.js | UTF-8 | 8,474 | 2.921875 | 3 | [] | no_license | function loadJsonFile(url) {
var result = null
var xhr = new XMLHttpRequest()
xhr.open("GET", url, false)
xhr.send()
if (xhr.readyState == 4) {
result = JSON.parse(xhr.responseText)
}
return result
}
function drawSvg(shape, attributes) {
var result = document.createElementNS(ns,... | true |
bd810be8704d30fcd6d765a84d4c737d8c7cb3a2 | JavaScript | AsafEini/lesson5_fileSystem | /filesystem1.js | UTF-8 | 6,831 | 3.234375 | 3 | [] | no_license | var readlineSync = require('readline-sync');
var prompt = require('prompt-sync')();
var exit = false;
var menu = [
'Print current folder',
'Change current folder',
'Create file or folder',
'Delete file or folder',
'Search in file or folder',
'Quit Program'
];
/* this will be the storage for our... | true |
2c3f23ca2084e7fdbd677e554f87e34fe34d9962 | JavaScript | wy2016xiao/leetcode | /solution/392.is-subsequence.js | UTF-8 | 1,648 | 3.8125 | 4 | [] | no_license | /*
* @lc app=leetcode id=392 lang=javascript
*
* [392] Is Subsequence
*
* https://leetcode.com/problems/is-subsequence/description/
*
* algorithms
* Medium (47.21%)
* Likes: 1429
* Dislikes: 199
* Total Accepted: 207.8K
* Total Submissions: 423.5K
* Testcase Example: '"abc"\n"ahbgdc"'
*
* Given a ... | true |
c11e227223501b396b64a829f2d3decbac083284 | JavaScript | aminshishev/calc2 | /js.js | UTF-8 | 4,241 | 3.234375 | 3 | [] | no_license | let scr = document.querySelector('#scrdiv2');
let litscr = document.querySelector("#scrdiv");
const countDecimals = function(value) {
if (Math.floor(value) === value) return 0;
return value.toString().split(".")[1].length || 0;
}
const operate = function(a, oper, b) {
if (oper == '+') {
res = (Numb... | true |
64c3bb8a723f150a5194daff0fef01a2d1ede335 | JavaScript | jacobswearingen/eecs448-lab03 | /exercise4/script.js | UTF-8 | 823 | 3.03125 | 3 | [] | no_license | // border-color: rgb("bord_red()", "bord_green()", "bord_blue()");
function press(){
let edgy = document.getElementById("edgy");
let bord_red = document.getElementById("bord_red").value;
let bord_green = document.getElementById("bord_green").value;
let bord_blue = document.getElementById("bord_blue").value;
let ... | true |
0e9b01cf60fdc72e199bf5252504cbae2a4371a7 | JavaScript | XccelerateTech/melodywong | /40-chatroom/public/script.js | UTF-8 | 948 | 2.90625 | 3 | [] | no_license | $( document ).ready(function() {
$.get( "/room1", function( data ) {
for(var i=0;i<data.length;i++){
let message=data[i];
message=JSON.parse(message)
$('#messages').append(`<p>${message.id} : ${message.msg}`);
}
});
});
$(function () ... | true |
5376871959214ecc4eeeb55aa72662c4d14f1eae | JavaScript | taniprokhorenko/easy_code_js_course | /h_w_2/app.js | UTF-8 | 13,516 | 4.46875 | 4 | [] | no_license | 'use strict';
/*
--------- Функции ---------
1. Создать функцию multiply, которая будет принимать любое количество чисел и возвращать их
произведение: multiply(1,2,3) = 6 (1*2*3)
Если нет ни одного аргумента, вернуть ноль: multiply() // 0
*/
function multiply(...args) {
let abc = 1;
if (args.length) {
... | true |
dffb2b7f8173f4ca7e422be34daece0533636c24 | JavaScript | leaimy/BT_DanhSachCongViec | /script.js | UTF-8 | 2,248 | 3 | 3 | [] | no_license | var dsCongViec = document.getElementById("danhsach");
var bieumau = document.getElementById("bieumau");
var input = document.getElementById("input");
var xoaTatCa = document.getElementById("nutbam_xoa");
var danhsach = [
//"Tập thể dục",
//"Học làm web",
//"Đọc sách",
//"Làm việc nhà",
//"Xem phim",
];
input... | true |
99abf4f2eedf7dbbe3ae1d052c1c5823677b674a | JavaScript | amandabcarneiro9/pluris-engenharia | /pluris-page/components/contactForm/contactForm.jsx | UTF-8 | 5,194 | 2.6875 | 3 | [] | no_license | import Style from './contactForm.module.scss'
import Util from '../../styles/util.module.scss'
import { useState } from 'react'
export default function ContactForm({ onSubmit }) {
const [name, setName] = useState('')
const [phone, setPhone] = useState('')
const [email, setEmail] = useState('')
const [address, ... | true |
619e85bd5031f33da39bb313e94dfdb48cf232e1 | JavaScript | zismano/algorithm-problems | /makeTriangle.js | UTF-8 | 681 | 4.6875 | 5 | [] | no_license | /* function gets number as input and returns a triangle out of asteriks
e.g n = 4
*
***
*****
*******
*/
/*
e.g n = 4
* line 1: 1 asteriks, 3 spaces; (1 + 2 * (line - 1)) asteriks, (n - line) spaces
*** line 2: 3 asteriks, 2 spaces
***** line 3: 5 asteriks, 1 space
******* line 4: 7 asteriks, 0... | true |
a1ed43c5924ddfb4bb8cf62de28a3115a069e2ce | JavaScript | cbdevnet/taskboard | /static/gui.js | UTF-8 | 7,433 | 2.546875 | 3 | [
"WTFPL"
] | permissive | var gui = {
elem:function(id){
return document.getElementById(id);
},
create:function(tag, text, options){
var node = document.createElement(tag);
if(text){
node.textContent = text;
}
if(options){
Object.keys(options).forEach(function(prop){
node.setAttribute(prop, options[prop]);
});
}
... | true |
0b27d5d2ace6100e91aa26a9ae34beba4aff0855 | JavaScript | platon517/GameEngineJS | /src/Game/js/utilities/getCoordsArr.js | UTF-8 | 240 | 2.578125 | 3 | [] | no_license | export const getCoordsArr = data => {
const { coords, offset, size } = data;
const x1y1 = [coords.x + offset.x, coords.y + offset.y];
const x2y2 = [coords.x + offset.x + size.w, coords.y + offset.y + size.h];
return [x1y1, x2y2];
}; | true |
02f394b1e2dfae97860ace32b32be25a2eab9031 | JavaScript | danigb/nand-to-tetris | /chips/v3/circuits.test.js | UTF-8 | 1,164 | 2.78125 | 3 | [] | no_license | /* global describe test expect */
var { not, and, or, xor, not16, and16, run, build } = require('./index.js')
const word = (str) => str.split('').map(d => +d)
describe('circuit', () => {
test('not', () => {
expect(build(not(0))).toEqual(['nand', 0, 1])
expect(run(not(0))).toBe(1)
expect(run(not(1))).toB... | true |
5d6c10f06750db48096a384a8c9bf16b2cf7fe81 | JavaScript | jfelipearaujo/educafro-jogos-classicos-1 | /Aula 05/sketch.js | UTF-8 | 6,304 | 3.453125 | 3 | [] | no_license | let width = 800;
let height = 600;
// ***** variáveis para a raquete do jogador ********************************** //
let widthPlayerRacquet = 15;
let heightPlayerRacquet = 150;
let xPlayerRacquet = 5;
let yPlayerRacquet = (height / 2) - (heightPlayerRacquet / 2);
let yPlayerRacquetSpeed = 5;
// ********************... | true |
f997c0c521a3db6d84daf898d72a11dff86d1534 | JavaScript | Mahmoud-Elhassan/movie-website | /src/App.js | UTF-8 | 2,078 | 2.5625 | 3 | [] | no_license | import { useEffect, useState } from "react";
import axios from "axios";
// components
import Movie from "./components/Movie";
import Hero from "./components/Hero";
// style
import "./styles/App.scss";
function App() {
const [movies, setMovies] = useState([]);
useEffect(() => {
axios
.get(
... | true |
35843cae82be6a226bb0a5411c88aa1e56d4b5d8 | JavaScript | kbop543-zz/HitchHike | /app/routes/usersRoutes.js | UTF-8 | 9,357 | 2.6875 | 3 | [] | no_license | var User = require('../models/user');
var Hike = require('../models/hike')
/* Sign in */
exports.signIn = function(req, res) {
console.log('signIn');
// Find if user matches both username AND password
User.findOne({
'username': req.body.username,
'password': req.body.password
}, functi... | true |
ea47117cacdc4db4234d26b7bf550fe9854f8d14 | JavaScript | JCode1986/data-structures-and-algorithms | /challenges/multiBracketValidation/__tests__/multi-bracket-validation-test.js | UTF-8 | 955 | 3.3125 | 3 | [] | no_license | 'use strict'
const multiBracketValidation = require('../multi-bracket-validation');
const Stack = require('../../../data-structures/stacksAndQueues/stack')
const stack = new Stack()
describe('Multi-bracket validation', () => {
it('can instantiate an empty stack', () => {
let expected = stack
let actual... | true |
50235929271b2638ab32ef4c757d91b70113dbdd | JavaScript | homangab/Human_Behavior | /newtabscript.js | UTF-8 | 36,925 | 2.53125 | 3 | [
"MIT"
] | permissive | /*var urlToRemove = "moz-extension://38f44e2d-62f0-4c4b-9bea-eed54e974bc6/trialhtml.html";
function onGot(results) {
if (!results.length) {
console.log(urlToRemove + " was removed");
} else {
console.log(urlToRemove + " was not removed");
}
}
function onRemoved() {
var searching = brows... | true |
902f57a4eb351952680b8b3c1808788e2b5ceca0 | JavaScript | P-K-J-B/myreads-book-tracking-app | /src/js/ShelfSelector.js | UTF-8 | 1,219 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
import PropTypes from 'prop-types';
class ShelfSelector extends Component {
static propTypes = {
book: PropTypes.object.isRequired,
allBooks: PropTypes.array.isRequired,
moveToShelf: PropTypes.func.isRequired
}
assignNewShelf = (chosenShelf... | true |
a8263fb4c11fed7f4e8efb1224f7cd7a95c8a450 | JavaScript | xguo99/kovid | /models/Customer.js | UTF-8 | 1,871 | 3.03125 | 3 | [] | no_license | const db = require('../db/db_config');
class Customer {
/**
* Add a Customer.
*
* @param {string} name
* @param {string} password
* @return {Customer} - created user
*/
static async addOne(name, password) {
// first insert the user into the db then fetch the user from the DB
return db.ru... | true |
4e1c6295200850839e66ecc5a17377b6e5b785ed | JavaScript | bhaviksingh/sharedspace.page | /src/components/HTML/smileyRoom.js | UTF-8 | 2,504 | 2.75 | 3 | [] | no_license | import React from "react";
import "../core.css";
import "./smileyRoom.css";
import { setColorSwitcher, setWindowSizeCalc } from "../utils.js";
export default class SmileyGrid extends React.Component {
constructor(props) {
super(props);
this.contentRef = React.createRef();
this.state = {
alignment: ... | true |
9520ba3d9f4bda6cbac48204e513699817ff963b | JavaScript | samchillcott/sam_firebase_auth | /app.js | UTF-8 | 3,186 | 3.328125 | 3 | [] | no_license | // Have left some console logs in for error handling and review
// Sign Up
const signupForm = document.querySelector("#signup-form");
try {
// .addEventListener here
signupForm.addEventListener("submit", (e) => {
e.preventDefault();
// get user email
const email = signupForm["email"].value;
// get user pa... | true |
6a3492a5cc5e07459da829e48776153f1c28f193 | JavaScript | cwattrus/Bliss | /js/bliss.js | UTF-8 | 1,399 | 2.953125 | 3 | [] | no_license | function getAverageRGB(imgElement) {
var blockSize = 5, // only visit every 5 pixels
defaultRGB = {r:0,g:0,b:0}, // for non-supporting envs
canvas = document.createElement('canvas'),
context = canvas.getContext && canvas.getContext('2d'),
data, width, height,
i = -4,
... | true |
382856a02536e72cf274dc652b215dbddf223a11 | JavaScript | badgerodon/canvas-ui | /src/CanvasUI.js | UTF-8 | 5,036 | 2.59375 | 3 | [
"MIT"
] | permissive | var CanvasUI = {};
function isFunction(x) {
return Object.prototype.toString.call(x) == '[object Function]';
}
function isString(o) {
return o !== null && o !== undefined && (typeof o == "string" || (typeof o == "object" && o.constructor === String));
}
function isSet(x) {
return x !== undefined && x !== null;
}
fu... | true |
55c23e62ae8b5f3cd835a2baf50b816539e1fd9b | JavaScript | nusic/nusic.github.io | /Visualization-as-decision-support-in-CI/public/js/show_all/Decorator.js | UTF-8 | 3,302 | 2.71875 | 3 | [] | no_license |
var Decorator = function(){
}
Decorator.prototype.decorate = function(g){
var thisDecorator = this;
g.nodes().forEach(function (nodeId){
var node = g.node(nodeId);
node.id = node.id || nodeId;
thisDecorator.decorateNode(node);
});
g.edges().forEach(function (edgeId){
var edge = g.edge(edgeId);
var ... | true |
8a6eadeaaf186983320f919c4df372b171c03f50 | JavaScript | valemun/grupo_5_Activ | /activ-dashboard/src/components/LastProductInDb.js | UTF-8 | 1,949 | 2.546875 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import imagenFondo from '../assets/images/product-placeholder.jpg';
function LastProductInDb(){
const [lastProductData, setLastProduct] = useState([]);
const lastProductAPI = async () => {
const url = "http://127.0.0.1:3001/api/products/last";
const las... | true |
0a7af96d63f068dcd74dfca4a5077b8906f260d5 | JavaScript | rameshpaudel/june-js | /js/array2.js | UTF-8 | 1,793 | 3.71875 | 4 | [] | no_license | var arr = [1,2,3,4,5,6,7,8,9,10];
for(var i = 0; i < arr.length; i++){
// console.log(i)//, arr[i]);
}
function mapEveryItem(value,index){
if(index == 5){
return null;
}
return value;
}
function isGreater(value,index){
return value > 5;
}
var generatedArray = arr.map(mapEveryIt... | true |
07c7e76b91a11f1a9d5a49e4b9fa64f0e6aba4dc | JavaScript | batzz-00/image-slideshow | /app/js/slider/sliderImage.js | UTF-8 | 830 | 2.65625 | 3 | [] | no_license | import $ from 'jquery'
export default class sliderImage {
constructor(ui, rotation){
this.imageClass = ui;
// TODO : do checks to see if properties exist
this.caption = this.imageClass.attr("data-caption");
this.imageurl = this.imageClass.attr("href");
this.imag... | true |
8ed087c6fdb737ad2f11ca4e7bf674bc08bf3f39 | JavaScript | kub1x/rodnecislo | /src/lib/rodnecislo.js | UTF-8 | 5,050 | 3.046875 | 3 | [
"MIT"
] | permissive | // rodnecislo.js
// authors : Jakub Podlaha
// license : MIT
// repo: github.com/kub1x/rodnecislo
const GENDER = {
MALE: 'MALE',
FEMALE: 'FEMALE'
};
const MONTH_OFFSET = 1;
const DEFAULT_ADULTHOOD = 18;
const AGE_WHEN_BORN = 0;
export function RodneCislo(value) {
// PIN parts and Parsed birthdate
let _yy, _... | true |
15d7456d2aff03cb8a61ca422de943b9a2458143 | JavaScript | apostopher/kata-string-calculator | /optimization.test.js | UTF-8 | 734 | 2.671875 | 3 | [] | no_license | /* jshint ignore:start */
"use strict";
var add = require('./src/index');
function printStatus(fn) {
switch(%GetOptimizationStatus(fn)) {
case 1: console.log("Function is optimized"); break;
case 2: console.log("Function is not optimized"); break;
case 3: console.log("Function is always optimized"); brea... | true |
7c47847a21abbdcc683fdc64ce5d2cd6931efe75 | JavaScript | jedbng/kktkdatabase2 | /public/js/index.js | UTF-8 | 1,083 | 3.03125 | 3 | [] | no_license | //OnLoad
function onLoad(){
//retrieve localStorage
if(localStorage.KKTKdbUserName!=undefined)document.getElementById("txtUser").value=localStorage.KKTKdbUserName;
}
//Show and hide password
function showPass(){
var xxx = document.getElementById("txtPass");
xxx.type="Text";
}
function hidePas... | true |
7d789d593282e9763f544e8e991366157777ba7f | JavaScript | rachelnabors/rachelnabors.github.io | /talks/wordpress-themeing-2011/js/script.js | UTF-8 | 3,851 | 2.75 | 3 | [] | no_license | /* Author: Rachel Nabors
*/
$(document).ready(function() {
//make each section the height of the window if it is horter than it
var winHeight = $(window).height();
$('section').each(function() {
if($(this).height() < winHeight ){
$(this).height(winHeight);
}
});
//menu
//give each section a sequ... | true |
238dd035704ef72b25afb0e15e1f92ee17b1acda | JavaScript | tarekul/DSA | /codingExercises/removeLL.js | UTF-8 | 1,837 | 4.28125 | 4 | [] | no_license | class Node {
constructor(val) {
this.val = val;
this.next = null;
}
}
class SinglyLinkedList {
constructor(val) {
this.head = null;
this.tail = null;
this.length = 0;
}
push(val) {
var newNode = new Node(val);
if (!this.head) {
this.head = newNode;
this.tail = this.hea... | true |
075564ccb0f3d1ae52804324ea9efa4582cac8a3 | JavaScript | Aniket-Wali/react-movie-app | /src/MovieDetailsSection.js | UTF-8 | 1,888 | 2.515625 | 3 | [] | no_license | import { useEffect, useState } from "react";
import { Button } from "reactstrap";
import { useHistory, useLocation } from "react-router-dom";
import Loader from './Components/Loader';
import MovieModal from './Components/Modal'
const apikey = "8b0354c6";
const MovieDetailsSection = (props) => {
const [movieData, s... | true |
5552330624e9f1570458d409e1eb82b2fbafe507 | JavaScript | meng1070470144/demo | /safeMgr-mobile/js/core/.svn/text-base/check-second-detail.js.svn-base | UTF-8 | 12,705 | 2.6875 | 3 | [] | no_license | // 公共详情界面
mui.init();
mui.plusReady(function() {
var self = plus.webview.currentWebview();
// 注意:不能使用id
var listItemId = self.listItemId;
var flag = self.flag;
console.log("listItemId=" + listItemId + " flag=" + flag);
var title = getTitle(flag);
jQuery("#h-title").html(title);
docume... | true |
9520e52d539ce2b7a7c3e50ec42cd3a76728b356 | JavaScript | DariaZherebtsova/Reader_book_2_0 | /scripts/component.js | UTF-8 | 689 | 2.734375 | 3 | [] | no_license | export default class Component {
constructor(element) {
this._element = element;
}
on(eventName, callback, selector = '') {
this._element.addEventListener(eventName, (event) => {
if (selector && !event.target.closest(selector)) {
return;
}
callback(event);
});
}
off(ev... | true |
08437013d2a44d27cea2136a3002c6d720a4f555 | JavaScript | hefox/rt-react | /src/containers/CategoryFilter.js | UTF-8 | 991 | 2.53125 | 3 | [
"MIT"
] | permissive | /**
* Provide a category (tags, venue) filter.
*/
import React from 'react';
import GalleriesServiceInstance from 'services/galleries';
import { Dropdown } from 'react-toolbox';
class CategoryFilter extends React.Component {
constructor(props) {
super(props);
this.state = {tags: []};
}
componentDidMou... | true |
4dc15a2c6f714dc5f855f45934a291908cd096d9 | JavaScript | effesociety/perlinapp | /backend/src/rooms.js | UTF-8 | 30,077 | 2.671875 | 3 | [] | no_license | const { deck, generateID, shuffleArray } = require("./util");
const cloneDeep = require('lodash.clonedeep');
const DEFAULT_POCKET_VALUE = process.env.DEFAULT_POCKET_VALUE || 0;
class Rooms{
constructor(){
this.data = {};
}
getInfo(){
console.log(this.data);
}
getRoom(roomID){
... | true |
02233c532be3b30ae32a43c877ba9e0e9ae63f20 | JavaScript | tahngarth825/yesangel | /frontend/util/message_api_util.js | UTF-8 | 977 | 2.53125 | 3 | [] | no_license | const MessageApiUtil = {
fetchMessages(userId, callback){
$.ajax({
url: "api/messages",
method: "GET",
data: {message: {user1_id: userId}},
dataType: "json",
success (response) {
callback(response);
}
});
},
fetchMessage(messageId, callback){
$.ajax({
... | true |
db7faf22dd1ca1a41c8754c72ea8c1dbe0995489 | JavaScript | hperez1123/First-Project | /app.js | UTF-8 | 2,577 | 3.25 | 3 | [] | no_license | const cURL = "https://www.themealdb.com/api/json/v1/1/categories.php"
const rURL = "https://www.themealdb.com/api/json/v1/1/random.php"
const sURL = "https://www.themealdb.com/api/json/v1/1/search.php?s="
const cbutton = document.querySelector("#cbutton");
const rbutton = document.querySelector('#rbutton')
const sbutt... | true |
a8d0f492b0bffc0a7d300578d46b573657597c3f | JavaScript | arafat5549/MyDataV | /demo/electronic-file/public/js/transform.js | UTF-8 | 10,177 | 2.875 | 3 | [
"MIT"
] | permissive | var x_PI = 3.14159265358979324 * 3000.0 / 180.0; var PI = 3.1415926535897932384626; var a = 6378245.0; var ee = 0.00669342162296594323;
function gcj02towgs84 (lng, lat) {
var dlat = transformlat(lng - 105.0, lat - 35.0);
var dlng = transformlng(lng - 105.0, lat - 35.0); var radlat = lat / 180.0 * PI;
var mag... | true |
61351e432626dc55a2a1f4c7732f72833ed7b8e5 | JavaScript | adityaiparkar/Angular | /AA1Q3.js | UTF-8 | 224 | 3.265625 | 3 | [] | no_license | function DisplayFactors(a) {
var i;
for (i = 0; i < a; i++) {
if (a % i == 0) {
console.log(+i);
}
}
}
var result;
result = DisplayFactors(20);
console.log("factors are : " + result);
| true |
e59c8bb647e90fecb3a5ead7914464ff6166ec92 | JavaScript | PriyaSilverback/JS | /JS/l22_math.js | UTF-8 | 603 | 4.3125 | 4 | [] | no_license | /*
Math Object
The Math object allows you to perform mathematical tasks.
Mathematical Constants
Math.E
Math.PI
Math.SQRT2
Math.SQRT1_2
Math.LN2
Math.LN10
Math.LOG2E
Math.LOG10E
*/
console.log(Math.PI * 2 * 2);
/*
Mathematical Methods
*/
console.log(Math.round(3.6));
console.log(Math.round(3.4));
console.log(Math.... | true |
1c5870df2a6322164ee274f6fef3bce601991d2e | JavaScript | AswAce/VacationWebsite | /JS-code/MainLogicControllers.js | UTF-8 | 6,743 | 2.6875 | 3 | [] | no_license | async function loginUserOnclick(e,email,password){
e.preventDefault()
let formLogin =new FormData(document.forms['login-form'])
///Формата от логин страницата трябва да има ИД 'login-form'
if(email==undefined||password==undefined){
email= formLogin.get("email")
password= formLogin.get("p... | true |
80e735f169bd2a60884001ec26a19d38eed9035e | JavaScript | ColdeGarage/SmartCalendar-Android | /js/account.js | UTF-8 | 1,445 | 3 | 3 | [] | no_license | function Account(){
// account name
this.name = "";
// login account retrun flag
this.login = function(name,password,callback){
var account = this;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
//console.log(this.responseT... | true |
f8fb76182ce713032ebdc57cec91175bb5d013c6 | JavaScript | docomo80/functionsAndLogicFlow | /02_Simple-Number-Validator/solution.js | UTF-8 | 1,662 | 3.578125 | 4 | [] | no_license | function validate() {
document.getElementsByTagName('button')[0].addEventListener('click', pressedBtn);
function pressedBtn() {
let input = document.getElementsByTagName('input')[0].value;
// console.log(input);
let sum = 0;
function isItThenDigitsNumber(input) {
r... | true |
710693d9d8a5cc1e9eb9e5ba4ae32b645cb56441 | JavaScript | Pigrabbit/web-dev-tutorial | /javascript-tutorial/team_stats.js | UTF-8 | 1,384 | 3.21875 | 3 | [] | no_license | const team = {
_players: [
{
firstName: 'Heungmin',
lastName: 'Son',
age: 28
},
{
firstName: 'Harry',
lastName: 'Kane',
age: 24
},
{
firstName: 'Dele',
lastName: 'Ali',
... | true |
834c65c679648053f92e390ecfe24705ca84aaaa | JavaScript | 0ness/generative-design | /common/js/contents/color_02.js | UTF-8 | 4,199 | 2.828125 | 3 | [] | no_license | (function () {
"use strict";
/*static property
--------------------------------------------------------------------*/
var canvas = document.getElementById("myCanvas"),
ctx = canvas.getContext("2d"),
perlin = new SimplexNoise(),
LIB = new Planet(),
TwoPi = Math.PI * 2,
winWidth =... | true |
1fe17ed7b60578d4a2fabdfae44970ac59f3b3f3 | JavaScript | SompalSingh/JSsnippets | /projects/jsonEffect/assets/js/script.js | UTF-8 | 1,520 | 3.015625 | 3 | [] | no_license |
/* Play an animation on each click and hover */
let animationIcon = document.querySelector('.bodymovinanim');
let createAnimation = bodymovin.loadAnimation({
container: animationIcon,
renderer: 'svg',
loop: false,
autoplay: false,
path: 'assets/data/checkbox.json'
... | true |
3fb14cba577e07848c822a0f9ee55ed3f6e15320 | JavaScript | acegoibniu/Aliens-vs.-Predator-2-Custom-Maps-List | /Scripts.js | UTF-8 | 2,779 | 2.765625 | 3 | [] | no_license | function ProduceCSV(MapsData) {
'use strict';
var Result = "";
MapsData.forEach( (M) => {
Result += `${M.mode},${M.name},${M.creator},${M.comment}\n`;
});
return (Result);
}
function ProduceMDTableByGameMode(MapsData, GameMode) {
'use strict';
var Result = "|Map Name|Author(s)|Comment|\n";
Result ... | true |
e35bc74f63c52a4f66f2a6a307ca6dd444cbc0af | JavaScript | rufman/fetch-script | /src/index.js | UTF-8 | 2,686 | 2.546875 | 3 | [
"MIT"
] | permissive | import { head, headCors } from './injectors';
const networkError = 'Network response was not ok.';
function contentLoadedEvent() {
const DOMContentLoadedEvent = document.createEvent('Event');
DOMContentLoadedEvent.initEvent('DOMContentLoaded', true, true);
document.dispatchEvent(DOMContentLoadedEvent);
}
/**
*... | true |
ed786f8703887f502e3229a2be30c21d32b3ecaf | JavaScript | VasylStep/june-2020 | /basic/consultation3/const3.js | UTF-8 | 8,864 | 3.609375 | 4 | [] | no_license | // // // // // // дан отсортированный по возрастанию массив целых чисел.
// // // // // // Необходимо вернуть наименьший и наибольший индекс заданного элемента.
// // // // // // Входные данные: arr — массив целых чисел значения которых по модулю не больше 10.
// // // // // // Размер массива не более 10 элементов.Выво... | true |
0a706e2d47df45fadb5417522a99bda88abc0c2d | JavaScript | hatemeel/university-web | /web techs/lab_6/scripts/calculations.js | UTF-8 | 1,942 | 3.140625 | 3 | [] | no_license | const calculationTypes = [
'square_area',
'circle_area',
'triangle_area',
'circle_length',
'sphere_volume',
];
let selectedCalcType;
const form = document.querySelector('form');
const selectCalculationType = (calcType) => {
if (!calcType) {
calcType = location.search.replace('?type=', '') || calculat... | true |
6d5a2f006a4976d0f44c768eb364871ef75280e7 | JavaScript | MikeGWem/PaperChase | /linkedList.js | UTF-8 | 1,402 | 3.421875 | 3 | [] | no_license | class Node {
constructor(data){
this.data = data;
this.next = this.previous = null;
}
}
class LinkedList {
constructor(){
this.head = null;
this.tail = null;
this.count = 0;
}
[Symbol.iterator]() {
let n = this.head;
return {
... | true |
13416f6c04082230a2e899602e74bf4fdae2cc3b | JavaScript | kaszowski/miniprojekt1 | /server.js | UTF-8 | 5,497 | 2.578125 | 3 | [] | no_license | var express = require("express")
var app = express()
const PORT = process.env.PORT || 3000;
var Registry = [];
var isLoggedIn = false;
var path = require("path")
app.use(express.static(path.join(__dirname, 'html')))
app.get("/", function (req, res) {
res.sendFile(path.join(__dirname + "/html/index.html"))
})
app... | true |
cb4dce65c3fc4454215b514d5ebed400464b6f5a | JavaScript | Aardeedev/reactBlog | /src/components/App/index.js | UTF-8 | 2,845 | 2.71875 | 3 | [] | no_license | import React, { Component, Fragment } from "react";
import "./App.css";
import ArticlePreview from "../articlePreview";
import posts from "../data/post";
import users from "../data/users";
import Comment from "../comment";
fetch("https://jsonplaceholder.typicode.com/comments").then(fetched =>
fetched.json()
);
clas... | true |
be2e63ba46c81ccb5ece821e1666de9825155106 | JavaScript | erikm18/erikm98 | /src/useCountAnimation.js | UTF-8 | 730 | 2.84375 | 3 | [] | no_license | import React, {useState, useEffect} from "react";
export default function useCountAnimation (countTo, countTime, fps=30){
let [number, setNumber] = useState(0)
useEffect(()=> {
const startTime = Date.now()
const myNumber=setInterval(() => {
let actTime = Date.now()
let a... | true |
64bb543193928f95411a6251dad66fcd12279596 | JavaScript | shinichiy2021/timecard_sample | /smart_phone/js/1017_chat_log/popup.js | UTF-8 | 7,394 | 2.828125 | 3 | [] | no_license | "use strict";
//******************************************************************************
// ファイルの変更履歴をここに記入してください。
// 2018/04/27 ポップアップ処理を分離しました。
// 2018/05/23 回転ボタン押下時の縦横の書き出しメソッドを追加しました。
//******************************************************************************
const Target_length_px = 1024
//----------... | true |
328c07ea3f833eea0cf0925acb5a2cd70bc45d88 | JavaScript | mbrukman/mender-gui | /src/js/components/common/forms/form.js | UTF-8 | 7,672 | 2.671875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import validator from 'validator';
import React from 'react';
var createReactClass = require('create-react-class');
import FlatButton from 'material-ui/FlatButton';
import RaisedButton from 'material-ui/RaisedButton';
var Form = createReactClass({
getInitialState: function() {
return {
isSubmitting: false... | true |
f02108e8285053a0e2bfe4e8146b4f2c024e3680 | JavaScript | flexayoung/stort-verkefni2 | /gogn/js/videoList.js | UTF-8 | 4,245 | 3.203125 | 3 | [] | no_license | class VideoList {
constructor(container) {
this.container = container;
}
load() {
const http = new XMLHttpRequest();
http.open('GET', './videos.json', true);
http.onload = function checkState() {
if (http.status >= 200 && http.status < 400) {
this.storeData(http.response);
... | true |
f08aed5265e5bcfa3462afcf48a313867bae78be | JavaScript | Webtech12/Node-Practice | /app.js | UTF-8 | 1,414 | 2.75 | 3 | [] | no_license | const validator = require('validator')
const yargs = require('yargs')
const Notes = require('./functions/utils.js')
// let val = getNotes('Your notes...')
// commands to run
// add command
yargs.command({
command: 'add',
describe: 'adds new note',
builder:{
title:{
describe: 'note tit... | true |
197b908ce2322fe8e153f58ea90ea54f2b12e26e | JavaScript | Mnarique217/react-crud | /src/components/Persona.js | UTF-8 | 4,587 | 2.953125 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import PersonaDataService from "../services/PersonaService";
const Persona = props => {
const initialPersonaState = {
id: null,
identificacion: "",
nombre: "",
fecha: ""
}
const [currentPersona, setCurrentPersona] = useSta... | true |
fc98ea8c45acafeb01a3359c7122d4db1f65347b | JavaScript | jkang95/tweeter | /public/scripts/client.js | UTF-8 | 3,425 | 3.234375 | 3 | [] | no_license | /*
* Client-side JS logic goes here
* jQuery is already loaded
* Reminder: Use (and do all your DOM work in) jQuery's document ready function
*/
const renderTweets = function (tweets) {
//deletes the existing tweet so that only the new tweet will be posted.
$("#tweets-container").empty();
//loops through twee... | true |
37a09ca70ff425d386d88094e3d19805a8308db3 | JavaScript | Erh22/Portfolio | /_js/myJS.js | UTF-8 | 3,029 | 2.71875 | 3 | [] | no_license |
//篩選功能
function change() {
var modelCbs = document.querySelectorAll(".models input[type='checkbox']");
var processorCbs = document.querySelectorAll(".processors input[type='checkbox']");
var filters = {
models: getClassOfCheckedCheckboxes(modelCbs),
processors: getClassOfCheckedCheckboxe... | true |