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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c895b2987e94720fd88925bbd7e72463b7ac6776 | JavaScript | BOSEES/vocabulary_note | /자료구조/리스트/double_linked_list.js | UTF-8 | 3,996 | 3.84375 | 4 | [] | no_license | let LinkedList = function() {
let list = {};
list.length = 0;
list.head = null;
list.tail = null;
list.addToHead = function(value){
let newNode = new Node(value);
if(!list.head) { //헤드노드가 null이라면?
list.head = newNode;
list.tail = newNode;
list.length++;
} else {
let curr =... | true |
fc60af28d29d12140c8800cf4c500622318bbedd | JavaScript | lguibert/rcon-ark | /media/js/messages.js | UTF-8 | 1,149 | 2.671875 | 3 | [] | no_license | /**
* Created by Lucas on 12/05/2015.
function displayMessage(message, type){
if (message == null){
message = "Une erreur est survenue.";
}
if (type == null){
type = "error";
}
var act = $("#result-error");
var act_content = $("#result-error-content");
act.addClass(type).a... | true |
95fd14f3ec2e23702782117b1ab99d61414666b8 | JavaScript | rubiyadav18/JS-Objects-questions | /ques5.js | UTF-8 | 269 | 2.78125 | 3 | [
"MIT"
] | permissive | var readline=require("readline-sync")
var n=readline.question("enter a number--")
var d={"name":"rubi","age":"28","marks":"56"}
for (i in d){
if (i==n){
console.log("exit")
break
}
else{
console.log("not exit")
break
}
} | true |
c53918296e1438efe93b83ced3e77234b23a26c7 | JavaScript | brambleshadow4/PepBandManagerWebApp | /node/api/getEvents.js | UTF-8 | 709 | 2.765625 | 3 | [] | no_license | const sqlite3 = require('sqlite3').verbose();
exports.run = function(req, res)
{
let db = new sqlite3.Database('./db/pepband.db');
let events = [];
if (req.query.season == undefined || isNaN(Number(req.query.season)))
{
res.writeHead(400);
res.send("Must specify season as a URL parameter, e.g. getEvents.php... | true |
81e4377fe4472816f0e799d5d10ab2a15f585e28 | JavaScript | 0xc14m1z/webrtc-one-to-one | /src/client/EventsEmitter.js | UTF-8 | 473 | 2.671875 | 3 | [] | no_license | function EventsEmitter() {
this.handlers = {}
}
EventsEmitter.prototype.on = function on(event, handler) {
if ( !this.handlers[event] ) this.handlers[event] = []
this.handlers[event].push(handler)
}
EventsEmitter.prototype.emit = function emit(event, ...payload) {
const handlers = this.handlers[event] || []
... | true |
50b2d3e0543de59edfa37fe55198fd222f17576e | JavaScript | carveler/javascript | /js2/ex1.js | UTF-8 | 3,885 | 4.375 | 4 | [] | no_license | // Create a class called Vehicle
// It should have three properties. Model, colour, maxSpeed
// It should have four methods. changeColour, showColour, changeMaxSpeed and showMaxSpeed
// Create three instances of land based vehicles
// using the methods described chain the methods to change the colour, show the colour, ... | true |
c5e987bb60e4771a6d18fd137bd1322aafb3a6be | JavaScript | Remarkb/JavaScript_Hmwk | /static/js/app.js | UTF-8 | 1,223 | 3.140625 | 3 | [] | no_license | // from data.js
var tableData = data;
// YOUR CODE HERE!
// Get a reference to the table body
var tbody = d3.select("tbody");
// d3 to build out data in table
data.forEach(function(ufoReport) {
// console.log(ufoReport);
var row = tbody.append("tr");
Object.entries(ufoReport).forEach(function([key, val... | true |
fe32d7d19723a7583e700e764cbfabd7d64430ec | JavaScript | phamus/Place-sharing-backend | /src/components/places/places.controller.js | UTF-8 | 2,364 | 2.59375 | 3 | [] | no_license | const HttpError = require("../../library/helper/errorHandlers");
const uuid = require("uuid/v4");
const { validationResult } = require("express-validator");
const placeService = require("./places.services");
///////////////////////////////
///// get place by placeid ////
exports.getPlace = async (req, res, next) => {
... | true |
0c06dbde2f2c7ae19f0205b89621d7df92a527a1 | JavaScript | EDZ05/660project | /controllers/api.js | UTF-8 | 2,361 | 2.859375 | 3 | [] | no_license |
// Create a function which is a "controller", it
// handles a request, writing the response.
function api(request, response) {
var requestURL = request.url;
if (requestURL.includes("?search=")){
search(request, response)
}else{
const pg = require('pg');
const cli... | true |
2afbcf9fa2f7b76a8ea391b4c936b1201687eb3f | JavaScript | amit-sahani/songlist | /src/components/SongList.js | UTF-8 | 1,656 | 2.875 | 3 | [] | no_license | import React from 'react';
import { connect } from 'react-redux';
import { selectSong } from '../actions';
class SongList extends React.Component {
renderList(){
//here this.props.songs we are accessing only because
// connect function is getting songs from state or redux store
//using ... | true |
9b8e39ad7ba08a06281d0f1890a81beb72180835 | JavaScript | tikangcs/CREAM | /src/components/outfits/utils.jsx | UTF-8 | 1,031 | 2.765625 | 3 | [
"MIT"
] | permissive | import React from "react";
const getFeatures = (product, currentProduct) => {
const features = new Set();
for (let item of product) {
features.add(item.feature);
}
for (let item of currentProduct) {
features.add(item.feature);
}
var result = [];
for (let feature of features) {
let obj = {};
... | true |
b74b615bf7b23e98c1a8de047c9c577bd3069a39 | JavaScript | sarahabbas10/week04_day17_React | /lab1/src/index.js | UTF-8 | 1,685 | 2.640625 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import sarahPic from './sara.jpg';
//Create a JavaScript object called ‘user’ that stores all the details
// name, surname, date_of_birth, country, email, telephon... | true |
7be81555bffb8f080ba8380fcd569b1bcaf10a09 | JavaScript | zeusCore/tunk-examples | /tunk-vue/src/modules/counter.js | UTF-8 | 902 | 2.671875 | 3 | [] | no_license | import {create, action} from 'tunk';
import _list from './_list';
import {sleep, until, delay} from 'tunk-delay';
@create
class counter extends _list {
//不允许异步,应该保持简单
constructor(){
super();
this.state = {
count:0
};
}
@action
async decrement(){
const ok = await delay('22', 2000);
... | true |
4cebee40c40fb496f2daf1d32d7fa91127d32314 | JavaScript | juniormartinxo/typescript-handbook | /mini-course-willian-justen/build/module10-TypeUtilities.js | UTF-8 | 519 | 3.3125 | 3 | [] | no_license | "use strict";
// Readonly
const todo = {
title: 'Write TypeScript',
description: 'Learn TypeScript',
completed: false,
};
console.log(todo);
//todo.completed = true
// Partial
function updateTodo(todo, fieldsToUpdate) {
return Object.assign(Object.assign({}, todo), fieldsToUpdate);
}
const todo2 = updat... | true |
227cd635dfd1abf9147361e65b3f75b52c670956 | JavaScript | Cmacs-Products/3D-Viewer | /src/assets/scripts/3DGraphics/CAPS/selection.js | UTF-8 | 5,627 | 2.515625 | 3 | [] | no_license | // parameters: extreme points of object bounds
CAPS.Selection = function (low, high) {
var diffHalf = high.clone().sub(low).multiplyScalar(0.5);
var midPoint = low.clone().add(diffHalf);
// extend 10% above the models bounds
diffHalf.multiplyScalar(1.1);
// the maximum extension of the selection... | true |
46b44a8227a980132d831edd9b44bcb2f9c2911e | JavaScript | mavidian/FieldIncrementer | /js/incrementActiveElement.js | UTF-8 | 307 | 3.625 | 4 | [
"Apache-2.0"
] | permissive | var currValue = document.activeElement.value;
if (currValue === "") currValue = 0;
if (isNaN(currValue)) {
window.alert(currValue + " is not a number; can't increment.")
} else {
const incr = Number(window.prompt("Increment by", "1"));
document.activeElement.value=Number(currValue) + incr;
}
| true |
fe2648137dae0540364a9b619f7a8094f0661ae5 | JavaScript | 0blu3/01-modular_patterns_and_testing | /lab-brae/test/greet-test.js | UTF-8 | 706 | 2.765625 | 3 | [] | no_license | 'use strict';
const greet = require('../lib/greet.js');
const assert = require('assert');
describe('Greet Module', function() {
describe('#sayHello', function() {
it('should return Hello brae', function() {
var result = greet.sayHello('brae');
assert.ok(result === 'Hello brae', 'not equal to Hello b... | true |
5efa2d26e25113176e1684a5d2ae1922458aff36 | JavaScript | Manuel-wandeto/learning-javascript-journey | /math object challenge/random.js | UTF-8 | 384 | 3.5625 | 4 | [] | no_license | alert("Hey there thank you for visiting, lets get started!");
var user_min = prompt("what is the minimum number you would like generated?");
user_min = parseInt(user_min);
var user_max = prompt("What is the maximum number you would like generated?");
user_max = parseInt(user_max);
alert("All done, your number is " + Ma... | true |
8c43963a2538bd19d1186120649a00ed513dbb6c | JavaScript | erinlhamilton/LGBT-Rights | /js/map.js | UTF-8 | 3,539 | 2.90625 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////////////
// Main Class File: main.js, topojson.js
// File: map.js
//
// Author: Vanessa Knoppke-Wetzel
// Author: Erin Hamilton
//
// Description: Creates the map displayed at the top of the page. As well as
// ... | true |
9a39859b4897dc55b1dc7ee25dffe596df6d99b7 | JavaScript | mustafasarac/mustafa-sarac-envanter-1 | /scripts/tableCreator.js | UTF-8 | 4,530 | 2.734375 | 3 | [] | no_license | (function($) {
"use strict";
$.fn.tableCreator = function(props) {
var container = this;
var table = $('<table>').addClass("table table-bordered");
var headerRow = $('<tr>');
$.each(props.columns, function(ind, val) {
var col = $("<td>" + val + "</td>");
headerRow.append(col);
}... | true |
56d7de8beff746739da799a62d66e22584f7a8f4 | JavaScript | chrisJohn404/ljswitchboard-ljm_device_curator | /lib/register_watcher.js | UTF-8 | 9,792 | 2.6875 | 3 | [
"MIT"
] | permissive |
var q = require('q');
// var math = require('mathjs');
var gcd = require('compute-gcd');
var DEBUG_DATA_COLLECTOR = false;
function createWatcherObject(watcherName, collectionFunction, callback, curatedDevice) {
this.timerRef = undefined;
this.reportResults = false;
this.registerGroups = [];
this.dataCache = {};... | true |
08ca4fba9cbd309b3c5ddb61857464978b44f532 | JavaScript | yeonahki/cctv | /source/part3/js/loop.js | UTF-8 | 331 | 3.65625 | 4 | [] | no_license | var count = 0;
console.log('Example: for')
for(count=0; count < 5; count++){
console.log('count:', count);
}
count = 0;
console.log('Example: while')
while(count < 5){
console.log('count:', count);
count++;
}
count = 0;
console.log('Example: do-while')
do{
console.log('count:', count);
count++;
}while(c... | true |
a0ba6a4027c04b5650b54a86391762439ba0def3 | JavaScript | camilledlr/sneaklove | /bin/seeds.js | UTF-8 | 1,368 | 2.609375 | 3 | [] | no_license | const sneakerModel = require("../models/Sneaker");
const tagModel = require("../models/Tag");
const mongoose = require ("mongoose");
const someSneakers = [{
name: "AirMax",
ref: "12345",
sizes: ["39","40"],
description: "it's a classic sneaker",
price: 300,
image: "https://res.cloudinary.com/dxc... | true |
d6d96438afdba744ebd3a08c0b26a0432ad8e2d3 | JavaScript | ducky007/GlitterDrag | /src/options/custom_elements/search_engine_manager.js | UTF-8 | 5,880 | 2.53125 | 3 | [
"MIT"
] | permissive | import * as logUtil from '../../utils/log'
import * as env from '../../utils/env'
import * as i18nUtil from '../../utils/i18n'
import * as configUtil from '../../utils/config'
class SearchEngineManager extends HTMLElement {
constructor() {
super();
const template = document.querySelector("#template-... | true |
30b47eab7dc4ef4db1790a9428b1025c29d76d64 | JavaScript | rolandschuetz/CodeQNeosDemo | /Source/CodeQ.Site/Resources/Public/Frontend/js/moblie-menu.js | UTF-8 | 1,883 | 2.765625 | 3 | [] | no_license | (function() {
//Remember if the menu is opened or not
var menuOpened = false;
var menuButton = document.getElementById('mobile-navigation-button');
var mobileNavigationContainer = document.getElementById('site-navigation-holder');
var siteNavigationHolder = document.getElementById('codeq-site-header');
var siteC... | true |
9074fbc8006816818cf015daa3984a2c557fa69a | JavaScript | Jacobus-afk/cs50w-project2 | /static/index.js | UTF-8 | 7,523 | 2.609375 | 3 | [] | no_license | let user = JSON.parse(localStorage.getItem("user_data"));
document.addEventListener("DOMContentLoaded", () => {
const socket = io.connect(location.protocol + '//' + document.domain + ':' + location.port);
/*socket.on('connect', () => {
console.log("socket connected")
});*/
const chan_create_f... | true |
25c1553fb029f117e54fef186453b9b0190c1e3b | JavaScript | aghaatif94/set-3 | /q9.js | UTF-8 | 333 | 2.578125 | 3 | [] | no_license | let balance = 0;
if (balance < 1){
console.log("Moazziz Sarif, aap ka mojooda balance iss call k lye naa kaafi hai. Please re-charge karain");
} else if(balance >= 1 && balance < 10){
console.log("Moazziz sarif, aap ka balance khatam honay wala hai" );
console.log("Ring Ring");
} else{
console.log("Ri... | true |
bed9fb96ce3bdad81bb691c6b4fc7e33211f2d1b | JavaScript | tdj03001/React-Staff-Directory | /src/Components/Table/table.js | UTF-8 | 2,733 | 2.6875 | 3 | [] | no_license | import React from "react";
import data from "../../data.json"
import TableRow from "./components/TableRow/tableRow";
import TableHeader from "./components/TableHeader/tableHeader";
import { TableContext, EventContext } from "./tableContexts";
import { AppContext } from "../../AppContexts";
export default function Tabl... | true |
516ef1b5aeae4bf016bf6e94fa9570f76f60d505 | JavaScript | huohuoit/leetcode-practice | /leetcode-practice/217存在重复元素contains-duplicate/contains-duplicate.js | UTF-8 | 533 | 3.203125 | 3 | [] | no_license | /* leetcode 217存在重复元素contains-duplicate JavaScript实现 */
/** * @param {number[]} nums * @return {boolean} */
var containsDuplicate = function(nums) {
var len = nums.length;
var minNum = 2;
var item;
var cache = {};
for (var i = 0; i < len; i++) {
item = nums[i];
if (cache[item] === u... | true |
475446165b929706fa4ba6732948c03800db3e6a | JavaScript | AndrewKozinsky/interactive-table-at-react | /src/components/people-list/people-list/getPeopleData.js | UTF-8 | 555 | 2.875 | 3 | [] | no_license | /**
* Функция получает с сервера JSON со списком людей
* @return {Promise<null|any>}
*/
async function getPeopleData() {
const adress = 'http://andrewkozinsky.ru/samples/chu/data-provider/people-data.php';
const fetchSettings = {
method: 'GET', mode: 'cors'
};
let result = null;
try {
... | true |
2150fc79e61c8ab4b8e62ca333585df7429ab70d | JavaScript | shivamjain1/Online-food-ordering-app | /js/app.js | UTF-8 | 3,826 | 3.03125 | 3 | [] | no_license | const restaurantsElem = document.querySelector('.restaurants');
const inputBox = document.getElementById('search');
const errorMessage = document.querySelector('.errorNotify');
let hotelLists = [];
// fetch api to get list of restaurants
let getData = () => fetch("./data/api.json").then(data => data.json());... | true |
5daaa16323666e008248a91a6e869b4bdd66af59 | JavaScript | RedRoserade/asp-mvc-react | /data-annotations-schema-validator/src/validation-result.js | UTF-8 | 449 | 2.75 | 3 | [] | no_license | 'use strict';
export default class ValidationResult {
constructor() {
/**
* Contains any validation errors that were found.
*/
this.errors = [];
}
addError(error) {
this.errors.push(error);
}
addErrors(errors) {
for (let i = 0; i < errors.length; i++) {
this.errors.push(erro... | true |
6f2867953bf685c47122941d0cedd0965b69278d | JavaScript | oakis/vuecalorie-express | /routes/ingredients.js | UTF-8 | 1,359 | 2.578125 | 3 | [] | no_license | import { Router } from 'express';
import Ingredient from '../models/ingredient';
const router = Router();
router.get('/', async (req, res) => {
const allIngredients = await Ingredient.find();
return res.send({
allIngredients,
count: allIngredients.length,
});
});
router.post('/', (req, res) => {
cons... | true |
a62828f65109d2801cbf04ade60cafbcda6ae82b | JavaScript | finos/waltz | /waltz-ng/client/system/svelte/nav-aid-builder/nav-aid-utils.js | UTF-8 | 628 | 2.65625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-generic-cla",
"CC0-1.0"
] | permissive | import _ from "lodash";
export function prettyHTML(elemHtml) {
if (_.isNil(elemHtml)) {
return "";
}
const tab = " ";
let result = "";
let indent= "";
elemHtml
.split(/>\s*</)
.forEach(function(element) {
if (element.match( /^\/\w/ )) {
in... | true |
f75cb74c7941e7d651f72a86057db1977b8abe50 | JavaScript | thejhh/graphdb | /src/buffer_utils.js | UTF-8 | 741 | 2.765625 | 3 | [
"MIT"
] | permissive |
/* Simple block-based file storage for Copy on Write implementations */
var q = require('q');
var errors = require('./errors.js');
var mod = module.exports = {};
/** Find last index for value in a buffer */
mod.find_last = function(value, buffer, len) {
var i = parseInt(len || buffer.length, 10)-1;
for(; i>=0; i=i... | true |
9e0f615958edc8e4cb2a8e4234ddc952d027f1bf | JavaScript | bingfengding/knowQuestion | /build/js/test-工具提示.js | UTF-8 | 2,273 | 2.609375 | 3 | [] | no_license | $(function () {
function setRem(number) {
var rem =parseFloat(getComputedStyle(document.documentElement)["fontSize"]);
return number*rem;
}
$("#search_button").button({
});
$("#reg").dialog({
autoOpen:true,
buttons:{
"提交":function () {
alert("正在ajax提交中");
},
"取消":function () {
$(this).di... | true |
a0d39935ccd44418ea85caf004fd468b58555159 | JavaScript | rjoleary/oec | /js/train-safety.js | UTF-8 | 1,611 | 3.28125 | 3 | [] | no_license | /**
* Analyze the array of train parameters and create sends commands to the server.
*/
function applySafety(trainParameters) {
console.log("Applying train safety...");
var cmd = [];
for (var i = 0; i < trainParameters.length; i++) {
for (var j = i + 1; j < trainParameters.length; j++) {
if (i != j... | true |
216f8cb30fd2ef980361fa093da49b517ce0fb0a | JavaScript | juliankohlman/Data-Structures-II | /src/binary-search-tree.js | UTF-8 | 2,970 | 4 | 4 | [] | no_license | /* eslint-disable no-unused-vars */
/* eslint-disable no-trailing-spaces */
/* eslint-disable class-methods-use-this */
class BinarySearchTree {
constructor(value) { // Root only special in terms of references (each node is a tree itself)
this.value = value; // actual node value
this.left = null; // link to ... | true |
1b20e992da98aa9767695a4fa97660b020f36f85 | JavaScript | FabioMezzina/react-burger-builder | /src/containers/BurgerBuilder/BurgerBuilder.js | UTF-8 | 3,950 | 2.859375 | 3 | [] | no_license | // Questa è la sezione in cui potrò costruire il mio hamburger
// Di base ho il mio wrapper Aux che contiene le mie sezioni principale
// Una sezione in cui mostro il Burger man mano che si crea
// Un'altra sezione in cui controllo gli elementi da aggiungere all'hamburger
import React, { Component } from 'react';
impo... | true |
34d08af1a11b8a2d167ac7719d58f4da2979b485 | JavaScript | dsrivan/Admin-Panel-01 | /assets/js/main.js | UTF-8 | 839 | 2.5625 | 3 | [] | no_license | // btn to top
const btn_to_top = document.querySelector('.btn-to-top');
btn_to_top.addEventListener('click', () => {
window.scroll({
top: 0,
behavior: 'smooth'
})
});
// todos os botões terão o mesmo efeito ao clicar
const btns_theme_color = document.querySelectorAll('.square-color');
btns_them... | true |
796774aba5274aa0f957d606f5bca66527df48c6 | JavaScript | rodelros/rodelros.github.io | /projects/web_components/components/grid-ns.js | UTF-8 | 3,103 | 3.203125 | 3 | [] | no_license | (function(){
(rowTemplate = document.createElement('template')).innerHTML =
`<tr> <td></td> <td></td> <td></td> </tr>`;
class GridRow{
constructor(param){
this.node = rowTemplate.content.cloneNode(true);
this._elements = this._getElements();
this.update(param);
}
///////////////////
// p... | true |
e0ff4a780d8ee272e55f8f3a1f471496d84539a8 | JavaScript | kristinatong/js-task-lister-lite-nyc-web-080618 | /src/oo_index.js | UTF-8 | 722 | 2.984375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive |
document.addEventListener("DOMContentLoaded", () => {
const taskList = new TaskList();
const formElement = document.getElementById('create-task-form')
const list = document.getElementById('tasks')
document.addEventListener('submit',(e)=>{
e.preventDefault()
if(formElement.elements['new-task-descripti... | true |
7257d480539dd168f001eddf632108fb88851391 | JavaScript | alexandfox/commons-game | /js/src/villager.js | UTF-8 | 823 | 2.984375 | 3 | [] | no_license | import Player from "./player.js"
class Villager extends Player {
constructor(name, index) {
super(name, index);
this.human = 0;
}
autoFish(choicesArray, availFish, numPlayers) {
if (!availFish) {
this.starve()
return 0
} else {
if (!choicesArray.length) { // no human players have made a move yet
... | true |
952e1ca26d59eb57120622f9dd81d78e63a19948 | JavaScript | Cesar-Jim/fullstackopen | /part2/countries/src/App.js | UTF-8 | 1,991 | 2.921875 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import axios from "axios";
import Filter from "./components/Filter";
import Viewer from "./components/Viewer";
import Country from "./components/Country";
const App = () => {
const [countries, setCountries] = useState([]);
const [newSearch, setNewSearch] = useSt... | true |
a8c9ef3202fcfeb5e46743a4f267cd45fc1cfb0f | JavaScript | amp89/FindIP | /FindIp/FindIp/WebContent/angular/apps/changePassword.js | UTF-8 | 1,036 | 2.515625 | 3 | [] | no_license | var app = angular.module('changePassword',[]);
app.controller('editController',function($scope,$http){
$scope.emailRegex = "^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$";
$scope.userData = {};
$scope.rese... | true |
0cc22521fb4617c07b039df1d2902ec7c656e202 | JavaScript | richard-sistern/top-javascript-exercises | /palindromes/palindromes.js | UTF-8 | 239 | 3.046875 | 3 | [] | no_license | const palindromes = function(string) {
cleanString = string.toLowerCase().replace(/[^A-Za-z]/g, "");
reverseString = cleanString.split("").reverse().join("")
return cleanString == reverseString;
}
module.exports = palindromes
| true |
07f7c1ab5c39cb32dfbc2b40c5e76cfaf9ad55c9 | JavaScript | JamieMaple/express-animation | /www/js/main.js | UTF-8 | 6,603 | 2.6875 | 3 | [] | no_license | 'use strict'
// every request num
var COUNT_NUM = 12
// up request limit
var TOTAL_NUM = 67
// image params format
var IMGPARAMS = { height: 441, width: 300 }
// Debug mode open or close
var DEBUG_MODE = false
// querySet
var query = { tag:'吉卜力', start: 0, count: COUNT_NUM }
// jsonp callback
function jsonp(appData) {
... | true |
0172e1a45f8b1976b68a3edde158c5059d992a86 | JavaScript | CodeFTW/soobdoo | /imports/core/TimeConverter.js | UTF-8 | 1,191 | 3.359375 | 3 | [] | no_license |
const TimeConverter = {
fromTimeToMilliseconds(time) {
//00:02:01,720 --> 00:02:04,200
//hours:minutes:seconds:milliseconds
const [hours, minutes, secondsWithMilliseconds] = time.split(':');
let [seconds, milliseconds] = secondsWithMilliseconds.split(',');
return parseInt(... | true |
70548c86f8a405613b1199879681c1e0bd90e3de | JavaScript | EizeHofstra/Boss_machine | /server/checkMillionDollarIdea.js | UTF-8 | 806 | 2.796875 | 3 | [] | no_license | const checkMillionDollarIdea = (req, res, next) => {
const {numWeeks, weeklyRevenue} = req.body;
const totalValue = Number(numWeeks) * Number(weeklyRevenue);
if (!numWeeks || !weeklyRevenue || isNaN(totalValue) || totalValue < 1000000) {
res.status(400).send();
} else {
next();
}
}
/*You will create ... | true |
fa95bdeb5d66b2bdc5ff355f810212de3f9371a2 | JavaScript | loumioussama/Javascript | /dom.js | UTF-8 | 1,300 | 2.578125 | 3 | [] | no_license | function home() {
setTimeout(() => {
let affiche=`<div class="alert alert-success" role="alert">
<h2 class="alert-heading " style="text-align:center"> DOM => document object Model </h2>
<p>
<strong>
Le modèle d'objet de document ( DOM ) est une interface multiplateforme et indépendante du langag... | true |
adf27068aa02b220e0565330ade01dca3498eaaa | JavaScript | vilimco/adventofcode | /src/day-12/DigitalPlumber.js | UTF-8 | 1,199 | 2.75 | 3 | [] | no_license | module.exports = (_input) => (
(
((f) => f(f))(
(f) => (input, pos, marker) =>
marker[pos] === undefined
&& ((marker[pos] = true) || true)
&& input[pos]
.split(' <-> ')[1]
.split(', ')
.ma... | true |
11c607ab34b3638b6ec9fc657b196481cd47ca9a | JavaScript | gabrielnvg/react-base | /src/assets/js/utils.js | UTF-8 | 623 | 3.25 | 3 | [
"MIT"
] | permissive | export function slugify(string = '') {
if (typeof string !== 'string') {
throw new TypeError(
'Slugify function must receive a string as a parameter!',
);
}
let str = string.replace(/^\s+|\s+$/g, '').toLowerCase();
const from = 'àáäâãèéëêìíïîõòóöôùúüûñç·/_,:;';
const to = 'aaaaaeeeeiiiiooooouu... | true |
1bea93e00fc37a596f8e95f9da0d541084b1bff5 | JavaScript | letaotf/webcast | /src/main/resources/static/js/goodsOperating.js | UTF-8 | 16,464 | 2.65625 | 3 | [
"MIT"
] | permissive | /**
* 查询网络节目内容
*/
$(function() {
init();
//搜索事件
buttonEvent();
getGoodsOperatingAjax({
pageNo: 1,
}, function (data) {
renderPager(data.totalPage, data.pageNo);
bindPagerEvent();
initRecord();
});
//添加商品
addGoods();
//处理商品在线状态
dealGoodsOnlineStat... | true |
00e4c3ce633e3429909d485a6ca6a9b5feac4f7b | JavaScript | AlaynaGrace/solo-project | /server/routes/addPet.js | UTF-8 | 3,415 | 2.53125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var pet = require('../models/pet.model');
var path = require('path');
var user = require('../models/user.model');
// Handles Ajax request for user information if user is authenticated
router.get('/', function(req, res) {
console.log('get /pets route')... | true |
35b3bf591302d049d4edd037c92c3e31f92adf81 | JavaScript | OOO-MetaPrime/geoprime.core.server | /database/helpers/strings.js | UTF-8 | 513 | 2.703125 | 3 | [
"MIT"
] | permissive | 'use strict'
function padStart (sourceString, targetLength, padString) {
targetLength = targetLength >> 0
padString = String(padString || ' ')
if (sourceString.length > targetLength) {
return String(sourceString)
} else {
targetLength = targetLength - sourceString.length
if (targetLength > padStrin... | true |
a834fe752351cba35204542a125da70b7738bf9d | JavaScript | beefy/multiplayer-chess-cmd | /server.js | UTF-8 | 3,465 | 2.953125 | 3 | [
"MIT"
] | permissive | const app = require('express')();
const http = require('http').Server(app);
const io = require('socket.io')(http);
const { Chess } = require('chess.js');
const chess = new Chess();
let white = -1;
let black = -1;
let turn = -1;
let not_turn = -1;
let last_move = -1;
let white_rematch = -1;
let black_rematch = -1;
let ... | true |
a60191c543a04aaf5083a8dca9b89579b5af26d4 | JavaScript | jerrykingxyz/pigeon | /src/channel/webhook/index.js | UTF-8 | 690 | 2.546875 | 3 | [
"MIT"
] | permissive | const fetch = require('node-fetch')
const Channel = require('../index')
/**
* webhook channel
*/
class Webhook extends Channel {
/**
* @constructor
* @param {string} name - webhook channnel instance name
* @param {Object} options - channel options
* @param {string} options.url - http url
* @param {O... | true |
88542c40b64279da1ef0631614a33f0a78914a3f | JavaScript | anjali0626/data-structures | /tree/tree.js | UTF-8 | 532 | 4.1875 | 4 | [] | no_license | // Implement Tree data structure
var Tree = function(val) {
this.value = val;
this.children = [];
};
// Time Complexity : O(1)
Tree.prototype.addChild = function(val) {
var newChild = new Tree(val);
this.children.push(newChild);
return newChild;
};
// Time Complexity : O(n)
Tree.prototype.contains = f... | true |
9c19cebaef2590e181fa298bbb83ca23fd0635b2 | JavaScript | yahaoli/collect | /js/数值转换人民币汉子.js | UTF-8 | 1,717 | 3.03125 | 3 | [
"MIT"
] | permissive | /*function numToRMB(num) {
var num1=(num*1).toString(),RMB=['仟万','佰万','拾万','万','仟','佰','拾',''].reverse(),CN=['壹','贰','叁','肆','伍','陆','柒','捌','玖'],str='';
for(var len=num1.length,i=len-1;i>=0;i--){
str+=num1[len-i-1]>0?CN[num1[len-i-1]-1]+RMB[i]:i>=1&&num1[len-i]>0?"零":'';
}
return str+'元';
}*/
f... | true |
3aa12f4b440717a3bc467a0d17118df2e6b0532c | JavaScript | forcedotcom/lightning-language-server | /packages/aura-language-server/resources/aura/util/Override.js | UTF-8 | 5,468 | 2.671875 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* Copyright (C) 2013 salesforce.com, inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | true |
6f92cd8dcf6f0d0b8595774a50d6dd8633581752 | JavaScript | Arsalan134/React | /blog-app/src/UI/New BLog/NewBlog.jsx | UTF-8 | 2,078 | 2.75 | 3 | [] | no_license | import { useState } from "react";
import { useHistory } from "react-router-dom";
import firebase from "../../firebase";
import "./NewBlog.css";
const NewBlog = () => {
const [title, setTitle] = useState("");
const [body, setBody] = useState("");
const [description, setDescription] = useState("");
// const [author,... | true |
f21d33d10555c9d2ce3c285b34baa360c17464c3 | JavaScript | starkhorn/fizzbuzz.js | /public/js/fizzbuzz.js | UTF-8 | 595 | 2.96875 | 3 | [] | no_license | (function() {
var FizzBuzz;
FizzBuzz = (function() {
function FizzBuzz() {}
FizzBuzz.prototype.say = function(number) {
switch (false) {
case number % 15 !== 0:
return 'FizzBuzz';
case number % 3 !== 0:
return 'Fizz';
case number % 5 !== 0:
retur... | true |
ae7a5cef316995603a9f11f43129d5f261549ca6 | JavaScript | brownplt/ML-LambdaJS | /tests/eval_es5/get-and-assign.js | UTF-8 | 155 | 2.515625 | 3 | [] | no_license |
function() {
var o = { toString: function() {return "toString called";}};
var f = o.toString;
assertobj(f() === "toString called", "get-and-call");
}(); | true |
5017b93d53d8588c7ddc4f8610587c8ba12b8b8c | JavaScript | unoctanium/Vue-Vuex-Axios-Websocket | /src/store/moduleSocket.js | UTF-8 | 2,272 | 2.546875 | 3 | [] | no_license | const mutations = {
SOCKET_ONOPEN(state, event) {
state.isConnected = true;
state.errorFlag = false;
},
SOCKET_ONCLOSE(state, event) {
state.isConnected = false;
if (state.reconnectTimeoutId)
clearTimeout(state.reconnectTimeoutId);
state.socket = null;
},
SOCKET_ONERROR(s... | true |
842b876807f33186ecc49ef0fcc6719bf2de982c | JavaScript | trungly/generator-flask-ng | /generators/app/index.js | UTF-8 | 2,791 | 2.578125 | 3 | [
"MIT"
] | permissive | 'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');
module.exports = yeoman.generators.Base.extend({
prompting: function () {
var done = this.async();
// Have Yeoman greet the user
this.log(yosay(
'This Yeoman generator will create a ... | true |
19b0e61d2c761bc8b49c0dc29c9b090dfb0e2374 | JavaScript | Juancho5945/Discord-bots-js | /Comandos/userinfo.js | UTF-8 | 5,710 | 2.8125 | 3 | [] | no_license | ///Este es un comando de Userinfo///
if (message.content.startsWith(prefix +"userinfo" )){
//hacemos un let para definir los estados
let estados = {
"online": "<:online:837326922232233984> En Línea",
"idle": "<:idles:837326921925656647> Ausente",
"dnd": ... | true |
9631b88bb3c93ff9f76f477fc24f09274ddcf4db | JavaScript | ZiPengYe/leetcode | /#209 Minimum Size Subarray Sum.js | UTF-8 | 529 | 3.40625 | 3 | [
"MIT"
] | permissive | /**
* @param {number} target
* @param {number[]} nums
* @return {number}
*/
const minSubArrayLen = (target, nums) => {
const len = nums.length;
if (!len) return 0;
let ans = len + 1,
sum = 0,
left = 0,
right = 0;
// 双指针
while (right < len) {
sum += nums[right];
// 符合条件时, 尝试 左指针 ... | true |
22b6760b14e5b5299ce1f1eac51358adefad717e | JavaScript | AleksandrCherepakhin/Udemy_Practice | /js/script.js | UTF-8 | 1,795 | 3.40625 | 3 | [] | no_license | /* Задания на урок:
1) Удалить все рекламные блоки со страницы (правая часть сайта)
2) Изменить жанр фильма, поменять "комедия" на "драма"
3) Изменить задний фон постера с фильмом на изображение "bg.jpg". Оно лежит в папке img.
Реализовать только при помощи JS
4) Список фильмов на странице сформировать на основании... | true |
533207dc20f077eee6eb091dc8dc6d31c909c0d3 | JavaScript | seba689/trabajo_js | /script.js | UTF-8 | 3,064 | 3.734375 | 4 | [] | no_license | // problema 1
let arr = []
function add(x){
for(i=1;i<=x;i++){
arr.push(i)
}
}
add(255)
console.log(arr.length)
//problema 2
function pares(x){
y=0
for(i=2;i<=x;i+=2){
y=y+i
}
return y
}
console.log(pares(1000))
//problema 3
functio... | true |
0e54e7122aa5349d120c02ee57e4f740019187b4 | JavaScript | WeeverApps/WeeverMapsK2 | /assets/js/wmx.js | UTF-8 | 8,827 | 2.53125 | 3 | [] | no_license | /*
* Weever Geotagger Core
* (c) 2012 Weever Apps Inc. <http://www.weeverapps.com/>
*
* Author: Robert Gerald Porter <rob@weeverapps.com>
* Version: 0.3
* License: GPL v3.0
*
* This extension is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as pub... | true |
89ddf4da834f8e6d0b7f83d42869ad03a00591cf | JavaScript | fehrryjake/monster-slayer | /src/reducers/actorReducer.js | UTF-8 | 2,177 | 2.765625 | 3 | [] | no_license | const defaultState = {
player: {
health: 100,
maxHealth: 100,
id: 'player'
},
monster: {
health: 100,
maxHealth: 100,
id: 'computer'
}
}
export default (state = defaultState, action) => {
switch (action.type) {
case 'ATTACK':
if (action.payload.attacker.health > 0) {
... | true |
43847590e78da1fcedb7a119f0c78fe8a63012e8 | JavaScript | cwi-crescer-2017-1/mirela.adam | /Modulo-04/lista2/js/exercicios-array.js | UTF-8 | 4,943 | 3.234375 | 3 | [] | no_license | //ex1
function seriesInvalidas(series) {
let anoAtual = (new Date()).getFullYear();
let arrayDeSeriesInvalidas = [];
for (let s of series){
let invalida = false;
if( s.anoEstreia > anoAtual ) {
invalida = true;
}
for (let campo in s) {
let valor = s[campo];
if(typeof valor === "undefi... | true |
379037141ad0faed24e5b3b2e5f01b0b232d6a73 | JavaScript | tong-yongze/node.js | /day4/04.定义最简单的中间件函数.js | UTF-8 | 389 | 2.8125 | 3 | [] | no_license | // 导入 express
const express = require('express')
// 创建
const app = express()
// 开始定义
const mw = function (req, res, next) {
console.log('这是最简单的中间件函数');
// 把流转关系 转交给下一个中间件或路由
next()
}
// 将mw 注册为全局生效的中间件
app.use(mw)
app.listen(80, () => {
console.log('http://127.0.0.1');
})
| true |
5043dd2f46aeb6f31289f5f70c4713f842ba7bdf | JavaScript | Collabify/Collabify_Backend | /controllers/helpers.js | UTF-8 | 14,478 | 2.65625 | 3 | [] | no_license | var _ = require('underscore');
var helpers = require('./helpers');
var CollabifyError = require('../collabify-error');
var status = require('../status');
var Event = require('../models/event').Event;
var User = require('../models/user').User;
/** @module */
/**
* ... | true |
9ab3a1a187fd139dfaedad18461248d10b7afc11 | JavaScript | mechanismsjs/mech-scope-cell | /tests/shared/cellRef.js | UTF-8 | 2,324 | 2.84375 | 3 | [] | no_license | describe("getting a reference to a cell - cellRef", function() {
beforeEach(function() {
for (var key in m.cellWorkBook) {
if (m.cellWorkBook.hasOwnProperty(key)) {
delete m.cellWorkBook[key]; // slow but for tests ok
}
}
});
it("should not wipeout Object prototype and be a mechanism... | true |
4d79c4fc4e947b66a03abedf50f0e201c88c10c3 | JavaScript | tvergho/idea-lab | /utils/calcDate.js | UTF-8 | 437 | 3 | 3 | [] | no_license | const calcDate = (date) => {
const dateObj = new Date(date);
if (dateObj === 'Invalid Date' || Number.isNaN(dateObj)) return null;
const ye = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(dateObj);
const mo = new Intl.DateTimeFormat('en', { month: 'long' }).format(dateObj);
const da = new Intl.Da... | true |
8db5376caea33b7dc01575fad543aa0fc9601766 | JavaScript | dudwns9331/2021-Summer-NodeJS | /Example/src/ModernExample.js | UTF-8 | 3,511 | 4.03125 | 4 | [] | no_license | // @ts-check
/* eslint-disable no-restricted-syntax */
/* JSdoc 이용 */
/**
* @typedef Person
*
* @property {number} age
* @property {string} city
* @property {string | string[]} [pet]
*/
/** @type {Person[]}*/
const people = [
{
age: 20,
city: '서울',
pet: ['cat', 'dog'],
},
{
age: 40,
... | true |
e418ae2ed598dd08fe7b55eb8e3035baaa0354c5 | JavaScript | jvanderen1/cli_chat | /src/server/Helpers/Log.js | UTF-8 | 1,296 | 3.3125 | 3 | [
"MIT"
] | permissive | /**
* CLI Chat
* SE420 & SE310 Spring 2018 Group Project
* Grant Savage, Josh Van Deren, Joy Tan, Jacob Lai
*
* Updated: April 30. 2018
*
* Log.js
*
* This file contains the class definition for the
* Log class. This file essentially pulls in a package
* that changes the color of the console output so that... | true |
63cb5b93574d78d4390ef8a850e7caeb4ee62190 | JavaScript | Szarp/discord-chatbot | /lib/messagesRouter.js | UTF-8 | 1,516 | 2.6875 | 3 | [] | no_license | import { routeRoleMessage } from "./privileges.js";
import { routeTestMessage } from "./testManager.js";
import * as messageStrings from "./messageStrings.js";
/**
* Routes incoming messages to appropriate handlers
* @param {import("discord.js").Message} message The received message
*/
async function routeMessage(m... | true |
280b5ed3af894b8ed2f878445fb74fb979ee8eb0 | JavaScript | emiruffini/MYTINERARY | /frontend/src/components/Ciudades.js | UTF-8 | 2,425 | 2.515625 | 3 | [] | no_license | import React from 'react'
import Ciudad from './Ciudad'
import '../styles/ciudadesFiltro.css'
import {connect} from 'react-redux'
import { NavLink, Redirect } from 'react-router-dom'
//Componente donde se mostrarpa cada componente ciudad y donde se encuentra el filtro
class Ciudades extends React.Component{
state... | true |
539b0735eaf984566d42514717ab36e3ed3e1563 | JavaScript | avniraiyani/react-examples | /src/components/Example8.js | UTF-8 | 1,107 | 2.84375 | 3 | [] | no_license | import React, { Component } from 'react';
class Example8 extends Component {
constructor() {
super();
this.state = {
value:0,
};
}
valueOperation(operation)
{
if(operation=='add')
{
this.setState({value:this.state.value+1});
}
... | true |
b711f5f27ca9c88f85e40d9ffb15293ce16ae9f0 | JavaScript | Laharisikakollu/calculator | /result.js | UTF-8 | 1,545 | 4.21875 | 4 | [] | no_license | //1.Take a mathematical expression as input which contain only [/, *,+,-] as operators.
//2.Compute the operations according to the operator identified and print the result.
//Import the sum,diff,multiply and divison modules
const sum=require("./sum")
const diff=require("./subtract")
const mul=require("./multipl... | true |
66e72e1c90220078e2750791837c0c5cc0933d83 | JavaScript | pratikfulkar/91social | /src/component/Home.js | UTF-8 | 1,570 | 2.65625 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import CardM from "./CardM";
const Home = () => {
const [histry, setHistry] = useState([]);
useEffect(() => {
fetch("https://api.spacexdata.com/v3/history")
.then((res) => res.json())
.then((histry) => {
setHistry(histry);
// cons... | true |
3b718d6e81a008234a30e4e0b3dbc6cc103ef59a | JavaScript | thebestfella/fm-calculator | /calculator.js | UTF-8 | 1,778 | 3.078125 | 3 | [] | no_license | let num = 0
let helpNum = 0
let operation = 0;
function updateOutput(){
document.getElementById("output").innerHTML = num.toString()
}
function clickCancel(){
num = 0
helpNum = 0
operation = 0
updateOutput()
}
function clickBack(){
num = num / 10
num = Math.floor (num)
updateOutput()
... | true |
ea386014343da04c61663ba1552d61db571848ae | JavaScript | misakar/NODE.JS | /hello-world.js | UTF-8 | 226 | 3.453125 | 3 | [] | no_license | // hello world come from js
setTimeout(function(){
// function 是一个回调函数
console.log('World');
}, 2000)
console.log('Hello');
// the same program in python
// print "hello"
// sleep(2)
// print "world"
| true |
36510d24e480b25de927bc823c2f495903a9967a | JavaScript | akshaykarve/learn-io-api | /controllers/search.js | UTF-8 | 1,678 | 2.515625 | 3 | [] | no_license | var router = require('express').Router();
const mongoose=require('mongoose');
const platformSchema=require('../models/platform.js');
const userInfo=require('../models/userInfo.js');
const handleSearchPlatforms=(req,res)=>{
const {user, name, skip, count} = req.params;
let query = {};
if (user != 'all')
... | true |
e4a29d1d8ad3381ec8f36792e25cd46b492f26a0 | JavaScript | RemyPham/lab-thinking-in-react | /starter-code/src/components/FilterableProductTable.jsx | UTF-8 | 1,300 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react'
import data from '../data.json'
import SearchBar from './SearchBar'
import ProductTable from './ProductTable'
export default class FilterableProductTable extends Component {
state = {
itemData: data,
previousList: ""
}
filterHandler = (target) => {... | true |
436d62fb2ec33aac26e0429895d4b0f865f66d6f | JavaScript | przekwas/personal-blog | /client/src/components/blogpost.jsx | UTF-8 | 1,942 | 2.71875 | 3 | [] | no_license | import React, { Component, Fragment } from 'react';
import { render } from 'react-dom';
class BlogPost extends Component {
constructor(props) {
super(props);
this.state = {
title: '',
content: ''
}
this.addBlog = this.addBlog.bind(this);
this.updateT... | true |
f7846746eea0628092a05df37c62aafca58af177 | JavaScript | saylerb/lololodash | /give_me_an_overview.js | UTF-8 | 356 | 2.515625 | 3 | [] | no_license | var _ = require("lodash");
var yarg = function(orders) {
res = _.reduce(orders, (result, order) => {
result[order.article] = result[order.article] + order.quantity || order.quantity
return result
}, {})
mapped = _.map(res, (val, key) => ({ article: parseInt(key), total_orders: val }))
return mapped... | true |
f10f5cf35ed2a8337ed9e6a95858be2ae6ff96fa | JavaScript | gtorres777/rickandmortyapi | /src/store/index.js | UTF-8 | 954 | 2.546875 | 3 | [] | no_license | import Vue from "vue";
import Vuex from "vuex";
import {API} from "../services/API"
Vue.use(Vuex);
export default new Vuex.Store({
state: {
charactersList:[]
},
getters:{
charactersList: state => {
return state.charactersList;
},
character: state => id => {
return state.charactersLis... | true |
eb2566c8a272957907d2ceb535773e539fc94dee | JavaScript | PaigeAndrews/jsPractice | /hangman/script.js | UTF-8 | 4,616 | 3.4375 | 3 | [] | no_license | let wordList = `Afraid
Apparition
Bat
Bloodcurdling
Bloody
Brew
Bone
Boo
Broomstick
Cackle
Cadaver
Carved
Casket
Cauldron
Cemetery
Cobweb
Coffin
Concoction
Corpse
Creepy
Dark
Death
Decapitated
Decomposing
Dracula
Dusk
Eerie
Fangs
Frankenstein
Frightening
Ghost
Ghoulish
Goblin
Gory
GrimReaper
Grotesque
Gruesome
Haunted
... | true |
5e98f38e3573c1e10260feca5ac8cebe2388ee01 | JavaScript | rogermadsen/home | /app/AppStore.js | UTF-8 | 2,114 | 2.53125 | 3 | [] | no_license | 'use strict';
import React from 'react';
//import Counter from './Counter';
//import Immutable from 'immutable';
import {
ReduceStore
} from 'flux/utils';
//import Todo from './Todo';
import ActionTypes from './ActionTypes';
import AppDispatcher from './AppDispatcher';
var store = {
lights: []
}
class AppSt... | true |
b1419a4e7525da0993e296b6786d62b0fe1d7b7b | JavaScript | danscan/fractal | /app/vendor/pro-inputs/src/utils/reduceBoxSelectedSides.js | UTF-8 | 1,214 | 2.515625 | 3 | [
"MIT"
] | permissive | import {
TOP,
RIGHT,
BOTTOM,
LEFT,
ALL_SIDES,
VERTICAL_SIDES,
HORIZONTAL_SIDES,
} from '../constants/boxSides';
export default function reduceSelectedSides(selectedSides, pressedSide) {
const allSidesAreSelected = selectedSides === ALL_SIDES;
const verticalSidesAreSelected = selectedSides === VERTICA... | true |
a06117b62e665558af336f7138030e7865d3484f | JavaScript | yutagoto8/Spring-Boot | /src/main/resources/static/js/checkbox.js | UTF-8 | 799 | 3.015625 | 3 | [] | no_license | $(function(){
// 初期状態のボタンは無効
$("#btn1").prop("disabled", true);
// チェックボックスの状態が変わったら(クリックされたら)
$("input[type='checkbox']").on('change', function () {
// チェックされているチェックボックスの数
if ($(".chk:checked").length == 1) {
// ボタン有効
$("#btn1").prop("disabled", f... | true |
8539820361903d8746ac3f40a89c14f3c71502d8 | JavaScript | MuneebSajjad2/Covid-19-Tracker | /src/api/index.jsx | UTF-8 | 1,038 | 2.609375 | 3 | [] | no_license | import axios from "axios";
let url = "https://covid19.mathdro.id/api";
export async function fetchData (country){
let countryUrl = url;
if(country && country !== "Global"){
countryUrl = `${url}/countries/${country}`
}
try {
let {data:{confirmed,recovered,deaths,lastUpdate}... | true |
ef0910eb529901fb9f1a5a39011745621f471da0 | JavaScript | fuyumi-m/learn-PG | /sample/sample/PART-1/CHAPTER08/162/code_jquery/2.1.0/js/sample.js | UTF-8 | 208 | 2.671875 | 3 | [] | no_license | // ページの読み込みが完了したら処理する
$(document).ready(function(){
// 読み込み完了時のメッセージを表示する
$("output:first").html("ページ読み込み完了");
}); | true |
230388996956825544f63932a47a20c1a0958528 | JavaScript | tu4mo/wurd | /client/ducks/timelines.js | UTF-8 | 1,341 | 2.515625 | 3 | [] | no_license | export const TIMELINES_REMOVE_POST = 'TIMELINES/REMOVE_POST'
export const TIMELINES_SET_POSTS = 'TIMELINES/SET_POSTS'
export const TIMELINES_TOGGLE_HAS_MORE = 'TIMELINES/TOGGLE_HAS_MORE'
export const removePost = id => ({
id,
type: TIMELINES_REMOVE_POST
})
export const setPosts = (id, posts) => ({
id,
posts,
... | true |
315d97cccb2bafda7c57f98daf425863c8fb3c0d | JavaScript | caseymeiz/noughts-and-crosses | /ui/render.js | UTF-8 | 5,104 | 2.828125 | 3 | [] | no_license | define(['../constants'],function (constants) {
function Render () {
};
Render.prototype = {
constructor : Render,
build : function (state, winMarks) {
var board = this.makeBoard();
this.populate(board, state, winMarks);
return board;
},
... | true |
2d2409674bdb70f27d6d18b371fb484927320a69 | JavaScript | OmarAvelar/lab-react-ironnutrition | /starter-code/src/App.js | UTF-8 | 2,153 | 2.9375 | 3 | [] | no_license | import React, { Component } from "react";
import logo from "./logo.svg";
import "./App.css";
import foods from "./foods.json";
import FoodBox from "./components/FoodBox/FoodBox";
class App extends Component {
state = {
total: 0,
foods,
selected: []
};
searchFood = e => {
const text = e.target.va... | true |
d5b0097538a80b492918ddd7fd52b53deaa821d6 | JavaScript | leovolving/hospitalert-api | /routes/hospitalizations.js | UTF-8 | 2,059 | 2.546875 | 3 | [] | no_license | 'use strict';
const express = require('express');
const router = express.Router();
const {User, Friend, Hospitalization} = require('../models');
//GET requests
router.get('/:userId', (req, res) => Hospitalization.findAll({
where: {user_id: req.params.userId}
})
.then(hosps => res.json({hospitalizations: hosps.m... | true |