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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
86926b83e51b78b6c240bfc88d0f8cfe1fb3b26c | JavaScript | saotome88/furima-34745 | /app/javascript/item_price.js | UTF-8 | 599 | 3.34375 | 3 | [] | no_license | function inputPrice() {
const itemPrice = document.getElementById("item-price");
itemPrice.addEventListener("keyup", () => {
const price = itemPrice.value
const tax = Math.floor(price * 0.1)
const profit = Math.floor(price - tax)
const taxPrice = document.getElementById("add-tax-price");
const... | true |
92ac6d1554970f7c316c4cc0acb7eda6f18de0fb | JavaScript | funduval/Giphy-Generator | /assets/javascript.js | UTF-8 | 3,432 | 3.34375 | 3 | [] | no_license | var topics = ["Donald Trump", "Jeff Sessions", "Mitch McConnell", "Paul Ryan", "Angela Merkel", "Tayyip Erdogan", "Nigel Farage"]
var animated;
var still;
function renderButtons() {
// Looping through the array of giphys
for (var i = 0; i < topics.length; i++) {
// Then dynamicaly generating buttons... | true |
e673b975582485301e9698c4b61ea00a30e791db | JavaScript | docljn/codeclan_class_notes | /week12/day4/charts_start_point/public/app.js | UTF-8 | 1,626 | 3.5 | 4 | [] | no_license |
// new PieChart();
//
// const titleText = "Our Favourite Programming Languages";
// const seriesArray = [
// {
// name: "Cohort 7 Languages",
// data: [8, 12, 3, 0, 1]
// },
// {
// name: "Cohort 18 Languages",
// data: [10, 10, 1, 1, 0]
// }
// ];
//
// const xAxisCategoriesArray = ["JavaScri... | true |
62bab3ef6d1451426a724c29506d590a170ea025 | JavaScript | sotobry/personal-website-2 | /my-app/src/views/BlogView.js | UTF-8 | 3,485 | 2.5625 | 3 | [] | no_license | import React from 'react';
import { GoBackButton } from '../components/GoBackButton';
import { Journal } from '../components/bulletJournal/Journal';
const BlogView = () => {
return (
<>
<GoBackButton />
{/*
<p style={{ textAlign: 'right' }}>17:44 03/09/20</p>
<h1 style={{ fontFamily: 'Permanent M... | true |
fc6b2c6b032255c6038420eb736c699895a24730 | JavaScript | serraguti/reactclases | /src/components/Deportes/Deportes.js | UTF-8 | 1,625 | 3.09375 | 3 | [] | no_license | import { Component } from "react";
import Deporte from "./Deporte";
class Deportes extends Component{
//DEBEMOS CREAR UN DEPORTE FAVORITO EN
//STATE PARA PODER CAMBIARLO AL SELECCIONAR
state = {
seleccionado: "",
//AQUI TENDREMOS UN list CON TODOS LOS
//DEPORTES Y SERA DINAMICO
... | true |
cb63fb42b63b8af2407d7cfe4db5cc7871661f31 | JavaScript | dewsign/maxfactor-vue-support | /src/Filters/MoneyFilter.js | UTF-8 | 447 | 3.265625 | 3 | [
"MIT"
] | permissive | /**
* Format a given value to a monetary value.
*
* @param {String} value Value to format
* @return {String} Formatted monetary value
*/
const Money = (value) => {
if (value === null) return ''
return parseFloat(value)
.toLocaleString('en-GB', {
style: 'currency',
cu... | true |
60c47216f21c746b3092ab5365889560744a411d | JavaScript | dumi994/js-jsnacks-blocco-5 | /snack3/main.js | UTF-8 | 336 | 3.65625 | 4 | [] | no_license | // Snack 3:
// Scrivi una funzione che accetti una stringa come argomento e la ritorni girata (es. Ciao -> oaiC)
function reverseString (text){
var nuovaParola = '';
for (var i = (text.length - 1); i >= 0; i-- ){
nuovaParola += text[i];
}
return nuovaParola;
};
reverseString ('mario');
console.log(reverseS... | true |
bef45911a37cd2cca261ebd4c65ccb99da5283d8 | JavaScript | ZacharyBaker/react-native-basic-todo | /basicTodo/BasicTodo.js | UTF-8 | 868 | 2.609375 | 3 | [] | no_license | import React, { Component } from 'react'
import { AppRegistry, View } from 'react-native'
import List from './List'
import Input from './Input'
import Title from './Title'
export default class BasicTodo extends Component {
state = {
todos: ['Eat a sandwich', 'Skate', 'Learn something']
}
onAddTodo = (text) => ... | true |
0ec34011bbfaf57dc64a4d2dee59eef820594cd4 | JavaScript | dandevri/course-19-20 | /examples/d3/interactiveBarChart/drawMap.js | UTF-8 | 780 | 2.625 | 3 | [
"MIT",
"CC-BY-4.0"
] | permissive | import { geoPath } from 'd3'
import { feature } from 'topojson'
export function drawMap(container, projection){
const pathGenerator = geoPath().projection(projection)
setupMap(container, pathGenerator)
drawCountries(container, pathGenerator)
}
function setupMap(container, pathGenerator){
container
.append(... | true |
8d22548c414587f1a157dfab29bd2c18f2c98ca2 | JavaScript | GastonHummel/xsellConverse | /js/settings.js | UTF-8 | 2,827 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | /**
* settings.js
*
* The settings contained in file are used to define the project specific settings required for
* the landing page to be fully functional. These settings are used throughout the core JavaScript
* and defined here to be easily updatable.
*
* Each variable below has a short explanation of how to... | true |
4e46b1408d65e78caf808700192becc6cb5ecaa2 | JavaScript | valentinancy/RugbyAppReactNative | /react-native-packager-cache-16f5a119/90/3d1974_isIndex.js | UTF-8 | 289 | 2.609375 | 3 | [] | no_license |
var MAX_SAFE_INTEGER=9007199254740991;
var reIsUint=/^(?:0|[1-9]\d*)$/;
function isIndex(value,length){
length=length==null?MAX_SAFE_INTEGER:length;
return!!length&&(
typeof value=='number'||reIsUint.test(value))&&
value>-1&&value%1==0&&value<length;
}
module.exports=isIndex; | true |
de385dc4fdc71a367e525b03b058dd180879c3a5 | JavaScript | sleafummer/mini-bookkeeping | /client/src/utils/filter.js | UTF-8 | 1,579 | 3.125 | 3 | [] | no_license | /**
* @Description: 格式化的
* @author yidierh
* @email yidierh@gmail.com
* @date 2020-02-29
*/
/**
* 格式化日期
* @param date
* @returns {string}
*/
export const formatDate = (date) => {
const _date = date ? new Date(date) : new Date()
const y = _date.getFullYear()
const m = _date.getMonth() + 1
const... | true |
048b6ac32719883fc503fae1e8ce68d3170abd0a | JavaScript | seriallos/aoc2018 | /day16/solve.js | UTF-8 | 4,194 | 2.734375 | 3 | [] | no_license | let fs = require('fs');
const path = require('path');
const _ = require('lodash');
const Promise = require('bluebird');
fs = Promise.promisifyAll(fs);
const file = process.argv[2];
const IS_TEST_DATA = path.basename(file) === 'test.txt';
const write = (...args) => process.stdout.write(...args);
const printLine = ... | true |
780c24208ec578999fa7fecfca00aeb7871b940c | JavaScript | Rbllado/lab-mongoose-movies | /starter-code/bin/seed.js | UTF-8 | 979 | 2.5625 | 3 | [] | no_license | const mongoose = require('mongoose');
const Celebrity = require('./../models/Celebrity');
//const dbName = 'library';
const celebrities = [
{
name: "Tom Cruise",
occupation: "Actor",
catchPhrase: "Mission impossible"
},
{
name: "Beyonce",
occupation: "Singer",
... | true |
01967b756bec028fc76ddde769dbd0ba4631689b | JavaScript | Nic0mrt/my-chat-app-client | /src/components/Conversation.jsx | UTF-8 | 1,976 | 2.765625 | 3 | [] | no_license | import { useState, useEffect, useRef } from 'react';
import './App.css';
import openSocket from 'socket.io-client';
function App() {
const [inputText, setInputText] = useState('');
const [messages, setMessages] = useState([]);
const socket = useRef(null);
const input = useRef(null);
const messageSectionEnd =... | true |
41a0a2d47be726badaa62c41add92d87b06f4213 | JavaScript | jtruong2/javascript-basics-challenge | /lib/longestString/longestString.js | UTF-8 | 242 | 2.75 | 3 | [] | no_license | const pry = require('pryjs')
function longestString(arr) {
var longest = arr[0];
for (var i = 0; i < arr.length; i++) {
if(longest < arr[i]) {
longest = arr[i];
};
};
return longest;
};
module.exports = longestString;
| true |
3ac2dc212433c89860840a5b698ad2bdda41710c | JavaScript | brightjonathan/Task-Tracker-with-json-server-in-react | /my-app/src/App.js | UTF-8 | 3,356 | 3.21875 | 3 | [] | no_license | import './App.css';
import { useState, useEffect } from 'react';
import Header from './Component/Header';
import Tasks from './Component/Tasks';
//passing data as a props using usesate()
import Data from './Component/Data';
import AddTasks from './Component/AddTasks';
function App() {
//For the Tasks.jsx
const [t... | true |
6f9ccb526b3f26a7cf901df620a6b460e4cf1244 | JavaScript | pablovelpostigo/P3_Quiz | /cmds.js | UTF-8 | 8,427 | 2.96875 | 3 | [] | no_license |
const {models} = require('./model');
const Sequelize = require('sequelize');
const {log, biglog, errorlog, colorize} = require("./out");
const validateId = id => {
return new Sequelize.Promise((resolve, reject) => {
if (typeof id === "undefined") {
reject(new Error(`Falta el parametro <i... | true |
6996a32eb436348c9794fc215d66aadcc38b955b | JavaScript | MeloVicG/React-Tabs | /src/components/Tabs.jsx | UTF-8 | 1,021 | 2.5625 | 3 | [] | no_license | import React, { useState } from 'react';
import Display from './Display';
// this was set to props, than changed to grab from parent
const Tabs = ({tabs, tabHandler, selected}) => {
//This was placed before adding it to the Parent compontent ~~Apps.js~~
// const [tabs,setTabs] = useState([
//... | true |
21bdfa6e5ea0d4d9b0deb1620381776c1fa16518 | JavaScript | Fuadzarzar/Calc_apos | /scripts.js | UTF-8 | 480 | 3.203125 | 3 | [] | no_license | const nome = 'Carla';
const sexo = 'Feminino';
const idade = 22;
const contribuicao = 30;
const cont_years = idade + contribuicao;
const homemAposenta = sexo == 'Masculino' && contribuicao >= 35 && cont_years >= 95;
const mulherAposenta = sexo == 'Feminino' && contribuicao >= 30 && cont_years >= 85;
if (ho... | true |
53bbf3685265974f537f59525a86bfe9f48d551c | JavaScript | puneetmanghwani/task_manager | /frontend/src/components/user/AddUser.js | UTF-8 | 1,256 | 2.828125 | 3 | [] | no_license |
// ***React imports***
import React, { useState } from 'react';
// ***API imports****
import * as APIHANDLER from '../../utility/API';
function AddUser(props) {
const [state, setState] = useState({
name:"",
designation:""
});
const onChange = e => {
setState({
...sta... | true |
19722aeff55c999d597fe72e7acd42dd0befadd2 | JavaScript | JSoon/LuckyDraw | /js/sj.lucky.js | UTF-8 | 17,478 | 2.90625 | 3 | [
"MIT"
] | permissive | /**
* SJ Lucky Draw JavaScript Library v 0.0.1
* jQuery v 1.11.1
*
* Copyright 2014 J.Soon Personal
* Released under the MIT license
*
* Date: 2014-07-08 10:59 pm
*/
if ( window.SJ === undefined ) {
window.SJ = {};
}
SJ.Lucky = {
/**
* 生成限定范围内的随机数
*/
randomNum: function( startNum, scope )... | true |
da7b98d4512114675a5445ddddf8fd408f22ea9b | JavaScript | eliashelander/food-tracker | /client/src/stock/Stock.jsx | UTF-8 | 2,600 | 2.625 | 3 | [] | no_license | import React, { useState } from 'react';
// import PropTypes from 'prop-types';
import Ingredient from './components/Ingredient';
const Stock = ({
stock, ingredients, handleAdd, addIngredient, handleSubtract, handleRemove,
}) => {
const [updateComponent, setUpdateComponent] = useState(false);
const handleClick ... | true |
524c3874ae41c77fd15b928ba2f5fadb63535220 | JavaScript | Abhisheksinha1506/dublin-bus-journey-planner | /django_dublin_bus/map/static/map/js/geocode_address.js | UTF-8 | 1,987 | 3 | 3 | [] | no_license | function geocodeAddress() {
var origin_new = "";
var dest_new = "";
var origin_lat;
var origin_lng;
var origin_found = false;
if(destination_searchbox.value === ""){
callsnackBar("enter_destination");
return;
}
if (origin_searchbox.value === "") {
origin_lat = u... | true |
2b62e235c1a1ede4ecbc65c1c9649b63cd07a76d | JavaScript | cpetersend89/RomanNumeralPalindromeChallenge | /script.js | UTF-8 | 2,024 | 4.09375 | 4 | [] | no_license | "use strict"
function messagePrompt(message){
var userInput = prompt(message);
return userInput;
}
function convertNumber(num) {
var roman = "";
var romanNumeral = ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"];
var numbers = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];
for (... | true |
fb0254fe04428f7d371eb44050087751d513a0b3 | JavaScript | Metoyo/metoyo | /src/plugins/common/common.js | UTF-8 | 4,778 | 2.609375 | 3 | [
"MIT"
] | permissive | import Common from './common.vue'
export default {
/**
* 每个插件都有的install方法,用于安装插件
* @param {Object} Vue - Vue类
* @param {Object} [pluginOptions] - 插件安装配置
*/
install(Vue, pluginOptions = {}) {
// 创建"子类"方便挂载
// const PlgCommon = Vue.extend(Common);
// let comn = null;
let comnFun = {
... | true |
c9defcef5945e4ccab27057f869b58202368d13d | JavaScript | HughMoron/JS-excercises | /Mentoring/October19/M-191018/script.js | UTF-8 | 2,505 | 3.671875 | 4 | [] | no_license | ////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////
// MENTORING 191018
///////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
document.write("MENTORING 191018<br><br>")
/////////////... | true |
57794872a4064cf0c91893ff0a80302ae9df4794 | JavaScript | yuya-oikawa/PublicCardActionGame | /src/js/card.js | UTF-8 | 2,816 | 3.453125 | 3 | [] | no_license | // querySelectorAllはCSSのセレクターで要素を取得することができる。配列で取得
function cardClickRan(){
const cardElements = document.querySelectorAll("#behavior ul");
cardElements.forEach(function(card) {
card.addEventListener("click", function() {
let useCardData = null;
cardInstanceList.forEach(cardData => {
if (card... | true |
b4137e03cd353289c4e5119907c9bbd9fb8fb7c9 | JavaScript | mtisya/Hostel-Portal | /admin/js/payment.js | UTF-8 | 882 | 2.515625 | 3 | [
"MIT"
] | permissive | // JavaScript Document
function verifyPayments(id){
var mpesa = prompt("Enter MPesa ID received from client")
var url = "verify.php?id="+id+"&mpesa="+mpesa
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET",url,true)
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState==4&&xmlhttp.status==200){
... | true |
ab34e740bff90066a2ecdaf31cb42eac9e3b210a | JavaScript | cbrake/snippets | /nodejs/oop.js | UTF-8 | 2,968 | 3.890625 | 4 | [] | no_license | // todo: http://mckoss.com/jscript/object.htm
// todo: http://www.devarticles.com/c/a/JavaScript/Object-Oriented-JavaScript-Using-the-Prototype-Property/3/
function ObjectA()
{
this.a = 2;
}
ObjectA.prototype.inc_a = function()
{
this.a++;
}
a_ = new ObjectA();
console.log("a_.a = ", a_.a);
a_.inc_a();
// ===... | true |
726f2db45faa5f50698cad65fc0658a900ebda9e | JavaScript | firefighter-19/chess | /chess/figures/sortMoves.js | UTF-8 | 1,076 | 3.34375 | 3 | [] | no_license | function sortMoves(board, arr, color) {
let newSort = arr.filter(el => el.y >= 0 && el.x < 8 && el.y < 8 && el.x >= 0)
.map(el => board[el.y][el.x] === null || board[el.y][el.x].color !== color ? el : false)
let sorted = newSort;
for (let key of newSort) {
if (key === false) {
sorted = newSort.slice... | true |
f753d10a30d816e3e5e60e82373fafd798f3fc46 | JavaScript | Orbot90/guestbook-task | /frontend/src/services/login.js | UTF-8 | 2,858 | 2.90625 | 3 | [] | no_license | import {getApplicationProperty} from '../properties/applicationProperties'
class LoginService {
constructor() {
this.signInListeners = {}
this.signOutListeners = {}
this.token = localStorage.getItem("jwt")
this.userName = localStorage.getItem("userName")
this.roles = localS... | true |
1e681794b1dee256d682de5c9748eaf1417b1dbc | JavaScript | MikeLDJ/FreeCodeCamp | /Intermediate-Algorithm-Scripting/Diff-Two-Arrays.js | UTF-8 | 862 | 3.796875 | 4 | [] | no_license | /*******************************************************************************
* Diff Two Arrays *
* *
* Compare two arrays and return a new array with any items only found in one... | true |
9cd172a28143bcaa84648c20b6c603b28011b237 | JavaScript | Franckou31/teleinfo | /client/src/routes/Cloture/containers/Cloture.js | UTF-8 | 1,678 | 2.609375 | 3 | [
"MIT"
] | permissive | import React from 'react'
export default class Cloture extends React.Component {
constructor (props) {
super(props)
this.state = { selectedOption: 'option1' }
this.handleChange = this.handleChange.bind(this)
this.handleSubmit = this.handleSubmit.bind(this)
}
handleChange (event) {
this.setS... | true |
084ede611bcc5a12bde9c94a64322fa3e0fbe891 | JavaScript | epachols/50smallprojects | /js-carousel/index.js | UTF-8 | 1,278 | 3.1875 | 3 | [] | no_license | // variable grabs
const prev = document.getElementsByClassName('previous')[0];
const next = document.getElementsByClassName('next')[0];
const gallery = document.getElementsByClassName('gallery')[0];
let pictArr = gallery.children;
let current = 0;
let translate = -220;
// animate the frames
next.addEventListener('cl... | true |
0fa86ebcd3a818ca682f2995e3d4bc47acf23a56 | JavaScript | gongxiancao/package-saving | /lib/mincost.spec.js | UTF-8 | 2,253 | 2.53125 | 3 | [
"MIT"
] | permissive | 'use strict';
var mincost = require('./mincost');
var assert = require('chai').assert;
/* globals
describe: false,
it: false
*/
describe('mincost', function() {
it('should return empty when the input is empty', function() {
var shops = [], wishes = [];
var actual = mincost(shops, wishes);
assert.... | true |
5cc2777b05df06c2be932c3c27d90993250617a8 | JavaScript | rimIlmia/traininginterview | /server.js | UTF-8 | 566 | 2.59375 | 3 | [] | no_license | //Imports
const express = require("express");
const bodyParser = require("body-parser");
const apiRouter = require("./apiRouter").router;
const cors = require("cors");
//Instantiate server
const server = express();
//port
const port = 3001;
//body-parser configuration
server.use(bodyParser.urlencoded({ extended: true... | true |
7fccca24a29079ab0d0795e6c391141ffec201d2 | JavaScript | jawwadturabi/aws-lex | /Hotel_agent_mongodb/index.js | UTF-8 | 3,685 | 2.546875 | 3 | [] | no_license | 'use strict';
// const mongoose = require("mongoose ")
// Close dialog with the customer, reporting fulfillmentState of Failed or Fulfilled ("Thanks for using our services.")
// --------------- Events -----------------------
exports.handler = (event, context,callback) => {
try {
console.log(`request rec... | true |
ebf450c377ba2b832104e7c32dc498a993c6fad7 | JavaScript | joel-eche/PracticandoAngularJS | /factories/controller.js | UTF-8 | 1,307 | 2.625 | 3 | [] | no_license | var modulo=angular.module("ToDoList",["LocalStorageModule"]);
modulo.factory('ToDoService',function(localStorageService){
var toDoService={};
toDoService.key="todokey";//cualquier clave
if (localStorageService.get(toDoService.key)) {
toDoService.activities=localStorageService.get(toDoService.key);
} else {
toD... | true |
4071b33c3e316644664b50c988c32344ff914c62 | JavaScript | neeravp/Samay | /mixins/InformativeManipulations.js | UTF-8 | 4,899 | 3.265625 | 3 | [
"MIT"
] | permissive | import Util from "@/utils/Util";
import MONTHS from "@/utils/MONTHS";
export default {
/**
* Mutate the Samay instance to represent the first day of the year.
* @return this
*/
startOfYear(){
this.subtractProp(this._time - ((this.dayOfYear()-1)*24*60*60*1000));
return this;
... | true |
cd6728179010529a704041e62d01d83ad9be3e3b | JavaScript | SolveEducation/nodejs_tcp_test | /library/checkParameter.js | UTF-8 | 316 | 2.578125 | 3 | [] | no_license | module.exports = function (parameters_from_user, rules) {
let empty_parameters = [];
for(let rule of rules){
if(rule in parameters_from_user){
}else{
empty_parameters.push(rule);
}
}
empty_parameters = empty_parameters.join(", ");
return empty_parameters;
}; | true |
a51742808cff389405059c0aeb840d2abb0589b7 | JavaScript | emilb/MMM-SL-departure | /node_helper.js | UTF-8 | 3,529 | 2.59375 | 3 | [
"MIT"
] | permissive | const NodeHelper = require('node_helper');
var request = require('request');
var moment = require('moment');
module.exports = NodeHelper.create({
reloadInterval: 15 * 60 * 1000,
refreshInterval: 60 * 1000,
lastFetchedDepartures: [],
// Subclass start method.
start: function () {
console.... | true |
360e12d37dd2a9ce3f0d21e4eb29f24e5b6dfebf | JavaScript | kankuro12/k363p | /public/assets/public/js/main1.js | UTF-8 | 6,392 | 2.53125 | 3 | [] | no_license |
function toogleSearch(ele){
if(ele.dataset.set==1){
ele.innerHTML='<i class="fas fa-times"></i>';
ele.dataset.set=2;
$('#min-search-bar').collapse('show')
}else{
ele.innerHTML='<i class="fas fa-search"></i>';
ele.dataset.set=1;
$('#min-search-bar').collapse('hide... | true |
0f4a89a0c8a4ca01ec71fded3a31db691d215f88 | JavaScript | jonfranche/todo-list | /src/Modules/todoEdit.js | UTF-8 | 3,548 | 2.78125 | 3 | [] | no_license | import { controller } from './controller'
import { listArray } from './listArray'
const todoEdit = (div, activeList, activeTodo) => {
const editDiv = document.createElement('div')
editDiv.setAttribute('class', 'editDiv')
div.appendChild(editDiv)
const editElements = {
title: document.createEle... | true |
e6763758b9a1ac5eb93d83c9e30ee4ffdedcb6ee | JavaScript | andytompkins/ObservableOperators | /test/switchMap.js | UTF-8 | 5,625 | 2.578125 | 3 | [] | no_license | import { expect } from 'chai';
import sinon from 'sinon';
import switchMap from '../src/switchMap';
import apiCheck from './common/apiCheck';
import MyObservable from './utils/MyObservable';
const emitAfterTime = (observer, ms, value) =>
setTimeout(() => observer.next(value), ms);
const timeout = ms => new Promise(... | true |
ef49e714e5bfc1156a4438d33d19f9b85ae4194e | JavaScript | mahieakhtar/hyf-homework | /nodejs/week1/mealSharingWebsite/src/backend/index.js | UTF-8 | 2,148 | 3 | 3 | [] | no_license | const express = require("express");
const fs = require("fs");
const app = express();
const meals = JSON.parse(fs.readFileSync(__dirname + "/data/meals.json"));
const reviews = JSON.parse(fs.readFileSync(__dirname + "/data/reviews.json"));
const reservations = JSON.parse(fs.readFileSync(__dirname + "/data/reservations.j... | true |
13dbc186e9077134af330c32cd09a548bf0ed6f7 | JavaScript | MeStock/data-structures-and-algorithms | /code-challenges/linked-list/mergeList.js | UTF-8 | 1,465 | 4.125 | 4 | [
"MIT"
] | permissive | 'use strict';
/*
Write a function called mergeLists which takes two linked lists as arguments. Zip the two linked lists together into one so that the nodes alternate between the two lists and return a reference to the head of the zipped list. Try and keep additional space down to O(1). You have access to the Node cl... | true |
cf81338e7dfd28081653fe19ee7dbca2fd1d775a | JavaScript | salesforce-demos/Unilever-SIC20 | /force-app/main/default/aura/Demo_TranscriptionCMP_UnileverSIC20/Demo_TranscriptionCMP_UnileverSIC20Helper.js | UTF-8 | 14,105 | 2.546875 | 3 | [] | no_license | ({
showAssistant : function(component, event, helper) {
// slide up window
var assistant = component.find('panel');
$A.util.toggleClass(assistant,'hidden');
var bar = component.find('bar');
$A.util.toggleClass(bar,'slds-is-active');
},
startDialogueOne : function(cmp, event, helper... | true |
c6b6a38952926b9ab40dd0de1b2e616443863832 | JavaScript | Kvoti/underscore-camelcase | /underscoreCamelCase.js | UTF-8 | 712 | 2.796875 | 3 | [] | no_license | import objectWalk from 'object-walk';
export function strToUnderscore(str) {
return str.replace(/([A-Z])/, (m, p1) => '_' + p1.toLowerCase());
}
export function strToCamelCase(str) {
return str.replace(/_([a-z])/, (m, p1) => p1.toUpperCase());
}
export function objToCamelCase(obj) {
walk(obj, strToCamelCase);
... | true |
90433a1e3eeb569450cc7f77d90ea5c1e24891cc | JavaScript | margo-chek/front-end | /5.3/js/scripts_m.js | UTF-8 | 9,460 | 2.59375 | 3 | [] | no_license | /* Устанавливает заполнение позиции прокрутки, если в этой области добавляются классы `near-top` /` near-bottom`.
Revealator . scroll_padding = ' 100 ' ;
Устанавливает смещения cверху и cнизу, при которых срабатывают эффекты
Revealator . effects_padding = ' -100 ' ; */
Revealator.scroll_padding = '300';... | true |
89914d757aa0732bd3b80cac37b61d3690abfc67 | JavaScript | Tech1989plus1/CashAmount | /CashAmount.js | UTF-8 | 939 | 3.5 | 4 | [] | no_license |
class CashAmount{
constructor(amount){
this.pennies = this.convertIntoPennies(amount);
this.denomination = {
'hundreds': 0,
'fifties': 0,
'twenties': 0,
'tens': 0,
'fives': 0,
'ones': 0,
'quarters': 0,
'dimes': 0,
'nickels': 0,
'pennies': 0
};
... | true |
aa356c617521d6fb54cf3a860cacdfb0c370a40b | JavaScript | Leonardo-Antonio/UserSearchByGitHub | /js/main.js | UTF-8 | 398 | 2.578125 | 3 | [] | no_license | let app = new Vue({
el: '#app',
data:{
user: null,
url: 'https://api.github.com',
data_user: null
},
methods: {
async SearchUser(){
const response = await fetch(`${this.url}/users/${this.user}`);
if (response.ok)
this.data_user = await... | true |
0086f612bc03b768461d5f0792e79809157be3a2 | JavaScript | allan-2stars/unit-converter | /src/Update.js | UTF-8 | 3,417 | 2.96875 | 3 | [] | no_license | import * as R from 'ramda';
export const messageTypes = {
LEFT_VALUE_INPUT: 'LEFT_VALUE_INPUT',
RIGHT_VALUE_INPUT: 'RIGHT_VALUE_INPUT',
LEFT_UNIT_CHANGED: 'LEFT_UNIT_CHANGED',
RIGHT_UNIT_CHANGED: 'RIGHT_UNIT_CHANGED'
};
// export function for function types
export function leftValueInputMessage(valueLeft) {
... | true |
7745a1313be055c0df6c4a7af2240e931e44ad32 | JavaScript | vialeksandrova/javascript | /contactList.js | UTF-8 | 562 | 3.03125 | 3 | [] | no_license | var friends={};
friends.bill={firstName:'George', lastName:'Nikolov', number:'0889065656', address:['Sofia','Bulgaria']};
friends.steve={firstName:'Martin', lastName:'Ivanov', number:'0997 343526', address:['Veliko Tarnovo','Bulgaria']};
var list=function(object){
for(var key in object){
console.log(key); ... | true |
af896157c7893d0ab8ca96f51b28935e1d8a5135 | JavaScript | bedemiralp/async5 | /async5.js | UTF-8 | 16,185 | 2.5625 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | /**
* @license
* async5.js <https://github.com/bedemiralp/async5>
* Copyright 2013 Berke Ediz Demiralp
* Licensed under the Apache License, Version 2.0
*/
(function (global) {
'use strict';
global.async5 = {
/**
* @type {Object.<string, Object>}
* @private
* @dict
... | true |
ec4f3a2403442245526baf48ec7525644ef450cd | JavaScript | nordov/quickies | /actnow_info_retrive_demo/script.js | UTF-8 | 2,560 | 3.0625 | 3 | [] | no_license | const htmls = {
main : `
<label><h3>Please enter your order number</h3></label>
<p>Try empty, "111111" and "222222" for different results</p>
<input id="orderID" type="text">
<button class="submit" onclick="orderSubmit()">Submit</button>
<p><a href="#" onclick="getOrderID()">... | true |
69f96dd98abe99419100620cb204846a29aa6917 | JavaScript | vanluke/React-Fun-In-Free-Time | /client/src/middleware/index.js | UTF-8 | 798 | 2.546875 | 3 | [] | no_license | import jwtFactory from 'jwt-simple';
import config from '../app.config';
const secret = config.get('secret');
export const removeFromLocalstorage = (key) => {
window.localStorage.removeItem(key);
};
export const setItemInLocalstorage = (key, user,
fn = (dt) => JSON.stringify(dt)) => {
removeFromLocalstorage(ke... | true |
3999d142f7dc7b123e96de583bf955f127c3e381 | JavaScript | triveni12345-art/TodoReact | /src/Assignment2/Bindinrender.js | UTF-8 | 440 | 2.59375 | 3 | [] | no_license | import React,{Component} from 'react'
class Bindinrender extends Component{
constructor(props){
super(props);
this.state={msg:'Hello How Are u?'}
}
clickMe(){this.setState({msg:"I am Fine"})
console.log(this)
}
render(){
return(
<div>
<div>{this.state.msg}</div>
... | true |
33f844231aceeed6506eff5c661082abdca8d2b0 | JavaScript | evansmusomi/js-test-frameworks | /tape-test/Math.spec.js | UTF-8 | 234 | 2.640625 | 3 | [] | no_license | const test = require('tape');
const math = require('../Math/Math');
let first = 2;
let second = 3;
test("Math add function", function(t) {
let result = math.add(first, second);
t.equal(result, first + second);
t.end();
}); | true |
78bd90ef0231f04c7e0abb238a8438d1fe7a76b3 | JavaScript | slimui/site | /src/helpers.js | UTF-8 | 1,359 | 2.671875 | 3 | [] | no_license | import createEmojiRegex from 'emoji-regex'
export const dt = d => new Date(d).toLocaleDateString()
const year = new Date().getFullYear()
export const tinyDt = d =>
dt(d)
.replace(`/${year}`, '')
.replace(`${year}-`, '')
// based on https://github.com/withspectrum/spectrum/blob/alpha/src/helpers/utils.js#L1... | true |
2237d1f7d20ac1fbd9eab94b5b2e7d5fe3164c14 | JavaScript | fresheneesz/lima | /src/statefulParsimmon.js | UTF-8 | 987 | 2.765625 | 3 | [
"MIT"
] | permissive | // This file uses a hack suggested here: https://github.com/jneen/parsimmon/issues/210
var P = require("parsimmon/src/parsimmon")
class Language {
constructor(state, parsers) {
this.state = state;
this.parsers = parsers;
for(var key in parsers) {
var val = parsers[key]
const func = val.... | true |
68ca246cea01d64811244745cd7be0347dc35193 | JavaScript | Wiand1515/restserver-nodejs-express | /controllers/user.js | UTF-8 | 770 | 2.515625 | 3 | [] | no_license | const { response, request } = require("express");
const userGet = (req = request, res = response) => {
const {q, nombre = 'No Name', apikey = '12313131', page = 1, limit} = req.query
res.json({
msg: "get API Controller",
q,
nombre,
apikey,
page,
limit
});
};
const userPut = (req, res =... | true |
ff4851bc3f5919a90efaf823b12b3b1fd5379236 | JavaScript | lsm1987/sd-gundam-keyboard-fighter | /scripts/unitSimulator.js | UTF-8 | 6,829 | 2.671875 | 3 | [] | no_license | //유닛시뮬레이터 페이지에서 사용되는 스크립트
//커스텀 포인트로 인한 스탯 상승률
var arrStatIncrease = new Array();
//0: 일반 기체
arrStatIncrease[0] = new Array();
arrStatIncrease[0][0] = new Array(0.6, 0.9, 2.4, 1.8, 0.9, 1.8);
arrStatIncrease[0][1] = new Array(0.3, 0.9, 2.4, 1.2, 0.9, 1.2);
//1: 정밀 보유기체
arrStatIncrease[1] = new Array();
arrStatIncrease... | true |
72dbb322e0dc97fcc64a0a6dc53a86b232a0b9d8 | JavaScript | arkenidar/copyjump.js | /show-source.js | UTF-8 | 400 | 2.8125 | 3 | [
"MIT"
] | permissive | (function show_source_code(){
var url=document.currentScript.dataset.href; if(!url) url=""
var text=`<pre contenteditable="true" class="show_source"
style=" overflow-y: scroll; border:1px solid black; padding: 1em; "></pre>`
document.currentScript.insertAdjacentHTML("afterend", text)
var code=document.currentScript.n... | true |
1b6392e02295eb234bba7ce54a529139f2e02dd8 | JavaScript | duongttran/book-demo-be | /services/authenticationService.js | UTF-8 | 1,275 | 2.578125 | 3 | [] | no_license | const jwt = require("jsonwebtoken");
const User = require("../models/user");
exports.generateToken = async (user) => {
const token = jwt.sign({ id: user._id }, process.env.SECRET, {
expiresIn: "7d",
});
console.log(user);
console.log(user.tokens);
user.tokens.push(token);
await user.save();
return to... | true |
b95befbfa568b50b13ffd8f8289c0d0049c978ca | JavaScript | chilin89117/BT01-HTML5 | /BT01-06-Stickys/js/script.js | UTF-8 | 7,117 | 2.96875 | 3 | [] | no_license | var db = null;
if(window.openDatabase){
db = openDatabase("NoteTest","1.0","Stickys Database",1024*1024);
if(!db){
alert("Failed to open database");
}
} else {
alert("Failed to open database, make sure your browser supports HTML5 web storage");
}
var captured = null; // boolean to indicate if a sticky is selec... | true |
91fbedd9fba621901a66de127cb0d4be19df4235 | JavaScript | yczhao95/CourseGT | /routes/comments.js | UTF-8 | 3,918 | 2.828125 | 3 | [] | no_license | var express = require("express");
var router = express.Router({mergeParams: true});
var Course = require("../models/course");
var Comment = require("../models/comment");
// ========================
// COMMENTR ROUTES
// ========================
if (!String.prototype.padStart) {
String.prototype.padStart = functio... | true |
0556bb535802fb3106a1fe5f570bcd4d9bb37fbf | JavaScript | blond/rangem | /test/subtract.test.js | UTF-8 | 2,937 | 2.53125 | 3 | [
"MIT"
] | permissive | 'use strict';
var test = require('ava');
var subtract = require('../lib/subtract');
test('should keep range', function(t) {
var fromRange = { from: 1, to: 2 };
var whatRanges = [];
var ranges = subtract(fromRange, whatRanges);
t.deepEqual(ranges, [fromRange]);
});
test('should subtract himself', f... | true |
3c3eb3e8eb619254a5666c0817aa5df8fab42713 | JavaScript | cristinaverdi/sign | /src/main.js | UTF-8 | 708 | 3.203125 | 3 | [] | no_license | //SEACRH BY NAME
function searchByName(cocktailName) {
fetch('https://www.thecocktaildb.com/api/json/v1/1/search.php?s=' + cocktailName)
.then(response => response.json() )
.then(data => console.log('Success:', data) );
}
//SEARCH BY ID
function searchById(cocktailId) {
fetch('https://www.thec... | true |
3b4b943b4968892ae998e42e7f1b2849d44c16d1 | JavaScript | Avi-Aravindh/BackToBasics-Practice-DSA-In-JS | /data-structures/trees/BinaryTreeNode.js | UTF-8 | 3,645 | 2.84375 | 3 | [] | no_license | import Comparator from '../../utils/Comparator';
import HashTable from '../hash-table/HashTable';
export default class BinaryTreeNode {
constructor(value = null) {
this.value = value;
this.left = null;
this.right = null;
this.parent = null;
this.meta = new HashTable();
this.Comparator = new ... | true |
0fe8d4fa29300daba2b1c64e4d31fdd6ce8b3cfc | JavaScript | aridoza/JS-Algorithm-Problems | /May_2017/May2517/main.js | UTF-8 | 604 | 3.875 | 4 | [] | no_license | // The Hurdle Race \\
/*
Q: Given n, k, and the heights of all the hurdles, find and print the minimum number of magic beverages Dan must drink to complete the race.
input:
5 4 (n,k)
1 6 3 5 2
output:
2
*/
// my solution:
// see the max number in the array of heights, then subtract k from it; this should be the min... | true |
c9232e325b28bc5edcb450ee3da586b11673c512 | JavaScript | ksky521/works | /video/js/capture.js | UTF-8 | 5,578 | 2.703125 | 3 | [] | no_license | // Polyfill - requestAnimationFrame - only basic shim as very old browsers don't support getUserMedia anyway (from http://paulirish.com/2011/requestanimationframe-for-smart-animating/)
window.requestAnimationFrame = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mo... | true |
4b8214cff5a2e36134f5c8216ba6aaa0682b6f6f | JavaScript | armin-bkh/React-practice | /src/SignUpComponent.jsx | UTF-8 | 2,618 | 2.640625 | 3 | [] | no_license | import React, {Component} from 'react';
import SignUpinp from './SingUpinpComponent';
class SignUp extends Component{
constructor(props){
super(props);
this.state = {
nameinpRef : React.createRef(),
emailinpRef: React.createRef(),
passwordinpRef: React.createRef(),
repasswor... | true |
6a888416f4a9badadd7e3fec828d56709fbef042 | JavaScript | cScarlson/RadGrab | /schema.js | UTF-8 | 1,232 | 2.765625 | 3 | [] | no_license | /**
* A Schema for the Algorithms & DataStructures of RadGrab foundation
*/
//
var DataTime = function(){
// date properties
};
var Notification = function(){
this.Date = new DateTime();
this.User = new User();
this.Geo = new Geo();
};
var HoursOfOperation = function(){
this.Geo = new Geo(... | true |
1ce4833030c2a58ddb9a7191c745c994966ebae0 | JavaScript | jatindhankhar/senty | /static/js/main.js | UTF-8 | 2,927 | 2.59375 | 3 | [
"MIT"
] | permissive | $(document).ready(
function() {
$("#tar").show();
$("#result").hide();
$("#tar").submit(function(event) {
event.preventDefault();
var settings = {
"async": true,
"url": "/score?phrase=" + encodeURI($("#inputlg").val()),
"me... | true |
fdb1f9352cb4dbcad1a1f30c3693f8711a04df53 | JavaScript | feklee/rotogamex2 | /app/client/display_c_sys.js | UTF-8 | 3,418 | 2.9375 | 3 | [
"WTFPL"
] | permissive | // Functionality for the coordinate system in the display canvases.
/*jslint browser: true, maxlen: 80 */
/*global define */
define(["board"], function (board) {
"use strict";
var tileSideLen = 0;
var fixedTileSideLen = 0;
var spacing = 0;
var sideLen;
var updateDimensions = function () {
... | true |
927ca0401cdf3268fe0386ee57cfa7981aafa7ca | JavaScript | Wan20/Tugas-Pengenalan-VueJs-Sanbercode | /assets/js/app.js | UTF-8 | 1,770 | 2.625 | 3 | [] | no_license | Vue.component('comment-template', {
props: ['comment'],
template: `
<li>
<button @click="upVote">+</button><br>
{{ comment.comment }} || {{ comment.tgl }} || Score : {{ votes }}<br>
<button @click="downVote">-</button>
<br><br>
</li>
`... | true |
43acc1d244da4c10b0d9229c203a18a9bf43c3f0 | JavaScript | RuiGuedes/LAIG1819_T3G6 | /T3/primitives/Board.js | UTF-8 | 13,655 | 2.8125 | 3 | [
"MIT"
] | permissive | /**
* Pente Board Object (13x13)
*
* Board length -> 1 unit
* Board without frame -> .91 units
* Cell unit -> .91 / 13 = .07 units
*/
class Board extends CGFobject {
/**
*
* @param {Object} scene The active scene
*/
constructor(scene) {
super(scene);
this.picking = false;
... | true |
d850d86f7d8f5891e40ab96e24b524b0ab382433 | JavaScript | kvas-it/votegrity | /client/js/store.js | UTF-8 | 6,095 | 2.765625 | 3 | [] | no_license | /*
* Client for the votegrity server-side key-value store.
*/
(function (registry) {
'use strict';
var store = registry.store = {};
store.accessToken = undefined;
store.baseUrl = '';
function apiCall(params) {
params.accessToken = store.accessToken;
var deferred = ayepromise.... | true |
cbe22a73ef7b20f982eb4de59d6e621ad0ca5690 | JavaScript | kingjerod/power-di | /index.js | UTF-8 | 6,013 | 2.671875 | 3 | [] | no_license | let fs = require("fs");
let path = require('path');
let util = require('./util.js');
class Container {
constructor(config) {
this.container = {};
let defaultConfig = {
prefix: '',
npmPrefix: '',
debug: false
};
for (let key in config) {
defaultConfig[key] = config[key];
}
... | true |
5826d68f8646ceff6dbfe64ef1de152a0bfbe446 | JavaScript | omar-omal/Personal-projects | /Projekt4/Projekt4/scripts/MyJavaScript.js | UTF-8 | 472 | 2.703125 | 3 | [] | no_license | function lettersonly(input) {
var regex = /[^a-z ]/gi;
input.value = input.value.replace(regex, "");
}
function openchannel(day, elmnt) {
var i, channelcont;
channelcont = document.getElementsByClassName("channel-cont");
//remove all divs by default
for (i = 0; i < channelcont.length; i++) {... | true |
ca694c15b2fcf0551c0e123ce1f34fc172e490df | JavaScript | bobthered/hackerrank | /skills/interview-preparation-kit/dictionaries-and-hashmaps/count-triplets/index.js | UTF-8 | 322 | 2.78125 | 3 | [
"MIT"
] | permissive | const countTriplets = (arr, r) => {
let count = 0;
const hashJ = {};
const hashK = {};
for (let n of arr) {
if (hashK[n]) count += hashK[n];
if (hashJ[n])
hashK[n * r] = hashK[n * r] ? hashK[n * r] + hashJ[n] : hashJ[n];
hashJ[n * r] = hashJ[n * r] ? hashJ[n * r] + 1 : 1;
}
return count;
}... | true |
d56e0564a14d30f2b98619a663b42686b9c56ee6 | JavaScript | jasscia/leetcode | /503_2.js | UTF-8 | 508 | 3.59375 | 4 | [] | no_license | /**
* @param {number[]} nums
* @return {number[]}
*/
var nextGreaterElements = function(nums) {
const n = nums.length
const res = Array(n).fill(-1)
const stack = []
for(let i=0;i<2*n - 1;i++){
while(stack.length && nums[peek(stack)]<nums[i%n]){
res[peek(stack)] = nums[i%n]
stack.pop()
} ... | true |
a74f20a1e228ce35cd2e6537ad42c9307cf5d625 | JavaScript | hsump1996/Connectmoji | /src/game.js | UTF-8 | 4,079 | 3.375 | 3 | [] | no_license | // require your module, connectmoji
// require any other modules that you need, like clear and readline-sync
// const s = 😎,😎💻AABBCC,6,7,4
const c = require('./connectmoji.js');
const clear = require('clear');
const readlineSync = require('readline-sync');
const runInteractiveMode = function (state, playerVal, com... | true |
82cf76e4aee9fbdca9f2eb45f586dbd24f78ef48 | JavaScript | MainlyColors/complete-javascript-udemy-course | /18-forkify/starter/src/js/views/bookmarksView.js | UTF-8 | 888 | 2.515625 | 3 | [] | no_license | import View from './View.js'; // parent class
import previewView from './previewView';
import icons from 'url:../../img/icons.svg'; // Parcel 2 way
class BookmarksView extends View {
constructor(_data) {
super(_data);
this._parentElement = document.querySelector('.bookmarks__list');
this._errorMessage =
... | true |
1419965b2e4665f7dfdc1c41093f9f09cd7345a1 | JavaScript | ymwangel/algorithm | /code/sort/quick-sort.js | UTF-8 | 2,844 | 3.890625 | 4 | [] | no_license | /**
* 快速排序
* 递归模式:单边循环分治法、双边循环分治法
* 非递归模式:栈:
* 平均时间复杂度: O(nlogn)
* 平均空间复杂度: O(nlogn)
*/
const quickSort = function(arr, startIndex=0, endIndex=arr.length-1) {
// let middleIndex = Math.floor((arr.length-1)/2);
// [ arr[0], arr[middleIndex] ] = [ arr[middleIndex], arr[0] ];
if(startIndex >= endIndex)... | true |
f7640934c292063dd0f379544a15bb69838b2fcb | JavaScript | zhangyiweiwei/hkzf-mobile | /src/pages/City/index.js | UTF-8 | 2,371 | 2.59375 | 3 | [] | no_license | import React from 'react'
import { NavBar } from 'antd-mobile'
import axios from 'axios'
import './index.scss'
class City extends React.Component {
state = {
cityList: []
}
componentDidMount() {
this.getCitys()
}
formatDate(list) {
console.log(list)
const cityObj = {}
// 数据进行处理
// ... | true |
89a4b7c826ace33d7653bf5d2ebf8d48240190a4 | JavaScript | progschool-ru/tortuga | /examples/tree_animation.js | UTF-8 | 5,068 | 2.765625 | 3 | [] | no_license |
var iterate = function(params, iteration_params, count, timeout_time, iteration_callback, callback)
{
if(count <= 0)
{
callback()
return
}
for(var i = 0; i < iteration_params.length; ++i)
{
var iteration_param = iteration_params[i]
var param_name = iteration_param.param_name
var delta = iteration_param... | true |
32153c7d692847e9ddc441c013dc8cc7f431b4a6 | JavaScript | techmynd/ReactJS | /my-reads-app/from-web/MyReads-ReactJS-master/src/App.js | UTF-8 | 1,392 | 2.578125 | 3 | [] | no_license | import React from 'react'
import ListBooks from './ListBooks'
import SearchBooks from './SearchBooks'
import * as BooksAPI from './BooksAPI'
import { Route } from 'react-router-dom'
import './App.css'
class BooksApp extends React.Component {
state = {
books: [],
search: '',
results: [],
status:'none... | true |
2acd728a41fbe784c6178d99b868cf9e1a4a90da | JavaScript | srMarquinho/ultimate-crypto-portfolio | /src/ResourceHelpers.js | UTF-8 | 1,260 | 2.515625 | 3 | [] | no_license | function getName(quoteSummary) {
return sanitize(quoteSummary['summaryProfile']['name']);
}
function getStartDate(quoteSummary) {
return quoteSummary['summaryProfile']['startDate'];
}
function getMarketPrice(quoteSummary) {
return quoteSummary['price']['regularMarketPrice']['raw'];
}
function getMarketDayHigh(... | true |
7904f6f6e610ecd2e20471b569fbb8f8ab88f81f | JavaScript | d3r3j3/thank-you-react | /src/App.js | UTF-8 | 779 | 2.8125 | 3 | [
"MIT"
] | permissive | // import { useEffect, useState } from "react";
import React from "react";
import Main from "./main";
export default function App() {
/* Ignore
const greetings = [
{id:1, title:"Thankyou"},
{id:2, title:"For"},
{id:3, title:"All Of Your Hard Work"}
];
const [index, setIndexVal] = useState(0);
us... | true |
86c6314635a11e4992e37ef967b1e6fb2ec54fec | JavaScript | gabrielasdl/Arbyte | /atividades2_if/ex2.js | UTF-8 | 764 | 4.21875 | 4 | [] | no_license | // Faça um programa onde o usuário irá escolher se quer Converter graus Celsius
// para Fahrenheit ou Fahrenheit para Celsius.
var rs = require('readline-sync')
var valor = rs.questionFloat("Digite a temperatura: ")
var graus = rs.question("\nESCOLHA - \n1 para converter Celsius em Fahrenheit \n2 para converte Fahren... | true |
c6b8324b2fb4380ea6ef0c15c46c7a4f3065db2e | JavaScript | maybe-william/holbertonschool-web_back_end | /0x11-ES6_data_manipulation/3-get_ids_sum.js | UTF-8 | 202 | 2.765625 | 3 | [] | no_license | export default function getStudentIdsSum(students) {
if (!Array.isArray(students)) {
return [];
}
let val = 0;
val = students.map((x) => x.id).reduce((prev, x) => prev + x);
return val;
}
| true |
1ac5c158ad5b2799f407b12cdc2f7d437524d2c4 | JavaScript | phakamani/acme-bank | /server/server.js | UTF-8 | 3,147 | 2.5625 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(express.urlencoded());
app.use(express.json());
app.use(function (req, res, next) {
// Website you wish to allow to connect
const allowedOrigins = ['https://travis-ci.com/', 'http://localhost:4200',... | true |
39dd1130bf11deedb2bb8e18f28684ee5f86d713 | JavaScript | DuongGiaHoa/learningReactJS | /09-manage-task/src/components/TaskForm.js | UTF-8 | 3,603 | 2.609375 | 3 | [] | no_license | import React, { Component } from "react";
class TaskForm extends Component {
constructor(props) {
super(props);
this.state = {
id: "",
name: "",
status: true
};
}
onChange = event => {
var target = event.target;
var name = target.name;
var value = target.value;
... | true |
12053b7c40af041184c7eb034f5a22482bb7379c | JavaScript | step-batch-7/graph-trinangkur | /src/graph.js | UTF-8 | 1,269 | 2.953125 | 3 | [] | no_license | const parsePairs = function (pairs) {
const graph = {};
pairs.forEach((pair) => {
const parent = pair[0];
if (graph[parent] === undefined) {
graph[parent] = [];
}
graph[parent].push(pair[1]);
});
return graph;
};
const getChildren = (graph, parent) =>
graph[parent] === undefined ? [] :... | true |
06045109461cdea65f6dbe969df53c75d97bbe95 | JavaScript | kustomzone/uil | /src/String.js | UTF-8 | 631 | 2.8125 | 3 | [] | no_license | UIL.String = function(target, name, callback, value, color ){
UIL.Proto.call( this, target, name, callback );
this.color = color || 'G';
this.c[3] = UIL.element('UIL string', 'input' );
this.f[0] = function(e){
if (!e) e = window.event;
if ( e.keyCode === 13 ){
this.call... | true |
40bcc0fe6f81693a1ac6710a32162f6b1e4dffe6 | JavaScript | osagiestar/JavaScript-Core-1-Homework | /week-1/1-exercises/E-strings-concatenation/exercise.js | UTF-8 | 130 | 3.640625 | 4 | [] | no_license | // Start by creating a variable `message`
let greeting = "Hello, my name is ";
let name = "Osagie";
console.log(greeting + name);
| true |
3e74f2050bfd07771b325f9115e90b654e99e80d | JavaScript | dailyfikr/dailyfikr.github.io | /jowla.js | UTF-8 | 9,024 | 2.53125 | 3 | [] | no_license | var map,infoWindow;
var locations = [];
var mapcenter = {lat: 33.0597, lng: -96.7512};
var halaqa="";
var spreadsheetid="";
/**
* The CenterControl adds a control to the map that recenters the map on
* mapcenter.
* This constructor takes the control DIV as an argument.
* @constructor
*/
... | true |
db576e7d6a8b5503e536299d6903e666717b4ce2 | JavaScript | future4code/Marcela-Militello | /semana7/labenusers/labenusers/src/components/ListaUsuarios.js | UTF-8 | 1,499 | 2.734375 | 3 | [] | no_license | import React from "react";
import styled from "styled-components";
import axios from "axios";
import { baseUrl, axiosConfig } from "../constants/consts";
const DeleteButton = styled.span`
color: red;
cursor: pointer;
`;
class ListaUsuarios extends React.Component {
state = {
usuarios: []
};
c... | true |