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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
843a3680dc884dbf5f156c0d6eda6d48f3957034 | JavaScript | GrandeJuan/Ejercicios-Playground | /Destructuring/1ero.js | UTF-8 | 261 | 3.609375 | 4 | [] | no_license | // DESTRUCTURACION ARRAY
let destinosDelMundo = ['Marruecos', 'Bariloche', 'Barcelona', 'China', 'Grecia'];
let [, bariloche] = destinosDelMundo;
let [, , , china] = destinosDelMundo;
console.log(destinosDelMundo);
console.log(bariloche);
console.log(china); | true |
a331c38e2b4e03041dcf14c62a773cb5cb8a45ed | JavaScript | pinkmauve/Movie-seat-booking | /src/main/webapp/resources/js/custom.js | UTF-8 | 7,434 | 2.671875 | 3 | [
"MIT"
] | permissive | var request;
function sendInfo(date) {
var datebutton = document.getElementsByClassName("datebutton");
for (i = 0; i < datebutton.length; i++) {
datebutton[i].style.transform = 'rotateY(0deg)';
datebutton[i].style.boxShadow = '0px 0px';
datebutton[i].style.backgroundColor='white';
datebutton[i].style.color='... | true |
6085c5dbc256cc0118bee4f8da12c2259f9cde66 | JavaScript | andycao/algorithmLearn | /src/leetcode_js/longestStr.js | UTF-8 | 615 | 4.15625 | 4 | [
"MIT"
] | permissive |
/**
* 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。
* @param {string} s
* @return {number}
*/
var lengthOfLongestSubstring = function(s) {
let j = 0;
let len = s.length;
let test = [];
let max = 0;
while(j < len) {
if(test.indexOf(s.charAt(j)) !== -1) {
test.shift();
} else {
... | true |
e57c7209bd159340ee34a596e273a47a79fd5d28 | JavaScript | BlvckYuppie/MochaTestPractice | /test/reading_test.js | UTF-8 | 1,120 | 2.765625 | 3 | [] | no_license | const assert = require ("assert");
const User = require("../src/user");
describe("Searching For User Record",() => {
let joe, moe, hoe, foe;
beforeEach((done) => {
foe = new User({
name: "Foe"
});
hoe = new User({
name: "Hoe"
});
joe = new User({
name: "Joe"
});
moe... | true |
0630cba5dad67e752a8ee639afd130c2d67eb60b | JavaScript | mattplatoff/dbFinalProject | /routes/registeruser.js | UTF-8 | 3,511 | 2.75 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var mysql = require('mysql');
var con = mysql.createConnection({
host: "dbproj.cep2q1dc92rr.us-east-1.rds.amazonaws.com",
user: "root",
password: "password",
database: "hulton_hotels"
});
function checkEmail(data, callback){
var emai... | true |
263d84889b3ce651881625e3421af760bf354549 | JavaScript | bryant1410/html-to-canvas | /lib/IgeClass.js | UTF-8 | 5,206 | 2.78125 | 3 | [] | no_license | /*
Isogenic Game Engine - Class generator
--------------------------------------
This code is part of the Isogenic Game Engine, however it is released
under a separate license from other parts of the engine and can be used,
reproduced, copied and distributed for all types of projects.
Rob Evans
Irrelon Softw... | true |
382e75aa966d0ad10727d79d409ac071fb68673f | JavaScript | RyuGuardian/messing-with-data-structures | /lib/unique.js | UTF-8 | 1,269 | 3.546875 | 4 | [] | no_license | 'use strict';
/******************************************
Could work on to not break if someone uses a string with "num" or "bool"
in it, but I think it does more than needed already, and I need to move on.
******************************************/
var unique = function(givenArr) {
var copy = [];
if(givenArr.len... | true |
2e550e0c67cf7629f9ef05c6c02f4a25bbf7170e | JavaScript | MrKalefruit/Kapit_bahay_prototype_ds | /js/app.js | UTF-8 | 4,574 | 2.875 | 3 | [
"MIT"
] | permissive | //scrollig
$(function() {
//sourced from scrollify master code
$.scrollify({
//section : "app",
sectionName : "section-name",
interstitialSection : "",
easing: "easeOutExpo",
scrollSpeed: 1100,
offset : 0,
scrollbars: true,
standardScrollE... | true |
20561a2d4e18389fc41f3bbad8f0529548eacddf | JavaScript | roseviet/JavaScript-programming | /4. Practice problems/Edabit questions + Interview questions/56. Trace that matrix.js | UTF-8 | 783 | 4.46875 | 4 | [
"MIT"
] | permissive | // Trace That Matrix
// Given a square matrix (i.e. same number of rows as columns), its trace is the sum of the entries in the main diagonal (i.e. the diagonal line from the top left to the bottom right).
// As an example, for:
// [
// [1, 2, 3],
// [4, 5, 6],
// [7, 8, 9]
// ]
// ... the trace is 1 + 5 + 9 = ... | true |
84ae73ad413cb2ecf04ab20f41611fd8f7c07eca | JavaScript | noelrock333/react-demo | /src/components/VideoForm/index.js | UTF-8 | 1,365 | 2.734375 | 3 | [] | no_license | import React from 'react';
import axios from 'axios';
class VideoForm extends React.Component {
state = {
title: '',
imageUrl: '',
videoUrl: ''
}
handleInputChange = (event) => {
this.setState({
[event.target.name]: event.target.value
})
}
_onSubmit = async (event) => {
event.... | true |
f0284bfb500f9077332d325e1922f5b6c9c5915a | JavaScript | tonyalaribe/heavenly-glory | /app/scripts/engine.js | UTF-8 | 26,009 | 3.03125 | 3 | [
"MIT"
] | permissive | (function(window){
"use strict";
/**
* The Motion Detector module takes a canvas context as an input to the
* `analyze()` method, and examines any motion that has occurred since the last
* call to `analyze()`.
*
* The constructor takes an options object which can be used to specify the width and height o... | true |
fbe4d20df2a7227f32be8685e7ab5840df9c40f0 | JavaScript | dh2020fall/advanced-topics-last-3-assignments-Zhaoyang-Yu | /js/popcorn-data.js | UTF-8 | 11,220 | 2.671875 | 3 | [] | no_license | // define a new function that pauses media when required
// everything in this file happens inside the window.on(load) function
// it runs when the rest of the window has been loaded
//$(window).on('load', function() {
var loadPopcornSub = function () {
// Create a popcporn instance by calling Popcorn("#id-of-the-me... | true |
8f2c5b516dd5911ff03d7bb8d41853b2bce79643 | JavaScript | werlang/gladcode-cdn | /js/tournament.js | UTF-8 | 18,989 | 2.515625 | 3 | [] | no_license | var hash, round;
$(document).ready( function() {
hash = $('#hash').html();
round = $('#round').html();
$('#hash, #round').remove();
socket_ready().then( () => {
socket.emit('tournament run join', {
hash: hash
});
socket.on('tournament refresh', data =>{
... | true |
a36e586e31302cdeae6e9a0fa1ea22693bde7e78 | JavaScript | WhiteSurge/MyDemo | /xiangqu1.0/js/login.js | UTF-8 | 3,518 | 3.046875 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
$("#log").click(function(){
//输入内容合法性验证
var phoneNum = $("#phonenum input").val();
var passWord = $("#password input").val();
if(!/^1(3|4|5|7|8)\d{9}$/.test(phoneNum)){
console.log("手机号错误");
$("#warning").html("请输入正确的手机号!")
}
else if(!/^[\w\$\%\!\@\#\^\&\*\(\)\-... | true |
3b1e271dd70f47cf8abeeb7fad74457c0d078406 | JavaScript | WilsonCWu/WebsocketWithUnity | /Daydream-Nodejs/server.js | UTF-8 | 651 | 2.625 | 3 | [] | no_license | /*
const http = require ('http');
http.createServer((request, response) =>{
response.writeHead(200, {
'Content-Type': 'text/plain'
});
response.write('Hello, Daydream!\n');
response.end();
}).listen(0917);
*/
const WebSocketServer = require("ws").Server;
const wss = new WebSocketServer({ po... | true |
5b52149a797dbd0afe305bca9ed6d956a934c66c | JavaScript | lytArthur/wfQuery | /amd/wfquery/dom.js | UTF-8 | 3,318 | 2.921875 | 3 | [] | no_license | /**
* @file 常用的dom操作添加、删除、前置、后置等
* @author shiyangyang(shiyangyang@baidu.com)
* @namespace wfquery/dom
*/
define('wfquery/dom', function () {
var wfQuery = require('wfquery');
wfQuery.fn.extend({
/**
* 基于当前wfQuery对象dom列表进行的matchesSelector过滤。
*
* @private
*
... | true |
4f13a031b66b948be40f365259b26679d6b74efa | JavaScript | JohnnyLin1998/johnnylin1998.github.io | /task1-JS/ninebox.js | UTF-8 | 1,915 | 4.09375 | 4 | [] | no_license | var boxGet = document.getElementsByClassName('box'); //获取九个格子class属性,取九个节点,变成数组
console.log(boxGet);
//随机颜色——16进制法
function color() {
var colorGet = "#";
for (var i = 0; i < 6; i++) {
colorGet += (~~(Math.random() * 15 + 1)).toString(16); //从1开始,16个数字内随机,向下取整+转化为16进制数
}
return colorGet;
}
c... | true |
0b9ab06b21f3110288bd4f5723d08c6f7a0450da | JavaScript | agunacoco/React-Study | /src/components/ReadContent.js | UTF-8 | 644 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react';
class ReadContent extends Component {
render() {
return (
// 독립적으로 구성된 글을 표시한다.
// 본문과 별개로 구성되어 다른 영역에 영향을 주거나 받지 않고 독립적으로 배포되거나 재사용할 수 있다.
<article>
{/* 밑에 코드처럼 props로 값을 변경하는 것은 불가하다 */}
{/* {thi... | true |
6593cb1cb4167c63d821955eb1db5546e84af289 | JavaScript | adrianeguez/App-Web-2017-A | /07-Backend-MVC/CarritoCompras/api/controllers/SaludoController.js | UTF-8 | 2,101 | 2.671875 | 3 | [
"MIT"
] | permissive | /**
* Created by USRDEL on 19/6/17.
*/
// /Saludo/crearUsuarioQuemado
module.exports = {
welcome: function (req, res) {
sails.log.info(req.method);
if (req.method == "POST") {
return res.json({ saludo: "hola" });
}
else {
return res.send("Error");
}
... | true |
8bca1c0e6d93b339a0407556f08599531cf4a0c4 | JavaScript | Sobolevskiy/informationSystem | /www/includes/warningJS.js | UTF-8 | 286 | 2.8125 | 3 | [] | no_license | (function(){
var but=document.querySelectorAll('.wrn');
for(var i=0; i<but.length; i++){
but[i].addEventListener('click', function(event){
if(!confirm("Вы правда уверены, что хотите это сделать?")){
event.preventDefault();}
});
};
})(); | true |
d51f48aceada52dcb6cd86bf0dbe227372a553e0 | JavaScript | navnis/budget_app | /app.js | UTF-8 | 578 | 2.546875 | 3 | [] | no_license | // BUDGET CONTROLlER
var budgetController = (function(){
//some Code
})();
// UI Controller
var UIContoller= (function(){
//some Code
})();
//Global app Controller
var controller = (function(budgetController, UICtrl){
var ctrlAddItem = function(){}
document.querySelector('.add__btn').addEventListen... | true |
6363fd64a4522f990d538edfa0ca04c3ab300622 | JavaScript | JonathanSpalding/mini-timeDirective | /js/timeDirective.js | UTF-8 | 914 | 3.03125 | 3 | [] | no_license | var app = angular.module('timeApp');
app.directive('showTime', function(){
return {
restrict: 'E',
template: '<div> {{formalIntroduction}}: {{personName}}' + '<button id="btn">Meet</button></div>', //The current time is {{time}} </div>
scope: {
formalIntroduction: '@', //String-literal ... | true |
32ac2c0f86d203152e21557015c985f742b01fce | JavaScript | RashmiRanganathan/count-to-6 | /exampleOfStringTemplate.js | UTF-8 | 181 | 3.625 | 4 | [] | no_license | var inputString = process.argv[2];
var lowerCasedString = inputString.toLowerCase(inputString);
console.log(`Hello, ${inputString}!
Your name lowercased is "${lowerCasedString}".`); | true |
ec9f390bcd83be5d1c1356f1036c34677e547226 | JavaScript | Kumar3080/first-test | /React Project test/test1.js | UTF-8 | 1,015 | 4.65625 | 5 | [] | no_license | // 1. Write a function that accepts three numbers and returns product of it.
const Product3=(x,y,z)=>(x*y*z)
undefined
Product3(10,2,5)
100
// 2. Write a function that accepts a number and returns
// - true if the number is even
// - false if the number is odd
const number=(x)=>{
console.log(x);
if (x%2==0){
... | true |
89e6c01d609182d3e154f7b6ff863757cabfb8be | JavaScript | nayonglin/jquery-slide | /slide.js | UTF-8 | 5,355 | 2.765625 | 3 | [] | no_license | /**
* 滑动组件
* @param {string} jqueryDom 组件最外层jquery对象
* @param {object} userOptions 用户可选参数
*/
function Slide(jqueryDom, userOptions) {
var userOptions = userOptions ? userOptions : {}; // 判断用户是否传入了可选参数
var options = {
slideWidth: userOptions.slideWidth || 450, // 每一页滚动多少宽度,默认为450px
slideSp... | true |
4e1a729e25ed2fa1d8c59c5aa817b2c0a8709446 | JavaScript | Irumporai1/song-recommender | /src/App.js | UTF-8 | 2,168 | 2.6875 | 3 | [] | no_license | import React from "react";
import "./styles.css";
import { useState } from "react";
const songDB = {
English: [
{
song: "Believer",
album: "Evolve"
},
{
song: "Master the Blaster",
album: "Master"
}
],
Malayalam: [
{
song: "Ezhutha kadha",
album: "Kumbalan... | true |
76f0752000d6027cf6c5f321fa6ebc523134bf83 | JavaScript | BourGuy64/RatzSlayer3 | /src/js/form.js | UTF-8 | 2,068 | 2.71875 | 3 | [] | no_license | "use strict";
// collect value of input text
function getDataText(formId, formData) {
let key,
value;
$('#' + formId + ' :text').each(function() {
key = $(this).attr('id');
value = $(this).val();
formData.append(key, value); // formData[key] = value;
});
$('#' + formId ... | true |
d4850c918f21c5e6cd253625a65adf49f9b56b6c | JavaScript | mjaffk/HW_JS | /39_Throttle.js | UTF-8 | 3,070 | 3.546875 | 4 | [] | no_license | 'use strict';
/* By Ekaterina Khorina */
let f = function ( a ) {
console.log( a )
};
// затормозить функцию до одного раза в 1000 мс
let f1000 = throttle( f, 1000 );
let f2000 = throttle2( f, 2000 );
f1000( 1 ); // выведет 1
f1000( 2 ); // (тормозим, не прошло 1000 мс)
f1000( 3 ); // (тормозим, не прошло 1000 м... | true |
883541c58387ae5b4a8752d0aaedc703361242ca | JavaScript | zzxjoanw/week3-assignment | /shopping-cart/shopping-cart/src/App.js | UTF-8 | 1,304 | 2.734375 | 3 | [] | no_license | import React, { Component } from 'react';
import ShoppingCart from './ShoppingCart.js';
import './App.css';
import FlightList from './FlightList.js';
class App extends Component {
state = { //remember, state flows down to child components
flights: [
'Seattle -> Tokyo',
'Seattle -> Budapest',
],
... | true |
5a1d9a1d88c50af2af9fd85b46a257c9c94a6d93 | JavaScript | Bogdan18b/testing_hooks | /src/counter.js | UTF-8 | 739 | 2.890625 | 3 | [] | no_license | import React, { useState } from 'react';
import {Button} from './styles';
const Counter = () => {
let [count, setCount] = useState(0);
let [firstName, setFirstName] = useState("Harry");
let [lastName, setLastName] = useState("Poppins");
// let [name, setName] = useState({
// first: "Harry",
// last: "P... | true |
1a917aa83b186718ee9752390587d23297bcb415 | JavaScript | varunchillara/p5 | /client/sketch_example_4.js | UTF-8 | 799 | 3.84375 | 4 | [] | no_license | class Circle {
constructor(x, y) {
this.x = x;
this.y = y;
this.radius = 1;
}
grow() {
this.radius++;
}
}
const circles = [];
function setup() {
createCanvas(1280, 720);
background(220);
for (let i = 0; i < 100; i++) {
circles.push(new Circle(random(width), random(height)));
}
}
... | true |
c1ae70967ad3b827dd130f49992aa1e8c59db2a5 | JavaScript | NepheliumInc/red-berry-master | /src/main/webapp/resources-new/dist/js/redberry.js | UTF-8 | 17,502 | 2.84375 | 3 | [] | no_license |
ko.observableArray.fn.subscribeArrayChanged = function(addCallback, deleteCallback) {
var previousValue = undefined;
this.subscribe(function(_previousValue) {
previousValue = _previousValue.slice(0);
}, undefined, 'beforeChange');
this.subscribe(function(latestValue) {
var editScript = ... | true |
4e932bcf3fe200f8b473fbc550611f2504208378 | JavaScript | zlatnaspirala/chrome-extensions | /projects/goldenspiral-googel-search/scripts/app.js | UTF-8 | 4,800 | 2.6875 | 3 | [
"MIT"
] | permissive |
/**
* @method getDom
* @param {id} id
* @returns {HTMLElement}
*/
function getDom(id) {
return document.getElementById(id);
}
(function () {
var extTitle = "<h4 class='half' >Search custom</h4>";
extTitle += "<h4 class='half' >Change type</h4>";
function createContainers() {
var btn = document.crea... | true |
d5d93fa9930f0d259d8d8110c7c889a83f6f8141 | JavaScript | Dmitry-rgb/Dmitry-rgb.github.io | /kalyan_project/src/js/script.js | UTF-8 | 2,198 | 2.953125 | 3 | [] | no_license | // slider
function slider(slide, prev, next) {
let slidIndex = 1,
items = document.querySelectorAll(slide),
prevBtn = document.querySelector(prev),
nextBtn = document.querySelector(next);
function showSlides(n) {
if (n > items.length) {
slidIndex = 1;
... | true |
78ff990a29631045d7cc8b81d1a22c51b16796b7 | JavaScript | returningsam/playground | /danish_shade/main.js | UTF-8 | 7,868 | 2.640625 | 3 | [] | no_license |
const MIN_NUM_MESHES = 7;
const MAX_NUM_MESHES = 20;
const NUM_LANTERNS = 1;
const MIN_RADIUS = .15;
const MAX_RADIUS = 12;
const SHADE_HEIGHT = 20;
const TIME_STEP = 0.001;
const LIGHT_COLOR = "#e8b757";
// three.js variables
var container, camera, scene, renderer;
var controls;
var simplex;
var lanterns;
var ... | true |
fe68f6127c2719596a6ceee2ae4c02943e4b98a2 | JavaScript | sarachour/vidsubtitle | /site/src/core/audio.js | UTF-8 | 254 | 2.703125 | 3 | [] | no_license | var AudioFile = function(path){
this.init = function(){
this.audio = new Audio(path);
}
this.play = function(c){
if(isValue(c)) this.audio.onended = c;
this.audio.currentTime = 0;
this.audio.play();
}
this.init();
} | true |
dcc89e384f1013ca934efd00649359530bc37948 | JavaScript | ppyaxin/leetcode | /problem46.js | UTF-8 | 634 | 3.421875 | 3 | [] | no_license | /**
* @param {number[]} nums
* @return {number[][]}
*/
var permute = function(nums) {
let results=[]
let result = new Set()
dfs()
function dfs(){
console.log(result.size)
if(result.size==nums.length){
results.push([...result])
return
}
for(let i... | true |
29b978dc1d715c49a89131ad8007d2b54e593404 | JavaScript | tibagni/Delivery | /WebContent/javascript/common/Form.js | WINDOWS-1250 | 1,158 | 2.765625 | 3 | [] | no_license | /*
* Este arquivo define funcionalidades de formularios ajax
*/
$(document).ready(function() {
// Hint dos campos do formulrio
$("input").live("focus", function() {
var tip = $(this).attr("title");
$(".tooltip").html(tip);
});
// Envio do formulrio usando ajax
$(".ajaxForm").submit(function() {
var seri... | true |
0e29c9bc233361deff8ab73df71a03786e843e8c | JavaScript | jvbeethoven/MAIII_DOK | /src/js/lib/PageTransition.js | UTF-8 | 1,556 | 2.859375 | 3 | [
"MIT"
] | permissive | import es6Promise from 'es6-promise';
import fetch from 'isomorphic-fetch';
es6Promise.polyfill();
const cache = {};
export default () => {
document.addEventListener(`click`, onClick);
window.addEventListener(`popstate`, changePage);
};
const onClick = e => {
let el = e.target;
while (el && !el.href) {
... | true |
99812032a8277f144b3e66c44486eb9a8483a7df | JavaScript | knowit/magicboard-react | /server/service/googleAssistantService.js | UTF-8 | 583 | 2.5625 | 3 | [] | no_license | let client = null;
function googleAssistantService(ws, req) {
ws.on("message", msg => {
console.log(msg);
if (msg.includes("client")) {
console.log("Client connected");
if(client === null) {
client = ws;
}
} else if (client !== null) {
... | true |
317920fbe1e7496e66a21496b61159a8f50651a4 | JavaScript | Mohiuddin10/shoppingCalculate | /JS/appp.js | UTF-8 | 1,214 | 3.15625 | 3 | [] | no_license | function updateCase(itemID, increasing, totalID, itemPrice) {
const caseInput = document.getElementById(itemID);
let caseNumber = caseInput.value;
if (increasing == true) {
caseNumber = parseInt(caseNumber) + 1;
}
else if (caseNumber > 0) {
caseNumber = parseInt(caseNumber) - 1;
... | true |
21b05cfd1777b29ff11741d5607a4e4f28f17924 | JavaScript | Qix-/node-legos | /lib/lego-accumulator.js | UTF-8 | 1,382 | 2.609375 | 3 | [
"MIT"
] | permissive | 'use strict';
/*
* _______
* /\ \
* / \ \ _
* / O \ \ | |
* / \ \ | | ___ __ _ ___ ___
* / O \______\ | | / _ \/ _` |/ _ \/ __|
* \ O / / | |___| __/ (_| | (_) \__ \
* \ / / |... | true |
9bcbc960515e0a65af1c271e7f867321a3ea42c6 | JavaScript | jish/better-status-bar | /better_status_bar.user.js | UTF-8 | 1,985 | 3.0625 | 3 | [
"MIT"
] | permissive | // ==UserScript==
// @name Better Status Bar
// @namespace josh.lubaway.com
// @description Chrome's status bar blows. It doesn't show you the full uri.
// @include *
// ==/UserScript==
var StatusBar = {
initialize: function() {
StatusBar.createStatusBar("I'm a status bar!");
StatusBar.hide();
... | true |
16931b70dcdf9090b3259e1a65d941385035c794 | JavaScript | bobbi-henderson/Coding_Challenges | /CodeWars/level7/EvensTimesLast.js | UTF-8 | 460 | 4.09375 | 4 | [] | no_license | // Given a sequence of integers, return the sum of all the integers that have an even index, multiplied by the integer at the last index.
// Indices in sequence start from 0.
// If the sequence is empty, you should return 0.
function evenLast(numbers) {
let total = 0
let multiplier = numbers[numbers.length-1... | true |
765a9625cb8cd29e3d5337802b051a9f930b9e65 | JavaScript | andywan40/react-foodpicker-app | /src/helpers/colorHelpers.js | UTF-8 | 144 | 2.53125 | 3 | [] | no_license | import chroma from "chroma-js";
export function getLuminance(hexColor) {
let luminance = chroma(hexColor).luminance();
return luminance;
}
| true |
ff8d378fe75bedb78e84e724843c2fe6ef44d348 | JavaScript | alec-huang-labs/TerminalCalculator2.0 | /src/instructions.js | UTF-8 | 943 | 3.171875 | 3 | [] | no_license | import React from 'react';
export default function Instructions() {
return (
<div>
<div className = "top-left-column">
<p>Instructions: <br />
Click on icons below or type in equation. Use "Enter" key or "=" button to calculte.
Will save up to 9 time stamped entries... | true |
a0cba54da1e93745999976cc0b0ed8fd09847c03 | JavaScript | olajide1234/ale | /lib/handlers/postPromoItem.js | UTF-8 | 926 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | /**
* Create a new promo item
*
* POST: /addpromo
*
*/
const Loan = require('../../models/loan');
const Promo = require('../../models/promo');
exports.handler = async function postPromoLoans(req, res, next) {
const { isAdmin } = req;
const { items } = req.body;
try {
let createdItemsArray = [];
... | true |
ddf6b03d81af2612d428fc90ed24942e6167f158 | JavaScript | debo98/Vlead | /just-artefacts/runtime8/artefact8.js | UTF-8 | 1,578 | 3.109375 | 3 | [] | no_license | var artefactMaker8 = function() {
var obj = {};
var adddiv = function(divElem) {
var art8 = document.createElement("div");
art8.innerHTML =
'<br>' +
'<p id="elements">Some elements have been inserted into the hash table. Search for the given element. Write the starting index and the ending index when search... | true |
9ccef7d85c3a71502277b62b6bd349dbdc441992 | JavaScript | yakcmxela/nofrills-forms-plugin | /form-loader.js | UTF-8 | 24,463 | 2.515625 | 3 | [] | no_license | jQuery(document).ready(function() {
// DB
var nfas = 'wp_nfas_fields';
var nfach = 'wp_nfach_fields';
// Navigation
jQuery('#nfas').on('click', function() {
jQuery('.account-sign-ups').css('display', 'block');
jQuery('.account-sign-ups .form-list').removeClass('Hidden');
jQuery('.ach-authorizations').css('disp... | true |
6a7727f12ce177ef2242ff4a537e1e55821f01b3 | JavaScript | dthiers/Workspace_Blok_11 | /Cloudservices/Passport/lib/modules/basicMiddleware.js | UTF-8 | 423 | 2.625 | 3 | [] | no_license | // Basic middleware
var middleware = function(req, res, next){
// Params is leeg
console.log(req.query);
if(req.user){
// TODO: check if user exists in database
if(req.user.username === "Dion Thiers"){
req.messages = {msg: "Helllooo"};
console.log("Signed in as: " + req.user.username);
... | true |
f70a079e5caf7fa5030459c2647a013be6300f97 | JavaScript | andygock/table-barcode-generator | /src/App.js | UTF-8 | 7,115 | 2.765625 | 3 | [
"MIT"
] | permissive | import React from "react";
import InputArea from "./InputArea";
import OutputTable from "./OutputTable";
import "./style.scss";
import OutputInline from "./OutputInline";
const App = () => {
const [records, setRecords] = React.useState([]);
const [hasHeaderRow, setHasHeaderRow] = React.useState(false);
const [ti... | true |
272cbe71215272aed655af513c83033463eb154d | JavaScript | KseniyaTulikova/virtual-keyboard | /src/Key.js | UTF-8 | 916 | 2.90625 | 3 | [] | no_license | export class Key {
constructor(width, height, row, column) {
this.value = null;
this.isKeyPressed = false;
this.element = document.createElement('div');
this.element.className = 'key';
this.element.style.width = `${width}px`;
this.element.style.height = `${height}px`... | true |
6534360c3376955d9335dfebf618e1f5468d38bb | JavaScript | sdgdsffdsfff/jordan2 | /static/js/test/importjquery.js | UTF-8 | 2,396 | 2.625 | 3 | [] | no_license | document.write("<script src='http://49.4.129.122/jordan/static/js/jquery.js'></script>");
//$.getJSON("http://49.4.129.122/jordan/god/kuayu_test?name=cooler&callback=?",{"name":"cooler"},function(data){
// alert(data);
// $.each(data, function(key, val) {
// alert(key);
// alert(val);
// });
//});
// $.... | true |
8e944a221a2823d128446d370e3ee15bec6e7fe6 | JavaScript | hexagonatron/WeatherDashboard | /script.js | UTF-8 | 10,408 | 3.0625 | 3 | [] | no_license | const cityTitleEl = document.querySelector(".current-city");
const currentDateEl = document.querySelector(".current-date");
const currentDayEl = document.querySelector(".current-day");
const currentIconEl = document.querySelector(".current-icon");
const currentTempEl = document.querySelector(".current-temp");
const cur... | true |
976e091479a39d64f423adcc12cc0c976efc13c8 | JavaScript | serhiy-t/search-control | /lib/assets/javascripts/search-control.js.js | UTF-8 | 4,219 | 2.578125 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | // Generated by CoffeeScript 1.3.3
(function($) {
var INPUT_SELECTOR, RESULTS_SELECTOR, buildQuery, focusInput, initResultsForQuery, performAsyncQuery, runQuery, searchEngines, setQueriesStatus, showResults, timestamp, visibleResults, whenInputChanged;
INPUT_SELECTOR = '.search-control-input';
RESULTS_SELECTOR =... | true |
812e1551df7205d031c869a99c64ba6a96ee46ff | JavaScript | lee-227/webpack | /webpack-source/source/4.es-load-common/copy.js | UTF-8 | 1,624 | 2.90625 | 3 | [] | no_license | // es模块会被转换成 commonjs模块
(() => {
// 根据依赖图构建模块对象,key为模块Id既该模块相对于根目录的相对路径,value为模块源代码
var modules = {
'./src/title.js': (module, exports, require) => {
module.exports = {
age: 18,
};
},
};
const cache = {}; // 模块缓存
function require(moduleId) {
// 自己实现的 require 方法
if (cache[mo... | true |
9a28f8d566db4c3fbb66a5ff816515c36566a498 | JavaScript | pankaj-shimpi/mern-exercise | /static/src/components/home/home.jsx | UTF-8 | 715 | 2.578125 | 3 | [] | no_license | import React from 'react';
import './home.css';
import Card from '../card/card';
function returnCards() {
let users = Array(10).fill({
id: Math.floor(100000 + Math.random() * 900000),
title: 'Card title',
details: `This is a wider card with supporting text below as a natural
lead-in to additional con... | true |
f3f460ec1ab801db1e30fb7a2479a4f36a27fe20 | JavaScript | baeron/rxjs-web-for-myself-course | /scripts/seventh-lesson.js | UTF-8 | 2,135 | 3.046875 | 3 | [
"MIT"
] | permissive | // Method FIRST get first value from data
rxjs.of(1, 2, "next", "lastValue")
.pipe(rxjs.operators.first())
.subscribe(
v => { console.log(v) },
e => { console.log(e) },
() => { console.log("complete") }
);
// Method LAST get last value from data
rxjs.of(1, 2, "next", "lastValue")
.pipe(rxjs.operator... | true |
52f573f960b6439d8676750f730e7df217b0700c | JavaScript | Falskim/Codewars | /day6/More Zeros than Ones.js | UTF-8 | 520 | 3.625 | 4 | [] | no_license | // More Zeros than Ones
// https://www.codewars.com/kata/5d41e16d8bad42002208fe1a
function moreZeros(s){
let unique = Array.from(new Set(s));
let ascii = unique.map(x=>toBinary(x.charCodeAt(0)));
return ascii.map((x,i)=>{
if(x.replace(/0+/g,'').length < x.replace(/1+/g, '').length){
retu... | true |
6eb6ed2b3e90a87732516fd64d294afe8b14a808 | JavaScript | maddstyle/JS-exercises | /functions.js | UTF-8 | 4,359 | 3.890625 | 4 | [] | no_license | function welcome(name){
console.log(`Hello ${name}`);
}
welcome("Michaela");
// let greetingName = "Michaela";
// const welcome = name => console.log(`Hello ${name}`)
// Define a function printToTwenty() that will print the numbers from 0 to 20 to the console ( don’t forget we have to invoke/call the function to s... | true |
8d988f59923043bef680280e99078ed257fcde31 | JavaScript | 5jasonc/Animations-using-Genetic-Algorithms | /HueGrid.js | UTF-8 | 6,236 | 3.640625 | 4 | [] | no_license | "use strict"
/*
Project 3 - Phase 5
Jason Streeter
HueGrid class - implements 2D array of hue values and uses a "chromosome" to determine atributes of each hue grid.
*/
class HueGrid
{
constructor(chrom, x, y, width, height)
{
this.chrom = chrom; //Chromosome decoded to find ... | true |
4161028102000ae70b23407636bc49d306e867fd | JavaScript | raphi/tic-tac-toe | /public/assets/js/tic-tac-toe.js | UTF-8 | 443 | 2.71875 | 3 | [] | no_license | $(document).ready(function() {
var api = new API();
$('#start-game-btn').on('click', function() {
api.start();
});
// Detect which row and column index was clicked and send the info to the server
$('#board td').on('click', function(e) {
var y = $(this).parent().children().index($(... | true |
035008c630738be16fef2c712974b1ccedce4d66 | JavaScript | Alexey-Astapchik/Social_Network | /src/redux/friends_reducer.js | UTF-8 | 3,944 | 2.734375 | 3 | [] | no_license | import {usersAPI} from '../components/API/API';
const FOLLOW = 'FOLLOW';
const UNFOLLOW = 'UNFOLLOW';
const SET_USERS = 'SET_USERS';
const SET_CURRENT_PAGE = 'SET_CURRENT_PAGE';
const SET_TOTAL_USERS_COUNT = 'SET_TOTAL_USERS_COUNT';
const TOGGLE_IS_FETCHING = 'TOGGLE_IS_FETCHING';
const TOGGLE_FOLLOWING_PROGRESS = 'TO... | true |
e3aae90b9e8962f9df55dc51b2bfe4cce75e6ffe | JavaScript | jgburton/WDI_PROJECT_2 | /db/seeds.js | UTF-8 | 3,039 | 3.171875 | 3 | [] | no_license |
const rp = require('request-promise');
const mongoose = require('mongoose');
const Venue = require('../models/venue');
const databaseUrl = require('../config/config').db;
mongoose.connect(databaseUrl);
Venue.collection.drop();
const options = {
uri: 'https://api.yelp.com/v3/businesses/search?location=london&catego... | true |
674611762bc44a679639bb4ea974507d677df69c | JavaScript | tritium-anglaise/howwhatwhy-react | /src/util/FetchHandler.js | UTF-8 | 957 | 2.671875 | 3 | [] | no_license | import React from 'react';
import 'whatwg-fetch';
import headlineCache from './local-cache-manager';
const HEADLINE_ENDPOINT = '//howwhatwhy.herokuapp.com/api/headlines/';
class FetchHandler extends React.Component {
constructor(props) {
super(props);
if( window.todaysData ){
headlineCache.set(0, window.toda... | true |
a81dfedf7bb0da76185059cbbd26802548ecc61d | JavaScript | Wayne-Bai/AST-normalize | /data/alibaba/nquery/demo/kv.js | UTF-8 | 1,814 | 2.828125 | 3 | [] | no_license | // (C) 2011-2013 Alibaba Group Holding Limited.
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// version 2 as published by the Free Software Foundation.
// Author :windyrobin <windyrobin@Gmail.com>
var columns = [
'id', 'name' , '... | true |
47a8c73df1973bb85ffc10febc3326d41ad6f972 | JavaScript | rdenson/supercub | /app/db/insurance-document.js | UTF-8 | 2,216 | 2.515625 | 3 | [] | no_license | var extend = require('extend'),
kq = require('q');
function InsuranceDocument(serverObject) {
var db = serverObject.get('database'),
insuranceSchema = db.Schema({
active: Boolean,
coverageDate: String,
dates: {
created: Date,
modified: Date
},
ef... | true |
0e59088e25bb4fbb7ebe6a99e8750ffb650c2ff9 | JavaScript | justinavickers/firstReactApp | /src/modules/OwnerManager.js | UTF-8 | 579 | 2.53125 | 3 | [] | no_license | import APIManager from "./APIManager"
class OwnerManager extends APIManager {
getOwner(id) {
return this.get(id)
}
getAll() {
console.log(this.all)
return this.all()
}
removeAndList(id) {
return this.delete(id).then(() => this.all())
}
post(newOwner) {
return fetch(`... | true |
d3e575ce34708cf0ba0a748c26ae636860d8093c | JavaScript | back2Lobby/cssWithJS | /cssWithJS.js | UTF-8 | 2,416 | 2.734375 | 3 | [] | no_license | function cssWithJS(styleElemID) {
var styleElemID = styleElemID;
var styleElement = document.querySelector(styleElemID).innerHTML;
var all = styleElement.match(/[^\n].*?{.*?}/gms);
//save all these class/ids to a global object
eval.call(this, 'var updateCss = {queries:[],data:[],magic: function(quer... | true |
f8a2cb9ca28ca84a458670c4825ddd933c74a2e1 | JavaScript | bingcheng45/hnr-extension | /chrome-extension/popup.js | UTF-8 | 3,633 | 2.921875 | 3 | [] | no_license | // Wait for DOM to be ready
document.addEventListener('DOMContentLoaded', () => {
const API_URL = 'http://localhost:3000/api/attack';
const dropdownItems = document.getElementsByClassName('dropdown-item');
function showView (views, viewToShow) {
for (let view of views) {
if (view.getAttribute('id') ==... | true |
7a2e57d3c821b371023f408cfdfb149e65667da4 | JavaScript | ChrisW-B/azuresubdomain | /snakeGame/js/main.js | UTF-8 | 4,424 | 2.734375 | 3 | [] | no_license | var snakeLoc = {};
var snakeLength;
var fruitLoc;
var dir = 1;
var tid;
var score = 0;
$(document).ready(
function () {
createSnake();
startPlaying();
}
);
$(document).on("swipeleft", function (event) {
if (dir != 1) {
dir = 0;
}
});
$(document).on("swiperight", function (event) {
if (dir != 0) {
dir = 1;... | true |
866b61a1fc746ab72ab9211c6a9b5dc0bd7bfcf9 | JavaScript | Pnguyen55/Web_Dev | /javascript/ToDoList.js | UTF-8 | 974 | 4.125 | 4 | [] | no_license | var todos = ["Buy New Turtle"];
window.setTimeout(function() {
var input = prompt("What would you like to do?");
while(input != "quit") {
//handle input
if(input == "list") {
listTodos();
}
else if(input == "new"){
addTodos();
}
else if(input == "delete"){
deleteTodos();
}
input = promp... | true |
7d7fbb55f1e04fd02ac9c101cfdf5e8d7d5c598e | JavaScript | Tvisher/todo-list | /src/tasks/tasks.actions.js | UTF-8 | 1,807 | 2.59375 | 3 | [] | no_license | import * as tasksGateway from './tasksGateway';
import { taskListSelector } from './tasks.selector'
export const TASK_LIST_RESIVED = 'TASK_LIST_RESIVED';
export const taskListResived = (taskList) => {
return {
type: TASK_LIST_RESIVED,
payload: {
taskList,
}
}
}
export co... | true |
4a451bd1e6a2aad17135f65beafcae4e797449ed | JavaScript | nagyist/remobjects-script | /Test/sputniktests/tests/Conformance/08_Types/8.5_The_Number_Type/S8.5_A4.js | UTF-8 | 334 | 2.796875 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S8.5_A4;
* @section: 8.5, 7.8.3;
* @assertion: NaN is not a keyword;
* @description: Create variable entitled NaN;
*/
var NaN=1.0;
NaN='asdf';
NaN=true;
NaN... | true |
eeaaaf35fd9947cc05a74460daeb43a18e4e1798 | JavaScript | evnelson315/MovieDatabaseReact | /app/components/Children/MovieList.js | UTF-8 | 1,320 | 2.578125 | 3 | [] | no_license | var React = require('react');
var MovieItem = require ('./MovieItem');
var MovieList = React.createClass({
render() {
const { movies, movieDelete } = this.props;
console.log(movies);
var renderMoviesList = () => {
return movies.map((movie, index) => {
return (
... | true |
da89f1983a8849b2c8e91377c0c6cef6ecbd443e | JavaScript | mattlaguardia/algo-practicar | /algos/by_date/20191126_count_the_number_of_ones/number-of-ones.test.js | UTF-8 | 746 | 2.921875 | 3 | [] | no_license | const numberOfOnes = require('./number-of-ones');
test('counts number of ones for [0, 0, 0, 1, 1, 1, 1, 1]', () => {
expect(numberOfOnes([0, 0, 0, 1, 1, 1, 1, 1])).toBe(5);
});
test('counts number of ones for [1, 1, 1, 1, 1, 1, 1, 1]', () => {
expect(numberOfOnes([1, 1, 1, 1, 1, 1, 1, 1])).toBe(8);
});
test('cou... | true |
8fee8d4567b5d78b960cdef9363e6618967f4291 | JavaScript | ChuaKaixin/express-books-api | /routes/books.js | UTF-8 | 1,905 | 2.578125 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const Book = require('../models/book')
const Author = require('../models/author')
/* GET books listing. */
router.get("/", async(req, res) => {
try {
let lookupCriteria = {};
if(req.query.authorname) {
let authors = await Author.find(... | true |
38a63b08eb49ad500fe08011ddc8b51328ae0970 | JavaScript | Mikamora/Reacting2react | /src/components/App.jsx | UTF-8 | 1,662 | 3.09375 | 3 | [] | no_license | import React, { Component } from 'react';
// import React from "react";
// const App = (props) => {
// return <h1>{props.text}</h1>;
// }
//same as below
class App extends Component {
constructor() {
super();
this.state = {
text: "hello world!",
phText: "Im a place hol... | true |
a6fc0eef102bd0429b7e2136b23fd804766d42cc | JavaScript | Sharanam/SAMGS | /Public/scripts/student.js | UTF-8 | 6,910 | 2.78125 | 3 | [] | no_license | function tabChanger() {
event.preventDefault();
// active tab change
let d = document.getElementsByClassName("nav-link");
for (var i = 0; i < d.length; i++) {
d[i].classList.remove("active");
d[i].classList.remove("active-updated");
d[i].classList.add("link-text-red");
}
... | true |
73c9b8dcd051dbed735247909b59ab063983ca9e | JavaScript | mleanos/trustroots | /modules/core/client/directives/tr-switch.client.directive.js | UTF-8 | 1,037 | 2.625 | 3 | [
"MIT"
] | permissive | (function () {
'use strict';
/**
* Directive to create a pretty toggle switches out from `input[type=checkbox]`
*
* Use as an attribute of the surrounding label:
* ```html
* <label tr-switch>
* <input type="checkbox">
* </label>
* ```
*
*/
angular
.module('core')
.directiv... | true |
655d753aed594dab06f3130020328d72d089fe26 | JavaScript | ArifSanaullah/React-Native | /restaurant-search-app/src/hooks/useResults.js | UTF-8 | 972 | 2.953125 | 3 | [] | no_license | import { useEffect, useState } from "react";
import yelp from "../api/yelp";
export default () => {
const [results, setResults] = useState([]);
const [loading, setLoading] = useState(false);
const [errorMessage, setErrorMessage] = useState("");
const searchApi = async (searchTerm) => {
try {
setLoad... | true |
0d68714f6c60153a2d011f7216877426adf54d26 | JavaScript | romanX1/SportGames | /src/main/resources/static/js/userLogic.js | UTF-8 | 993 | 2.8125 | 3 | [] | no_license | function getUserByName(name) {
$.ajax({
url: "/api/users/" + name ,
type: "GET",
async: false,
success: function (event) {
result = event;
}
});
return result;
}
function checkParam(){
}
function checkDuplicateName(name){
$.ajax({
url: "/api/... | true |
2479be455ffb3ba6eab7e19005b8a469db03c736 | JavaScript | markcorrea/task-manager | /src/components/utilities.js | UTF-8 | 294 | 3.03125 | 3 | [] | no_license | const formatDate = date => {
const day = date.getDate().toString()
const month = (date.getMonth() + 1).toString()
return `${date.getFullYear()}${validateZeros(month)}${validateZeros(day)}`
}
const validateZeros = entry => entry.length < 2 ? '0' + entry : entry
export default formatDate | true |
da14d75268fb7fc50a9394088085f5c6855e9978 | JavaScript | aniketstiwari/react_http_app | /src/containers/Blog/Posts/Posts.js | UTF-8 | 3,103 | 2.84375 | 3 | [] | no_license | import React, { Component } from "react";
import axiosinstance from '../../../axios';
import Post from '../../../components/Post/Post';
// import { Link } from 'react-router-dom';
import { Route } from 'react-router-dom';
import FullPost from '../FullPost/FullPost';
import './Posts.css';
class Posts extends Component ... | true |
93269e88bedca7c20c06aa23619d30cdcc7a6c56 | JavaScript | dtinth/tuner-chrome | /vendor/pitchy@2.0.3.js | UTF-8 | 31,249 | 2.71875 | 3 | [] | no_license | (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.pitchy = {}));
}(this, (function (ex... | true |
a784a8b1da5fd71f261f063f98e41533d599c07f | JavaScript | DusanSacha/pullup | /models/Vote.js | UTF-8 | 1,818 | 2.609375 | 3 | [
"MIT"
] | permissive | var mongoose = require('mongoose'),
Schema = mongoose.Schema,
Comment = require('./Comment.js'),
Issue = require('./Issue.js'),
NewsItem = require('./NewsItem.js');
var voteSchema = new mongoose.Schema({
item: {
type: Schema.Types.ObjectId,
required: true
},
itemType: {
type: String... | true |
44b350d7a0ed5b80fde5cfc89211bb9f9339f0df | JavaScript | jhkette/react-app-quiz-final | /src/components/questionBox.js | UTF-8 | 3,862 | 2.671875 | 3 | [] | no_license | import React, { Component } from "react";
import styled from "styled-components";
import Header from "./header";
import Footer from "./footer";
import QuizCompleted from "./quizCompleted";
const Wrapper = styled.div`
width: 100%;
min-height: 100vh;
`;
const Questions = styled.div`
width: 50rem;
margin: auto;... | true |
9d8784a9b27545db67fac9c38aa0730c282c29e4 | JavaScript | PiniShteren/catalog | /src/components/Home/Home.js | UTF-8 | 2,424 | 2.5625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import "./home.css";
import { useHistory } from 'react-router-dom';
import Door1 from "../images/door1.png";
import Door2 from "../images/door2.png";
import Door3 from "../images/door3.png";
import Door4 from "../images/door4.png";
const doors = [Door1, Door2, Door3,... | true |
e1986895580b5c35e1fe1544e51cbe838115ed7c | JavaScript | Marwillus/REST-practice | /controller/users-controller.js | UTF-8 | 4,504 | 2.53125 | 3 | [] | no_license | // Vereinheitlicht Datenbank
const mongoose = require("mongoose");
const bcrypt = require("bcrypt");
const jwt = require("jsonwebtoken");
const { validationResult } = require("express-validator");
const User = require("../models/user-model");
// für GET /user
exports.getAll = (req, res, next) => {
if (req.tokenUser... | true |
d1b97e6112a997f5aae22dd57299257660a4b998 | JavaScript | theoyrus/sanbercode-reactjs-batch18-part2 | /src/Tugas-13/Tugas13.js | UTF-8 | 6,346 | 2.65625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import axios from 'axios'
import '../Tugas-12/Tugas12.css'
const API_URL = 'http://backendexample.sanbercloud.com/api'
const Tugas13 = () => {
const recordKosong = {
id: null,
name: "",
price: 0,
weight: 0,
}
const [produkBu... | true |
f5543508c448e1bdea51be1f167ebe3490d56356 | JavaScript | P79N6A/front_end | /移动端/H5/积分/积分代码/src/pages/auction_old/controllers/updateCountdownAndButton.js | UTF-8 | 2,506 | 2.5625 | 3 | [] | no_license | /**
* Created by liuzhimeng.
* @date 2018/8/9
* @description
*/
import {staticData} from '../assets'
const {COUNT_DOWN, BUTTON} = staticData
/**
* 获取用户当前状态类型
* @param nowStatus 当前周期
* @param isWin 是否获奖
* @param isBid 是否出价
* @param bottomScore 底价
* @param userScore 用户总积分
* @return... | true |
e8a7bfaba317329235ed28a1b66fbc4034573e7f | JavaScript | Yashpk789987/AVENUEEXPAWANSIR | /src/redux/reducers/submissions.js | UTF-8 | 1,021 | 2.59375 | 3 | [] | no_license | const initialState = {
totalCount: 0,
submissions: [],
selectedSubmission: undefined,
};
const submissions = (state = initialState, action) => {
switch (action.type) {
case "APPEND": {
// eslint-disable-next-line no-shadow
const { submissions, totalCount } = action.payload;
return {
... | true |
fe1213c16b6a52d23c670670743cbec4c157b37e | JavaScript | val-elf/projector | /react/app/common/components/expandable/expandable-body.component.js | UTF-8 | 1,133 | 2.515625 | 3 | [] | no_license | import React from "react";
import template from "./expandable-body.template";
export default class ExpandableBody extends React.Component {
constructor() {
super(...arguments);
if (this.props.controller) {
this.props.controller.bodyController = this;
}
this.state = {
expanded: false
}
}
bodyRef =... | true |
f88dbef4df1441e4c562b8e449b49eb4114d429e | JavaScript | saif-11bit/NextFrontend | /src/pages/login.js | UTF-8 | 1,294 | 2.578125 | 3 | [] | no_license | import React, { useState } from "react";
import axiosInstance from "../utils/axiosApi";
import { useRouter } from 'next/router';
function Login() {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const router = useRouter()
const loginUser = async (e) => {
e.prevent... | true |
b44756559d8e7140f3744f5fcd5d60d87b2540d3 | JavaScript | kennethmcinturf/npm-exercises | /src/index.js | UTF-8 | 668 | 2.859375 | 3 | [] | no_license | const $ = require('jquery');
const sayHi = () => {
console.log("howdy");
}
sayHi();
$('body').append('<h2>jquery succesful</h2>')
// const user = require('./say-hello');
// console.log(user.niceMessage());
import user from './say-hello.js'
import colors from './colors.js'
console.log(user.sayHello());
console... | true |
8242e54ac9e6a435ce7281bc35c383d988863297 | JavaScript | FrankyDevelop/JasvascriptFullStack | /backend/index.js | UTF-8 | 1,617 | 2.625 | 3 | [] | no_license | //Solo usar variables de entorno en etapa de desarrollo
if (process.env.NODE_ENV != "production") {
require("dotenv").config();//modulo para variables de entorno
}
const path = require("path"); //resuelve problemas del / en otros SO
const express = require("express");
const morgan = require("morgan"); //nos permit... | true |
52c3c269867af7added362f5b3f37efa7588bc44 | JavaScript | robertelliott17/elliottdev | /js/app.js | UTF-8 | 713 | 2.640625 | 3 | [] | no_license | (function() {
var app = angular.module('store', [ ]);
app.controller('SiteController', function() {
});
app.controller('PanelController', function() {
this.tab = 1;
this.selectTab = function(setTab) {
this.tab = setTab;
};
this.isSelected = function(checkTab) {
return this.tab === checkTab;
};
... | true |
4d89df1f56b759e052bcfa7a0a4ef0b0fb2029dd | JavaScript | NacerYeles/tuto-learnyounode | /13-serveur_api_json_http.js | UTF-8 | 2,018 | 2.796875 | 3 | [] | no_license | // let port = process.argv[2];
// let http = require('http');
// let url = require('url');
// http.createServer((req, res) => {
// res.writeHead(200, {'Content-Type' : 'application/json'})
// var queryString = url.parse(req.url, true);
// let pahtname = queryString.pathname;
// // let minute = quer... | true |
0fd422f3a4f06641d99b652175d6a13d795cb9a5 | JavaScript | jonslui/jest_prac | /TOP_prac_set_1/reverse_string/reverse_string.test.js | UTF-8 | 233 | 3.09375 | 3 | [] | no_license | const reverseString = require('./reverse_string.js');
test('Works with "How are you today?"', () => {
const expected = '?yadot uoy era woH';
const result = reverseString('How are you today?');
expect(result).toBe(expected);
}) | true |
cd4018b54c112e831503231be3131b87a162a71c | JavaScript | aditya19555/c-pro-34 | /dog.js | UTF-8 | 669 | 2.96875 | 3 | [] | no_license | class Dog {
constructor(x,y,width,height){
//properties of body
var options = {
isStatic:true,
friction : 0.3,
density : 1.0
}
this.w = width;
this.h = height;
this.image = loadImage("images/dog1.png");
}
/... | true |