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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
af28ae671635b75a23cd246bd3b2669771688c00 | JavaScript | anabeatrizgn/app-ce-heroku | /controladores/cadastro.js | UTF-8 | 1,333 | 2.859375 | 3 | [] | no_license | const knex = require("../conexao");
const bcrypt = require("bcrypt");
const cadastro = async (req, res) => {
const { nome, email, senha, cep, cidade } = req.body;
if (!nome) {
return res.status(404).json("O campo nome é obrigatório");
}
if (!email) {
return res.status(404).json("O campo email é obrig... | true |
12d59781a8918fbbfcdeca5715378a48c7f6b320 | JavaScript | alejandrozeb/curso_nodejs | /12-ts/05-decoradores/index.js | UTF-8 | 1,379 | 3.25 | 3 | [] | no_license | "use strict";
//descomentamos en el config los decoradores por que son experimenales
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof R... | true |
543d9dd9ae8c7a27ceb653731c9ed40b95451039 | JavaScript | 47leonel-wabo/dogs-image-gallery | /src/components/BreedsList.jsx | UTF-8 | 3,095 | 2.640625 | 3 | [] | no_license | import React, {useState, useEffect} from 'react';
import {fetchBreeds} from '../lib/api'
const BreedsList = ({dispatchBreedChange}) => {
const [value, setValue] = useState('')
const [breeds, setBreeds] = useState([])
const [isLoading, setIsLoading] = useState(false)
const [currentPage, setCurrentPage]... | true |
d6dab89ecce154e56b12c4a134a603fbdbae51a8 | JavaScript | ujjawal-1999/Weather-App | /app.js | UTF-8 | 2,836 | 2.9375 | 3 | [] | no_license | window.addEventListener('load',()=>{
let long;
let lat;
let temperatureDescription = document.querySelector('.temperature-description');
let temperatureDegree = document.querySelector('.temperature-degree');
let locationTimezone = document.querySelector('.location-timezone');
let temperatureSec... | true |
872df6c1ee8f54b188259715d22a724054195b15 | JavaScript | manavjotsingh/instanews | /js/script.js | UTF-8 | 947 | 2.96875 | 3 | [] | no_license | $(function() {
$("#sections").on("change", function() {
const $selected = $(this).val();
appendArticles($selected);
});
});
function appendArticles($selected){
$.ajax({
method: 'get',
url: `https://api.nytimes.com/svc/topstories/v2/${$selected}.json?api-key=Y0Po2jNwx2e3WMMp9UNMY... | true |
461c698e7b95103c08972886457174c556dd9dce | JavaScript | gvialpai/Triviachat-iOS-Public | /App/Utils/api.js | UTF-8 | 750 | 2.734375 | 3 | [] | no_license | var encoder = require('./encoder');
var api = {
getQuestions(difficulty){
return new Promise((resolve,reject) => {
var url = `https://opentdb.com/api.php?amount=100&difficulty=${difficulty}&type=multiple`;
console.log(url)
fetch(url)
.then((res) => res.json())
.then((questionSet... | true |
7d1637dea631e6a9b16dcbcba2d91ac5ac5bab13 | JavaScript | melissabanoengarde/CART253 | /Projects/Project2/spawn-testing/js/script.js | UTF-8 | 1,614 | 3.3125 | 3 | [] | no_license | "use strict";
/**************************************************
Asteroid Spawn Test
Melissa Banoen-Garde
Testing out the skeleton here since the amount of
code on P2 is overwhelming and trials has not been
working.
**************************************************/
let asteroids = [];
let numAsteroids = 2;
let as... | true |
210cb62440e63624559e44fe75901bf6f20a27f8 | JavaScript | darlaevans2000/refactor-tractor | /test/User-test.js | UTF-8 | 1,193 | 2.6875 | 3 | [] | no_license | import { expect } from 'chai';
import User from '../src/User';
import testUserData from './test-data/test-users';
describe('User', () => {
let user;
beforeEach(() => {
user = new User(testUserData[0])
})
it('should be a function', () => {
expect(User).to.be.a('function');
});
it('should be an in... | true |
9d2ef2f1967b8004304606ce2f453a057f364fdc | JavaScript | GenesisMauries/ejercicio_test_jest | /test/calculator.spec.js | UTF-8 | 1,367 | 3.328125 | 3 | [] | no_license | const { add, resta, multiply, division } = require('../calculator');
describe ('Suma', () =>{
test('suma de dos numeros', () => {
expect(add(1,2)).toBe(3);
});
test('Deberia retornar 11 para recibe 5,6', () => {
expect(add(5,6)).toBe(11);
})
test('Deberia retornar el mismo valor si ... | true |
bb7147a3d7b5f8970f01c8104c47485c3b235774 | JavaScript | sunlight3d/Aptech | /C2108G1/JSON/24-08-2022/myapp/src/Part3CallApi.js | UTF-8 | 4,311 | 2.671875 | 3 | [] | no_license | import { Button } from 'react-bootstrap'
import 'bootstrap/dist/css/bootstrap.min.css'
import './Part3.css'
import { useState, useEffect } from 'react'
import {Spinner} from 'react-bootstrap'
const axios = require('axios').default;
function Part3CallApi(props) {
//useState is called "Hook"
const [type... | true |
4f1672fc4c827f96097c6f90b913ac2b059677f8 | JavaScript | griffobeid/weather-tweets | /server/controllers/tweet.controller.js | UTF-8 | 1,904 | 2.703125 | 3 | [
"MIT"
] | permissive | import Tweet from '../models/tweet';
/**
* Get all tweets
* @param req
* @param res
* @returns void
*/
export function getTweets(req, res) {
Tweet.find().exec((err, tweets) => {
if (err) {
res.status(500).send(err);
}
res.json({ tweets });
});
}
/**
* Get tweets from the last 3 hours
* @p... | true |
da189e35447f7d6a3876e9d0c7adfadb71f84599 | JavaScript | aliakseyevavikt/codewars-solutions | /7 kyu/Find the lucky numbers.js | UTF-8 | 477 | 4.5 | 4 | [] | no_license | /*
https://www.codewars.com/kata/580435ab150cca22650001fb/train/javascript
Description:
Write a function filterLucky/filter_lucky() that accepts a list of integers and filters the list to only include
the elements that contain the digit 7.
For example,
ghci> filterLucky [1,2,3,4,5,6,7,68,69,70,15,17]
[7,70,17]
Don'... | true |
b54db097e82bca70e5352b47a818f4e85391d6d1 | JavaScript | Archi711/TTT2 | /src/store/store.js | UTF-8 | 2,859 | 2.5625 | 3 | [
"MIT"
] | permissive | import React from 'react';
import { JOIN_ROOM, GET_AVAILABLE_ROOMS, CREATE_ROOM, UPDATE_DATA_PING, CHANGE_NAME, LOAD_OLD_STATE } from './actionTypes';
import { socket } from '../api';
export const lightTheme = {
primaryColor: "#FFF",
secondaryColor: "#DFEE20",
secondaryBColor: "#eFEf30",
ndColor1: "#A4F109",
... | true |
8d0ba9b1c76eb913c18da6edb0f4e1b2e0e0415c | JavaScript | komobe/km-inventory | /indigo/WebContent/resources/build/js/jquery.insert.js | UTF-8 | 2,586 | 2.53125 | 3 | [] | no_license | jQuery(document).ready(function($){
$("form#ajouterArticle").on('submit',function(e){ // On sélectionne le formulaire par son identifiant
e.preventDefault(); // Le navigateur ne peut pas envoyer le formulaire
var formulaire = $(this);
var tbody= $("#datatableArticle").find("tbody");
var donnees... | true |
75769a6a38300a42c59b5251ede92209784da5f9 | JavaScript | pkanher617/project-symo | /symo/content/stats.js | UTF-8 | 3,255 | 3.03125 | 3 | [] | no_license | var current = "Overall";
var overallReset = 0;
var game1Reset = 0;
var game2Reset = 0;
function pickMockStats (mockType) {
var imageHolder = document.getElementById('statsImage');
switch(mockType) {
case "Overall":
current = mockType;
if(overallReset === 0) {
imageHolder.src = "../../images/mockOverallSt... | true |
547f3347c06acbc9a4c70738bbac580c6d0a85ee | JavaScript | devobro/jsfundamentals | /0.032_conditionalschallenge.js | UTF-8 | 1,514 | 3.953125 | 4 | [] | no_license | //Bronze Challenge - write a conditional that chacks an age variable aned prints a different statement depending on the age.
let age = 20;
if (age >= 0 && age < 16){
console.log("You're too friggin' young to do anything");
} else if (age == 16){
console.log("Hooray! You can drive, now! (don't run me over)");
} else... | true |
6113b2a7ac2461bf8ea81a9046d05f808b594eb7 | JavaScript | pattodiablo/gameJam | /WebContent/assets/canvas/Intro.js | UTF-8 | 2,437 | 2.59375 | 3 | [] | no_license |
// -- user code here --
/* --- start generated code --- */
// Generated by 1.5.4 (Phaser v2.6.2)
/**
* Intro.
*/
function Intro() {
Phaser.State.call(this);
}
/** @type Phaser.State */
var Intro_proto = Object.create(Phaser.State.prototype);
Intro.prototype = Intro_proto;
Intro.prototype.constructor = Int... | true |
0a69635457762d46f460c965e686036aa43ae5f2 | JavaScript | jethroglaudin/Algorithms | /HackerRank/2DArrays.js | UTF-8 | 1,666 | 3.5 | 4 | [] | no_license | 'use strict';
const fs = require('fs');
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});
process.stdin.on('end', _ => {
inputString = inputString.replace(/\s*$/, '')
.split(... | true |
48c7490aec757507228c9ef2ac1d59bc7053548b | JavaScript | Woc12138/JS-Sorting-Algorithms | /src/index.js | UTF-8 | 1,021 | 3.734375 | 4 | [] | no_license | // 导入列表类
import ArrayList from './arrayList'
// 初始化数据项
let list = new ArrayList()
list.insert(3)
list.insert(6)
list.insert(4)
list.insert(2)
list.insert(11)
list.insert(10)
list.insert(5)
console.log(list) // [3, 6, 4, 2, 11, 10, 5]
// 冒泡排序 bubbleSort() 测试
// list.bubbleSort()
// console.log(list) ... | true |
6942cec44f77ef6b1afd6bf8fdc4e5dba833df46 | JavaScript | fredrick-dominy/javascript-trainingPrograms | /24-7kyu-javascriptFilter-1.js | UTF-8 | 1,204 | 3.703125 | 4 | [
"MIT"
] | permissive | /*While developing a website, you detect that some of the members
have troubles logging in. Searching through the code you find
that all logins ending with a "_" make problems. So you want
to write a function that takes an array of pairs of login-names
and e-mails, and outputs an array of all login-name,
e-mails-pairs... | true |
480389b99bcf9f63fbbbcfca81a7a0ec56e8b488 | JavaScript | ejdouglass/studybuddy | /src/App.js | UTF-8 | 22,795 | 2.53125 | 3 | [] | no_license | import React, { createContext, useContext, useReducer, useState, useEffect } from 'react';
import { BrowserRouter as Router, Route, useHistory } from 'react-router-dom';
import './App.css';
function save(state) {
window.localStorage.setItem('studyBuddyData', JSON.stringify(state));
}
function load() {
return JSON... | true |
5f809ac82c655f89a0df3643c8232a204448a540 | JavaScript | max-van-leeuwen/SnapLensStudio-OceanShader | /Ocean Shader/Ocean Shader/Public/Script/OceanHueCycle.js | UTF-8 | 1,347 | 2.96875 | 3 | [
"MIT"
] | permissive | // Max van Leeuwen
// maxvanleeuwen.com, ig @max.van.leeuwen, twitter @maksvanleeuwen
//
// Ocean Shader example project
// Cycles through hue of ocean shader colours
//@input bool on
//@input float animSpeed = 1
//@input float colourSaturation = .7
//@input float colourValue = .7
var anim = 0;
var oceanShader = ... | true |
278d4d17e4edf8959fbf27bc44ecb6dac84e1b27 | JavaScript | wanderls/trybe-exercises | /Fundamentos/Bloco-4-Intro-JS-Logica-Programacao/dia-1-javascript-primeiros-passos/exercicio-7/script.js | UTF-8 | 622 | 3.640625 | 4 | [] | no_license | let nota = -100;
if (nota >= 90 && nota <= 100){
console.log("Você acertou: " + nota + "% - Nota: A.");
}
else if (nota >= 80 && nota < 90){
console.log("Você acertou: " + nota + "% - Nota: B.");
}
else if (nota >= 70 && nota < 80){
console.log("Você acertou: " + nota + "% - Nota: C.");
}
else if (nota >= 60 && ... | true |
2c839e7f07ed1f89341491bc0d0f94f0eb80edfd | JavaScript | MAXON-BY/Portfolio-ReactJS | /src/Components/Test/MoshCounters.js | UTF-8 | 1,330 | 2.59375 | 3 | [] | no_license | import React, {Component} from 'react';
import Mosh from './Mosh.js'
class MoshCounters extends Component {
state = {
counters: [
{id: 1, value: 0},
{id: 2, value: 0},
{id: 3, value: 0},
{id: 4, value: 0},
]
};
handleReset = () => {
c... | true |
a7a246b67f5fcc3e3bad79b332130e0a6bed1e6c | JavaScript | tigoe/MakingThingsTalk2 | /3rd_edition/chapter9/ndefSignature/public/writer/sketch.js | UTF-8 | 1,782 | 3.265625 | 3 | [] | no_license | /*
Writer/formatter page script
context: p5.js
*/
var userField, challengeField; // fields for username and challenge phrase
var responseDiv; // div for responses from the server
function setup() {
noCanvas(); // no drawing, so no canvas needed
// create the response div:
responseDiv = cre... | true |
aa1ddbdf4a21aae190e1f55b92016bcc438ec066 | JavaScript | zfxj/studyDemo | /src/arithmetic/递归.js | UTF-8 | 457 | 4.09375 | 4 | [] | no_license | //案例一 普通递归
function factorial(n){
if( n === 1) return n;
return n * factorial(n-1);
}
//案例二 尾递归(并非所有的语言都支持尾递归。)
// 因为尾递归函数每子一层不再需要使用父一层的变量,所以父一层执行完毕就会销毁栈记录,避免了内存溢出节省了内存空间。
function fac(n, total) {
if (n === 1) return total;
return fac(n - 1, n * total);
}
fac(5, 1) // 120
| true |
3d010b9fc866ea1a451495e46804adcc358ad4b8 | JavaScript | ibtissamjori/version-plateform-1.2 | /WebContent/js/services/FormationServ.js | UTF-8 | 1,295 | 2.578125 | 3 | [] | no_license | class FormationServ {
constructor(activityDAO, eventDAO, formationDAO, jobDAO, laureateDAO, partnerDAO, professorDAO, studentDAO, actualityDAO) {
this.activityDAO = activityDAO;
this.eventDAO = eventDAO;
this.formationDAO = formationDAO;
this.jobDAO = jobDAO;
this.laureateD... | true |
750da6678bc6d949d594cc7a8b453b24af0e4786 | JavaScript | QiShaoXuan/animate_resume | /src/load/style.js | UTF-8 | 2,723 | 2.96875 | 3 | [] | no_license | import config from '../scripts/components/config'
export const style1 = `/**
*
* Hey. My name's qishaoxuan. I'm a web developer.
*
* I build a animating resume
*
* Let's begin. We start by animating... yes, everything.
*/
* {
transition: all 1s;
}
/**
* It seems to do noting. But you'll see.
*
* Black on ... | true |
a5c8642b43f8367f75cc10d7d3479fb5f73b7db3 | JavaScript | tonygithinji/React-Concepts | /src/todos-redux/components/AddTodo.js | UTF-8 | 775 | 2.515625 | 3 | [] | no_license | import React from "react";
import { connect } from "react-redux";
import { addTodo } from "../actions";
class AddTodo extends React.Component {
constructor(props) {
super(props);
this.state = {
todo: ""
};
}
handleInputChange = (e) => {
this.setState({ todo: e.t... | true |
e958be1145db6b5737a5c029557de65e96dec761 | JavaScript | brandon2997/Brandgampro | /protypeweekone/js/player.js | UTF-8 | 2,197 | 3.1875 | 3 | [] | no_license | function Player() {
this.x = canvas.width / 2;
this.y = canvas.height / 2;
this.width = 250;
this.height = 40;
this.radius = this.width/2
this.vx = 0;
this.vy = 0;
this.ay = 1;
this.color = "#ff0100";
this.drawrec = function () {
context.save();
contex... | true |
085cdf82cb8fca05bce6d54d96300c9075c87088 | JavaScript | momo-barro/simple-react-counter | /src/Counter.js | UTF-8 | 1,345 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
import {connect} from 'react-redux';
//import action creators
import {incrementActionCreator, decrementActionCreator} from './App'
class Counter extends Component {
constructor(props){
super(props);
this.increment = this.increment.bind(this);
this... | true |
0b71b0f746a75c1964854926e168b97ba0ad09f6 | JavaScript | catalinarw/JS-Algorithm-Quick-Ref | /Algorithm Library/mortgage-calculator.js | UTF-8 | 363 | 2.875 | 3 | [
"MIT"
] | permissive | //calcuate monthly loan payment
var calculate = function (loan) {
principalAmount = loan.principle.value;
annualPR = loan.annualPR.value;
loanTerm = loan.loanTerm.value;
r = annualPR / 1200;
a = Math.pow(1 + r, -12 * loanTerm);
b = 1 - a;
mp = principalAmount * r / b
loan.mp.value = mp... | true |
ccd53cb61e28abb2baa9c0ff41f6beb77874b47d | JavaScript | birdjonathan/subclass-dance-party | /src/pirate.js | UTF-8 | 1,186 | 2.859375 | 3 | [] | no_license | var Pirate = function(top, left, timeBetweenSteps, imageQueue){
Dancer.call(this, top, left, timeBetweenSteps, imageQueue);
this.$node = $('<span class="pirate"><img /></span>');
this.$node.find('img').attr('src', this.currImg);
var dancer = this;
this.$node.on('mouseover', function() {
console.dir(this);... | true |
fa9f130ed1254e654330416a8628708fac16bd38 | JavaScript | app-init/ui | /src/components/Collapse/CollapseItem.js | UTF-8 | 3,382 | 2.921875 | 3 | [] | no_license | import React, {Component} from 'react'
import Header from './CollapseHeader'
import Body from './CollapseBody'
/**
* The CollapseItem class is used for both assigning the correct classnames
* to the outer container hosting the CollapseHeader and CollapseBody components,
* as well as keeping track of the collapse i... | true |
0d286fb88b5d8fec15991119b684c83833337fd3 | JavaScript | rique223/react-course-exercises | /exercise1-userinput useroutput/src/App.js | UTF-8 | 697 | 2.578125 | 3 | [] | no_license | import { useState } from "react";
import UserOutput from "./components/UserOutput";
import UserInput from "./components/UserInput";
import "./App.css";
const App = () => {
const [username, setUsername] = useState("Renjia");
const style = {
display: "flex",
flexDirection: "column",
alignItems: "center",
};
... | true |
428c76f905e7525492162fc159295990818a7777 | JavaScript | Sushant2/RestAPI | /app.js | UTF-8 | 2,795 | 2.546875 | 3 | [] | no_license | const express = require("express");
const app = express();
const morgan = require("morgan"); //HTTP request logger package for node.js
const bodyParser = require("body-parser");
const mongoose = require("mongoose");
require("dotenv").config();
const pswrd = process.env.MONGO_PW;
const productRoutes = require("... | true |
1318de78a6b90c0efa617c2c70e16a3154ccd6af | JavaScript | RabbiaUmer/QuizrApp | /www/js/compete.js | UTF-8 | 7,613 | 2.578125 | 3 | [] | no_license | $(function () {
var token = window.localStorage.getItem('user-token');
$("#compete-screen").on("pageshow", function () {
$('#comp-loader').hide();
// Retreiving data from URL parameters
var params = $(this).data("url").split("?")[1]; // retrieveing url parameters
var emptyString = ""; // will be ... | true |
2613390b9e42f6c56431e7b038cd56ebb97c3d76 | JavaScript | arasmussen/Venzio | /roots/www/root/common/PhysicsManager.js | UTF-8 | 5,126 | 2.9375 | 3 | [] | no_license | // Copyright (c) Venzio 2013 All Rights Reserved
define([
'basejs',
'common/TerrainManager',
'common/Globals'
], function(Base, TerrainManager, Globals) {
return Base.extend({
constructor: function(terrainManager) {
this.terrainManager = terrainManager;
this.moveSpeed = 5.0;
},
... | true |
d623b3df6977450ac0134a7aff3f75d86342ea59 | JavaScript | eva1963/zhufengLearn | /banner/js/index.js | UTF-8 | 4,112 | 2.84375 | 3 | [] | no_license | ~ function() {
let bannerRender = (function() {
let container = document.querySelector('.container'),
wrapper = document.querySelector('.wrapper'),
focus = document.querySelector('.focus'),
arrowLeft = document.querySelector('.arrowLeft'),
arrowRight = documen... | true |
b06d15ab54189b42fdb48cf583f1dcf3297f5a6f | JavaScript | dreyes06/NodeDB | /src/Components/MyPost.js | UTF-8 | 2,888 | 2.8125 | 3 | [] | no_license | import React, { Component } from "react";
import axios from "axios";
class MyPost extends Component {
constructor() {
super();
this.state = {
amendStatus: false,
img: "",
description: "",
link: "",
handle: "",
updateBlogPost: true,
myPost: []
};
}
changeAme... | true |
1a36b163b85c6f0fd2a08b198f27c8cf554a16e2 | JavaScript | martn001/keep-me-fit | /src/data/Messages.js | UTF-8 | 1,575 | 2.65625 | 3 | [] | no_license | // Message as reward that you did it!
// TODO: maybe someday this should contain transgender-neutral messages.. maybe someday..
const successfulMessages = [
'Lekker man!',
'Lekker bezig pik!',
'Heeeuuy goed gedaan!',
'Woooop woooop! Je hebt het gewoon effkes gedaan!',
'Ben trots op je!',
'Wie is hier nou de... | true |
2e7de67638b8c00876f34e49735a66624043cdb3 | JavaScript | valMn/code-challenges | /CodeWars/inc. Extract domain from URL.js | UTF-8 | 473 | 3.515625 | 4 | [] | no_license | function domainName(url) {
let regex = /^[^a-z][^\//];
return url.match(regex);
//your code here
}
console.log(domainName("http://github.com/carbonfive/raygun"));
domainName("http://github.com/carbonfive/raygun") == "github";
domainName("http://www.zombie-bites.com") == "zombie-bites";
domainName("https://www.... | true |
9e8d86920e2c38c6180a9da5f63132779934e135 | JavaScript | phantom6174/vanillaEmailValidation | /js/validator/validator.js | UTF-8 | 1,014 | 2.890625 | 3 | [] | no_license | // IFFY - module pattern for the validation request
// reutrn {object} - the module api
var formValidator = (function(){
var api = {
requestCheck: requestCheck
}
// performs the check request
//@param {string} - email to validate
//@return - request promise
function requestCheck(email){... | true |
e049027af0624335fc0edbb2abf2fde34b5d7086 | JavaScript | 2424066896/react_Project | /src/api/index.js | UTF-8 | 2,847 | 2.515625 | 3 | [] | no_license | //定义接口函数请求模块
import ajax from "./ajax";
import jsonp from 'jsonp'
import {message} from 'antd'
const BASE = ''
export const reqLogin = (username,password) =>{
return ajax(BASE+'/login',{username,password},'POST') //注意不能写pwd瞎写否则response没有数据的
}
export const addUser = (user) =>{
return ajax('/manage/user/add',... | true |
158edd78f492aed575510be15ba8b01a5b3be98a | JavaScript | rsamp/HuskyNOM | /frontend/components/image/Index.jsx | UTF-8 | 2,329 | 2.515625 | 3 | [] | no_license | var React = require('react'),
ImageStore = require('../../stores/image'),
ApiUtil = require('../../util/api_util'),
AddImageButton = require('./AddButton'),
ImageIndexItem = require('./IndexItem');
var ImageIndex = React.createClass({
getInitialState: function(){
return {images: [], page: 0};
}... | true |
0f576947efa999df28e5fe15af18db5c82ca2bfd | JavaScript | vpatel90/Plunder | /app/assets/javascripts/components/card.js.jsx | UTF-8 | 2,025 | 2.515625 | 3 | [] | no_license | var Card = React.createClass ({
getInitialState: function() {
return {
style: '',
clickedStyle: '',
shipUrl: '',
iconUrl: '',
};
},
componentWillMount: function() {
var style = "card play-card color-card-" + this.props.color;
var shipUrl = "/assets/" + this.props.... | true |
28be65b41da9cf387649de2da04a1c727ca0e462 | JavaScript | Chrispykins/Music-Generation | /composer.js | UTF-8 | 4,343 | 2.703125 | 3 | [] | no_license | (function(global) {
//controller function for constructing melody
function Composer(options) {
options= options || {};
this.timeSig= options.timeSig || [4, 4];
this.clef= options.clef || 'Treble';
this.key= options.key || global.keys.C;
this.mode= options.mode || global.modes.Major;
this.range= optio... | true |
1eeb02c4729c24a3970f9c6a605dfb3ebd52d358 | JavaScript | psym0n76/archimedes-service-broker | /Broker/request-live-price.js | UTF-8 | 1,481 | 2.9375 | 3 | [] | no_license | module.exports = {
subscriber(params){
subscribe(params);
}
}
var subscribe = (params) => {
var callback = (statusCode, requestID, data) => {
if (statusCode === 200) {
try {
var jsonData = JSON.parse(data);
} catch (e) {
console.log('subscribe request #', requestID, ' JSON ... | true |
51955a0c744120a114c282efb4b606cc84347c39 | JavaScript | mildred/nntpcont | /config/data/js/app.js | UTF-8 | 403 | 2.53125 | 3 | [] | no_license | import m from "./mithril.js"
class App {
constructor(){
this.list = new List()
}
view(){
return [
m("h1", {}, "App"),
"Hello",
"World",
m(this.list)
]
}
}
class List {
constructor(){
this.template = template("list", {
"li": {
"line <- lines": {'.': "line"}
}
})
}
view(){
var r... | true |
4ad06edc3df34e5394469d3491abcd2a07087d05 | JavaScript | chamerling/node-livelogger | /samples/post.js | UTF-8 | 1,272 | 2.90625 | 3 | [
"MIT"
] | permissive | //
// Simple client which sends valid log messages to the server defined in the ../config.js file
//
// Christophe Hamerling - christophe.hamerling@gmail.com
//
var request = require('request')
, conf = require('../config');
var levels = ['fine', 'info', 'success', 'warning', 'error'];
var messages = [
'This is a... | true |
f96ecab8083d4b9dccf3863de9cb45929c69e446 | JavaScript | DavidScales/portfolio | /Gruntfile.js | UTF-8 | 5,857 | 2.65625 | 3 | [
"MIT"
] | permissive | /*
Code Partly From Udacity Responsive Images Course
*/
/* Use 'grunt' to execute the following:
1. Removes images & src/images directories - ('grunt clean')
2. Makes new images & scr/images directories - ('grunt mkdir')
3. Minifies & Inlines CSS (style.css) & JS (projects.js) - ('grunt inline')
4. Minif... | true |
6125f2fc62c6419352e1f391b078406fed9876d9 | JavaScript | LanderMalta/maxipago-gateway-sdk | /lib/utils/utils.js | UTF-8 | 403 | 3.109375 | 3 | [
"MIT"
] | permissive | var formatObject = function(object, reference) {
var formatted = {};
Object.keys(reference).forEach(function(key) {
if (object.hasOwnProperty(key)) {
if (object[key] instanceof Object) {
formatted[key] = formatObject(object[key], reference[key]);
} else {
formatted[key] = object[key]... | true |
eb0d80b6d17e91f8d3afc47847fcb4f7c23b0499 | JavaScript | mdanemberg/senac-aula-2 | /aula-2-senac/lista-de-compras/src/App.js | UTF-8 | 1,459 | 2.71875 | 3 | [] | no_license | import React from 'react';
import './App.css';
import Form from './components/Form'
import Input from './components/Input'
import List from './components/List'
import ListItem from './components/ListItem'
import Button from './components/Button'
class App extends React.Component {
state = {
item: '',
list: [... | true |
4802b479ce45e01fa9c414addc709dc32b172ba4 | JavaScript | Wolfe-Lamprecht/ASC-Front | /src/Components/CreateProfile.jsx | UTF-8 | 2,463 | 2.828125 | 3 | [] | no_license | import React, { useState } from 'react';
import Form from 'react-bootstrap/Form'
import InputGroup from 'react-bootstrap/InputGroup'
import FormControl from 'react-bootstrap/FormControl'
import Button from 'react-bootstrap/Button'
import FormGroup from 'react-bootstrap/FormGroup'
function CreateProfile(props) {
co... | true |
7a5eb62636874cf46d29ae027f90b901061c94f1 | JavaScript | simonhuan/Oursky-Answer | /Answer-4.js | UTF-8 | 160 | 3.109375 | 3 | [] | no_license | function createArrayofFunctions(y) {
var arr = [];
for(let i=0;i<y;i++){
arr[i] = function(x) {return x+i;}
}
return arr;
} | true |
5230dd6d23f6add82a51c18f4f9ca348cc12cf73 | JavaScript | jwkovell/Rogue | /rogue/js/set.js | UTF-8 | 5,144 | 3.5 | 4 | [] | no_license | // Define Set class
function Set(cards) {
'use strict';
if (cards === undefined) {
this.cards = [];
} else {
this.cards = cards;
}
}
Set.prototype = {
getCardCount: function() {
'use strict';
return this.cards.length;
},
getCourtCardCount: function() {
'use strict';
var courtCardCount = 0;
va... | true |
f40071f5fa5f3e6532a703a666e0600e2ed62c8f | JavaScript | delta94/VrboClone | /Frontend/vbro-app/src/Redux/Listing/listingreducer.js | UTF-8 | 770 | 2.5625 | 3 | [] | no_license | import {
LISTING_DATA_FAILED,
LISTING_DATA_SEND,
LISTING_DATA_SUCCESS,
} from "./actionTypes";
const initState = {
isSending: false,
isSent: false,
isError: false,
dataListingPage: [],
totalResults: 0,
};
export const listingreducer = (state = initState, action) => {
switch (action.type) {
case LISTING_DAT... | true |
1ca29257da87b56318e8d9aaaa35fc01a31cd000 | JavaScript | 38/radiation | /doc/tracker.js | UTF-8 | 6,921 | 2.984375 | 3 | [] | no_license | /* if the global is not initliazed, initialize it */
try {
$t
} catch (e) {
/* The helper object */
$t={
/* Encode base64 VLQ integer */
encode: function () {
var termset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef"
var nonterm = "ghijklmnopqrstuvwxyz0123456789+/"
var last = 0
var absolute = true
/* gener... | true |
d019de5403d20f0aab3a2f8456912fe58fd39bff | JavaScript | thejohnfreeman/rambda | /modules/dissoc.js | UTF-8 | 378 | 2.625 | 3 | [
"MIT"
] | permissive | import omit from './omit'
export default function dissoc (prop, obj) {
if(arguments.length === 1){
return objHolder => dissoc(prop, objHolder)
}
if (obj === null || obj === undefined) {
return undefined
}
const willReturn = {}
for (const key in obj) {
if (key !== `${prop}`) {
willRe... | true |
ec8438ec9ba1e4d8ba1a8d922d57d603d05ceb02 | JavaScript | FranBarGar/JavaScript | /Unit4/Boletin6/q01/script.js | UTF-8 | 974 | 3.296875 | 3 | [] | no_license | var map = new Map();
map.set('DAW', 'Despliegue de aplicaciones web');
map.set('DIW', 'Diseño de interfaces web');
map.set('DWECL', 'Desarrollo web en entorno cliente');
map.set('DWESE', 'Desarrollo web en entorno servidor');
map.set('EIE', 'Empresas, iniciativa emprendedora');
console.log("Muestra cuántos módulos hay... | true |
702650834ecab932a52d139020a668a3202a8e68 | JavaScript | R0NAND/R0NAND.github.io | /simulations/physics_engine/objects/aabb.js | UTF-8 | 1,603 | 2.96875 | 3 | [] | no_license | // RENAME FILE
class AABB{
constructor(min, max){
this.min = min;
this.max = max;
}
doesItFit(aabb){
return (this.min.x < aabb.min.x && this.max.x > aabb.max.x && this.min.y < aabb.min.y && this.max.y > aabb.max.y);
}
fatten(fatness){
this.min = Vec2.subtract(this.min, new Vec2(fatness, fatne... | true |
2f9900ee21da73adac8ab496530c1558713ce287 | JavaScript | vladinson009/SoftUni-Projects | /JS FUNDAMENTALS/11FundamentalsFinalPreparation/04. Programming Fundamentals Final Exam/03. Heroes of Code and Logic VII.js | UTF-8 | 2,906 | 3.5 | 4 | [] | no_license | function heroesOfCode(input) {
let n = Number(input.shift());
let myHeroes = {};
let myCommands = {
'CastSpell': castSpell,
'TakeDamage': takeDamage,
'Recharge': recharge,
'Heal': heal
};
for (let i = 0; i < n; i++) {
let tokens = input.shift().split(' ');
... | true |
04f53c379b1b942382eceecd4448ee6523cff97f | JavaScript | zenkicosmetics/webapp-repo | /system/virtualpost/themes/widget/js/sessioncatch.js | UTF-8 | 829 | 2.75 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | function setCookie(cname, cvalue, minutes) {
var d = new Date();
d.setTime(d.getTime() + (minutes*60*1000));
var expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + "; " + expires;
}
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';... | true |
84a45e6e95d2d560afc781fed05d188116a94394 | JavaScript | vickoshman/kraken | /WebApp/Scripts/Posts.js | UTF-8 | 2,387 | 2.6875 | 3 | [] | no_license | var pageSize = 20;
var pageIndex = 0;
$(document).ready(function () {
var lastLoadTime = Date.now();
ko.applyBindings(new ViewModel());
var loading = false;
$(window).scroll(function () {
var currentScroll = $(window).scrollTop();
var docHeight = $(document).height();
var windowHeight = $(window)... | true |
6815aa9fef331a25329b8b416e26c878cdd76c16 | JavaScript | damir-bubanovic/JavaScript-CodeBook | /INTER - VAR - inserting special characters.js | UTF-8 | 547 | 3.515625 | 4 | [] | no_license | /*
!!INTER - VAR - INSERTING SPECIAL CHARACTERS!!
> want to insert a special character, such as a line feed, into a string
*/
/*
EXAMPLE:
1) Use one of the escape sequences in the string
>> npr. to include the copyright symbol in a block of text to be added
to the page, use the escape sequence \u00A9... | true |
2987da2040e7e0e2d76e7c8e4789206441c295fa | JavaScript | grind086/LootML | /dist/Compiler.js | UTF-8 | 6,038 | 2.703125 | 3 | [] | no_license | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("./constants");
const varNameGenerator_1 = require("./varNameGenerator");
/**
* Converts parser objects to javascript
*/
class Compiler {
constructor(parsed, lib) {
this._nextVarname = varNameGenerator... | true |
2ca31865561549d8f1ce2eda30cd49bcd0dcb500 | JavaScript | JarodChen/algo-js | /src/others/queue-scenarios/hot-potato/hot-potato.test.console.js | UTF-8 | 181 | 2.703125 | 3 | [] | no_license | import { hotPotato } from './hot-potato.js';
const names = ['John', 'Jack', 'Camila', 'Ingrid', 'Carl'];
console.log(hotPotato(names, 6));
console.log(hotPotato(names, 6).winner); | true |
bedbfa5d513d4ce31f2da8713e8448d7f3dd0986 | JavaScript | FranciscoNav/francisco-first-website | /script.js | UTF-8 | 726 | 3.3125 | 3 | [] | no_license |
/*This code below is to add content to the “about” paragraph*/
const p1 = document.createElement('p1');
p1.textContent = 'The primary purpose of this website is to give myself (Francisco) a sand box to practice JavaScript, CSS, and HTML. I may also add some personal information about myself too, but do not expect anyt... | true |
cb847eda2a04e908af1b813a30d5345874f398b5 | JavaScript | JDeardsJr/SimpleGetRequests2 | /index.js | UTF-8 | 1,010 | 3.234375 | 3 | [] | no_license | 'use strict';
function getDogImage(newUrlLink) {
fetch(newUrlLink)
.then(response => response.json())
.then(responseJson =>
displayResults(responseJson));
}
function displayResults(responseJson) {
console.log(responseJson);
for (let i = 0; i < responseJson.message.length; i++) {
$('.js-image-... | true |
c51d69b005c61617de79d8245daeeaad518e6ddb | JavaScript | asimeoli/ad649_teamc | /assets/javascript/app.js | UTF-8 | 677 | 2.828125 | 3 | [] | no_license | //submit form
function registrationComplete() {
document.getElementById("registrationTitle").innerHTML =
"Registration Complete";
document.getElementById("registrationText").innerHTML = "Thank you!";
document.getElementById("registrationForm").innerHTML =
"<div class='card text-center border border-whit... | true |
a0962cbe717cacf531637c7e43ecc4e91d423c3f | JavaScript | brayankj/ApiVeterinaria | /routes/user.js | UTF-8 | 1,731 | 2.640625 | 3 | [] | no_license | /*
--------- Create Crud /api/users routes ---------
*/
//--------- express require ---------
const { Router } = require('express');
const router = Router();
const { check } = require('express-validator');
//--------- exports helpers and middlewares ---------
const { validarCamposExpress } = require('../helpers/... | true |
c9242156d7c96f2ec42b6180945046c8c89d3af6 | JavaScript | deuxfractales/otto | /api/repostBot.js | UTF-8 | 769 | 2.53125 | 3 | [] | no_license | async function repostBot (fastify, options) {
const {Builder, By, Key, until} = require('selenium-webdriver');
const users = [
{
username:'oototesterone',
password: '123ABCabc123!'
}
]
fastify.get('/repostBot', async (request, reply) => {
let driver = await new Builder().forBrowser... | true |
4c63d1f11bc11a9159a5604e8b3d81a74353e77a | JavaScript | kenmaready/natours | /dev-data/import-dev-data.js | UTF-8 | 1,533 | 2.71875 | 3 | [] | no_license | const fs = require('fs');
require('../db');
const Tour = require('../models/Tour');
const User = require('../models/User');
const Review = require('../models/Review');
const tours = JSON.parse(
fs.readFileSync(`${__dirname}/data/tours.json`, 'utf-8')
);
const users = JSON.parse(
fs.readFileSync(`${__di... | true |
cbb0908cfe934160a38b5bf0fac1b99eb81b63ec | JavaScript | astridlyre/99bottles | /test/bottleNumber.js | UTF-8 | 3,552 | 3.09375 | 3 | [
"MIT"
] | permissive | /* eslint func-names: ["error", "never"] */
/* eslint no-magic-numbers: 0 */
import { BottleNumber } from '../bottleNumber.js'
import { describe, it } from 'mocha'
import { expect } from 'chai'
describe('BottleNumber', function () {
describe('BottleNumber Factory Method', function () {
it('Returns the correct Bo... | true |
2ad5f579159424942813bbf7a09ae87546d7d734 | JavaScript | ZhafranBahij/personal-profile | /src/component/js/Experience.js | UTF-8 | 1,784 | 2.5625 | 3 | [] | no_license | import react from "react";
import "../css/Experience.css";
//* BUAT IMPORT IMAGE SECARA MASSAL
function importAll(r) {
let images = {};
r.keys().forEach((item, index) => {
images[item.replace("./", "")] = r(item);
});
return images;
}
const photoProject = importAll(
require.context("../project_image", fa... | true |
fa8cb3d53140773284bb57d0dbe34925bb8ba6fb | JavaScript | rajanpriyadarshi/Transit-Planner | /Segmentation/markbusstop.js | UTF-8 | 2,255 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | var gtds = [];
function gtd(marker, busstop) {
this.marker = marker;
this.busstop = busstop;
}
var busstopid = 1;
function clickedOnMap(event) {
//return;
getBusStop(event.latLng);
}
function getBusStop(latlng) {
var busstop = prompt("Marker Number?");
busstop = busstop == null ? "" : busst... | true |
ce4bc42ca7f03de2608e689e5eff143674f33ed5 | JavaScript | 04Bhushan/Learning-React-with-Redux | /Some Application Built for Practice/videos/src/components/App.js | UTF-8 | 1,984 | 2.796875 | 3 | [] | no_license | import React from "react";
import SearchBar from "./Searchbar";
import youtube from "../apis/youtube";
import VideoList from "./VideoList";
import VideoDetail from "./VideoDetail";
//making API request is an async operation
// we have to interact with API either promises or Async await syntax
class App extends React.... | true |
3d9cb6275a88295628d7db7d358f7ab87fcb727e | JavaScript | djvang/app-post | /src/api.js | UTF-8 | 259 | 2.578125 | 3 | [] | no_license | export const loadPosts = async ( ) => {
const url = `https://jsonplaceholder.typicode.com/posts/1?_embed=comments&_expand=user`
return fetch(url)
.then((res) => res.json())
.catch((err) => {
console.error(err);
return [];
});
}; | true |
2185a6b3c7606ad990ff736c357c23d0a2d8f1d0 | JavaScript | wnwlals13/myBlogApp | /src/components/hashtag/hashtag.jsx | UTF-8 | 1,667 | 2.96875 | 3 | [] | no_license | import React, { useEffect, useRef, useState } from "react";
import styles from "./hashtag.module.css";
const Hashtag = ({ setHashtag }) => {
const [hash, setHash] = useState([]);
const hashOneRef = useRef();
const hashRef = useRef();
const onKeyUp = (event) => {
event.preventDefault();
if (event.keyCo... | true |
395d64a8eb6e82343f94eb9ef16b6a7998bdf4bc | JavaScript | kamilpodlasek/wallcleaner | /content.js | UTF-8 | 909 | 2.75 | 3 | [] | no_license | const feed = document.querySelector('div[role="feed"]');
const config = { childList: true, subtree: true };
const grabAndRemovePosts = (keywords = []) => {
const posts = feed.querySelectorAll('div[data-testid="fbfeed_story"]');
posts.forEach(post => {
const userContents = post.querySelectorAll('.user... | true |
c78f8696bba96aa6db46d2503988ad4db4a226f7 | JavaScript | Samiriiit/react-learn | /src/components/Customer.js | UTF-8 | 1,163 | 2.53125 | 3 | [] | no_license | /* eslint-disable no-restricted-globals */
import React from 'react'
import { Link } from 'react-router-dom'
const Customer = ({ customer }) => {
const handleDelete = (id) => {
console.log(id)
var del = confirm('Are you sure you want to delete')
if (del === true) {
fetch('https://reqres.in/api/use... | true |
a8290aa8319333392ed478cde3142fa470eafb8d | JavaScript | Alice-nor/front-endEnginnerClass-season3 | /0728 - Web front-end development/week4/myui/src/App.js | UTF-8 | 4,163 | 2.796875 | 3 | [] | no_license | import {useState} from 'react';
import './App.css';
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';
import MyTable from './MyTable';
import Grid from '@material-ui/core/Grid';
function App() {
const [text, setText] = useState('');
const [task, setTask] = useStat... | true |
2861c790a73d8ac249d28bc3b49d10526413cf3f | JavaScript | RomainMon/tall | /TALL/js/jquery_itineraire.js | UTF-8 | 1,001 | 2.6875 | 3 | [] | no_license | $(document).ready(function(){ // fonction qui permet de lancer les autres fonction jquery si la page c'est chargé correctement
$("#itineraire_button").on('click', function(e){
e.preventDefault(); // on empêche le bouton d'envoie d'envoyer le formulaire
// récupération de la valeur de la commune cho... | true |
afb683e892d26627fca278b72c9c899099843da4 | JavaScript | sx81128/AppInOneBPM | /Lib/MyDP-AD/seldateinit.js | UTF-8 | 10,735 | 2.609375 | 3 | [] | no_license | var RLParas = {
MDayCount: new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31), //定义阳历中每个月的最大天数
TheYear: new Date().getFullYear(), //定义年的变量的初始值
TheMonth: new Date().getMonth() + 1, //定义月的变量的初始值
TheDay: new Date().getDate(), //定义当前日期的初始值
CurDayObj: null,
//日期单击事件
clickHandle... | true |
27017d2a2c2c25d471a62396d646fc67224562ce | JavaScript | devnagoyal-ux/pendulum | /bob.js | UTF-8 | 218 | 2.96875 | 3 | [] | no_license | class Bob{
constructor(x,y,diameter){
this.diameter = diameter;
this.x = x;
this.y = y;
this.body = circle(x,y,this.diameter);
}
display(){
circle(this.x,this.y,this.diameter);
fill('red');
}
} | true |
252b2c4b0d93207da3a2fe1d20ea0af42e9e8141 | JavaScript | hadoop835/bpmn-process-designer | /src/modules/auto-place/CustomAutoPlace.js | UTF-8 | 2,072 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | import AutoPlace from "diagram-js/lib/features/auto-place/AutoPlace";
export default function CustomAutoPlace(eventBus, modeling) {
AutoPlace.call(this, eventBus, modeling, 3000);
eventBus.on("autoPlace", 3000, function(context) {
const shape = context.shape,
source = context.source;
return getNewC... | true |
76c60433bf03fc8a3e713923f7264c4fc7210bee | JavaScript | bluemonkmn/iotaBuildIt | /HTML/Sprites/ThrownTorch.js | UTF-8 | 3,019 | 2.625 | 3 | [] | no_license | spriteDefinitions.ThrownTorch = function(layer, x, y, dx, dy, state, frame, active, priority, solidity, BurnTime, NeedIgnite) {
Sprite.call(this, layer, x, y, dx, dy, state, frame, active, priority, solidity);
this.BurnTime = BurnTime
this.NeedIgnite = NeedIgnite
};
spriteDefinitions.ThrownTorch.prototype = ne... | true |
e29850fe9a63cbf6b819dbc3459894c3c9169a61 | JavaScript | DiegoMartinez1509/pruebasdecomandos | /routes/boletos.js | UTF-8 | 2,110 | 2.640625 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const pool = require('../config/db.config');
router.get('/add', (req, res) =>{
res.render('boletos/add', { title: "Alta Boleto - Bruji Rifas" });
})
//ruta para guardar los boletos
router.post("/add", async (req, res) => {
const {
... | true |
6b7e7786922120063b7797943b6bc507d51fde57 | JavaScript | misaelljr/lps_reuso_software | /lps_reuso/model.js | UTF-8 | 1,174 | 2.78125 | 3 | [] | no_license | /*
Aluno: Misael Costa Júnior
NUSP: 9254469
Trabalho Final da disciplina de Reuso de Software (SSC5904)
ICMC-USP
*/
function getJson(){
nome_produto = localStorage.getItem('nome_produto');
id1 = localStorage.getItem('id1');
id2 = localStorage.getItem('id2');
id3 = localStorage.getItem('id3');
id4 = localStorage.g... | true |
4458b4047d7f32ec6a9a5562a6f582835febe353 | JavaScript | Nic024A/CET300 | /app.js | UTF-8 | 1,940 | 3 | 3 | [] | no_license | //This function slides the side menu out by 250px and pushes the main content to the right by 250px.
function openSlideMenu(){
document.getElementById('side-menu').style.width = '250px';
document.getElementById('main').style.marginLeft = '250px';
}
//This function collapses the side menu completely.
f... | true |
8c7c7fac01c925858c70bfa78f636d5e2ccefca9 | JavaScript | edelk/codex | /codex/js/tela_projeto.js | UTF-8 | 1,362 | 2.84375 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
$('#btnAdicionar').click(function(){
adicionar();
});
var cont = 0;
function adicionar(){
idnome = $("#idnome").val();
idunidade = $("#idunidade").val();
idedital = $("#idedital").val();
idarea = $("#idarea").val();
idcoordenador = $("#idcoordenador").val();
data_inicio ... | true |
efcb27e662961dd282d9c1bf3365b4ae15046889 | JavaScript | huogiafei/ES6 | /ch12_proxy/handler.js | UTF-8 | 3,183 | 3.4375 | 3 | [] | no_license | 'use strict';
/*proxy handler 14 methods*/
/** demo1:handler.apply() **/
var p = new Proxy(function () {
}, {
apply: function (target, thisArg, argumentsList) {
console.log(`called:${argumentsList.join(",")}`);
}
});
p(1, 2, 3);
var p2 = new Proxy({}, {
apply: function (target, thisArg, argumentsLis... | true |
e928e3f644aff3e3c2928837801f3c51e7d91e71 | JavaScript | sheelarajeshkumar/testcms | /components/chart/organizer/Exhibitors.js | UTF-8 | 2,639 | 2.546875 | 3 | [] | no_license | import React, { Component, PureComponent } from 'react'
import { Pie, PieChart, Sector, ResponsiveContainer } from 'recharts'
import { formatIntegerNumber } from '../../../util/utilities';
const renderActiveShape = (props) => {
const RADIAN = Math.PI / 180;
const {
cx, cy,
midAngle,
in... | true |
cf02e877bfff5293be5f667dc88763fce4f466cc | JavaScript | Larberge/P5js_projects | /Pong/ball.js | UTF-8 | 1,492 | 3.578125 | 4 | [] | no_license |
class Ball{
constructor(){
this.d = 25;
this.pos = createVector(width/2,height/2);
this.speed = 5;
let r1 = random(PI/4, 3*PI/4);
let r2 = random(5*PI/4,7*PI/4);
if(random(1)<0.5){this.angle = r1;}
else{this.angle = r2;}
this.buff = true;
}
show(){
fill(255);
stroke(255,0... | true |
3b9f46692fb54957147ee79160d4a7d22c93f657 | JavaScript | mayankk67/Hooks_demo | /src/Components/HomePage.js | UTF-8 | 496 | 2.96875 | 3 | [] | no_license | import React, { useState } from "react";
function Palindrome() {
let [name, setName] = useState({ fname: "" });
let ChangeFont = event => {
setName({ ...name, [event.target.name]: event.target.value });
};
return (
<div>
<h1>Please enter your string</h1>
<input
type="te... | true |
d0e3715047171151639329be42ee2f307d3e1803 | JavaScript | luqmankahloon/MoDeCaSo | /frontend/js/app/tools/toast.js | UTF-8 | 2,969 | 2.578125 | 3 | [] | no_license | /*
* MoDeCaSo - A Web Application for Modified Delphi Card Sorting Experiments
* Copyright (C) 2014-2015 Peter Folta. All rights reserved.
*
* Project: MoDeCaSo
* Version: 1.0.0
*
* File: /frontend/js/app/tools/toast.js
* Created: 2014-11-19
* Author: Peter Folta <ma... | true |
9fcb52cad616d662818f3ea01709c23cc091229b | JavaScript | petar-staynov/coronavirus-tracker-bg | /src/contexts/AppContext.js | UTF-8 | 910 | 2.578125 | 3 | [] | no_license | import React, {useState, createContext, useEffect} from 'react';
import LoadingStatus from "../common/LoadingStatus";
export const AppContext = createContext();
export const AppContextProvider = (props) => {
const [country, setCountry] = useState(JSON.parse(localStorage.getItem("country")));
const [status, se... | true |
5fdd4460bbe4f47a8c4bf744e64b88d5b12059ee | JavaScript | coolbree2e/click-game | /Game/click/src/App.js | UTF-8 | 2,556 | 2.890625 | 3 | [] | no_license | import React, { Component } from 'react';
import Redhead from './components/Redhead';
import Title from './components/Title';
import Wrapper from './components/Wrapper';
import pics from './pics.json';
// import './App.css';
import Navbar from './components/Navbar';
class App extends Component {
state = {
score: ... | true |
d86ca9ba8a9f29c4c7515080c2e46e7a9859af86 | JavaScript | KokoTa/React-plugin-and-component | /src/views/Gallary/index.js | UTF-8 | 2,454 | 2.6875 | 3 | [] | no_license | import React, { PureComponent } from 'react';
import {
GallaryWrap,
ImgWrap,
ImgItem,
ImgTitle
} from './style';
class Gallary extends PureComponent {
constructor(props) {
super(props);
this.gallaryWrap = React.createRef(); // 画框
this.imgWraps = []; // 图片框
}
addImgWrap = (el) => { // 获取 DOM
... | true |
c52f5661ebd21502a1064fd4ead91dc85f375c33 | JavaScript | SourceOf0-HTML/processing-p5.js | /sketch_190820d/sketch_190820d.js | UTF-8 | 726 | 3.578125 | 4 | [] | no_license | /*
setup=()=>{createCanvas(S=500,S)}
draw=()=>{d=new Date();background(255);circle(S/2,S/2,S/2-25);m(15,150,d.getHours()%12/12);m(10,200,d.getMinutes()/60);m(2,200,d.getSeconds()/60)}
m=(w,h,r)=>{push();translate(S/2,S/2);rotate(r*PI*2);rect(-w/2,0,w,-h);pop()}
/**/
function setup() {
canvasSize = 500;
createCanva... | true |