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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4065ff0c7952a9da4841d0b4eecd0d6d349a8b40 | JavaScript | MartijnNieuwenhuizen/looklive-server | /public/js/app.js | UTF-8 | 4,254 | 2.75 | 3 | [] | no_license | // Change product section on detail page
(function() {
'use strict';
var HTMLElements = {
main: document.querySelector('main')
};
var app = {
launcher: function() {
router.watch();
}
};
var router = {
watch: function() {
routie({
'feed': function(id) {
window.location.hash = 'fe... | true |
cc966b307f17a76c3a5d684193cdee0561746be9 | JavaScript | ricketts30/ricketts30 | /src/Game/components/GameClassComponent.js | UTF-8 | 4,517 | 2.765625 | 3 | [] | no_license | import React, { Component, PropTypes } from 'react';
class GameClassComponent extends Component {
// no need for a constructor as we just use the standard
//constructor(props){
// super(props);
//}
render(){
var chooser = null;
if(this.props.stateName === "initial"){
... | true |
11a17165af35cd8db750cbc1da3786a4bc839064 | JavaScript | adamcarheden/bookkeeper | /test/unit/Period.js | UTF-8 | 1,208 | 2.640625 | 3 | [] | no_license | const Path = require('path')
import { ChartOfAccounts, Period, test } from './fixtures'
test(`Generate Financial Statements (${Path.basename(__filename)})`, (t) => {
const PAYCHECK = 1099.99
const coa = new ChartOfAccounts()
const wages = coa.income.subAccount('Wages')
const checking = coa.assets.subAccount('Che... | true |
dc23ae217024aa0f17822a13847911661a7f6ab0 | JavaScript | DavidCastefa/FCC_QA_American_British_English_Translator | /components/translator.js | UTF-8 | 7,500 | 3.296875 | 3 | [] | no_license | const americanOnly = require('./american-only.js');
const americanToBritishSpelling = require('./american-to-british-spelling.js');
const americanToBritishTitles = require("./american-to-british-titles.js")
const britishOnly = require('./british-only.js')
class Translator {
translate(text, locale, change) {
// ... | true |
643c70b686a4b161993821bd6a11491bf335a02f | JavaScript | chikanara/ws-express-rm | /server.js | UTF-8 | 1,071 | 2.96875 | 3 | [] | no_license | const express = require("express")
const app = express()
app.use(express.json())
let users = [
{
name:"Mohamed",
email:"mohamed@gmail.com",
id:0
},
{
name:"Rami",
email:"Rami@gmail.com",
id:1
},
{
name:"Wassim",
email:"Wassim@gmail.com... | true |
fcc3efd3269ee3bd67b769658b09674c45571744 | JavaScript | yifax/StockViewC2Cdata | /Examples/Draw_NoA.js | UTF-8 | 640 | 2.65625 | 3 | [] | no_license | google.charts.load('current', {packages: ['corechart', 'line']});
google.charts.setOnLoadCallback(drawBasic);
function drawBasic() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Date');
data.addColumn('number', 'Viewers');
for (var i = 0; i < json.length; i++) {
//console.... | true |
cd0791a17f80f14f138a4c0e7fa7cf1cf43397a8 | JavaScript | lchis/laureateaem | /content/src/main/content/jcr_root/etc/designs/laureate/unitec/clientlibs/js/main.js | UTF-8 | 3,803 | 2.515625 | 3 | [] | no_license | // Override Laureate's Kaltura script that injects Twitter Bootstrap into our page
// Their lack of use of closures here is my gain!
function includeBootstrap () {
return false;
}
// Initialize Zurb Foundation
jQuery(document).foundation({
"magellan-expedition": {
destination_threshold: 400 // pixels f... | true |
64b8eb002e546c304012f9468f93614295413d1b | JavaScript | apoorvtomar2222/urlshortner | /src/action/index.js | UTF-8 | 1,936 | 2.578125 | 3 | [] | no_license | const apiCall = 'https://tranquil-temple-98462.herokuapp.com/shortner/'
const apiUrl = 'https://tranquil-temple-98462.herokuapp.com/shortner/geturls'
const callAPi = (url) => {
const data = [{
"url": url
}
]
return fetch(apiCall, {
method: 'POST',
headers: {
'Accept':... | true |
f14ae4436e6fba79a9a7e4350f2f4ed3fdf72a45 | JavaScript | Momentum-Team-8/ajax--notes-app-itsdeebarnett | /script.js | UTF-8 | 2,507 | 3.40625 | 3 | [] | no_license | //reference Jeanette example//
const url = 'http://localhost:3000/notes'
const form = document.querySelector('#entry-form')
const entryList = document.querySelector('#entry-list')
form.addEventListener('submit', event => {
event.preventDefault()
const entryText = document.getElementById('entry-text').value
... | true |
5de95c9ecc67261b9483f6b55b5d2e2301a94164 | JavaScript | Sinas66/goit-fe-course | /js/module-03/script.js | UTF-8 | 24,782 | 3.546875 | 4 | [] | no_license | "use strict";
//================ task 1 ===============
/*
* Есть массив имен пользователей
* Используя методы массива, последовательно выполнить указанные операции
*/
// const users = ["Mango", "Poly", "Ajax", "Chelsey"];
// users.length
// Удалить первый элемент массива
// users.shift();
// console.log(users); ... | true |
eeef4d8c1981d7b3aa15422b315866e59aa23715 | JavaScript | naseemkhan7021/Postman-clone | /PostMaster/app.js | UTF-8 | 4,990 | 2.625 | 3 | [] | no_license | console.log('This is post master');
let count = 0
// utility function
function addParams(div, string) {
div.innerHTML = string;
return div.firstElementChild;
}
// show and hide json and paramiter
// Request JSON
document.getElementById('paramsBox').style.display = 'none';
// show the json box
let reJ... | true |
abc80f8bf9fb4c3b546a174e74e290204553573e | JavaScript | rodolfobacini/curso-react-elotech | /src/Home.jsx | UTF-8 | 1,639 | 2.515625 | 3 | [
"MIT"
] | permissive | import React from "react";
import {
Container,
Form,
FormGroup,
Input,
Button,
} from "reactstrap";
import { ListaPosts } from "./ListaPosts";
export default class Home extends React.Component {
constructor(props) {
super(props);
this.state = {
post: "",
posts: []
};
}
onCha... | true |
54be04c83bbd9a275d7981170301850d95298cdf | JavaScript | pppwaw/network-rc | /lib/user.js | UTF-8 | 819 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | const moment = require("moment");
const { join } = require("path");
const yaml = require('js-yaml');
const fs = require('fs');
module.exports = class User {
constructor({ currentUser, onChange }) {
const userInterval = () => {
console.log("用户检测", moment());
try {
var { users } = yaml.safeLoa... | true |
54977776724b3ba91548b8268b10544317f46e18 | JavaScript | dexternierva/react-image-ecommerce-mock | /src/pages/Cart.js | UTF-8 | 1,498 | 2.703125 | 3 | [] | no_license | import React, { useContext,useState } from "react";
import { InitContext } from "../contexts/InitContext";
import CartItem from "../components/CartItem";
function Cart () {
const { cartItems, emptyCart} = useContext(InitContext);
const [ buttonText, setButtonText] = useState("Place Order");
const cartIte... | true |
92dfec1ef00d8e0341a1f5632f29f66d5135fb05 | JavaScript | Ulzahk/challenge-javascript-02 | /src/index.js | UTF-8 | 314 | 3.5 | 4 | [
"MIT"
] | permissive | const fibonacci = (n) => {
var fibonacciArray =[]
for(var i = 0; i < n ; i++){
if(i === 0 || i === 1){
fibonacciArray[i]= 1
} else if(i>1){
fibonacciArray[i] = (fibonacciArray[i-1] + fibonacciArray[i-2])
}
}
return fibonacciArray
}
module.exports = fibonacci; | true |
87087d9aea30ab143f0f39d093a9ff2098dfcf52 | JavaScript | FelipeMolinari/Curso-WEB-com-javascript | /Atividade Pratica/Atividade Extra imagens/calculo.js | UTF-8 | 1,389 | 3.484375 | 3 | [] | no_license | function calcular(){
const seletor1 = document.getElementById("seletor1")
const seletor2 = document.getElementById("seletor2")
const seletor3 = document.getElementById("seletor3")
const seletor4 = document.getElementById("seletor4")
}
function verificaResposta(resposta){
let certo = true
cons... | true |
98bbcb02149790f59c2b340b377e96f2b781e0c9 | JavaScript | apfranzen/angular_form_validation | /controllers.js | UTF-8 | 1,257 | 3.203125 | 3 | [] | no_license | (function () {
'use strict'
console.log('controllers.js wired');
const app = angular.module('formApp');
app.controller('myFormCtrl', Submission)
function Submission() {
this.users = [];
this.collectSubmission = (user) => {
console.log(this.users)
this.users.push(user)
this.user ... | true |
0ff0f86d5caaa5196cd6e25b6ee6588c4cf5119b | JavaScript | taylorreichner/lab-04-fetch-data-and-react-router | /src/DetailPage.js | UTF-8 | 1,468 | 2.734375 | 3 | [] | no_license | import React from 'react';
import request from 'superagent';
import Spinner from './Spinner';
export default class DetailPage extends React.Component {
state = {
pokemonData: {}
}
componentDidMount = async () => {
this.setState({ loading: true });
const data = await request.ge... | true |
c92151381b9c2d2f8fba209748c9f05465d2fcfe | JavaScript | ath2010/battle.world-classicals.com | /scripts/data/helpers/cleanTeamName.mjs | UTF-8 | 612 | 2.9375 | 3 | [
"MIT"
] | permissive | import emojiRegex from 'emoji-regex'
function capitalize(sentence) {
return sentence
.toLocaleLowerCase()
.split(' ')
.map(word => word.charAt(0).toLocaleUpperCase() + word.slice(1))
.join(' ')
}
function cleanEmojis(sentence) {
return sentence.replace(emojiRegex(), '')
}
function trim(sentence) ... | true |
5a34b6d6e3c192fab98bfc401d94f91848e09290 | JavaScript | 00lucasm/jokenpo | /script.js | UTF-8 | 1,043 | 3.84375 | 4 | [] | no_license |
var player_choice = 0;
var npc_choice = 0;
var winner = -1;
function play(choice){
player_choice = choice;
npc_choice = Math.floor((Math.random()*(3 - 1 + 1)) + 1);
// 1 - Pedra
// 2 - Papel
// 3 - Tesoura
if(player_choice == 1){
if(npc_choice == 1)
winner = 0;
else if(npc_choice == 2)
... | true |
a2e1134bc3b4c21dfb15f11568f1fa749d8c87d0 | JavaScript | vip-master/goit-js-hw-10-food-service | /src/index.js | UTF-8 | 968 | 2.84375 | 3 | [] | no_license | import "./styles.css"
import "./images/sprite.svg"
import template from "./templates/template.hbs"
import data from "./menu.json"
const Theme = {
LIGHT: 'light-theme',
DARK: 'dark-theme',
LOCAL: 'theme',
};
const checker = document.querySelector(".theme-switch__toggle")
let actualTheme = (localStorage.... | true |
5ed5df25ca698c8ac7254fb8fab63d974ab9fc15 | JavaScript | mel-lim/persistent-listmaker-front-end | /src/components/Lists/ListItem/ListItem.js | UTF-8 | 3,442 | 2.671875 | 3 | [] | no_license | import React, { useState } from "react";
import { SettledItem } from "./SettledItem";
import { EditItemForm } from "./EditItemForm";
import { delay, editListItemApi } from "../../../api";
// Import config data
import configData from "../../../config.json";
export const ListItem = ({ tripId, listItem, listItems, setLi... | true |
c6494ef74ea8d1a7a2cd7f41569e77e24af03a1a | JavaScript | zhecht/bitcoin | /static/js/main.js | UTF-8 | 4,095 | 2.625 | 3 | [] | no_license | var url = "/zack/";
var green = "green";
var red = "red";
function timeout() {
$.get(url+"price", function(data) {
var overall_profit = 0, overall = 0, overall_bought = 0, overall_sold = 0;
//console.log(data);
for (var i = 0; i < coins.length; ++i) {
var curr_btc_price = data[coins[i]]["curr_btc... | true |
f13e788aefc14e0940e6be4199540267aed064a5 | JavaScript | musicaldoofus/agot-deck-player | /src/helpers/getUniqueKey.js | UTF-8 | 197 | 2.859375 | 3 | [] | no_license | const getUniqueKey = (keyMemo) => {
let newKey = 100 * Math.random();
if (keyMemo.indexOf(newKey) > -1) newKey = newKey * 2;
keyMemo.push(newKey);
return newKey;
}
export default getUniqueKey; | true |
8be2cb18722f5b6cc1eb948c32a733ad7c935148 | JavaScript | guillermoriv/note-taking | /src/components/note/note.js | UTF-8 | 1,369 | 2.71875 | 3 | [] | no_license | import React from 'react';
import './note.css';
class Note extends React.Component {
handleEnter = (event) => {
if (event.key === 'Enter') {
this.props.handleNote();
let textArea = document.querySelector("#note-text textarea");
textArea.value = "Enter some text for yo... | true |
e06289df6d463c9a5e386aa8233049ede1ee1ccb | JavaScript | jaredly/local-first | /packages/nested-object-crdt/old/tests/utils/permute.js | UTF-8 | 2,045 | 2.828125 | 3 | [] | no_license | // we're looking for
// commutativity
// associativity
// idempotency
// maybe generate all the permutations, and then dedup on prefix?
const check = (initial, ops, apply, eq) => {
const cache = {};
const seen = {};
// maybe dynamic programming is all we need.
const all = permute(ops.map((v, i) => [v,... | true |
5c713ffad6ad190af713788606fa00c7061d4f70 | JavaScript | Howie126313/learningMongoose | /改/updateOne.js | UTF-8 | 600 | 2.53125 | 3 | [] | no_license | var mongoose = require('mongoose')
mongoose.connect('mongodb://localhost:27017/insert', function(err) {
if (!err) {
var schema = new mongoose.Schema({age: Number, name: String})
var temp = mongoose.model('temp', schema)
// temp.updateOne({name: /howie/}, {age: 24}, function(err, raw) {
... | true |
010d3ce05f7a346945a46613a770a269766e9ec4 | JavaScript | satyampatro/exercise04 | /modules/user_tasks.js | UTF-8 | 1,778 | 3.03125 | 3 | [] | no_license |
exports.checkForCircularDependecyInTasks = function (dependencyGraph, currentState, task) {
let taskList = dependencyGraph.tasks;
if (detectCycle(taskList)) {
throw new Error('Invalid dependency graph.');
}
if (currentState.tasks[task].status === 'completed') {
return false;
} el... | true |
2da0f2d080db0cadbe68229fdb712a200ad7f1c9 | JavaScript | avinash112233/java-script | /task15.js | UTF-8 | 280 | 3.4375 | 3 | [] | no_license | function sumofintegers(num1,num2){
var sum = num1+num2;
if(num1==num2){
var total=sum*3;
return total;
}
else{
return sum;
}
}
var result=sumofintegers(10,20);
console.log("output is ",result);
module.exports = sumofintegers;
| true |
be2b199838d7ffc1fabbc139475ece431e9c2308 | JavaScript | lvLokkie/codsen | /packages/html-crush/test/exbugs.js | UTF-8 | 1,188 | 2.546875 | 3 | [
"MIT"
] | permissive | import tap from "tap";
import { m } from "./util/util.js";
// pre + code
// -----------------------------------------------------------------------------
tap.test(
`01 - ${`\u001b[${33}m${`ex-bugs`}\u001b[${39}m`} - does not mangle pre/code`,
(t) => {
t.is(
m(
t,
`<html>
<body>
<pre cl... | true |
611dd2c58388d00588d61501d95d9b4b8c6d68d8 | JavaScript | jonathan-prevedan/Hackathon | /libraries/servers.js | UTF-8 | 2,886 | 2.71875 | 3 | [] | no_license | $(document).ready(function(){
setInterval(function(){
updateServers();
}, 1000)
$('.server').click(function(){
var status = $('#' + this.id).children(".status").children("p").text();
if(status == "Disponible"){
const id = this.id;
document.location.href = "g... | true |
4732445f58f93fff4f8972521e6c1a6651e6f5ee | JavaScript | ihlayhiha/JavaScript-course | /JavaScriptworks/howJSworks.js | UTF-8 | 4,337 | 4.3125 | 4 | [] | no_license | 'use strict';
// checking to see how JavaScript works
console.log(this);
const arrow = () => {
console.log("This is an arrow function");
console.log("This is 'this' inside arrow function", this);
}
arrow();
// if we use strict, 'this' property does not exist inside normal function expressions or functions d... | true |
1b4f9b64d0ac6335fc0ee361b05484e25fecfc8c | JavaScript | danm1kael/matheussilva2.github.io | /projetos/icarusph/js/popup-image.js | UTF-8 | 1,355 | 3.140625 | 3 | [] | no_license | const popupElement = document.getElementById("image-popup-container")
const closePopupBtn = document.getElementById("close-button-popup")
const popupImage = document.getElementById("popupImage")
const botaoProximo = document.getElementById("nextImageBtn")
const botaoAnterior = document.getElementById("previousImageBtn"... | true |
a8519054bae9ce3e5b3d7d6cf39135324bb40004 | JavaScript | erciliastf/predicao_futebol | /format.js | UTF-8 | 5,486 | 2.6875 | 3 | [] | no_license | var fs = require("fs");
// var csv = fs.readFileSync('updated_data/training.csv', 'UTF-8');
var csv = fs.readFileSync('updated_data/training_pred.csv', 'UTF-8');
csv = csv.split('\n');
var newCols = ["days", "homeWonLast", "awayWonLast", "homeWinStreak", "homeLoseStreak", "homeTieStreak", "awayWinStreak", "awayLoseStre... | true |
918ccfe331dbc64be383b369e1ddfef17b5891d7 | JavaScript | NadyaIlinskiy/data-structures-and-algorithms-2 | /Challenges/quicksort/test/quicksort.test.js | UTF-8 | 1,215 | 3.375 | 3 | [] | no_license | 'use strict';
// Require the module we're testing
const { quickSort } = require('../quicksort.js');
describe('Verify insertionSort functionality', () => {
it('Verify Sort array of length 1', () => {
let arr = [1];
let result = [1];
expect(result).toEqual(quickSort(arr));
});
it('Verify Sort array o... | true |
4b6915b3441640a4cc4f0434ebd510e010d126fc | JavaScript | sercasti/amplify-js-app | /count.js | UTF-8 | 800 | 2.828125 | 3 | [] | no_license | function buildCount(inputData){
var results = inputData.totalResults.results;
var videoLabels = [];
var totalValues = [];
for(i = 0; i < results.length; i++){
var result = results[i];
var videoName = Object.keys(result)[0];
videoLabels.push(videoName);
var events = resu... | true |
ee64fd1d1371bf658220b8f7067adbfe3955e489 | JavaScript | MarianoTroncoso/Bot-Discord | /index.js | UTF-8 | 2,914 | 2.6875 | 3 | [] | no_license | const fs = require('fs');
const { Client, Collection } = require('discord.js');
const client = new Client();
// mongo
const mongoose = require('mongoose');
const uri = process.env.URI_MONGO;
mongoose.connect(uri,
{
useNewUrlParser: true,
useCreateIndex: true,
useUnifiedTopology: true
}... | true |
a1bca7e8e8b508ad667ee266c1864179e96c2ffe | JavaScript | rsaihe/combat | /scripts/particle.js | UTF-8 | 798 | 2.9375 | 3 | [
"MIT"
] | permissive | class Particle extends Entity {
constructor(x, y, speed, template) {
super(x, y);
// Display
this.color = [0, 0, 0]; // base RGB color
this.model = MODEL.basicParticle; // skin
// Misc
this.decay = 2;
this.lifespan = 255;
// Physics
... | true |
ab4e68be7a45d975114e208864ca0071eff9bbec | JavaScript | bernsteinjon/csc470-browsers | /project4/process_start.js | UTF-8 | 1,462 | 3.28125 | 3 | [] | no_license | self.onmessage = function(event) {
let start = Date.now();
let img = event.data;
let newImg = median(img.imData, img.imData.width, img.imData.height);
img.imData.data.set(newImg);
let elapsed = Date.now() - start;
img.id += ": " + elapsed + " ";
self.postMessage(img);
};
// Apply ... | true |
1b4b6f5bd9e3f628ece999041a53a0c0d7db4eaa | JavaScript | davidhariri/locker | /source/locker.js | UTF-8 | 2,606 | 3.03125 | 3 | [] | no_license | class Locker {
constructor(storageType='local') {
const storageTypes = ['local', 'session'];
this.items = {};
this.usingStorage = false;
this.storageType = storageType;
if(!storageTypes.includes(this.storageType)) {
console.warn(`'${this.storageType}' is not a v... | true |
160c65729cabd4fd0b6f8fe839cf432083194a1b | JavaScript | torredefarol24/tm-jest-yt | /functions.test.js | UTF-8 | 810 | 2.5625 | 3 | [] | no_license | const asyncfunctions = require('./functions')
test("Some Randome Test", () => {
expect(asyncfunctions.dummyFunc()).toBe(5);
});
test('User Fetched name should be Learne Graham', ()=> {
expect.assertions(1);
const name = 'Leanne Graham';
return asyncfunctions.fetchUser_jsonplaceholder().then( api_data => {
... | true |
c760ba363961888489a6c7aa07b365567ceeac6e | JavaScript | PeteBastonCliency/Inteliscan23 | /src/components/charts/defaults.js | UTF-8 | 2,623 | 2.5625 | 3 | [] | no_license | import React, { useEffect, useRef, useState } from "react"
export const colors = {
primary: "#4650dd",
blue: "#0d6efd",
indigo: "#6610f2",
purple: "#6f42c1",
pink: "#d63384",
pinkLighter: "#e685b5",
red: "#dc3545",
orange: "#fd7e14",
yellow: "#ffc107",
green: "#35b653",
teal: "#20c997",
cyan: "... | true |
b4f2dd7def69a1268ddb6577b28f1860c2790b17 | JavaScript | Kirby2021/SpotifyMusic | /src/commands/music/leave.js | UTF-8 | 772 | 2.515625 | 3 | [] | no_license | module.exports = {
name: "leave",
aliases: ["end","dc","disconnect","leavevc"],
description: "Toggle music loop",
async execute(message) {
if(!message.member.voice.channel) {
return message.channel.send('<:Zayn_salah:841625444594876417>・Please, join in voice channel');
}
... | true |
5e42c8580492adfda59dc74a8ff972d9762cfee2 | JavaScript | lebedevadare/vanilla | /js/main.js | UTF-8 | 326 | 2.640625 | 3 | [
"MIT"
] | permissive |
let buttonRefuse = document.querySelector('.refuse');
let modal = document.querySelector('.modal-wrapper');
let close= document.querySelector('.link-back')
buttonRefuse.addEventListener("click",function (){
modal.classList.add('show')
});
close.addEventListener("click",function () {
modal.classList.remove('show'... | true |
f9d237e1d4b2ec730662cbc80c67a6746df30766 | JavaScript | cmiyachi/InterviewQuestions | /Data Structures/LinkedList/doublyLL.js | UTF-8 | 4,384 | 4.34375 | 4 | [] | no_license | //First We will create a node with the following parameters:
//1. Data
//2. Previous
//3. Next
function Node(data) {
this.data = data;
this.previous = null;
this.next = null;
};
function DoublyLL() {
this.head = null;
this.tail = null;
this.numberOfVals = 0;
};
DoublyLL.proto... | true |
09c6e5db1035f1613c1ce3f765aa20c131bef507 | JavaScript | melissa-24/ambient-weather-fe | /src/components/current/pws/HbPwsCard.js | UTF-8 | 2,132 | 2.546875 | 3 | [
"MIT"
] | permissive | import React, { useState, useEffect } from 'react'
import axios from 'axios'
const { REACT_APP_HB_CUR_AMB_URL } = process.env
function PWS() {
const [data, setData] = useState([])
useEffect(() => {
axios
.get(REACT_APP_HB_CUR_AMB_URL)
.then((res) => setData(res.data))
// .then((res) => c... | true |
6139ed329467941e7250a8439f2400f0da372650 | JavaScript | elloveronika/dailycodingchallenges | /regex.js | UTF-8 | 187 | 2.859375 | 3 | [] | no_license | function validatePIN (pin) {
let newPin= pin.replace(/[a]/gi, '').replace(/\W_/g,"").match(/[0-9]/g)
return newPin.length == 6 || newPin.length == 4 ? true : false
} | true |
1504d09141ece9873232701e868cc42a99ac9293 | JavaScript | philjohnson74/ModernReactBootcamp | /02_JSX/JSXConditionals/index.js | UTF-8 | 722 | 3.296875 | 3 | [] | no_license | function getRandomNumber() {
return Math.floor(Math.random() * 10) + 1;
}
class NumPicker extends React.Component {
render() {
const randomNumber = getRandomNumber();
let msg;
if(randomNumber === 7) {
msg = <div>
<p>Congrats!</p>
<img src="htt... | true |
4ac278621260ca1876c171c6dc0c05da4f9fdddb | JavaScript | guticostanti/experimentos | /Curso programador br/Módulo 22 - Express Node/aula-3/script.js | UTF-8 | 418 | 2.65625 | 3 | [] | no_license | var express = require('express');
var app = express();
var bodyParser = require("body-parser");
let consoleBody = (req, res, next) => {
console.log(req.body);
next();
}
let hello = (req, res) => {
res.send("ola, mundo");
}
app.use("/", bodyParser.json());
app.use("/", consoleBody);
app.get("/", hello);
... | true |
e12d12f055d39cd921693048963d5034d9d78fe3 | JavaScript | TatyPashkoff/HelloExpressJS | /js/script.js | UTF-8 | 6,475 | 3.03125 | 3 | [] | no_license | /*jshint esversion: 8 */
window.addEventListener('DOMContentLoaded', () => {
//load data from db
const loadData = async (url, callback) => {
await fetch(url)
.then(response => response.json())
.then(json => showData(json.goods)); // console.log(json)
callback();
};
// buttons sort
docum... | true |
a58a0a2e59506ce924dcbfe4f6b8a6782647f6dc | JavaScript | amilcar-laniakea/vue-first | /js/scripts.js | UTF-8 | 721 | 2.765625 | 3 | [] | no_license | const dep = new Vue({
el: '#app',
data: {
titulo: 'hola mundo con vue',
frutas: ['pera', 'manzana', 'uva', 'mandarina'],
fruits: [
{nombre:'pera', cantidad: 10},
{nombre:'manzana', cantidad: 0},
{nombre:'uva', cantidad: 7},
{nombre:'mandarina', cantidad: 3}
],
newFruit: '... | true |
8601c3223d5b50927f18c5bfe0ab31ab585a9d89 | JavaScript | Lrodrigues94/GitAula04 | /calculadora.test.js | UTF-8 | 407 | 2.984375 | 3 | [] | no_license | //npmimport { expect, test } from '@jest/globals';
//import * as calculadora from './calculadora.js';
const calculadora = require('.calculator');
test("testantdo soma de 1 + 1", () => {
expect(calculadora.soma(1,1)).tobe(2);
})
test("testar divisao de 42/6", () => {
expect(calculadora.divisao(42,6)).tobe(7);... | true |
2b028d9964c00da74bc4fb9451feda94dd935de2 | JavaScript | palomomatias/CursoIngresoJS | /9-Parciales/parcial/uno.js | UTF-8 | 203 | 3.09375 | 3 | [] | no_license |
function Mostrar()
{
var perimetro
var resultado
perimetro= document.getElementById("laBase").value;
perimetro= parseInt(perimetro)
resultado= (perimetro*4)
alert(resultado);
}
| true |
3a6b2165bc7c264da3fa6da9728891776dd2e302 | JavaScript | ApurvaVerma096/Assignments1 | /ts assignment/sumOfIndividualDigit.js | UTF-8 | 423 | 2.90625 | 3 | [] | no_license | "use strict";
exports.__esModule = true;
var readline = require("readline");
var val = readline.createInterface({
input: process.stdin,
output: process.stdout
});
var x;
var r;
val.question('enter a number ', function (answer) {
var num = parseInt(answer);
while (num != 0) {
r = num ... | true |
b36418f729f74fca889235dba1ae5f625890c014 | JavaScript | PavelYvorskiy/myFirstProject | /script/components/slides/slides.js | UTF-8 | 905 | 2.546875 | 3 | [] | no_license | const slideTemplate =`
<div class="swiper-slide"><img src="./assets/img/slideSingl_1.webp" alt=""></div>
<div class="swiper-slide"><img src="./assets/img/slideSingl_2.webp" alt=""></div>
<div class="swiper-slide"><img src="./assets/img/slideSingl_3.webp" alt=""></div>
<div class=... | true |
0eb7fe0d4ba303ed43619138822023c98dd5db55 | JavaScript | unstoo/orgurtube | /client/components/GroupsPane/component.jsx | UTF-8 | 1,573 | 2.59375 | 3 | [] | no_license | import React from 'react'
import styles from './style.css'
export default class GroupsPane extends React.Component {
constructor(props){
super(props)
const channels = props.channels.items
const groups = {}
let groupTag = ''
for (let id in channels) {
groupTag = channels[id].grou... | true |
88ed32d6e2d091cc2f3a7c39a7aa0777503aeedb | JavaScript | ymakarevich76/1210421-technomart-28 | /js/total.js | UTF-8 | 3,016 | 2.71875 | 3 | [] | no_license | var mapLink = document.querySelector('.map__link');
if(mapLink) {
var mapPopup = document.querySelector('.modal-map');
var mapClose = mapPopup.querySelector('.map-close');
mapLink.addEventListener('click', function(evt) {
evt.preventDefault();
mapPopup.classList.add('modal-show');
});
mapClose.addEventListener('cl... | true |
a63ce5bde8c6fc6cffdae20712bcb7bbd7eb8233 | JavaScript | lucasclf/SoulCodeAcademy | /06_BancoDados/coque_market/app.js | UTF-8 | 2,431 | 2.515625 | 3 | [
"MIT"
] | permissive | //Chamada dos módulos
const express = require("express");
const app = express();
const expressLayouts =require("express-ejs-layouts");
const cookieParser = require('cookie-parser');
const session = require('express-session');
const flash = require('req-flash');
const con = require("./config/... | true |
fdc2b6a4c18704172dc319ca19eae5bcf1a3e09f | JavaScript | ippei-tanaka/othello | /scripts/controllers/queueComponent.js | UTF-8 | 1,320 | 2.796875 | 3 | [] | no_license | define([
'jquery',
'underscore'
], function (
$,
_
) {
var instance = null;
var $element = $("<div />");
var QueueComponent = function () {
if(instance !== null){
throw new Error("Cannot instantiate more than one QueueComponent, use QueueComponent.getInstance()");
... | true |
71dc8f769232ac261d9c96d70fd635f792e15abe | JavaScript | ccwq/ipro | /src/string/StringUtils.js | UTF-8 | 5,023 | 3.3125 | 3 | [] | no_license | const randomDic = new Map();
import $GBK from "../base/$GBK";
export default class StringUtils {
/**
* 使用字符串的第一个字母大写
* @param first
* @param rest
* @returns {string}
*/
static firstLetterUppercase(string){
if(string === 0){
return "0"
}
if (string ... | true |
e4a911bfd5ca551a35ce081856ed6d3dd83ed7fb | JavaScript | HarryDao/Algorithm | /A.Algorithm/3.Sort/2.MergeSort_CountInversion.js | UTF-8 | 278 | 3.234375 | 3 | [] | no_license | function countInversions(arr) {
function splitArray(array) {
const middleIndex = Math.floor(array.length / 2);
return [array.slice(0, middleIndex + 1), array.slice(middleIndex)];
}
return splitArray(arr);
}
console.log(countInversions([2, 4, 1])); | true |
6aca58d98f21a811f2ea1659d40eaa6fe5ed68e3 | JavaScript | snmgian/statement-bb | /app/assets/javascripts/bb_views.js | UTF-8 | 1,269 | 2.515625 | 3 | [] | no_license | _.templateSettings = {
interpolate: /\{\{(.+?)\}\}/g,
evaluate: /\{\%(.+?)\%\}/g
};
var HelloView = Backbone.View.extend({
tagName: "div",
className: "hello",
events: {
'click': 'notify'
},
render: function() {
$(this.el).html("Hello world!");
return this;
},
notify: function() {
... | true |
9b9960d1f27282b5a8b2b5dd8945398871390879 | JavaScript | hwang1995/react_project | /src/views/Ch08GlobalState/Exam01ColorContext/ColorContext.jsx | UTF-8 | 521 | 2.5625 | 3 | [] | no_license | import {useState, createContext} from 'react';
const ColorContext = createContext({
color: 'yellow',
setColor: function(color) {
this.color = color
alert(color);
}
});
// Component O
export function ColorContextProvider(props) {
const [color, setColor] = useState('black');
const va... | true |
f000e781e6e377b851ddf49dfa6f882318494fea | JavaScript | frankerzeng/node_test_service | /spread.js | UTF-8 | 2,788 | 2.625 | 3 | [] | no_license | Date.prototype.format = function (format) {
var date = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
"S+": this.getMilliseconds()
};
... | true |
4d6e1e46e80f3b4d19d9ad7b9460e16c50e9b91c | JavaScript | lecuisto56/epreuve-du-feu | /escalier.js | UTF-8 | 232 | 3.859375 | 4 | [] | no_license |
liste1 = " # \n";
liste2 = " ## \n";
liste3 = " ### \n";
liste4 = " #### \n";
console.log(liste1 + liste2 + liste3 + liste4);
console.log(" #");
console.log(" ##");
console.log(" ###");
console.log(" ####"); | true |
59835ddb1e1244afe77f1828aea86b645aef2d5d | JavaScript | PetrPPetrov/extreme-nest | /test-client/sources/scripts/nestingGenerator.js | UTF-8 | 5,432 | 2.859375 | 3 | [] | no_license | // Copyright (c) 2019 by
// GkmSoft (individual entrepreneur Petr Petrovich Petrov)
// This file is part of Extreme Nest project.
// This software is intellectual property of GkmSoft.
'use strict';
import * as _ from 'underscore'
const FIGURE_TYPE_TRIANGLE = 1;
const FIGURE_TYPE_RECTANGLE = 2;
const TRIANGLE_UP_DIR... | true |
51f680ba8b16cf65b0508f3440dc67de15efd9e4 | JavaScript | alechash/branches | /config/functions.js | UTF-8 | 2,510 | 2.890625 | 3 | [
"MIT"
] | permissive | const Log = require('../models/Log')
async function isAdmin(user) {
if (loggedIn(user) == true && user.admin == true) {
return true
} else {
return false
}
}
async function loggedIn(user) {
if (user) {
return true
} else {
return false
}
}
async function create... | true |
4020976296e4539187015b768207e6a434109f34 | JavaScript | shubhamjaintech/secret-santa-using-react | /secret-santa/src/Form.js | UTF-8 | 614 | 2.59375 | 3 | [] | no_license | import React from "react";
let Form = ({onSubmitHandler}) => {
let nameField, emailField;
let onFormSubmit = (e) => {
e.preventDefault();
onSubmitHandler(nameField.value, emailField.value);
nameField.value = "";
emailField.value = "";
nameField.focus();
}
return (
... | true |
cd3cce0d43b314b53e6fb76e79e16824d4421b21 | JavaScript | SvenjaHolzinger/SoftwarePraktikum | /frontend/src/api/ArtikelBO.js | UTF-8 | 1,371 | 2.96875 | 3 | [] | no_license | import NamedBO from './NamedBO';
export default class ArtikelBO extends NamedBO {
/** Damit direkt über diese KLasse ein Name angelegt werden kann,
muss der Parameter im Constructor entgegengenommen werden
und an die Superklasse NamedBO weitergegeben werden. */
constructor(name) {
super(name);
... | true |
58bc51610398da4dac19e9a69ef6a9767a391a87 | JavaScript | js-tasks-ru/vuejs-20200615-course-materials | /05-deep-vue/05-render/main.js | UTF-8 | 3,503 | 2.796875 | 3 | [] | no_license | import Vue from '/vendor/vue.esm.browser.js';
const TextDiv = {
name: 'TextDiv',
render(createElement) {
return createElement('div', 'Text')
}
};
const ParagraphComponent = {
name: 'ParagraphComponent',
render(createElement) {
return createElement('p', this.$slots.default);
},
};
const CounterB... | true |
7006615d3ea61cac3097d5c566fd238087df8752 | JavaScript | dominicenglish/travel-planner | /shared/redux/reducers/__tests__/titleReducer.spec.js | UTF-8 | 996 | 2.609375 | 3 | [] | no_license | jest.unmock('../titleReducer.js');
jest.unmock('../../actions/titleActions.js');
import titleReducer from '../titleReducer.js';
import { TITLE_SET } from '../../actions/titleActions.js';
describe('titleReducer', () => {
it('should return existing state if no cases match', () => {
const state = 'hello';
... | true |
61b6b733f7a060572e433f5a19aafa38e1a31d16 | JavaScript | shamim-ahmed/frontend-nanodegree-arcade-game | /js/app.js | UTF-8 | 8,576 | 3.515625 | 4 | [] | no_license | // the constants used by various classes and game engine
var gameConstants = {
"deltaX": 101,
"deltaY": 83,
"numberOfRows": 6,
"numberOfColumns": 5,
"canvasWidth": 505,
"canvasHeight": 606,
"playerInitialX": 202,
"playerInitialY": 415,
"enemyCount": 3,
"enemyInitialXValues": [0, 101, 202],
"enemyI... | true |
2c04c1cc9333f6b3129d275ebe80cb8a6a1bc2a9 | JavaScript | MichaelOlmosTrujillo/2020-14-21-sept-js | /assets/js/script.js | UTF-8 | 692 | 3.6875 | 4 | [] | no_license | /* Div que va a tener la tabla del 1 */
const tabla1 = document.getElementById("tablaDel1");
/* Boton para la tabla del 1 */
const boton = document.getElementById("boton");
// console.log(tabla1);
boton.addEventListener('click', () => {
let arreglo = [];
// let tabla = []
// arreglo.push('1' + ' ' + '*' + '... | true |
eba3b5b6c39b35cfdf74b066757a9db17739d7dd | JavaScript | kwhittelsey/Fixit9KatieWhitt.appstudio | /MadLibs.js | UTF-8 | 863 | 2.671875 | 3 | [] | no_license | sbmt.onClick = function(){
let noun1 = inptNoun1.value
let noun2 = inptNoun2.value
let noun3 = inptNoun3.value
let verb = inptVerb.value
let ajective = inptAdjective.value
let verbIng = verb.concat("ing")
let nounS = noun2.concat('s')
lblSentence.value = `A ${noun1} in Nebraska was arrested this morning... | true |
2db29e9cc619c5a4e35be257bc888a48f44fd402 | JavaScript | konce/react-router-limiter | /index.js | UTF-8 | 5,982 | 2.734375 | 3 | [
"MIT"
] | permissive | /**
* @desc 基于react-router,对传进来的路由名单进行过滤出最终白名单,对其进行访问权限控制, 支持UMD写法
* @author kxj0206@gmail.com
* @namespace RouteLimiter
* @version 1.0.5
*
* @interface { init, canAccess, limit }
* @example 在可以获取菜单或者路由数据的地方,RouteLimiter.init(list, config, callback);
* 在App.js 挂载的render函数或者在挂载之前,执行RouteLimiter.limit(th... | true |
6d1c182469b6d87cb32970bbec7fa51e562042af | JavaScript | RodrigoGuinazu/apuntes | /apis/ejercicio-1/public/js/products.js | UTF-8 | 4,356 | 3.046875 | 3 | [] | no_license | window.addEventListener('load', function(e){
// LATEST //
fetch('http://localhost:3000/api/products/latest')
.then(function(response){
return response.json()
})
.then(function(information){
let latest = document.getElementById('latest-products')
let ultimos = []
... | true |
900146644124044641be7be6f04484ad4e4e518b | JavaScript | nataliasu/myPage | /MathsGame/javascript.js | UTF-8 | 3,965 | 3.53125 | 4 | [] | no_license | var playing = false;
var score;
var action;
var timeremaining;
// klikajac na start/reset
document.getElementById("startreset").onclick = function () {
// jesli gramy
if (playing == true) {
location.reload(); // przeladuj strone
} else { // jesli nie gramy
playing = true; // tryb grania
... | true |
353c377279d3ba977023367d96545675af511418 | JavaScript | TheTerryVo/restel_black_jack | /Contents/Resources/GetPrefs.js | UTF-8 | 962 | 2.875 | 3 | [] | no_license | function getPrefs()
{
var result = "";
var queryelements = document.getElementsByTagName('div');
for ( i = 0 ; i < queryelements.length ; ++i )
{
if ( queryelements[i].className == "query" )
{
var queries = queryelements[i].getElementsByTagName('input');
if ( queries.length > 0 )
{
for ( j = 0 ; j ... | true |
03798ccc39e802fbcb85fd5d012e4ede2e1ecb67 | JavaScript | carlo1678/digitalcrafts | /week5/day1/weather.js | UTF-8 | 1,174 | 3.28125 | 3 | [] | no_license | const getWeatherData = async () => {
let input = document.querySelector("#cityInput").value
const data = await fetch(`https://api.openweathermap.org/data/2.5/weather?zip=${input},us&appid=714e2f1a644d53aee22d57e720922fab&units=imperial`)
const dataJson = await data.json()
let grabLocation = document.que... | true |
68f125a866b9484a8c8bad4902f323b2c239e365 | JavaScript | PhiHung99/A0720i1-NguyenPhiHung | /Module 1/B15_LapTrinhHuongDoiTuong/Thuc_Hanh/XayDungLopHinhTron/Circle.js | UTF-8 | 618 | 3.84375 | 4 | [] | no_license | class Circle {
constructor(radius, color) {
this.radius = radius;
this.color = color;
}
getRadius(){
return this.radius;
}
setRadius(radius){
this.radius = radius;
}
getColor(){
return this.color;
}
setColor(color){
this.color = color;
... | true |
a465b0a8bd437749f94f033ab3248ce5577530fb | JavaScript | dshfc/react-examples | /api-client/src/components/math/Sum.js | UTF-8 | 1,948 | 2.796875 | 3 | [] | no_license | import React, { Component } from 'react';
import { Button } from 'react-bootstrap';
import { Row, Col } from 'react-bootstrap';
import { FormGroup, FormControl, ControlLabel } from 'react-bootstrap';
import Message from '../Message';
import { apiUrl } from '../Utils'
class Calculate extends Component {
constructor(... | true |
0cca9b393290fc20181af39507a03ba6ef8e2476 | JavaScript | yamamaot/Prog209HW-4 | /HW4JS.js | UTF-8 | 1,755 | 3.34375 | 3 | [] | no_license | var i;
var input;
var inputArray = new Array();
var firstInputs = document.getElementById("firstInputs");
var outputs = document.getElementById("outputs");
var btnStartInput = document.getElementById("btnStartInput");
var btnChange = document.getElementById(... | true |
ac64cad03f7ebe86b4ec50ad253996aaca7edcd2 | JavaScript | mehtadhiraj/YelpCamp | /middleware/index.js | UTF-8 | 1,919 | 2.640625 | 3 | [] | no_license | var Campground = require("../models/Campgrounds"),
Comment = require("../models/Comment"),
User = require("../models/User");
//All the middlewares goes here
var middlewareObject = {};
middlewareObject.checkCampgroundOwnership = function(req, res, next){
if(req.isAuthenticated()){
Campgro... | true |
92b5af6e90f014c7abd7a050c4636297be78ffa8 | JavaScript | jmregan0/react-boilerplate | /app/reducers/sample.jsx | UTF-8 | 4,491 | 3.9375 | 4 | [] | no_license |
// ****** FOR USE WITH REDUX ***********************************
/* ****** Action-Types *****************************************
These are basically the types of actions you anticipate having.
They can be things like RETRIEVE_DATA or UPDATE_USER.
Basically their naming convention surrounds the 'way' you are
... | true |
026b2c739ce7f322f2607e04d05a11a629ee31fe | JavaScript | 4bss3101/TK_1621 | /api/mqtt_server.js | UTF-8 | 1,397 | 2.5625 | 3 | [
"MIT"
] | permissive | const mqtt = require('mqtt')
const getImagePath = require('./lib/get_image_path')
const translate = require('./lib/translate')
const googleVision = require('node-cloud-vision-api')
// initialize google cloud vision api
googleVision.init({auth:'AIzaSyBBrKHAumfSaP5EBfOsA5A27qRIWaj83c4'})
const googleReq = (filePath) =>... | true |
ca3f94c638fb0d4bd3ee93dce45d7f8673655392 | JavaScript | cihm/Node.js-Reference | /2/stacks_pop.js | UTF-8 | 221 | 3.5625 | 4 | [
"MIT"
] | permissive | var queue = [];
queue.push('Fred');
queue.push('Wesley');
queue.push('Chuck');
queue.push('Charles');
queue.push('Frankie');
var first = queue.pop();
console.log(first);
var second = queue.pop();
console.log(second);
| true |
86cf09635a52da9ebb1160f044a45f424adb5894 | JavaScript | kientrungle2001/fbsale.api | /api/helpers/fb-post-messages.js | UTF-8 | 4,772 | 2.515625 | 3 | [] | no_license | var request = require('request');
module.exports = {
friendlyName: 'fb Post Messages',
description: 'Nhắn tin cho khách hàng',
inputs: {
recipient: {
type: 'string',
example: 'recipient Id',
description: 'id người nhận',
required: true
},
token: {
type: 'string'... | true |
6bd4f0254ccc86d3ef0b42eab5ab43454cfb574d | JavaScript | ashwinian/api_performance_test | /test/recipe.js | UTF-8 | 1,452 | 2.65625 | 3 | [] | no_license | var should = require("should");
var request = require("request");
var chai = require("chai");
var expect = chai.expect;
const { PerformanceObserver, performance, PerformanceEntry } = require('perf_hooks');
var baseUrl = "https://www.themealdb.com/api/json/v1/1/search.php?";
function displayTime(numInms) {
perfT... | true |
ad6b346f3b4a380d511ea9e2a2c438a27f3e3ea9 | JavaScript | domino14/liwords-old | /static/js/components/tile.jsx | UTF-8 | 4,000 | 2.65625 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
const fontFamily = 'Arial,Geneva,Helvetica,Helv,sans-serif';
const TILE_STYLES = {
aeroBlue: {
color: '#4417b7',
outline: '#492889',
textColor: '#ffffff',
blankTextColor: '#11fefe',
},
aeroBlueJustPlayed: {
color: '#175cb7',
... | true |
8c9967834fed9ff448b2368c6162a6400e79bb98 | JavaScript | YugantKachroo/Algoflow | /react_front/src/algorithms/Graph/Maze/WeightMaze.js | UTF-8 | 812 | 2.8125 | 3 | [] | no_license | import generate from '@indutny/maze';
export function WeightMaze(grid, Row, Col) {
const maze = generate({ width: Col, height: Row });
for (let i = 0; i < Row; i++) {
for (let j = 0; j < Col; j++) {
const { row, col } = grid[i][j];
if (grid[i][j].isStart || grid[i][j].isFinish) {
if (row > ... | true |
348319bcd3310264dfd6ed9c073a2223d1af025b | JavaScript | nvodoor/subclass-dance-party | /src/makeBearDancer.js | UTF-8 | 478 | 2.859375 | 3 | [] | no_license | //THIS IS THE SUB CLASS
var makeBearDancer = function(top, left, timeBetweenSteps) {
makeDancer.call(this, top, left, timeBetweenSteps);
this.$node = $('<img class="beardancer" src="./src/giphy.gif"></img>');
this.setPosition(top, left);
};
makeBearDancer.prototype = Object.create(makeDancer.prototype);
makeBear... | true |
fe3049888015d2242385824ef07b42795a1f57a4 | JavaScript | crowjdh/QuesStudyCabinet | /180518/codefight/arcade/core/NaDongHyun/06_CircleOfNumbers.js | UTF-8 | 159 | 3.15625 | 3 | [] | no_license | function circleOfNumbers(n, firstNumber) {
if(n/2 > firstNumber) {
return n/2 + firstNumber;
} else {
return firstNumber - n/2
}
}
| true |
67b782ed04d69959692cac73042ce9a4bca045ea | JavaScript | fiveletter/wee-board | /WeebApp/app/actions/actions.js | UTF-8 | 2,274 | 2.53125 | 3 | [] | no_license | import BleManager from 'react-native-ble-manager';
import {NativeAppEventEmitter} from 'react-native';
import * as BleBoard from '../api/BleBoard.js';
/* bleDeviceReducer Actions */
export let addDevice = (device) => {
return {
type: 'ADD_DEVICE',
device
}
};
export let removeDevice = () => {
return {
... | true |
c64884e1660fa258cfc3f261deaa1c6b812756dd | JavaScript | missionraj/myself | /assets/js/custom.js | UTF-8 | 3,603 | 2.65625 | 3 | [] | no_license |
!function($) {
"use strict";
/* ---------------------------------------------- /*
* Preloader
/* ---------------------------------------------- */
$(window).on('load', function() {
$('#loadingview').addClass("loaded");
});
/*
navbar section
*/
$('.navbar-toggler').on(... | true |
d8637cbad161eeed41c0d7aeb7b6da91f56a823a | JavaScript | mkleon2020/front-eco | /components/Account/ChangePasswordForm/ChangePasswordForm.js | UTF-8 | 1,724 | 2.53125 | 3 | [] | no_license | import React, {useState} from "react";
import {Form, Button} from "semantic-ui-react";
import {useFormik} from "formik";
import * as Yup from "yup";
import {toast} from "react-toastify";
import {updatePasswordApi} from "../../../api/user";
export default function ChangePasswordForm(props){
const {user, logout, setRe... | true |
caead0525bb3c611759095d6149cd6458c7209f6 | JavaScript | bachvtuan/handlebar | /app_1.js | UTF-8 | 1,122 | 2.671875 | 3 | [] | no_license | var source = $("#ajax-comment").html();
//Convert html object handlebar object
var template = Handlebars.compile(source);
var data = {
name: "Bach Van Tuan",
date: "02/04/203",
comment: "what do you think about handlebar, does it awesome ?",
social: [
{
site: "Twitter",
name: "Ba... | true |
c5faa0acc91dbac5756b50423ad6ec5411d78bfc | JavaScript | colinritchey/app-academy-projects | /W6D4/jqueryLite/lib/dom_node_collection.js | UTF-8 | 1,358 | 3.3125 | 3 | [] | no_license | class DOMNodeCollection{
constructor(htmlEls){
this.htmlEls = htmlEls;
}
html(string){
if(string instanceof String){
this.htmlEls.forEach(function(el){
el.innerHTML = string;
});
} else {
return this.htmlEls[0].innerHTML;
}
}
empty(){
this.html('');
}
appen... | true |
6634b74fc69771b0d69face2c807571580c8bb77 | JavaScript | chugunov75/BookStore | /js/cart/confirmMessagebox.js | UTF-8 | 1,948 | 2.71875 | 3 | [
"MIT"
] | permissive | class ConfirmMessagebox extends Popup {
constructor(options) {
options = Object.assign({
message: 'mesage',
width: '500px',
className: '',
parent: null,
onCloseCallback: function (result) {}
}, options);
super(options);
... | true |
0bcc0a8e6cf753eb0734a44ee5ab12a1323f2ab6 | JavaScript | peoplemaner/nodejs | /Examples/Chapter4/4.1_HttpServer/server2.js | UTF-8 | 1,252 | 2.859375 | 3 | [] | no_license | const http = require('http');
const fs = require('fs/promises');
http.createServer(async (req, res) => {
try {
const data = await fs.readFile(`${__dirname}/server2.html`);
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8'});
res.end(data); // 버퍼 데이터 전송
} catch (error) {
... | true |
724f4a7dd70f400fcaeb2f7446966f81e4866a1a | JavaScript | enarddpascua/Tweet-sentiment-analysis- | /problem1New.js | UTF-8 | 1,440 | 3.171875 | 3 | [] | no_license | var stemmer = require('stemmer')
const readline = require("readline");
const fs = require("fs");
fs.readFile('scores.txt', (err, data) => {
if (err) throw err;
var getData = data.toString();
var removeTab = getData.split("\t").toString();
var removeN = removeTab.split("\n");
readline.createInterface(... | true |