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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
dbb88b541895623a81e7f9bd7a8df0b943c9fbb0 | JavaScript | rhaws87/Alien_Heroku | /static/js/app3.js | UTF-8 | 5,950 | 2.65625 | 3 | [] | no_license | // UFO Data --> standalone file
// Perform a GET request to the query URL
// var URL = "../static/js/GeoJsonNew.json";
// Perform a GET request to the query URL
d3.json("../static/js/GeoJsonNew.json", function(data_MiB) {
// Once we get a response, send the data.features object to the createFeatures function
cons... | true |
a4ad01fc01b54a74ea77f6f8b0e359962c75227d | JavaScript | eric-wang/dojo-todo-app | /views/utils/utils.js | UTF-8 | 1,023 | 2.65625 | 3 | [
"BSD-3-Clause",
"AFL-2.1"
] | permissive | define(["dojo/dom", "dojo/_base/connect", "dijit/registry"], function(dom, connect, registry){
var _getListItemByIndex = function(widget, index){
var children = widget.domNode.children;
var list = [];
//get all list items
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child.node... | true |
b64bd242c6c10106f76c2e0d09d2e9c8db5b75c4 | JavaScript | wiss1php2014/wiss1 | /app/webroot/js/front/invtrust/description/invTrustCalendarCom.js | UTF-8 | 746 | 3 | 3 | [] | no_license | // カレンダー生成処理メソッド
function calendarInit() {
// 表示対象の年
var year = $('[name=registerYear]').val();
// 休日データ(JSON形式)の格納先を取得
var $dateInput = $('#jsonDate');
// JSON形式のデータからJavaScriptオブジェクトに変換
var dateMap = parseJson($dateInput.val());
// 入力種別の読み込み
var inputType = $('#inputType').val();
// 休日データが更新された時の処理
var ... | true |
bc9e2db19a688d6bf785e0bf0637c13032a910a0 | JavaScript | bohandley/vending-machine-js | /coin.js | UTF-8 | 229 | 2.75 | 3 | [
"MIT"
] | permissive | var Coin = function(args) {
this.name = args.name;
this.size = args.name.length;
this.weight = args.name.split('').map(function(x) { return x.charCodeAt(); }).reduce(function(a,b) { return a+b; });
this.value = '';
};
| true |
cdb733a24ba6b848c369bda97d84d8ad009ff878 | JavaScript | ccjoness/CG_StudentWork | /Juan/Exercises/Week6/roll_dice/js/main.js | UTF-8 | 2,306 | 4.53125 | 5 | [] | no_license | /* I will need:
- An event listener to detect a button click
- A function that generates an array of random numbers
- A function that creates an html element for each random number
*/
// input validator
function validator(num_rolls) {
// check to make sure input can be interpreted as a positive integer
if (parseI... | true |
e0fd6915902425e0fe3b9985dbb6866f2aa56461 | JavaScript | achuth10/achuth10.github.io | /src/app.js | UTF-8 | 313 | 3 | 3 | [] | no_license | console.log("App.js is running");
const incCount = ()=> {count+=1;console.log(count)}
let count = 0;
let template = (
<div>
<p>{count} </p>
<button onClick = {incCount}>Click me now!</button>
</div>
);
let appRoot = document.getElementById("app")
ReactDOM.render(template, appRoot); | true |
77ddba4ad40fcfe3a6e6e547e2211d01970d9444 | JavaScript | chriskelsey/employee-directory | /src/components/EmployeeContainer/index.js | UTF-8 | 2,359 | 2.75 | 3 | [] | no_license | import React, { Component } from 'react';
import API from '../../utils/API.js';
import Table from '../Table';
import Searchbox from '../Searchbox';
class EmployeeContainer extends Component{
state = {
employees:[],
result: "",
}
componentDidMount(){
this.getEmployees();
}
... | true |
50c9bc939b8e0e35ac3ae58fe45269a935c8dfa6 | JavaScript | JBeard1981/webfund | /Old Assignments/Expressions_Personal/js/script.js | UTF-8 | 2,347 | 4.15625 | 4 | [] | no_license | // Jonathan Beard, Expressions assignment part 1 "Personal" date completed Thursday, January 16, 2014
// This section lets pops up an allert to let you know what is going on in this portion of the assignment //
alert ("In this portion of the assignment we are to use javascrypt to create \nsomething that relates specif... | true |
4e564c58a286197ff2ba96974dfca38c60b32737 | JavaScript | phamphanbang/RGT-webbase | /JS/ProductPageController.js | UTF-8 | 3,628 | 2.6875 | 3 | [] | no_license | var item = {};
var id = sessionStorage.getItem("curent-id");
let renderProduct = () => {
fetch('http://localhost:3000/product')
.then(response => {
if(!response.ok){
throw Error('ERROR');
}
return response.json();
})
.then(data => {
console.log(data);
... | true |
7fc6d3843fa594e9512bc0398d085709f2ed6816 | JavaScript | jiangshuai/xingguapp | /src/libs/fileUpload.js | UTF-8 | 3,832 | 2.6875 | 3 | [
"MIT"
] | permissive | window.fileUpload = (function() {
function fileUpload(option) {
var uploadUrl;
if (option && option.url && option.url != "") {
uploadUrl = option.url
} else {
console.error("upload url undefined");
return
}
var FileList = [];
if (o... | true |
11f641115d80a3c196992eb44fa395fe4238aebc | JavaScript | withKumar/backend | /main.js | UTF-8 | 1,606 | 3.015625 | 3 | [] | no_license | $(document).ready(()=> {
console.log('Document Loaded');
//Way 1 -> to binding an Event using Selecctor
$('#mid_div').bind("click", function(e) {
console.log(e);
var value = $('#input1').val();
console.log(value);
})
var user;
var pass;
$('#auth').bind('click', () ... | true |
bbd3d96f3a9b4f83b42baed01493c4c0f85f747f | JavaScript | Bizoguc/final | /js/manageActivity.js | UTF-8 | 1,059 | 2.609375 | 3 | [
"MIT"
] | permissive |
$(document).ready(function () {
$("#activity").change(function () {
var id = $(this).val();
console.log('Activity', id);
$.ajax({
url: "getActivity.php",
type: 'POST',
data: { activityId: id } //activityId ชื่อค่า : id value... | true |
4a029e1162757f1ab7c7221b768414893ae9d41e | JavaScript | joshuahamlet/whatdoyouwannaread | /src/contexts/authContext.js | UTF-8 | 597 | 2.546875 | 3 | [] | no_license | import React, {createContext, useEffect, useState} from 'react'
export const AuthContext = createContext()
const AuthContextProvider = (props) => {
const localData = localStorage.getItem('accessToken')
const [authState, setAuthState] = useState(localData)
useEffect(() => {
localStorage.setI... | true |
cfc97e873359b999352bf833dc267f423a7c68b7 | JavaScript | laurenthiasherly/1950-final | /scripts/menu.js | UTF-8 | 1,735 | 2.625 | 3 | [] | no_license |
$(document).ready(function(){
$( "#hamburger" ).click(function() {
$( "nav" ).toggle();
});
$( window ).resize(function() {
if($( window ).width() > 768 || $( document ).width() > 768){
$( "nav" ).css("display", "block");
}
else{
$( "nav" ).css("display", "none");
}
});
$("#sc... | true |
e29b8b9311add9da1edd730f054affd60e68dd00 | JavaScript | DannyLeiton/MongoDBx-Class | /3 - Node REST APIs with Express/3-examples/test.js | UTF-8 | 3,991 | 3.359375 | 3 | [] | no_license | var app = require('./server');
var assert = require('assert');
var superagent = require('superagent');
describe('server', function() {
var server;
beforeEach(function() {
server = app().listen(3005);
});
afterEach(function() {
server.close();
});
it('prints out "Hello, world" when user goes to /... | true |
dcc09cb16bd3fabd0b2dbf70f97025ca9d5f95da | JavaScript | rodrigodata/iforgot | /app/controllers/servico/Servico.js | UTF-8 | 622 | 2.8125 | 3 | [] | no_license | /* Importação de dependencias */
const Mongoose = require("mongoose");
/* Importação Models */
const Servico = Mongoose.model("Servico");
/* Controller responsável pela criação de novos serviços em que possa ser gerado um */
exports.criar = function(req, res, next) {
let body = req.body;
if (!body.nome)
retu... | true |
91ef599e596d99c1779e8098dde5d066ad3068ad | JavaScript | chunkzer/hook-fiesta | /src/components/StateTester.jsx | UTF-8 | 1,426 | 2.953125 | 3 | [] | no_license | import React, { useState } from 'react';
const initialTodos = [
{
id: 'a',
task: 'Learn React',
complete: true,
},
{
id: 'b',
task: 'Learn Firebase',
complete: true,
},
{
id: 'c',
task: 'Learn GraphQL',
complete: false,
},
];
const StateTester = () => {
const [inputVa... | true |
742f156f1aba0d54b9ae6eb1c5bf2ddfc30a5d53 | JavaScript | CallMeSahu/build-exercises | /strings.js | UTF-8 | 4,925 | 4.28125 | 4 | [] | no_license | /*//Convert to UpperCase
var str = "siddhartha";
str = str.toUpperCase();
console.log(str);*/
//Join two strings
function joinStrings(str1, str2){
return str1.concat(str2);
}
//Count number of characters
function countCharacters(str){
var count = 0;
for(var i=0; i<str.length; i++){
if(str.charAt(i) != " "){... | true |
e9966ef9b397304cdcef7ab2cc205eb0c8b12cb0 | JavaScript | TheNewbieCO/primerSketch | /script.js | UTF-8 | 992 | 2.890625 | 3 | [] | no_license | //animation
const card = document.querySelector('.card');
const container = document.querySelector('.container');
const butt = document.querySelector('.comprabtn');
const bridge = document.querySelector('.bridge img');
const title = document.querySelector('.info h1');
//evento: movimiento de mouse
container.addEventL... | true |
6df518e907db17f0b458a7c547d0056d712e399c | JavaScript | joshthecoder/firmata-http | /firmata-http.js | UTF-8 | 4,075 | 2.984375 | 3 | [
"MIT"
] | permissive | var events = require('events'),
util = require('util');
var express = require('express'),
firmata = require('firmata');
var app = express();
app.configure(function(){
app.set('port', process.env.PORT || 8080);
});
// -- Channels --
// Channels provide a way for clients
// to consume pin data on a dedicate... | true |
a10226ef88169c0844a0dd82dab3b8cb50013cb8 | JavaScript | Aliszl/Sprint-Challenge-Advanced-React | /womens-world-cup/src/components/Worldcupdata.jsx | UTF-8 | 1,942 | 2.859375 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import axios from "axios";
import styled from "styled-components";
// import Card from "./Card";
const DivStyled = styled.div`
border: 1px solid red;
margin: 20px 20px;
padding: 20px 20px;
.list {
margin: 10px;
}
`;
export default class WorldcupData e... | true |
cd5333f37ededafd18714811f27f3c8553ed293f | JavaScript | sacken0923/team_c_57 | /app/assets/javascripts/select_2.js | UTF-8 | 271 | 2.53125 | 3 | [] | no_license | $(function(){
$("#delivery").on("change",function(){
$("#shipping_method").removeClass("method");
var deliveryselect = document.getElementById("item_delivery").value;
if (deliveryselect === '')
$("#shipping_method").addClass("method");
});
}); | true |
f2cf683dcb7cee94bf8fc227e8fcb9349c969788 | JavaScript | Yatoom/yatoom.github.io | /yawl-viewer/js/drawer.js | UTF-8 | 1,192 | 2.5625 | 3 | [] | no_license | var drawer = new function drawer() {
this.draw = function(net, canvas) {
net = $(net)
var bounds = _getBounds(net)
console.log(bounds)
}
this.createCanvas = function(net, target) {
var $target = $(target)
var bounds = _getBounds(net)
var canvas = sprintf("<canvas width='%(w)dpx' height='%(h)dpx'></canv... | true |
f4045db8acef1571f37f5afff532599513b04331 | JavaScript | MrTrick/connect4 | /lib/game.js | UTF-8 | 2,496 | 3.53125 | 4 | [
"MIT"
] | permissive | //Represents and encapsulates the game itself - the players and the board state
'use strict';
const assert = require('assert').strict;
const EventEmitter = require('events');
const State = require('./state');
const Player = require('./player');
/**
* Game Controller
*
* Contains:
* - The game state
* - The pl... | true |
c1ce1aaeafa8f489046dce8cd6605712dc5ac082 | JavaScript | msd495/React-Topic-wise | /src/useCustomHook.jsx | UTF-8 | 219 | 2.53125 | 3 | [] | no_license | import React from 'react';
const useCustomHook = (count) => {
React.useEffect(()=> {
alert('I am clicked');
document.title = `you clicked me ${count} times`;
})
}
export default useCustomHook; | true |
dab83ae2690569d8710f1a27a3bda522c6b3b253 | JavaScript | AbhishekNairOfficial/northstar | /src/components/goalListingComponents/goalTemplate.js | UTF-8 | 3,128 | 2.609375 | 3 | [] | no_license | import React, { Component } from 'react';
import { Text, View, TouchableOpacity, Image } from 'react-native';
import ProgressCircle from 'react-native-progress-circle';
import moment from 'moment';
import FilledIcon from "../../../images/filled.png";
import HighImpactIcon from "../../../images/highImpact.png";
class G... | true |
7f0c1eb8cfe29babd367f6dd85c5f1021e83d8b8 | JavaScript | jshbrntt/sierpinski | /src/core/services/index.js | UTF-8 | 362 | 2.640625 | 3 | [] | no_license | export default class Services {
static provide (name, service) {
if (!this._services) {
this._services = new Map()
}
this._services.set(name, service)
}
static locate (name) {
if (this._services.has(name)) {
return this._services.get(name)
} else {
throw new ReferenceError(`S... | true |
8491be2e55ae61881acdd1c8e44438b037bffbd2 | JavaScript | meeksfred/random-practice-problems | /min-max.js | UTF-8 | 640 | 4.125 | 4 | [] | no_license | 'use strict';
// Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers.
let exampleArray = [4, 2, 34, 22, 12];
function minMax(ar... | true |
50f1b4fefe552866b69a796236cf73d34b0b090e | JavaScript | togetherworks/iKBS | /WebRoot/scripts/menuExpandable.js | UTF-8 | 2,503 | 2.796875 | 3 | [] | no_license | /*
* menuExpandable2.js - implements an expandable menu based on a HTML list
* Author: Dave Lindquist (dave@gazingus.org)
*/
if (!document.getElementById)
document.getElementById = function() { return null; }
function isExpanded(menuId) {
var cookieName = window.location.pathname + "=";
var r... | true |
3dfdc38307462124da7c09c94c75e8bdc11fb917 | JavaScript | dheerajaraj/foodDeliveryApp | /appeng/src/AppPart1.js | UTF-8 | 2,842 | 2.515625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import ReactDOM from "react-dom";
import axios from "axios";
import "./index.css";
import loginService from "./service/loginService";
import LoginForm from "./components/LoginForm";
import BlogForm from "./components/BlogForm";
import TogglableButton from "./component... | true |
b6d681b8add254f9b1b49f72694386a4a0770d1e | JavaScript | rado08271/isitkeyword | /src/App.js | UTF-8 | 1,557 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import SearchBar from './components/SearchBar';
import './components/faLib';
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import './components/faLib'
class App extends Component {
constructor(props){
super(props);
th... | true |
8ce4f36c59ee2a6e624a6762307908976cb3a086 | JavaScript | shamlisampla/webproject | /FinalProjectWebDev/js/slideShow.js | UTF-8 | 1,894 | 2.8125 | 3 | [] | no_license |
document.getElementById("app").innerHTML = `
<div class='wrapper'>
<div class='view'>
<div class='left'><</div>
<div class='right'>></div>
</div>
<div class='buttons'>
</div>
</div>
`;
const images = [
"https://images.all-free-download.com/images/graphiclarge/canoe_water_nature_221611... | true |
281820cebce0054e6ec5976f9f52dfb8d658bb2e | JavaScript | eliasjames/load_test | /test_spec.js | UTF-8 | 755 | 2.765625 | 3 | [] | no_license | var loadTester = require('./loadTester');
var config = require('./config');
// solves error caused by self-signed https cert
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
var user_name_num = 0;
function oneUserCycle(user_name_num) {
var user_name_num_padded = padWithZeroes(user_name_num, 4);
//console.log(user... | true |
4b3f153190d529d719dea9f3c22070d3e8f2df44 | JavaScript | alastairkitchen/studio-ghibli-react-app | /src/js/components/full-info-panel/full-info-panel.js | UTF-8 | 1,177 | 2.609375 | 3 | [] | no_license | import React from "react";
// Owned imports
import FilmPanelContent from "./film-panel-content";
import PersonPanelContent from "./person-panel-content";
class FullInfoPanel extends React.Component {
constructor(props) {
super(props);
this.characterNumberText = this.characterNumberText.bind(this);
this.... | true |
0cf55113822f248668377541f36df3e4bafc68c8 | JavaScript | adriansilisque/js-largest-prime-factor | /scripts/LPFCalculator.js | UTF-8 | 780 | 3.234375 | 3 | [] | no_license | function largestPrimeFactor(n) {
if (n % 2 == 0){
var lastFactor = 2;
n=n/2;
while (n % 2 == 0){
n=n/2; }
}else{
lastFactor =1;}
factor = 3;
maxFactor = Math.sqrt(n);
while ((n > 1) && (factor<=maxFactor)){
if (n % factor == 0){
n=n/factor
l... | true |
d154302100ca0dcd60658d844b4ac9abf84e6404 | JavaScript | sebascrosta/curso | /React/exchange/app/index_exchange.js | UTF-8 | 1,951 | 2.84375 | 3 | [] | no_license | import React, {Component, PropTypes} from 'react';
import ReactDOM from 'react-dom';
const node = document.getElementById('content');
class SimpleApp extends Component {
constructor(props) {
super(props)
this.state = {
rates: [],
error: '',
isLoading: true
... | true |
ff08254441bff25dd41a691ba37c7545c43e6723 | JavaScript | akira86071/Y | /my-app/src/App.js | UTF-8 | 1,128 | 2.59375 | 3 | [] | no_license | import React from 'react';
import logo from './logo.svg';
import './App.css';
import { render } from 'react-dom';
function App() {
let a = Promise.resolve(getdata());
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
... | true |
e8f3d5b0f263b738bc7bc061c31a6f82c383e393 | JavaScript | yifoo/Node | /Demo-core/demo00_http.js | UTF-8 | 1,538 | 2.890625 | 3 | [] | no_license | const http=require('http');
const fs=require('fs');
let server=http.createServer(function(req,res){
res.writeHead(200, {'Content-Type':'text/html;charset=UTF-8'});
if(req.url=='/index'){
res.write('<h1>这是首页</h1>')
}else if(req.url=='/user/login'){
res.write('<h1>这是登录页</h1>')
}else if(req.url=='/user/reg... | true |
705df7da23611aed4b265727b73e2f6b3b500289 | JavaScript | HarolG/komatsu | /js/informe.js | UTF-8 | 3,774 | 2.921875 | 3 | [] | no_license | $(document).ready(function () {
lista_informe()
function lista_informe(){
$.get("../php/informe.php",
function (response) {
const tasks = JSON.parse(response)
let template = '';
let template2 = '';
tasks.forEach(informe => {
... | true |
9bc68795a11f68a1006c9002307532d6d1a097ea | JavaScript | ruk-na-Ziddi/XYZ | /practice1/guess.js | UTF-8 | 2,307 | 3.421875 | 3 | [] | no_license | var min=0;
var max=1000;
var attempts=8;
var valueOfButton=function(id){
var input= document.getElementById('itsInput');
input.value=input.value+id;
}
var getRandomInt=function(){
var num=Math.floor(Math.random()*(max-min))+min;
return num;
}
var generatedNum=getRandomInt();
var reload=function(){
document.... | true |
9509beccb1ef0a76c6d5c8ac69d303f45a32835b | JavaScript | jessmcdonald/currency-converter | /src/App.js | UTF-8 | 708 | 2.546875 | 3 | [] | no_license | import React from "react";
import "./App.css";
import Converter from "./components/converter/Converter";
import History from "./components/history/History";
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
history: [],
};
}
addItemToHistory = (newitem) => ... | true |
ed83b7401312b42c295648b7fa1e515757862999 | JavaScript | pizza-is-life/todo-list | /assets/js/scripts.js | UTF-8 | 867 | 3.046875 | 3 | [] | no_license | $(document).ready(function() {
// Check off specific todos by clicking li
$("ul").on("click", "li", function() {
$(this).toggleClass("completed");
});
// Delete todos by clicking X
$("ul").on("click", "span", function(event) {
$(this).parent().fadeOut(500, function() {
$(this).remove();
})... | true |
a2e2dbdaf329651721278cde4eb250d4431c05be | JavaScript | KBerndt10/kyle-berndt-prework | /JavaScript_Basics_Assessment/activity-1.js | UTF-8 | 392 | 3.40625 | 3 | [] | no_license | const product = 9 * 9;
const quotient = 56 / 12;
const remainder = 281 % 9;
const inf = 18 / 0;
const concat = '56' + '92';
const falseBool = 42 >= 52;
console.log(`9 * 9 = ${product}`);
console.log(`56 / 12 = ${quotient}`);
console.log(`281 % 9 = ${remainder}`);
console.log(`18 / 0 = ${inf}`);
console.log(... | true |
7268b69df972f74afe291b5f6272e043ea381f53 | JavaScript | luyongzhao/reframe | /utils/wxWrapper.js | UTF-8 | 3,065 | 2.65625 | 3 | [] | no_license | function showToast(errMsg) {
wx.showToast({
title: errMsg,
icon: 'none',
duration: 3000
})
}
function get(url, data, succ, error){
//加载等待
wx.showLoading({
title: '加载中...',
mask: true
})
//网络请求
var requestTask = wx.request({
url: baseUrl+url,
data: data,
method: "get",
... | true |
7eb27196c2767bec61c30304ead9f9730f0daf14 | JavaScript | konarssuresh/burger_react | /src/store/reducers/order.js | UTF-8 | 1,218 | 2.59375 | 3 | [] | no_license | import * as actionTypes from '../actions/actionTypes';
const initialValue={
orders:[],
loading:false,
purchased:false
}
export const reducer=(state=initialValue,action)=>{
switch(action.type){
case actionTypes.FETCH_ORDER_START:
return{
...state,
lo... | true |
c36acc355240e5d6e64f9fa870dd9a2db536de0f | JavaScript | tbris/tic-tac-toe | /js/dom.js | UTF-8 | 4,384 | 2.53125 | 3 | [
"MIT"
] | permissive | "use strict"
const dom = (function(doc) {
let container = doc.querySelector("#current");
let grid = doc.querySelector(".grid");
let turn = doc.querySelector("#turn");
let msgCont = doc.querySelector("#msg");
let autoMode = false;
let darkMode = false;
let finished = true;
let currentPlayer = "O";
... | true |
c5967667aaa2948451042bbef853b13324df4f92 | JavaScript | jmneutel/wexler-questions | /Quiz-program/public/assets/javascript/logic.js | UTF-8 | 10,725 | 3.046875 | 3 | [] | no_license | var counter = 0;
var database = firebase.database();
// Append text to the DOM
function append_text(txt)
{
var docbody=document.getElementsByTagName("body")[0];
docbody.appendChild(document.createTextNode(txt));
docbody.appendChild(document.createElement("br"));
}
// Append row data to a row
function ap... | true |
d3373aa935be7fae358ad6dc39eb08c24db0c4b7 | JavaScript | qaz734913414/Speech-Nodes | /speech/read-file.js | UTF-8 | 963 | 2.75 | 3 | [] | no_license | /*
*本节点用于测试语音识别和语音合成节点
*语音数据通过my_msg.audio_len和my_msg.audio_data传递给语音识别节点
*文本数据通过my_msg.text传递给语音合成节点
*/
module.exports = function(RED) {
var fs = require('fs');
var file_name = 'text_to_speech_result.pcm';//需要读取的音频文件
var my_msg = new Object();
var node
function ReadFile(config) {
RED.nodes.c... | true |
742d985a17cc6a8ec4c0acfccdc2c2538cda9bd2 | JavaScript | battez/d3a | /scripts/main.js | UTF-8 | 11,449 | 2.953125 | 3 | [] | no_license |
/*
JL Barker
1: wrote a D3 program that consumes the feed
2: draws a map of the UK
3: Plots the towns form the feed on the map
4: You can use any details in the feed to enhance the map.
*/
var debugMode = (window.location.hash !== "#debug") ? false : true;
var amount = debugMode ? 20 : document.getElementById... | true |
8a24a782f4b9168b7f8e8abcfbfadf7029c206e9 | JavaScript | MrKaKaluote/study | /excess/javascript/leetcode/连续的子数组和/index.js | UTF-8 | 1,298 | 3.375 | 3 | [] | no_license | /*
* @Description: https://leetcode-cn.com/problems/continuous-subarray-sum/
* @Autor: ruyun
* @Date: 2021-06-03 10:17:10
* @LastEditors: ruyun
* @LastEditTime: 2021-06-03 10:20:19
*/
/**
* @param {number[]} nums
* @param {number} k
* @return {boolean}
*/
var checkSubarraySum = function(nums, k) {
let ma... | true |
926361425ce0daaed5f209ea5bb4db38a2b2270b | JavaScript | TeamHowler/altitude-apparel | /client/ProductOverview/Size.jsx | UTF-8 | 2,075 | 2.546875 | 3 | [] | no_license | /* eslint-disable guard-for-in */
import React, {useContext} from 'react';
import {ProductContext} from '../context.js';
import {Col, Row} from 'react-bootstrap';
function Size() {
const {currentStyle, currentSize, updateSize} =
useContext(ProductContext);
const skuArr = [];
const quantArr = [];
if (curr... | true |
d58734ad1c7589bc054ee33b30fd71a7fe6f0f24 | JavaScript | aparna0003/aparna0003 | /sketches/p5/p5/webcam.js | UTF-8 | 441 | 2.78125 | 3 | [] | no_license | let video;
let button;
function takesnap()
{
image(video,0,0);
ellipse(5,10,10,10)
}
function setup() {
createCanvas(200, 200);
background(51);
video= createCapture(VIDEO);
video.size(200,200);
fill(120,70,30);
button = createButton('SNAP');
button.mousePressed(takesnap);
// ellipse(5,10,10,10)
}
/... | true |
2f5c1e3b4b18c44c38d53b0825c8dfa1cd245b1b | JavaScript | duchuytran943/note-ECMAScript-Advanced-Example | /method-overriding.js | UTF-8 | 398 | 3.5 | 4 | [] | no_license | /**
* methods-overriding
*/
class CoffeeMachine {
makeCoffee() {
console.log("making coffee...");
}
}
class SpecialCoffeeMachine extends CoffeeMachine {
makeCoffee(cbFunc) {
console.log("making spectial coffee and do somethings...");
cbFunc();
}
}
const coffeeMachine = new SpecialCoffeeMachine();
... | true |
84c28685f551c28c4c43fd49d9d131fedb49779a | JavaScript | celelstine/codingProblemSolutions | /CDS_65_print_matrix_clockwise.js | UTF-8 | 2,012 | 4.3125 | 4 | [
"MIT"
] | permissive | function popRow(matrix, rowIndex, start_column, end_column, direction = 1) {
if (direction === 1) {
for (var i = start_column; i <= end_column; i++) {
console.log(matrix[rowIndex][i]);
}
} else {
for (var i = start_column; i >= end_column; i--) {
console.log(matrix[rowIndex][i]);
}
}
... | true |
55ddca62cac0b31acfbda08bcf4f08d54e87c839 | JavaScript | timurkalimullin/basic-js | /src/extended-repeater.js | UTF-8 | 742 | 3.125 | 3 | [
"MIT"
] | permissive | module.exports = function repeater(str,{repeatTimes, separator = "+", addition, additionRepeatTimes, additionSeparator = "|"}){
let addBlock = [],
finalBlock = [];
if (String(addition).length>0) {
if (additionRepeatTimes>0) {
while (additionRepeatTimes) {
addBlo... | true |
5177b3b254a8625d0066e5b00feb55a4f5cc5031 | JavaScript | felipandrade/launchbase | /1.challenges/1.introduction-to-web/challenge-1.3/2.search-for-technology.js | UTF-8 | 594 | 3.40625 | 3 | [
"MIT"
] | permissive | const users = [
{ name: "Carlos", technologies: ["HTML", "CSS"] },
{ name: "Jasmine", technologies: ["JavaScript", "CSS"] },
{ name: "Tuane", technologies: ["HTML", "Node.js"] }
];
function checkUserUseCss(user) {
for( let technologie of user.technologies ) {
const userUseCss = technologie === ... | true |
25c783273f8143236a9d32fe6a6ed154c7dd084d | JavaScript | thatkaiguy/AppAcademy | /Week6/w6d1/Asteroids/lib/gameView.js | UTF-8 | 834 | 2.8125 | 3 | [] | no_license | (function() {
var Asteroids = window.Asteroids = window.Asteroids || {};
var GameView = Asteroids.GameView = function(game, ctx) {
this.game = game;
this.ctx = ctx.getContext("2d");
};
GameView.prototype.start = function () {
var game = this.game;
var ctx = this.ctx;
this... | true |
547a8929c83327acdae37a6cfc6f8c707d85899e | JavaScript | khan4019/advJSDebug | /scripts/promiseDemo.js | UTF-8 | 2,984 | 3.234375 | 3 | [
"MIT"
] | permissive | var fakeSlowNetwork;
(function() {
var lsKey = 'fake-slow-network';
var networkFakeDiv = document.querySelector('.network-fake');
var checkbox = networkFakeDiv.querySelector('input');
fakeSlowNetwork = Number(localStorage.getItem(lsKey)) || 1;
networkFakeDiv.style.display = 'block';
checkbox.checked = !!... | true |
36929e90b658ec414d69f2892e9e2d441dec98f5 | JavaScript | jtefera/node_learning_examples | /06_files/appendData.js | UTF-8 | 469 | 3.53125 | 4 | [] | no_license | //appendData.js
//Cada vez que se llama a este archivo,
//añade al final del texto la fecha a la que se hizo
//Modulo fs para tratar con archivos
var fs = require("fs");
var filepath = "appending.txt";
//Tiempo actual más salto de linea
var textToAppend = Date() + "\r\n";
//appendFile, añade textToAppend al final d... | true |
0ffc20d224469b81092250c9406a8119d1ce95a7 | JavaScript | brandonsargent/brandonsargent.github.io | /js/main.js | UTF-8 | 259 | 2.5625 | 3 | [] | no_license | var teaser = false;
$("document").ready(function(){
if (teaser == true)
{
// open teaser website
window.open("templates/teaser.html", "_self");
}
else
{
// open regular website
window.open("templates/home.html", "_self");
}
});
| true |
a4f416367246e0d5fef5756c5757802adeedf9dd | JavaScript | Vinit453/schoolbackend2 | /services/schoolService.js | UTF-8 | 2,703 | 2.640625 | 3 | [] | no_license | var appRoot = require('app-root-path');
var con = require(appRoot + '/services/connectionService');
exports.getSchools = function (queryString, callback) {
var sql = "select * from tbl_school";
con.query(sql, function (err, result) {
if (err) {
callback(null, err);
return;
... | true |
7ee925e213b317af4bc3acb47aa639cc238c58ae | JavaScript | mitchelkuijpers/ajxr | /test/ajxrTest.js | UTF-8 | 1,995 | 2.53125 | 3 | [
"MIT"
] | permissive | describe('ajxr', function() {
// Fix Sinon bug when using 'FakeXMLHttpRequest' in Node
// https://github.com/cjohansen/Sinon.JS/issues/319
if (navigator.userAgent.indexOf('PhantomJS') !== -1){
window.ProgressEvent = function (type, params) {
params = params || {};
this.lengthComputable = params.l... | true |
3879677b6f2b30f4fc0f2d90bbe863b0316be0a4 | JavaScript | GaianiMagali/Photogram-Backend | /server/src/middleware/auth.js | UTF-8 | 705 | 2.546875 | 3 | [] | no_license | const jwt = require("jsonwebtoken");
module.exports = (req, res, next) => {
const authHeader = req.headers.authorization;
if (!authHeader) return res.status(401).send({ error: "No autorizado" });
const parts = authHeader.split(" ");
if (parts.length !== 2)
return res.status(401).send({ e... | true |
4290ec338298b26b7b93f2bd53beb9a4f6f25e6c | JavaScript | kapil125/rps | /app.js | UTF-8 | 3,500 | 3.75 | 4 | [] | no_license | const playerImg = document.getElementById("plyr-img");
const computerImg = document.getElementById("comp-img");
const rockSelected = document.getElementById("rock");
const paperSelected = document.getElementById("paper");
const scissorsSelected = document.getElementById("scissors");
const won = document.getElement... | true |
1d70b97ff4fc6f22a5b6d19bc903cc67e7fa9c06 | JavaScript | palak-sethi/CodeDecode | /js/main.js | UTF-8 | 2,274 | 3.390625 | 3 | [] | no_license | function showCode() {
document.getElementById('code').style.display = "block";
document.getElementById('codeBtn').style.display = "none";
}
function showDecode() {
document.getElementById('decode').style.display = "block";
document.getElementById('decodeBtn').style.display = "none";
}
function code1... | true |
423df7c7d548a3f3f93d349b19ca2bd9372ff501 | JavaScript | remusao/pbot | /content_scripts/find_candidates.js | UTF-8 | 2,262 | 2.703125 | 3 | [] | no_license | const { parse } = require('tldjs');
// cached regex case insensitive (crci)
const KEYWORDS = [
new RegExp('privacy', 'i'),
new RegExp('datenschutz', 'i'),
new RegExp('Конфиденциальность', 'i'),
new RegExp('Приватность', 'i'),
new RegExp('тайность', 'i'),
new RegExp('隐私', 'i'),
new RegExp('... | true |
373a15a55a2dfe8fb8c1ba6ee4127a53a162f2df | JavaScript | pauladarias/users_API | /user.js | UTF-8 | 5,947 | 2.953125 | 3 | [] | no_license | // function fetchData() {
// fetch("http://35.178.207.61:8080/pubmate/api/0.1/user/1")
// .then(response => {
// console.log(response)
// if (!response.ok) {
// throw Error("ERROR")
// }
// return response.json()
// }).then(data => {
// console.log(data.username)
// // mapping over (... | true |
f76c9a0eb6775f098285aaf13c63d3381bde1020 | JavaScript | brandon1011/vaxx-pass-web | /src/components/User/index.js | UTF-8 | 2,065 | 2.5625 | 3 | [] | no_license | import React, { useState, useEffect, useRef } from 'react';
import QRCode from 'qrcode';
import './style.css';
import VerifiedImage from '../../assets/images/verified.png';
import UnverifiedImage from '../../assets/images/unverified.png';
export default function User(props) {
const [user, setUser] = useState(null)... | true |
73db3ebec9e368228be795363528a7dccae04d86 | JavaScript | givedirectly/Google-Partnership | /docs/import/manage_disaster_add_delete.js | UTF-8 | 7,013 | 2.546875 | 3 | [
"MIT"
] | permissive | import {eeLegacyPathPrefix, legacyStateDir} from '../ee_paths.js';
import {showError} from '../error.js';
import {disasterCollectionReference} from '../firestore_document.js';
import {createDisasterData} from './create_disaster_lib.js';
import {setStatus} from './create_score_asset.js';
import {createOptionFrom} from ... | true |
d6732e9e054479ef999ea4678b8be79aa93a0f18 | JavaScript | zhangjianhaoww/blog | /target/myblog/resources/js/adminindex.js | UTF-8 | 1,691 | 2.546875 | 3 | [] | no_license | $(function () {
var url = "/myblog/admin/admininitinfo";
var articlePage = 1;
var articleType = null;
var pageCount = 1;
$("#buttonfull").click();
getAdminInitInfo(articlePage, articleType);
function getAdminInitInfo(articlePage, articleType) {
$.getJSON(url,
{
... | true |
085a25db36de640040b06187b683335026570044 | JavaScript | joewickes/playstore-practice-express | /app.js | UTF-8 | 2,156 | 3.125 | 3 | [] | no_license | const express = require('express');
const morgan = require('morgan');
// Data from Thinkful
const apps = require('./apps.json');
const app = express();
app.use(morgan('dev'));
app.get('/apps', (req, res) => {
// Sort the list by either rating or app, any other value results in an error, if no value provided do not ... | true |
feb711d273682f35d689f2de52ef2b68fe3edc0d | JavaScript | szolotukhin-language/js-webpack | /server.js | UTF-8 | 357 | 2.609375 | 3 | [] | no_license | const express = require("express")
const app = express()
app.get('/api/users', (req, res) =>
// res.send("HELLO FROM EXPRESS 22")
res.json([
{username: 'Serhij Zolotukhin 1'},
{username: 'Serhij Zolotukhin 2'},
{username: 'Serhij Zolotukhin 3'}
]
)
);
app.listen... | true |
10b9b7266a8cffd3f7e6714c9972c79d93389759 | JavaScript | haiitk14/react_online_shop | /src/reducers/categorys.js | UTF-8 | 1,734 | 2.796875 | 3 | [] | no_license | import * as Types from './../constants/ActionTypes';
var initialState = [];
const categorys = (state = initialState, action) => {
var { categorys, category } = action;
switch (action.type) {
case Types.GET_CATEGORYS:
state = categorys;
return [...state];
case Types.POST_... | true |
76aab89743a9bda930876c327eb3ebe51b0d363b | JavaScript | MikeMurrayDev/react100-change-calculator | /src/js/app.jsx | UTF-8 | 9,432 | 2.890625 | 3 | [] | no_license | import React, { Component } from 'react';
import { render } from 'react-dom';
class App extends Component {
constructor(props) {
super(props);
this.state = {
amountDue: '0',
amountReceived: '0',
twenties: '0',
tens: '0',
fives: '0',
ones: '0',
quarters: '0',
di... | true |
879bf1283472d9be98362a7afb4b7e78c49007a4 | JavaScript | Codezainab/myjava | /film.js | UTF-8 | 522 | 3.171875 | 3 | [] | no_license | let film = ("kung fu hustle");
let films = ["inglorious Bastards", "matilda", "pulpfiction", "her",]
console.log("My third favourite film is " + films[2])
console.log("My second favourite film is " +films[1])
let book = ("Harry Potter");
let books = ["The Perks Of Being A Wallflower", "Lord Of The Rings", "Charlie a... | true |
e52686c33d76a633a3e68f4b9d8be8b63cfa8688 | JavaScript | crappy-coder/astrid | /src/Thread.js | UTF-8 | 575 | 2.90625 | 3 | [] | no_license | class Thread {
constructor(callback) {
this.threadCallback = callback;
this.threadTarget = null;
this.threadArgs = null;
}
getCallback() {
return this.threadCallback;
}
setCallback(value) {
this.threadCallback = value;
}
start(target) {
this.threadTarget = target;
// remove the target from the ... | true |
1ecae89ae969df259a61cfb02ae2be02a197fdaf | JavaScript | lwd6666/school | /好酷音乐网站/js/1.js | UTF-8 | 318 | 2.515625 | 3 | [] | no_license |
var t=demo.scrollWidth
demo1.innerHTML+=demo1.innerHTML
function doMarquee()
{
demo.scrollLeft=demo.scrollLeft<demo.scrollWidth-demo.offsetWidth?demo.scrollLeft+1:t-demo.offsetWidth
}
function doscroll()
{
sc=setInterval(doMarquee,20)
}
function stopscroll()
{
clearInterval(sc)
}
doscroll() ;
| true |
297cc538bdf1e751b204f0b0afdd10ef09176809 | JavaScript | Q-Jones92/Week-4-Homework | /setInterval.js | UTF-8 | 159 | 2.8125 | 3 | [] | no_license | var count = 0
var time = 1000
var intervalId = setInterval(function(){
console.log(count);
count++
if(count == 900){
clearInterval(intervalId)
}
},time)
| true |
bcd0c6ef8da7194ee6e96a3298ec42abcfd2e0b8 | JavaScript | iskonplus/js-course | /hometasks/lesson5/lesson5-app/src/App.js | UTF-8 | 2,811 | 2.625 | 3 | [] | no_license | import React from 'react';
import { LoginForm } from './components/LoginForm'
import './App.css';
// const compose = (...fns) => {
// return value => {
// let result = value;
// for (let fn of fns) {
// result = fn(result)
// }
// return result;
// }
// }
// const withValidation = (validat... | true |
e1c1faba0969f6a4a58ab2ea2d12d27dd4cdeddc | JavaScript | swtpumpkin/JavascriptAlgorithm | /Exercise/alphaString46.js | UTF-8 | 897 | 4.5625 | 5 | [] | no_license | //alphaString46 함수는 문자열 s를 매개변수로 입력받는다. s의 길이가 4 ~ 6이고, 숫자로만 구성되어 있는지 확인하는 함수를 완성하라.
function alphaString46(s) {
/* 문자열을 배열의 형태로 바꿔 4자리 이상 6자리 이하인지 확인한다.
확인 후 true이면 정규표현식을 사용하여 문자열이 숫자형인지 확인 후 맞으면 true
문자열이 숫자 이외의 다른 문자가 있으면 false를 반환한다.
if문에서 3항연산자로 변환하였다.
*/
return (s.split('').length<= 6 && s.spli... | true |
73080bc6d32b7a64717e385648a4f96a8bbe1a76 | JavaScript | relf/XDSMjs | /src/graph.js | UTF-8 | 8,756 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | var UID = "_U_";
var MULTI_TYPE = "_multi";
function Node(id, name, type) {
if (typeof (name) === 'undefined') {
name = id;
}
if (typeof (type) === 'undefined') {
type = 'analysis';
}
this.id = id;
this.name = name;
this.isMulti = (type.search(/_multi$/) >= 0);
this.type = this.isMulti ?
ty... | true |
85f177b6bfe985ce132b2d6921e4aa6ab8dd7b1e | JavaScript | sarahsponda902/volunteervoice | /public/javascripts/pagination.js | UTF-8 | 392 | 2.546875 | 3 | [] | no_license | $( function(){
//constantly looks for click changes to dom
$(".pagination a").live("click",function() {
$(".pagination").html("Page is loading...")//loading message
$.get(this.href, null, null, "script");// says that any script returned by ajax request should be executed
return... | true |
3bf154a9847a554104c3528f976979240cfc9ee8 | JavaScript | ecodolphin/i8254-Emulator | /Sources/JS/main.js | UTF-8 | 1,702 | 2.75 | 3 | [] | no_license | $(document).ready(function()
{
init();
welcome();
//test();
});
// Interaction.
var rwl = [];
var dbf = [];
var cwr = [];
// Channels.
var channels = [];
var generator = [];
// Features.
var assemblerer = [];
var tasker = [];
function init()
{
rwl = new RWL();
dbf = new DBF();
cwr = n... | true |
a3879f7f51ada7d590b4e27893a5b3c9b245c434 | JavaScript | estebandh/misy350-s18-exercises | /4-5-18/my-code.js | UTF-8 | 198 | 2.984375 | 3 | [
"MIT"
] | permissive | blist = ["end of semester", "blah blah", "blah blah blah"];
console.log(blist.length);
blist.push("more blahs");
console.log(blist);
for (i = 0; i < blist.length; i++) {
console.log(blist[i]);
}
| true |
fa5ea9bed203d5ca0889aae7cd5b2f23ef202597 | JavaScript | sandeep2007/floating-emoji | /app.js | UTF-8 | 270 | 2.71875 | 3 | [] | no_license | emojiArray = ['😀', '🥳', '😜', '❤️'];
function pushEmoji() {
$('.em-container').append(`<span class="em-node-${(Math.floor(Math.random() * 5) + 1)}">${emojiArray[(Math.floor(Math.random() * 3) + 1)]}</span>`)
}
setInterval(() => {
pushEmoji()
}, 200); | true |
cec4ec4f40c6045b1cc8939c384a8165dc27db94 | JavaScript | 5ervant/usamadaniyalxen.github.io | /envato/themeforest/aline/javascript/infiniteSlider.js | UTF-8 | 13,950 | 2.515625 | 3 | [] | no_license | /* ////////////////////////////////////////////////////////////////////////////
//
// Infinite Slider
// V 1.0
// Alexandra Nantel
// Last Update 01/11/2012 10:22
//
/////////////////////////////////////////////////////////////////////////// */
function InfiniteSlider(wrapper, speed, duration, mode, easing, hover, anim... | true |
7d0d2cc898d5ee76c70cd032389789945171d9cd | JavaScript | silverjosh90/airController | /js/logic.js | UTF-8 | 946 | 3.375 | 3 | [] | no_license | var cost = 0;
function finalCost() {
cityVal();
seatVal();
wifiVal();
bagVal();
discountVal();
total.innerHTML = '\$' + cost;
cost = 0
}
function cityVal() {
var cityChoice = Number(departures.value) + Number(arrivals.value)
switch (cityChoice) {
case 3.0:
cost += 250;
break;
cas... | true |
a4f64c3b9d48f3d71191cb854b7607e2296f9a31 | JavaScript | kunalbhoria/quick-notes.github.io | /app2.js | UTF-8 | 10,365 | 2.921875 | 3 | [] | no_license | // let newBtn = document.querySelector('#newbtn');
// let saveBtn = document.querySelector('#savebtn');
// let deleteBtn = document.querySelector('#deletebtn');
// let textBox = document.querySelector('#textBox');
// let noteBox = document.querySelector('#noteBox');
// let h = document.querySelectorAll('h4')
// l... | true |
2c28e6328792c96fc7b878f45992088caa99e7f2 | JavaScript | chaitanyaGitHub1/The-Roar | /index.js | UTF-8 | 5,200 | 2.515625 | 3 | [] | no_license | // Importing required node modules
var http = require('http');
const request = require('request');
const cheerio = require('cheerio');
const path = require('path');
var fs = require('fs');
const shell = require('shelljs');
const https = require('https');
var cron = require('node-cron');
const express = require('expres... | true |
2c77bb439456ae2b964dbb8b54c44b15fc3c4dac | JavaScript | bonbj/30DayChallengeJavaScript.github.io | /18-ReduceWithDiv/script.js | UTF-8 | 806 | 3.265625 | 3 | [] | no_license | //data time of videos
let timeNodes = Array.from(document.querySelectorAll("[data-time]"));
//total time
const seconds = timeNodes
.map(node => node.dataset.time)
.map(timeCode => {
const [mins, secs] = timeCode.split(":").map(parseFloat);
return mins * 60 + secs;
})
.reduce((total, vidSeconds) => tota... | true |
ec5e6bfa8e1d2a19ff4a9e3b7129d8b1c7df6f0f | JavaScript | Grumlen/Exercises-Java | /Eloquent/Ch10/months.js | UTF-8 | 396 | 4.0625 | 4 | [] | no_license | // Your code here.
var month = function () {
var months = ["January","February","March","April","May","June","July","August","September","October","November","December"];
return {
name: function (number) {return months[number];},
number: function (name) {return months.indexOf(name);}
}
}();
console.log(mo... | true |
d0cd381ba3d3732627c2159199691fb96819a925 | JavaScript | CarmenGarduno09/expedientes | /assets/js/comparar_val_jur.js | UTF-8 | 6,772 | 2.78125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
//Comparación 1
function obtener_informacion_mes(selectobject){
var mes = selectobject.value;
//alert ('estoy en info mes ');
var id_expediente= $.trim($('#id_exp').val());
var anio = $.trim($("#year").val());
if(anio.length == ""){
alert ('por favor elije un año y después el mes.');
... | true |
1779a3ea802b4fae000d6f200b7536434d1488d7 | JavaScript | JesusWhite97/LabSoft_Ingexis | /Interfaz/js/validaciones.js | UTF-8 | 4,632 | 3.265625 | 3 | [] | no_license | //======================================================================================================
//Función para validar una CURP La entrada tiene que ser toda en mayusculas
function curpValida(curp) {
var re = /^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HM](?:AS|B[CS]|C[CLMSH]|D[F... | true |
6abd987978b35683d507df2717f52556f662fadc | JavaScript | kornofilo/portafolio-S9 | /Codigos/bubbleSort.js | UTF-8 | 809 | 3.890625 | 4 | [
"MIT"
] | permissive | var arreglo = [2, 7, 4, 1, 5, 3];
function bubbleSort(arreglo) {
var swapped;
do {
swapped = false;
for (var i = 0; i < arreglo.length - 1; i++) {
if (arreglo[i] > arreglo[i + 1]) {
var temp = arreglo[i];
arreglo[i] = arreglo[i + 1];
... | true |
3645b791a6be8b2a593fc354b121d2ab4b635987 | JavaScript | anadoh/react_meal_finder | /src/helpers/helpers.js | UTF-8 | 526 | 2.609375 | 3 | [] | no_license | export async function searchMealFromApi(term) {
const response = await fetch(
`https://www.themealdb.com/api/json/v1/1/search.php?s=${term}`
);
if (response.status === 200) {
return response.json();
} else {
throw new Error(response);
}
}
export async function getRandomMeal() {
cons... | true |
5cb7fa2b62129ead1aab0d636f8ca0909973556f | JavaScript | moguejiofor/grape-electron | /app/src/app/ensureFocus.js | UTF-8 | 258 | 2.5625 | 3 | [] | no_license | import state from './state'
/**
* Makes sure window is in focus.
* Maximizes window if needed.
*/
export default function ensureFocus(win = state.mainWindow) {
if (!win) return false
if (win.isMinimized()) win.restore()
win.focus()
return true
}
| true |
2843bca41b10495f5add7ec2286776cbc1cf3335 | JavaScript | ShakoHo/moztrap-new-ui | /js/parser.js | UTF-8 | 3,176 | 2.578125 | 3 | [] | no_license | //TODO: replace this with jison generated parser
function tokenize(query) {
// separate qeury with space
var re_tokenize = /([^\s"']+"([^"]*)"|[^\s]+)/g;
var results = query.match(re_tokenize);
var resultList = results.map(function(result) {
var keyVal = result.split(":");
if (keyVal.length < 2) {
... | true |
f663fac2916372d4a800aba7fa8c5498dfafd25e | JavaScript | CahylA1/Kixclusive | /src/components/Main.js | UTF-8 | 1,267 | 2.8125 | 3 | [] | no_license | import { useState, useEffect } from 'react'
import { Route, Switch } from 'react-router-dom'
import Index from '../pages/Index'
import Show from '../pages/Show'
function Main(props) {
console.log("MAIN PROPS", props)
const [sneaker, setSneaker ] = useState(null);
const BASE_URL = 'http://localhost:3001/kixclus... | true |
e7f2379cda9220b98ece6bf634bf6263d791c09b | JavaScript | jstiehl/training-plan | /app/src/libs/utils.js | UTF-8 | 1,079 | 3.03125 | 3 | [] | no_license | export const dayMap = day => {
switch(day) {
case 1:
return "Monday"
case 2:
return "Tuesday"
case 3:
return "Wednesday"
case 4:
return "Thursday"
case 5:
return "Friday"
case 6:
return "Saturday"
case 0:
default:
return "Sunday"
}
}
e... | true |
a0ad25f249bd6a2a490f72560c4deaa83f1ca7fa | JavaScript | Edisonsan/typescript | /Typescript002_Decorators_Clase.js | UTF-8 | 2,463 | 2.921875 | 3 | [] | no_license | var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] =... | true |